From fd3274ff5342491e9cec4fe9c628bfccfeeaa517 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Thu, 23 Feb 2012 16:17:36 +0100 Subject: [PATCH 01/10] less html in mod/group.php, template for group members editor, quattro theme for group edit. --- mod/group.php | 82 ++++++++++++++++----------------- view/group_edit.tpl | 30 ++++++------ view/group_new.tpl | 23 --------- view/groupeditor.tpl | 16 +++++++ view/theme/quattro/colors.less | 2 + view/theme/quattro/quattro.less | 27 ++++++++++- view/theme/quattro/style.css | 33 ++++++++++++- 7 files changed, 133 insertions(+), 80 deletions(-) delete mode 100755 view/group_new.tpl create mode 100644 view/groupeditor.tpl diff --git a/mod/group.php b/mod/group.php index c896362ca2..f6f8e41733 100755 --- a/mod/group.php +++ b/mod/group.php @@ -76,14 +76,17 @@ function group_content(&$a) { if($switchtotext === false) $switchtotext = 400; + $tpl = get_markup_template('group_edit.tpl'); + $context = array('$submit' => t('Submit')); + if(($a->argc == 2) && ($a->argv[1] === 'new')) { - $tpl = get_markup_template('group_new.tpl'); - $o .= replace_macros($tpl,array( - '$desc' => t('Create a group of contacts/friends.'), - '$name' => t('Group Name: '), - '$submit' => t('Submit') - )); - return $o; + + return replace_macros($tpl, $context + array( + '$title' => t('Create a group of contacts/friends.'), + '$gname' => array('groupname',t('Group Name: '),$group['name'], ''), + )); + + } if(($a->argc == 3) && ($a->argv[1] === 'drop')) { @@ -156,66 +159,61 @@ function group_content(&$a) { $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); - $tpl = get_markup_template('group_edit.tpl'); - $o .= replace_macros($tpl, array( - '$gid' => $group['id'], - '$name' => $group['name'], - '$drop' => $drop_txt, - '$desc' => t('Click on a contact to add or remove.'), + + $context = $context + array( '$title' => t('Group Editor'), - '$gname' => t('Group Name: '), - '$submit' => t('Submit') - )); + '$gname' => array('groupname',t('Group Name: '),$group['name'], ''), + '$gid' => $group['id'], + '$drop' => $drop_txt, + ); } if(! isset($group)) return; - $o .= '
'; - if($change) - $o = ''; + $groupeditor = array( + 'label_members' => t('Members'), + 'members' => array(), + 'label_contacts' => t('All Contacts'), + 'contacts' => arraY(), + ); + - $o .= '

' . t('Members') . '

'; - $o .= '
'; $textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : false); foreach($members as $member) { if($member['url']) { $member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . '); return true;'; - $o .= micropro($member,true,'mpgroup', $textmode); + $groupeditor['members'][] = micropro($member,true,'mpgroup', $textmode); } else group_rmv_member(local_user(),$group['name'],$member['id']); } - $o .= '
'; - $o .= '
'; - - $o .= '

' . t('All Contacts') . '

'; - $o .= '
'; + $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0 ORDER BY `name` ASC", + intval(local_user()) + ); - $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0 ORDER BY `name` ASC", - intval(local_user()) - ); - - if(count($r)) { - $textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false); - foreach($r as $member) { - if(! in_array($member['id'],$preselected)) { - $member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . '); return true;'; - $o .= micropro($member,true,'mpall', $textmode); - } + if(count($r)) { + $textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false); + foreach($r as $member) { + if(! in_array($member['id'],$preselected)) { + $member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . '); return true;'; + $groupeditor['contacts'][] = micropro($member,true,'mpall', $textmode); } } + } - $o .= '
'; + $context['$groupeditor'] = $groupeditor; + $context['$desc'] = t('Click on a contact to add or remove.'); if($change) { - echo $o; + $tpl = get_markup_template('groupeditor.tpl'); + echo replace_macros($tpl, $context); killme(); } - $o .= '
'; - return $o; + + return replace_macros($tpl, $context); } diff --git a/view/group_edit.tpl b/view/group_edit.tpl index 51782ab952..3689db7535 100755 --- a/view/group_edit.tpl +++ b/view/group_edit.tpl @@ -2,17 +2,21 @@
-
-
- - -
-
-$drop -
- -
-
$desc
-
-
+
+ + {{ inc field_input.tpl with $field=$gname }}{{ endinc }} + {{ if $drop }}$drop{{ endif }} +
+ +
+
+
+ + +{{ if $groupeditor }} +
+ {{ inc groupeditor.tpl }}{{ endinc }} +
+{{ endif }} +{{ if $desc }}
$desc
{{ endif }} diff --git a/view/group_new.tpl b/view/group_new.tpl deleted file mode 100755 index 735b51634d..0000000000 --- a/view/group_new.tpl +++ /dev/null @@ -1,23 +0,0 @@ - - - -
-
- -
-

