From b4b85ecc55a6787726627150a2ee93fd960ff2c6 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 16 Jun 2009 01:39:32 +0000 Subject: added delete phototags capability --- views/default/js/tagging.php | 29 ++++++++++++++++++++++++++++- views/default/object/image.php | 6 +++++- views/default/tidypics/css.php | 12 ++++++++++++ views/default/tidypics/image_menu.php | 11 ++++++++++- views/default/tidypics/tagging.php | 16 ++++++++++++++++ 5 files changed, 71 insertions(+), 3 deletions(-) (limited to 'views/default') diff --git a/views/default/js/tagging.php b/views/default/js/tagging.php index e27af7fca..a79914196 100644 --- a/views/default/js/tagging.php +++ b/views/default/js/tagging.php @@ -139,7 +139,7 @@ $('#tag_control').text("Stop Tagging"); showTagInstruct(); - + $('#delete_tag_menu').hide(); $('#tidypics_image').hover( function(){ @@ -252,4 +252,31 @@ //Show loading //$("#tag_menu").replaceWith('
'); } + + function deleteTags() + { + offsetY = 60; + + divWidth = $('#delete_tag_menu').width(); + imgOffset = $('#tidypics_image').offset(); + imgWidth = $('#tidypics_image').width(); + offsetX = parseInt((imgWidth - divWidth)/2); + + _top = imgOffset.top + offsetY; + _left = imgOffset.left + offsetX; + + $('#delete_tag_menu').show().css({ + "top": _top + "px", + "left": _left + "px" + }); + + $('#tidypics_image').hover( + function(){ + $('.tidypics_tag').hide(); + }, + function(){ + $('.tidypics_tag').hide(); + } + ); + } \ No newline at end of file diff --git a/views/default/object/image.php b/views/default/object/image.php index 64109f1a2..1ab2e921a 100644 --- a/views/default/object/image.php +++ b/views/default/object/image.php @@ -47,6 +47,7 @@ if ($photo_tags) { $photo_tags_json .= '{' . $photo_tag->coords . ',"text":"' . $phototag_text . '","id":"' . $p->id . '"},'; $photo_tag_links[] = array($p->id, $phototag_text); // gave up on associative array for now + $photo_tag_texts[$p->id] = $phototag_text; } $photo_tags_json = rtrim($photo_tags_json,','); $photo_tags_json .= ']'; @@ -184,16 +185,19 @@ if ($photo_tags) { '; // tagging code if (get_plugin_setting('tagging', 'tidypics') != "disabled") { echo elgg_view('tidypics/tagging', array( 'photo_tags' => $photo_tags, 'links' => $photo_tag_links, + 'text' => $photo_tag_texts, 'photo_tags_json' => $photo_tags_json, 'file_guid' => $file_guid, 'viewer' => $viewer, 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(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,15 +13,24 @@ $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)) { ?>
  • +guid == $owner->guid) { +?> +
  • 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 @@ ?> +
    '; + $content = ""; + foreach ($tag_texts as $id => $text) { + $name = "tags[{$id}]"; + $content .= elgg_view("input/checkboxes", array('options' => array($text => $text), 'internalname' => $name, 'value' => '' )); + } + $content .= "
    "; + + echo elgg_view('input/form', array('internalname' => 'form-deletetag', 'action' => "{$vars['url']}action/tidypics/deletetag", 'body' => $content)); + + } + echo '
    '; // delete_tag_menu + echo elgg_view('js/tagging', array('photo_tags_json' => $photo_tags_json,) ); ?> \ No newline at end of file -- cgit v1.2.3