aboutsummaryrefslogtreecommitdiff
path: root/views/default/tidypics
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-06-16 01:39:32 +0000
committerCash Costello <cash.costello@gmail.com>2009-06-16 01:39:32 +0000
commitb4b85ecc55a6787726627150a2ee93fd960ff2c6 (patch)
tree35e8e30305355b72c011c26597eec75759cc4b17 /views/default/tidypics
parentde4945a1bb1b627a530048c7dece50805d06f1ee (diff)
downloadelgg-b4b85ecc55a6787726627150a2ee93fd960ff2c6.tar.gz
elgg-b4b85ecc55a6787726627150a2ee93fd960ff2c6.tar.bz2
added delete phototags capability
Diffstat (limited to 'views/default/tidypics')
-rw-r--r--views/default/tidypics/css.php12
-rw-r--r--views/default/tidypics/image_menu.php11
-rw-r--r--views/default/tidypics/tagging.php16
3 files changed, 38 insertions, 1 deletions
diff --git a/views/default/tidypics/css.php b/views/default/tidypics/css.php
index bc0073734..7564f1eaf 100644
--- a/views/default/tidypics/css.php
+++ b/views/default/tidypics/css.php
@@ -230,6 +230,18 @@ font-size:12px;
text-align:left;
}
+#delete_tag_menu {
+border:1px solid #3B5999;
+width:200px;
+position:absolute;
+z-index:10000;
+display:none;
+background:#ffffff;
+padding:10px;
+font-size:12px;
+text-align:left;
+}
+
.tidypics_tag {
display:none;
background:url(<?php echo $vars['url']; ?>mod/tidypics/graphics/spacer.gif);
diff --git a/views/default/tidypics/image_menu.php b/views/default/tidypics/image_menu.php
index 9257d780a..5940a0138 100644
--- a/views/default/tidypics/image_menu.php
+++ b/views/default/tidypics/image_menu.php
@@ -13,7 +13,8 @@
$file_guid = $vars['file_guid'];
$viewer = $vars['viewer'];
$owner = $vars['owner'];
-
+ $anytags = $vars['anytags'];
+
if (get_plugin_setting('tagging', 'tidypics') != "disabled") {
// only owner and friends of owner can tag
if ($viewer && $viewer->guid == $owner->guid || user_is_friend($owner->guid, $viewer->guid)) {
@@ -21,7 +22,15 @@
<li id="start_tagging"><a id="tag_control" href="javascript:void(0)" onclick="startTagging()"><?= elgg_echo('tidypics:tagthisphoto') ?></a></li>
<?php
}
+
+ // only owner can delete tags
+ if ($anytags && $viewer && $viewer->guid == $owner->guid) {
+?>
+<li id="delete_tags"><a href="javascript:void(0)" onclick="deleteTags()"><?= elgg_echo('tidypics:deletetag') ?></a></li>
+<?php
+ }
}
+
if (get_plugin_setting('download_link', 'tidypics') != "disabled") {
?>
<li id="download_image"><a href="<?php echo $vars['url']; ?>action/tidypics/download?file_guid=<?php echo $file_guid; ?>"><?php echo elgg_echo("image:download"); ?></a></li>
diff --git a/views/default/tidypics/tagging.php b/views/default/tidypics/tagging.php
index 8ba58be4f..fdf40b3a5 100644
--- a/views/default/tidypics/tagging.php
+++ b/views/default/tidypics/tagging.php
@@ -5,6 +5,7 @@
$file_guid = $vars['file_guid'];
$viewer = $vars['viewer'];
$owner = $vars['owner'];
+ $tag_texts = $vars['text'];
if ($photo_tags) {
?>
@@ -53,6 +54,21 @@
?>
</div>
+<div id="delete_tag_menu">
<?php
+ if ($photo_tags) {
+ echo elgg_echo('tidypics:deltag_title') . '<br />';
+ $content = "<input type='hidden' name='image_guid' value='{$file_guid}' />";
+ foreach ($tag_texts as $id => $text) {
+ $name = "tags[{$id}]";
+ $content .= elgg_view("input/checkboxes", array('options' => array($text => $text), 'internalname' => $name, 'value' => '' ));
+ }
+ $content .= "<fieldset><button class='submit_button' type='submit'>" . elgg_echo('tidypics:actiondelete') . "</button></fieldset>";
+
+ echo elgg_view('input/form', array('internalname' => 'form-deletetag', 'action' => "{$vars['url']}action/tidypics/deletetag", 'body' => $content));
+
+ }
+ echo '</div>'; // delete_tag_menu
+
echo elgg_view('js/tagging', array('photo_tags_json' => $photo_tags_json,) );
?> \ No newline at end of file