localisation path for all view templates

This commit is contained in:
Mike Macgirvin 2010-09-22 18:00:19 -07:00
parent 124129e2a0
commit d5a13b1e4c
28 changed files with 113 additions and 100 deletions

View File

@ -154,9 +154,8 @@ class App {
}
function init_pagehead() {
if(file_exists("view/head.tpl"))
$s = file_get_contents("view/head.tpl");
$this->page['htmlhead'] = replace_macros($s,array(
$tpl = load_view_file("view/head.tpl");
$this->page['htmlhead'] = replace_macros($tpl,array(
'$baseurl' => $this->get_baseurl()
));
}
@ -331,14 +330,14 @@ function escape_tags($string) {
if(! function_exists('login')) {
function login($register = false) {
$o = "";
$register_html = (($register) ? file_get_contents("view/register-link.tpl") : "");
$register_html = (($register) ? load_view_file("view/register-link.tpl") : "");
if(x($_SESSION,'authenticated')) {
$o = file_get_contents("view/logout.tpl");
$o = load_view_file("view/logout.tpl");
}
else {
$o = file_get_contents("view/login.tpl");
$o = load_view_file("view/login.tpl");
$o = replace_macros($o,array('$register_html' => $register_html ));
}
@ -870,3 +869,12 @@ function format_like($cnt,$arr,$type,$id) {
return $o;
}}
if(! function_exists('load_view_file')) {
function load_view_file($s) {
$b = basename($s);
$d = dirname($s);
$lang = get_config('system','language');
if($lang && file_exists("$d/$lang/$b"))
return file_get_contents("$d/$lang/$b");
return file_get_contents($s);
}}

View File

@ -1,6 +1,6 @@
<?php
$tpl = file_get_contents('view/xrd_host.tpl');
$tpl = load_view_file('view/xrd_host.tpl');
echo str_replace('$domain',$this->hostname,$tpl);
session_write_close();
exit();

View File

@ -116,10 +116,10 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) {
$items = $r;
$feed_template = file_get_contents('view/atom_feed.tpl');
$tomb_template = file_get_contents('view/atom_tomb.tpl');
$item_template = file_get_contents('view/atom_item.tpl');
$cmnt_template = file_get_contents('view/atom_cmnt.tpl');
$feed_template = load_view_file('view/atom_feed.tpl');
$tomb_template = load_view_file('view/atom_tomb.tpl');
$item_template = load_view_file('view/atom_item.tpl');
$cmnt_template = load_view_file('view/atom_cmnt.tpl');
$atom = '';

View File

@ -126,13 +126,13 @@
$contacts = $r;
$tomb_template = file_get_contents('view/atom_tomb.tpl');
$item_template = file_get_contents('view/atom_item.tpl');
$cmnt_template = file_get_contents('view/atom_cmnt.tpl');
$tomb_template = load_view_file('view/atom_tomb.tpl');
$item_template = load_view_file('view/atom_item.tpl');
$cmnt_template = load_view_file('view/atom_cmnt.tpl');
}
$feed_template = file_get_contents('view/atom_feed.tpl');
$mail_template = file_get_contents('view/atom_mail.tpl');
$feed_template = load_view_file('view/atom_feed.tpl');
$mail_template = load_view_file('view/atom_mail.tpl');
$atom = '';

View File

@ -102,10 +102,11 @@ $a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array(
$page = $a->page;
$profile = $a->profile;
$lang = get_config('system','language');
header("Content-type: text/html; charset=utf-8");
$template = "view/"
$template = "view/" . (($lang) ? $lang . "/" : "")
. ((x($a->page,'template')) ? $a->page['template'] : 'default' )
. ".php";

View File

@ -148,7 +148,7 @@ function contacts_content(&$a) {
require_once('view/contact_selectors.php');
$tpl = file_get_contents("view/contact_edit.tpl");
$tpl = load_view_file("view/contact_edit.tpl");
switch($r[0]['rel']) {
case REL_BUD:
@ -202,7 +202,7 @@ function contacts_content(&$a) {
$search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : '');
$tpl = file_get_contents("view/contacts-top.tpl");
$tpl = load_view_file("view/contacts-top.tpl");
$o .= replace_macros($tpl,array(
'$hide_url' => ((strlen($sql_extra)) ? 'contacts/all' : 'contacts' ),
'$hide_text' => ((strlen($sql_extra)) ? t('Show Blocked Connections') : t('Hide Blocked Connections')),
@ -235,7 +235,7 @@ function contacts_content(&$a) {
if(count($r)) {
$tpl = file_get_contents("view/contact_template.tpl");
$tpl = load_view_file("view/contact_template.tpl");
foreach($r as $rr) {
if($rr['self'])

View File

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

View File

@ -103,7 +103,7 @@ function dfrn_notify_post(&$a) {
require_once('bbcode.php');
if($importer['notify-flags'] & NOTIFY_MAIL) {
$tpl = file_get_contents('view/mail_received_eml.tpl');
$tpl = load_view_file('view/mail_received_eml.tpl');
$email_tpl = replace_macros($tpl, array(
'$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(),
@ -241,7 +241,7 @@ function dfrn_notify_post(&$a) {
if(($importer['notify-flags'] & NOTIFY_COMMENT) && (! $importer['self'])) {
require_once('bbcode.php');
$from = stripslashes($datarray['author-name']);
$tpl = file_get_contents('view/cmnt_received_eml.tpl');
$tpl = load_view_file('view/cmnt_received_eml.tpl');
$email_tpl = replace_macros($tpl, array(
'$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(),
@ -307,7 +307,7 @@ function dfrn_notify_post(&$a) {
continue;
require_once('bbcode.php');
$from = stripslashes($datarray['author-name']);
$tpl = file_get_contents('view/cmnt_received_eml.tpl');
$tpl = load_view_file('view/cmnt_received_eml.tpl');
$email_tpl = replace_macros($tpl, array(
'$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(),

View File

@ -356,7 +356,7 @@ function dfrn_request_content(&$a) {
$dfrn_url = notags(trim(hex2bin($_GET['dfrn_url'])));
$aes_allow = (((x($_GET,'aes_allow')) && ($_GET['aes_allow'] == 1)) ? 1 : 0);
$confirm_key = (x($_GET,'confirm_key') ? $_GET['confirm_key'] : "");
$o .= file_get_contents("view/dfrn_req_confirm.tpl");
$o .= load_view_file("view/dfrn_req_confirm.tpl");
$o = replace_macros($o,array(
'$dfrn_url' => $dfrn_url,
'$aes_allow' => (($aes_allow) ? '<input type="hidden" name="aes_allow" value="1" />' : "" ),
@ -388,7 +388,7 @@ function dfrn_request_content(&$a) {
if(count($r)) {
if($r[0]['notify-flags'] & NOTIFY_INTRO) {
$email_tpl = file_get_contents('view/request_notify_eml.tpl');
$email_tpl = load_view_file('view/request_notify_eml.tpl');
$email = replace_macros($email_tpl, array(
'$requestor' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')),
'$url' => stripslashes($r[0]['url']),
@ -416,7 +416,7 @@ function dfrn_request_content(&$a) {
// Normal web request. Display our user's introduction form.
$o = file_get_contents("view/dfrn_request.tpl");
$o = load_view_file("view/dfrn_request.tpl");
$o = replace_macros($o,array('$nickname' => $a->argv[1]));
return $o;
}

View File

@ -8,7 +8,7 @@ function directory_content(&$a) {
$search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : '');
$tpl .= file_get_contents('view/directory_header.tpl');
$tpl .= load_view_file('view/directory_header.tpl');
@ -34,7 +34,7 @@ function directory_content(&$a) {
);
if(count($r)) {
$tpl = file_get_contents('view/directory_item.tpl');
$tpl = load_view_file('view/directory_item.tpl');
if(in_array('small', $a->argv))
$photo = 'thumb';

View File

@ -100,10 +100,10 @@ function display_content(&$a) {
);
$cmnt_tpl = file_get_contents('view/comment_item.tpl');
$like_tpl = file_get_contents('view/like.tpl');
$tpl = file_get_contents('view/wall_item.tpl');
$wallwall = file_get_contents('view/wallwall_item.tpl');
$cmnt_tpl = load_view_file('view/comment_item.tpl');
$like_tpl = load_view_file('view/like.tpl');
$tpl = load_view_file('view/wall_item.tpl');
$wallwall = load_view_file('view/wallwall_item.tpl');
$return_url = $_SESSION['return_url'] = $a->cmd;
@ -203,7 +203,7 @@ function display_content(&$a) {
$drop = '';
if(($item['contact-id'] == $_SESSION['visitor_id']) || ($item['uid'] == get_uid()))
$drop = replace_macros(file_get_contents('view/wall_item_drop.tpl'), array('$id' => $item['id']));
$drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id']));
$like = (($alike[$item['id']]) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
$dislike = (($dlike[$item['id']]) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');

View File

@ -89,7 +89,7 @@ function group_content(&$a) {
}
if(($a->argc == 2) && ($a->argv[1] == 'new')) {
$tpl = file_get_contents('view/group_new.tpl');
$tpl = load_view_file('view/group_new.tpl');
$o .= replace_macros($tpl,array());
return $o;
}
@ -130,13 +130,13 @@ function group_content(&$a) {
$preselected[] = $p['id'];
}
$drop_tpl = file_get_contents('view/group_drop.tpl');
$drop_tpl = load_view_file('view/group_drop.tpl');
$drop_txt = replace_macros($drop_tpl, array(
'$id' => $group['id'],
'$delete' => t('Delete')
));
$tpl = file_get_contents('view/group_edit.tpl');
$tpl = load_view_file('view/group_edit.tpl');
$o .= replace_macros($tpl, array(
'$gid' => $group['id'],
'$name' => $group['name'],

View File

@ -23,7 +23,7 @@ function install_post(&$a) {
else
notice( t('Connected to database.') . EOL);
$tpl = file_get_contents('view/htconfig.tpl');
$tpl = load_view_file('view/htconfig.tpl');
$txt = replace_macros($tpl,array(
'$dbhost' => $dbhost,
'$dbuser' => $dbuser,
@ -79,7 +79,7 @@ function install_content(&$a) {
require_once('datetime.php');
$tpl = file_get_contents('view/install_db.tpl');
$tpl = load_view_file('view/install_db.tpl');
$o .= replace_macros($tpl, array(
'$tzselect' => ((x($_POST,'timezone')) ? select_timezone($_POST['timezone']) : select_timezone()),
'$submit' => t('Submit'),

View File

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

View File

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

View File

@ -25,7 +25,7 @@ function lostpass_post(&$a) {
if($r)
notice("Password reset request issued. Check your email.");
$email_tpl = file_get_contents("view/lostpass_eml.tpl");
$email_tpl = load_view_file("view/lostpass_eml.tpl");
$email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(),
@ -69,7 +69,7 @@ function lostpass_content(&$a) {
intval($uid)
);
if($r) {
$tpl = file_get_contents('view/pwdreset.tpl');
$tpl = load_view_file('view/pwdreset.tpl');
$o .= replace_macros($tpl,array(
'$newpass' => $new_password,
'$baseurl' => $a->get_baseurl()
@ -78,7 +78,7 @@ function lostpass_content(&$a) {
$email_tpl = file_get_contents("view/passchanged_eml.tpl");
$email_tpl = load_view_file("view/passchanged_eml.tpl");
$email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(),
@ -94,7 +94,7 @@ function lostpass_content(&$a) {
}
else {
$tpl = file_get_contents('view/lostpass.tpl');
$tpl = load_view_file('view/lostpass.tpl');
$o .= $tpl;

View File

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

View File

@ -28,13 +28,13 @@ function network_content(&$a, $update = 0) {
}
$_SESSION['return_url'] = $a->cmd;
$tpl = file_get_contents('view/jot-header.tpl');
$tpl = load_view_file('view/jot-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
require_once('view/acl_selectors.php');
$tpl = file_get_contents("view/jot.tpl");
$tpl = load_view_file("view/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'])))))
$lockstate = 'lock';
@ -124,10 +124,10 @@ function network_content(&$a, $update = 0) {
);
$cmnt_tpl = file_get_contents('view/comment_item.tpl');
$like_tpl = file_get_contents('view/like.tpl');
$tpl = file_get_contents('view/wall_item.tpl');
$wallwall = file_get_contents('view/wallwall_item.tpl');
$cmnt_tpl = load_view_file('view/comment_item.tpl');
$like_tpl = load_view_file('view/like.tpl');
$tpl = load_view_file('view/wall_item.tpl');
$wallwall = load_view_file('view/wallwall_item.tpl');
$alike = array();
$dlike = array();
@ -219,7 +219,7 @@ function network_content(&$a, $update = 0) {
}
$drop = replace_macros(file_get_contents('view/wall_item_drop.tpl'), array('$id' => $item['id']));
$drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id']));

View File

@ -65,7 +65,7 @@ function notifications_content(&$a) {
$sql_extra = " AND `ignore` = 0 ";
$tpl = file_get_contents('view/intros-top.tpl');
$tpl = load_view_file('view/intros-top.tpl');
$o .= replace_macros($tpl,array(
'$hide_url' => ((strlen($sql_extra)) ? 'notifications/all' : 'notifications' ),
'$hide_text' => ((strlen($sql_extra)) ? t('Show Ignored Requests') : t('Hide Ignored Requests'))
@ -79,7 +79,7 @@ function notifications_content(&$a) {
if(($r !== false) && (count($r))) {
$tpl = file_get_contents("view/intros.tpl");
$tpl = load_view_file("view/intros.tpl");
foreach($r as $rr) {

View File

@ -458,7 +458,7 @@ function photos_content(&$a) {
}
}
$albumselect .= '</select>';
$tpl = file_get_contents('view/photos_upload.tpl');
$tpl = load_view_file('view/photos_upload.tpl');
$o .= replace_macros($tpl,array(
'$pagename' => t('Upload Photos'),
'$sessid' => session_id(),
@ -504,7 +504,7 @@ function photos_content(&$a) {
if($cmd == 'edit') {
if(($album != t('Profile Photos')) && ($album != t('Contact Photos'))) {
if(local_user() && (get_uid() == $a->data['user']['uid'])) {
$edit_tpl = file_get_contents('view/album_edit.tpl');
$edit_tpl = load_view_file('view/album_edit.tpl');
$o .= replace_macros($edit_tpl,array(
'$nametext' => t('New album name: '),
'$album' => $album,
@ -524,7 +524,7 @@ function photos_content(&$a) {
}
}
}
$tpl = file_get_contents('view/photo_album.tpl');
$tpl = load_view_file('view/photo_album.tpl');
if(count($r))
foreach($r as $rr) {
$o .= replace_macros($tpl,array(
@ -636,7 +636,7 @@ function photos_content(&$a) {
}
if($cmd == 'edit') {
$edit_tpl = file_get_contents('view/photo_edit.tpl');
$edit_tpl = load_view_file('view/photo_edit.tpl');
$o .= replace_macros($edit_tpl, array(
'$id' => $ph[0]['id'],
'$resource_id' => $ph[0]['resource-id'],
@ -654,8 +654,8 @@ function photos_content(&$a) {
if(count($i1)) {
// pull out how many people like the photo
$cmnt_tpl = file_get_contents('view/comment_item.tpl');
$tpl = file_get_contents('view/photo_item.tpl');
$cmnt_tpl = load_view_file('view/comment_item.tpl');
$tpl = load_view_file('view/photo_item.tpl');
$return_url = $a->cmd;
if(can_write_wall($a,$a->data['user']['uid'])) {
@ -706,7 +706,7 @@ function photos_content(&$a) {
$drop = '';
if(($item['contact-id'] == $_SESSION['visitor_id']) || ($item['uid'] == get_uid()))
$drop = replace_macros(file_get_contents('view/wall_item_drop.tpl'), array('$id' => $item['id']));
$drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id']));
$o .= replace_macros($template,array(
@ -755,7 +755,7 @@ function photos_content(&$a) {
. $a->data['user']['nickname'] . '/upload' . '">' . t('Upload New Photos') . '</a></div>';
}
$tpl = file_get_contents('view/photo_top.tpl');
$tpl = load_view_file('view/photo_top.tpl');
if(count($r)) {
foreach($r as $rr) {
$o .= replace_macros($tpl,array(

View File

@ -124,7 +124,7 @@ function profile_content(&$a, $update = 0) {
if(x($_GET,'tab'))
$tab = notags(trim($_GET['tab']));
$tpl = file_get_contents('view/profile_tabs.tpl');
$tpl = load_view_file('view/profile_tabs.tpl');
$o .= replace_macros($tpl,array(
'$url' => $a->get_baseurl() . '/' . $a->cmd,
@ -133,17 +133,21 @@ function profile_content(&$a, $update = 0) {
if($tab == 'profile') {
$lang = config_get('system','language');
if($lang && file_exists("view/$lang/profile_advanced.php"))
require_once("view/$lang/profile_advanced.php");
else
require_once('view/profile_advanced.php');
return $o;
}
if(can_write_wall($a,$a->profile['profile_uid'])) {
$tpl = file_get_contents('view/jot-header.tpl');
$tpl = load_view_file('view/jot-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
require_once('view/acl_selectors.php');
$tpl = file_get_contents("view/jot.tpl");
$tpl = load_view_file("view/jot.tpl");
if(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';
else
@ -246,14 +250,14 @@ function profile_content(&$a, $update = 0) {
);
$cmnt_tpl = file_get_contents('view/comment_item.tpl');
$cmnt_tpl = load_view_file('view/comment_item.tpl');
$like_tpl = file_get_contents('view/like.tpl');
$like_tpl = load_view_file('view/like.tpl');
$tpl = file_get_contents('view/wall_item.tpl');
$tpl = load_view_file('view/wall_item.tpl');
$droptpl = file_get_contents('view/wall_item_drop.tpl');
$fakedrop = file_get_contents('view/wall_fake_drop.tpl');
$droptpl = load_view_file('view/wall_item_drop.tpl');
$fakedrop = load_view_file('view/wall_fake_drop.tpl');
if($update)
$return_url = $_SESSION['return_url'];

View File

@ -139,7 +139,7 @@ function profile_photo_post(&$a) {
$a->config['imagecrop'] = $hash;
$a->config['imagecrop_resolution'] = $smallest;
$a->page['htmlhead'] .= file_get_contents("view/crophead.tpl");
$a->page['htmlhead'] .= load_view_file("view/crophead.tpl");
return;
}
@ -154,7 +154,7 @@ function profile_photo_content(&$a) {
if(! x($a->config,'imagecrop')) {
$tpl = file_get_contents('view/profile_photo.tpl');
$tpl = load_view_file('view/profile_photo.tpl');
$o .= replace_macros($tpl,array(
@ -165,7 +165,7 @@ function profile_photo_content(&$a) {
else {
$filename = $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'] . '.jpg';
$resolution = $a->config['imagecrop_resolution'];
$tpl = file_get_contents("view/cropbody.tpl");
$tpl = load_view_file("view/cropbody.tpl");
$o .= replace_macros($tpl,array(
'$filename' => $filename,
'$resource' => $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'],

View File

@ -281,9 +281,9 @@ function profiles_content(&$a) {
require_once('view/profile_selectors.php');
$tpl = file_get_contents('view/profed_head.tpl');
$tpl = load_view_file('view/profed_head.tpl');
$opt_tpl = file_get_contents("view/profile-hide-friends.tpl");
$opt_tpl = load_view_file("view/profile-hide-friends.tpl");
$hide_friends = replace_macros($opt_tpl,array(
'$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""),
'$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
@ -298,7 +298,7 @@ function profiles_content(&$a) {
$is_default = (($r[0]['is-default']) ? 1 : 0);
$tpl = file_get_contents("view/profile_edit.tpl");
$tpl = load_view_file("view/profile_edit.tpl");
$o .= replace_macros($tpl,array(
'$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''),
'$baseurl' => $a->get_baseurl(),
@ -342,9 +342,9 @@ function profiles_content(&$a) {
$_SESSION['uid']);
if(count($r)) {
$o .= file_get_contents('view/profile_listing_header.tpl');
$tpl_default = file_get_contents('view/profile_entry_default.tpl');
$tpl = file_get_contents('view/profile_entry.tpl');
$o .= load_view_file('view/profile_listing_header.tpl');
$tpl_default = load_view_file('view/profile_entry_default.tpl');
$tpl = load_view_file('view/profile_entry.tpl');
foreach($r as $rr) {
$template = (($rr['is-default']) ? $tpl_default : $tpl);

View File

@ -169,7 +169,7 @@ function register_post(&$a) {
}
if( $a->config['register_policy'] == REGISTER_OPEN ) {
$email_tpl = file_get_contents("view/register_open_eml.tpl");
$email_tpl = load_view_file("view/register_open_eml.tpl");
$email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(),
@ -204,7 +204,7 @@ function register_post(&$a) {
dbesc($new_password)
);
$email_tpl = file_get_contents("view/register_verify_eml.tpl");
$email_tpl = load_view_file("view/register_verify_eml.tpl");
$email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(),
@ -241,7 +241,7 @@ function register_content(&$a) {
return;
}
$o = file_get_contents("view/register.tpl");
$o = load_view_file("view/register.tpl");
$o = replace_macros($o, array(
'$registertext' =>((x($a->config,'register_text'))
? '<div class="error-message">' . $a->config['register_text'] . '</div>'

View File

@ -63,7 +63,7 @@ function regmod_content(&$a) {
intval($register[0]['uid'])
);
$email_tpl = file_get_contents("view/register_open_eml.tpl");
$email_tpl = load_view_file("view/register_open_eml.tpl");
$email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(),

View File

@ -181,14 +181,14 @@ function settings_content(&$a) {
$timezone = date_default_timezone_get();
$opt_tpl = file_get_contents("view/profile-in-directory.tpl");
$opt_tpl = load_view_file("view/profile-in-directory.tpl");
$profile_in_dir = replace_macros($opt_tpl,array(
'$yes_selected' => (($profile['publish']) ? " checked=\"checked\" " : ""),
'$no_selected' => (($profile['publish'] == 0) ? " checked=\"checked\" " : "")
));
if(strlen(get_config('system','directory_submit_url'))) {
$opt_tpl = file_get_contents("view/profile-in-netdir.tpl");
$opt_tpl = load_view_file("view/profile-in-netdir.tpl");
$profile_in_net_dir = replace_macros($opt_tpl,array(
'$yes_selected' => (($profile['net-publish']) ? " checked=\"checked\" " : ""),
@ -198,11 +198,11 @@ function settings_content(&$a) {
else
$profile_in_net_dir = '';
$nickname_block = file_get_contents("view/settings_nick_set.tpl");
$nickname_block = load_view_file("view/settings_nick_set.tpl");
$nickname_subdir = '';
if(strlen($a->get_path())) {
$subdir_tpl = file_get_contents('view/settings_nick_subdir.tpl');
$subdir_tpl = load_view_file('view/settings_nick_subdir.tpl');
$nickname_subdir = replace_macros($subdir_tpl, array(
'$baseurl' => $a->get_baseurl(),
'$nickname' => $nickname,
@ -230,7 +230,7 @@ function settings_content(&$a) {
'$basepath' => $a->get_hostname(),
'$baseurl' => $a->get_baseurl()));
$stpl = file_get_contents('view/settings.tpl');
$stpl = load_view_file('view/settings.tpl');
$o .= replace_macros($stpl,array(
'$baseurl' => $a->get_baseurl(),

View File

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

View File

@ -16,7 +16,7 @@ function xrd_content(&$a) {
if(! count($r))
killme();
$tpl = file_get_contents('view/xrd_person.tpl');
$tpl = load_view_file('view/xrd_person.tpl');
$o = replace_macros($tpl, array(
'$accturi' => $uri,