-$desc - -

- - -
-
- -
- - -
-
- - \ No newline at end of file diff --git a/view/groupeditor.tpl b/view/groupeditor.tpl new file mode 100644 index 0000000000..aa3853375b --- /dev/null +++ b/view/groupeditor.tpl @@ -0,0 +1,16 @@ +
+

$groupeditor.label_members

+
+{{ for $groupeditor.contacts as $c}} $c {{ endfor }} +
+
+
+
+ +
+

$groupeditor.label_contacts

+
+{{ for $groupeditor.members as $m}} $m {{ endfor }} +
+
+
diff --git a/view/theme/quattro/colors.less b/view/theme/quattro/colors.less index 18d0fc620d..9183b2e777 100755 --- a/view/theme/quattro/colors.less +++ b/view/theme/quattro/colors.less @@ -71,6 +71,8 @@ @NoticeColor: @Grey1; @NoticeBackgroundColor: #511919; +@FieldHelpColor: @Grey3; + @ThreadBackgroundColor: #f6f7f8; @ShinyBorderColor: @Yellow1; diff --git a/view/theme/quattro/quattro.less b/view/theme/quattro/quattro.less index 9d26082616..27c48f1952 100755 --- a/view/theme/quattro/quattro.less +++ b/view/theme/quattro/quattro.less @@ -890,6 +890,31 @@ ul.tabs { } +/** group editor **/ +#group-edit-desc { margin-top: 1em; color: @FieldHelpColor; } +#group-update-wrapper{ + height: auto; overflow: auto; + #group { + width:300px; + float:left; + margin-right:20px; + } + #contacts { + width:300px; + float:left; + } + #group-separator { display: none; } + .contact_list { + height: 300px; + border: 1px solid @MenuBorder; + overflow: auto; + .contact-block-div { + width: 50px; height: 50px; + float: left; + } + } +} + /** * Form fields */ @@ -913,7 +938,7 @@ ul.tabs { .field_help { display: block; margin-left: 200px; - color: #666666; + color: @FieldHelpColor; } diff --git a/view/theme/quattro/style.css b/view/theme/quattro/style.css index b728023c9f..6087e4cd17 100755 --- a/view/theme/quattro/style.css +++ b/view/theme/quattro/style.css @@ -1304,6 +1304,37 @@ ul.tabs li { ul.tabs li .active { border-bottom: 1px solid #005c94; } +/** group editor **/ +#group-edit-desc { + margin-top: 1em; + color: #999999; +} +#group-update-wrapper { + height: auto; + overflow: auto; +} +#group-update-wrapper #group { + width: 300px; + float: left; + margin-right: 20px; +} +#group-update-wrapper #contacts { + width: 300px; + float: left; +} +#group-update-wrapper #group-separator { + display: none; +} +#group-update-wrapper .contact_list { + height: 300px; + border: 1px solid #364e59; + overflow: auto; +} +#group-update-wrapper .contact_list .contact-block-div { + width: 50px; + height: 50px; + float: left; +} /** * Form fields */ @@ -1326,7 +1357,7 @@ ul.tabs li .active { .field .field_help { display: block; margin-left: 200px; - color: #666666; + color: #999999; } .field .onoff { float: left; From f5b8654818e63a0583e58caecc8a13c2d83c12d5 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Thu, 23 Feb 2012 16:21:28 +0100 Subject: [PATCH 02/10] fix visualization in groupeditor --- view/groupeditor.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/groupeditor.tpl b/view/groupeditor.tpl index aa3853375b..755985eb35 100644 --- a/view/groupeditor.tpl +++ b/view/groupeditor.tpl @@ -1,7 +1,7 @@

