]> git.mxchange.org Git - friendica.git/commitdiff
more work on filer, comment level and file tag removal
authorfriendica <info@friendica.com>
Wed, 14 Mar 2012 03:46:37 +0000 (20:46 -0700)
committerfriendica <info@friendica.com>
Wed, 14 Mar 2012 03:46:37 +0000 (20:46 -0700)
include/conversation.php
include/oembed.php
include/text.php
mod/filerm.php [new file with mode: 0644]
view/theme/duepuntozero/style.css
view/theme/duepuntozero/wall_item.tpl
view/theme/duepuntozero/wallwall_item.tpl

index a420e9923abc52555b9305c2942326f5dd5c9764..117127a287fa04b86227538316cb53a9c6418d16 100755 (executable)
@@ -560,25 +560,28 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                );
 
                                $star = false;
+                               $filer = false;
+
                                $isstarred = "unstarred";
-                               if ($profile_owner == local_user() && $toplevelpost) {
-                                       $isstarred = (($item['starred']) ? "starred" : "unstarred");
-
-                                       $star = array(
-                                               'do' => t("add star"),
-                                               'undo' => t("remove star"),
-                                               'toggle' => t("toggle star status"),
-                                               'classdo' => (($item['starred']) ? "hidden" : ""),
-                                               'classundo' => (($item['starred']) ? "" : "hidden"),
-                                               'starred' =>  t('starred'),
-                                               'tagger' => t("add tag"),
-                                               'filer' => t("file as"),
-                                               'classtagger' => "",
-                                       );
+                               if ($profile_owner == local_user()) {
+                                       if($toplevelpost) {
+                                               $isstarred = (($item['starred']) ? "starred" : "unstarred");
+
+                                               $star = array(
+                                                       'do' => t("add star"),
+                                                       'undo' => t("remove star"),
+                                                       'toggle' => t("toggle star status"),
+                                                       'classdo' => (($item['starred']) ? "hidden" : ""),
+                                                       'classundo' => (($item['starred']) ? "" : "hidden"),
+                                                       'starred' =>  t('starred'),
+                                                       'tagger' => t("add tag"),
+                                                       'classtagger' => "",
+                                               );
+                                       }
+                                       $filer = t("file as");
                                }
 
 
-
                                $photo = $item['photo'];
                                $thumb = $item['thumb'];
 
@@ -672,6 +675,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                        'edpost' => $edpost,
                                        'isstarred' => $isstarred,
                                        'star' => $star,
+                                       'filer' => $filer,
                                        'drop' => $drop,
                                        'vote' => $likebuttons,
                                        'like' => $like,
index 52068efc763fab6599e4d98b2168452c4815f9c6..cc71f9757c9208ffcdcd31ac5d8c4de38a53b24b 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
 function oembed_replacecb($matches){
-       logger('oembedcb');
+//     logger('oembedcb');
        $embedurl=$matches[1];
        $j = oembed_fetch_url($embedurl);
        $s =  oembed_format_object($j);
@@ -14,6 +14,9 @@ function oembed_fetch_url($embedurl){
 
        $txt = Cache::get($embedurl);
 
+       // These media files should now be caught in bbcode.php
+       // left here as a fallback in case this is called from another source
+
        $noexts = array("mp3","mp4","ogg","ogv","oga","ogm","webm");
        $ext = pathinfo(strtolower($embedurl),PATHINFO_EXTENSION);
        
index c44b4d1789bef1fb05697ad66f5c649d88ef9e52..199460d2cf12104841d27085a3d8db9a14c34559 100644 (file)
@@ -874,6 +874,7 @@ function link_compare($a,$b) {
 if(! function_exists('prepare_body')) {
 function prepare_body($item,$attach = false) {
 
+       $a = get_app();
        call_hooks('prepare_body_init', $item); 
 
        $s = prepare_text($item['body']);
@@ -916,7 +917,7 @@ function prepare_body($item,$attach = false) {
        $matches = false;
        $cnt = preg_match_all('/<(.*?)>/',$item['file'],$matches,PREG_SET_ORDER);
        if($cnt) {
-               logger('prepare_text: categories: ' . print_r($matches,true), LOGGER_DEBUG);
+//             logger('prepare_text: categories: ' . print_r($matches,true), LOGGER_DEBUG);
                foreach($matches as $mtch) {
                        if(strlen($x))
                                $x .= ',';
@@ -931,11 +932,11 @@ function prepare_body($item,$attach = false) {
        $x = '';
        $cnt = preg_match_all('/\[(.*?)\]/',$item['file'],$matches,PREG_SET_ORDER);
        if($cnt) {
-               logger('prepare_text: filed_under: ' . print_r($matches,true), LOGGER_DEBUG);
+//             logger('prepare_text: filed_under: ' . print_r($matches,true), LOGGER_DEBUG);
                foreach($matches as $mtch) {
                        if(strlen($x))
-                               $x .= ',';
-                       $x .= file_tag_decode($mtch[1]);
+                               $x .= '&nbsp;&nbsp;&nbsp;';
+                       $x .= file_tag_decode($mtch[1]). ' <a href="' . $a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&term=' . file_tag_decode($mtch[1]) . '" title="' . t('remove') . '" >' . t('[remove]') . '</a>';
                }
                if(strlen($x) && (local_user() == $item['uid']))
                        $s .= '<div class="filesavetags"><span>' . t('Filed under:') . ' </span>' . $x . '</div>'; 
diff --git a/mod/filerm.php b/mod/filerm.php
new file mode 100644 (file)
index 0000000..66b684d
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+
+function filerm_content(&$a) {
+
+       if(! local_user()) {
+               killme();
+       }
+
+       $term = notags(trim($_GET['term']));
+       $item_id = (($a->argc > 1) ? notags(trim($a->argv[1])) : 0);
+
+       logger('filerm: tag ' . $term . ' item ' . $item_id);
+
+       if($item_id && strlen($term))
+               file_tag_unsave_file(local_user(),$item_id,$term);
+
+       if(x($_SESSION,'return_url'))
+               goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
+       
+       killme();
+}
index 10ddb00909df6c754bfd9d9cda46475a47c21b1b..b79b00ef418f6ad62702a5da2538fe55892a1b6b 100755 (executable)
@@ -2615,12 +2615,12 @@ aside input[type='text'] {
        margin-top: 10px;
 }
 
-.body-tag {
+.body-tag, .filesavetags {
        opacity: 0.5;
        filter:alpha(opacity=50);
 }
 
-.body-tag:hover {
+.body-tag:hover, .filesavetags:hover {
        opacity: 1.0 !important;
        filter:alpha(opacity=100) !important;
 }
index 2c88fc598ef914d6c64fed26b81eee8f834b09db..6cb018b7bc37932398fd472d3c2e5d49d156aa45 100755 (executable)
                        {{ if $item.star }}
                        <a href="#" id="starred-$item.id" onclick="dostar($item.id); return false;" class="star-item icon $item.isstarred" title="$item.star.toggle"></a>
                        <a href="#" id="tagger-$item.id" onclick="itemTag($item.id); return false;" class="tag-item icon tagged" title="$item.star.tagger"></a>
-                       <a href="#" id="filer-$item.id" onclick="itemFiler($item.id); return false;" class="filer-item filer-icon" title="$item.star.filer"></a>
                        {{ endif }}
-                       
+                       {{ if $item.filer }}
+                       <a href="#" id="filer-$item.id" onclick="itemFiler($item.id); return false;" class="filer-item filer-icon" title="$item.filer"></a>
+                       {{ endif }}
+
                        <div class="wall-item-delete-wrapper" id="wall-item-delete-wrapper-$item.id" >
                                {{ if $item.drop.dropping }}<a href="item/drop/$item.id" onclick="return confirmDelete();" class="icon drophide" title="$item.drop.delete" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a>{{ endif }}
                        </div>
index 211906c9343c995f5e0b8b7bd7ec3470e89f04a6..c37bcb4a28bb81f4e96b5b449fe25274ce05418d 100755 (executable)
@@ -61,6 +61,9 @@
                        <a href="#" id="starred-$item.id" onclick="dostar($item.id); return false;" class="star-item icon $item.isstarred" title="$item.star.toggle"></a>
                        <a href="#" id="tagger-$item.id" onclick="itemTag($item.id); return false;" class="tag-item icon tagged" title="$item.star.tagger"></a>
                        {{ endif }}
+                       {{ if $item.filer }}
+                       <a href="#" id="filer-$item.id" onclick="itemFiler($item.id); return false;" class="filer-item filer-icon" title="$item.filer"></a>
+                       {{ endif }}
                        
                        <div class="wall-item-delete-wrapper" id="wall-item-delete-wrapper-$item.id" >
                                {{ if $item.drop.dropping }}<a href="item/drop/$item.id" onclick="return confirmDelete();" class="icon drophide" title="$item.drop.delete" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a>{{ endif }}