aboutsummaryrefslogtreecommitdiff
path: root/views/default/tidypics
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-08-25 12:03:29 +0000
committerCash Costello <cash.costello@gmail.com>2009-08-25 12:03:29 +0000
commit31a654b61284e0f848645aeb436d0335bc765abf (patch)
tree8748b2646fece6b95394a14b12157969d7a40d4c /views/default/tidypics
parente25ce6edc31cae1befb863cff66b9e845f67a417 (diff)
downloadelgg-31a654b61284e0f848645aeb436d0335bc765abf.tar.gz
elgg-31a654b61284e0f848645aeb436d0335bc765abf.tar.bz2
cleaned up tagging views to better integrate with image class
Diffstat (limited to 'views/default/tidypics')
-rw-r--r--views/default/tidypics/image_menu.php2
-rw-r--r--views/default/tidypics/tagging.php30
2 files changed, 19 insertions, 13 deletions
diff --git a/views/default/tidypics/image_menu.php b/views/default/tidypics/image_menu.php
index d6568360c..afbb34f21 100644
--- a/views/default/tidypics/image_menu.php
+++ b/views/default/tidypics/image_menu.php
@@ -10,7 +10,7 @@
*
**************************************************************************/
- $image_guid = $vars['file_guid'];
+ $image_guid = $vars['image_guid'];
$viewer = $vars['viewer'];
$owner = $vars['owner'];
$anytags = $vars['anytags'];
diff --git a/views/default/tidypics/tagging.php b/views/default/tidypics/tagging.php
index f911fe217..7062d942a 100644
--- a/views/default/tidypics/tagging.php
+++ b/views/default/tidypics/tagging.php
@@ -1,20 +1,26 @@
<?php
- $photo_tags = $vars['photo_tags'];
- $links = $vars['links'];
- $photo_tags_json = $vars['photo_tags_json'];
- $file_guid = $vars['file_guid'];
+
+ $image = $vars['image'];
$viewer = $vars['viewer'];
$owner = $vars['owner'];
+ // get photo tags
+ $tag_info = $image->getPhotoTags();
+
+ // defining json text as "" makes sure the tagging javascript code doesn't throw errors if no tags
+ $photo_tags_json = "\"\"";
+ if ($tag_info) {
+ $photo_tags_json = $tag_info['json'];
+ }
- if ($photo_tags) {
+ if ($tag_info) {
?>
<div id="tidypics_phototags_list">
<h3><?php echo elgg_echo('tidypics:inthisphoto') ?></h3>
<ul>
<?php
- foreach ($links as $id=>$link) {
- echo "<li><a class='tidypics_phototag_links' id='taglink{$id}' href='{$link[1]}'>{$link[0]}</a></li>";
+ foreach ($tag_info['links'] as $id=>$link) {
+ echo "<li><a class='tidypics_phototag_links' id='taglink{$id}' href='{$link['url']}'>{$link['text']}</a></li>";
}
?>
</ul>
@@ -41,7 +47,7 @@
ksort($friend_array);
$content = "<div id='tidypics_tagmenu_left'>";
- $content .= "<input type='hidden' name='image_guid' value='{$file_guid}' />";
+ $content .= "<input type='hidden' name='image_guid' value='{$image->guid}' />";
$content .= "<input type='hidden' name='coordinates' id='coordinates' value='' />";
$content .= "<input type='hidden' name='user_id' id='user_id' value='' />";
$content .= "<input type='hidden' name='word' id='word' value='' />";
@@ -66,11 +72,11 @@
<div id="tidypics_delete_tag_menu" class="tidypics_popup">
<div id='tidypics_popup_header'><h3><?php echo elgg_echo('tidypics:deltag_title'); ?></h3></div>
<?php
- if ($photo_tags) {
- $content = "<input type='hidden' name='image_guid' value='{$file_guid}' />";
- foreach ($links as $id => $text) {
+ if ($tag_info) {
+ $content = "<input type='hidden' name='image_guid' value='{$image->guid}' />";
+ foreach ($tag_info['links'] as $id => $link) {
$name = "tags[{$id}]";
- $content .= elgg_view("input/checkboxes", array('options' => array($text[0] => $text[0]), 'internalname' => $name, 'value' => '' ));
+ $content .= elgg_view("input/checkboxes", array('options' => array($link['text'] => $link['text']), 'internalname' => $name, 'value' => '' ));
}
$content .= "<input type='submit' value='" . elgg_echo('tidypics:actiondelete') . "' class='submit_button' />";