$groupeditor.label_members

-{{ for $groupeditor.contacts as $c}} $c {{ endfor }} +{{ for $groupeditor.members as $c}} $c {{ endfor }}

@@ -10,7 +10,7 @@

$groupeditor.label_contacts

-{{ for $groupeditor.members as $m}} $m {{ endfor }} +{{ for $groupeditor.contacts as $m}} $m {{ endfor }}
From f0b6e7629312c6eaf8b1ac2a0abca2bb6ef49c8c Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Thu, 1 Mar 2012 11:28:48 +0100 Subject: [PATCH 03/10] admin: fix small string --- mod/admin.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index 0f600e3126..94bf445032 100755 --- a/mod/admin.php +++ b/mod/admin.php @@ -366,7 +366,7 @@ function admin_page_users_post(&$a){ intval( $uid ) ); } - notice( sprintf( tt("%s user blocked", "%s users blocked/unblocked", count($users)), count($users)) ); + notice( sprintf( tt("%s user blocked/unblocked", "%s users blocked/unblocked", count($users)), count($users)) ); } if (x($_POST,'page_users_delete')){ require_once("include/Contact.php"); @@ -428,6 +428,7 @@ function admin_page_users(&$a){ LEFT JOIN `contact` ON `register`.`uid` = `contact`.`uid` LEFT JOIN `user` ON `register`.`uid` = `user`.`uid`;"); + /* get users */ $total = q("SELECT count(*) as total FROM `user` where 1"); @@ -435,7 +436,8 @@ function admin_page_users(&$a){ $a->set_pager_total($total[0]['total']); $a->set_pager_itemspage(100); } - + + $users = q("SELECT `user` . * , `contact`.`name` , `contact`.`url` , `contact`.`micro`, `lastitem`.`lastitem_date` FROM (SELECT MAX(`item`.`changed`) as `lastitem_date`, `item`.`uid` @@ -469,6 +471,7 @@ function admin_page_users(&$a){ } $users = array_map("_setup_users", $users); + $t = get_markup_template("admin_users.tpl"); $o = replace_macros($t, array( // strings // From a26ce7c56b91defccf0b222c9c9481d4b05f3c8d Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Thu, 1 Mar 2012 11:31:16 +0100 Subject: [PATCH 04/10] show relation in contact_template --- view/contact_template.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/view/contact_template.tpl b/view/contact_template.tpl index f4c0670bfe..b826acc65d 100755 --- a/view/contact_template.tpl +++ b/view/contact_template.tpl @@ -17,6 +17,7 @@
$contact.name
+ {{ if $contact.alt_text }}
$contact.alt_text
{{ endif }}
$contact.itemurl
$contact.network
From c462ed9fc50e2c2a60e8cb01314a7d5fa498b412 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Thu, 1 Mar 2012 11:32:49 +0100 Subject: [PATCH 05/10] template proc: avoid a notice and allow template name to include to be passed with a variable value --- include/template_processor.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/template_processor.php b/include/template_processor.php index 28c3f07ddd..b4d444e1c6 100755 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -116,7 +116,15 @@ * {{ inc [with $var1=$var2] }}{{ endinc }} */ private function _replcb_inc($args){ - list($tplfile, $newctx) = array_map('trim', explode("with",$args[2])); + if (strpos($args[2],"with")) { + list($tplfile, $newctx) = array_map('trim', explode("with",$args[2])); + } else { + $tplfile = trim($args[2]); + $newctx = null; + } + + if ($tplfile[0]=="$") $tplfile = $this->_get_var($tplfile); + $this->_push_stack(); $r = $this->r; if (!is_null($newctx)) { From e0c659b34b8992111bcc64d3f0eea75dfa193412 Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Thu, 1 Mar 2012 11:44:33 +0100 Subject: [PATCH 06/10] Enabled automated doc building. Changes: -build.xml, phing build file -@package tags at acl_selector.php and db_update.php -added documentation and some IDE files to .gitignore -automated tool to find files that corrupt the doc build process -removed ansi characters from SSH1.php, docBlox could not handle them --- .gitignore | 8 ++ build.xml | 38 +++++++++ include/acl_selectors.php | 7 +- library/phpsec/Net/SSH1.php | 4 +- util/db_update.php | 6 ++ util/docblox_errorchecker.php | 145 ++++++++++++++++++++++++++++++++++ 6 files changed, 205 insertions(+), 3 deletions(-) create mode 100644 build.xml create mode 100644 util/docblox_errorchecker.php diff --git a/.gitignore b/.gitignore index 3dfb8a903a..6302bc1c8b 100755 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,11 @@ home.html addon *~ +#ignore documentation, it should be newly built +doc/api + +#ignore config files from eclipse, we don't want IDE files in our repository +.project +.buildpath +.externalToolBuilders +.settings diff --git a/build.xml b/build.xml new file mode 100644 index 0000000000..83c5300264 --- /dev/null +++ b/build.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/acl_selectors.php b/include/acl_selectors.php index 6070b7db21..67d8cebdeb 100755 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -1,6 +1,11 @@ Date: Thu, 1 Mar 2012 11:46:08 +0100 Subject: [PATCH 07/10] conversation: remove templating items in code and move it to template. --- include/conversation.php | 197 +++++++++++----------- view/conversation.tpl | 14 +- view/search_item.tpl | 74 ++++---- view/theme/dispy/search_item.tpl | 52 +++--- view/theme/dispy/wall_item.tpl | 82 ++++----- view/theme/dispy/wallwall_item.tpl | 90 +++++----- view/theme/duepuntozero/conversation.tpl | 14 +- view/theme/duepuntozero/search_item.tpl | 54 +++--- view/theme/duepuntozero/wall_item.tpl | 84 ++++----- view/theme/duepuntozero/wallwall_item.tpl | 92 +++++----- view/theme/vier/search_item.tpl | 72 ++++---- view/theme/vier/wall_item.tpl | 76 ++++----- view/theme/vier/wallwall_item.tpl | 86 +++++----- view/wall_item.tpl | 70 ++++---- view/wallwall_item.tpl | 78 ++++----- 15 files changed, 584 insertions(+), 551 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 2ef37694dc..f4740688cd 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -6,11 +6,6 @@ function localize_item(&$item){ $Text = $item['body']; - - - // find private image (w/data url) if present and convert image - // link to a magic-auth redirect. - $saved_image = ''; $img_start = strpos($Text,'[img]data:'); $img_end = strpos($Text,'[/img]'); @@ -184,6 +179,7 @@ function localize_item(&$item){ * that are based on unique features of the calling module. * */ + if(!function_exists('conversation')){ function conversation(&$a, $items, $mode, $update, $preview = false) { require_once('bbcode.php'); @@ -231,13 +227,13 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $items = $cb['items']; $cmnt_tpl = get_markup_template('comment_item.tpl'); - $tpl = get_markup_template('wall_item.tpl'); - $wallwall = get_markup_template('wallwall_item.tpl'); + $tpl = 'wall_item.tpl'; + $wallwall = 'wallwall_item.tpl'; $hide_comments_tpl = get_markup_template('hide_comments.tpl'); $alike = array(); $dlike = array(); - $o = ""; + // array with html for each thread (parent+comments) $threads = array(); @@ -250,7 +246,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { // "New Item View" on network page or search page results // - just loop through the items and format them minimally for display - $tpl = get_markup_template('search_item.tpl'); + //$tpl = get_markup_template('search_item.tpl'); + $tpl = 'search_item.tpl'; foreach($items as $item) { $threadsid++; @@ -316,43 +313,46 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $body = prepare_body($item,true); - $tmp_item = replace_macros($tpl,array( - '$id' => (($preview) ? 'P0' : $item['item_id']), - '$linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])), - '$profile_url' => $profile_link, - '$item_photo_menu' => item_photo_menu($item), - '$name' => template_escape($profile_name), - '$sparkle' => $sparkle, - '$lock' => $lock, - '$thumb' => $profile_avatar, - '$title' => template_escape($item['title']), - '$body' => template_escape($body), - '$ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])), - '$lock' => $lock, - '$location' => template_escape($location), - '$indent' => '', - '$owner_name' => template_escape($owner_name), - '$owner_url' => $owner_url, - '$owner_photo' => $owner_photo, - '$plink' => get_plink($item), - '$edpost' => false, - '$isstarred' => $isstarred, - '$star' => $star, - '$drop' => $drop, - '$vote' => $likebuttons, - '$like' => '', - '$dislike' => '', - '$comment' => '', - '$conv' => (($preview) ? '' : array('href'=> $a->get_baseurl() . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))), - '$previewing' => $previewing, - '$wait' => t('Please wait'), - )); + //$tmp_item = replace_macros($tpl,array( + $tmp_item = array( + 'template' => $tpl, + 'id' => (($preview) ? 'P0' : $item['item_id']), + 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])), + 'profile_url' => $profile_link, + 'item_photo_menu' => item_photo_menu($item), + 'name' => template_escape($profile_name), + 'sparkle' => $sparkle, + 'lock' => $lock, + 'thumb' => $profile_avatar, + 'title' => template_escape($item['title']), + 'body' => template_escape($body), + 'text' => strip_tags(template_escape($body)), + 'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])), + 'lock' => $lock, + 'location' => template_escape($location), + 'indent' => '', + 'owner_name' => template_escape($owner_name), + 'owner_url' => $owner_url, + 'owner_photo' => $owner_photo, + 'plink' => get_plink($item), + 'edpost' => false, + 'isstarred' => $isstarred, + 'star' => $star, + 'drop' => $drop, + 'vote' => $likebuttons, + 'like' => '', + 'dislike' => '', + 'comment' => '', + 'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl() . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))), + 'previewing' => $previewing, + 'wait' => t('Please wait'), + ); $arr = array('item' => $item, 'output' => $tmp_item); call_hooks('display_item', $arr); $threads[$threadsid]['id'] = $item['item_id']; - $threads[$threadsid]['html'] .= $arr['output']; + $threads[$threadsid]['items'] = array($arr['output']); } @@ -385,6 +385,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { } $comments_collapsed = false; + $comment_lastcollapsed = false; + $comment_firstcollapsed = false; $blowhard = 0; $blowhard_count = 0; @@ -438,10 +440,12 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $comments_seen = 0; $comments_collapsed = false; + $comment_lastcollapsed = false; + $comment_firstcollapsed = false; $threadsid++; $threads[$threadsid]['id'] = $item['item_id']; - $threads[$threadsid]['html'] = ""; + $threads[$threadsid]['items'] = array(); } else { @@ -449,6 +453,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { if((! $toplevelpost) && (! $toplevelprivate) && ($item['private']) && ($profile_owner != local_user())) continue; $comments_seen ++; + $comment_lastcollapsed = false; + $comment_firstcollapsed = false; } $override_comment_box = ((($page_writeable) && ($item_writeable)) ? true : false); @@ -456,23 +462,17 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) { - if(! $comments_collapsed) { - // IMPORTANT: the closing
in the hide_comments template - // is supplied below in code. - - $threads[$threadsid]['html'] .= replace_macros($hide_comments_tpl,array( - '$id' => $item['parent'], - '$num_comments' => sprintf( tt('%d comment','%d comments',$comments[$item['parent']]), - $comments[$item['parent']]), - '$display' => 'none', - '$hide_text' => t('show more') - )); + if (!$comments_collapsed){ + $threads[$threadsid]['num_comments'] = sprintf( tt('%d comment','%d comments',$comments[$item['parent']]),$comments[$item['parent']] ); + $threads[$threadsid]['hide_text'] = t('show more'); $comments_collapsed = true; + $comment_firstcollapsed = true; } } if(($comments[$item['parent']] > 2) && ($comments_seen == ($comments[$item['parent']] - 1))) { - $threads[$threadsid]['html'] .= '
'; + + $comment_lastcollapsed = true; } $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; @@ -649,63 +649,72 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { // Build the HTML $body = prepare_body($item,true); + //$tmp_item = replace_macros($template, + $tmp_item = array( + // collapse comments in template. I don't like this much... + 'comment_firstcollapsed' => $comment_firstcollapsed, + 'comment_lastcollapsed' => $comment_lastcollapsed, + // template to use to render item (wall, walltowall, search) + 'template' => $template, + + 'type' => implode("",array_slice(split("/",$item['verb']),-1)), + 'tags' => $tags, + 'body' => template_escape($body), + 'text' => strip_tags(template_escape($body)), + 'id' => $item['item_id'], + 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])), + 'olinktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])), + 'to' => t('to'), + 'wall' => t('Wall-to-Wall'), + 'vwall' => t('via Wall-To-Wall:'), + 'profile_url' => $profile_link, + 'item_photo_menu' => item_photo_menu($item), + 'name' => template_escape($profile_name), + 'thumb' => $profile_avatar, + 'osparkle' => $osparkle, + 'sparkle' => $sparkle, + 'title' => template_escape($item['title']), + 'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])), + 'lock' => $lock, + 'location' => template_escape($location), + 'indent' => $indent, + 'owner_url' => $owner_url, + 'owner_photo' => $owner_photo, + 'owner_name' => template_escape($owner_name), + 'plink' => get_plink($item), + 'edpost' => $edpost, + 'isstarred' => $isstarred, + 'star' => $star, + 'drop' => $drop, + 'vote' => $likebuttons, + 'like' => $like, + 'dislike' => $dislike, + 'comment' => $comment, + 'previewing' => $previewing, + 'wait' => t('Please wait'), - $tmp_item = replace_macros($template,array( - '$type' => implode("",array_slice(explode("/",$item['verb']),-1)), - '$tags' => $tags, - '$body' => template_escape($body), - '$id' => $item['item_id'], - '$linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])), - '$olinktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])), - '$to' => t('to'), - '$wall' => t('Wall-to-Wall'), - '$vwall' => t('via Wall-To-Wall:'), - '$profile_url' => $profile_link, - '$item_photo_menu' => item_photo_menu($item), - '$name' => template_escape($profile_name), - '$thumb' => $profile_avatar, - '$osparkle' => $osparkle, - '$sparkle' => $sparkle, - '$title' => template_escape($item['title']), - '$ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])), - '$lock' => $lock, - '$location' => template_escape($location), - '$indent' => $indent, - '$owner_url' => $owner_url, - '$owner_photo' => $owner_photo, - '$owner_name' => template_escape($owner_name), - '$plink' => get_plink($item), - '$edpost' => $edpost, - '$isstarred' => $isstarred, - '$star' => $star, - '$drop' => $drop, - '$vote' => $likebuttons, - '$like' => $like, - '$dislike' => $dislike, - '$comment' => $comment, - '$previewing' => $previewing, - '$wait' => t('Please wait'), - - )); + ); $arr = array('item' => $item, 'output' => $tmp_item); call_hooks('display_item', $arr); - $threads[$threadsid]['html'] .= $arr['output']; + $threads[$threadsid]['items'][] = $arr['output']; } } } - $page_template = get_markup_template("conversation.tpl"); $o .= replace_macros($page_template, array( + '$baseurl' => $a->get_baseurl(), + '$mode' => $mode, + '$user' => $a->user, '$threads' => $threads, '$dropping' => ($dropping?t('Delete Selected Items'):False), )); return $o; -} +}} function best_link_url($item,&$sparkle) { diff --git a/view/conversation.tpl b/view/conversation.tpl index 7d4e7d2621..ff202bbe44 100755 --- a/view/conversation.tpl +++ b/view/conversation.tpl @@ -1,6 +1,18 @@ {{ for $threads as $thread }}
- $thread.html + {{ for $thread.items as $item }} + {{if $item.comment_firstcollapsed}} +
+ $thread.num_comments $thread.hide_text +
+ {{endif}} + + {{ inc $item.template }}{{ endinc }} + + + {{ endfor }}
{{ endfor }} diff --git a/view/search_item.tpl b/view/search_item.tpl index de8bd23961..a889062e06 100755 --- a/view/search_item.tpl +++ b/view/search_item.tpl @@ -1,75 +1,75 @@
- $star.starred - {{ if $lock }}$lock{{ endif }} - + $item.star.starred + {{ if $item.lock }}$item.lock{{ endif }} +
-
+
- {{ for $tags as $tag }} - $tag + {{ for $item.tags as $item.tag }} + $item.tag {{ endfor }}
- {{ if $plink }}$plink.title{{ endif }} + {{ if $item.plink }}$item.plink.title{{ endif }}
- $name $ago + $item.name $item.ago
- {{ if $star }} - $star.do - $star.undo - $star.tagger + {{ if $item.star }} + $item.star.do + $item.star.undo + $item.star.tagger {{ endif }} - {{ if $vote }} - $vote.like.1 - $vote.dislike.1 + {{ if $item.vote }} + $item.vote.like.1 + $item.vote.dislike.1 {{ endif }} - {{ if $vote.share }} - $vote.share.1 + {{ if $item.vote.share }} + $item.vote.share.1 {{ endif }}
- {{ if $drop.dropping }} - - $drop.delete + {{ if $item.drop.dropping }} + + $item.drop.delete {{ endif }} - {{ if $edpost }} - + {{ if $item.edpost }} + {{ endif }}
@@ -77,11 +77,11 @@
- -
$dislike
- {{ if $conv }} -
- $conv.title + +
$item.dislike
+ {{ if $item.conv }} +
+ $item.conv.title {{ endif }}
diff --git a/view/theme/dispy/search_item.tpl b/view/theme/dispy/search_item.tpl index 3d841ab080..54c3e389c0 100755 --- a/view/theme/dispy/search_item.tpl +++ b/view/theme/dispy/search_item.tpl @@ -1,40 +1,40 @@ -
-
-
-
- - $name - menu -
+
+
+
+
+ + $item.name + menu +
    - $item_photo_menu + $item.item_photo_menu
-
{{ if $location }}$location {{ endif }}
+
{{ if $item.location }}$item.location {{ endif }}
- {{ if $lock }}
$lock
+ {{ if $item.lock }}
$item.lock
{{ else }}
{{ endif }}
-
-
- {{ if $drop.dropping }}{{ endif }} +
+
+ {{ if $item.drop.dropping }}{{ endif }}
- {{ if $drop.dropping }}{{ endif }} + {{ if $item.drop.dropping }}{{ endif }}
-
-
$title
+
+
$item.title
-
$body
+
$item.body
- $name -
$ago
+ $item.name +
$item.ago
@@ -42,10 +42,10 @@
-
-
- {{ if $conv }} - $conv.title +
+
+ {{ if $item.conv }} + $item.conv.title {{ endif }}
diff --git a/view/theme/dispy/wall_item.tpl b/view/theme/dispy/wall_item.tpl index 882843a093..0dcd30f7b4 100755 --- a/view/theme/dispy/wall_item.tpl +++ b/view/theme/dispy/wall_item.tpl @@ -1,77 +1,77 @@ -
-
-
-
- - $name +
+
+
+
+ + $item.name - menu -
+ menu +
    - $item_photo_menu + $item.item_photo_menu
-
{{ if $location }}$location {{ endif }}
+
{{ if $item.location }}$item.location {{ endif }}
- {{ if $lock }}
$lock
+ {{ if $item.lock }}
$item.lock
{{ else }}
{{ endif }}
-
- {{ if $star }} - - +
+ {{ if $item.star }} + + {{ endif }} - {{ if $vote }} -