Implement Smarty3
This commit is contained in:
parent
5cedd3430f
commit
96ed0a7791
755 changed files with 21646 additions and 637 deletions
115
mod/photos.php
115
mod/photos.php
|
@ -1039,6 +1039,16 @@ function photos_content(&$a) {
|
|||
|
||||
|
||||
$tpl = get_markup_template('photos_upload.tpl');
|
||||
|
||||
if($a->theme['template_engine'] === 'internal') {
|
||||
$albumselect_e = template_escape($albumselect);
|
||||
$aclselect_e = (($visitor) ? '' : template_escape(populate_acl($a->user, $celeb)));
|
||||
}
|
||||
else {
|
||||
$albumselect_e = $albumselect;
|
||||
$aclselect_e = (($visitor) ? '' : populate_acl($a->user, $celeb));
|
||||
}
|
||||
|
||||
$o .= replace_macros($tpl,array(
|
||||
'$pagename' => t('Upload Photos'),
|
||||
'$sessid' => session_id(),
|
||||
|
@ -1047,9 +1057,9 @@ function photos_content(&$a) {
|
|||
'$newalbum' => t('New album name: '),
|
||||
'$existalbumtext' => t('or existing album name: '),
|
||||
'$nosharetext' => t('Do not show a status post for this upload'),
|
||||
'$albumselect' => template_escape($albumselect),
|
||||
'$albumselect' => $albumselect_e,
|
||||
'$permissions' => t('Permissions'),
|
||||
'$aclselect' => (($visitor) ? '' : template_escape(populate_acl($a->user, $celeb))),
|
||||
'$aclselect' => $aclselect_e,
|
||||
'$uploader' => $ret['addon_text'],
|
||||
'$default' => (($ret['default_upload']) ? $default_upload : ''),
|
||||
'$uploadurl' => $ret['post_url']
|
||||
|
@ -1092,10 +1102,18 @@ function photos_content(&$a) {
|
|||
if(($album !== t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) {
|
||||
if($can_post) {
|
||||
$edit_tpl = get_markup_template('album_edit.tpl');
|
||||
|
||||
if($a->theme['template_engine'] === 'internal') {
|
||||
$album_e = template_escape($album);
|
||||
}
|
||||
else {
|
||||
$album_e = $album;
|
||||
}
|
||||
|
||||
$o .= replace_macros($edit_tpl,array(
|
||||
'$nametext' => t('New album name: '),
|
||||
'$nickname' => $a->data['user']['nickname'],
|
||||
'$album' => template_escape($album),
|
||||
'$album' => $album_e,
|
||||
'$hexalbum' => bin2hex($album),
|
||||
'$submit' => t('Submit'),
|
||||
'$dropsubmit' => t('Delete Album')
|
||||
|
@ -1135,6 +1153,15 @@ function photos_content(&$a) {
|
|||
|
||||
$ext = $phototypes[$rr['type']];
|
||||
|
||||
if($a->theme['template_engine'] === 'internal') {
|
||||
$imgalt_e = template_escape($rr['filename']);
|
||||
$desc_e = template_escape($rr['desc']);
|
||||
}
|
||||
else {
|
||||
$imgalt_e = $rr['filename'];
|
||||
$desc_e = $rr['desc'];
|
||||
}
|
||||
|
||||
$o .= replace_macros($tpl,array(
|
||||
'$id' => $rr['id'],
|
||||
'$twist' => ' ' . $twist . rand(2,4),
|
||||
|
@ -1142,8 +1169,8 @@ function photos_content(&$a) {
|
|||
. (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''),
|
||||
'$phototitle' => t('View Photo'),
|
||||
'$imgsrc' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.' .$ext,
|
||||
'$imgalt' => template_escape($rr['filename']),
|
||||
'$desc'=> template_escape($rr['desc'])
|
||||
'$imgalt' => $imgalt_e,
|
||||
'$desc'=> $desc_e
|
||||
));
|
||||
|
||||
}
|
||||
|
@ -1344,20 +1371,32 @@ function photos_content(&$a) {
|
|||
$edit = Null;
|
||||
if(($cmd === 'edit') && ($can_post)) {
|
||||
$edit_tpl = get_markup_template('photo_edit.tpl');
|
||||
|
||||
if($a->theme['template_engine'] === 'internal') {
|
||||
$album_e = template_escape($ph[0]['album']);
|
||||
$caption_e = template_escape($ph[0]['desc']);
|
||||
$aclselect_e = template_escape(populate_acl($ph[0]));
|
||||
}
|
||||
else {
|
||||
$album_e = $ph[0]['album'];
|
||||
$caption_e = $ph[0]['desc'];
|
||||
$aclselect_e = populate_acl($ph[0]);
|
||||
}
|
||||
|
||||
$edit = replace_macros($edit_tpl, array(
|
||||
'$id' => $ph[0]['id'],
|
||||
'$rotatecw' => t('Rotate CW (right)'),
|
||||
'$rotateccw' => t('Rotate CCW (left)'),
|
||||
'$album' => template_escape($ph[0]['album']),
|
||||
'$album' => $album_e,
|
||||
'$newalbum' => t('New album name'),
|
||||
'$nickname' => $a->data['user']['nickname'],
|
||||
'$resource_id' => $ph[0]['resource-id'],
|
||||
'$capt_label' => t('Caption'),
|
||||
'$caption' => template_escape($ph[0]['desc']),
|
||||
'$caption' => $caption_e,
|
||||
'$tag_label' => t('Add a Tag'),
|
||||
'$tags' => $link_item['tag'],
|
||||
'$permissions' => t('Permissions'),
|
||||
'$aclselect' => template_escape(populate_acl($ph[0])),
|
||||
'$aclselect' => $aclselect_e,
|
||||
'$help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping'),
|
||||
'$item_id' => ((count($linked_items)) ? $link_item['id'] : 0),
|
||||
'$submit' => t('Submit'),
|
||||
|
@ -1488,14 +1527,25 @@ function photos_content(&$a) {
|
|||
$drop = replace_macros(get_markup_template('photo_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete')));
|
||||
|
||||
|
||||
if($a->theme['template_engine'] === 'internal') {
|
||||
$name_e = template_escape($profile_name);
|
||||
$title_e = template_escape($item['title']);
|
||||
$body_e = template_escape(bbcode($item['body']));
|
||||
}
|
||||
else {
|
||||
$name_e = $profile_name;
|
||||
$title_e = $item['title'];
|
||||
$body_e = bbcode($item['body']);
|
||||
}
|
||||
|
||||
$comments .= replace_macros($template,array(
|
||||
'$id' => $item['item_id'],
|
||||
'$profile_url' => $profile_link,
|
||||
'$name' => template_escape($profile_name),
|
||||
'$name' => $name_e,
|
||||
'$thumb' => $profile_avatar,
|
||||
'$sparkle' => $sparkle,
|
||||
'$title' => template_escape($item['title']),
|
||||
'$body' => template_escape(bbcode($item['body'])),
|
||||
'$title' => $title_e,
|
||||
'$body' => $body_e,
|
||||
'$ago' => relative_date($item['created']),
|
||||
'$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''),
|
||||
'$drop' => $drop,
|
||||
|
@ -1531,20 +1581,34 @@ function photos_content(&$a) {
|
|||
}
|
||||
|
||||
$photo_tpl = get_markup_template('photo_view.tpl');
|
||||
|
||||
if($a->theme['template_engine'] === 'internal') {
|
||||
$album_e = array($album_link,template_escape($ph[0]['album']));
|
||||
$tags_e = template_escape($tags);
|
||||
$like_e = template_escape($like);
|
||||
$dislike_e = template_escape($dislike);
|
||||
}
|
||||
else {
|
||||
$album_e = array($album_link,$ph[0]['album']);
|
||||
$tags_e = $tags;
|
||||
$like_e = $like;
|
||||
$dislike_e = $dislike;
|
||||
}
|
||||
|
||||
$o .= replace_macros($photo_tpl, array(
|
||||
'$id' => $ph[0]['id'],
|
||||
'$album' => array($album_link,template_escape($ph[0]['album'])),
|
||||
'$album' => $album_e,
|
||||
'$tools' => $tools,
|
||||
'$lock' => $lock,
|
||||
'$photo' => $photo,
|
||||
'$prevlink' => $prevlink,
|
||||
'$nextlink' => $nextlink,
|
||||
'$desc' => $ph[0]['desc'],
|
||||
'$tags' => template_escape($tags),
|
||||
'$tags' => $tags_e,
|
||||
'$edit' => $edit,
|
||||
'$likebuttons' => $likebuttons,
|
||||
'$like' => template_escape($like),
|
||||
'$dislike' => template_escape($dislike),
|
||||
'$like' => $like_e,
|
||||
'$dislike' => $dikslike_e,
|
||||
'$comments' => $comments,
|
||||
'$paginate' => $paginate,
|
||||
));
|
||||
|
@ -1588,16 +1652,25 @@ function photos_content(&$a) {
|
|||
$twist = 'rotright';
|
||||
$ext = $phototypes[$rr['type']];
|
||||
|
||||
if($a->theme['template_engine'] === 'internal') {
|
||||
$alt_e = template_escape($rr['filename']);
|
||||
$name_e = template_escape($rr['album']);
|
||||
}
|
||||
else {
|
||||
$alt_e = $rr['filename'];
|
||||
$name_e = $rr['album'];
|
||||
}
|
||||
|
||||
$photos[] = array(
|
||||
'id' => $rr['id'],
|
||||
'twist' => ' ' . $twist . rand(2,4),
|
||||
'link' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'],
|
||||
'title' => t('View Photo'),
|
||||
'src' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.' . $ext,
|
||||
'alt' => template_escape($rr['filename']),
|
||||
'alt' => $alt_e,
|
||||
'album' => array(
|
||||
'link' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),
|
||||
'name' => template_escape($rr['album']),
|
||||
'name' => $name_e,
|
||||
'alt' => t('View Album'),
|
||||
),
|
||||
|
||||
|
@ -1606,7 +1679,13 @@ function photos_content(&$a) {
|
|||
}
|
||||
|
||||
$tpl = get_markup_template('photos_recent.tpl');
|
||||
$o .= replace_macros($tpl,array(
|
||||
|
||||
$includes = array(
|
||||
'$photo_top' => 'photo_top.tpl',
|
||||
);
|
||||
$includes = set_template_includes($a->theme['template_engine'], $includes);
|
||||
|
||||
$o .= replace_macros($tpl,$includes + array(
|
||||
'$title' => t('Recent Photos'),
|
||||
'$can_post' => $can_post,
|
||||
'$upload' => array(t('Upload New Photos'), $a->get_baseurl().'/photos/'.$a->data['user']['nickname'].'/upload'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue