mirror of
https://github.com/friendica/friendica
synced 2025-04-19 06:30:10 +00:00
replace macros
implement new replaceMacros function
This commit is contained in:
parent
f6c86649c2
commit
91facd2d0a
91 changed files with 335 additions and 249 deletions
|
@ -13,6 +13,7 @@ use Friendica\Core\ACL;
|
|||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
|
@ -82,7 +83,7 @@ class Contact extends BaseModule
|
|||
}
|
||||
|
||||
/// @TODO Add nice spaces
|
||||
$vcard_widget = replace_macros(get_markup_template('vcard-widget.tpl'), [
|
||||
$vcard_widget = Renderer::replaceMacros(get_markup_template('vcard-widget.tpl'), [
|
||||
'$name' => htmlentities($contact['name']),
|
||||
'$photo' => $contact['photo'],
|
||||
'$url' => Model\Contact::MagicLink($contact['url']),
|
||||
|
@ -113,7 +114,7 @@ class Contact extends BaseModule
|
|||
$groups_widget = null;
|
||||
}
|
||||
|
||||
$a->page['aside'] .= replace_macros(get_markup_template('contacts-widget-sidebar.tpl'), [
|
||||
$a->page['aside'] .= Renderer::replaceMacros(get_markup_template('contacts-widget-sidebar.tpl'), [
|
||||
'$vcard_widget' => $vcard_widget,
|
||||
'$findpeople_widget' => $findpeople_widget,
|
||||
'$follow_widget' => $follow_widget,
|
||||
|
@ -123,7 +124,7 @@ class Contact extends BaseModule
|
|||
|
||||
$base = $a->getBaseURL();
|
||||
$tpl = get_markup_template('contacts-head.tpl');
|
||||
$a->page['htmlhead'] .= replace_macros($tpl, [
|
||||
$a->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
|
||||
'$baseurl' => System::baseUrl(true),
|
||||
'$base' => $base
|
||||
]);
|
||||
|
@ -438,7 +439,7 @@ class Contact extends BaseModule
|
|||
|
||||
$a->page['aside'] = '';
|
||||
|
||||
return replace_macros(get_markup_template('contact_drop_confirm.tpl'), [
|
||||
return Renderer::replaceMacros(get_markup_template('contact_drop_confirm.tpl'), [
|
||||
'$header' => L10n::t('Drop contact'),
|
||||
'$contact' => self::getContactTemplateVars($orig_record),
|
||||
'$method' => 'get',
|
||||
|
@ -475,7 +476,7 @@ class Contact extends BaseModule
|
|||
$contact_id = $a->data['contact']['id'];
|
||||
$contact = $a->data['contact'];
|
||||
|
||||
$a->page['htmlhead'] .= replace_macros(get_markup_template('contact_head.tpl'), [
|
||||
$a->page['htmlhead'] .= Renderer::replaceMacros(get_markup_template('contact_head.tpl'), [
|
||||
'$baseurl' => $a->getBaseURL(true),
|
||||
]);
|
||||
|
||||
|
@ -592,7 +593,7 @@ class Contact extends BaseModule
|
|||
}
|
||||
|
||||
$tpl = get_markup_template('contact_edit.tpl');
|
||||
$o .= replace_macros($tpl, [
|
||||
$o .= Renderer::replaceMacros($tpl, [
|
||||
'$header' => L10n::t('Contact'),
|
||||
'$tab_str' => $tab_str,
|
||||
'$submit' => L10n::t('Submit'),
|
||||
|
@ -756,7 +757,7 @@ class Contact extends BaseModule
|
|||
];
|
||||
|
||||
$tab_tpl = get_markup_template('common_tabs.tpl');
|
||||
$t = replace_macros($tab_tpl, ['$tabs' => $tabs]);
|
||||
$t = Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs]);
|
||||
|
||||
$total = 0;
|
||||
$searching = false;
|
||||
|
@ -801,7 +802,7 @@ class Contact extends BaseModule
|
|||
}
|
||||
|
||||
$tpl = get_markup_template('contacts-template.tpl');
|
||||
$o .= replace_macros($tpl, [
|
||||
$o .= Renderer::replaceMacros($tpl, [
|
||||
'$baseurl' => System::baseUrl(),
|
||||
'$header' => L10n::t('Contacts') . (($nets) ? ' - ' . ContactSelector::networkToName($nets) : ''),
|
||||
'$tabs' => $t,
|
||||
|
@ -904,7 +905,7 @@ class Contact extends BaseModule
|
|||
}
|
||||
|
||||
$tab_tpl = get_markup_template('common_tabs.tpl');
|
||||
$tab_str = replace_macros($tab_tpl, ['$tabs' => $tabs]);
|
||||
$tab_str = Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs]);
|
||||
|
||||
return $tab_str;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ use Friendica\Database\DBA;
|
|||
use Friendica\Database\DBStructure;
|
||||
use Friendica\Core;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Util\Temporal;
|
||||
|
||||
class Install extends BaseModule
|
||||
|
@ -124,7 +125,7 @@ class Install extends BaseModule
|
|||
$status = self::$installer->checkEnvironment($a->getBaseURL(), $phppath);
|
||||
|
||||
$tpl = get_markup_template('install_checks.tpl');
|
||||
$output .= replace_macros($tpl, [
|
||||
$output .= Renderer::replaceMacros($tpl, [
|
||||
'$title' => $install_title,
|
||||
'$pass' => L10n::t('System check'),
|
||||
'$checks' => self::$installer->getChecks(),
|
||||
|
@ -146,7 +147,7 @@ class Install extends BaseModule
|
|||
$adminmail = notags(trim(defaults($_POST, 'adminmail', '' )));
|
||||
|
||||
$tpl = get_markup_template('install_db.tpl');
|
||||
$output .= replace_macros($tpl, [
|
||||
$output .= Renderer::replaceMacros($tpl, [
|
||||
'$title' => $install_title,
|
||||
'$pass' => L10n::t('Database connection'),
|
||||
'$info_01' => L10n::t('In order to install Friendica we need to know how to connect to your database.'),
|
||||
|
@ -202,7 +203,7 @@ class Install extends BaseModule
|
|||
$lang_choices = L10n::getAvailableLanguages();
|
||||
|
||||
$tpl = get_markup_template('install_settings.tpl');
|
||||
$output .= replace_macros($tpl, [
|
||||
$output .= Renderer::replaceMacros($tpl, [
|
||||
'$title' => $install_title,
|
||||
'$checks' => self::$installer->getChecks(),
|
||||
'$pass' => L10n::t('Site settings'),
|
||||
|
@ -233,7 +234,7 @@ class Install extends BaseModule
|
|||
}
|
||||
|
||||
$tpl = get_markup_template('install_finished.tpl');
|
||||
$output .= replace_macros($tpl, [
|
||||
$output .= Renderer::replaceMacros($tpl, [
|
||||
'$title' => $install_title,
|
||||
'$checks' => self::$installer->getChecks(),
|
||||
'$pass' => L10n::t('Installation finished'),
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Model;
|
||||
|
||||
/**
|
||||
|
@ -28,7 +29,7 @@ class Itemsource extends \Friendica\BaseModule
|
|||
}
|
||||
|
||||
$tpl = get_markup_template('debug/itemsource.tpl');
|
||||
$o = replace_macros($tpl, [
|
||||
$o = Renderer::replaceMacros($tpl, [
|
||||
'$guid' => ['guid', L10n::t('Item Guid'), htmlentities(defaults($_REQUEST, 'guid', '')), ''],
|
||||
'$source' => $source,
|
||||
'$item_uri' => $item_uri
|
||||
|
|
|
@ -11,6 +11,7 @@ use Friendica\Core\Authentication;
|
|||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Model\User;
|
||||
|
@ -301,7 +302,7 @@ class Login extends BaseModule
|
|||
if (local_user()) {
|
||||
$tpl = get_markup_template('logout.tpl');
|
||||
} else {
|
||||
$a->page['htmlhead'] .= replace_macros(
|
||||
$a->page['htmlhead'] .= Renderer::replaceMacros(
|
||||
get_markup_template('login_head.tpl'),
|
||||
[
|
||||
'$baseurl' => $a->getBaseURL(true)
|
||||
|
@ -312,7 +313,7 @@ class Login extends BaseModule
|
|||
$_SESSION['return_path'] = $return_path;
|
||||
}
|
||||
|
||||
$o .= replace_macros(
|
||||
$o .= Renderer::replaceMacros(
|
||||
$tpl,
|
||||
[
|
||||
'$dest_url' => self::getApp()->getBaseURL(true) . '/login',
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace Friendica\Module;
|
|||
use Friendica\BaseModule;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
|
||||
|
@ -66,7 +67,7 @@ class Tos extends BaseModule
|
|||
public static function content() {
|
||||
$tpl = get_markup_template('tos.tpl');
|
||||
if (Config::get('system', 'tosdisplay')) {
|
||||
return replace_macros($tpl, [
|
||||
return Renderer::replaceMacros($tpl, [
|
||||
'$title' => L10n::t('Terms of Service'),
|
||||
'$tostext' => BBCode::convert(Config::get('system', 'tostext')),
|
||||
'$displayprivstatement' => Config::get('system', 'tosprivstatement'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue