aboutsummaryrefslogtreecommitdiff
path: root/views/default/object
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-04-04 20:40:01 +0000
committerCash Costello <cash.costello@gmail.com>2009-04-04 20:40:01 +0000
commit706480c069b5396504b4cbc7375f45f34c73268e (patch)
treeb1eb3e2cc7fd228f8c95b5575832f5cd4cb338c0 /views/default/object
parent08fa8b7fd926df80b0f0d7bb4334394c44713b18 (diff)
downloadelgg-706480c069b5396504b4cbc7375f45f34c73268e.tar.gz
elgg-706480c069b5396504b4cbc7375f45f34c73268e.tar.bz2
adding unique id to each tag div
Diffstat (limited to 'views/default/object')
-rw-r--r--views/default/object/image.php121
1 files changed, 45 insertions, 76 deletions
diff --git a/views/default/object/image.php b/views/default/object/image.php
index cd3d8fe53..17e1a2974 100644
--- a/views/default/object/image.php
+++ b/views/default/object/image.php
@@ -34,13 +34,12 @@ if ($photo_tags) {
$phototag_text = "unknown user";
}
- $photo_tags_json .= '{' . $photo_tag->coords . ',"text":"' . $phototag_text . '"},';
+ $photo_tags_json .= '{' . $photo_tag->coords . ',"text":"' . $phototag_text . '","id":"' . $p->id . '"},';
}
$photo_tags_json = rtrim($photo_tags_json,',');
$photo_tags_json .= ']';
}
-
if (get_context() == "search") { //if this is the search view
if (get_input('search_viewtype') == "gallery") {
@@ -124,68 +123,6 @@ if ($photo_tags) {
<div id="tidypics_image_frame">
<?php echo '<img id="tidypics_image"' . ' src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $file_guid . '&size=large" alt="' . $title . '"/>'; ?>
</div>
-<div id="tag_menu">
-<?php
-
- $viewer = get_loggedin_user();
- $friends = get_entities_from_relationship('friend', $viewer->getGUID(), false, 'user', '', 0);
-
- $content = "<input type='hidden' name='image_guid' value='{$file_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='' />";
-
- $content .= "<ul id='phototagging-menu'>";
- $content .= "<li><a href='javascript:void(0)' onClick='selectUser({$viewer->getGUID()},\"{$viewer->name}\")'> {$viewer->name} (" . elgg_echo('me') . ")</a></li>";
-
- if ($friends) {
- foreach($friends as $friend) {
- $content .= "<li><a href='javascript:void(0)' onClick='selectUser({$friend->getGUID()}, \"{$friend->name}\")'>{$friend->name}</a></li>";
- }
- }
-
- $content .= "</ul>";
-
- $content .= "<fieldset><button class='submit_button' type='submit'>" . elgg_echo('image:actiontag') . "</button></fieldset>";
-
- echo elgg_view('input/form', array('internalid' => 'quicksearch', 'internalname' => 'form-phototagging', 'class' => 'quicksearch', 'action' => "{$vars['url']}action/tidypics/addtag", 'body' => $content));
-
-?>
-</div>
-
-<?php
-//$photo_tags = get_annotations($file_guid,'object','image','phototag');
-
-//if ($photo_tags) {
-// foreach ($photo_tags as $photo_tag)
-// {
- //$data_tag = unserialize($photo_tag->value);
- $data_tag->type = 'word';
- $data_tag->value = 'Test tag';
- $data_tag->id = 32;
- $data_tag->x1 = 73;
- $data_tag->y1 = 56;
- $data_tag->width = 100;
- $data_tag->height = 32;
-
- if($data_tag->type == 'user')
- $data_tag->data = get_entity($data_tag->value);
- else
- $data_tag->data = $data_tag->value;
-
- echo "<div class='phototag' rel='{$photo_tag->id}' style='margin-left:{$data_tag->x1}px; margin-top:{$data_tag->y1}px; width:{$data_tag->width}px;'>";
-
- if($data_tag->type == 'user')
- echo "<em>{$data_tag->data->name}</em>";
- else
- echo "<em>{$data_tag->data}</em>";
-
- echo "<span style='width:" . ((int)$data_tag->width - 2) . "px; height:" . ((int)$data_tag->height - 2) . "px;'></span>";
- echo "</div>";
-// }
-//}
-?>
-
<div class="clearfloat"></div>
</div>
<div id="tidypics_controls">
@@ -194,17 +131,33 @@ if ($photo_tags) {
<li><a href="<?php echo $vars['url']; ?>action/tidypics/download?file_guid=<?php echo $file_guid; ?>"><?php echo elgg_echo("image:download"); ?></a></li>
</ul>
</div>
+<?php if ($photo_tags) { ?>
+ <div id="tidypics_phototags_list">
+ <h3> <?= elgg_echo('image:inthisphoto') ?></h3>
+ <ul>
+ </ul>
+ </div>
+<?php } ?>
+
<div id="tidypics_info">
-<?php
- if (!is_null($tags)) {
-?>
+<?php if (!is_null($tags)) { ?>
<div class="object_tag_string"><?php echo elgg_view('output/tags',array('value' => $tags));?></div>
-<?php
- }
-
+<?php } ?>
+<?
echo elgg_echo('image:by');?> <b><a href="<?php echo $vars['url']; ?>pg/profile/<?php echo $owner->username; ?>"><?php echo $owner->name; ?></a></b> <?php echo $friendlytime;
?>
</div>
+ </div> <!-- tidypics wrapper-->
+<?php
+
+ echo elgg_view_comments($file);
+
+ echo '</div>'; // content wrapper
+ } // // end of individual image display
+
+ }
+
+?>
<div id='tagging_instructions'>
<table>
@@ -217,18 +170,34 @@ if ($photo_tags) {
</table>
</div>
- </div> <!-- tidypics wrapper-->
+<div id="tag_menu">
+<?php
-<?php
+ $viewer = get_loggedin_user();
+ $friends = get_entities_from_relationship('friend', $viewer->getGUID(), false, 'user', '', 0);
- echo elgg_view_comments($file);
+ $content = "<input type='hidden' name='image_guid' value='{$file_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='' />";
- echo '</div>'; // content wrapper
- } // // end of individual image display
+ $content .= "<ul id='phototagging-menu'>";
+ $content .= "<li><a href='javascript:void(0)' onClick='selectUser({$viewer->getGUID()},\"{$viewer->name}\")'> {$viewer->name} (" . elgg_echo('me') . ")</a></li>";
+ if ($friends) {
+ foreach($friends as $friend) {
+ $content .= "<li><a href='javascript:void(0)' onClick='selectUser({$friend->getGUID()}, \"{$friend->name}\")'>{$friend->name}</a></li>";
+ }
}
+ $content .= "</ul>";
+
+ $content .= "<fieldset><button class='submit_button' type='submit'>" . elgg_echo('image:actiontag') . "</button></fieldset>";
+
+ echo elgg_view('input/form', array('internalid' => 'quicksearch', 'internalname' => 'form-phototagging', 'class' => 'quicksearch', 'action' => "{$vars['url']}action/tidypics/addtag", 'body' => $content));
+
?>
+</div>
<script type="text/javascript" src="<?= $vars['url'] ?>mod/tidypics/vendors/jquery.imgareaselect-0.7.js"></script>
<script type="text/javascript" src="<?= $vars['url'] ?>mod/tidypics/vendors/jquery.quicksearch.js"></script>
@@ -304,7 +273,7 @@ if ($photo_tags) {
tag_top = parseInt(imgOffset.top) + parseInt(tag.y1);
tag_left = parseInt(imgOffset.left) + parseInt(tag.x1);
- tag_div = $('<div class="tidypics_tag"></div>').css({ left: tag_left + 'px', top: tag_top + 'px', width: tag.width + 'px', height: tag.height + 'px' });
+ tag_div = $('<div class="tidypics_tag" id="tag'+tag.id+'"></div>').css({ left: tag_left + 'px', top: tag_top + 'px', width: tag.width + 'px', height: tag.height + 'px' });
tag_text_div = $('<div class="tidypics_tag_text">'+tag.text+'</div>').css({ left: tag_left + 'px', top: tag_top + 'px', width: tag.width + 'px', height: 20 + 'px' });