]> git.mxchange.org Git - friendica.git/commitdiff
replace macros
authorAdam Magness <adam.magness@gmail.com>
Wed, 31 Oct 2018 14:35:50 +0000 (10:35 -0400)
committerAdam Magness <adam.magness@gmail.com>
Wed, 31 Oct 2018 14:35:50 +0000 (10:35 -0400)
implement new replaceMacros function

91 files changed:
doc/Addons.md
doc/smarty3-templates.md
include/conversation.php
include/enotify.php
include/items.php
include/text.php
mod/admin.php
mod/allfriends.php
mod/api.php
mod/apps.php
mod/babel.php
mod/cal.php
mod/common.php
mod/community.php
mod/credits.php
mod/crepair.php
mod/delegate.php
mod/dfrn_request.php
mod/directory.php
mod/dirfind.php
mod/display.php
mod/editpost.php
mod/events.php
mod/fbrowser.php
mod/feedtest.php
mod/filer.php
mod/follow.php
mod/group.php
mod/help.php
mod/home.php
mod/hostxrd.php
mod/hovercard.php
mod/invite.php
mod/lostpass.php
mod/maintenance.php
mod/manage.php
mod/manifest.php
mod/match.php
mod/message.php
mod/network.php
mod/notifications.php
mod/notify.php
mod/oexchange.php
mod/opensearch.php
mod/photos.php
mod/poco.php
mod/poke.php
mod/profile_photo.php
mod/profiles.php
mod/register.php
mod/removeme.php
mod/search.php
mod/settings.php
mod/suggest.php
mod/uexport.php
mod/uimport.php
mod/unfollow.php
mod/videos.php
mod/viewcontacts.php
mod/wallmessage.php
mod/xrd.php
src/App.php
src/Content/ForumManager.php
src/Content/Nav.php
src/Content/OEmbed.php
src/Content/Pager.php
src/Content/Text/BBCode.php
src/Content/Widget.php
src/Content/Widget/CalendarExport.php
src/Content/Widget/TagCloud.php
src/Core/ACL.php
src/Core/Installer.php
src/Core/Renderer.php
src/Core/System.php
src/Model/Event.php
src/Model/Group.php
src/Model/Profile.php
src/Module/Contact.php
src/Module/Install.php
src/Module/Itemsource.php
src/Module/Login.php
src/Module/Tos.php
src/Object/Post.php
src/Util/Temporal.php
util/README
view/theme/duepuntozero/config.php
view/theme/frio/config.php
view/theme/quattro/config.php
view/theme/smoothly/theme.php
view/theme/vier/config.php
view/theme/vier/theme.php

index f7dfcc870c72ca56a877df3503969ec37e743694..cc5ea8d73e64fdeb11318179528b31376bd35d76 100644 (file)
@@ -164,7 +164,7 @@ $tpl = get_markup_template('mytemplate.tpl', 'addon/addon_name/');
 
 # apply template. first argument is the loaded template,
 # second an array of 'name' => 'values' to pass to template
