]> git.mxchange.org Git - friendica.git/commitdiff
zeros - theming for new categories/folder display
authorfriendica <info@friendica.com>
Mon, 24 Sep 2012 02:22:48 +0000 (19:22 -0700)
committerfriendica <info@friendica.com>
Mon, 24 Sep 2012 02:22:48 +0000 (19:22 -0700)
include/conversation.php
include/text.php
object/Item.php
view/search_item.tpl
view/wall_item.tpl
view/wall_thread.tpl
view/wallwall_item.tpl
view/wallwall_thread.tpl

index b8546ce014c245d279d2e57ff7afdffe18ec4a15..1bdde5e9ffe38b9216f3d57641f84adfc5bf9048 100644 (file)
@@ -626,13 +626,12 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
                if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
                        $indent .= ' shiny';
 
+
                localize_item($item);
 
                $body = prepare_body($item,true);
 
-               list($categories, $folders) = get_cats_and_terms($item);
-
-
+               list($categories,$folders) = get_cats_and_terms($item);
 
                $tmp_item = array(
                        // collapse comments in template. I don't like this much...
@@ -903,6 +902,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
 
                                $body = prepare_body($item,true);
 
+
                                list($categories, $folders) = get_cats_and_terms($item);
                                //$tmp_item = replace_macros($tpl,array(
                                $tmp_item = array(
index 9b55078cbefe78033cd27a7cd4c82ea607140944..23e3e5061153f51996f891c9a77e5ca03e777543 100644 (file)
@@ -1115,24 +1115,25 @@ function get_cats_and_terms($item) {
     if (count($categories)) $categories[count($categories)-1]['last'] = true;
     
 
-
-    $matches = false; $first = true;
-    $cnt = preg_match_all('/\[(.*?)\]/',$item['file'],$matches,PREG_SET_ORDER);
-    if($cnt) {
-        foreach($matches as $mtch) {
-            $folders[] = array(
-                'name' => xmlify(file_tag_decode($mtch[1])),
-                 'url' =>  "#",
-                'removeurl' => ((local_user() == $item['uid'])?$a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&term=' . xmlify(file_tag_decode($mtch[1])):""),
-                'first' => $first,
-                'last' => false
-            );
-            $first = false;
+       if(local_user() == $item['uid']) {
+           $matches = false; $first = true;
+       $cnt = preg_match_all('/\[(.*?)\]/',$item['file'],$matches,PREG_SET_ORDER);
+           if($cnt) {
+           foreach($matches as $mtch) {
+                   $folders[] = array(
+                   'name' => xmlify(file_tag_decode($mtch[1])),
+                        'url' =>  "#",
+                       'removeurl' => ((local_user() == $item['uid'])?$a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&term=' . xmlify(file_tag_decode($mtch[1])):""),
+                   'first' => $first,
+                       'last' => false
+               );
+                   $first = false;
+                       }
         }
     }
 
     if (count($folders)) $folders[count($folders)-1]['last'] = true;
-    
+
     return array($categories, $folders);
 }
 
index 04d52a896e31624ce61df193622dd47673a9786e..ed439e4d29a1ba97c98f44a8a27e672ac15d4d3f 100644 (file)
@@ -214,6 +214,10 @@ class Item extends BaseObject {
                        'tags' => $tags,
             'hashtags' => $hashtags,
             'mentions' => $mentions,
+                       'txt_cats' => t('Categories:'),
+                       'txt_folders' => t('Filed under:'),
+                       'has_cats' => ((count($categories)) ? 'true' : ''),
+                       'has_folders' => ((count($folders)) ? 'true' : ''),
             'categories' => $categories,
             'folders' => $folders,            
                        'body' => template_escape($body),
index 8d8a0dbd4d57dfaad47cad8bcc289e3ea7de0324..de3c58839cd70ea8315c7572c34bf494d8e4735e 100644 (file)
                        <div class="wall-item-title" id="wall-item-title-$item.id">$item.title</div>
                        <div class="wall-item-title-end"></div>
                        <div class="wall-item-body" id="wall-item-body-$item.id" >$item.body</div>
+                       {{ if $item.has_cats }}
+                       <div class="categorytags"><span>$item.txt_cats {{ for $item.categories as $cat }}$cat.name <a href="$cat.removeurl" title="$remove">[$remove]</a> {{ if $cat.last }}{{ else }}, {{ endif }}{{ endfor }}
+                       </div>
+                       {{ endif }}
+
+                       {{ if $item.has_folders }}
+                       <div class="filesavetags"><span>$item.txt_folders {{ for $item.folders as $cat }}$cat.name <a href="$cat.removeurl" title="$remove">[$remove]</a> {{ if $cat.last }}{{ else }}, {{ endif }}{{ endfor }}
+                       </div>
+                       {{ endif }}
                </div>
                <div class="wall-item-tools" id="wall-item-tools-$item.id">
                        <div class="wall-item-delete-wrapper" id="wall-item-delete-wrapper-$item.id" >
index e4eabb9e5cb099197e931c412c092eb97e7c439d..7fe8794d81010c2dd6f6e253d3be4cccb6b8426c 100644 (file)
                                                        <span class='tag'>$tag</span>
                                                {{ endfor }}
                                        </div>
+                       {{ if $item.has_cats }}
+                       <div class="categorytags"><span>$item.txt_cats {{ for $item.categories as $cat }}$cat.name <a href="$cat.removeurl" title="$remove">[$remove]</a> {{ if $cat.last }}{{ else }}, {{ endif }}{{ endfor }}
+                       </div>
+                       {{ endif }}
+
+                       {{ if $item.has_folders }}
+                       <div class="filesavetags"><span>$item.txt_folders {{ for $item.folders as $cat }}$cat.name <a href="$cat.removeurl" title="$remove">[$remove]</a> {{ if $cat.last }}{{ else }}, {{ endif }}{{ endfor }}
+                       </div>
+                       {{ endif }}
                        </div>
                </div>
                <div class="wall-item-tools" id="wall-item-tools-$item.id">
index e3f0436a3b81cbf3fd778e53f26e1abd860cfbd0..86a937fef5b3ba52c3d4b75e05781b51453f2271 100644 (file)
                                                        <span class='tag'>$tag</span>
                                                {{ endfor }}
                                        </div>
+                       {{ if $item.has_cats }}
+                       <div class="categorytags"><span>$item.txt_cats {{ for $item.categories as $cat }}$cat.name <a href="$cat.removeurl" title="$remove">[$remove]</a> {{ if $cat.last }}{{ else }}, {{ endif }}{{ endfor }}
+                       </div>
+                       {{ endif }}
+
+                       {{ if $item.has_folders }}
+                       <div class="filesavetags"><span>$item.txt_folders {{ for $item.folders as $cat }}$cat.name <a href="$cat.removeurl" title="$remove">[$remove]</a> {{ if $cat.last }}{{ else }}, {{ endif }}{{ endfor }}
+                       </div>
+                       {{ endif }}
                        </div>
                </div>
                <div class="wall-item-tools" id="wall-item-tools-$item.id">
index e8044532a36923b422d10bf0b34a7950f1090ef8..ff2bc00e4752fb2e31819f42e10d7d4fa0d90e1c 100644 (file)
                                                        <span class='tag'>$tag</span>
                                                {{ endfor }}
                                        </div>
+                       {{ if $item.has_cats }}
+                       <div class="categorytags"><span>$item.txt_cats {{ for $item.categories as $cat }}$cat.name <a href="$cat.removeurl" title="$remove">[$remove]</a> {{ if $cat.last }}{{ else }}, {{ endif }}{{ endfor }}
+                       </div>
+                       {{ endif }}
+
+                       {{ if $item.has_folders }}
+                       <div class="filesavetags"><span>$item.txt_folders {{ for $item.folders as $cat }}$cat.name <a href="$cat.removeurl" title="$remove">[$remove]</a> {{ if $cat.last }}{{ else }}, {{ endif }}{{ endfor }}
+                       </div>
+                       {{ endif }}
                        </div>
                </div>
                <div class="wall-item-tools" id="wall-item-tools-$item.id">
index 68bb3bc9d5f2b88c71c5c397c6a1246c25d16a2e..211f9513289486d3f70cec7c9c12322e301f27b1 100644 (file)
                                                        <span class='tag'>$tag</span>
                                                {{ endfor }}
                                        </div>
+                       {{ if $item.has_cats }}
+                       <div class="categorytags"><span>$item.txt_cats {{ for $item.categories as $cat }}$cat.name <a href="$cat.removeurl" title="$remove">[$remove]</a> {{ if $cat.last }}{{ else }}, {{ endif }}{{ endfor }}
+                       </div>
+                       {{ endif }}
+
+                       {{ if $item.has_folders }}
+                       <div class="filesavetags"><span>$item.txt_folders {{ for $item.folders as $cat }}$cat.name <a href="$cat.removeurl" title="$remove">[$remove]</a> {{ if $cat.last }}{{ else }}, {{ endif }}{{ endfor }}
+                       </div>
+                       {{ endif }}
                        </div>
                </div>
                <div class="wall-item-tools" id="wall-item-tools-$item.id">