1
1
Fork 0

deprecate load_view_file

This commit is contained in:
Friendika 2011-05-11 04:37:13 -07:00
parent a00813497f
commit b2e92e0af3
36 changed files with 135 additions and 102 deletions

View file

@ -828,7 +828,7 @@ function escape_tags($string) {
if(! function_exists('login')) { if(! function_exists('login')) {
function login($register = false) { function login($register = false) {
$o = ""; $o = "";
$register_tpl = (($register) ? file_get_contents("view/register-link.tpl") : ""); $register_tpl = (($register) ? get_markup_template("register-link.tpl") : "");
$register_html = replace_macros($register_tpl,array( $register_html = replace_macros($register_tpl,array(
'$title' => t('Create a New Account'), '$title' => t('Create a New Account'),
@ -852,10 +852,10 @@ function login($register = false) {
$lostlink = t('Password Reset'); $lostlink = t('Password Reset');
if(local_user()) { if(local_user()) {
$tpl = file_get_contents("view/logout.tpl"); $tpl = get_markup_template("logout.tpl");
} }
else { else {
$tpl = file_get_contents("view/login.tpl"); $tpl = get_markup_template("login.tpl");
} }
@ -1864,6 +1864,8 @@ function allowed_email($email) {
// wrapper to load a view template, checking for alternate // wrapper to load a view template, checking for alternate
// languages before falling back to the default // languages before falling back to the default
// obsolete, deprecated.
if(! function_exists('load_view_file')) { if(! function_exists('load_view_file')) {
function load_view_file($s) { function load_view_file($s) {
global $lang, $a; global $lang, $a;
@ -1882,6 +1884,37 @@ function load_view_file($s) {
return file_get_contents($s); return file_get_contents($s);
}} }}
if(! function_exists('get_intltext_template')) {
function get_intltext_template($s) {
global $lang;
if(! isset($lang))
$lang = 'en';
if(file_exists("view/$lang/$s"))
return file_get_contents("view/$lang/$s");
elseif(file_exists("view/en/$s"))
return file_get_contents("view/en/$s");
else
return file_get_contents("view/$s");
}}
if(! function_exists('get_markup_template')) {
function get_markup_template($s) {
$theme = current_theme();
if(file_exists("view/theme/$theme/$s"))
return file_get_contents("view/theme/$theme/$s");
else
return file_get_contents("view/$s");
}}
// for html,xml parsing - let's say you've got // for html,xml parsing - let's say you've got
// an attribute foobar="class1 class2 class3" // an attribute foobar="class1 class2 class3"
// and you want to find out if it contains 'class3'. // and you want to find out if it contains 'class3'.
@ -2307,7 +2340,7 @@ function profile_sidebar($profile) {
$homepage = ((x($profile,'homepage') == 1) ? '<div class="homepage"><span class="homepage-label">' . t('Homepage:') . ' </span><span class="homepage-url">' . linkify($profile['homepage']) . '</span></div><div class="profile-clear"></div>' : ''); $homepage = ((x($profile,'homepage') == 1) ? '<div class="homepage"><span class="homepage-label">' . t('Homepage:') . ' </span><span class="homepage-url">' . linkify($profile['homepage']) . '</span></div><div class="profile-clear"></div>' : '');
$tpl = file_get_contents('view/profile_vcard.tpl'); $tpl = get_markup_template('profile_vcard.tpl');
$o .= replace_macros($tpl, array( $o .= replace_macros($tpl, array(
'$fullname' => $fullname, '$fullname' => $fullname,

View file

@ -273,7 +273,7 @@
case "atom": case "atom":
case "xml": case "xml":
$data = api_xmlify($data); $data = api_xmlify($data);
$tpl = file_get_contents("view/api_".$templatename."_".$type.".tpl"); $tpl = get_markup_template("api_".$templatename."_".$type.".tpl");
$ret = replace_macros($tpl, $data); $ret = replace_macros($tpl, $data);
break; break;
case "json": case "json":

View file

@ -104,11 +104,11 @@ function conversation(&$a, $items, $mode, $update) {
load_contact_links(local_user()); load_contact_links(local_user());
$cmnt_tpl = file_get_contents('view/comment_item.tpl'); $cmnt_tpl = get_markup_template('comment_item.tpl');
$like_tpl = file_get_contents('view/like.tpl'); $like_tpl = get_markup_template('like.tpl');
$noshare_tpl = file_get_contents('view/like_noshare.tpl'); $noshare_tpl = get_markup_template('like_noshare.tpl');
$tpl = load_view_file('view/wall_item.tpl'); $tpl = get_markup_template('wall_item.tpl');
$wallwall = load_view_file('view/wallwall_item.tpl'); $wallwall = get_markup_template('wallwall_item.tpl');
$alike = array(); $alike = array();
$dlike = array(); $dlike = array();
@ -120,8 +120,8 @@ function conversation(&$a, $items, $mode, $update) {
// "New Item View" on network page or search page results // "New Item View" on network page or search page results
// - just loop through the items and format them minimally for display // - just loop through the items and format them minimally for display
$tpl = load_view_file('view/search_item.tpl'); $tpl = get_markup_template('search_item.tpl');
$droptpl = file_get_contents('view/wall_fake_drop.tpl'); $droptpl = get_markup_template('wall_fake_drop.tpl');
foreach($items as $item) { foreach($items as $item) {
@ -383,7 +383,7 @@ function conversation(&$a, $items, $mode, $update) {
? '<a class="editpost" href="' . $a->get_baseurl() . '/editpost/' . $item['id'] ? '<a class="editpost" href="' . $a->get_baseurl() . '/editpost/' . $item['id']
. '" title="' . t('Edit') . '"><img src="images/pencil.gif" /></a>' . '" title="' . t('Edit') . '"><img src="images/pencil.gif" /></a>'
: ''); : '');
$drop = replace_macros(file_get_contents('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete'))); $drop = replace_macros(get_markup_template('wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete')));
$photo = $item['photo']; $photo = $item['photo'];
$thumb = $item['thumb']; $thumb = $item['thumb'];
@ -662,9 +662,9 @@ function status_editor($a,$x) {
$o = ''; $o = '';
$geotag = (($x['allow_location']) ? file_get_contents('view/jot_geotag.tpl') : ''); $geotag = (($x['allow_location']) ? get_markup_template('jot_geotag.tpl') : '');
$tpl = load_view_file('view/jot-header.tpl'); $tpl = get_markup_template('jot-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array( $a->page['htmlhead'] .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(), '$baseurl' => $a->get_baseurl(),
@ -680,7 +680,7 @@ function status_editor($a,$x) {
)); ));
$tpl = load_view_file("view/jot.tpl"); $tpl = get_markup_template("jot.tpl");
$jotplugins = ''; $jotplugins = '';
$jotnets = ''; $jotnets = '';

View file

@ -113,7 +113,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0)
$items = $r; $items = $r;
$feed_template = file_get_contents('view/atom_feed.tpl'); $feed_template = get_markup_template('atom_feed.tpl');
$atom = ''; $atom = '';
@ -1421,7 +1421,7 @@ function new_follower($importer,$contact,$datarray,$item) {
$a = get_app(); $a = get_app();
if(count($r)) { if(count($r)) {
if(($r[0]['notify-flags'] & NOTIFY_INTRO) && ($r[0]['page-flags'] == PAGE_NORMAL)) { if(($r[0]['notify-flags'] & NOTIFY_INTRO) && ($r[0]['page-flags'] == PAGE_NORMAL)) {
$email_tpl = load_view_file('view/follow_notify_eml.tpl'); $email_tpl = get_intltext_template('follow_notify_eml.tpl');
$email = replace_macros($email_tpl, array( $email = replace_macros($email_tpl, array(
'$requestor' => ((strlen($name)) ? $name : t('[Name Withheld]')), '$requestor' => ((strlen($name)) ? $name : t('[Name Withheld]')),
'$url' => $url, '$url' => $url,

View file

@ -125,7 +125,7 @@ function nav(&$a) {
$banner .= '<a href="http://project.friendika.com"><img id="logo-img" src="images/friendika-32.png" alt="logo" /></a><span id="logo-text"><a href="http://project.friendika.com">Friendika</a></span>'; $banner .= '<a href="http://project.friendika.com"><img id="logo-img" src="images/friendika-32.png" alt="logo" /></a><span id="logo-text"><a href="http://project.friendika.com">Friendika</a></span>';
$tpl = load_view_file('view/nav.tpl'); $tpl = get_markup_template('nav.tpl');
$a->page['nav'] .= replace_macros($tpl, array( $a->page['nav'] .= replace_macros($tpl, array(
'$langselector' => lang_selector(), '$langselector' => lang_selector(),

View file

@ -191,8 +191,8 @@ function notifier_run($argv, $argc){
$contacts = $r; $contacts = $r;
} }
$feed_template = file_get_contents('view/atom_feed.tpl'); $feed_template = get_markup_template('atom_feed.tpl');
$mail_template = file_get_contents('view/atom_mail.tpl'); $mail_template = get_markup_template('atom_mail.tpl');
$atom = ''; $atom = '';
$slaps = array(); $slaps = array();

View file

@ -161,7 +161,7 @@ EOT;
$signature2 = base64url_encode($rsa->sign($data)); $signature2 = base64url_encode($rsa->sign($data));
$salmon_tpl = file_get_contents('view/magicsig.tpl'); $salmon_tpl = get_markup_template('magicsig.tpl');
$salmon = replace_macros($salmon_tpl,array( $salmon = replace_macros($salmon_tpl,array(
'$data' => $data, '$data' => $data,
'$encoding' => $encoding, '$encoding' => $encoding,

View file

@ -86,7 +86,7 @@
$r[$a] = $this->_get_var($b); $r[$a] = $this->_get_var($b);
} }
$this->nodes = Array(); $this->nodes = Array();
$tpl = load_view_file($tplfile); $tpl = get_markup_template($tplfile);
$ret = $this->replace($tpl, $r); $ret = $this->replace($tpl, $r);
$this->_pop_stack(); $this->_pop_stack();
return $ret; return $ret;

View file

@ -14,7 +14,7 @@ function contacts_init(&$a) {
if(strlen(get_config('system','directory_submit_url'))) if(strlen(get_config('system','directory_submit_url')))
$a->page['aside'] .= '<div class="side-link" id="side-match-link"><a href="match" >' . t('Find People With Shared Interests') . '</a></div>'; $a->page['aside'] .= '<div class="side-link" id="side-match-link"><a href="match" >' . t('Find People With Shared Interests') . '</a></div>';
$tpl = file_get_contents('view/follow.tpl'); $tpl = get_markup_template('follow.tpl');
$a->page['aside'] .= replace_macros($tpl,array( $a->page['aside'] .= replace_macros($tpl,array(
'$label' => t('Connect/Follow'), '$label' => t('Connect/Follow'),
'$hint' => t('Example: bob@example.com, http://example.com/barbara'), '$hint' => t('Example: bob@example.com, http://example.com/barbara'),
@ -168,7 +168,7 @@ function contacts_content(&$a) {
// create an unfollow slap // create an unfollow slap
if($orig_record[0]['network'] === 'stat') { if($orig_record[0]['network'] === 'stat') {
$tpl = file_get_contents('view/follow_slap.tpl'); $tpl = get_markup_template('follow_slap.tpl');
$slap = replace_macros($tpl, array( $slap = replace_macros($tpl, array(
'$name' => $a->user['username'], '$name' => $a->user['username'],
'$profile_page' => $a->get_baseurl() . '/profile/' . $a->user['nickname'], '$profile_page' => $a->get_baseurl() . '/profile/' . $a->user['nickname'],
@ -215,12 +215,12 @@ function contacts_content(&$a) {
return; return;
} }
$tpl = file_get_contents('view/contact_head.tpl'); $tpl = get_markup_template('contact_head.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl())); $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
require_once('include/contact_selectors.php'); require_once('include/contact_selectors.php');
$tpl = file_get_contents("view/contact_edit.tpl"); $tpl = get_markup_template("contact_edit.tpl");
switch($r[0]['rel']) { switch($r[0]['rel']) {
case REL_BUD: case REL_BUD:
@ -317,7 +317,7 @@ function contacts_content(&$a) {
$search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : ''); $search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : '');
$tpl = file_get_contents("view/contacts-top.tpl"); $tpl = get_markup_template("contacts-top.tpl");
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$header' => t('Contacts'), '$header' => t('Contacts'),
'$hide_url' => ((strlen($sql_extra)) ? 'contacts/all' : 'contacts' ), '$hide_url' => ((strlen($sql_extra)) ? 'contacts/all' : 'contacts' ),
@ -351,7 +351,7 @@ function contacts_content(&$a) {
if(count($r)) { if(count($r)) {
$tpl = file_get_contents("view/contact_template.tpl"); $tpl = get_markup_template("contact_template.tpl");
foreach($r as $rr) { foreach($r as $rr) {
if($rr['self']) if($rr['self'])

View file

@ -80,7 +80,7 @@ function crepair_content(&$a) {
$o .= '<div class="error-message">' . $msg2 . EOL . EOL. $msg3 . '</div>'; $o .= '<div class="error-message">' . $msg2 . EOL . EOL. $msg3 . '</div>';
$tpl = file_get_contents('view/crepair.tpl'); $tpl = get_markup_template('crepair.tpl');
$o .= replace_macros($tpl, array( $o .= replace_macros($tpl, array(
'$label_name' => t('Name'), '$label_name' => t('Name'),
'$label_nick' => t('Account Nickname'), '$label_nick' => t('Account Nickname'),

View file

@ -639,8 +639,8 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
if((count($r)) && ($r[0]['notify-flags'] & NOTIFY_CONFIRM)) { if((count($r)) && ($r[0]['notify-flags'] & NOTIFY_CONFIRM)) {
$tpl = (($new_relation == REL_BUD) $tpl = (($new_relation == REL_BUD)
? load_view_file('view/friend_complete_eml.tpl') ? get_intltext_template('friend_complete_eml.tpl')
: load_view_file('view/intro_complete_eml.tpl')); : get_intltext_template('intro_complete_eml.tpl'));
$email_tpl = replace_macros($tpl, array( $email_tpl = replace_macros($tpl, array(
'$sitename' => $a->config['sitename'], '$sitename' => $a->config['sitename'],

View file

@ -210,7 +210,7 @@ function dfrn_notify_post(&$a) {
= html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), "<br />\n",$msg['body'])))); = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), "<br />\n",$msg['body']))));
// load the template for private message notifications // load the template for private message notifications
$tpl = load_view_file('view/mail_received_html_body_eml.tpl'); $tpl = get_intltext_template('mail_received_html_body_eml.tpl');
$email_html_body_tpl = replace_macros($tpl,array( $email_html_body_tpl = replace_macros($tpl,array(
'$siteName' => $a->config['sitename'], // name of this site '$siteName' => $a->config['sitename'], // name of this site
'$siteurl' => $a->get_baseurl(), // descriptive url of this site '$siteurl' => $a->get_baseurl(), // descriptive url of this site
@ -225,7 +225,7 @@ function dfrn_notify_post(&$a) {
)); ));
// load the template for private message notifications // load the template for private message notifications
$tpl = load_view_file('view/mail_received_text_body_eml.tpl'); $tpl = get_intltext_template('mail_received_text_body_eml.tpl');
$email_text_body_tpl = replace_macros($tpl,array( $email_text_body_tpl = replace_macros($tpl,array(
'$siteName' => $a->config['sitename'], // name of this site '$siteName' => $a->config['sitename'], // name of this site
'$siteurl' => $a->get_baseurl(), // descriptive url of this site '$siteurl' => $a->get_baseurl(), // descriptive url of this site
@ -389,7 +389,7 @@ function dfrn_notify_post(&$a) {
if((! $is_like) && ($importer['notify-flags'] & NOTIFY_COMMENT) && (! $importer['self'])) { if((! $is_like) && ($importer['notify-flags'] & NOTIFY_COMMENT) && (! $importer['self'])) {
require_once('bbcode.php'); require_once('bbcode.php');
$from = stripslashes($datarray['author-name']); $from = stripslashes($datarray['author-name']);
$tpl = load_view_file('view/cmnt_received_eml.tpl'); $tpl = get_intltext_template('cmnt_received_eml.tpl');
$email_tpl = replace_macros($tpl, array( $email_tpl = replace_macros($tpl, array(
'$sitename' => $a->config['sitename'], '$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(), '$siteurl' => $a->get_baseurl(),
@ -479,7 +479,7 @@ function dfrn_notify_post(&$a) {
continue; continue;
require_once('bbcode.php'); require_once('bbcode.php');
$from = stripslashes($datarray['author-name']); $from = stripslashes($datarray['author-name']);
$tpl = load_view_file('view/cmnt_received_eml.tpl'); $tpl = get_intltext_template('cmnt_received_eml.tpl');
$email_tpl = replace_macros($tpl, array( $email_tpl = replace_macros($tpl, array(
'$sitename' => $a->config['sitename'], '$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(), '$siteurl' => $a->get_baseurl(),

View file

@ -499,8 +499,8 @@ function dfrn_request_content(&$a) {
$dfrn_url = notags(trim(hex2bin($_GET['dfrn_url']))); $dfrn_url = notags(trim(hex2bin($_GET['dfrn_url'])));
$aes_allow = (((x($_GET,'aes_allow')) && ($_GET['aes_allow'] == 1)) ? 1 : 0); $aes_allow = (((x($_GET,'aes_allow')) && ($_GET['aes_allow'] == 1)) ? 1 : 0);
$confirm_key = (x($_GET,'confirm_key') ? $_GET['confirm_key'] : ""); $confirm_key = (x($_GET,'confirm_key') ? $_GET['confirm_key'] : "");
$o .= file_get_contents("view/dfrn_req_confirm.tpl"); $tpl = get_markup_template("dfrn_req_confirm.tpl");
$o = replace_macros($o,array( $o = replace_macros($tpl,array(
'$dfrn_url' => $dfrn_url, '$dfrn_url' => $dfrn_url,
'$aes_allow' => (($aes_allow) ? '<input type="hidden" name="aes_allow" value="1" />' : "" ), '$aes_allow' => (($aes_allow) ? '<input type="hidden" name="aes_allow" value="1" />' : "" ),
'$confirm_key' => $confirm_key, '$confirm_key' => $confirm_key,
@ -537,7 +537,7 @@ function dfrn_request_content(&$a) {
if($r[0]['page-flags'] != PAGE_NORMAL) if($r[0]['page-flags'] != PAGE_NORMAL)
$auto_confirm = true; $auto_confirm = true;
if(($r[0]['notify-flags'] & NOTIFY_INTRO) && (! $auto_confirm)) { if(($r[0]['notify-flags'] & NOTIFY_INTRO) && (! $auto_confirm)) {
$email_tpl = load_view_file('view/request_notify_eml.tpl'); $email_tpl = get_intltext_template('request_notify_eml.tpl');
$email = replace_macros($email_tpl, array( $email = replace_macros($email_tpl, array(
'$requestor' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')), '$requestor' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')),
'$url' => stripslashes($r[0]['url']), '$url' => stripslashes($r[0]['url']),
@ -622,9 +622,9 @@ function dfrn_request_content(&$a) {
*/ */
if($a->profile['page-flags'] == PAGE_NORMAL) if($a->profile['page-flags'] == PAGE_NORMAL)
$tpl = file_get_contents('view/dfrn_request.tpl'); $tpl = get_markup_template('dfrn_request.tpl');
else else
$tpl = file_get_contents('view/auto_request.tpl'); $tpl = get_markup_template('auto_request.tpl');
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$header' => t('Friend/Connection Request'), '$header' => t('Friend/Connection Request'),

View file

@ -29,7 +29,7 @@ function directory_content(&$a) {
else else
$search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : ''); $search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
$tpl = file_get_contents('view/directory_header.tpl'); $tpl = get_markup_template('directory_header.tpl');
$globaldir = ''; $globaldir = '';
$gdirpath = dirname(get_config('system','directory_submit_url')); $gdirpath = dirname(get_config('system','directory_submit_url'));
@ -65,7 +65,7 @@ function directory_content(&$a) {
); );
if(count($r)) { if(count($r)) {
$tpl = file_get_contents('view/directory_item.tpl'); $tpl = get_markup_template('directory_item.tpl');
if(in_array('small', $a->argv)) if(in_array('small', $a->argv))
$photo = 'thumb'; $photo = 'thumb';

View file

@ -31,7 +31,7 @@ function editpost_content(&$a) {
$o .= '<h2>' . t('Edit post') . '</h2>'; $o .= '<h2>' . t('Edit post') . '</h2>';
$tpl = load_view_file('view/jot-header.tpl'); $tpl = get_markup_template('jot-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array( $a->page['htmlhead'] .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(), '$baseurl' => $a->get_baseurl(),
@ -41,7 +41,7 @@ function editpost_content(&$a) {
)); ));
$tpl = load_view_file("view/jot.tpl"); $tpl = get_markup_template("jot.tpl");
if(($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) if(($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid'])))))
$lockstate = 'lock'; $lockstate = 'lock';

View file

@ -133,7 +133,7 @@ function follow_post(&$a) {
// create a follow slap // create a follow slap
$tpl = file_get_contents('view/follow_slap.tpl'); $tpl = get_markup_template('follow_slap.tpl');
$slap = replace_macros($tpl, array( $slap = replace_macros($tpl, array(
'$name' => $a->user['username'], '$name' => $a->user['username'],
'$profile_page' => $a->get_baseurl() . '/profile/' . $a->user['nickname'], '$profile_page' => $a->get_baseurl() . '/profile/' . $a->user['nickname'],

View file

@ -69,7 +69,7 @@ function group_content(&$a) {
} }
if(($a->argc == 2) && ($a->argv[1] === 'new')) { if(($a->argc == 2) && ($a->argv[1] === 'new')) {
$tpl = file_get_contents('view/group_new.tpl'); $tpl = get_markup_template('group_new.tpl');
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$desc' => t('Create a group of contacts/friends.'), '$desc' => t('Create a group of contacts/friends.'),
'$name' => t('Group Name: '), '$name' => t('Group Name: '),
@ -140,7 +140,7 @@ function group_content(&$a) {
} }
$drop_tpl = file_get_contents('view/group_drop.tpl'); $drop_tpl = get_markup_template('group_drop.tpl');
$drop_txt = replace_macros($drop_tpl, array( $drop_txt = replace_macros($drop_tpl, array(
'$id' => $group['id'], '$id' => $group['id'],
'$delete' => t('Delete') '$delete' => t('Delete')
@ -148,7 +148,7 @@ function group_content(&$a) {
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
$tpl = file_get_contents('view/group_edit.tpl'); $tpl = get_markup_template('group_edit.tpl');
$o .= replace_macros($tpl, array( $o .= replace_macros($tpl, array(
'$gid' => $group['id'], '$gid' => $group['id'],
'$name' => $group['name'], '$name' => $group['name'],

View file

@ -37,7 +37,7 @@ function install_post(&$a) {
notice( t('Connected to database.') . EOL); notice( t('Connected to database.') . EOL);
$tpl = load_view_file('view/htconfig.tpl'); $tpl = get_intltext_template('htconfig.tpl');
$txt = replace_macros($tpl,array( $txt = replace_macros($tpl,array(
'$dbhost' => $dbhost, '$dbhost' => $dbhost,
'$dbuser' => $dbuser, '$dbuser' => $dbuser,
@ -116,7 +116,7 @@ function install_content(&$a) {
require_once('datetime.php'); require_once('datetime.php');
$tpl = file_get_contents('view/install_db.tpl'); $tpl = get_markup_template('install_db.tpl');
$o .= replace_macros($tpl, array( $o .= replace_macros($tpl, array(
'$lbl_01' => t('Friendika Social Network'), '$lbl_01' => t('Friendika Social Network'),
'$lbl_02' => t('Installation'), '$lbl_02' => t('Installation'),

View file

@ -55,7 +55,7 @@ function invite_content(&$a) {
return; return;
} }
$tpl = file_get_contents('view/invite.tpl'); $tpl = get_markup_template('invite.tpl');
$o = replace_macros($tpl, array( $o = replace_macros($tpl, array(
'$invite' => t('Send invitations'), '$invite' => t('Send invitations'),

View file

@ -464,7 +464,7 @@ function item_post(&$a) {
if(($user['notify-flags'] & NOTIFY_COMMENT) && ($contact_record != $author)) { if(($user['notify-flags'] & NOTIFY_COMMENT) && ($contact_record != $author)) {
require_once('bbcode.php'); require_once('bbcode.php');
$from = $author['name']; $from = $author['name'];
$tpl = load_view_file('view/cmnt_received_eml.tpl'); $tpl = get_intltext_template('cmnt_received_eml.tpl');
$email_tpl = replace_macros($tpl, array( $email_tpl = replace_macros($tpl, array(
'$sitename' => $a->config['sitename'], '$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(), '$siteurl' => $a->get_baseurl(),
@ -490,7 +490,7 @@ function item_post(&$a) {
if(($user['notify-flags'] & NOTIFY_WALL) && ($contact_record != $author)) { if(($user['notify-flags'] & NOTIFY_WALL) && ($contact_record != $author)) {
require_once('bbcode.php'); require_once('bbcode.php');
$from = $author['name']; $from = $author['name'];
$tpl = load_view_file('view/wall_received_eml.tpl'); $tpl = get_intltext_template('wall_received_eml.tpl');
$email_tpl = replace_macros($tpl, array( $email_tpl = replace_macros($tpl, array(
'$sitename' => $a->config['sitename'], '$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(), '$siteurl' => $a->get_baseurl(),

View file

@ -26,7 +26,7 @@ function lostpass_post(&$a) {
if($r) if($r)
notice( t('Password reset request issued. Check your email.') . EOL); notice( t('Password reset request issued. Check your email.') . EOL);
$email_tpl = load_view_file("view/lostpass_eml.tpl"); $email_tpl = get_intltext_template("lostpass_eml.tpl");
$email_tpl = replace_macros($email_tpl, array( $email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'], '$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(), '$siteurl' => $a->get_baseurl(),
@ -73,7 +73,7 @@ function lostpass_content(&$a) {
intval($uid) intval($uid)
); );
if($r) { if($r) {
$tpl = file_get_contents('view/pwdreset.tpl'); $tpl = get_markup_template('pwdreset.tpl');
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$lbl1' => t('Password Reset'), '$lbl1' => t('Password Reset'),
'$lbl2' => t('Your password has been reset as requested.'), '$lbl2' => t('Your password has been reset as requested.'),
@ -89,7 +89,7 @@ function lostpass_content(&$a) {
$email_tpl = load_view_file("view/passchanged_eml.tpl"); $email_tpl = get_intltext_template("passchanged_eml.tpl");
$email_tpl = replace_macros($email_tpl, array( $email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'], '$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(), '$siteurl' => $a->get_baseurl(),
@ -108,7 +108,7 @@ function lostpass_content(&$a) {
} }
else { else {
$tpl = file_get_contents('view/lostpass.tpl'); $tpl = get_markup_template('lostpass.tpl');
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$title' => t('Forgot your Password?'), '$title' => t('Forgot your Password?'),

View file

@ -120,7 +120,7 @@ function message_content(&$a) {
$myprofile = $a->get_baseurl() . '/profile/' . $a->user['nickname']; $myprofile = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
$tpl = load_view_file('view/mail_head.tpl'); $tpl = get_markup_template('mail_head.tpl');
$header = replace_macros($tpl, array( $header = replace_macros($tpl, array(
'$messages' => t('Messages'), '$messages' => t('Messages'),
'$inbox' => t('Inbox'), '$inbox' => t('Inbox'),
@ -164,7 +164,7 @@ function message_content(&$a) {
if(($a->argc > 1) && ($a->argv[1] === 'new')) { if(($a->argc > 1) && ($a->argv[1] === 'new')) {
$tpl = file_get_contents('view/msg-header.tpl'); $tpl = get_markup_template('msg-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array( $a->page['htmlhead'] .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(), '$baseurl' => $a->get_baseurl(),
@ -175,7 +175,7 @@ function message_content(&$a) {
$preselect = (isset($a->argv[2])?array($a->argv[2]):false); $preselect = (isset($a->argv[2])?array($a->argv[2]):false);
$select = contact_select('messageto','message-to-select', $preselect, 4, true); $select = contact_select('messageto','message-to-select', $preselect, 4, true);
$tpl = file_get_contents('view/prv_message.tpl'); $tpl = get_markup_template('prv_message.tpl');
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$header' => t('Send Private Message'), '$header' => t('Send Private Message'),
'$to' => t('To:'), '$to' => t('To:'),
@ -225,7 +225,7 @@ function message_content(&$a) {
return $o; return $o;
} }
$tpl = file_get_contents('view/mail_list.tpl'); $tpl = get_markup_template('mail_list.tpl');
foreach($r as $rr) { foreach($r as $rr) {
$o .= replace_macros($tpl, array( $o .= replace_macros($tpl, array(
'$id' => $rr['id'], '$id' => $rr['id'],
@ -275,7 +275,7 @@ function message_content(&$a) {
require_once("include/bbcode.php"); require_once("include/bbcode.php");
$tpl = file_get_contents('view/msg-header.tpl'); $tpl = get_markup_template('msg-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array( $a->page['htmlhead'] .= replace_macros($tpl, array(
'$nickname' => $a->user['nickname'], '$nickname' => $a->user['nickname'],
@ -283,7 +283,7 @@ function message_content(&$a) {
)); ));
$tpl = file_get_contents('view/mail_conv.tpl'); $tpl = get_markup_template('mail_conv.tpl');
foreach($messages as $message) { foreach($messages as $message) {
if($message['from-url'] == $myprofile) { if($message['from-url'] == $myprofile) {
$from_url = $myprofile; $from_url = $myprofile;
@ -309,7 +309,7 @@ function message_content(&$a) {
} }
$select = $message['name'] . '<input type="hidden" name="messageto" value="' . $contact_id . '" />'; $select = $message['name'] . '<input type="hidden" name="messageto" value="' . $contact_id . '" />';
$parent = '<input type="hidden" name="replyto" value="' . $message['parent-uri'] . '" />'; $parent = '<input type="hidden" name="replyto" value="' . $message['parent-uri'] . '" />';
$tpl = file_get_contents('view/prv_message.tpl'); $tpl = get_markup_template('prv_message.tpl');
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$header' => t('Send Reply'), '$header' => t('Send Reply'),
'$to' => t('To:'), '$to' => t('To:'),

View file

@ -89,13 +89,13 @@ function notifications_content(&$a) {
if(($r !== false) && (count($r))) { if(($r !== false) && (count($r))) {
$tpl = file_get_contents("view/intros.tpl"); $tpl = get_markup_template("intros.tpl");
foreach($r as $rr) { foreach($r as $rr) {
$friend_selected = (($rr['network'] !== 'stat') ? ' checked="checked" ' : ' disabled '); $friend_selected = (($rr['network'] !== 'stat') ? ' checked="checked" ' : ' disabled ');
$fan_selected = (($rr['network'] === 'stat') ? ' checked="checked" disabled ' : ''); $fan_selected = (($rr['network'] === 'stat') ? ' checked="checked" disabled ' : '');
$dfrn_tpl = file_get_contents('view/netfriend.tpl'); $dfrn_tpl = get_markup_template('netfriend.tpl');
$knowyou = ''; $knowyou = '';
$dfrn_text = ''; $dfrn_text = '';

View file

@ -4,7 +4,7 @@
function oexchange_init(&$a) { function oexchange_init(&$a) {
if(($a->argc > 1) && ($a->argv[1] === 'xrd')) { if(($a->argc > 1) && ($a->argv[1] === 'xrd')) {
$tpl = file_get_contents('view/oexchange_xrd.tpl'); $tpl = get_markup_template('oexchange_xrd.tpl');
$o = replace_macros($tpl, array('$base' => $a->get_baseurl())); $o = replace_macros($tpl, array('$base' => $a->get_baseurl()));
echo $o; echo $o;

View file

@ -1,7 +1,7 @@
<?php <?php
function opensearch_content(&$a) { function opensearch_content(&$a) {
$tpl = file_get_contents('view/opensearch.tpl'); $tpl = get_markup_template('opensearch.tpl');
header("Content-type: application/opensearchdescription+xml"); header("Content-type: application/opensearchdescription+xml");

View file

@ -828,7 +828,7 @@ function photos_content(&$a) {
$tpl = file_get_contents('view/photos_upload.tpl'); $tpl = get_markup_template('photos_upload.tpl');
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$pagename' => t('Upload Photos'), '$pagename' => t('Upload Photos'),
'$sessid' => session_id(), '$sessid' => session_id(),
@ -874,7 +874,7 @@ function photos_content(&$a) {
if($cmd === 'edit') { if($cmd === 'edit') {
if(($album != t('Profile Photos')) && ($album != t('Contact Photos'))) { if(($album != t('Profile Photos')) && ($album != t('Contact Photos'))) {
if($can_post) { if($can_post) {
$edit_tpl = file_get_contents('view/album_edit.tpl'); $edit_tpl = get_markup_template('album_edit.tpl');
$o .= replace_macros($edit_tpl,array( $o .= replace_macros($edit_tpl,array(
'$nametext' => t('New album name: '), '$nametext' => t('New album name: '),
'$nickname' => $a->data['user']['nickname'], '$nickname' => $a->data['user']['nickname'],
@ -895,7 +895,7 @@ function photos_content(&$a) {
} }
} }
} }
$tpl = file_get_contents('view/photo_album.tpl'); $tpl = get_markup_template('photo_album.tpl');
if(count($r)) if(count($r))
foreach($r as $rr) { foreach($r as $rr) {
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
@ -1073,7 +1073,7 @@ function photos_content(&$a) {
$edit = Null; $edit = Null;
if(($cmd === 'edit') && ($can_post)) { if(($cmd === 'edit') && ($can_post)) {
$edit_tpl = file_get_contents('view/photo_edit.tpl'); $edit_tpl = get_markup_template('photo_edit.tpl');
$edit = replace_macros($edit_tpl, array( $edit = replace_macros($edit_tpl, array(
'$id' => $ph[0]['id'], '$id' => $ph[0]['id'],
'$album' => $ph[0]['album'], '$album' => $ph[0]['album'],
@ -1095,11 +1095,11 @@ function photos_content(&$a) {
if(count($linked_items)) { if(count($linked_items)) {
$cmnt_tpl = file_get_contents('view/comment_item.tpl'); $cmnt_tpl = get_markup_template('comment_item.tpl');
$tpl = file_get_contents('view/photo_item.tpl'); $tpl = get_markup_template('photo_item.tpl');
$return_url = $a->cmd; $return_url = $a->cmd;
$like_tpl = file_get_contents('view/like_noshare.tpl'); $like_tpl = get_markup_template('like_noshare.tpl');
$likebuttons = ''; $likebuttons = '';
@ -1225,7 +1225,7 @@ function photos_content(&$a) {
$drop = ''; $drop = '';
if(($item['contact-id'] == remote_user()) || ($item['uid'] == local_user())) if(($item['contact-id'] == remote_user()) || ($item['uid'] == local_user()))
$drop = replace_macros(file_get_contents('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete'))); $drop = replace_macros(get_markup_template('wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete')));
$comments .= replace_macros($template,array( $comments .= replace_macros($template,array(
@ -1247,7 +1247,7 @@ function photos_content(&$a) {
$paginate = paginate($a); $paginate = paginate($a);
} }
$photo_tpl = load_view_file('view/photo_view.tpl'); $photo_tpl = get_markup_template('photo_view.tpl');
$o .= replace_macros($photo_tpl, array( $o .= replace_macros($photo_tpl, array(
'$id' => $ph[0]['id'], '$id' => $ph[0]['id'],
'$album' => array($album_link,$ph[0]['album']), '$album' => array($album_link,$ph[0]['album']),
@ -1298,7 +1298,7 @@ function photos_content(&$a) {
. $a->data['user']['nickname'] . '/upload' . '">' . t('Upload New Photos') . '</a></div>'; . $a->data['user']['nickname'] . '/upload' . '">' . t('Upload New Photos') . '</a></div>';
} }
$tpl = file_get_contents('view/photo_top.tpl'); $tpl = get_markup_template('photo_top.tpl');
if(count($r)) { if(count($r)) {
foreach($r as $rr) { foreach($r as $rr) {
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(

View file

@ -104,7 +104,7 @@ function profile_content(&$a, $update = 0) {
if(x($_GET,'tab')) if(x($_GET,'tab'))
$tab = notags(trim($_GET['tab'])); $tab = notags(trim($_GET['tab']));
$tpl = load_view_file('view/profile_tabs.tpl'); $tpl = get_markup_template('profile_tabs.tpl');
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$url' => $a->get_baseurl() . '/' . $a->cmd, '$url' => $a->get_baseurl() . '/' . $a->cmd,

View file

@ -186,7 +186,7 @@ function profile_photo_content(&$a) {
if(! x($a->config,'imagecrop')) { if(! x($a->config,'imagecrop')) {
$tpl = file_get_contents('view/profile_photo.tpl'); $tpl = get_markup_template('profile_photo.tpl');
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$user' => $a->user['nickname'], '$user' => $a->user['nickname'],
@ -201,7 +201,7 @@ function profile_photo_content(&$a) {
else { else {
$filename = $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'] . '.jpg'; $filename = $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'] . '.jpg';
$resolution = $a->config['imagecrop_resolution']; $resolution = $a->config['imagecrop_resolution'];
$tpl = file_get_contents("view/cropbody.tpl"); $tpl = get_markup_template("cropbody.tpl");
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$filename' => $filename, '$filename' => $filename,
'$resource' => $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'], '$resource' => $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'],
@ -252,7 +252,7 @@ function profile_photo_crop_ui_head(&$a, $ph){
$a->config['imagecrop'] = $hash; $a->config['imagecrop'] = $hash;
$a->config['imagecrop_resolution'] = $smallest; $a->config['imagecrop_resolution'] = $smallest;
$a->page['htmlhead'] .= file_get_contents("view/crophead.tpl"); $a->page['htmlhead'] .= get_markup_template("crophead.tpl");
return; return;
}} }}

View file

@ -347,9 +347,9 @@ function profiles_content(&$a) {
require_once('include/profile_selectors.php'); require_once('include/profile_selectors.php');
$tpl = file_get_contents('view/profed_head.tpl'); $tpl = get_markup_template('profed_head.tpl');
$opt_tpl = file_get_contents("view/profile-hide-friends.tpl"); $opt_tpl = get_markup_template("profile-hide-friends.tpl");
$hide_friends = replace_macros($opt_tpl,array( $hide_friends = replace_macros($opt_tpl,array(
'$desc' => t('Hide my contact/friend list from viewers of this profile?'), '$desc' => t('Hide my contact/friend list from viewers of this profile?'),
'$yes_str' => t('Yes'), '$yes_str' => t('Yes'),
@ -364,7 +364,7 @@ function profiles_content(&$a) {
$is_default = (($r[0]['is-default']) ? 1 : 0); $is_default = (($r[0]['is-default']) ? 1 : 0);
$tpl = file_get_contents("view/profile_edit.tpl"); $tpl = get_markup_template("profile_edit.tpl");
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$banner' => t('Edit Profile Details'), '$banner' => t('Edit Profile Details'),
'$submit' => t('Submit'), '$submit' => t('Submit'),
@ -451,7 +451,7 @@ function profiles_content(&$a) {
local_user()); local_user());
if(count($r)) { if(count($r)) {
$tpl_header = file_get_contents('view/profile_listing_header.tpl'); $tpl_header = get_markup_template('profile_listing_header.tpl');
$o .= replace_macros($tpl_header,array( $o .= replace_macros($tpl_header,array(
'$header' => t('Profiles'), '$header' => t('Profiles'),
'$chg_photo' => t('Change profile photo'), '$chg_photo' => t('Change profile photo'),
@ -459,7 +459,7 @@ function profiles_content(&$a) {
)); ));
$tpl = file_get_contents('view/profile_entry.tpl'); $tpl = get_markup_template('profile_entry.tpl');
foreach($r as $rr) { foreach($r as $rr) {
$o .= replace_macros($tpl, array( $o .= replace_macros($tpl, array(

View file

@ -319,7 +319,7 @@ function register_post(&$a) {
if( $a->config['register_policy'] == REGISTER_OPEN ) { if( $a->config['register_policy'] == REGISTER_OPEN ) {
$email_tpl = load_view_file("view/register_open_eml.tpl"); $email_tpl = get_intltext_template("register_open_eml.tpl");
$email_tpl = replace_macros($email_tpl, array( $email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'], '$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(), '$siteurl' => $a->get_baseurl(),
@ -357,7 +357,7 @@ function register_post(&$a) {
dbesc($new_password) dbesc($new_password)
); );
$email_tpl = load_view_file("view/register_verify_eml.tpl"); $email_tpl = get_intltext_template("register_verify_eml.tpl");
$email_tpl = replace_macros($email_tpl, array( $email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'], '$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(), '$siteurl' => $a->get_baseurl(),
@ -435,7 +435,7 @@ function register_content(&$a) {
$profile_publish_reg = '<input type="hidden" name="profile_publish_reg" value="1" />'; $profile_publish_reg = '<input type="hidden" name="profile_publish_reg" value="1" />';
} }
else { else {
$publish_tpl = file_get_contents("view/profile_publish.tpl"); $publish_tpl = get_markup_template("profile_publish.tpl");
$profile_publish = replace_macros($publish_tpl,array( $profile_publish = replace_macros($publish_tpl,array(
'$instance' => 'reg', '$instance' => 'reg',
'$pubdesc' => t('Include your profile in member directory?'), '$pubdesc' => t('Include your profile in member directory?'),
@ -450,7 +450,7 @@ function register_content(&$a) {
$license = t('Shared content is covered by the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license.'); $license = t('Shared content is covered by the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license.');
$o = file_get_contents("view/register.tpl"); $o = get_markup_template("register.tpl");
$o = replace_macros($o, array( $o = replace_macros($o, array(
'$oidhtml' => $oidhtml, '$oidhtml' => $oidhtml,
'$realpeople' => $realpeople, '$realpeople' => $realpeople,

View file

@ -79,7 +79,7 @@ function regmod_content(&$a) {
proc_run('php',"include/directory.php","$url"); proc_run('php',"include/directory.php","$url");
} }
$email_tpl = load_view_file("view/register_open_eml.tpl"); $email_tpl = get_intltext_template("register_open_eml.tpl");
$email_tpl = replace_macros($email_tpl, array( $email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'], '$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(), '$siteurl' => $a->get_baseurl(),

View file

@ -35,7 +35,7 @@ function removeme_content(&$a) {
$_SESSION['remove_account_verify'] = $hash; $_SESSION['remove_account_verify'] = $hash;
$tpl = file_get_contents('view/removeme.tpl'); $tpl = get_markup_template('removeme.tpl');
$o .= replace_macros($tpl, array( $o .= replace_macros($tpl, array(
'$basedir' => $a->get_baseurl(), '$basedir' => $a->get_baseurl(),
'$hash' => $hash, '$hash' => $hash,

View file

@ -89,7 +89,7 @@ function salmon_post(&$a) {
// Create a fake feed wrapper so simplepie doesn't choke // Create a fake feed wrapper so simplepie doesn't choke
$tpl = file_get_contents('view/fake_feed.tpl'); $tpl = get_markup_template('fake_feed.tpl');
$base = substr($data,strpos($data,'<entry')); $base = substr($data,strpos($data,'<entry'));

View file

@ -310,7 +310,7 @@ function settings_content(&$a) {
$mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0); $mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0);
$pageset_tpl = file_get_contents('view/pagetypes.tpl'); $pageset_tpl = get_markup_template('pagetypes.tpl');
$pagetype = replace_macros($pageset_tpl,array( $pagetype = replace_macros($pageset_tpl,array(
'$normal' => (($a->user['page-flags'] == PAGE_NORMAL) ? " checked=\"checked\" " : ""), '$normal' => (($a->user['page-flags'] == PAGE_NORMAL) ? " checked=\"checked\" " : ""),
'$soapbox' => (($a->user['page-flags'] == PAGE_SOAPBOX) ? " checked=\"checked\" " : ""), '$soapbox' => (($a->user['page-flags'] == PAGE_SOAPBOX) ? " checked=\"checked\" " : ""),
@ -344,7 +344,7 @@ function settings_content(&$a) {
$profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />'; $profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />';
} }
else { else {
$opt_tpl = file_get_contents("view/profile-in-directory.tpl"); $opt_tpl = get_markup_template("profile-in-directory.tpl");
$profile_in_dir = replace_macros($opt_tpl,array( $profile_in_dir = replace_macros($opt_tpl,array(
'$desc' => t('Publish your default profile in site directory?'), '$desc' => t('Publish your default profile in site directory?'),
'$yes_str' => t('Yes'), '$yes_str' => t('Yes'),
@ -355,7 +355,7 @@ function settings_content(&$a) {
} }
if(strlen(get_config('system','directory_submit_url'))) { if(strlen(get_config('system','directory_submit_url'))) {
$opt_tpl = file_get_contents("view/profile-in-netdir.tpl"); $opt_tpl = get_markup_template("profile-in-netdir.tpl");
$profile_in_net_dir = replace_macros($opt_tpl,array( $profile_in_net_dir = replace_macros($opt_tpl,array(
'$desc' => t('Publish your default profile in global social directory?'), '$desc' => t('Publish your default profile in global social directory?'),
@ -397,7 +397,7 @@ function settings_content(&$a) {
$subdir = ((strlen($a->get_path())) ? '<br />' . t('or') . ' ' . $a->get_baseurl() . '/profile/' . $nickname : ''); $subdir = ((strlen($a->get_path())) ? '<br />' . t('or') . ' ' . $a->get_baseurl() . '/profile/' . $nickname : '');
$tpl_addr = file_get_contents("view/settings_nick_set.tpl"); $tpl_addr = get_markup_template("settings_nick_set.tpl");
$prof_addr = replace_macros($tpl_addr,array( $prof_addr = replace_macros($tpl_addr,array(
'$desc' => t('Your Identity Address is'), '$desc' => t('Your Identity Address is'),
@ -406,7 +406,7 @@ function settings_content(&$a) {
'$basepath' => $a->get_hostname() '$basepath' => $a->get_hostname()
)); ));
$stpl = load_view_file('view/settings.tpl'); $stpl = get_markup_template('settings.tpl');
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);

View file

@ -41,7 +41,7 @@ function viewcontacts_content(&$a) {
return $o; return $o;
} }
$tpl = file_get_contents("view/viewcontact_template.tpl"); $tpl = get_markup_template("viewcontact_template.tpl");
foreach($r as $rr) { foreach($r as $rr) {
if($rr['self']) if($rr['self'])

View file

@ -15,7 +15,7 @@
<coordinates>$status.coordinates</coordinates> <coordinates>$status.coordinates</coordinates>
<place>$status.place</place> <place>$status.place</place>
<contributors>$status.contributors</contributors> <contributors>$status.contributors</contributors>
{{ inc view/api_user_xml.tpl with $user=$status.user }}{{ endinc }} {{ inc api_user_xml.tpl with $user=$status.user }}{{ endinc }}
</status> </status>
{{ endfor }} {{ endfor }}
</statuses> </statuses>