';$('body').append(confdialog);var btns={};if(rtlsupport==""){diagclass="inmage-annotate-dialog"}else{diagclass="inmage-annotate-dialog-rtl"}btns[labels[5]]=function(){var delform=$("#"+$(this).attr("rel")+"-del-form");$.ajax({url:deleteUrl,type:'POST',data:delform.serialize(),error:function(e){var errordialog='
'+labels[15]+'
';$('body').append(errordialog);var btns={};if(rtlsupport==""){diagclass="inmage-annotate-dialog"}else{diagclass="inmage-annotate-dialog-rtl"}btns[labels[14]]=function(){$('#image-annotate-error-dialog').remove()};$('#image-annotate-error-dialog').dialog({modal:true,resizable:false,dialogClass:diagclass,title:labels[13],close:function(event,ui){$('#image-annotate-error-dialog').remove()},width:450,buttons:btns})},success:function(data){if(data.result=="success"){var annotationid="photoannotation-area-"+data.notetype+"-"+data.noteid;var legendid="photoannotation-legend-"+data.notetype;$("#"+legendid+"-"+data.noteid).remove();if($("#"+legendid+" > span").size()==0){$("#"+legendid).hide()}$("#"+annotationid).remove();$("#"+annotationid+"-edit").remove();$("#"+annotationid+"-delete").remove();$("#"+annotationid+"-note").remove()}},dataType:"json"});$('#image-annotate-conf-dialog').remove()};btns[labels[6]]=function(){$('#image-annotate-conf-dialog').remove()};$('#image-annotate-conf-dialog').dialog({modal:true,resizable:false,dialogClass:diagclass,title:labels[7],close:function(event,ui){$('#image-annotate-conf-dialog').remove()},buttons:btns})});var form=this;this.editarea.bind('click',function(){form.edit(tags,labels,saveUrl,csrf,rtlsupport,users)});this.delarea.hide();this.editarea.hide()}var notedescription="";if(note.description!=""){notedescription="
"+note.description}this.form=$('
'+note.text+notedescription+'
');this.form.hide();image.canvas.children('.image-annotate-view').append(this.form);this.form.children('span.actions').hide();this.setPosition(rtlsupport);var annotation=this;this.area.hover(function(){annotation.show();if(annotation.delarea!=undefined){annotation.delarea.show();annotation.editarea.show()}},function(){annotation.hide();if(annotation.delarea!=undefined){annotation.delarea.hide();annotation.editarea.hide()}});var legendspan="#photoannotation-legend-"+this.note.notetype+"-"+this.note.noteid;if($(legendspan).length>0){$(legendspan).hover(function(){var legendsarea="#photoannotation-area-"+note.notetype+"-"+note.noteid;$(legendsarea).children('.image-annotate-view').show();$(".image-annotate-view").show();$(legendsarea).show();annotation.show()},function(){var legendsarea="#photoannotation-area-"+note.notetype+"-"+note.noteid;annotation.hide();$(legendsarea).children('.image-annotate-view').hide();$(".image-annotate-view").hide()})}if(editable){this.delarea.hover(function(){annotation.delarea.show();annotation.editarea.show()},function(){annotation.delarea.hide();annotation.editarea.hide()});this.editarea.hover(function(){annotation.delarea.show();annotation.editarea.show()},function(){annotation.delarea.hide();annotation.editarea.hide()})}if(note.url!=""&¬e.url!=null){this.area.bind('click',function(){window.location=note.url})}};$.fn.annotateView.prototype.setPosition=function(rtlsupport){this.area.children('div').height((parseInt(this.note.height)-2)+'px');this.area.children('div').width((parseInt(this.note.width)-2)+'px');this.area.css('left',(this.note.left)+'px');this.area.css('top',(this.note.top)+'px');this.form.css('left',(this.note.left)+'px');this.form.css('top',(parseInt(this.note.top)+parseInt(this.note.height)+7)+'px');if(this.delarea!=undefined){this.delarea.children('div').height('14px');this.delarea.children('div').width('14px');this.delarea.css('top',(this.note.top)+'px');this.editarea.children('div').height('14px');this.editarea.children('div').width('14px');this.editarea.css('top',(this.note.top+16)+'px');if(rtlsupport==''){this.delarea.css('left',(this.note.left+parseInt(this.note.width))+'px');this.editarea.css('left',(this.note.left+parseInt(this.note.width))+'px')}else{this.delarea.css('left',(this.note.left-16)+'px');this.editarea.css('left',(this.note.left-16)+'px')}}};$.fn.annotateView.prototype.show=function(){this.form.fadeIn(250);if(!this.note.editable){this.area.addClass('image-annotate-area-hover')}else{this.area.addClass('image-annotate-area-editable-hover')}};$.fn.annotateView.prototype.hide=function(){this.form.fadeOut(250);this.area.removeClass('image-annotate-area-hover');this.area.removeClass('image-annotate-area-editable-hover')};$.fn.annotateView.prototype.destroy=function(){this.area.remove();this.form.remove()};$.fn.annotateView.prototype.edit=function(tags,labels,saveUrl,csrf,rtlsupport,users){if(this.image.mode=='view'){this.image.mode='edit';var annotation=this;var editable=new $.fn.annotateEdit(this.image,this.note,tags,labels,saveUrl,csrf,rtlsupport,users);$.fn.annotateImage.createSaveButton(editable,this.image,annotation,rtlsupport,labels,saveUrl);$.fn.annotateImage.createCancelButton(editable,this.image,rtlsupport,labels)}};$.fn.annotateView.prototype.resetPosition=function(editable,text){this.form.html(text);this.form.hide();this.area.children('div').height(editable.area.height()+'px');this.area.children('div').width((editable.area.width()-2)+'px');this.area.css('left',(editable.area.position().left)+'px');this.area.css('top',(editable.area.position().top)+'px');this.form.css('left',(editable.area.position().left)+'px');this.form.css('top',(parseInt(editable.area.position().top)+parseInt(editable.area.height())+7)+'px');this.note.top=editable.area.position().top;this.note.left=editable.area.position().left;this.note.height=editable.area.height();this.note.width=editable.area.width();this.note.text=text;this.note.id=editable.note.id;this.editable=true};$.fn.annotateImage.appendPosition=function(form,editable){var areaFields=$('
'+'
'+'
'+'
'+'
');form.append(areaFields)}})(jQuery);
diff --git a/modules/photoannotation/views/photoannotation_highlight_block.html.php b/modules/photoannotation/views/photoannotation_highlight_block.html.php
index 6e7b48e9..9241e5b9 100644
--- a/modules/photoannotation/views/photoannotation_highlight_block.html.php
+++ b/modules/photoannotation/views/photoannotation_highlight_block.html.php
@@ -22,6 +22,7 @@
$jscode = "";
$legend_faces = "";
$legend_notes = "";
+ $legend_users = "";
if (module::get_var("gallery", "active_site_theme") == "greydragon") {
$css_item_id = "#g-photo-id-". $item->id;
$css_a_class = ".g-sb-preview";
@@ -42,7 +43,7 @@
$user_text = $oneTag->name;
}
if ($showusers) {
- $legend_users .= "
id . "\">user_id) ."\">". html::clean($user_text) .", ";
+ $legend_users .= "
id . "\">user_id) ."\">". html::clean($user_text) ." ";
}
$jscode .= "{ \"top\": ". $oneUser->y1 .",\n";
$jscode .= "\"left\": ". $oneUser->x1 .",\n";
@@ -57,15 +58,16 @@
$jscode .= "\"url\": \"". user_profile::url($oneUser->user_id) ."\" },\n";
}
}
+ $display = "none";
if ($legend_users != "") {
- $legend_users = trim($legend_users, ", ");
- $legend_users = t("Users on this photo: ") . $legend_users;
+ $display = "block";
}
+ $legend_users = t("
People on this photo: ") . $legend_users ."";
foreach ($existingFaces as $oneFace) {
$oneTag = ORM::factory("tag", $oneFace->tag_id);
if ($oneTag->loaded()) {
if ($showfaces) {
- $legend_faces .= "
id . "\">url() ."\">". html::clean($oneTag->name) .", ";
+ $legend_faces .= "
id . "\">url() ."\">". html::clean($oneTag->name) ." ";
}
$jscode .= "{ \"top\": ". $oneFace->y1 .",\n";
$jscode .= "\"left\": ". $oneFace->x1 .",\n";
@@ -79,13 +81,14 @@
$jscode .= "\"url\": \"". $oneTag->url() ."\" },\n";
}
}
+ $display = "none";
if ($legend_faces != "") {
- $legend_faces = trim($legend_faces, ", ");
- $legend_faces = t("Faces on this photo: ") . $legend_faces;
+ $display = "block";
}
+ $legend_faces = t("
Faces on this photo: ") . $legend_faces ."";
foreach ($existingNotes as $oneNote) {
if ($shownotes) {
- $legend_notes .= "
id . "\">". html::clean($oneNote->title) .", ";
+ $legend_notes .= "
id . "\">". html::clean($oneNote->title) ." ";
}
$jscode .= "{ \"top\": ". $oneNote->y1 .",\n";
$jscode .= "\"left\": ". $oneNote->x1 .",\n";
@@ -100,17 +103,14 @@
}
$jscode = trim($jscode, ",\n");
$jscode .= " ],";
+ $display = "none";
if ($legend_notes != "") {
- $legend_notes = trim($legend_notes, ", ");
- $legend_notes = t("Notes on this photo: ") . $legend_notes;
+ $display = "block";
}
+ $legend_notes = t("
Notes on this photo: ") . $legend_notes ."";
}
- $legend_display = "";
- if ($legend_users != "" || $legend_faces != "" || $legend_notes != "") {
- $legend_display = $legend_users . "
" . $legend_faces . "
" . $legend_notes;
- $legend_display = str_replace("
", "
", $legend_display);
- }
- $labels_arraystring = "labels: [ '". t("Tag:") ."','". t("Note Title:") ."','". t("Description (optional)") ."','". t("Are you sure you want to delete this annotation?") ."','". t("or") ."','". t("Yes") ."','". t("No") ."','". t("Confirm deletion") ."','". t("Save") ."','". t("Cancel") ."','". t("User:") ."','". t("No user selected") ."','". t("Select one of the following") ."' ],";
+ $legend_display = $legend_users . $legend_faces . $legend_notes;
+ $labels_arraystring = "labels: [ '". t("Tag:") ."','". t("Note Title:") ."','". t("Description (optional)") ."','". t("Are you sure you want to delete this annotation?") ."','". t("or") ."','". t("Yes") ."','". t("No") ."','". t("Confirm deletion") ."','". t("Save") ."','". t("Cancel") ."','". t("Person:") ."','". t("No user selected") ."','". t("Select one of the following") ."','". t("An error ocurred while saving annotation") ."','". t("OK") ."','". t("An error ocurred while deleting annotation") ."','". t("View fullsize") ."' ],";
?>
- if ($legend_display != ""): ?>
- = "
". $legend_display ."
" ?>
- endif ?>
+ = "
". $legend_display ."
" ?>
diff --git a/modules/photoannotation/views/photoannotation_user_search.html.php b/modules/photoannotation/views/photoannotation_user_search.html.php
index 42f32519..2182a324 100644
--- a/modules/photoannotation/views/photoannotation_user_search.html.php
+++ b/modules/photoannotation/views/photoannotation_user_search.html.php
@@ -16,7 +16,7 @@
= $search_form ?>
if (count($users)): ?>
- = t("%count users found for %term", array("count" => $count, "term" => $q)) ?>
+ = t("%count people found for %term", array("count" => $count, "term" => $q)) ?>
foreach ($users as $user): ?>
$profile_link = "
id) ."\">" ?>
@@ -52,4 +52,4 @@
= t("No users found for %term", array("term" => $q)) ?>