-$output = replace_macros($tpl, array(
+$output = Renderer::replaceMacros($tpl, array(
        'title' => 'My beautiful addon',
 ));
 ```
index d44f263255fcece30edb561288355cfab92f28a5..6d53199f8c871598b83347b47c9fef108ecb358f 100644 (file)
@@ -20,10 +20,10 @@ Templates that are only used by addons shall be placed in the
 
 directory.
 
-To render a template use the function *get_markup_template* to load the template and *replace_macros* to replace the macros/variables in the just loaded template file.
+To render a template use the function *getMarkupTemplate* to load the template and *replaceMacros* to replace the macros/variables in the just loaded template file.
 
                $tpl = get_markup_template('install_settings.tpl');
-        $o .= replace_macros($tpl, array( ... ));
+        $o .= Renderer::replaceMacros($tpl, array( ... ));
 
 the array consists of an association of an identifier and the value for that identifier, i.e.
 
index 8317746dd3a39c1a91ae13cf99a3ec66b81379b8..45f5607bd0e46a6e25f703df352d3cd1fc5a3ec3 100644 (file)
@@ -14,6 +14,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\PConfig;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -758,7 +759,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
                }
        }
 
-       $o = replace_macros($page_template, [
+       $o = Renderer::replaceMacros($page_template, [
                '$baseurl' => System::baseUrl($ssl_state),
                '$return_path' => $a->query_string,
                '$live_update' => $live_update_div,
@@ -1062,7 +1063,7 @@ function format_like($cnt, array $arr, $type, $id) {
        }
 
        $phrase .= EOL ;
-       $o .= replace_macros(get_markup_template('voting_fakelink.tpl'), [
+       $o .= Renderer::replaceMacros(get_markup_template('voting_fakelink.tpl'), [
                '$phrase' => $phrase,
                '$type' => $type,
                '$id' => $id
@@ -1076,10 +1077,10 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
 {
        $o = '';
 
-       $geotag = x($x, 'allow_location') ? replace_macros(get_markup_template('jot_geotag.tpl'), []) : '';
+       $geotag = x($x, 'allow_location') ? Renderer::replaceMacros(get_markup_template('jot_geotag.tpl'), []) : '';
 
        $tpl = get_markup_template('jot-header.tpl');
-       $a->page['htmlhead'] .= replace_macros($tpl, [
+       $a->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
                '$newpost'   => 'true',
                '$baseurl'   => System::baseUrl(true),
                '$geotag'    => $geotag,
@@ -1117,10 +1118,10 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
                $public_post_link = '&public=1';
        }
 
-       // $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
+       // $tpl = Renderer::replaceMacros($tpl,array('$jotplugins' => $jotplugins));
        $tpl = get_markup_template("jot.tpl");
 
-       $o .= replace_macros($tpl,[
+       $o .= Renderer::replaceMacros($tpl,[
                '$new_post' => L10n::t('New Post'),
                '$return_path'  => $query_str,
                '$action'       => 'item',
index bc9a7b9b0e6b6028ab9585131270a5a8c28e3fd2..cf8b195deb9a055eb5d6589a422d4b519c9b4ef3 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\Core\Addon;
 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\Contact;
@@ -517,7 +518,7 @@ function notification($params)
                }
 
                $itemlink = System::baseUrl().'/notify/view/'.$notify_id;
-               $msg = replace_macros($epreamble, ['$itemlink' => $itemlink]);
+               $msg = Renderer::replaceMacros($epreamble, ['$itemlink' => $itemlink]);
                $msg_cache = format_notification_message($datarray['name_cache'], strip_tags(BBCode::convert($msg)));
 
                $fields = ['msg' => $msg, 'msg_cache' => $msg_cache];
@@ -590,7 +591,7 @@ function notification($params)
 
                // load the template for private message notifications
                $tpl = get_markup_template('email_notify_html.tpl');
-               $email_html_body = replace_macros($tpl, [
+               $email_html_body = Renderer::replaceMacros($tpl, [
                        '$banner'       => $datarray['banner'],
                        '$product'      => $datarray['product'],
                        '$preamble'     => str_replace("\n", "<br>\n", $datarray['preamble']),
@@ -611,7 +612,7 @@ function notification($params)
 
                // load the template for private message notifications
                $tpl = get_markup_template('email_notify_text.tpl');
-               $email_text_body = replace_macros($tpl, [
+               $email_text_body = Renderer::replaceMacros($tpl, [
                        '$banner'       => $datarray['banner'],
                        '$product'      => $datarray['product'],
                        '$preamble'     => $datarray['preamble'],
index 104547ab831137cbf75fd50ab95e98b81f01a4ed..ff9559b2879b9ea5dbcaf090dd1a52429b6024d2 100644 (file)
@@ -11,6 +11,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\PConfig;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Item;
@@ -390,7 +391,7 @@ function drop_item($id)
                                }
                        }
 
-                       return replace_macros(get_markup_template('confirm.tpl'), [
+                       return Renderer::replaceMacros(get_markup_template('confirm.tpl'), [
                                '$method' => 'get',
                                '$message' => L10n::t('Do you really want to delete this item?'),
                                '$extra_inputs' => $inputs,
@@ -481,7 +482,7 @@ function posted_date_widget($url, $uid, $wall)
        $cutoff_year = intval(DateTimeFormat::localNow('Y')) - $visible_years;
        $cutoff = ((array_key_exists($cutoff_year, $ret))? true : false);
 
-       $o = replace_macros(get_markup_template('posted_date_widget.tpl'),[
+       $o = Renderer::replaceMacros(get_markup_template('posted_date_widget.tpl'),[
                '$title' => L10n::t('Archives'),
                '$size' => $visible_years,
                '$cutoff_year' => $cutoff_year,
index 0c2ea61de9b9f298f4f2d18d24503aef71dcf5ae..d5c2ee961a974c02a62b7ac1ea8bb813f4ea76d8 100644 (file)
@@ -267,7 +267,7 @@ function unxmlify($s) {
  */
 function scroll_loader() {
        $tpl = get_markup_template("scroll_loader.tpl");
-       return replace_macros($tpl, [
+       return Renderer::replaceMacros($tpl, [
                'wait' => L10n::t('Loading more entries...'),
                'end' => L10n::t('The end')
        ]);
@@ -514,7 +514,7 @@ function contact_block() {
        }
 
        $tpl = get_markup_template('contact_block.tpl');
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$contacts' => $contacts,
                '$nickname' => $a->profile['nickname'],
                '$viewcontacts' => L10n::t('View Contacts'),
@@ -571,7 +571,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
                $url = '';
        }
 
-       return replace_macros(get_markup_template(($textmode)?'micropro_txt.tpl':'micropro_img.tpl'),[
+       return Renderer::replaceMacros(get_markup_template(($textmode)?'micropro_txt.tpl':'micropro_img.tpl'),[
                '$click' => defaults($contact, 'click', ''),
                '$class' => $class,
                '$url' => $url,
@@ -626,7 +626,7 @@ function search($s, $id = 'search-box', $url = 'search', $save = false, $aside =
                }
        }
 
-       return replace_macros(get_markup_template('searchbox.tpl'), $values);
+       return Renderer::replaceMacros(get_markup_template('searchbox.tpl'), $values);
 }
 
 /**
@@ -904,14 +904,14 @@ function prepare_body(array &$item, $attach = false, $is_preview = false)
                if (strpos($mime, 'video') !== false) {
                        if (!$vhead) {
                                $vhead = true;
-                               $a->page['htmlhead'] .= replace_macros(get_markup_template('videos_head.tpl'), [
+                               $a->page['htmlhead'] .= Renderer::replaceMacros(get_markup_template('videos_head.tpl'), [
                                        '$baseurl' => System::baseUrl(),
                                ]);
                        }
 
                        $url_parts = explode('/', $the_url);
                        $id = end($url_parts);
-                       $as .= replace_macros(get_markup_template('video_top.tpl'), [
+                       $as .= Renderer::replaceMacros(get_markup_template('video_top.tpl'), [
                                '$video' => [
                                        'id'     => $id,
                                        'title'  => L10n::t('View Video'),
@@ -1007,7 +1007,7 @@ function apply_content_filter($html, array $reasons)
 {
        if (count($reasons)) {
                $tpl = get_markup_template('wall/content_filter.tpl');
-               $html = replace_macros($tpl, [
+               $html = Renderer::replaceMacros($tpl, [
                        '$reasons'   => $reasons,
                        '$rnd'       => random_string(8),
                        '$openclose' => L10n::t('Click to open/close'),
index d4cbafe54bc99919feea859c52576eac3ca73182..dce65c2fcca2ae536b5c757c6980cb295e35cd01 100644 (file)
@@ -14,6 +14,7 @@ use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Theme;
 use Friendica\Core\Worker;
@@ -174,7 +175,7 @@ function admin_content(App $a)
        //      apc_delete($toDelete);
        //}
        // Header stuff
-       $a->page['htmlhead'] .= replace_macros(get_markup_template('admin/settings_head.tpl'), []);
+       $a->page['htmlhead'] .= Renderer::replaceMacros(get_markup_template('admin/settings_head.tpl'), []);
 
        /*
         * Side bar links
@@ -226,7 +227,7 @@ function admin_content(App $a)
        }
 
        $t = get_markup_template('admin/aside.tpl');
-       $a->page['aside'] .= replace_macros($t, [
+       $a->page['aside'] .= Renderer::replaceMacros($t, [
                '$admin' => $aside_tools,
                '$subpages' => $aside_sub,
                '$admtxt' => L10n::t('Admin'),
@@ -314,7 +315,7 @@ function admin_page_tos(App $a)
 {
        $tos = new Tos();
        $t = get_markup_template('admin/tos.tpl');
-       return replace_macros($t, [
+       return Renderer::replaceMacros($t, [
                '$title' => L10n::t('Administration'),
                '$page' => L10n::t('Terms of Service'),
                '$displaytos' => ['displaytos', L10n::t('Display Terms of Service'), Config::get('system', 'tosdisplay'), L10n::t('Enable the Terms of Service page. If this is enabled a link to the terms will be added to the registration form and the general information page.')],
@@ -376,7 +377,7 @@ function admin_page_blocklist(App $a)
                }
        }
        $t = get_markup_template('admin/blocklist.tpl');
-       return replace_macros($t, [
+       return Renderer::replaceMacros($t, [
                '$title' => L10n::t('Administration'),
                '$page' => L10n::t('Server Blocklist'),
                '$intro' => L10n::t('This page can be used to define a black list of servers from the federated network that are not allowed to interact with your node. For all entered domains you should also give a reason why you have blocked the remote server.'),
@@ -491,7 +492,7 @@ function admin_page_contactblock(App $a)
        $contacts = DBA::toArray($statement);
 
        $t = get_markup_template('admin/contactblock.tpl');
-       $o = replace_macros($t, [
+       $o = Renderer::replaceMacros($t, [
                // strings //
                '$title'       => L10n::t('Administration'),
                '$page'        => L10n::t('Remote Contact Blocklist'),
@@ -534,7 +535,7 @@ function admin_page_deleteitem(App $a)
 {
        $t = get_markup_template('admin/deleteitem.tpl');
 
-       return replace_macros($t, [
+       return Renderer::replaceMacros($t, [
                '$title' => L10n::t('Administration'),
                '$page' => L10n::t('Delete Item'),
                '$submit' => L10n::t('Delete this Item'),
@@ -726,7 +727,7 @@ function admin_page_federation(App $a)
 
        // load the template, replace the macros and return the page content
        $t = get_markup_template('admin/federation.tpl');
-       return replace_macros($t, [
+       return Renderer::replaceMacros($t, [
                '$title' => L10n::t('Administration'),
                '$page' => L10n::t('Federation Statistics'),
                '$intro' => $intro,
@@ -769,7 +770,7 @@ function admin_page_queue(App $a)
        DBA::close($entries);
 
        $t = get_markup_template('admin/queue.tpl');
-       return replace_macros($t, [
+       return Renderer::replaceMacros($t, [
                '$title' => L10n::t('Administration'),
                '$page' => L10n::t('Inspect Queue'),
                '$count' => count($r),
@@ -820,7 +821,7 @@ function admin_page_workerqueue(App $a, $deferred)
        DBA::close($entries);
 
        $t = get_markup_template('admin/workerqueue.tpl');
-       return replace_macros($t, [
+       return Renderer::replaceMacros($t, [
                '$title' => L10n::t('Administration'),
                '$page' => $sub_title,
                '$count' => count($r),
@@ -938,7 +939,7 @@ function admin_page_summary(App $a)
                                'mysql' => ['max_allowed_packet' => $max_allowed_packet]];
 
        $t = get_markup_template('admin/summary.tpl');
-       return replace_macros($t, [
+       return Renderer::replaceMacros($t, [
                '$title' => L10n::t('Administration'),
                '$page' => L10n::t('Summary'),
                '$queues' => $queues,
@@ -1449,7 +1450,7 @@ function admin_page_site(App $a)
        }
 
        $t = get_markup_template('admin/site.tpl');
-       return replace_macros($t, [
+       return Renderer::replaceMacros($t, [
                '$title' => L10n::t('Administration'),
                '$page' => L10n::t('Site'),
                '$submit' => L10n::t('Save Settings'),
@@ -1642,13 +1643,13 @@ function admin_page_dbsync(App $a)
        }
 
        if (!count($failed)) {
-               $o = replace_macros(get_markup_template('structure_check.tpl'), [
+               $o = Renderer::replaceMacros(get_markup_template('structure_check.tpl'), [
                        '$base' => System::baseUrl(true),
                        '$banner' => L10n::t('No failed updates.'),
                        '$check' => L10n::t('Check database structure'),
                ]);
        } else {
-               $o = replace_macros(get_markup_template('failed_updates.tpl'), [
+               $o = Renderer::replaceMacros(get_markup_template('failed_updates.tpl'), [
                        '$base' => System::baseUrl(true),
                        '$banner' => L10n::t('Failed Updates'),
                        '$desc' => L10n::t('This does not include updates prior to 1139, which did not return a status.'),
@@ -1910,7 +1911,7 @@ function admin_page_users(App $a)
        $th_users = array_map(null, [L10n::t('Name'), L10n::t('Email'), L10n::t('Register date'), L10n::t('Last login'), L10n::t('Last item'), L10n::t('Type')], $valid_orders);
 
        $t = get_markup_template('admin/users.tpl');
-       $o = replace_macros($t, [
+       $o = Renderer::replaceMacros($t, [
                // strings //
                '$title' => L10n::t('Administration'),
                '$page' => L10n::t('Users'),
@@ -2027,7 +2028,7 @@ function admin_page_addons(App $a, array $addons_admin)
 
                $t = get_markup_template('admin/addon_details.tpl');
 
-               return replace_macros($t, [
+               return Renderer::replaceMacros($t, [
                        '$title' => L10n::t('Administration'),
                        '$page' => L10n::t('Addons'),
                        '$toggle' => L10n::t('Toggle'),
@@ -2087,7 +2088,7 @@ function admin_page_addons(App $a, array $addons_admin)
        }
 
        $t = get_markup_template('admin/addons.tpl');
-       return replace_macros($t, [
+       return Renderer::replaceMacros($t, [
                '$title' => L10n::t('Administration'),
                '$page' => L10n::t('Addons'),
                '$submit' => L10n::t('Save Settings'),
@@ -2297,7 +2298,7 @@ function admin_page_themes(App $a)
                }
 
                $t = get_markup_template('admin/addon_details.tpl');
-               return replace_macros($t, [
+               return Renderer::replaceMacros($t, [
                        '$title' => L10n::t('Administration'),
                        '$page' => L10n::t('Themes'),
                        '$toggle' => L10n::t('Toggle'),
@@ -2341,7 +2342,7 @@ function admin_page_themes(App $a)
        }
 
        $t = get_markup_template('admin/addons.tpl');
-       return replace_macros($t, [
+       return Renderer::replaceMacros($t, [
                '$title'               => L10n::t('Administration'),
                '$page'                => L10n::t('Themes'),
                '$submit'              => L10n::t('Save Settings'),
@@ -2416,7 +2417,7 @@ function admin_page_logs(App $a)
 
        $t = get_markup_template('admin/logs.tpl');
 
-       return replace_macros($t, [
+       return Renderer::replaceMacros($t, [
                '$title' => L10n::t('Administration'),
                '$page' => L10n::t('Logs'),
                '$submit' => L10n::t('Save Settings'),
@@ -2483,7 +2484,7 @@ function admin_page_viewlogs(App $a)
                        fclose($fp);
                }
        }
-       return replace_macros($t, [
+       return Renderer::replaceMacros($t, [
                '$title' => L10n::t('Administration'),
                '$page' => L10n::t('View Logs'),
                '$data' => $data,
@@ -2562,7 +2563,7 @@ function admin_page_features(App $a)
                }
 
                $tpl = get_markup_template('admin/settings_features.tpl');
-               $o = replace_macros($tpl, [
+               $o = Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseModule::getFormSecurityToken("admin_manage_features"),
                        '$title' => L10n::t('Manage Additional Features'),
                        '$features' => $arr,
index 83ea73af6b97222890bbd3395fa79a99cbff9070..5f368220b7871960837ccda5af5b2017f43bc143 100644 (file)
@@ -7,6 +7,7 @@ use Friendica\App;
 use Friendica\Content\ContactSelector;
 use Friendica\Content\Pager;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model;
@@ -100,7 +101,7 @@ function allfriends_content(App $a)
 
        $tpl = get_markup_template('viewcontact_template.tpl');
 
-       $o .= replace_macros($tpl, [
+       $o .= Renderer::replaceMacros($tpl, [
                //'$title' => L10n::t('Friends of %s', htmlentities($c[0]['name'])),
                '$tab_str' => $tab_str,
                '$contacts' => $entries,
index 716b484461aeff250e902a856a040da6e1ddbec7..e81633531b748888c152749317caba85f4c27410 100644 (file)
@@ -5,6 +5,7 @@
 use Friendica\App;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Module\Login;
@@ -82,7 +83,7 @@ function api_content(App $a)
                        }
 
                        $tpl = get_markup_template("oauth_authorize_done.tpl");
-                       $o = replace_macros($tpl, [
+                       $o = Renderer::replaceMacros($tpl, [
                                '$title' => L10n::t('Authorize application connection'),
                                '$info' => L10n::t('Return to your app and insert this Securty Code:'),
                                '$code' => $verifier,
@@ -104,7 +105,7 @@ function api_content(App $a)
                }
 
                $tpl = get_markup_template('oauth_authorize.tpl');
-               $o = replace_macros($tpl, [
+               $o = Renderer::replaceMacros($tpl, [
                        '$title' => L10n::t('Authorize application connection'),
                        '$app' => $app,
                        '$authorize' => L10n::t('Do you want to authorize this application to access your posts and contacts, and/or create new posts for you?'),
index 80138f78dc9654d1c959dfcd0f9614d38e790c82..5fd00462ed41f1d5ac29462cfa7e73a203ff08f6 100644 (file)
@@ -5,6 +5,7 @@
 use Friendica\Content\Nav;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 
 function apps_content()
 {
@@ -25,7 +26,7 @@ function apps_content()
        }
 
        $tpl = get_markup_template('apps.tpl');
-       return replace_macros($tpl, [
+       return Renderer::replaceMacros($tpl, [
                '$title' => $title,
                '$apps'  => $apps,
        ]);
index 65287b9f2b590eeeabdf66c36d797998170edb59..6a6e084a05450a3754d199bf8984ce66bf5ac1e3 100644 (file)
@@ -5,6 +5,7 @@
 
 use Friendica\Content\Text;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 
 function visible_whitespace($s)
 {
@@ -140,7 +141,7 @@ function babel_content()
        }
 
        $tpl = get_markup_template('babel.tpl');
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$text'          => ['text', L10n::t('Source text'), htmlentities(defaults($_REQUEST, 'text', '')), ''],
                '$type_bbcode'   => ['type', L10n::t('BBCode'), 'bbcode', '', defaults($_REQUEST, 'type', 'bbcode') == 'bbcode'],
                '$type_markdown' => ['type', L10n::t('Markdown'), 'markdown', '', defaults($_REQUEST, 'type', 'bbcode') == 'markdown'],
index 6f483acc163478853847b72c36b343bccb0117d4..f9e4b3fdfe5387c212f7aa7615dadd6603bbe34e 100644 (file)
@@ -12,6 +12,7 @@ use Friendica\Content\Nav;
 use Friendica\Content\Widget;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -61,7 +62,7 @@ function cal_init(App $a)
 
        $tpl = get_markup_template("vcard-widget.tpl");
 
-       $vcard_widget = replace_macros($tpl, [
+       $vcard_widget = Renderer::replaceMacros($tpl, [
                '$name' => $profile['name'],
                '$photo' => $profile['photo'],
                '$addr' => (($profile['addr'] != "") ? $profile['addr'] : ""),
@@ -89,7 +90,7 @@ function cal_content(App $a)
        $i18n = Event::getStrings();
 
        $htpl = get_markup_template('event_head.tpl');
-       $a->page['htmlhead'] .= replace_macros($htpl, [
+       $a->page['htmlhead'] .= Renderer::replaceMacros($htpl, [
                '$baseurl' => System::baseUrl(),
                '$module_url' => '/cal/' . $a->data['user']['nickname'],
                '$modparams' => 2,
@@ -267,7 +268,7 @@ function cal_content(App $a)
                        $events[$key]['item'] = $event_item;
                }
 
-               $o = replace_macros($tpl, [
+               $o = Renderer::replaceMacros($tpl, [
                        '$baseurl' => System::baseUrl(),
                        '$tabs' => $tabs,
                        '$title' => L10n::t('Events'),
index 8fb19b57cdbac15675121b57c3a4b93879f836c8..0a84dc56cd89d1e7691dbdf88634b2c22b6e95a6 100644 (file)
@@ -7,6 +7,7 @@ use Friendica\App;
 use Friendica\Content\ContactSelector;
 use Friendica\Content\Pager;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\Model;
 use Friendica\Module;
@@ -48,7 +49,7 @@ function common_content(App $a)
                $contact = DBA::selectFirst('contact', ['name', 'url', 'photo', 'uid', 'id'], ['self' => true, 'uid' => $uid]);
 
                if (DBA::isResult($contact)) {
-                       $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'    => 'contact/' . $cid
@@ -144,7 +145,7 @@ function common_content(App $a)
 
        $tpl = get_markup_template('viewcontact_template.tpl');
 
-       $o .= replace_macros($tpl, [
+       $o .= Renderer::replaceMacros($tpl, [
                '$title'    => $title,
                '$tab_str'  => $tab_str,
                '$contacts' => $entries,
index 1017698eaa5c134f5f5f24115f4f9f68070f8fc1..a85a79c05106a4dc54e8dcde1b6e032b7374bcc5 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\Core\ACL;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\Item;
@@ -120,7 +121,7 @@ function community_content(App $a, $update = 0)
                }
 
                $tab_tpl = get_markup_template('common_tabs.tpl');
-               $o .= replace_macros($tab_tpl, ['$tabs' => $tabs]);
+               $o .= Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs]);
 
                Nav::setSelected('community');
 
@@ -199,7 +200,7 @@ function community_content(App $a, $update = 0)
        }
 
        $t = get_markup_template("community.tpl");
-       return replace_macros($t, [
+       return Renderer::replaceMacros($t, [
                '$content' => $o,
                '$header' => '',
                '$show_global_community_hint' => ($content == 'global') && Config::get('system', 'show_global_community_hint'),
index 880b4b34c4cdbaab87a18a9c1383340ef51d32ab..42894484a91ce148efde5eb81947fff395af7c60 100644 (file)
@@ -7,6 +7,7 @@
  */
 use Friendica\App;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 
 function credits_content()
 {
@@ -14,7 +15,7 @@ function credits_content()
        $credits_string = file_get_contents('util/credits.txt');
        $names = explode("\n", htmlspecialchars($credits_string));
        $tpl = get_markup_template('credits.tpl');
-       return replace_macros($tpl, [
+       return Renderer::replaceMacros($tpl, [
                '$title'  => L10n::t('Credits'),
                '$thanks' => L10n::t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'),
                '$names'  => $names,
index 1ca04af50dc2bce40e2e56ba1d2ac03228a2a702..7c8761a54a4cdd589ed97d8fa67da41f413781e0 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\Model;
 use Friendica\Module;
@@ -137,7 +138,7 @@ function crepair_content(App $a)
        $tab_str = Module\Contact::getTabsHTML($a, $contact, 5);
 
        $tpl = get_markup_template('crepair.tpl');
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$tab_str'        => $tab_str,
                '$warning'        => $warning,
                '$info'           => $info,
index e38ce058e57305d4eca69a7f484e54a59b3baf2e..bd21bb2ee6605a6da190611db181fd7eae573e87 100644 (file)
@@ -7,6 +7,7 @@ use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Core\L10n;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\User;
@@ -163,7 +164,7 @@ function delegate_content(App $a)
                $parent_password = ['parent_password', L10n::t('Parent Password:'), '', L10n::t('Please enter the password of the parent account to legitimize your request.')];
        }
 
-       $o = replace_macros(get_markup_template('delegate.tpl'), [
+       $o = Renderer::replaceMacros(get_markup_template('delegate.tpl'), [
                '$form_security_token' => BaseModule::getFormSecurityToken('delegate'),
                '$parent_header' => L10n::t('Parent User'),
                '$parent_user' => $parent_user,
index 674248be2292457859accc94d63c22d6d7347bc0..65b0b2ed3ecf39e9c6ba6965df4c4449c782e6d1 100644 (file)
@@ -17,6 +17,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -515,7 +516,7 @@ function dfrn_request_content(App $a)
                }
 
                $tpl = get_markup_template("dfrn_req_confirm.tpl");
-               $o = replace_macros($tpl, [
+               $o = Renderer::replaceMacros($tpl, [
                        '$dfrn_url' => $dfrn_url,
                        '$aes_allow' => (($aes_allow) ? '<input type="hidden" name="aes_allow" value="1" />' : "" ),
                        '$hidethem' => L10n::t('Hide this contact'),
@@ -639,7 +640,7 @@ function dfrn_request_content(App $a)
                        get_server() . '/servers'
                );
 
-               $o = replace_macros($tpl, [
+               $o = Renderer::replaceMacros($tpl, [
                        '$header' => L10n::t('Friend/Connection Request'),
                        '$desc' => L10n::t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de'),
                        '$pls_answer' => L10n::t('Please answer the following:'),
index 6c8be7c3c5da26587de1f35753114299abe330e3..6f6348103d71847dc89fa6f4ead0b25718644a7a 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\Content\Widget;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\Profile;
@@ -203,7 +204,7 @@ function directory_content(App $a)
 
                $tpl = get_markup_template('directory_header.tpl');
 
-               $o .= replace_macros($tpl, [
+               $o .= Renderer::replaceMacros($tpl, [
                        '$search'    => $search,
                        '$globaldir' => L10n::t('Global Directory'),
                        '$gdirpath'  => $gdirpath,
index 5d7815bd808836bacc326082944c5cb7bfa59ebf..4c38a2dbdcf28bc58b7cf39c3f06a2db879a5383 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\Content\Widget;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
@@ -250,7 +251,7 @@ function dirfind_content(App $a, $prefix = "") {
                        }
 
                        $tpl = get_markup_template('viewcontact_template.tpl');
-                       $o .= replace_macros($tpl,[
+                       $o .= Renderer::replaceMacros($tpl,[
                                'title' => $header,
                                '$contacts' => $entries,
                                '$paginate' => $pager->renderFull($j->total),
index d95404a5b135ead15ce714a898b5b19525ba3599..b6577b00814fb927e66ae558906345bd1845b118 100644 (file)
@@ -12,6 +12,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -263,7 +264,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
                $conversation = '';
        }
 
-       $a->page['htmlhead'] .= replace_macros(get_markup_template('display-head.tpl'),
+       $a->page['htmlhead'] .= Renderer::replaceMacros(get_markup_template('display-head.tpl'),
                                ['$alternate' => $alternate,
                                        '$conversation' => $conversation]);
 
index 83fcdca56627287114b38f44c2d49ba5078dad32..fe1e5842effc9f7502452a7242d14872e3568314 100644 (file)
@@ -7,6 +7,7 @@ use Friendica\Content\Feature;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendcia\Model\FileTag;
 use Friendica\Model\Item;
@@ -40,12 +41,12 @@ function editpost_content(App $a)
 
        $geotag = '';
 
-       $o .= replace_macros(get_markup_template("section_title.tpl"), [
+       $o .= Renderer::replaceMacros(get_markup_template("section_title.tpl"), [
                '$title' => L10n::t('Edit post')
        ]);
 
        $tpl = get_markup_template('jot-header.tpl');
-       $a->page['htmlhead'] .= replace_macros($tpl, [
+       $a->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
                '$baseurl' => System::baseUrl(),
                '$ispublic' => '&nbsp;', // L10n::t('Visible to <strong>everybody</strong>'),
                '$geotag' => $geotag,
@@ -85,7 +86,7 @@ function editpost_content(App $a)
        Addon::callHooks('jot_tool', $jotplugins);
        //Addon::callHooks('jot_networks', $jotnets);
 
-       $o .= replace_macros($tpl, [
+       $o .= Renderer::replaceMacros($tpl, [
                '$is_edit' => true,
                '$return_path' => '/display/' . $item['guid'],
                '$action' => 'item',
index a13080a8e306b361ff861c7bec0d916cbd42b795..932f9acfa7ba58680801e2419f5cf0c0734c44a6 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\Content\Widget\CalendarExport;
 use Friendica\Core\ACL;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
@@ -226,7 +227,7 @@ function events_content(App $a)
        $i18n = Event::getStrings();
 
        $htpl = get_markup_template('event_head.tpl');
-       $a->page['htmlhead'] .= replace_macros($htpl, [
+       $a->page['htmlhead'] .= Renderer::replaceMacros($htpl, [
                '$baseurl' => System::baseUrl(),
                '$module_url' => '/events',
                '$modparams' => 1,
@@ -382,7 +383,7 @@ function events_content(App $a)
                        $events[$key]['item'] = $event_item;
                }
 
-               $o = replace_macros($tpl, [
+               $o = Renderer::replaceMacros($tpl, [
                        '$baseurl'   => System::baseUrl(),
                        '$tabs'      => $tabs,
                        '$title'     => L10n::t('Events'),
@@ -499,7 +500,7 @@ function events_content(App $a)
 
                $tpl = get_markup_template('event_form.tpl');
 
-               $o .= replace_macros($tpl, [
+               $o .= Renderer::replaceMacros($tpl, [
                        '$post' => System::baseUrl() . '/events',
                        '$eid'  => $eid,
                        '$cid'  => $cid,
index 3839bcc1cdef93749db9270798dea249ac4839a5..e1e4dc572f697820d3aee95c4946cef5a218cc12 100644 (file)
@@ -7,6 +7,7 @@
 
 use Friendica\App;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Object\Image;
@@ -95,7 +96,7 @@ function fbrowser_content(App $a)
 
                        $tpl = get_markup_template($template_file);
 
-                       $o =  replace_macros($tpl, [
+                       $o =  Renderer::replaceMacros($tpl, [
                                '$type'     => 'image',
                                '$baseurl'  => System::baseUrl(),
                                '$path'     => $path,
@@ -126,7 +127,7 @@ function fbrowser_content(App $a)
 
 
                                $tpl = get_markup_template($template_file);
-                               $o = replace_macros($tpl, [
+                               $o = Renderer::replaceMacros($tpl, [
                                        '$type'     => 'file',
                                        '$baseurl'  => System::baseUrl(),
                                        '$path'     => [ [ "", L10n::t("Files")] ],
index e75e7a1b8ec3cafebfdd9c814f40507e3fa9cb48..a284c4115ac2b6a259463ed4d3986735f540360c 100644 (file)
@@ -6,6 +6,7 @@
 
 use Friendica\App;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Protocol\Feed;
@@ -44,7 +45,7 @@ function feedtest_content(App $a)
        }
 
        $tpl = get_markup_template('feedtest.tpl');
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$url'    => ['url', L10n::t('Source URL'), defaults($_REQUEST, 'url', ''), ''],
                '$result' => $result
        ]);
index 050fa70633eea4b3eeaa8152a267eb35817ecfe5..f4e90d60357c587f2eab88def88699b57a0a2c10 100644 (file)
@@ -6,6 +6,7 @@ use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
 use Friendica\Model\FileTag;
 
 require_once 'include/items.php';
@@ -31,7 +32,7 @@ function filer_content(App $a)
                $filetags = explode(",", $filetags);
 
                $tpl = get_markup_template("filer_dialog.tpl");
-               $o = replace_macros($tpl, [
+               $o = Renderer::replaceMacros($tpl, [
                        '$field' => ['term', L10n::t("Save to Folder:"), '', '', $filetags, L10n::t('- select -')],
                        '$submit' => L10n::t('Save'),
                ]);
index adc3fcc3bd5125465e4c3a0720053869360f8cfb..2a069e72ae7ec58c3c2ac9e38bbd0a3ef83f21c8 100644 (file)
@@ -6,6 +6,7 @@ use Friendica\App;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Model\Contact;
 use Friendica\Model\Profile;
@@ -144,7 +145,7 @@ function follow_content(App $a)
 
        $header = L10n::t('Connect/Follow');
 
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$header'        => htmlentities($header),
                //'$photo'         => ProxyUtils::proxifyUrl($ret['photo'], false, ProxyUtils::SIZE_SMALL),
                '$desc'          => '',
@@ -187,7 +188,7 @@ function follow_content(App $a)
        }
 
        if ($gcontact_id <> 0) {
-               $o .= replace_macros(get_markup_template('section_title.tpl'),
+               $o .= Renderer::replaceMacros(get_markup_template('section_title.tpl'),
                        ['$title' => L10n::t('Status Messages and Posts')]
                );
 
index 404448ebb77008b9175365c583ea452432823b0b..1791fce3e854e92533470632b05f220975b252f0 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\BaseModule;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model;
@@ -105,7 +106,7 @@ function group_content(App $a) {
        ];
 
        if (($a->argc == 2) && ($a->argv[1] === 'new')) {
-               return replace_macros($tpl, $context + [
+               return Renderer::replaceMacros($tpl, $context + [
                        '$title' => L10n::t('Create a group of contacts/friends.'),
                        '$gname' => ['groupname', L10n::t('Group Name: '), '', ''],
                        '$gid' => 'new',
@@ -215,7 +216,7 @@ function group_content(App $a) {
                }
 
                $drop_tpl = get_markup_template('group_drop.tpl');
-               $drop_txt = replace_macros($drop_tpl, [
+               $drop_txt = Renderer::replaceMacros($drop_tpl, [
                        '$id' => $group['id'],
                        '$delete' => L10n::t('Delete Group'),
                        '$form_security_token' => BaseModule::getFormSecurityToken("group_drop"),
@@ -307,10 +308,10 @@ function group_content(App $a) {
 
        if ($change) {
                $tpl = get_markup_template('groupeditor.tpl');
-               echo replace_macros($tpl, $context);
+               echo Renderer::replaceMacros($tpl, $context);
                killme();
        }
 
-       return replace_macros($tpl, $context);
+       return Renderer::replaceMacros($tpl, $context);
 
 }
index 53118544fb1a72781e73090f1266f550817c134d..553f1ae8fc9e365c063613ed0221fe975dc26861 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\Content\Nav;
 use Friendica\Content\Text\Markdown;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 
 function load_doc_file($s)
@@ -61,7 +62,7 @@ function help_content(App $a)
        if (!strlen($text)) {
                header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . L10n::t('Not Found'));
                $tpl = get_markup_template("404.tpl");
-               return replace_macros($tpl, [
+               return Renderer::replaceMacros($tpl, [
                        '$message' => L10n::t('Page not found.')
                ]);
        }
index bf5b5d27fffa2fc5627f961e3391518392822cfd..4c7a1a8a4b248b1c919eb03f18562de7e2e9a33f 100644 (file)
@@ -6,6 +6,7 @@ use Friendica\App;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Module\Login;
 
@@ -54,7 +55,7 @@ function home_content(App $a) {
 
 
        $tpl = get_markup_template('home.tpl');
-       return replace_macros($tpl, [
+       return Renderer::replaceMacros($tpl, [
                '$defaultheader' => $defaultheader,
                '$customhome' => $customhome,
                '$login' => $login,
index 30343381c393c9ff119c4cc637a93bf121a17ac1..ec8b2cb3574066fbdcb202354a5b5015d0456e6c 100644 (file)
@@ -4,6 +4,7 @@
  */
 use Friendica\App;
 use Friendica\Core\Config;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Protocol\Salmon;
 use Friendica\Util\Crypto;
@@ -22,7 +23,7 @@ function hostxrd_init(App $a)
        }
 
        $tpl = get_markup_template('xrd_host.tpl');
-       echo replace_macros($tpl, [
+       echo Renderer::replaceMacros($tpl, [
                '$zhost' => $a->getHostName(),
                '$zroot' => System::baseUrl(),
                '$domain' => System::baseUrl(),
index 8b51eb00ae6b14881dde6128b32603b10e2228ea..1c9766d49614c8a69bbe6d76c61e939ee81bf6f9 100644 (file)
@@ -10,6 +10,7 @@
 
 use Friendica\App;
 use Friendica\Core\Config;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -111,7 +112,7 @@ function hovercard_content()
        ];
        if ($datatype == 'html') {
                $tpl = get_markup_template('hovercard.tpl');
-               $o = replace_macros($tpl, [
+               $o = Renderer::replaceMacros($tpl, [
                        '$profile' => $profile,
                ]);
 
index 7f479157f81afbf93d0a7463c7d0d9a4dbc99fd6..374628f5544b3cb66c7d53703cc873942f5a7580 100644 (file)
@@ -11,6 +11,7 @@ use Friendica\BaseModule;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Protocol\Email;
@@ -140,7 +141,7 @@ function invite_content(App $a) {
                }
        }
 
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$form_security_token' => BaseModule::getFormSecurityToken("send_invite"),
                '$title'               => L10n::t('Send invitations'),
                '$recipients'          => ['recipients', L10n::t('Enter email addresses, one per line:')],
index 9cde1c9ff4a637edf2398b99efe62c50c7bffd02..954788aa4d32dca67206a86da18b3de97a9b701d 100644 (file)
@@ -6,6 +6,7 @@
 use Friendica\App;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\User;
@@ -116,7 +117,7 @@ function lostpass_content(App $a)
 function lostpass_form()
 {
        $tpl = get_markup_template('lostpass.tpl');
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$title' => L10n::t('Forgot your Password?'),
                '$desc' => L10n::t('Enter your email address and submit to have your password reset. Then check your email for further instructions.'),
                '$name' => L10n::t('Nickname or Email: '),
@@ -135,7 +136,7 @@ function lostpass_generate_password($user)
        $result = User::updatePassword($user['uid'], $new_password);
        if (DBA::isResult($result)) {
                $tpl = get_markup_template('pwdreset.tpl');
-               $o .= replace_macros($tpl, [
+               $o .= Renderer::replaceMacros($tpl, [
                        '$lbl1'    => L10n::t('Password Reset'),
                        '$lbl2'    => L10n::t('Your password has been reset as requested.'),
                        '$lbl3'    => L10n::t('Your new password is'),
index 8727e4afb9f11f96c4efb25de694db22c7020e02..ccff935b8cd0d70b506afc7be8bcbbd7013d3552 100644 (file)
@@ -5,6 +5,7 @@
 use Friendica\App;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 
 function maintenance_content(App $a)
 {
@@ -20,7 +21,7 @@ function maintenance_content(App $a)
        header('Status: 503 Service Temporarily Unavailable');
        header('Retry-After: 600');
 
-       return replace_macros(get_markup_template('maintenance.tpl'), [
+       return Renderer::replaceMacros(get_markup_template('maintenance.tpl'), [
                '$sysdown' => L10n::t('System down for maintenance'),
                '$reason' => $reason
        ]);
index b98fcac6f747bae0c58254b5aa2348dfd0f86d81..20ed7e294889ee9231d978b129c4ca62ceaef5d7 100644 (file)
@@ -6,6 +6,7 @@ use Friendica\App;
 use Friendica\Core\Authentication;
 use Friendica\Core\Addon;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 
@@ -176,7 +177,7 @@ function manage_content(App $a) {
                $identities[$key]['notifications'] = $notifications;
        }
 
-       $o = replace_macros(get_markup_template('manage.tpl'), [
+       $o = Renderer::replaceMacros(get_markup_template('manage.tpl'), [
                '$title' => L10n::t('Manage Identities and/or Pages'),
                '$desc' => L10n::t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions'),
                '$choose' => L10n::t('Select an identity to manage: '),
index a651f51662a923d5a55d90cdd1c51002ef01ac5c..98325c336669aab1b1f4ecef7a08965cfb7e6f12 100644 (file)
@@ -3,6 +3,7 @@
 use Friendica\App;
 use Friendica\Core\System;
 use Friendica\Core\Config;
+use Friendica\Core\Renderer;
 
 function manifest_content(App $a) {
 
@@ -15,7 +16,7 @@ function manifest_content(App $a) {
                $touch_icon = 'images/friendica-128.png';
        }
 
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$baseurl' => System::baseUrl(),
                '$touch_icon' => $touch_icon,
                '$title' => Config::get('config', 'sitename', 'Friendica'),
index 43a3916506621252e8fd952dd183dc2d28eefed1..1856dd981aa78972b6a59d176c4bbdc428bcdbc9 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\Content\Pager;
 use Friendica\Content\Widget;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -114,7 +115,7 @@ function match_content(App $a)
 
                        $tpl = get_markup_template('viewcontact_template.tpl');
 
-                       $o .= replace_macros($tpl, [
+                       $o .= Renderer::replaceMacros($tpl, [
                                '$title'    => L10n::t('Profile Match'),
                                '$contacts' => $entries,
                                '$paginate' => $pager->renderFull($j->total)
index 5f7ffb2b7067f75d737848916b10a1d710d21aaf..3e2cccb76e793a0cb760e2fc2588ced94ab4e714 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\Content\Smilies;
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\ACL;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -37,14 +38,14 @@ function message_init(App $a)
        ];
 
        $tpl = get_markup_template('message_side.tpl');
-       $a->page['aside'] = replace_macros($tpl, [
+       $a->page['aside'] = Renderer::replaceMacros($tpl, [
                '$tabs' => $tabs,
                '$new' => $new,
        ]);
        $base = System::baseUrl();
 
        $head_tpl = get_markup_template('message-head.tpl');
-       $a->page['htmlhead'] .= replace_macros($head_tpl, [
+       $a->page['htmlhead'] .= Renderer::replaceMacros($head_tpl, [
                '$baseurl' => System::baseUrl(true),
                '$base' => $base
        ]);
@@ -119,7 +120,7 @@ function message_content(App $a)
                        'accesskey' => 'm',
                ];
        }
-       $header = replace_macros($tpl, [
+       $header = Renderer::replaceMacros($tpl, [
                '$messages' => L10n::t('Messages'),
                '$button' => $button,
        ]);
@@ -143,7 +144,7 @@ function message_content(App $a)
                        }
 
                        //$a->page['aside'] = '';
-                       return replace_macros(get_markup_template('confirm.tpl'), [
+                       return Renderer::replaceMacros(get_markup_template('confirm.tpl'), [
                                '$method' => 'get',
                                '$message' => L10n::t('Do you really want to delete this message?'),
                                '$extra_inputs' => $inputs,
@@ -199,7 +200,7 @@ function message_content(App $a)
                $o .= $header;
 
                $tpl = get_markup_template('msg-header.tpl');
-               $a->page['htmlhead'] .= replace_macros($tpl, [
+               $a->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
                        '$baseurl' => System::baseUrl(true),
                        '$nickname' => $a->user['nickname'],
                        '$linkurl' => L10n::t('Please enter a link URL:')
@@ -244,7 +245,7 @@ function message_content(App $a)
                $select = ACL::getMessageContactSelectHTML('messageto', 'message-to-select', $preselect, 4, 10);
 
                $tpl = get_markup_template('prv_message.tpl');
-               $o .= replace_macros($tpl, [
+               $o .= Renderer::replaceMacros($tpl, [
                        '$header' => L10n::t('Send Private Message'),
                        '$to' => L10n::t('To:'),
                        '$showinputs' => 'true',
@@ -339,7 +340,7 @@ function message_content(App $a)
                );
 
                $tpl = get_markup_template('msg-header.tpl');
-               $a->page['htmlhead'] .= replace_macros($tpl, [
+               $a->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
                        '$baseurl' => System::baseUrl(true),
                        '$nickname' => $a->user['nickname'],
                        '$linkurl' => L10n::t('Please enter a link URL:')
@@ -399,7 +400,7 @@ function message_content(App $a)
                $parent = '<input type="hidden" name="replyto" value="' . $message['parent-uri'] . '" />';
 
                $tpl = get_markup_template('mail_display.tpl');
-               $o = replace_macros($tpl, [
+               $o = Renderer::replaceMacros($tpl, [
                        '$thread_id' => $a->argv[1],
                        '$thread_subject' => $message['title'],
                        '$thread_seen' => $seen,
@@ -478,7 +479,7 @@ function render_messages(array $msg, $t)
                        $from_photo = (($rr['thumb']) ? $rr['thumb'] : $rr['from-photo']);
                }
 
-               $rslt .= replace_macros($tpl, [
+               $rslt .= Renderer::replaceMacros($tpl, [
                        '$id' => $rr['id'],
                        '$from_name' => $participants,
                        '$from_url' => Contact::magicLink($rr['url']),
index 6ba353d7e51c75dbf080ba8c465ec0c844792e41..5913f804b62609ac8c11639c865b84d33e438b7c 100644 (file)
@@ -18,6 +18,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\PConfig;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\Group;
@@ -201,7 +202,7 @@ function saved_searches($search)
        }
 
        $tpl = get_markup_template('saved_searches_aside.tpl');
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$title'     => L10n::t('Saved Searches'),
                '$add'       => L10n::t('add'),
                '$searchbox' => search($search, 'netsearch-box', $srchurl, true),
@@ -653,7 +654,7 @@ function networkThreadedView(App $a, $update, $parent)
                        info(L10n::t('Group is empty'));
                }
 
-               $o = replace_macros(get_markup_template('section_title.tpl'), [
+               $o = Renderer::replaceMacros(get_markup_template('section_title.tpl'), [
                        '$title' => L10n::t('Group: %s', $group['name'])
                ]) . $o;
        } elseif ($cid) {
@@ -674,7 +675,7 @@ function networkThreadedView(App $a, $update, $parent)
 
                        $entries[0]['account_type'] = Contact::getAccountType($contact);
 
-                       $o = replace_macros(get_markup_template('viewcontact_template.tpl'), [
+                       $o = Renderer::replaceMacros(get_markup_template('viewcontact_template.tpl'), [
                                'contacts' => $entries,
                                'id' => 'network',
                        ]) . $o;
@@ -1034,7 +1035,7 @@ function network_tabs(App $a)
 
        $tpl = get_markup_template('common_tabs.tpl');
 
-       return replace_macros($tpl, ['$tabs' => $arr['tabs']]);
+       return Renderer::replaceMacros($tpl, ['$tabs' => $arr['tabs']]);
 
        // --- end item filter tabs
 }
@@ -1059,7 +1060,7 @@ function network_infinite_scroll_head(App $a, &$htmlhead)
                && defaults($_GET, 'mode', '') != 'minimal'
        ) {
                $tpl = get_markup_template('infinite_scroll_head.tpl');
-               $htmlhead .= replace_macros($tpl, [
+               $htmlhead .= Renderer::replaceMacros($tpl, [
                        '$pageno'     => $pager->getPage(),
                        '$reload_uri' => $pager->getBaseQueryString()
                ]);
index 81084c1bc3f180a5c71297d2cdcdf01e6efcc65a..c2dc1cd4c5362903cef35971005a279bbbb4532c 100644 (file)
@@ -11,6 +11,7 @@ use Friendica\Content\Pager;
 use Friendica\Core\L10n;
 use Friendica\Core\NotificationsManager;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Module\Login;
@@ -158,7 +159,7 @@ function notifications_content(App $a)
                        // We have to distinguish between these two because they use different data.
                        switch ($notif['label']) {
                                case 'friend_suggestion':
-                                       $notif_content[] = replace_macros($sugg, [
+                                       $notif_content[] = Renderer::replaceMacros($sugg, [
                                                '$type'       => $notif['label'],
                                                '$str_notifytype' => L10n::t('Notification type:'),
                                                '$notify_type'=> $notif['notify_type'],
@@ -209,7 +210,7 @@ function notifications_content(App $a)
                                        }
 
                                        $dfrn_tpl = get_markup_template('netfriend.tpl');
-                                       $dfrn_text = replace_macros($dfrn_tpl, [
+                                       $dfrn_text = Renderer::replaceMacros($dfrn_tpl, [
                                                '$intro_id'    => $notif['intro_id'],
                                                '$friend_selected' => $friend_selected,
                                                '$fan_selected'=> $fan_selected,
@@ -234,7 +235,7 @@ function notifications_content(App $a)
                                                $discard = '';
                                        }
 
-                                       $notif_content[] = replace_macros($tpl, [
+                                       $notif_content[] = Renderer::replaceMacros($tpl, [
                                                '$type'        => $notif['label'],
                                                '$header'      => htmlentities($header),
                                                '$str_notifytype' => L10n::t('Notification type:'),
@@ -295,7 +296,7 @@ function notifications_content(App $a)
 
                        $tpl_notif = get_markup_template($notification_templates[$notif['label']]);
 
-                       $notif_content[] = replace_macros($tpl_notif, [
+                       $notif_content[] = Renderer::replaceMacros($tpl_notif, [
                                '$item_label' => $notif['label'],
                                '$item_link'  => $notif['link'],
                                '$item_image' => $notif['image'],
@@ -310,7 +311,7 @@ function notifications_content(App $a)
                $notif_nocontent = L10n::t('No more %s notifications.', $notifs['ident']);
        }
 
-       $o .= replace_macros($notif_tpl, [
+       $o .= Renderer::replaceMacros($notif_tpl, [
                '$notif_header'    => $notif_header,
                '$tabs'            => $tabs,
                '$notif_content'   => $notif_content,
index 6ec36d8f99f7fe387a77df94c049a9c908e52931..b7e2faf1c98ad722f39e5517246393520d87c342 100644 (file)
@@ -7,6 +7,7 @@ use Friendica\App;
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\L10n;
 use Friendica\Core\NotificationsManager;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Item;
@@ -66,7 +67,7 @@ function notify_content(App $a)
        $r = $nm->getAll(['seen'=>0]);
        if (DBA::isResult($r) > 0) {
                foreach ($r as $it) {
-                       $notif_content .= replace_macros($not_tpl, [
+                       $notif_content .= Renderer::replaceMacros($not_tpl, [
                                '$item_link' => System::baseUrl(true).'/notify/view/'. $it['id'],
                                '$item_image' => $it['photo'],
                                '$item_text' => strip_tags(BBCode::convert($it['msg'])),
@@ -77,7 +78,7 @@ function notify_content(App $a)
                $notif_content .= L10n::t('No more system notifications.');
        }
 
-       $o = replace_macros($notif_tpl, [
+       $o = Renderer::replaceMacros($notif_tpl, [
                '$notif_header' => L10n::t('System Notifications'),
                '$tabs' => false, // $tabs,
                '$notif_content' => $notif_content,
index 72577ab4ef67183fdbcbe3871159a789bba8e065..df5f391d435ace63ea5033748d7f7bffb1c5f6e5 100644 (file)
@@ -4,6 +4,7 @@
  */
 use Friendica\App;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Module\Login;
 use Friendica\Util\Network;
@@ -13,7 +14,7 @@ function oexchange_init(App $a) {
        if (($a->argc > 1) && ($a->argv[1] === 'xrd')) {
                $tpl = get_markup_template('oexchange_xrd.tpl');
 
-               $o = replace_macros($tpl, ['$base' => System::baseUrl()]);
+               $o = Renderer::replaceMacros($tpl, ['$base' => System::baseUrl()]);
                echo $o;
                killme();
        }
index 541002410076f22c7409a5a6ef72b715b2a03e36..b7c5ce2805b625c8d03c642bc2fc319a69f592f9 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 use Friendica\App;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 
 function opensearch_content(App $a) {
@@ -9,7 +10,7 @@ function opensearch_content(App $a) {
 
        header("Content-type: application/opensearchdescription+xml");
 
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$baseurl' => System::baseUrl(),
                '$nodename' => $a->getHostName(),
        ]);
index 8ddb0010d13ca79db6cd041951d9e1f06eceabc0..92f79d7c94d3f4ddc01681d1ea42978f3e19da54 100644 (file)
@@ -13,6 +13,7 @@ use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
@@ -64,7 +65,7 @@ function photos_init(App $a) {
 
                $tpl = get_markup_template("vcard-widget.tpl");
 
-               $vcard_widget = replace_macros($tpl, [
+               $vcard_widget = Renderer::replaceMacros($tpl, [
                        '$name' => $profile['name'],
                        '$photo' => $profile['photo'],
                        '$addr' => defaults($profile, 'addr', ''),
@@ -109,7 +110,7 @@ function photos_init(App $a) {
                }
 
                if ($ret['success']) {
-                       $photo_albums_widget = replace_macros(get_markup_template('photo_albums.tpl'), [
+                       $photo_albums_widget = Renderer::replaceMacros(get_markup_template('photo_albums.tpl'), [
                                '$nick'     => $a->data['user']['nickname'],
                                '$title'    => L10n::t('Photo Albums'),
                                '$recent'   => L10n::t('Recent Photos'),
@@ -132,7 +133,7 @@ function photos_init(App $a) {
 
                $tpl = get_markup_template("photos_head.tpl");
 
-               $a->page['htmlhead'] .= replace_macros($tpl,[
+               $a->page['htmlhead'] .= Renderer::replaceMacros($tpl,[
                        '$ispublic' => L10n::t('everybody')
                ]);
        }
@@ -246,7 +247,7 @@ function photos_post(App $a)
                                        ['name' => 'albumname', 'value' => $_POST['albumname']],
                                ];
 
-                               $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
+                               $a->page['content'] = Renderer::replaceMacros(get_markup_template('confirm.tpl'), [
                                        '$method' => 'post',
                                        '$message' => L10n::t('Do you really want to delete this photo album and all its photos?'),
                                        '$extra_inputs' => $extra_inputs,
@@ -318,7 +319,7 @@ function photos_post(App $a)
                if (!empty($_REQUEST['confirm'])) {
                        $drop_url = $a->query_string;
 
-                       $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
+                       $a->page['content'] = Renderer::replaceMacros(get_markup_template('confirm.tpl'), [
                                '$method' => 'post',
                                '$message' => L10n::t('Do you really want to delete this photo?'),
                                '$extra_inputs' => [],
@@ -1084,8 +1085,8 @@ function photos_content(App $a)
 
                Addon::callHooks('photo_upload_form',$ret);
 
-               $default_upload_box = replace_macros(get_markup_template('photos_default_uploader_box.tpl'), []);
-               $default_upload_submit = replace_macros(get_markup_template('photos_default_uploader_submit.tpl'), [
+               $default_upload_box = Renderer::replaceMacros(get_markup_template('photos_default_uploader_box.tpl'), []);
+               $default_upload_submit = Renderer::replaceMacros(get_markup_template('photos_default_uploader_submit.tpl'), [
                        '$submit' => L10n::t('Submit'),
                ]);
 
@@ -1095,7 +1096,7 @@ function photos_content(App $a)
 
                $aclselect_e = ($visitor ? '' : ACL::getFullSelectorHTML($a->user));
 
-               $o .= replace_macros($tpl,[
+               $o .= Renderer::replaceMacros($tpl,[
                        '$pagename' => L10n::t('Upload Photos'),
                        '$sessid' => session_id(),
                        '$usage' => $usage_message,
@@ -1169,7 +1170,7 @@ function photos_content(App $a)
 
                                        $album_e = $album;
 
-                                       $o .= replace_macros($edit_tpl,[
+                                       $o .= Renderer::replaceMacros($edit_tpl,[
                                                '$nametext' => L10n::t('New album name: '),
                                                '$nickname' => $a->data['user']['nickname'],
                                                '$album' => $album_e,
@@ -1220,7 +1221,7 @@ function photos_content(App $a)
                }
 
                $tpl = get_markup_template('photo_album.tpl');
-               $o .= replace_macros($tpl, [
+               $o .= Renderer::replaceMacros($tpl, [
                        '$photos' => $photos,
                        '$album' => $album,
                        '$can_post' => $can_post,
@@ -1342,7 +1343,7 @@ function photos_content(App $a)
 
                if ($cmd === 'edit') {
                        $tpl = get_markup_template('photo_edit_head.tpl');
-                       $a->page['htmlhead'] .= replace_macros($tpl,[
+                       $a->page['htmlhead'] .= Renderer::replaceMacros($tpl,[
                                '$prevlink' => $prevlink,
                                '$nextlink' => $nextlink
                        ]);
@@ -1434,7 +1435,7 @@ function photos_content(App $a)
                        $caption_e = $ph[0]['desc'];
                        $aclselect_e = ACL::getFullSelectorHTML($a->user, false, $ph[0]);
 
-                       $edit = replace_macros($edit_tpl, [
+                       $edit = Renderer::replaceMacros($edit_tpl, [
                                '$id' => $ph[0]['id'],
                                '$album' => ['albname', L10n::t('New album name'), $album_e,''],
                                '$caption' => ['desc', L10n::t('Caption'), $caption_e, ''],
@@ -1473,7 +1474,7 @@ function photos_content(App $a)
 
                        if ($can_post || Security::canWriteToUserWall($owner_uid)) {
                                $like_tpl = get_markup_template('like_noshare.tpl');
-                               $likebuttons = replace_macros($like_tpl, [
+                               $likebuttons = Renderer::replaceMacros($like_tpl, [
                                        '$id' => $link_item['id'],
                                        '$likethis' => L10n::t("I like this \x28toggle\x29"),
                                        '$nolike' => (Feature::isEnabled(local_user(), 'dislike') ? L10n::t("I don't like this \x28toggle\x29") : ''),
@@ -1484,7 +1485,7 @@ function photos_content(App $a)
 
                        if (!DBA::isResult($items)) {
                                if (($can_post || Security::canWriteToUserWall($owner_uid))) {
-                                       $comments .= replace_macros($cmnt_tpl, [
+                                       $comments .= Renderer::replaceMacros($cmnt_tpl, [
                                                '$return_path' => '',
                                                '$jsreload' => $return_path,
                                                '$id' => $link_item['id'],
@@ -1523,7 +1524,7 @@ function photos_content(App $a)
                                }
 
                                if (($can_post || Security::canWriteToUserWall($owner_uid))) {
-                                       $comments .= replace_macros($cmnt_tpl,[
+                                       $comments .= Renderer::replaceMacros($cmnt_tpl,[
                                                '$return_path' => '',
                                                '$jsreload' => $return_path,
                                                '$id' => $link_item['id'],
@@ -1568,7 +1569,7 @@ function photos_content(App $a)
                                        $title_e = $item['title'];
                                        $body_e = BBCode::convert($item['body']);
 
-                                       $comments .= replace_macros($template,[
+                                       $comments .= Renderer::replaceMacros($template,[
                                                '$id' => $item['id'],
                                                '$profile_url' => $profile_url,
                                                '$name' => $item['author-name'],
@@ -1583,7 +1584,7 @@ function photos_content(App $a)
                                        ]);
 
                                        if (($can_post || Security::canWriteToUserWall($owner_uid))) {
-                                               $comments .= replace_macros($cmnt_tpl, [
+                                               $comments .= Renderer::replaceMacros($cmnt_tpl, [
                                                        '$return_path' => '',
                                                        '$jsreload' => $return_path,
                                                        '$id' => $item['item_id'],
@@ -1612,7 +1613,7 @@ function photos_content(App $a)
                }
 
                $photo_tpl = get_markup_template('photo_view.tpl');
-               $o .= replace_macros($photo_tpl, [
+               $o .= Renderer::replaceMacros($photo_tpl, [
                        '$id' => $ph[0]['id'],
                        '$album' => [$album_link, $ph[0]['album']],
                        '$tools' => $tools,
@@ -1704,7 +1705,7 @@ function photos_content(App $a)
        }
 
        $tpl = get_markup_template('photos_recent.tpl');
-       $o .= replace_macros($tpl, [
+       $o .= Renderer::replaceMacros($tpl, [
                '$title' => L10n::t('Recent Photos'),
                '$can_post' => $can_post,
                '$upload' => [L10n::t('Upload New Photos'), 'photos/'.$a->data['user']['nickname'].'/upload'],
index 7a33a69d0b9d1d7f707dbb77c2aae8a10d82edc0..9eac87679906164e80a7f7576103963500c5c1b9 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\Core\Cache;
 use Friendica\Core\Config;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Protocol\PortableContact;
@@ -374,7 +375,7 @@ function poco_init(App $a) {
 
        if ($format === 'xml') {
                header('Content-type: text/xml');
-               echo replace_macros(get_markup_template('poco_xml.tpl'), array_xmlify(['$response' => $ret]));
+               echo Renderer::replaceMacros(get_markup_template('poco_xml.tpl'), array_xmlify(['$response' => $ret]));
                killme();
        }
        if ($format === 'json') {
index 3eefeb9aba3f6620f0141c0ba4f10516b6f0bf3b..37714eb4ab9ea0d0bb3e6e559c8c92630f865534 100644 (file)
@@ -17,6 +17,7 @@ use Friendica\App;
 use Friendica\Core\Addon;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
@@ -160,7 +161,7 @@ function poke_content(App $a)
        $base = System::baseUrl();
 
        $head_tpl = get_markup_template('poke_head.tpl');
-       $a->page['htmlhead'] .= replace_macros($head_tpl,[
+       $a->page['htmlhead'] .= Renderer::replaceMacros($head_tpl,[
                '$baseurl' => System::baseUrl(true),
                '$base' => $base
        ]);
@@ -180,7 +181,7 @@ function poke_content(App $a)
 
        $tpl = get_markup_template('poke_content.tpl');
 
-       $o = replace_macros($tpl,[
+       $o = Renderer::replaceMacros($tpl,[
                '$title' => L10n::t('Poke/Prod'),
                '$desc' => L10n::t('poke, prod or do other things to somebody'),
                '$clabel' => L10n::t('Recipient'),
index da45226fe02bbc20f983774eac313f21a5e5c946..ad9f5ab66d997e754167db0dd3368eb3ccdf87df 100644 (file)
@@ -7,6 +7,7 @@ use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
@@ -240,7 +241,7 @@ function profile_photo_content(App $a)
        if (empty($imagecrop)) {
                $tpl = get_markup_template('profile_photo.tpl');
 
-               $o = replace_macros($tpl,
+               $o = Renderer::replaceMacros($tpl,
                        [
                        '$user' => $a->user['nickname'],
                        '$lbl_upfile' => L10n::t('Upload File:'),
@@ -257,7 +258,7 @@ function profile_photo_content(App $a)
        } else {
                $filename = $imagecrop['hash'] . '-' . $imagecrop['resolution'] . '.' . $imagecrop['ext'];
                $tpl = get_markup_template("cropbody.tpl");
-               $o = replace_macros($tpl,
+               $o = Renderer::replaceMacros($tpl,
                        [
                        '$filename'  => $filename,
                        '$profile'   => (isset($_REQUEST['profile']) ? intval($_REQUEST['profile']) : 0),
@@ -318,7 +319,7 @@ function profile_photo_crop_ui_head(App $a, Image $image)
                }
        }
 
-       $a->page['htmlhead'] .= replace_macros(get_markup_template("crophead.tpl"), []);
+       $a->page['htmlhead'] .= Renderer::replaceMacros(get_markup_template("crophead.tpl"), []);
 
        $imagecrop = [
                'hash'       => $hash,
index a4a49ec785ad1b4e5dfda67a1430bff5adfec849..216edacb59d27766bded73a4bd739fd5e3af8761 100644 (file)
@@ -12,6 +12,7 @@ use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
@@ -526,12 +527,12 @@ function profiles_content(App $a) {
                        return;
                }
 
-               $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), [
+               $a->page['htmlhead'] .= Renderer::replaceMacros(get_markup_template('profed_head.tpl'), [
                        '$baseurl' => System::baseUrl(true),
                ]);
 
                $opt_tpl = get_markup_template("profile-hide-friends.tpl");
-               $hide_friends = replace_macros($opt_tpl,[
+               $hide_friends = Renderer::replaceMacros($opt_tpl,[
                        '$yesno' => [
                                'hide-friends', //Name
                                L10n::t('Hide contacts and friends:'), //Label
@@ -553,7 +554,7 @@ function profiles_content(App $a) {
 
                $is_default = (($r[0]['is-default']) ? 1 : 0);
                $tpl = get_markup_template("profile_edit.tpl");
-               $o .= replace_macros($tpl, [
+               $o .= Renderer::replaceMacros($tpl, [
                        '$personal_account' => $personal_account,
                        '$detailled_profile' => $detailled_profile,
 
@@ -667,7 +668,7 @@ function profiles_content(App $a) {
 
                        $profiles = '';
                        foreach ($r as $rr) {
-                               $profiles .= replace_macros($tpl, [
+                               $profiles .= Renderer::replaceMacros($tpl, [
                                        '$photo'        => $a->removeBaseURL($rr['thumb']),
                                        '$id'           => $rr['id'],
                                        '$alt'          => L10n::t('Profile Image'),
@@ -678,7 +679,7 @@ function profiles_content(App $a) {
                        }
 
                        $tpl_header = get_markup_template('profile_listing_header.tpl');
-                       $o .= replace_macros($tpl_header,[
+                       $o .= Renderer::replaceMacros($tpl_header,[
                                '$header'      => L10n::t('Edit/Manage Profiles'),
                                '$chg_photo'   => L10n::t('Change profile photo'),
                                '$cr_new'      => L10n::t('Create New Profile'),
index 73b57124a21613219d5f4363f05991a3eb789f81..0948098d7ea7f9bd1d926dd6994522a3ca0219dc 100644 (file)
@@ -11,6 +11,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Model;
@@ -229,7 +230,7 @@ function register_content(App $a)
                $profile_publish = '<input type="hidden" name="profile_publish_reg" value="1" />';
        } else {
                $publish_tpl = get_markup_template("profile_publish.tpl");
-               $profile_publish = replace_macros($publish_tpl, [
+               $profile_publish = Renderer::replaceMacros($publish_tpl, [
                        '$instance' => 'reg',
                        '$pubdesc' => L10n::t('Include your profile in member directory?'),
                        '$yes_selected' => '',
@@ -254,7 +255,7 @@ function register_content(App $a)
 
        $tos = new Tos();
 
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$oidhtml' => $oidhtml,
                '$invitations' => Config::get('system', 'invitation_only'),
                '$permonly'    => intval(Config::get('config', 'register_policy')) === REGISTER_APPROVE,
index 86d46a177b26fc31a5f0bee87ce0dadacef8a1cf..c4994064867d9aaa9b7844d33c18294b89e79662 100644 (file)
@@ -6,6 +6,7 @@
 use Friendica\App;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\User;
@@ -75,7 +76,7 @@ function removeme_content(App $a)
        $_SESSION['remove_account_verify'] = $hash;
 
        $tpl = get_markup_template('removeme.tpl');
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$basedir' => $a->getBaseURL(),
                '$hash' => $hash,
                '$title' => L10n::t('Remove My Account'),
index 4be378ba9a96609757251057c8a7b4b98eeb8723..320bf1b3b43eb82d122bc52ae490c78a971bb6ad 100644 (file)
@@ -11,6 +11,7 @@ use Friendica\Core\Cache;
 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\Item;
@@ -45,7 +46,7 @@ function search_saved_searches() {
 
                $tpl = get_markup_template("saved_searches_aside.tpl");
 
-               $o .= replace_macros($tpl, [
+               $o .= Renderer::replaceMacros($tpl, [
                        '$title'        => L10n::t('Saved Searches'),
                        '$add'          => '',
                        '$searchbox'    => '',
@@ -158,7 +159,7 @@ function search_content(App $a) {
        }
 
        // contruct a wrapper for the search header
-       $o = replace_macros(get_markup_template("content_wrapper.tpl"),[
+       $o = Renderer::replaceMacros(get_markup_template("content_wrapper.tpl"),[
                'name' => "search-header",
                '$title' => L10n::t("Search"),
                '$title_size' => 3,
@@ -251,7 +252,7 @@ function search_content(App $a) {
                $title = L10n::t('Results for: %s', $search);
        }
 
-       $o .= replace_macros(get_markup_template("section_title.tpl"),[
+       $o .= Renderer::replaceMacros(get_markup_template("section_title.tpl"),[
                '$title' => $title
        ]);
 
index 2973a7f729ac9a96e3360d78b6b496ea17ca9912..5a1ab5ba649293a4ab80dd60be5fdbc149635766 100644 (file)
@@ -13,6 +13,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Theme;
 use Friendica\Core\Worker;
@@ -50,7 +51,7 @@ function settings_init(App $a)
        // These lines provide the javascript needed by the acl selector
 
        $tpl = get_markup_template('settings/head.tpl');
-       $a->page['htmlhead'] .= replace_macros($tpl, [
+       $a->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
                '$ispublic' => L10n::t('everybody')
        ]);
 
@@ -130,7 +131,7 @@ function settings_init(App $a)
 
 
        $tabtpl = get_markup_template("generic_links_widget.tpl");
-       $a->page['aside'] = replace_macros($tabtpl, [
+       $a->page['aside'] = Renderer::replaceMacros($tabtpl, [
                '$title' => L10n::t('Settings'),
                '$class' => 'settings-widget',
                '$items' => $tabs,
@@ -672,7 +673,7 @@ function settings_content(App $a)
        if (($a->argc > 1) && ($a->argv[1] === 'oauth')) {
                if (($a->argc > 2) && ($a->argv[2] === 'add')) {
                        $tpl = get_markup_template('settings/oauth_edit.tpl');
-                       $o .= replace_macros($tpl, [
+                       $o .= Renderer::replaceMacros($tpl, [
                                '$form_security_token' => BaseModule::getFormSecurityToken("settings_oauth"),
                                '$title'        => L10n::t('Add application'),
                                '$submit'       => L10n::t('Save Settings'),
@@ -698,7 +699,7 @@ function settings_content(App $a)
                        $app = $r[0];
 
                        $tpl = get_markup_template('settings/oauth_edit.tpl');
-                       $o .= replace_macros($tpl, [
+                       $o .= Renderer::replaceMacros($tpl, [
                                '$form_security_token' => BaseModule::getFormSecurityToken("settings_oauth"),
                                '$title'        => L10n::t('Add application'),
                                '$submit'       => L10n::t('Update'),
@@ -730,7 +731,7 @@ function settings_content(App $a)
 
 
                $tpl = get_markup_template('settings/oauth.tpl');
-               $o .= replace_macros($tpl, [
+               $o .= Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseModule::getFormSecurityToken("settings_oauth"),
                        '$baseurl'      => $a->getBaseURL(true),
                        '$title'        => L10n::t('Connected Apps'),
@@ -757,7 +758,7 @@ function settings_content(App $a)
 
 
                $tpl = get_markup_template('settings/addons.tpl');
-               $o .= replace_macros($tpl, [
+               $o .= Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseModule::getFormSecurityToken("settings_addon"),
                        '$title'        => L10n::t('Addon Settings'),
                        '$settings_addons' => $settings_addons
@@ -778,7 +779,7 @@ function settings_content(App $a)
                }
 
                $tpl = get_markup_template('settings/features.tpl');
-               $o .= replace_macros($tpl, [
+               $o .= Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseModule::getFormSecurityToken("settings_features"),
                        '$title'               => L10n::t('Additional Features'),
                        '$features'            => $arr,
@@ -837,7 +838,7 @@ function settings_content(App $a)
 
                $mail_disabled_message = (($mail_disabled) ? L10n::t('Email access is disabled on this site.') : '');
 
-               $o .= replace_macros($tpl, [
+               $o .= Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseModule::getFormSecurityToken("settings_connectors"),
 
                        '$title'        => L10n::t('Social Networks'),
@@ -956,7 +957,7 @@ function settings_content(App $a)
                }
 
                $tpl = get_markup_template('settings/display.tpl');
-               $o = replace_macros($tpl, [
+               $o = Renderer::replaceMacros($tpl, [
                        '$ptitle'       => L10n::t('Display Settings'),
                        '$form_security_token' => BaseModule::getFormSecurityToken("settings_display"),
                        '$submit'       => L10n::t('Save Settings'),
@@ -1033,7 +1034,7 @@ function settings_content(App $a)
 
        $pageset_tpl = get_markup_template('settings/pagetypes.tpl');
 
-       $pagetype = replace_macros($pageset_tpl, [
+       $pagetype = Renderer::replaceMacros($pageset_tpl, [
                '$account_types'        => L10n::t("Account Types"),
                '$user'                 => L10n::t("Personal Page Subtypes"),
                '$community'            => L10n::t("Community Forum Subtypes"),
@@ -1094,40 +1095,40 @@ function settings_content(App $a)
        if (Config::get('system', 'publish_all')) {
                $profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />';
        } else {
-               $profile_in_dir = replace_macros($opt_tpl, [
+               $profile_in_dir = Renderer::replaceMacros($opt_tpl, [
                        '$field' => ['profile_in_directory', L10n::t('Publish your default profile in your local site directory?'), $profile['publish'], L10n::t('Your profile will be published in this node\'s <a href="%s">local directory</a>. Your profile details may be publicly visible depending on the system settings.', System::baseUrl().'/directory'), [L10n::t('No'), L10n::t('Yes')]]
                ]);
        }
 
        if (strlen(Config::get('system', 'directory'))) {
-               $profile_in_net_dir = replace_macros($opt_tpl, [
+               $profile_in_net_dir = Renderer::replaceMacros($opt_tpl, [
                        '$field' => ['profile_in_netdirectory', L10n::t('Publish your default profile in the global social directory?'), $profile['net-publish'], L10n::t('Your profile will be published in the global friendica directories (e.g. <a href="%s">%s</a>). Your profile will be visible in public.', Config::get('system', 'directory'), Config::get('system', 'directory')), [L10n::t('No'), L10n::t('Yes')]]
                ]);
        } else {
                $profile_in_net_dir = '';
        }
 
-       $hide_friends = replace_macros($opt_tpl, [
+       $hide_friends = Renderer::replaceMacros($opt_tpl, [
                '$field' => ['hide-friends', L10n::t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide-friends'], L10n::t('Your contact list won\'t be shown in your default profile page. You can decide to show your contact list separately for each additional profile you create'), [L10n::t('No'), L10n::t('Yes')]],
        ]);
 
-       $hide_wall = replace_macros($opt_tpl, [
+       $hide_wall = Renderer::replaceMacros($opt_tpl, [
                '$field' => ['hidewall', L10n::t('Hide your profile details from anonymous viewers?'), $a->user['hidewall'], L10n::t('Anonymous visitors will only see your profile picture, your display name and the nickname you are using on your profile page. Your public posts and replies will still be accessible by other means.'), [L10n::t('No'), L10n::t('Yes')]],
        ]);
 
-       $blockwall = replace_macros($opt_tpl, [
+       $blockwall = Renderer::replaceMacros($opt_tpl, [
                '$field' => ['blockwall', L10n::t('Allow friends to post to your profile page?'), (intval($a->user['blockwall']) ? '0' : '1'), L10n::t('Your contacts may write posts on your profile wall. These posts will be distributed to your contacts'), [L10n::t('No'), L10n::t('Yes')]],
        ]);
 
-       $blocktags = replace_macros($opt_tpl, [
+       $blocktags = Renderer::replaceMacros($opt_tpl, [
                '$field' => ['blocktags', L10n::t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), L10n::t('Your contacts can add additional tags to your posts.'), [L10n::t('No'), L10n::t('Yes')]],
        ]);
 
-       $suggestme = replace_macros($opt_tpl, [
+       $suggestme = Renderer::replaceMacros($opt_tpl, [
                '$field' => ['suggestme', L10n::t('Allow us to suggest you as a potential friend to new members?'), $suggestme, L10n::t('If you like, Friendica may suggest new members to add you as a contact.'), [L10n::t('No'), L10n::t('Yes')]],
        ]);
 
-       $unkmail = replace_macros($opt_tpl, [
+       $unkmail = Renderer::replaceMacros($opt_tpl, [
                '$field' => ['unkmail', L10n::t('Permit unknown people to send you private mail?'), $unkmail, L10n::t('Friendica network users may send you private messages even if they are not in your contact list.'), [L10n::t('No'), L10n::t('Yes')]],
        ]);
 
@@ -1137,7 +1138,7 @@ function settings_content(App $a)
 
        $tpl_addr = get_markup_template('settings/nick_set.tpl');
 
-       $prof_addr = replace_macros($tpl_addr,[
+       $prof_addr = Renderer::replaceMacros($tpl_addr,[
                '$desc' => L10n::t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . $a->getHostName() . $a->getURLPath(), System::baseUrl() . '/profile/' . $nickname),
                '$basepath' => $a->getHostName()
        ]);
@@ -1181,7 +1182,7 @@ function settings_content(App $a)
        $lang_choices = L10n::getAvailableLanguages();
 
        /// @TODO Fix indending (or so)
-       $o .= replace_macros($stpl, [
+       $o .= Renderer::replaceMacros($stpl, [
                '$ptitle'       => L10n::t('Account Settings'),
 
                '$submit'       => L10n::t('Save Settings'),
index 1e33cb66024e9d811a3711bb31ef12d2d7c758d0..baa3d184e740dc39c71442d5b5e305cd5b4f9949 100644 (file)
@@ -7,6 +7,7 @@ use Friendica\App;
 use Friendica\Content\ContactSelector;
 use Friendica\Content\Widget;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -33,7 +34,7 @@ function suggest_init(App $a)
                                }
                        }
 
-                       $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
+                       $a->page['content'] = Renderer::replaceMacros(get_markup_template('confirm.tpl'), [
                                '$method' => 'get',
                                '$message' => L10n::t('Do you really want to delete this suggestion?'),
                                '$extra_inputs' => $inputs,
@@ -113,7 +114,7 @@ function suggest_content(App $a)
 
        $tpl = get_markup_template('viewcontact_template.tpl');
 
-       $o .= replace_macros($tpl,[
+       $o .= Renderer::replaceMacros($tpl,[
                '$title' => L10n::t('Friend Suggestions'),
                '$contacts' => $entries,
        ]);
index 993e398025fb5301b13f204dd09b23b83cfbbaeb..27c36a40c6fa0ca4f8106e5e83f1a368c1d320b0 100644 (file)
@@ -5,6 +5,7 @@
 use Friendica\App;
 use Friendica\Core\Addon;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 
@@ -47,7 +48,7 @@ function uexport_content(App $a) {
        Addon::callHooks('uexport_options', $options);
 
        $tpl = get_markup_template("uexport.tpl");
-       return replace_macros($tpl, [
+       return Renderer::replaceMacros($tpl, [
                '$baseurl' => System::baseUrl(),
                '$title' => L10n::t('Export personal data'),
                '$options' => $options
index 3c80b671be45a308f4449a418705211f059e8de0..2061d4552047c26f1693c144f986b1bf0476f304 100644 (file)
@@ -9,6 +9,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\UserImport;
+use Friendica\Core\Renderer;
 
 function uimport_post(App $a)
 {
@@ -49,7 +50,7 @@ function uimport_content(App $a)
        }
 
        $tpl = get_markup_template("uimport.tpl");
-       return replace_macros($tpl, [
+       return Renderer::replaceMacros($tpl, [
                '$regbutt' => L10n::t('Import'),
                '$import' => [
                        'title' => L10n::t("Move account"),
index 2a60322f02d9b2d9043822e8cdaf9c26a8024d70..0e083c2276233a449f5dd9e41440229b87c7bd2c 100644 (file)
@@ -6,6 +6,7 @@
 use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -114,7 +115,7 @@ function unfollow_content(App $a)
 
        $header = L10n::t('Disconnect/Unfollow');
 
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$header'        => htmlentities($header),
                '$desc'          => '',
                '$pls_answer'    => '',
@@ -144,7 +145,7 @@ function unfollow_content(App $a)
        $a->page['aside'] = '';
        Profile::load($a, '', 0, Contact::getDetailsByURL($contact['url']));
 
-       $o .= replace_macros(get_markup_template('section_title.tpl'), ['$title' => L10n::t('Status Messages and Posts')]);
+       $o .= Renderer::replaceMacros(get_markup_template('section_title.tpl'), ['$title' => L10n::t('Status Messages and Posts')]);
 
        // Show last public posts
        $o .= Contact::getPostsFromUrl($contact['url']);
index 51f15a47ae02f7ebe8aebd1bdb688574a6750e01..c05132b8f7c51e36c842e26b8452b2f45604bb4e 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\Content\Nav;
 use Friendica\Content\Pager;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -52,7 +53,7 @@ function videos_init(App $a)
 
                $tpl = get_markup_template("vcard-widget.tpl");
 
-               $vcard_widget = replace_macros($tpl, [
+               $vcard_widget = Renderer::replaceMacros($tpl, [
                        '$name' => $profile['name'],
                        '$photo' => $profile['photo'],
                        '$addr' => defaults($profile, 'addr', ''),
@@ -103,7 +104,7 @@ function videos_init(App $a)
                $a->page['aside'] .= $vcard_widget;
 
                $tpl = get_markup_template("videos_head.tpl");
-               $a->page['htmlhead'] .= replace_macros($tpl,[
+               $a->page['htmlhead'] .= Renderer::replaceMacros($tpl,[
                        '$baseurl' => System::baseUrl(),
                ]);
        }
@@ -128,7 +129,7 @@ function videos_post(App $a)
 
                        $drop_url = $a->query_string;
 
-                       $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
+                       $a->page['content'] = Renderer::replaceMacros(get_markup_template('confirm.tpl'), [
                                '$method' => 'post',
                                '$message' => L10n::t('Do you really want to delete this video?'),
                                '$extra_inputs' => [
@@ -382,7 +383,7 @@ function videos_content(App $a)
        }
 
        $tpl = get_markup_template('videos_recent.tpl');
-       $o .= replace_macros($tpl, [
+       $o .= Renderer::replaceMacros($tpl, [
                '$title'      => L10n::t('Recent Videos'),
                '$can_post'   => $can_post,
                '$upload'     => [L10n::t('Upload New Videos'), System::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/upload'],
index 9a2513a6c400f667878448a55f7414d4629c7963..4b4ea46a5dbbb3c73c8d125ba9fd9d704e3dce34 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\Content\Pager;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -125,7 +126,7 @@ function viewcontacts_content(App $a)
 
 
        $tpl = get_markup_template("viewcontact_template.tpl");
-       $o .= replace_macros($tpl, [
+       $o .= Renderer::replaceMacros($tpl, [
                '$title' => L10n::t('Contacts'),
                '$contacts' => $contacts,
                '$paginate' => $pager->renderFull($total),
index af1de6c064cb33d916f243aa642a911d3b846b76..371b82beede770bb0057ff69bb881b1f14fcb432 100644 (file)
@@ -5,6 +5,7 @@
 use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Mail;
@@ -115,14 +116,14 @@ function wallmessage_content(App $a) {
        }
 
        $tpl = get_markup_template('wallmsg-header.tpl');
-       $a->page['htmlhead'] .= replace_macros($tpl, [
+       $a->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
                '$baseurl' => System::baseUrl(true),
                '$nickname' => $user['nickname'],
                '$linkurl' => L10n::t('Please enter a link URL:')
        ]);
 
        $tpl = get_markup_template('wallmessage.tpl');
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$header' => L10n::t('Send Private Message'),
                '$subheader' => L10n::t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.', $user['username']),
                '$to' => L10n::t('To:'),
index 1d29d7904a9d5705e77deac205f0dbfc0fdb2cde..a1ae7350b1e1ca2e1ebfa4d4af68a20f2fb7a2d7 100644 (file)
@@ -5,6 +5,7 @@
 
 use Friendica\App;
 use Friendica\Core\Addon;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Protocol\Salmon;
@@ -107,7 +108,7 @@ function xrd_xml($a, $uri, $alias, $profile_url, $r)
 
        $tpl = get_markup_template('xrd_person.tpl');
 
-       $o = replace_macros($tpl, [
+       $o = Renderer::replaceMacros($tpl, [
                '$nick'        => $r['nickname'],
                '$accturi'     => $uri,
                '$alias'       => $alias,
index 781faf1a506ad90326a309c0942e58ac04729129..b2ab78171be1db0b80b307ab63080e6dc6d9381b 100644 (file)
@@ -777,7 +777,7 @@ class App
                 * since the code added by the modules frequently depends on it
                 * being first
                 */
-               $this->page['htmlhead'] = replace_macros($tpl, [
+               $this->page['htmlhead'] = Core\Renderer::replaceMacros($tpl, [
                        '$baseurl'         => $this->getBaseURL(),
                        '$local_user'      => local_user(),
                        '$generator'       => 'Friendica' . ' ' . FRIENDICA_VERSION,
@@ -823,7 +823,7 @@ class App
                        } else {
                                $link = 'toggle_mobile?off=1&address=' . curPageURL();
                        }
-                       $this->page['footer'] .= replace_macros(get_markup_template("toggle_mobile_footer.tpl"), [
+                       $this->page['footer'] .= Core\Renderer::replaceMacros(get_markup_template("toggle_mobile_footer.tpl"), [
                                '$toggle_link' => $link,
                                '$toggle_text' => Core\L10n::t('toggle mobile')
                        ]);
@@ -832,7 +832,7 @@ class App
                Core\Addon::callHooks('footer', $this->page['footer']);
 
                $tpl = get_markup_template('footer.tpl');
-               $this->page['footer'] = replace_macros($tpl, [
+               $this->page['footer'] = Core\Renderer::replaceMacros($tpl, [
                        '$baseurl' => $this->getBaseURL(),
                        '$footerScripts' => $this->footerScripts,
                ]) . $this->page['footer'];
@@ -1793,7 +1793,7 @@ class App
 
                                header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . Core\L10n::t('Not Found'));
                                $tpl = get_markup_template("404.tpl");
-                               $this->page['content'] = replace_macros($tpl, [
+                               $this->page['content'] = Core\Renderer::replaceMacros($tpl, [
                                        '$message' =>  Core\L10n::t('Page not found.')
                                ]);
                        }
@@ -1881,7 +1881,7 @@ class App
 
                // Add the navigation (menu) template
                if ($this->module != 'install' && $this->module != 'maintenance') {
-                       $this->page['htmlhead'] .= replace_macros(get_markup_template('nav_head.tpl'), []);
+                       $this->page['htmlhead'] .= Core\Renderer::replaceMacros(get_markup_template('nav_head.tpl'), []);
                        $this->page['nav']       = Content\Nav::build($this);
                }
 
index 35df0aee9e6af85064d3bb9f7c36cc2f5c9c519a..0b06a04c7d4c869147f39d6bac8fab70c5ce7fe3 100644 (file)
@@ -8,6 +8,7 @@ namespace Friendica\Content;
 use Friendica\Core\Protocol;
 use Friendica\Content\Feature;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -124,7 +125,7 @@ class ForumManager
 
                        $tpl = get_markup_template('widget_forumlist.tpl');
 
-                       $o .= replace_macros(
+                       $o .= Renderer::replaceMacros(
                                $tpl,
                                [
                                        '$title'        => L10n::t('Forums'),
index 8289825eade47587a67017f7bcee64be49542134..5c347c2a761b409791b65a9a520c2986ebbd6a8d 100644 (file)
@@ -9,6 +9,7 @@ use Friendica\Content\Feature;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -63,7 +64,7 @@ class Nav
 
                $tpl = get_markup_template('nav.tpl');
 
-               $nav .= replace_macros($tpl, [
+               $nav .= Renderer::replaceMacros($tpl, [
                        '$baseurl'      => System::baseUrl(),
                        '$sitelocation' => $nav_info['sitelocation'],
                        '$nav'          => $nav_info['nav'],
index cfe9468ad57a58a0f893b0fb9d16522aa59e60fc..acc7f02cf7e98f719b8572d5dc2e23957d459328 100644 (file)
@@ -14,6 +14,7 @@ use Friendica\Core\Addon;
 use Friendica\Core\Cache;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Util\DateTimeFormat;
@@ -179,7 +180,7 @@ class OEmbed
                                        $th = 120;
                                        $tw = $th * $tr;
                                        $tpl = get_markup_template('oembed_video.tpl');
-                                       $ret .= replace_macros($tpl, [
+                                       $ret .= Renderer::replaceMacros($tpl, [
                                                '$baseurl' => System::baseUrl(),
                                                '$embedurl' => $oembed->embed_url,
                                                '$escapedhtml' => base64_encode($oembed->html),
index a95fc7cf656351de1c5a812e8e8b58ec2c516f37..5794f589a89fe70165b7cda7cf7527c08064c919 100644 (file)
@@ -3,6 +3,7 @@
 namespace Friendica\Content;
 
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 
 /**
  * The Pager has two very different output, Minimal and Full, see renderMinimal() and renderFull() for more details.
@@ -173,7 +174,7 @@ class Pager
                ];
 
                $tpl = get_markup_template('paginate.tpl');
-               return replace_macros($tpl, ['pager' => $data]);
+               return Renderer::replaceMacros($tpl, ['pager' => $data]);
        }
 
        /**
@@ -277,6 +278,6 @@ class Pager
                }
 
                $tpl = get_markup_template('paginate.tpl');
-               return replace_macros($tpl, ['pager' => $data]);
+               return Renderer::replaceMacros($tpl, ['pager' => $data]);
        }
 }
index 22ce4ea3aeb112c14e5b313e609190ca30c16e86..18804494525afa3b958fb60a58b2464beb4e07d7 100644 (file)
@@ -17,6 +17,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Model\Contact;
 use Friendica\Model\Event;
@@ -987,7 +988,7 @@ class BBCode extends BaseObject
                                        $text = ($is_quote_share? "\n" : '');
 
                                        $tpl = get_markup_template('shared_content.tpl');
-                                       $text .= replace_macros($tpl, [
+                                       $text .= Renderer::replaceMacros($tpl, [
                                                '$profile' => $attributes['profile'],
                                                '$avatar'  => $attributes['avatar'],
                                                '$author'  => $attributes['author'],
index 8dd71b8bfc7fe57398d5cd12c966a2c1a2420937..8f1279b4e55339ea6c56a3da5fcc9a69b05ce33c 100644 (file)
@@ -11,6 +11,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -30,7 +31,7 @@ class Widget
         */
        public static function follow($value = "")
        {
-               return replace_macros(get_markup_template('follow.tpl'), array(
+               return Renderer::replaceMacros(get_markup_template('follow.tpl'), array(
                        '$connect' => L10n::t('Add New Contact'),
                        '$desc' => L10n::t('Enter address or web location'),
                        '$hint' => L10n::t('Example: bob@example.com, http://example.com/barbara'),
@@ -73,7 +74,7 @@ class Widget
                $aside = [];
                $aside['$nv'] = $nv;
 
-               return replace_macros(get_markup_template('peoplefind.tpl'), $aside);
+               return Renderer::replaceMacros(get_markup_template('peoplefind.tpl'), $aside);
        }
 
        /**
@@ -151,7 +152,7 @@ class Widget
                        return '';
                }
 
-               return replace_macros(get_markup_template('nets.tpl'), array(
+               return Renderer::replaceMacros(get_markup_template('nets.tpl'), array(
                        '$title' => L10n::t('Networks'),
                        '$desc' => '',
                        '$sel_all' => (($selected == '') ? 'selected' : ''),
@@ -193,7 +194,7 @@ class Widget
                        }
                }
 
-               return replace_macros(get_markup_template('fileas_widget.tpl'), array(
+               return Renderer::replaceMacros(get_markup_template('fileas_widget.tpl'), array(
                        '$title' => L10n::t('Saved Folders'),
                        '$desc' => '',
                        '$sel_all' => (($selected == '') ? 'selected' : ''),
@@ -233,7 +234,7 @@ class Widget
                        }
                }
 
-               return replace_macros(get_markup_template('categories_widget.tpl'), array(
+               return Renderer::replaceMacros(get_markup_template('categories_widget.tpl'), array(
                        '$title' => L10n::t('Categories'),
                        '$desc' => '',
                        '$sel_all' => (($selected == '') ? 'selected' : ''),
@@ -300,7 +301,7 @@ class Widget
                        $r = GContact::commonFriendsZcid($profile_uid, $zcid, 0, 5, true);
                }
 
-               return replace_macros(get_markup_template('remote_friends_common.tpl'), array(
+               return Renderer::replaceMacros(get_markup_template('remote_friends_common.tpl'), array(
                        '$desc' => L10n::tt("%d contact in common", "%d contacts in common", $t),
                        '$base' => System::baseUrl(),
                        '$uid' => $profile_uid,
index 2c21b2f0d0ab7e2d1b2f59194e87e038d27437cb..2b42d35b21fc65f32d54c372c892c8fca88f5024 100644 (file)
@@ -8,6 +8,7 @@ namespace Friendica\Content\Widget;
 
 use Friendica\Content\Feature;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 
 require_once 'boot.php';
 require_once 'include/text.php';
@@ -61,7 +62,7 @@ class CalendarExport
                $user = defaults($a->data['user'], 'nickname', $a->user['nickname']);
 
                $tpl = get_markup_template("events_aside.tpl");
-               $return = replace_macros($tpl, [
+               $return = Renderer::replaceMacros($tpl, [
                        '$etitle'      => L10n::t("Export"),
                        '$export_ical' => L10n::t("Export calendar as ical"),
                        '$export_csv'  => L10n::t("Export calendar as csv"),
index 309f9a5bdb4e53ad97fce9dfa6929a7b047aea74..1fbb076a0f2ed2cf9c037a9a8c78118a53803d17 100644 (file)
@@ -7,6 +7,7 @@
 namespace Friendica\Content\Widget;
 
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Item;
@@ -50,7 +51,7 @@ class TagCloud
                        }
 
                        $tpl = get_markup_template('tagblock_widget.tpl');
-                       $o = replace_macros($tpl, [
+                       $o = Renderer::replaceMacros($tpl, [
                                '$title' => L10n::t('Tags'),
                                '$tags' => $tags
                        ]);
index bbe24545c7bcb6dd0dd1f0c1162f5e7a2c41a27c..14430fd5e3e7a4b9dd30d62d17278216ad10e33f 100644 (file)
@@ -9,6 +9,7 @@ namespace Friendica\Core;
 use Friendica\BaseObject;
 use Friendica\Content\Feature;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\GContact;
@@ -292,7 +293,7 @@ class ACL extends BaseObject
                }
 
                $tpl = get_markup_template('acl_selector.tpl');
-               $o = replace_macros($tpl, [
+               $o = Renderer::replaceMacros($tpl, [
                        '$showall' => L10n::t('Visible to everybody'),
                        '$show' => L10n::t('show'),
                        '$hide' => L10n::t('don\'t show'),
index cb871e2dfba51e8a322a351fe82d8ce931aa1236..f0cf0cd0f40e2d9d3ae836cb5ae238af09be5cb3 100644 (file)
@@ -6,6 +6,7 @@ namespace Friendica\Core;
 
 use DOMDocument;
 use Exception;
+use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\Database\DBStructure;
 use Friendica\Object\Image;
@@ -140,7 +141,7 @@ class Installer
        public function createConfig($phppath, $urlpath, $dbhost, $dbuser, $dbpass, $dbdata, $timezone, $language, $adminmail, $basepath)
        {
                $tpl = get_markup_template('local.ini.tpl');
-               $txt = replace_macros($tpl, [
+               $txt = Renderer::replaceMacros($tpl, [
                        '$phpath' => $phppath,
                        '$dbhost' => $dbhost,
                        '$dbuser' => $dbuser,
@@ -238,7 +239,7 @@ class Installer
                        $help .= L10n::t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See <a href='https://github.com/friendica/friendica/blob/master/doc/Install.md#set-up-the-worker'>'Setup the worker'</a>") . EOL;
                        $help .= EOL . EOL;
                        $tpl = get_markup_template('field_input.tpl');
-                       $help .= replace_macros($tpl, [
+                       $help .= Renderer::replaceMacros($tpl, [
                                '$field' => ['phpath', L10n::t('PHP executable path'), $phppath, L10n::t('Enter full path to php executable. You can leave this blank to continue the installation.')],
                        ]);
                        $phppath = "";
index 2c0cb55173e690a53532311d7d15abeb24693974..70f98059b12ee0d83cf25107f797d8d9d0095389 100644 (file)
@@ -5,6 +5,7 @@
 
 namespace Friendica\Core;
 
+use Exception;
 use Friendica\BaseObject;
 use Friendica\Core\System;
 use Friendica\Render\FriendicaSmarty;
index 07f0b6b171c75bd7f6c4c6fa3c9b16d12f61b581..42c68e4e8131b3a6b96176081e36915bca8b280f 100644 (file)
@@ -6,6 +6,7 @@ namespace Friendica\Core;
 
 use Friendica\BaseObject;
 use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
 use Friendica\Network\HTTPException\InternalServerErrorException;
 use Friendica\Util\XML;
 
@@ -140,7 +141,7 @@ class System extends BaseObject
 
                if (isset($description["title"])) {
                        $tpl = get_markup_template('http_status.tpl');
-                       echo replace_macros($tpl, ['$title' => $description["title"],
+                       echo Renderer::replaceMacros($tpl, ['$title' => $description["title"],
                                '$description' => defaults($description, 'description', '')]);
                }
 
index e6ed20f72cb4e77cff497050078ef16ad242207b..932322e3585e15715475a55b6da426ec6f4cbe9c 100644 (file)
@@ -11,6 +11,7 @@ use Friendica\Core\Addon;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -899,7 +900,7 @@ class Event extends BaseObject
                $profile_link = Contact::magicLinkById($item['author-id']);
 
                $tpl = get_markup_template('event_stream_item.tpl');
-               $return = replace_macros($tpl, [
+               $return = Renderer::replaceMacros($tpl, [
                        '$id'             => $item['event-id'],
                        '$title'          => prepare_text($item['event-summary']),
                        '$dtstart_label'  => L10n::t('Starts:'),
index 0bc8794f8676a6e4729a83611cd5ce272c0c051b..a0806af384c73b357e19ac7a340a7b878182d387 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\BaseModule;
 use Friendica\BaseObject;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\Util\Security;
 
@@ -332,7 +333,7 @@ class Group extends BaseObject
                        $label = L10n::t('Default privacy group for new contacts');
                }
 
-               $o = replace_macros(get_markup_template('group_selection.tpl'), [
+               $o = Renderer::replaceMacros(get_markup_template('group_selection.tpl'), [
                        '$label' => $label,
                        '$groups' => $display_groups
                ]);
@@ -400,7 +401,7 @@ class Group extends BaseObject
                }
 
                $tpl = get_markup_template('group_side.tpl');
-               $o = replace_macros($tpl, [
+               $o = Renderer::replaceMacros($tpl, [
                        '$add' => L10n::t('add'),
                        '$title' => L10n::t('Groups'),
                        '$groups' => $display_groups,
index fba6759459ccef267338b01c788492f6971b435c..c8a229f232d9fa4f2e43de3f9504d14f2459e388 100644 (file)
@@ -15,6 +15,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\PConfig;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
@@ -171,7 +172,7 @@ class Profile
                }
 
                if (local_user() && local_user() == $a->profile['uid'] && $profiledata) {
-                       $a->page['aside'] .= replace_macros(
+                       $a->page['aside'] .= Renderer::replaceMacros(
                                get_markup_template('profile_edlink.tpl'),
                                [
                                        '$editprofile' => L10n::t('Edit profile'),
@@ -517,7 +518,7 @@ class Profile
                $p['url'] = Contact::magicLink(defaults($p, 'url', $profile_url));
 
                $tpl = get_markup_template('profile_vcard.tpl');
-               $o .= replace_macros($tpl, [
+               $o .= Renderer::replaceMacros($tpl, [
                        '$profile' => $p,
                        '$xmpp' => $xmpp,
                        '$connect' => $connect,
@@ -622,7 +623,7 @@ class Profile
                        }
                }
                $tpl = get_markup_template('birthdays_reminder.tpl');
-               return replace_macros($tpl, [
+               return Renderer::replaceMacros($tpl, [
                        '$baseurl' => System::baseUrl(),
                        '$classtoday' => $classtoday,
                        '$count' => $total,
@@ -711,7 +712,7 @@ class Profile
                        $classtoday = (($istoday) ? 'event-today' : '');
                }
                $tpl = get_markup_template('events_reminder.tpl');
-               return replace_macros($tpl, [
+               return Renderer::replaceMacros($tpl, [
                        '$baseurl' => System::baseUrl(),
                        '$classtoday' => $classtoday,
                        '$count' => count($r),
@@ -726,7 +727,7 @@ class Profile
                $o = '';
                $uid = $a->profile['uid'];
 
-               $o .= replace_macros(
+               $o .= Renderer::replaceMacros(
                        get_markup_template('section_title.tpl'),
                        ['$title' => L10n::t('Profile')]
                );
@@ -860,7 +861,7 @@ class Profile
                                $profile['edit'] = [System::baseUrl() . '/profiles/' . $a->profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
                        }
 
-                       return replace_macros($tpl, [
+                       return Renderer::replaceMacros($tpl, [
                                '$title' => L10n::t('Profile'),
                                '$basic' => L10n::t('Basic'),
                                '$advanced' => L10n::t('Advanced'),
@@ -979,7 +980,7 @@ class Profile
 
                $tpl = get_markup_template('common_tabs.tpl');
 
-               return replace_macros($tpl, ['$tabs' => $arr['tabs']]);
+               return Renderer::replaceMacros($tpl, ['$tabs' => $arr['tabs']]);
        }
 
        /**
index 817c70e852400da3e8e02a3af31c475f0ffeb704..a50bcb14def1ec97ba3dbe25bcbbec1a5f96cccd 100644 (file)
@@ -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;
        }
index 2ef2c32299d1ba2a4033dcc4b8e7944c1efe3f96..1662e71f28a76e3486ad4e9410ffb1e47d824fdd 100644 (file)
@@ -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'),
index bcbd5571825ef386492e631d8a711ae1afbbc45d..e0d3bd01613d66115ded2f24a7c82bf1b741b1fc 100644 (file)
@@ -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
index a91c17b730e71cb69812d3e32bf6acd2294b611c..541b79885f9712e0d45c5efa38aae2336c54efc8 100644 (file)
@@ -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',
index db8b55885ae2829aedb3754daf947106f275dc43..5553fb6869a506b2b4535f23b03bbf77e7195306 100644 (file)
@@ -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'),
index bb1b81c2cc9b4dd8524b05f853df3abf140b6145..5303cc58a23e38d112e035c7b963fcd6b548dc1b 100644 (file)
@@ -13,6 +13,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\PConfig;
 use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\Item;
@@ -786,7 +787,7 @@ class Post extends BaseObject
                        }
 
                        $template = get_markup_template($this->getCommentBoxTemplate());
-                       $comment_box = replace_macros($template, [
+                       $comment_box = Renderer::replaceMacros($template, [
                                '$return_path' => $a->query_string,
                                '$threaded'    => $this->isThreaded(),
                                '$jsreload'    => '',
index bc7639b3b740f102b2f6b32e162413c1e961f7ca..3ac74f3eae384ea786e56ba33131d54176d196fe 100644 (file)
@@ -11,6 +11,7 @@ use DateTimeZone;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 
 require_once 'boot.php';
@@ -115,7 +116,7 @@ class Temporal
                $options = str_replace('</select>', '', $options);
 
                $tpl = get_markup_template('field_select_raw.tpl');
-               return replace_macros($tpl, [
+               return Renderer::replaceMacros($tpl, [
                        '$field' => [$name, $label, $current, $help, $options],
                ]);
        }
@@ -141,7 +142,7 @@ class Temporal
                $age = (intval($value) ? self::getAgeByTimezone($value, $a->user["timezone"], $a->user["timezone"]) : "");
 
                $tpl = get_markup_template("field_input.tpl");
-               $o = replace_macros($tpl,
+               $o = Renderer::replaceMacros($tpl,
                        [
                        '$field' => [
                                'dob',
@@ -247,7 +248,7 @@ class Temporal
                $readable_format = str_replace(['Y', 'm', 'd', 'H', 'i'], ['yyyy', 'mm', 'dd', 'HH', 'MM'], $dateformat);
 
                $tpl = get_markup_template('field_datetime.tpl');
-               $o .= replace_macros($tpl, [
+               $o .= Renderer::replaceMacros($tpl, [
                        '$field' => [
                                $id,
                                $label,
index d7774bc51977b1b3091adf4c8d86f4e7026688a9..18e8fb882281aaf90f7c475bde1fa84d0d045fd9 100644 (file)
@@ -39,7 +39,7 @@ text which you don't care for.
 
 Note: The view/lang/en directory contains many HTML template files, some of which
 only have a few words of English text amongst the HTML. Over time we will move
-the translation to the replace_macros() function which calls these files and
+the translation to the Renderer::replaceMacros() function which calls these files and
 then relocate the files to the view directory. The files in the top-level view
 directory are template files which do not require translation.
 
index d8323225d5bf1399d2999e36022786d667f5a46a..dedf418a28e2aaed97e170774be29f02c7d836f5 100644 (file)
@@ -7,6 +7,7 @@ use Friendica\App;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 
 function theme_content(App $a)
@@ -67,7 +68,7 @@ function clean_form(App $a, &$colorset, $user)
        }
 
        $t = get_markup_template("theme_settings.tpl");
-       $o = replace_macros($t, [
+       $o = Renderer::replaceMacros($t, [
                '$submit'   => L10n::t('Submit'),
                '$baseurl'  => System::baseUrl(),
                '$title'    => L10n::t("Theme settings"),
index 8bab362ff92812cf5183b1da737a13aa16c58438..3289618284af93f61d8a410df474961092281997 100644 (file)
@@ -4,6 +4,7 @@ use Friendica\App;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 
 require_once 'view/theme/frio/php/Image.php';
@@ -137,7 +138,7 @@ function frio_form($arr)
                $ctx['$login_bg_color'] = ['frio_login_bg_color', L10n::t('Login page background color'), $arr['login_bg_color'], L10n::t('Leave background image and color empty for theme defaults'), false];
        }
 
-       $o = replace_macros($t, $ctx);
+       $o = Renderer::replaceMacros($t, $ctx);
 
        return $o;
 }
index 562a9ff5f1c67f854c4c5f34ddbced0b5cc67f50..cc9f0488e089a903c07e163cc9ba7f3943fdb1e0 100644 (file)
@@ -7,6 +7,7 @@ use Friendica\App;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 
 function theme_content(App $a) {
@@ -69,7 +70,7 @@ function quattro_form(App $a, $align, $color, $tfs, $pfs) {
        }
 
        $t = get_markup_template("theme_settings.tpl" );
-       $o = replace_macros($t, [
+       $o = Renderer::replaceMacros($t, [
                '$submit'  => L10n::t('Submit'),
                '$baseurl' => System::baseUrl(),
                '$title'   => L10n::t("Theme settings"),
index e961146f6a941dd0d7aac1760a01706130641a54..98175e89bddba7e4e8a22a0ed7ebbe6ca24adca8 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 use Friendica\App;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 
 function smoothly_init(App $a) {
@@ -112,6 +113,6 @@ if (! function_exists('_js_in_foot')) {
                $bottom['$baseurl'] = $baseurl;
                $tpl = get_markup_template('bottom.tpl');
 
-               return $a->page['bottom'] = replace_macros($tpl, $bottom);
+               return $a->page['bottom'] = Renderer::replaceMacros($tpl, $bottom);
        }
 }
index 80225eb08dd943c33b7256e89f0d308d66cae8b6..c6628ad060084f2ec0e5e4c24ead18017d9c65ff 100644 (file)
@@ -7,6 +7,7 @@ use Friendica\App;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 
 function theme_content(App $a)
@@ -71,7 +72,7 @@ function theme_admin(App $a) {
                $helperlist = "https://forum.friendi.ca/profile/helpers";
 
        $t = get_markup_template("theme_admin_settings.tpl");
-       $o = replace_macros($t, [
+       $o = Renderer::replaceMacros($t, [
                '$helperlist' => ['vier_helperlist', L10n::t('Comma separated list of helper forums'), $helperlist, '', ''],
                ]);
 
@@ -115,7 +116,7 @@ function vier_form(App $a, $style, $show_pages, $show_profiles, $show_helpers, $
        $show_or_not = ['0' => L10n::t("don't show"), '1' => L10n::t("show"),];
 
        $t = get_markup_template("theme_settings.tpl");
-       $o = replace_macros($t, [
+       $o = Renderer::replaceMacros($t, [
                '$submit' => L10n::t('Submit'),
                '$baseurl' => System::baseUrl(),
                '$title' => L10n::t("Theme settings"),
index 887ef1c1298a32e2e5840870ef56a8d4f4e5ecbe..7d0c4bdb8665926ec66a5a2656a86c1960735173 100644 (file)
@@ -15,6 +15,7 @@ use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -150,7 +151,7 @@ function vier_community_info()
                        $aside['$comunity_profiles_items'] = [];
 
                        foreach ($r as $rr) {
-                               $entry = replace_macros($tpl, [
+                               $entry = Renderer::replaceMacros($tpl, [
                                        '$id' => $rr['id'],
                                        '$profile_link' => 'follow/?url='.urlencode($rr['url']),
                                        '$photo' => ProxyUtils::proxifyUrl($rr['photo'], false, ProxyUtils::SIZE_MICRO),
@@ -181,7 +182,7 @@ function vier_community_info()
 
                        foreach ($r as $rr) {
                                $profile_link = 'profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
-                               $entry = replace_macros($tpl, [
+                               $entry = Renderer::replaceMacros($tpl, [
                                        '$id' => $rr['id'],
                                        '$profile_link' => $profile_link,
                                        '$photo' => $a->removeBaseURL($rr['thumb']),
@@ -245,7 +246,7 @@ function vier_community_info()
 
                        $tpl = get_markup_template('widget_forumlist_right.tpl');
 
-                       $page = replace_macros(
+                       $page = Renderer::replaceMacros(
                                $tpl,
                                [
                                        '$title'          => L10n::t('Forums'),
@@ -297,7 +298,7 @@ function vier_community_info()
                        $aside['$helpers_items'] = [];
 
                        foreach ($r as $rr) {
-                               $entry = replace_macros($tpl, [
+                               $entry = Renderer::replaceMacros($tpl, [
                                        '$url' => $rr['url'],
                                        '$title' => $rr['name'],
                                ]);
@@ -387,7 +388,7 @@ function vier_community_info()
                        $aside['$con_services'] = $con_services;
 
                        foreach ($r as $rr) {
-                               $entry = replace_macros($tpl, [
+                               $entry = Renderer::replaceMacros($tpl, [
                                        '$url' => $url,
                                        '$photo' => $rr['photo'],
                                        '$alt_text' => $rr['name'],
@@ -400,5 +401,5 @@ function vier_community_info()
 
        //print right_aside
        $tpl = get_markup_template('communityhome.tpl');
-       $a->page['right_aside'] = replace_macros($tpl, $aside);
+       $a->page['right_aside'] = Renderer::replaceMacros($tpl, $aside);
 }