update functions calls for new Renderer class.
use Friendica\Core\Cache;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
use Friendica\Model\Item;
return $html;
} else {
- $t = get_markup_template('settings.tpl', 'addon/advancedcontentfilter/');
- return replace_macros($t, [
+ $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/advancedcontentfilter/');
+ return Renderer::replaceMacros($t, [
'$messages' => [
'backtosettings' => L10n::t('Back to Addon Settings'),
'title' => L10n::t('Advanced Content Filter'),
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
function blackout_install() {
Addon::registerHook('page_header', 'addon/blackout/blackout.php', 'blackout_redirect');
if (! is_string($myend)) { $myend = "YYYY-MM-DD:hhmm"; }
$myurl = Config::get('blackout','url');
if (! is_string($myurl)) { $myurl = "http://www.example.com"; }
- $t = get_markup_template( "admin.tpl", "addon/blackout/" );
+ $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/blackout/" );
- $o = replace_macros($t, [
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
'$rurl' => ["rurl", "Redirect URL", $myurl, "all your visitors from the web will be redirected to this URL"],
'$startdate' => ["startdate", "Begin of the Blackout<br />(YYYY-MM-DD hh:mm)", $mystart, "format is <em>YYYY</em> year, <em>MM</em> month, <em>DD</em> day, <em>hh</em> hour and <em>mm</em> minute"],
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Model\ItemContent;
use Friendica\Util\Proxy as ProxyUtils;
function buffer_addon_admin(App $a, &$o)
{
- $t = get_markup_template("admin.tpl", "addon/buffer/");
+ $t = Renderer::getMarkupTemplate("admin.tpl", "addon/buffer/");
- $o = replace_macros($t, [
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
// name, label, value, help, [extra values]
'$client_id' => ['client_id', L10n::t('Client ID'), Config::get('buffer', 'client_id'), ''],
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
return;
}
- $t = get_markup_template('settings.tpl', 'addon/catavatar/');
+ $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/catavatar/');
$s .= replace_macros ($t, [
'$postpost' => !empty($_POST['catavatar-morecat']) || !empty($_POST['catavatar-emailcat']),
'$uncache' => time(),
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
use Friendica\Util\Network;
use Friendica\Util\Proxy as ProxyUtils;
}
if ($ok) {
- $t = get_markup_template("widget.tpl", "addon/curweather/" );
+ $t = Renderer::getMarkupTemplate("widget.tpl", "addon/curweather/" );
$curweather = replace_macros ($t, [
'$title' => L10n::t("Current Weather"),
'$icon' => ProxyUtils::proxifyUrl('http://openweathermap.org/img/w/'.$res['icon'].'.png'),
'$showonmap' => L10n::t('Show on map')
]);
} else {
- $t = get_markup_template('widget-error.tpl', 'addon/curweather/');
- $curweather = replace_macros( $t, [
+ $t = Renderer::getMarkupTemplate('widget-error.tpl', 'addon/curweather/');
+ $curweather = Renderer::replaceMacros( $t, [
'$problem' => L10n::t('There was a problem accessing the weather data. But have a look'),
'$rpt' => $rpt,
'$atOWM' => L10n::t('at OpenWeatherMap')
$enable_checked = (($enable) ? ' checked="checked" ' : '');
// load template and replace the macros
- $t = get_markup_template("settings.tpl", "addon/curweather/" );
+ $t = Renderer::getMarkupTemplate("settings.tpl", "addon/curweather/" );
$s = replace_macros ($t, [
'$submit' => L10n::t('Save Settings'),
$appid = Config::get('curweather', 'appid');
$cachetime = Config::get('curweather', 'cachetime');
- $t = get_markup_template("admin.tpl", "addon/curweather/" );
+ $t = Renderer::getMarkupTemplate("admin.tpl", "addon/curweather/" );
$o = replace_macros ($t, [
'$submit' => L10n::t('Save Settings'),
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;
$search = ((!empty($_GET['search'])) ? notags(trim(rawurldecode($_GET['search']))) : '');
}
- $tpl = get_markup_template('directory_header.tpl');
+ $tpl = Renderer::getMarkupTemplate('directory_header.tpl');
$globaldir = '';
$gdirpath = Config::get('system', 'directory');
$admin = '';
- $o .= replace_macros($tpl, [
+ $o .= Renderer::replaceMacros($tpl, [
'$search' => $search,
'$globaldir' => $globaldir,
'$desc' => L10n::t('Find on this site'),
$homepage = !empty($profile['homepage']) ? L10n::t('Homepage:') : false;
$about = !empty($profile['about']) ? L10n::t('About:') : false;
- $tpl = get_markup_template('forumdirectory_item.tpl', 'addon/forumdirectory/');
+ $tpl = Renderer::getMarkupTemplate('forumdirectory_item.tpl', 'addon/forumdirectory/');
- $entry = replace_macros($tpl, [
+ $entry = Renderer::replaceMacros($tpl, [
'$id' => $rr['id'],
'$profile_link' => $profile_link,
'$photo' => $rr[$photo],
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
use Friendica\Object\Image;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
function fromgplus_addon_admin(&$a, &$o)
{
- $t = get_markup_template("admin.tpl", "addon/fromgplus/");
+ $t = Renderer::getMarkupTemplate("admin.tpl", "addon/fromgplus/");
- $o = replace_macros($t, [
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
'$key' => ['key', L10n::t('Key'), trim(Config::get('fromgplus', 'key')), ''],
]);
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
use Friendica\Util\Network;
function geocoordinates_install()
function geocoordinates_addon_admin(&$a, &$o)
{
- $t = get_markup_template("admin.tpl", "addon/geocoordinates/");
+ $t = Renderer::getMarkupTemplate("admin.tpl", "addon/geocoordinates/");
- $o = replace_macros($t, [
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
'$api_key' => ['api_key', L10n::t('API Key'), Config::get('geocoordinates', 'api_key'), ''],
'$language' => ['language', L10n::t('Language code (IETF format)'), Config::get('geocoordinates', 'language'), ''],
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Util\Security;
* Display admin settings for this addon
*/
function gravatar_addon_admin (&$a, &$o) {
- $t = get_markup_template( "admin.tpl", "addon/gravatar/" );
+ $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/gravatar/" );
$default_avatar = Config::get('gravatar', 'default_avatar');
$rating = Config::get('gravatar', 'rating');
// output Gravatar settings
$o .= '<input type="hidden" name="form_security_token" value="' . BaseModule::getFormSecurityToken("gravatarsave") .'">';
- $o .= replace_macros( $t, [
+ $o .= Renderer::replaceMacros( $t, [
'$submit' => L10n::t('Save Settings'),
'$default_avatar' => ['avatar', L10n::t('Default avatar image'), $default_avatar, L10n::t('Select default avatar image if none was found at Gravatar. See README'), $default_avatars],
'$rating' => ['rating', L10n::t('Rating of images'), $rating, L10n::t('Select the appropriate avatar rating for your site. See README'), $ratings],
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
use Friendica\Util\Proxy as ProxyUtils;
function impressum_install() {
info(L10n::t('Settings updated.'). EOL );
}
function impressum_addon_admin (&$a, &$o) {
- $t = get_markup_template( "admin.tpl", "addon/impressum/" );
- $o = replace_macros($t, [
+ $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/impressum/" );
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
'$owner' => ['owner', L10n::t('Site Owner'), Config::get('impressum','owner'), L10n::t('The page operators name.')],
'$ownerprofile' => ['ownerprofile', L10n::t('Site Owners Profile'), Config::get('impressum','ownerprofile'), L10n::t('Profile address of the operator.')],
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
function irc_install() {
Addon::registerHook('app_menu', 'addon/irc/irc.php', 'irc_app_menu');
$sitechats = PConfig::get( local_user(), 'irc','sitechats'); /* popular channels */
$autochans = PConfig::get( local_user(), 'irc','autochans'); /* auto connect chans */
- $t = get_markup_template( "settings.tpl", "addon/irc/" );
- $s .= replace_macros($t, [
+ $t = Renderer::getMarkupTemplate( "settings.tpl", "addon/irc/" );
+ $s .= Renderer::replaceMacros($t, [
'$header' => L10n::t('IRC Settings'),
'$info' => L10n::t('Here you can change the system wide settings for the channels to automatically join and access via the side bar. Note the changes you do here, only effect the channel selection if you are logged in.'),
'$submit' => L10n::t('Save Settings'),
function irc_addon_admin (&$a, &$o) {
$sitechats = Config::get('irc','sitechats'); /* popular channels */
$autochans = Config::get('irc','autochans'); /* auto connect chans */
- $t = get_markup_template( "admin.tpl", "addon/irc/" );
- $o = replace_macros($t, [
+ $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/irc/" );
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
'$autochans' => [ 'autochans', L10n::t('Channel(s) to auto connect (comma separated)'), $autochans, L10n::t('List of channels that shall automatically connected to when the app is launched.')],
'$sitechats' => [ 'sitechats', L10n::t('Popular Channels (comma separated)'), $sitechats, L10n::t('List of popular channels, will be displayed at the side and hotlinked for easy joining.') ]
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
/* Define the hooks we want to use
* that is, we have settings, we need to save the settings and we want
$minconfidence = PConfig::get(local_user(), 'langfilter', 'minconfidence') * 100;
$minlength = PConfig::get(local_user(), 'langfilter', 'minlength');
- $t = get_markup_template("settings.tpl", "addon/langfilter/");
- $s .= replace_macros($t, [
+ $t = Renderer::getMarkupTemplate("settings.tpl", "addon/langfilter/");
+ $s .= Renderer::replaceMacros($t, [
'$title' => L10n::t("Language Filter"),
'$intro' => L10n::t('This addon tries to identify the language posts are writen in. If it does not match any language specifed below, posts will be hidden by collapsing them.'),
'$enabled' => ['langfilter_enable', L10n::t('Use the language filter'), $enable_checked, ''],
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Util\Security;
*/
function libravatar_addon_admin(&$a, &$o)
{
- $t = get_markup_template("admin.tpl", "addon/libravatar");
+ $t = Renderer::getMarkupTemplate("admin.tpl", "addon/libravatar");
$default_avatar = Config::get('libravatar', 'default_avatar');
// output Libravatar settings
$o .= '<input type="hidden" name="form_security_token" value="' . BaseModule::getFormSecurityToken("libravatarsave") .'">';
- $o .= replace_macros( $t, [
+ $o .= Renderer::replaceMacros( $t, [
'$submit' => L10n::t('Save Settings'),
'$default_avatar' => ['avatar', L10n::t('Default avatar image'), $default_avatar, L10n::t('Select default avatar image if none was found. See README'), $default_avatars],
]);
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Util\Network;
use Friendica\Model\Item;
function mailstream_addon_admin(&$a,&$o) {
$frommail = Config::get('mailstream', 'frommail');
- $template = get_markup_template('admin.tpl', 'addon/mailstream/');
+ $template = Renderer::getMarkupTemplate('admin.tpl', 'addon/mailstream/');
$config = ['frommail',
L10n::t('From Address'),
$frommail,
L10n::t('Email address that stream items will appear to be from.')];
- $o .= replace_macros($template, [
+ $o .= Renderer::replaceMacros($template, [
'$frommail' => $config,
'$submit' => L10n::t('Save Settings')]);
}
}
$mail->IsHTML(true);
$mail->CharSet = 'utf-8';
- $template = get_markup_template('mail.tpl', 'addon/mailstream/');
+ $template = Renderer::getMarkupTemplate('mail.tpl', 'addon/mailstream/');
$item['body'] = BBCode::convert($item['body']);
$item['url'] = $a->getBaseURL() . '/display/' . $user['nickname'] . '/' . $item['id'];
- $mail->Body = replace_macros($template, [
+ $mail->Body = Renderer::replaceMacros($template, [
'$upstream' => L10n::t('Upstream'),
'$local' => L10n::t('Local'),
'$item' => $item]);
$address = PConfig::get(local_user(), 'mailstream', 'address');
$nolikes = PConfig::get(local_user(), 'mailstream', 'nolikes');
$attachimg= PConfig::get(local_user(), 'mailstream', 'attachimg');
- $template = get_markup_template('settings.tpl', 'addon/mailstream/');
- $s .= replace_macros($template, [
+ $template = Renderer::getMarkupTemplate('settings.tpl', 'addon/mailstream/');
+ $s .= Renderer::replaceMacros($template, [
'$enabled' => [
'mailstream_enabled',
L10n::t('Enabled'),
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
function mathjax_install()
{
$use = PConfig::get(local_user(), 'mathjax', 'use', false);
- $tpl = get_markup_template('settings.tpl', __DIR__);
- $s .= replace_macros($tpl, [
+ $tpl = Renderer::getMarkupTemplate('settings.tpl', __DIR__);
+ $s .= Renderer::replaceMacros($tpl, [
'$title' => 'MathJax',
'$description' => L10n::t('The MathJax addon renders mathematical formulae written using the LaTeX syntax surrounded by the usual $$ or an eqnarray block in the postings of your wall,network tab and private mail.'),
'$mathjax_use' => ['mathjax_use', L10n::t('Use the MathJax renderer'), $use, ''],
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
function newmemberwidget_install()
{
function newmemberwidget_addon_admin(&$a, &$o)
{
- $t = get_markup_template('admin.tpl', 'addon/newmemberwidget');
- $o = replace_macros($t, [
+ $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/newmemberwidget');
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
'$freetext' => [ "freetext", L10n::t("Message"), Config::get("newmemberwidget", "freetext"), L10n::t("Your message for new members. You can use bbcode here.")],
'$linkglobalsupport' => [ "linkglobalsupport", L10n::t('Add a link to global support forum'), Config::get('newmemberwidget', 'linkglobalsupport'), L10n::t('Should a link to the global support forum be displayed?')." (<a href='https://forum.friendi.ca/profile/helpers'>@helpers</a>)"],
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
use Friendica\Util\Emailer;
function notifyall_install()
$title = L10n::t('Send email to all members of this Friendica instance.');
- $o = replace_macros(get_markup_template('notifyall_form.tpl', 'addon/notifyall/'), [
+ $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('notifyall_form.tpl', 'addon/notifyall/'), [
'$title' => $title,
'$text' => htmlspecialchars(defaults($_REQUEST, 'text', '')),
'$subject' => ['subject', L10n::t('Message subject'), defaults($_REQUEST, 'subject', ''),''],
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Util\Network;
function openstreetmap_addon_admin(&$a, &$o)
{
- $t = get_markup_template("admin.tpl", "addon/openstreetmap/");
+ $t = Renderer::getMarkupTemplate("admin.tpl", "addon/openstreetmap/");
$tmsserver = Config::get('openstreetmap', 'tmsserver', OSM_TMS);
$nomserver = Config::get('openstreetmap', 'nomserver', OSM_NOM);
$zoom = Config::get('openstreetmap', 'zoom', OSM_ZOOM);
$nomserver = OSM_NOM;
}
- $o = replace_macros($t, [
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Submit'),
'$tmsserver' => ['tmsserver', L10n::t('Tile Server URL'), $tmsserver, L10n::t('A list of <a href="http://wiki.openstreetmap.org/wiki/TMS" target="_blank">public tile servers</a>')],
'$nomserver' => ['nomserver', L10n::t('Nominatim (reverse geocoding) Server URL'), $nomserver, L10n::t('A list of <a href="http://wiki.openstreetmap.org/wiki/Nominatim" target="_blank">Nominatim servers</a>')],
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
function pageheader_install() {
Addon::registerHook('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch');
if(! $words)
$words = '';
- $t = get_markup_template("settings.tpl", "addon/pageheader/");
- $s .= replace_macros($t, [
+ $t = Renderer::getMarkupTemplate("settings.tpl", "addon/pageheader/");
+ $s .= Renderer::replaceMacros($t, [
'$title' => L10n::t('"pageheader" Settings'),
'$phwords' => ['pageheader-words', L10n::t('Message'), $words, L10n::t('Message to display on every page on this server (or put a pageheader.html file in your docroot)')],
'$submit' => L10n::t('Save Settings')
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
function piwik_install() {
Addon::registerHook('load_config', 'addon/piwik/piwik.php', 'piwik_load_config');
}
}
function piwik_addon_admin (&$a, &$o) {
- $t = get_markup_template( "admin.tpl", "addon/piwik/" );
- $o = replace_macros( $t, [
+ $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/piwik/" );
+ $o = Renderer::replaceMacros( $t, [
'$submit' => L10n::t('Save Settings'),
'$piwikbaseurl' => ['baseurl', L10n::t('Piwik Base URL'), Config::get('piwik','baseurl' ), L10n::t('Absolute path to your Piwik installation. (without protocol (http/s), with trailing slash)')],
'$siteid' => ['siteid', L10n::t('Site ID'), Config::get('piwik','siteid' ), ''],
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Util\DateTimeFormat;
function public_server_addon_admin(&$a, &$o)
{
$token = BaseModule::getFormSecurityToken("publicserver");
- $t = get_markup_template("admin.tpl", "addon/public_server");
- $o = replace_macros($t, [
+ $t = Renderer::getMarkupTemplate("admin.tpl", "addon/public_server");
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
'$form_security_token' => $token,
'$infotext' => L10n::t('Set any of these options to 0 to deactivate it.'),
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
use Friendica\Database\DBA;
function remote_permissions_install() {
/* Add some HTML to the existing form */
// $t = file_get_contents("addon/remote_permissions/settings.tpl" );
- $t = get_markup_template("settings.tpl", "addon/remote_permissions/" );
- $o .= replace_macros($t, [
+ $t = Renderer::getMarkupTemplate("settings.tpl", "addon/remote_permissions/" );
+ $o .= Renderer::replaceMacros($t, [
'$remote_perms_title' => L10n::t('Remote Permissions Settings'),
'$remote_perms_label' => L10n::t('Allow recipients of your private posts to see the other recipients of the posts'),
'$checked' => (($remote_perms == 1) ? 'checked="checked"' : ''),
}
function remote_permissions_addon_admin(&$a, &$o){
- $t = get_markup_template( "admin.tpl", "addon/remote_permissions/" );
- $o = replace_macros($t, [
+ $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/remote_permissions/" );
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
'$global' => ['remotepermschoice', L10n::t('Global'), 1, L10n::t('The posts of every user on this server show the post recipients'), Config::get('remote_perms', 'global') == 1],
'$individual' => ['remotepermschoice', L10n::t('Individual'), 2, L10n::t('Each user chooses whether his/her posts show the post recipients'), Config::get('remote_perms', 'global') == 0]
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
use Friendica\Util\Emailer;
/* because the fraking openpgp-php is in composer, require libs in composer
$enable = intval(PConfig::get(local_user(), 'securemail', 'enable'));
$publickey = PConfig::get(local_user(), 'securemail', 'pkey');
- $t = get_markup_template('admin.tpl', 'addon/securemail/');
+ $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/securemail/');
- $s .= replace_macros($t, [
+ $s .= Renderer::replaceMacros($t, [
'$title' => L10n::t('"Secure Mail" Settings'),
'$submit' => L10n::t('Save Settings'),
'$test' => L10n::t('Save and send test'), //NOTE: update also in 'post'
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\GContact;
//'applicationname' => Array("applicationname[$id]", L10n::t("Application name"), "", ""),
];
- $t = get_markup_template("admin.tpl", "addon/statusnet/");
- $o = replace_macros($t, [
+ $t = Renderer::getMarkupTemplate("admin.tpl", "addon/statusnet/");
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
'$sites' => $sitesform,
]);
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
use Friendica\Database\DBA;
function tumblr_install()
function tumblr_addon_admin(App $a, &$o)
{
- $t = get_markup_template( "admin.tpl", "addon/tumblr/" );
+ $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/tumblr/" );
- $o = replace_macros($t, [
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
// name, label, value, help, [extra values]
'$consumer_key' => ['consumer_key', L10n::t('Consumer Key'), Config::get('tumblr', 'consumer_key' ), ''],
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
use Friendica\Core\Protocol;
+use Friendica\Core\Renderer;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
try {
$details = $connection->get('account/verify_credentials');
- $field_checkbox = get_markup_template('field_checkbox.tpl');
+ $field_checkbox = Renderer::getMarkupTemplate('field_checkbox.tpl');
$s .= '<div id="twitter-info" >
<p>' . L10n::t('Currently connected to: ') . '<a href="https://twitter.com/' . $details->screen_name . '" target="_twitter">' . $details->screen_name . '</a>
</div>';
$s .= '<div class="clear"></div>';
- $s .= replace_macros($field_checkbox, [
+ $s .= Renderer::replaceMacros($field_checkbox, [
'$field' => ['twitter-enable', L10n::t('Allow posting to Twitter'), $enabled, L10n::t('If enabled all your <strong>public</strong> postings can be posted to the associated Twitter account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.')]
]);
if ($a->user['hidewall']) {
$s .= '<p>' . L10n::t('<strong>Note</strong>: Due to your privacy settings (<em>Hide your profile details from unknown viewers?</em>) the link potentially included in public postings relayed to Twitter will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted.') . '</p>';
}
- $s .= replace_macros($field_checkbox, [
+ $s .= Renderer::replaceMacros($field_checkbox, [
'$field' => ['twitter-default', L10n::t('Send public postings to Twitter by default'), $defenabled, '']
]);
- $s .= replace_macros($field_checkbox, [
+ $s .= Renderer::replaceMacros($field_checkbox, [
'$field' => ['twitter-mirror', L10n::t('Mirror all posts from twitter that are no replies'), $mirrorenabled, '']
]);
- $s .= replace_macros($field_checkbox, [
+ $s .= Renderer::replaceMacros($field_checkbox, [
'$field' => ['twitter-import', L10n::t('Import the remote timeline'), $importenabled, '']
]);
- $s .= replace_macros($field_checkbox, [
+ $s .= Renderer::replaceMacros($field_checkbox, [
'$field' => ['twitter-create_user', L10n::t('Automatically create contacts'), $create_userenabled, L10n::t('This will automatically create a contact in Friendica as soon as you receive a message from an existing contact via the Twitter network. If you do not enable this, you need to manually add those Twitter contacts in Friendica from whom you would like to see posts here. However if enabled, you cannot merely remove a twitter contact from the Friendica contact list, as it will recreate this contact when they post again.')]
]);
$s .= '<div class="clear"></div>';
function twitter_addon_admin(App $a, &$o)
{
- $t = get_markup_template("admin.tpl", "addon/twitter/");
+ $t = Renderer::getMarkupTemplate("admin.tpl", "addon/twitter/");
- $o = replace_macros($t, [
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
// name, label, value, help, [extra values]
'$consumerkey' => ['consumerkey', L10n::t('Consumer key'), Config::get('twitter', 'consumerkey'), ''],
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
function webrtc_install() {
Addon::registerHook('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu');
}
function webrtc_addon_admin (&$a, &$o) {
- $t = get_markup_template( "admin.tpl", "addon/webrtc/" );
- $o = replace_macros( $t, [
+ $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/webrtc/" );
+ $o = Renderer::replaceMacros( $t, [
'$submit' => L10n::t('Save Settings'),
'$webrtcurl' => ['webrtcurl', L10n::t('WebRTC Base URL'), Config::get('webrtc','webrtcurl' ), L10n::t('Page your users will create a WebRTC chat room on. For example you could use https://live.mayfirst.org .')],
]);
<?php
use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
use Friendica\Database\DBA;
function like_widget_name() {
$o = "";
# $t = file_get_contents( dirname(__file__). "/widget_like.tpl" );
- $t = get_markup_template("widget_like.tpl", "addon/widgets/");
- $o .= replace_macros($t, [
+ $t = Renderer::getMarkupTemplate("widget_like.tpl", "addon/widgets/");
+ $o .= Renderer::replaceMacros($t, [
'$like' => $likes,
'$strlike' => L10n::tt("%d person likes this", "%d people like this", $likes),
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
use Friendica\Database\DBA;
function widgets_install() {
# $t = file_get_contents( dirname(__file__). "/settings.tpl" );
- $t = get_markup_template("settings.tpl", "addon/widgets/");
- $o .= replace_macros($t, [
+ $t = Renderer::getMarkupTemplate("settings.tpl", "addon/widgets/");
+ $o .= Renderer::replaceMacros($t, [
'$submit' => L10n::t('Generate new key'),
'$baseurl' => $a->getBaseURL(),
'$title' => "Widgets",
$widget_size = call_user_func($a->argv[1].'_widget_size');
$script = file_get_contents(dirname(__file__)."/widgets.js");
- $o .= replace_macros($script, [
+ $o .= Renderer::replaceMacros($script, [
'$entrypoint' => $a->getBaseURL()."/widgets/".$a->argv[1]."/cb/",
'$key' => $conf['key'],
'$widget_id' => 'f9a_'.$a->argv[1]."_"._randomAlphaNum(6),
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
+use Friendica\Core\Renderer;
function xmpp_install()
{
function xmpp_addon_admin(App $a, &$o)
{
- $t = get_markup_template('admin.tpl', 'addon/xmpp/');
+ $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/xmpp/');
- $o = replace_macros($t, [
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
'$bosh_proxy' => ['bosh_proxy', L10n::t('Jabber BOSH host'), Config::get('xmpp', 'bosh_proxy'), ''],
'$central_userbase' => ['central_userbase', L10n::t('Use central userbase'), Config::get('xmpp', 'central_userbase'), L10n::t('If enabled, users will automatically login to an ejabberd server that has to be installed on this machine with synchronized credentials via the "auth_ejabberd.php" script.')],