aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-03-13 20:46:37 -0700
committerfriendica <info@friendica.com>2012-03-13 20:46:37 -0700
commit4972d7ef6ee740f6eb09d8c7efa9a76ee40973c1 (patch)
treee27d165beb084a7fea27e9cd5b2a8a9c6da4b1f8
parentde017d1ed76500c01fd11c8e1d36cf4ebd70172d (diff)
downloadvolse-hubzilla-4972d7ef6ee740f6eb09d8c7efa9a76ee40973c1.tar.gz
volse-hubzilla-4972d7ef6ee740f6eb09d8c7efa9a76ee40973c1.tar.bz2
volse-hubzilla-4972d7ef6ee740f6eb09d8c7efa9a76ee40973c1.zip
more work on filer, comment level and file tag removal
-rwxr-xr-xinclude/conversation.php34
-rwxr-xr-xinclude/oembed.php5
-rw-r--r--include/text.php9
-rw-r--r--mod/filerm.php21
-rwxr-xr-xview/theme/duepuntozero/style.css4
-rwxr-xr-xview/theme/duepuntozero/wall_item.tpl6
-rwxr-xr-xview/theme/duepuntozero/wallwall_item.tpl3
7 files changed, 58 insertions, 24 deletions
diff --git a/include/conversation.php b/include/conversation.php
index a420e9923..117127a28 100755
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -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,
diff --git a/include/oembed.php b/include/oembed.php
index 52068efc7..cc71f9757 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -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);
diff --git a/include/text.php b/include/text.php
index c44b4d178..199460d2c 100644
--- a/include/text.php
+++ b/include/text.php
@@ -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
index 000000000..66b684dc9
--- /dev/null
+++ b/mod/filerm.php
@@ -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();
+}
diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css
index 10ddb0090..b79b00ef4 100755
--- a/view/theme/duepuntozero/style.css
+++ b/view/theme/duepuntozero/style.css
@@ -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;
}
diff --git a/view/theme/duepuntozero/wall_item.tpl b/view/theme/duepuntozero/wall_item.tpl
index 2c88fc598..6cb018b7b 100755
--- a/view/theme/duepuntozero/wall_item.tpl
+++ b/view/theme/duepuntozero/wall_item.tpl
@@ -56,9 +56,11 @@
{{ 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>
diff --git a/view/theme/duepuntozero/wallwall_item.tpl b/view/theme/duepuntozero/wallwall_item.tpl
index 211906c93..c37bcb4a2 100755
--- a/view/theme/duepuntozero/wallwall_item.tpl
+++ b/view/theme/duepuntozero/wallwall_item.tpl
@@ -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 }}