diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-12-12 19:51:49 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-12-12 19:51:49 +0000 |
commit | 621177abc2bc60e9edb3ca723a4afaa9d9e713ef (patch) | |
tree | d6064f1fe767d042ea41e4adea88e57b8e5138ff /views/default | |
parent | b40060fafaba46e2fb8800b2c2e557a8c6bde9db (diff) | |
download | elgg-621177abc2bc60e9edb3ca723a4afaa9d9e713ef.tar.gz elgg-621177abc2bc60e9edb3ca723a4afaa9d9e713ef.tar.bz2 |
convert line endings to Unix
Diffstat (limited to 'views/default')
23 files changed, 1253 insertions, 1253 deletions
diff --git a/views/default/annotation/annotate.php b/views/default/annotation/annotate.php index c0fb05d3a..8156a4bb4 100644 --- a/views/default/annotation/annotate.php +++ b/views/default/annotation/annotate.php @@ -1,21 +1,21 @@ -<?php
-
- /*
- * Overriding core view to work around bug dealing with empty titles
- */
-
- $performed_by = get_entity($vars['item']->subject_guid);
- $object = get_entity($vars['item']->object_guid);
- $url = $object->getURL();
- $subtype = get_subtype_from_id($object->subtype);
- $title = $object->title;
- if (!$title)
- $title = elgg_echo('untitled');
-
- $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("river:posted:generic"),$url) . " ";
- $string .= elgg_echo("{$subtype}:river:annotate") . " <a href=\"" . $object->getURL() . "\">" . $title . "</a>";
-
-?>
-
+<?php + + /* + * Overriding core view to work around bug dealing with empty titles + */ + + $performed_by = get_entity($vars['item']->subject_guid); + $object = get_entity($vars['item']->object_guid); + $url = $object->getURL(); + $subtype = get_subtype_from_id($object->subtype); + $title = $object->title; + if (!$title) + $title = elgg_echo('untitled'); + + $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; + $string = sprintf(elgg_echo("river:posted:generic"),$url) . " "; + $string .= elgg_echo("{$subtype}:river:annotate") . " <a href=\"" . $object->getURL() . "\">" . $title . "</a>"; + +?> + <?php echo $string; ?>
\ No newline at end of file diff --git a/views/default/js/tagging.php b/views/default/js/tagging.php index bd6890502..d8abda24c 100644 --- a/views/default/js/tagging.php +++ b/views/default/js/tagging.php @@ -1,303 +1,303 @@ -<?php
- $photo_tags_json = $vars['photo_tags_json'];
-?>
-<script type="text/javascript" src="<?php echo $vars['url'] ?>mod/tidypics/vendors/jquery.imgareaselect-0.7.js"></script>
-<script type="text/javascript" src="<?php echo $vars['url'] ?>mod/tidypics/vendors/jquery.quicksearch.js"></script>
-
-<script type="text/javascript">
-
- var coordinates = "";
- var user_id = 0;
- var tagging = 0;
-
- // add to DOM as soon as ready
- $(document).ready(function () {
- $('ul#tidypics_phototag_list li').quicksearch({
- position: 'before',
- attached: 'ul#tidypics_phototag_list',
- loaderText: '',
- inputClass: 'input-filter',
- delay: 100
- });
-
- $('#quicksearch').submit( function () { addTag() } );
- }
- );
-
- // images are loaded so process tags
- $(window).load(function () {
- $('#tidypics_image').setupTags();
- }
- );
-
- // get tags over image ready for mouseover
- // based on code by Tarique Sani tarique at sanisoft.com - MIT and GPL licenses
- $.fn.setupTags = function()
- {
-
- image = this;
-
- imgOffset = $(image).offset();
- imgOffset.left = parseInt(imgOffset.left) + parseInt($(image).css("border-left-width")) + parseInt($(image).css("padding-left"));
- imgOffset.top = parseInt(imgOffset.top) + parseInt($(image).css("border-top-width")) + parseInt($(image).css("padding-top"));
-
- tags = <?php echo $photo_tags_json; ?>;
-
- $(tags).each(function(){
- appendTag(imgOffset, this);
- });
-
- $(image).hover(
- function(){
- $('.tidypics_tag').show();
- },
- function(){
- $('.tidypics_tag').hide();
- }
- );
-
- addTagEvents();
-
- $('.tidypics_phototag_links').hover(
- function(){
- code = this.id.substr(7); // cut off taglink to get unique id
- $('#tag'+code).show();
- },
- function(){
- code = this.id.substr(7);
- $('#tag'+code).hide();
- }
- );
-
- // make sure we catch and handle when the browser is resized
- $(window).resize(function () {
- $('.tidypics_tag').remove();
-
- imgOffset = $(image).offset();
-
- $(tags).each(function(){
- appendTag(imgOffset, this);
- });
-
- addTagEvents();
- });
- }
-
- function appendTag(offset, tag)
- {
- // catch for IE when no tags available
- if (tag.id == undefined)
- return;
-
- tag_top = parseInt(imgOffset.top) + parseInt(tag.y1);
- tag_left = parseInt(imgOffset.left) + parseInt(tag.x1);
-
- 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' });
-
- text_top = parseInt(tag_top) + parseInt(tag.height) + 5;
-
- tag_text_div = $('<div class="tidypics_tag_text">'+tag.text+'</div>').css({ left: tag_left + 'px', top: text_top + 'px', width: '120px'});
-
- $('body').append(tag_div);
- $('body').append(tag_text_div);
- }
-
- function addTagEvents()
- {
- $('.tidypics_tag').hover(
- function(){
- $('.tidypics_tag').show();
- $(this).next('.tidypics_tag_text').show();
- $(this).next('.tidypics_tag_text').css("z-index", 10000);
- },
- function(){
- $('.tidypics_tag').show();
- $(this).next('.tidypics_tag_text').hide();
- $(this).next('.tidypics_tag_text').css("z-index", 0);
- }
- );
- }
-
-
- function selectUser(id, name)
- {
- user_id = id;
- $("input.input-filter").val(name);
- }
-
- function startTagging()
- {
- if (tagging != 0)
- {
- stopTagging();
- return;
- }
-
- tagging = 1;
-
- $('#tidypics_tag_control').text("<?php echo elgg_echo('tidypics:finish_tagging'); ?>");
-
- showTagInstruct();
- $('#tidypics_delete_tag_menu').hide();
-
- $('#tidypics_image').hover(
- function(){
- $('.tidypics_tag').hide();
- },
- function(){
- $('.tidypics_tag').hide();
- }
- );
-
- $('img#tidypics_image').imgAreaSelect( {
- borderWidth: 2,
- borderColor1: 'white',
- borderColor2: 'white',
- disable: false,
- hide: false,
- onSelectEnd: showTagMenu,
- onSelectStart: hideTagMenu
- }
- );
-
- $('img#tidypics_image').css({"cursor" : "crosshair"});
- }
-
- function stopTagging()
- {
- tagging = 0;
-
- hideTagInstruct();
- hideTagMenu();
-
- $('img#tidypics_image').imgAreaSelect( {hide: true, disable: true} );
-
- $('#tidypics_tag_control').text("<?php echo elgg_echo('tidypics:tagthisphoto'); ?>");
-
- // restart tag hovering
- $('#tidypics_image').hover(
- function(){
- $('.tidypics_tag').show();
- },
- function(){
- $('.tidypics_tag').hide();
- }
- );
-
- $('img#tidypics_image').css({"cursor" : "pointer"});
- }
-
- function showTagMenu(oObject, oCoordenates)
- {
- offsetX = 6;
- offsetY = 10;
-
- imgOffset = $('#tidypics_image').offset();
-
- // show the list of friends
- if (oCoordenates.width != 0 && oCoordenates.height != 0) {
- coordinates = oCoordenates;
-
- _top = imgOffset.top + oCoordenates.y2 + offsetY;
- _left = imgOffset.left + oCoordenates.x1 + offsetX;
-
- $('#tidypics_tag_menu').show().css({
- "top": _top + "px",
- "left": _left + "px"
- });
-
- $(".input-filter").focus();
- }
- }
-
-
- function hideTagMenu()
- {
- $('#tidypics_tag_menu').hide();
- }
-
- function showTagInstruct()
- {
- offsetY = -60;
-
- divWidth = $('#tidypics_tag_instructions').width();
- imgOffset = $('#tidypics_image').offset();
- imgWidth = $('#tidypics_image').width();
- offsetX = parseInt((imgWidth - divWidth)/2);
-
- _top = imgOffset.top + offsetY;
- _left = imgOffset.left + offsetX;
-
- $('#tidypics_tag_instructions').show().css({
- "top": _top + "px",
- "left": _left + "px"
- });
- }
-
- function hideTagInstruct()
- {
- $('#tidypics_tag_instructions').hide();
- }
-
- function addTag()
- {
- // do I need a catch for no tag?
-
- $("input#user_id").val(user_id);
- $("input#word").val( $("input.input-filter").val() );
-
- coord_string = '"x1":"' + coordinates.x1 + '",';
- coord_string += '"y1":"' + coordinates.y1 + '",';
- coord_string += '"width":"' + coordinates.width + '",';
- coord_string += '"height":"' + coordinates.height + '"';
-
- $("input#coordinates").val(coord_string);
-
- //Show loading
- //$("#tag_menu").replaceWith('<div align="center" class="ajax_loader"></div>');
- }
-
- function deleteTags()
- {
- offsetY = 60;
-
- stopTagging();
-
- 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;
-
- $('#tidypics_delete_tag_menu').show().css({
- "top": _top + "px",
- "left": _left + "px"
- });
-
- $('#tidypics_image').hover(
- function(){
- $('.tidypics_tag').hide();
- },
- function(){
- $('.tidypics_tag').hide();
- }
- );
- }
-
- function hideDeleteMenu()
- {
- $('#tidypics_delete_tag_menu').hide();
-
- // restart tag hovering
- $('#tidypics_image').hover(
- function(){
- $('.tidypics_tag').show();
- },
- function(){
- $('.tidypics_tag').hide();
- }
- );
- }
+<?php + $photo_tags_json = $vars['photo_tags_json']; +?> +<script type="text/javascript" src="<?php echo $vars['url'] ?>mod/tidypics/vendors/jquery.imgareaselect-0.7.js"></script> +<script type="text/javascript" src="<?php echo $vars['url'] ?>mod/tidypics/vendors/jquery.quicksearch.js"></script> + +<script type="text/javascript"> + + var coordinates = ""; + var user_id = 0; + var tagging = 0; + + // add to DOM as soon as ready + $(document).ready(function () { + $('ul#tidypics_phototag_list li').quicksearch({ + position: 'before', + attached: 'ul#tidypics_phototag_list', + loaderText: '', + inputClass: 'input-filter', + delay: 100 + }); + + $('#quicksearch').submit( function () { addTag() } ); + } + ); + + // images are loaded so process tags + $(window).load(function () { + $('#tidypics_image').setupTags(); + } + ); + + // get tags over image ready for mouseover + // based on code by Tarique Sani tarique at sanisoft.com - MIT and GPL licenses + $.fn.setupTags = function() + { + + image = this; + + imgOffset = $(image).offset(); + imgOffset.left = parseInt(imgOffset.left) + parseInt($(image).css("border-left-width")) + parseInt($(image).css("padding-left")); + imgOffset.top = parseInt(imgOffset.top) + parseInt($(image).css("border-top-width")) + parseInt($(image).css("padding-top")); + + tags = <?php echo $photo_tags_json; ?>; + + $(tags).each(function(){ + appendTag(imgOffset, this); + }); + + $(image).hover( + function(){ + $('.tidypics_tag').show(); + }, + function(){ + $('.tidypics_tag').hide(); + } + ); + + addTagEvents(); + + $('.tidypics_phototag_links').hover( + function(){ + code = this.id.substr(7); // cut off taglink to get unique id + $('#tag'+code).show(); + }, + function(){ + code = this.id.substr(7); + $('#tag'+code).hide(); + } + ); + + // make sure we catch and handle when the browser is resized + $(window).resize(function () { + $('.tidypics_tag').remove(); + + imgOffset = $(image).offset(); + + $(tags).each(function(){ + appendTag(imgOffset, this); + }); + + addTagEvents(); + }); + } + + function appendTag(offset, tag) + { + // catch for IE when no tags available + if (tag.id == undefined) + return; + + tag_top = parseInt(imgOffset.top) + parseInt(tag.y1); + tag_left = parseInt(imgOffset.left) + parseInt(tag.x1); + + 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' }); + + text_top = parseInt(tag_top) + parseInt(tag.height) + 5; + + tag_text_div = $('<div class="tidypics_tag_text">'+tag.text+'</div>').css({ left: tag_left + 'px', top: text_top + 'px', width: '120px'}); + + $('body').append(tag_div); + $('body').append(tag_text_div); + } + + function addTagEvents() + { + $('.tidypics_tag').hover( + function(){ + $('.tidypics_tag').show(); + $(this).next('.tidypics_tag_text').show(); + $(this).next('.tidypics_tag_text').css("z-index", 10000); + }, + function(){ + $('.tidypics_tag').show(); + $(this).next('.tidypics_tag_text').hide(); + $(this).next('.tidypics_tag_text').css("z-index", 0); + } + ); + } + + + function selectUser(id, name) + { + user_id = id; + $("input.input-filter").val(name); + } + + function startTagging() + { + if (tagging != 0) + { + stopTagging(); + return; + } + + tagging = 1; + + $('#tidypics_tag_control').text("<?php echo elgg_echo('tidypics:finish_tagging'); ?>"); + + showTagInstruct(); + $('#tidypics_delete_tag_menu').hide(); + + $('#tidypics_image').hover( + function(){ + $('.tidypics_tag').hide(); + }, + function(){ + $('.tidypics_tag').hide(); + } + ); + + $('img#tidypics_image').imgAreaSelect( { + borderWidth: 2, + borderColor1: 'white', + borderColor2: 'white', + disable: false, + hide: false, + onSelectEnd: showTagMenu, + onSelectStart: hideTagMenu + } + ); + + $('img#tidypics_image').css({"cursor" : "crosshair"}); + } + + function stopTagging() + { + tagging = 0; + + hideTagInstruct(); + hideTagMenu(); + + $('img#tidypics_image').imgAreaSelect( {hide: true, disable: true} ); + + $('#tidypics_tag_control').text("<?php echo elgg_echo('tidypics:tagthisphoto'); ?>"); + + // restart tag hovering + $('#tidypics_image').hover( + function(){ + $('.tidypics_tag').show(); + }, + function(){ + $('.tidypics_tag').hide(); + } + ); + + $('img#tidypics_image').css({"cursor" : "pointer"}); + } + + function showTagMenu(oObject, oCoordenates) + { + offsetX = 6; + offsetY = 10; + + imgOffset = $('#tidypics_image').offset(); + + // show the list of friends + if (oCoordenates.width != 0 && oCoordenates.height != 0) { + coordinates = oCoordenates; + + _top = imgOffset.top + oCoordenates.y2 + offsetY; + _left = imgOffset.left + oCoordenates.x1 + offsetX; + + $('#tidypics_tag_menu').show().css({ + "top": _top + "px", + "left": _left + "px" + }); + + $(".input-filter").focus(); + } + } + + + function hideTagMenu() + { + $('#tidypics_tag_menu').hide(); + } + + function showTagInstruct() + { + offsetY = -60; + + divWidth = $('#tidypics_tag_instructions').width(); + imgOffset = $('#tidypics_image').offset(); + imgWidth = $('#tidypics_image').width(); + offsetX = parseInt((imgWidth - divWidth)/2); + + _top = imgOffset.top + offsetY; + _left = imgOffset.left + offsetX; + + $('#tidypics_tag_instructions').show().css({ + "top": _top + "px", + "left": _left + "px" + }); + } + + function hideTagInstruct() + { + $('#tidypics_tag_instructions').hide(); + } + + function addTag() + { + // do I need a catch for no tag? + + $("input#user_id").val(user_id); + $("input#word").val( $("input.input-filter").val() ); + + coord_string = '"x1":"' + coordinates.x1 + '",'; + coord_string += '"y1":"' + coordinates.y1 + '",'; + coord_string += '"width":"' + coordinates.width + '",'; + coord_string += '"height":"' + coordinates.height + '"'; + + $("input#coordinates").val(coord_string); + + //Show loading + //$("#tag_menu").replaceWith('<div align="center" class="ajax_loader"></div>'); + } + + function deleteTags() + { + offsetY = 60; + + stopTagging(); + + 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; + + $('#tidypics_delete_tag_menu').show().css({ + "top": _top + "px", + "left": _left + "px" + }); + + $('#tidypics_image').hover( + function(){ + $('.tidypics_tag').hide(); + }, + function(){ + $('.tidypics_tag').hide(); + } + ); + } + + function hideDeleteMenu() + { + $('#tidypics_delete_tag_menu').hide(); + + // restart tag hovering + $('#tidypics_image').hover( + function(){ + $('.tidypics_tag').show(); + }, + function(){ + $('.tidypics_tag').hide(); + } + ); + } </script>
\ No newline at end of file diff --git a/views/default/river/object/album/create.php b/views/default/river/object/album/create.php index a9b261566..20f9293d7 100644 --- a/views/default/river/object/album/create.php +++ b/views/default/river/object/album/create.php @@ -1,42 +1,42 @@ -<?php
-
- $performed_by = get_entity($vars['item']->subject_guid);
- $album = get_entity($vars['item']->object_guid);
-
- $group_album = ($album->owner_guid != $album->container_guid);
- if ($group_album) {
- $group = get_entity($album->container_guid);
- $group_name = $group->name;
- $group_link = $group->getURL();
- }
-
- $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("album:river:created"),$url) . " ";
- $string .= "<a href=\"" . $album->getURL() . "\">" . $album->title . "</a>";
- if ($group_album)
- $string .= ' ' . elgg_echo('album:river:group') . ' ' . "<a href=\"{$group_link}\" >{$group_name}</a>";
-
- $album_river_view = get_plugin_setting('album_river_view', 'tidypics');
-
- if ($album_river_view == "cover") {
- if ($album->cover) {
- $string .= "<div class=\"river_content\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/>' . "</div>";
- }
- } else {
-
- $string .= "<div class=\"river_content\">";
-
- $images = get_entities("object", "image", $album->guid, 'time_created desc', 7);
-
- if (count($images)) {
- foreach($images as $image){
- $string .= "<a href=\"" . $image->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>';
- }
- }
-
- $string .= "</div>";
- }
-
-echo $string;
-
-?>
+<?php + + $performed_by = get_entity($vars['item']->subject_guid); + $album = get_entity($vars['item']->object_guid); + + $group_album = ($album->owner_guid != $album->container_guid); + if ($group_album) { + $group = get_entity($album->container_guid); + $group_name = $group->name; + $group_link = $group->getURL(); + } + + $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; + $string = sprintf(elgg_echo("album:river:created"),$url) . " "; + $string .= "<a href=\"" . $album->getURL() . "\">" . $album->title . "</a>"; + if ($group_album) + $string .= ' ' . elgg_echo('album:river:group') . ' ' . "<a href=\"{$group_link}\" >{$group_name}</a>"; + + $album_river_view = get_plugin_setting('album_river_view', 'tidypics'); + + if ($album_river_view == "cover") { + if ($album->cover) { + $string .= "<div class=\"river_content\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/>' . "</div>"; + } + } else { + + $string .= "<div class=\"river_content\">"; + + $images = get_entities("object", "image", $album->guid, 'time_created desc', 7); + + if (count($images)) { + foreach($images as $image){ + $string .= "<a href=\"" . $image->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>'; + } + } + + $string .= "</div>"; + } + +echo $string; + +?> diff --git a/views/default/river/object/image/create.php b/views/default/river/object/image/create.php index 5229e109a..2f1777f64 100644 --- a/views/default/river/object/image/create.php +++ b/views/default/river/object/image/create.php @@ -1,29 +1,29 @@ -<?php
-
- $performed_by = get_entity($vars['item']->subject_guid);
- $image = get_entity($vars['item']->object_guid);
- if($image->title) {
- $title = $image->title;
- } else {
- $title = "untitled";
- }
-
- $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $album = get_entity($image->container_guid);
-
- $album_link = "<a href='". $album->getURL() . "'>" . $album->title . "</a>";
- $image_link = "<a href=\"" . $image->getURL() . "\">" . $title . "</a>";
-
- $string = sprintf(elgg_echo("image:river:created"),$performed_by->name, $image_link, $album_link);
-
- $string .= "<div class=\"river_content\">";
-
-/* // this adds the album cover to the river display
- $string .= "<a href=\"" . $album->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>';
-*/
- $string .= "<a href=\"" . $image->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>';
- $string .= "</div>";
-
- echo $string;
-
+<?php + + $performed_by = get_entity($vars['item']->subject_guid); + $image = get_entity($vars['item']->object_guid); + if($image->title) { + $title = $image->title; + } else { + $title = "untitled"; + } + + $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; + $album = get_entity($image->container_guid); + + $album_link = "<a href='". $album->getURL() . "'>" . $album->title . "</a>"; + $image_link = "<a href=\"" . $image->getURL() . "\">" . $title . "</a>"; + + $string = sprintf(elgg_echo("image:river:created"),$performed_by->name, $image_link, $album_link); + + $string .= "<div class=\"river_content\">"; + +/* // this adds the album cover to the river display + $string .= "<a href=\"" . $album->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>'; +*/ + $string .= "<a href=\"" . $image->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>'; + $string .= "</div>"; + + echo $string; + ?>
\ No newline at end of file diff --git a/views/default/river/object/image/tag.php b/views/default/river/object/image/tag.php index 6e60d5af3..1b3589afb 100644 --- a/views/default/river/object/image/tag.php +++ b/views/default/river/object/image/tag.php @@ -1,23 +1,23 @@ -<?php
-
- $image = get_entity($vars['item']->subject_guid);
- $person_tagged = get_entity($vars['item']->object_guid);
- if($image->title) {
- $title = $image->title;
- } else {
- $title = "untitled";
- }
-
- // viewer may not have permission to view image
- if (!$image)
- return;
-
-
- $image_url = "<a href=\"{$image->getURL()}\">{$title}</a>";
- $person_url = "<a href=\"{$person_tagged->getURL()}\">{$person_tagged->name}</a>";
-
- $string = $person_url . ' ' . elgg_echo('image:river:tagged') . ' ' . $image_url;
-
- echo $string;
-
+<?php + + $image = get_entity($vars['item']->subject_guid); + $person_tagged = get_entity($vars['item']->object_guid); + if($image->title) { + $title = $image->title; + } else { + $title = "untitled"; + } + + // viewer may not have permission to view image + if (!$image) + return; + + + $image_url = "<a href=\"{$image->getURL()}\">{$title}</a>"; + $person_url = "<a href=\"{$person_tagged->getURL()}\">{$person_tagged->name}</a>"; + + $string = $person_url . ' ' . elgg_echo('image:river:tagged') . ' ' . $image_url; + + echo $string; + ?>
\ No newline at end of file diff --git a/views/default/tidypics/admin/help.php b/views/default/tidypics/admin/help.php index 4014be9ce..7f871598c 100644 --- a/views/default/tidypics/admin/help.php +++ b/views/default/tidypics/admin/help.php @@ -1,25 +1,25 @@ -<br />
-<h3>White screen when uploading images</h3>
-<p>
-Tidypics tries to calculate the maximum size of an image that your server will support. If it
-guesses incorrectly and someone uploads a photo that is too large, the script may crash when
-resizing the image if you are using GD. The easiest way to test this is to set display_errors
-to 1 in your .htaccess file and upload large images. If this causes a problem, a php memory error
-should display on the screen. You can increased your php memory limit (see the docs directory).
-A better option is to use ImageMagick if your server supports it (again see the docs directory).
-</p><p>
-If it is not a memory issue, you should see some other error appear. Once you have fixed the error,
-change display_error back to 0.
-</p>
-<h3>Question mark images appear</h3>
-<p>
-If you see question mark images when you look at your albums, this means the resizing of the images
-failed. This could be due to the memory limits as described above. There are other causes. Tidypics
-tries to detect these problems and write the cause to the error log. You should check your server
-error log right after an upload that results in a question mark for these error messages. The messages
-will begin with "Tidypics warning:". It is possible if you have turned off php warnings that you will
-not see these warnings.
-</p><p>
-Another possible cause is using ImageMagick when your server does not support it or specifying
-the wrong path to the ImageMagick executables.
+<br /> +<h3>White screen when uploading images</h3> +<p> +Tidypics tries to calculate the maximum size of an image that your server will support. If it +guesses incorrectly and someone uploads a photo that is too large, the script may crash when +resizing the image if you are using GD. The easiest way to test this is to set display_errors +to 1 in your .htaccess file and upload large images. If this causes a problem, a php memory error +should display on the screen. You can increased your php memory limit (see the docs directory). +A better option is to use ImageMagick if your server supports it (again see the docs directory). +</p><p> +If it is not a memory issue, you should see some other error appear. Once you have fixed the error, +change display_error back to 0. +</p> +<h3>Question mark images appear</h3> +<p> +If you see question mark images when you look at your albums, this means the resizing of the images +failed. This could be due to the memory limits as described above. There are other causes. Tidypics +tries to detect these problems and write the cause to the error log. You should check your server +error log right after an upload that results in a question mark for these error messages. The messages +will begin with "Tidypics warning:". It is possible if you have turned off php warnings that you will +not see these warnings. +</p><p> +Another possible cause is using ImageMagick when your server does not support it or specifying +the wrong path to the ImageMagick executables. </p>
\ No newline at end of file diff --git a/views/default/tidypics/admin/imagelib.php b/views/default/tidypics/admin/imagelib.php index deb32d0f3..b4656afe1 100644 --- a/views/default/tidypics/admin/imagelib.php +++ b/views/default/tidypics/admin/imagelib.php @@ -1,62 +1,62 @@ -<?php
-
- $img_type = get_subtype_id('object', 'image');
- $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
- $total = get_data_row($query);
- $num_images = $total->total;
-
- $img_type = get_subtype_id('object', 'album');
- $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
- $total = get_data_row($query);
- $num_albums = $total->total;
-
- $num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment');
- $num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment');
-
- $num_views = count_annotations(0, 'object', 'image', 'tp_view');
-
- if (get_plugin_setting('tagging', 'tidypics') != "disabled")
- $num_tags = count_annotations(0, 'object', 'image', 'phototag');
-?>
-<br />
-<h3>Overview</h3>
-<p>
-An image library is required by Tidypics to perform various manipulations: resizing on upload, watermarking, rotation, and cropping.
-There are three image library options with Tidypics: PHP extension <a href="http://www.php.net/manual/en/book.image.php">GD</a>,
-<a href="http://www.imagemagick.org/">ImageMagick</a> called via a system call, and the PHP extension
-<a href="http://pecl.php.net/package/imagick/">imagick</a>. GD is the most common of the three on hosted servers but suffers
-from serious memory usage problems when resizing photos. If you have access to ImageMagick (whether through system calls or the
-PHP extension), we recommend that you use that.
-</p>
-<h3>Testing ImageMagick Commandline</h3>
-<p>
-To use the ImageMagick executables, PHP must be configured to allow calls to exec(). You can check our
-<a href="<?php echo $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php'; ?>">server analysis page</a> to find out the
-configuration of your server. Next, you need to determine the path to ImageMagick on your server. Your hosting service should
-be able to provide this to you. You can test if the location is correct below. If successful, it should display the version of
-ImageMagick installed on your server.
-</p>
-<br />
-<p>
-<?php echo elgg_echo('tidypics:settings:im_path'); ?><br />
-<input name="im_location" type="text" />
-<input type="submit" value="Submit" onclick="TestImageMagickLocation();" />
-</p>
-<div id="im_results"></div>
-
-<script type="text/javascript">
-function TestImageMagickLocation()
-{
- var loc = $('input[name=im_location]').val();
- $("#im_results").html("");
- $.ajax({
- type: "GET",
- url: "<?php echo $CONFIG->wwwroot . 'mod/tidypics/actions/imtest.php'; ?>",
- data: {location: loc},
- cache: false,
- success: function(html){
- $("#im_results").html(html);
- }
- });
-}
+<?php + + $img_type = get_subtype_id('object', 'image'); + $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}"; + $total = get_data_row($query); + $num_images = $total->total; + + $img_type = get_subtype_id('object', 'album'); + $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}"; + $total = get_data_row($query); + $num_albums = $total->total; + + $num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment'); + $num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment'); + + $num_views = count_annotations(0, 'object', 'image', 'tp_view'); + + if (get_plugin_setting('tagging', 'tidypics') != "disabled") + $num_tags = count_annotations(0, 'object', 'image', 'phototag'); +?> +<br /> +<h3>Overview</h3> +<p> +An image library is required by Tidypics to perform various manipulations: resizing on upload, watermarking, rotation, and cropping. +There are three image library options with Tidypics: PHP extension <a href="http://www.php.net/manual/en/book.image.php">GD</a>, +<a href="http://www.imagemagick.org/">ImageMagick</a> called via a system call, and the PHP extension +<a href="http://pecl.php.net/package/imagick/">imagick</a>. GD is the most common of the three on hosted servers but suffers +from serious memory usage problems when resizing photos. If you have access to ImageMagick (whether through system calls or the +PHP extension), we recommend that you use that. +</p> +<h3>Testing ImageMagick Commandline</h3> +<p> +To use the ImageMagick executables, PHP must be configured to allow calls to exec(). You can check our +<a href="<?php echo $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php'; ?>">server analysis page</a> to find out the +configuration of your server. Next, you need to determine the path to ImageMagick on your server. Your hosting service should +be able to provide this to you. You can test if the location is correct below. If successful, it should display the version of +ImageMagick installed on your server. +</p> +<br /> +<p> +<?php echo elgg_echo('tidypics:settings:im_path'); ?><br /> +<input name="im_location" type="text" /> +<input type="submit" value="Submit" onclick="TestImageMagickLocation();" /> +</p> +<div id="im_results"></div> + +<script type="text/javascript"> +function TestImageMagickLocation() +{ + var loc = $('input[name=im_location]').val(); + $("#im_results").html(""); + $.ajax({ + type: "GET", + url: "<?php echo $CONFIG->wwwroot . 'mod/tidypics/actions/imtest.php'; ?>", + data: {location: loc}, + cache: false, + success: function(html){ + $("#im_results").html(html); + } + }); +} </script>
\ No newline at end of file diff --git a/views/default/tidypics/admin/settings.php b/views/default/tidypics/admin/settings.php index 1b449cfc7..ff7d330e2 100644 --- a/views/default/tidypics/admin/settings.php +++ b/views/default/tidypics/admin/settings.php @@ -1,25 +1,25 @@ -<?php
-
- echo elgg_view('output/longtext', array('value' => elgg_echo("tidypics:admin:instructions")));
-
- global $CONFIG;
- $system_url = $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php';
- $upgrade_url = $CONFIG->wwwroot . 'mod/tidypics/actions/upgrade.php';
-
- $upgrade = false;
- if (!get_subtype_class('object', 'image') || !get_subtype_class('object', 'album'))
- $upgrade = true;
-?>
-<p>
-<?php
- if ($upgrade) {
-?>
-<a href="<?php echo $upgrade_url; ?>">Upgrade</a><br />
-<?php
- }
-?>
-<a href="<?php echo $system_url; ?>">Run Server Analysis</a>
-</p>
-<?php
- echo elgg_view("tidypics/forms/settings");
+<?php + + echo elgg_view('output/longtext', array('value' => elgg_echo("tidypics:admin:instructions"))); + + global $CONFIG; + $system_url = $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php'; + $upgrade_url = $CONFIG->wwwroot . 'mod/tidypics/actions/upgrade.php'; + + $upgrade = false; + if (!get_subtype_class('object', 'image') || !get_subtype_class('object', 'album')) + $upgrade = true; +?> +<p> +<?php + if ($upgrade) { +?> +<a href="<?php echo $upgrade_url; ?>">Upgrade</a><br /> +<?php + } +?> +<a href="<?php echo $system_url; ?>">Run Server Analysis</a> +</p> +<?php + echo elgg_view("tidypics/forms/settings"); ?>
\ No newline at end of file diff --git a/views/default/tidypics/admin/stats.php b/views/default/tidypics/admin/stats.php index 8de3415a1..aea5e75ba 100644 --- a/views/default/tidypics/admin/stats.php +++ b/views/default/tidypics/admin/stats.php @@ -1,35 +1,35 @@ -<?php
-
- $img_type = get_subtype_id('object', 'image');
- $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
- $total = get_data_row($query);
- $num_images = $total->total;
-
- $img_type = get_subtype_id('object', 'album');
- $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
- $total = get_data_row($query);
- $num_albums = $total->total;
-
- $num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment');
- $num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment');
-
- $num_views = count_annotations(0, 'object', 'image', 'tp_view');
-
- if (get_plugin_setting('tagging', 'tidypics') != "disabled")
- $num_tags = count_annotations(0, 'object', 'image', 'phototag');
-?>
-<p>
-<br />
-Photos: <?php echo $num_images; ?><br />
-Albums: <?php echo $num_albums; ?><br />
-Comments on photos: <?php echo $num_comments_photos; ?><br />
-Comments on albums: <?php echo $num_comments_albums; ?><br />
-Total views: <?php echo $num_views; ?><br />
-<?php
- if ($num_tags) {
-?>
-Photo tags: <?php echo $num_tags; ?><br />
-<?php
- }
-?>
+<?php + + $img_type = get_subtype_id('object', 'image'); + $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}"; + $total = get_data_row($query); + $num_images = $total->total; + + $img_type = get_subtype_id('object', 'album'); + $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}"; + $total = get_data_row($query); + $num_albums = $total->total; + + $num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment'); + $num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment'); + + $num_views = count_annotations(0, 'object', 'image', 'tp_view'); + + if (get_plugin_setting('tagging', 'tidypics') != "disabled") + $num_tags = count_annotations(0, 'object', 'image', 'phototag'); +?> +<p> +<br /> +Photos: <?php echo $num_images; ?><br /> +Albums: <?php echo $num_albums; ?><br /> +Comments on photos: <?php echo $num_comments_photos; ?><br /> +Comments on albums: <?php echo $num_comments_albums; ?><br /> +Total views: <?php echo $num_views; ?><br /> +<?php + if ($num_tags) { +?> +Photo tags: <?php echo $num_tags; ?><br /> +<?php + } +?> </p>
\ No newline at end of file diff --git a/views/default/tidypics/admin/thumbnails.php b/views/default/tidypics/admin/thumbnails.php index 0af59090e..ccd884005 100644 --- a/views/default/tidypics/admin/thumbnails.php +++ b/views/default/tidypics/admin/thumbnails.php @@ -1,33 +1,33 @@ -<br />
-<h3>Overview</h3>
-<p>
-This page allows you to create thumbnails for images when the thumbnail creation failed during upload.
-You may experience problems with thumbnail creation if your image library in not configured properly or
-if there is not enough memory for the GD library to load and resize an image. If your users have
-experienced problems with thumbnail creation and you have modified your setup, you can try to redo the
-thumbnails. Find the unique identifier of the photo (it is the number near the end of the url when viewing
-a photo) and enter it below.
-</p>
-<h3>Thumbnail Creation</h3>
-<p>
-<b><?php echo elgg_echo('tidypics:settings:im_id'); ?></b>:
-<input name="image_id" type="text" />
-<input type="submit" value="Submit" onclick="TestThumbnailCreation();" />
-</p>
-<div id="im_results"></div>
-<script type="text/javascript">
-function TestThumbnailCreation()
-{
- var image_id = $('input[name=image_id]').val();
- $("#im_results").html("");
- $.ajax({
- type: "GET",
- url: "<?php echo $CONFIG->wwwroot . 'mod/tidypics/actions/create_thumbnails.php'; ?>",
- data: {guid: image_id},
- cache: false,
- success: function(html){
- $("#im_results").html(html);
- }
- });
-}
+<br /> +<h3>Overview</h3> +<p> +This page allows you to create thumbnails for images when the thumbnail creation failed during upload. +You may experience problems with thumbnail creation if your image library in not configured properly or +if there is not enough memory for the GD library to load and resize an image. If your users have +experienced problems with thumbnail creation and you have modified your setup, you can try to redo the +thumbnails. Find the unique identifier of the photo (it is the number near the end of the url when viewing +a photo) and enter it below. +</p> +<h3>Thumbnail Creation</h3> +<p> +<b><?php echo elgg_echo('tidypics:settings:im_id'); ?></b>: +<input name="image_id" type="text" /> +<input type="submit" value="Submit" onclick="TestThumbnailCreation();" /> +</p> +<div id="im_results"></div> +<script type="text/javascript"> +function TestThumbnailCreation() +{ + var image_id = $('input[name=image_id]').val(); + $("#im_results").html(""); + $.ajax({ + type: "GET", + url: "<?php echo $CONFIG->wwwroot . 'mod/tidypics/actions/create_thumbnails.php'; ?>", + data: {guid: image_id}, + cache: false, + success: function(html){ + $("#im_results").html(html); + } + }); +} </script>
\ No newline at end of file diff --git a/views/default/tidypics/albums.php b/views/default/tidypics/albums.php index 9c75bf024..42ac15afe 100644 --- a/views/default/tidypics/albums.php +++ b/views/default/tidypics/albums.php @@ -1,51 +1,51 @@ -<?php
-
- //the number of albums to display
- $number = (int)$vars['num_albums'];
- if (!$number)
- $number = 5;
-
- $owner = page_owner_entity();
- $owner_albums = get_entities("object", "album", page_owner(), "", $number, 0, false);
-
- echo '<div id="tidypics_album_widget_container">';
-
- if ($owner_albums) {
- foreach($owner_albums as $album) {
-
- if($album->cover)
- $album_cover = '<img src="'.$vars['url'].'mod/tidypics/thumbnail.php?file_guid='.$album->cover.'&size=small" class="tidypics_album_cover" alt="' . $album->title . '"/>';
- else
- $album_cover = '<img src="'.$vars['url'].'mod/tidypics/graphics/empty_album.png" class="tidypics_album_cover" alt="' . $album->title . '">';
-?>
- <div class="tidypics_album_widget_single_item">
- <div class="tidypics_album_widget_title"><a href="<?php echo $album->getURL();?>"><?php echo $album->title;?></a></div>
- <div class="tidypics_album_widget_timestamp"> <?php echo elgg_echo("album:created:on") . ' ' . friendly_time($album->time_created);?></div>
-<?php
- //get the number of comments
- $numcomments = elgg_count_comments($album);
- if ($numcomments)
- echo "<a href=\"{$album->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a><br>";
-?>
- <a href="<?php echo $album->getURL();?>"><?php echo $album_cover;?></a>
- </div>
-<?php
- } //end of foreach loop
-
- // bottom link to all group/user albums
- if (is_null($owner->username) || empty($owner->username)) {
- echo '<p class="profile_info_edit_buttons"><a href="' . $vars['url'] . 'pg/photos/world">' . elgg_echo('album:all') . '</a></p>';
- } else {
- echo '<p class="tidypics_download"><a href="' . $vars['url'] . 'pg/photos/owned/' . $owner->username . '">' . elgg_echo('album:more') . '</a></p>';
- }
-
- }
-
- if (can_write_to_container(0, $owner->guid)) {
- echo '<p class="tidypics_download"><a href=' . $CONFIG->wwwroot .'pg/photos/new/' . $owner->username . '>' . elgg_echo("album:create") . '</a></p>';
- }
-
-
- //close album_widget_container div
- echo "</div>";
+<?php + + //the number of albums to display + $number = (int)$vars['num_albums']; + if (!$number) + $number = 5; + + $owner = page_owner_entity(); + $owner_albums = get_entities("object", "album", page_owner(), "", $number, 0, false); + + echo '<div id="tidypics_album_widget_container">'; + + if ($owner_albums) { + foreach($owner_albums as $album) { + + if($album->cover) + $album_cover = '<img src="'.$vars['url'].'mod/tidypics/thumbnail.php?file_guid='.$album->cover.'&size=small" class="tidypics_album_cover" alt="' . $album->title . '"/>'; + else + $album_cover = '<img src="'.$vars['url'].'mod/tidypics/graphics/empty_album.png" class="tidypics_album_cover" alt="' . $album->title . '">'; +?> + <div class="tidypics_album_widget_single_item"> + <div class="tidypics_album_widget_title"><a href="<?php echo $album->getURL();?>"><?php echo $album->title;?></a></div> + <div class="tidypics_album_widget_timestamp"> <?php echo elgg_echo("album:created:on") . ' ' . friendly_time($album->time_created);?></div> +<?php + //get the number of comments + $numcomments = elgg_count_comments($album); + if ($numcomments) + echo "<a href=\"{$album->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a><br>"; +?> + <a href="<?php echo $album->getURL();?>"><?php echo $album_cover;?></a> + </div> +<?php + } //end of foreach loop + + // bottom link to all group/user albums + if (is_null($owner->username) || empty($owner->username)) { + echo '<p class="profile_info_edit_buttons"><a href="' . $vars['url'] . 'pg/photos/world">' . elgg_echo('album:all') . '</a></p>'; + } else { + echo '<p class="tidypics_download"><a href="' . $vars['url'] . 'pg/photos/owned/' . $owner->username . '">' . elgg_echo('album:more') . '</a></p>'; + } + + } + + if (can_write_to_container(0, $owner->guid)) { + echo '<p class="tidypics_download"><a href=' . $CONFIG->wwwroot .'pg/photos/new/' . $owner->username . '>' . elgg_echo("album:create") . '</a></p>'; + } + + + //close album_widget_container div + echo "</div>"; ?>
\ No newline at end of file diff --git a/views/default/tidypics/breadcrumbs.php b/views/default/tidypics/breadcrumbs.php index 1a96e921c..c4d347e6e 100644 --- a/views/default/tidypics/breadcrumbs.php +++ b/views/default/tidypics/breadcrumbs.php @@ -1,22 +1,22 @@ -<?php
- $file_guid = $vars['file_guid'];
- $page_owner = page_owner_entity();
-
- $first_level_text = '';
- $first_level_link = $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username;
- if (get_loggedin_userid() == $page_owner->guid)
- $first_level_text = elgg_echo('album:yours');
- else
- $first_level_text = sprintf(elgg_echo('album:user'), $page_owner->name);
-?>
-<a href="<?php echo $first_level_link; ?>"><?php echo $first_level_text; ?></a>
-<?php
- $second_level_text = '';
- if (isset($vars['album'])) {
- $second_level_text = $vars['album']->title;
- $second_level_link = $vars['album']->getURL();
-?>
->> <a href="<?php echo $second_level_link; ?>"><?php echo $second_level_text; ?></a>
-<?php
- }
-?>
+<?php + $file_guid = $vars['file_guid']; + $page_owner = page_owner_entity(); + + $first_level_text = ''; + $first_level_link = $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username; + if (get_loggedin_userid() == $page_owner->guid) + $first_level_text = elgg_echo('album:yours'); + else + $first_level_text = sprintf(elgg_echo('album:user'), $page_owner->name); +?> +<a href="<?php echo $first_level_link; ?>"><?php echo $first_level_text; ?></a> +<?php + $second_level_text = ''; + if (isset($vars['album'])) { + $second_level_text = $vars['album']->title; + $second_level_link = $vars['album']->getURL(); +?> +>> <a href="<?php echo $second_level_link; ?>"><?php echo $second_level_text; ?></a> +<?php + } +?> diff --git a/views/default/tidypics/exif.php b/views/default/tidypics/exif.php index 525665754..0100ac575 100644 --- a/views/default/tidypics/exif.php +++ b/views/default/tidypics/exif.php @@ -1,14 +1,14 @@ -<?php
-
- $guid = $vars['guid'];
-
- $exif = tp_exif_formatted($guid);
- if ($exif) {
- echo '<div id="tidypics_exif">';
- foreach ($exif as $name => $value) {
- echo $name . ': ' . $value . '<br />';
- }
- echo '</div>';
- }
-
+<?php + + $guid = $vars['guid']; + + $exif = tp_exif_formatted($guid); + if ($exif) { + echo '<div id="tidypics_exif">'; + foreach ($exif as $name => $value) { + echo $name . ': ' . $value . '<br />'; + } + echo '</div>'; + } + ?>
\ No newline at end of file diff --git a/views/default/tidypics/forms/edit.php b/views/default/tidypics/forms/edit.php index cec1945f0..342ac8822 100644 --- a/views/default/tidypics/forms/edit.php +++ b/views/default/tidypics/forms/edit.php @@ -1,118 +1,118 @@ -<?php
- /**
- * Tidypics images edit/add form
- * This form is used to:
- * - create albums
- * - edit albums
- * - edit images
- */
-
- //set stuff if we are editing existing album or image
- if (isset($vars['entity'])) {
- $action = "tidypics/edit";
- $title = $vars['entity']->title;
- $body = $vars['entity']->description;
- $tags = $vars['entity']->tags;
- $access_id = $vars['entity']->access_id;
- $subtype = $vars['subtype'];
-
- // if nothing is sent, create new, but only new albums are sent here
- // new images are sent to upload.php
- } else {
- $action = "tidypics/addalbum";
- $tags = "";
- $title = "";
- $body = "";
- if (defined('ACCESS_DEFAULT'))
- $access_id = ACCESS_DEFAULT;
- else
- $access_id = 1; // logged_in by default
- $subtype = 'album';
-
- $title = $_SESSION['tidypicstitle'];
- $body = $_SESSION['tidypicsbody'];
- $tags = $_SESSION['tidypicstags'];
-
- unset($_SESSION['tidypicstitle']);
- unset($_SESSION['tidypicsbody']);
- unset($_SESSION['tidypicstags']);
- }
-
- // group or individual
- $container_guid = page_owner();
-
-?>
-<div class="contentWrapper">
- <form action="<?php echo $vars['url']; ?>action/<?php echo $action; ?>" method="post">
- <p>
- <label><?php echo elgg_echo('album:title'); ?></label>
- <?php echo elgg_view("input/text", array("internalname" => "tidypicstitle", "value" => $title,)); ?>
- </p>
-<?php
- if ($subtype == 'album') {
-?>
- <p>
- <label><?php echo elgg_echo('album:desc'); ?></label>
- <?php echo elgg_view("input/longtext",array("internalname" => "tidypicsbody","value" => $body,)); ?>
- </p>
-<?php
- } else {
-?>
- <p>
- <label><?php echo elgg_echo('caption'); ?></label>
- <?php echo elgg_view("input/longtext",array("internalname" => "tidypicsbody","value" => $body,"class" => 'tidypics_caption_input')); ?>
- </p>
-<?php
- }
-?>
- <p>
- <label><?php echo elgg_echo("tags"); ?></label>
- <?php echo elgg_view("input/tags", array( "internalname" => "tidypicstags","value" => $tags,)); ?>
- </p>
-
-<?php
- if ($subtype == 'image') {
- $container_guid = $vars['entity']->container_guid;
-
- // should this image be the cover for the album - only ask for non-cover photos
- // determine if it is already the cover
- $img_guid = $vars['entity']->guid;
- $album = get_entity($container_guid);
- $cover_guid = $album->cover;
-
- if ($cover_guid != $img_guid) {
-
-?>
- <p>
-<?php echo elgg_view('input/checkboxes', array('internalname' => "cover",
- 'options' => array(elgg_echo("album:cover")),
- ));
-?>
- </p>
-<?php
- }
-
- } else {
- // album so display access control
-?>
- <p>
- <label><?php echo elgg_echo('access'); ?></label>
- <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id)); ?>
- </p>
-
-<?php
- }
-
- if (isset($vars['entity'])) {
-?>
- <input type="hidden" name="guid" value="<?php echo $vars['entity']->getGUID(); ?>" />
-<?php
- }
-
- echo elgg_view('input/securitytoken');
-?>
- <input type="hidden" name="container_guid" value="<?php echo $container_guid; ?>" />
- <input type="hidden" name="subtype" value="<?php echo $subtype; ?>" />
- <p><input type="submit" name="submit" value="<?php echo elgg_echo('save'); ?>" /></p>
- </form>
+<?php + /** + * Tidypics images edit/add form + * This form is used to: + * - create albums + * - edit albums + * - edit images + */ + + //set stuff if we are editing existing album or image + if (isset($vars['entity'])) { + $action = "tidypics/edit"; + $title = $vars['entity']->title; + $body = $vars['entity']->description; + $tags = $vars['entity']->tags; + $access_id = $vars['entity']->access_id; + $subtype = $vars['subtype']; + + // if nothing is sent, create new, but only new albums are sent here + // new images are sent to upload.php + } else { + $action = "tidypics/addalbum"; + $tags = ""; + $title = ""; + $body = ""; + if (defined('ACCESS_DEFAULT')) + $access_id = ACCESS_DEFAULT; + else + $access_id = 1; // logged_in by default + $subtype = 'album'; + + $title = $_SESSION['tidypicstitle']; + $body = $_SESSION['tidypicsbody']; + $tags = $_SESSION['tidypicstags']; + + unset($_SESSION['tidypicstitle']); + unset($_SESSION['tidypicsbody']); + unset($_SESSION['tidypicstags']); + } + + // group or individual + $container_guid = page_owner(); + +?> +<div class="contentWrapper"> + <form action="<?php echo $vars['url']; ?>action/<?php echo $action; ?>" method="post"> + <p> + <label><?php echo elgg_echo('album:title'); ?></label> + <?php echo elgg_view("input/text", array("internalname" => "tidypicstitle", "value" => $title,)); ?> + </p> +<?php + if ($subtype == 'album') { +?> + <p> + <label><?php echo elgg_echo('album:desc'); ?></label> + <?php echo elgg_view("input/longtext",array("internalname" => "tidypicsbody","value" => $body,)); ?> + </p> +<?php + } else { +?> + <p> + <label><?php echo elgg_echo('caption'); ?></label> + <?php echo elgg_view("input/longtext",array("internalname" => "tidypicsbody","value" => $body,"class" => 'tidypics_caption_input')); ?> + </p> +<?php + } +?> + <p> + <label><?php echo elgg_echo("tags"); ?></label> + <?php echo elgg_view("input/tags", array( "internalname" => "tidypicstags","value" => $tags,)); ?> + </p> + +<?php + if ($subtype == 'image') { + $container_guid = $vars['entity']->container_guid; + + // should this image be the cover for the album - only ask for non-cover photos + // determine if it is already the cover + $img_guid = $vars['entity']->guid; + $album = get_entity($container_guid); + $cover_guid = $album->cover; + + if ($cover_guid != $img_guid) { + +?> + <p> +<?php echo elgg_view('input/checkboxes', array('internalname' => "cover", + 'options' => array(elgg_echo("album:cover")), + )); +?> + </p> +<?php + } + + } else { + // album so display access control +?> + <p> + <label><?php echo elgg_echo('access'); ?></label> + <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id)); ?> + </p> + +<?php + } + + if (isset($vars['entity'])) { +?> + <input type="hidden" name="guid" value="<?php echo $vars['entity']->getGUID(); ?>" /> +<?php + } + + echo elgg_view('input/securitytoken'); +?> + <input type="hidden" name="container_guid" value="<?php echo $container_guid; ?>" /> + <input type="hidden" name="subtype" value="<?php echo $subtype; ?>" /> + <p><input type="submit" name="submit" value="<?php echo elgg_echo('save'); ?>" /></p> + </form> </div>
\ No newline at end of file diff --git a/views/default/tidypics/forms/edit_multi.php b/views/default/tidypics/forms/edit_multi.php index 4c4a111f5..4031b7968 100644 --- a/views/default/tidypics/forms/edit_multi.php +++ b/views/default/tidypics/forms/edit_multi.php @@ -1,58 +1,58 @@ -<?php
- /**
- * form for mass editing all uploaded images
- */
-?>
-<div class="contentWrapper">
-<form action="<?php echo $vars['url']; ?>action/tidypics/edit_multi" method="post">
-<?php
-
- $file_array = $vars['file_array'];
-
- // make sure one of the images becomes the cover if there isn't one already
- $album_entity = get_entity($vars['album_guid']);
- if (!$album_entity->cover) $no_cover = true;
-
- foreach ($file_array as $key => $file_guid){
- $entity = get_entity($file_guid);
- $guid = $entity->guid;
- $body = $entity->description;
- $title = $entity->title;
- $tags = $entity->tags;
- $container_guid = $entity->container_guid;
-
- // first one is default cover if there isn't one already
- if ($no_cover) {
- $val = $guid;
- $no_cover = false;
- }
-
- echo '<div class="tidypics_edit_image_container">';
- echo '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $guid . '&size=small" class="tidypics_edit_images" alt="' . $title . '"/>';
- echo '<div class="tidypics_image_info">';
- echo '<p><label>' . elgg_echo('album:title') . '</label>';
- echo elgg_view("input/text", array("internalname" => "title[$key]", "value" => $title,)) . "\n";
- echo '</p>';
- echo '<p><label>' . elgg_echo('caption') . "</label>";
- echo elgg_view("input/longtext",array("internalname" => "caption[$key]", "value" => $body, "class" => 'tidypics_caption_input',)) . "\n";
- echo "</p>";
- echo '<p><label>' . elgg_echo("tags") . "</label>\n";
- echo elgg_view("input/tags", array( "internalname" => "tags[$key]","value" => $tags)) . "\n";
- echo '</p>';
- echo '<input type="hidden" name="image_guid[' .$key. ']" value="'. $guid .'">' . "\n";
- echo elgg_view('input/securitytoken');
-
- echo elgg_view("input/radio", array("internalname" => "cover",
- "value" => $val,
- 'options' => array( elgg_echo('album:cover') => $guid,
- ),
- ));
- echo '</div>';
- echo '</div>';
- }
-
-?>
-<input type="hidden" name="container_guid" value="<?php echo $container_guid; ?>" />
-<p><input type="submit" name="submit" value="<?php echo elgg_echo('save'); ?>" /></p>
-</form>
+<?php + /** + * form for mass editing all uploaded images + */ +?> +<div class="contentWrapper"> +<form action="<?php echo $vars['url']; ?>action/tidypics/edit_multi" method="post"> +<?php + + $file_array = $vars['file_array']; + + // make sure one of the images becomes the cover if there isn't one already + $album_entity = get_entity($vars['album_guid']); + if (!$album_entity->cover) $no_cover = true; + + foreach ($file_array as $key => $file_guid){ + $entity = get_entity($file_guid); + $guid = $entity->guid; + $body = $entity->description; + $title = $entity->title; + $tags = $entity->tags; + $container_guid = $entity->container_guid; + + // first one is default cover if there isn't one already + if ($no_cover) { + $val = $guid; + $no_cover = false; + } + + echo '<div class="tidypics_edit_image_container">'; + echo '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $guid . '&size=small" class="tidypics_edit_images" alt="' . $title . '"/>'; + echo '<div class="tidypics_image_info">'; + echo '<p><label>' . elgg_echo('album:title') . '</label>'; + echo elgg_view("input/text", array("internalname" => "title[$key]", "value" => $title,)) . "\n"; + echo '</p>'; + echo '<p><label>' . elgg_echo('caption') . "</label>"; + echo elgg_view("input/longtext",array("internalname" => "caption[$key]", "value" => $body, "class" => 'tidypics_caption_input',)) . "\n"; + echo "</p>"; + echo '<p><label>' . elgg_echo("tags") . "</label>\n"; + echo elgg_view("input/tags", array( "internalname" => "tags[$key]","value" => $tags)) . "\n"; + echo '</p>'; + echo '<input type="hidden" name="image_guid[' .$key. ']" value="'. $guid .'">' . "\n"; + echo elgg_view('input/securitytoken'); + + echo elgg_view("input/radio", array("internalname" => "cover", + "value" => $val, + 'options' => array( elgg_echo('album:cover') => $guid, + ), + )); + echo '</div>'; + echo '</div>'; + } + +?> +<input type="hidden" name="container_guid" value="<?php echo $container_guid; ?>" /> +<p><input type="submit" name="submit" value="<?php echo elgg_echo('save'); ?>" /></p> +</form> </div>
\ No newline at end of file diff --git a/views/default/tidypics/forms/settings.php b/views/default/tidypics/forms/settings.php index 6ab9dfcc9..6cfed661f 100644 --- a/views/default/tidypics/forms/settings.php +++ b/views/default/tidypics/forms/settings.php @@ -1,145 +1,145 @@ -<?php
- /**
- * Tidypics admin settings form
- */
-
-
-
- $action = $vars['url'] . 'action/tidypics/settings';
-
- $plugin = find_plugin_settings('tidypics');
-
-
- // bootstrap the plugin version here for now
- if (!$plugin->version) {
- set_plugin_setting('version', 1.62, 'tidypics');
- }
-
- if (extension_loaded('imagick'))
- $img_lib_options['ImageMagickPHP'] = 'imagick PHP extension';
-
- $disablefunc = explode(',', ini_get('disable_functions'));
- if (is_callable('exec') && !in_array('exec',$disablefunc))
- $img_lib_options['ImageMagick'] = 'ImageMagick Cmdline';
-
- $img_lib_options['GD'] = 'GD';
-
-
- // Image Library
- $image_lib = $plugin->image_lib;
- if (!$image_lib) $image_lib = 'GD';
- $form_body = '<p>' . elgg_echo('tidypics:settings:image_lib') . ': ';
- $form_body .= elgg_view('input/pulldown', array(
- 'internalname' => 'params[image_lib]',
- 'options_values' => $img_lib_options,
- 'value' => $image_lib
- ));
- $form_body .= '<br/>Note: If you want to select ImageMagick Command Line, first confirm that it is installed on your server.</p>';
-
- if (is_callable('exec') && !in_array('exec',$disablefunc)) {
- // Image Magick Path
- $im_path = $plugin->im_path;
- if(!$im_path) $im_path = "/usr/bin/";
- $form_body .= "<p>" . elgg_echo('tidypics:settings:im_path') . "<br />";
- $form_body .= elgg_view("input/text",array('internalname' => 'params[im_path]', 'value' => $im_path)) . "</p>";
- }
-
- // Tagging
- $tagging = $plugin->tagging;
- if(!$tagging) $tagging = "enabled";
- $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:tagging') => 'enabled'), 'internalname' => 'tagging', 'value' => $tagging )) . "</p>";
-
- // Download Link
- $download_link = $plugin->download_link;
- if(!$download_link) $download_link = "enabled";
- $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:download_link') => 'enabled'), 'internalname' => 'download_link', 'value' => $download_link )) . "</p>";
-
- // Ratings
- $photo_ratings = $plugin->photo_ratings;
- if(!$photo_ratings) $photo_ratings = "disabled";
- $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:photo_ratings') => 'enabled'), 'internalname' => 'photo_ratings', 'value' => $photo_ratings )) . "</p>";
-
- // Show EXIF
- $exif = $plugin->exif;
- if(!$exif) $exif = "disabled";
- $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:exif') => 'enabled'), 'internalname' => 'exif', 'value' => $exif )) . "</p>";
-
- // Show View count
- $view_count = $plugin->view_count;
- if(!$view_count) $view_count = "enabled";
- $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:view_count') => 'enabled'), 'internalname' => 'view_count', 'value' => $view_count )) . "</p>";
- - // Watermark Text
- $form_body .= "<p>" . elgg_echo('tidypics:settings:watermark') . "<br />";
- $form_body .= elgg_view("input/text",array('internalname' => 'params[watermark_text]', 'value' => $plugin->watermark_text)) . "</p>";
- - // Max Image Size
- $maxfilesize = $plugin->maxfilesize;
- if (!$maxfilesize) $maxfilesize = (int)5; // 5 MB
- $form_body .= "<p>" . elgg_echo('tidypics:settings:maxfilesize') . "<br />";
- $form_body .= elgg_view("input/text",array('internalname' => 'params[maxfilesize]', 'value' => $maxfilesize)) . "</p>";
-
- // Quota Size
- $quota = $plugin->quota;
- if (!$quota) $quota = 0;
- $form_body .= "<p>" . elgg_echo('tidypics:settings:quota') . "<br />";
- $form_body .= elgg_view("input/text",array('internalname' => 'params[quota]', 'value' => $quota)) . "</p>";
-
- // River Image options
- $img_river_view = $plugin->img_river_view;
- if (!$img_river_view) $img_river_view = '1';
- $form_body .= '<p>' . elgg_echo('tidypics:settings:img_river_view');
- $form_body .= elgg_view('input/pulldown', array(
- 'internalname' => 'params[img_river_view]',
- 'options_values' => array(
- 'all' => 'all',
- '1' => '1',
- 'none' => 'none',
- ),
- 'value' => $img_river_view
- ));
- $form_body .= '</p>';
-
- // River Album options
- $album_river_view = $plugin->album_river_view;
- if (!$album_river_view) $album_river_view = 'set';
- $form_body .= '<p>' . elgg_echo('tidypics:settings:album_river_view');
- $form_body .= elgg_view('input/pulldown', array(
- 'internalname' => 'params[album_river_view]',
- 'options_values' => array(
- 'cover' => 'cover',
- 'set' => 'set',
- ),
- 'value' => $album_river_view
- ));
- $form_body .= '</p>';
-
- // Thumbnail sizes
- $image_sizes = $plugin->image_sizes;
- if(!$image_sizes) {
- $image_sizes = array(); // set default values
- $image_sizes['large_image_width'] = $image_sizes['large_image_height'] = 600;
- $image_sizes['small_image_width'] = $image_sizes['small_image_height'] = 153;
- $image_sizes['thumb_image_width'] = $image_sizes['thumb_image_height'] = 60;
- } else {
- $image_sizes = unserialize($image_sizes);
- }
- $form_body .= "<p>" . elgg_echo('tidypics:settings:largesize') . "<br />";
- $form_body .= 'width: <input style="width: 20%;" type="text" name="large_thumb_width" value=' . "\"{$image_sizes['large_image_width']}\"" . ' class="input-text" /> ';
- $form_body .= 'height: <input style="width: 20%;" type="text" name="large_thumb_height" value=' . "\"{$image_sizes['large_image_height']}\"" . ' class="input-text" /></p>';
- $form_body .= "<p>" . elgg_echo('tidypics:settings:smallsize') . "<br />";
- $form_body .= 'width: <input style="width: 20%;" type="text" name="small_thumb_width" value=' . "\"{$image_sizes['small_image_width']}\"" . ' class="input-text" /> ';
- $form_body .= 'height: <input style="width: 20%;" type="text" name="small_thumb_height" value=' . "\"{$image_sizes['small_image_height']}\"" . ' class="input-text" /></p>';
- $form_body .= "<p>" . elgg_echo('tidypics:settings:thumbsize') . "<br />";
- $form_body .= 'width: <input style="width: 20%;" type="text" name="thumb_width" value=' . "\"{$image_sizes['thumb_image_width']}\"" . ' class="input-text" /> ';
- $form_body .= 'height: <input style="width: 20%;" type="text" name="thumb_height" value=' . "\"{$image_sizes['thumb_image_height']}\"" . ' class="input-text" /></p>';
-
-
- // Group permission override
- $grp_perm_override = $plugin->grp_perm_override;
- if(!$grp_perm_override) $grp_perm_override = "enabled";
- $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:grp_perm_override') => 'enabled'), 'internalname' => 'grp_perm_override', 'value' => $grp_perm_override )) . "</p>";
-
- $form_body .= elgg_view('input/submit', array('value' => elgg_echo("save")));
-
+<?php + /** + * Tidypics admin settings form + */ + + + + $action = $vars['url'] . 'action/tidypics/settings'; + + $plugin = find_plugin_settings('tidypics'); + + + // bootstrap the plugin version here for now + if (!$plugin->version) { + set_plugin_setting('version', 1.62, 'tidypics'); + } + + if (extension_loaded('imagick')) + $img_lib_options['ImageMagickPHP'] = 'imagick PHP extension'; + + $disablefunc = explode(',', ini_get('disable_functions')); + if (is_callable('exec') && !in_array('exec',$disablefunc)) + $img_lib_options['ImageMagick'] = 'ImageMagick Cmdline'; + + $img_lib_options['GD'] = 'GD'; + + + // Image Library + $image_lib = $plugin->image_lib; + if (!$image_lib) $image_lib = 'GD'; + $form_body = '<p>' . elgg_echo('tidypics:settings:image_lib') . ': '; + $form_body .= elgg_view('input/pulldown', array( + 'internalname' => 'params[image_lib]', + 'options_values' => $img_lib_options, + 'value' => $image_lib + )); + $form_body .= '<br/>Note: If you want to select ImageMagick Command Line, first confirm that it is installed on your server.</p>'; + + if (is_callable('exec') && !in_array('exec',$disablefunc)) { + // Image Magick Path + $im_path = $plugin->im_path; + if(!$im_path) $im_path = "/usr/bin/"; + $form_body .= "<p>" . elgg_echo('tidypics:settings:im_path') . "<br />"; + $form_body .= elgg_view("input/text",array('internalname' => 'params[im_path]', 'value' => $im_path)) . "</p>"; + } + + // Tagging + $tagging = $plugin->tagging; + if(!$tagging) $tagging = "enabled"; + $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:tagging') => 'enabled'), 'internalname' => 'tagging', 'value' => $tagging )) . "</p>"; + + // Download Link + $download_link = $plugin->download_link; + if(!$download_link) $download_link = "enabled"; + $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:download_link') => 'enabled'), 'internalname' => 'download_link', 'value' => $download_link )) . "</p>"; + + // Ratings + $photo_ratings = $plugin->photo_ratings; + if(!$photo_ratings) $photo_ratings = "disabled"; + $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:photo_ratings') => 'enabled'), 'internalname' => 'photo_ratings', 'value' => $photo_ratings )) . "</p>"; + + // Show EXIF + $exif = $plugin->exif; + if(!$exif) $exif = "disabled"; + $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:exif') => 'enabled'), 'internalname' => 'exif', 'value' => $exif )) . "</p>"; + + // Show View count + $view_count = $plugin->view_count; + if(!$view_count) $view_count = "enabled"; + $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:view_count') => 'enabled'), 'internalname' => 'view_count', 'value' => $view_count )) . "</p>"; + + // Watermark Text + $form_body .= "<p>" . elgg_echo('tidypics:settings:watermark') . "<br />"; + $form_body .= elgg_view("input/text",array('internalname' => 'params[watermark_text]', 'value' => $plugin->watermark_text)) . "</p>"; + + // Max Image Size + $maxfilesize = $plugin->maxfilesize; + if (!$maxfilesize) $maxfilesize = (int)5; // 5 MB + $form_body .= "<p>" . elgg_echo('tidypics:settings:maxfilesize') . "<br />"; + $form_body .= elgg_view("input/text",array('internalname' => 'params[maxfilesize]', 'value' => $maxfilesize)) . "</p>"; + + // Quota Size + $quota = $plugin->quota; + if (!$quota) $quota = 0; + $form_body .= "<p>" . elgg_echo('tidypics:settings:quota') . "<br />"; + $form_body .= elgg_view("input/text",array('internalname' => 'params[quota]', 'value' => $quota)) . "</p>"; + + // River Image options + $img_river_view = $plugin->img_river_view; + if (!$img_river_view) $img_river_view = '1'; + $form_body .= '<p>' . elgg_echo('tidypics:settings:img_river_view'); + $form_body .= elgg_view('input/pulldown', array( + 'internalname' => 'params[img_river_view]', + 'options_values' => array( + 'all' => 'all', + '1' => '1', + 'none' => 'none', + ), + 'value' => $img_river_view + )); + $form_body .= '</p>'; + + // River Album options + $album_river_view = $plugin->album_river_view; + if (!$album_river_view) $album_river_view = 'set'; + $form_body .= '<p>' . elgg_echo('tidypics:settings:album_river_view'); + $form_body .= elgg_view('input/pulldown', array( + 'internalname' => 'params[album_river_view]', + 'options_values' => array( + 'cover' => 'cover', + 'set' => 'set', + ), + 'value' => $album_river_view + )); + $form_body .= '</p>'; + + // Thumbnail sizes + $image_sizes = $plugin->image_sizes; + if(!$image_sizes) { + $image_sizes = array(); // set default values + $image_sizes['large_image_width'] = $image_sizes['large_image_height'] = 600; + $image_sizes['small_image_width'] = $image_sizes['small_image_height'] = 153; + $image_sizes['thumb_image_width'] = $image_sizes['thumb_image_height'] = 60; + } else { + $image_sizes = unserialize($image_sizes); + } + $form_body .= "<p>" . elgg_echo('tidypics:settings:largesize') . "<br />"; + $form_body .= 'width: <input style="width: 20%;" type="text" name="large_thumb_width" value=' . "\"{$image_sizes['large_image_width']}\"" . ' class="input-text" /> '; + $form_body .= 'height: <input style="width: 20%;" type="text" name="large_thumb_height" value=' . "\"{$image_sizes['large_image_height']}\"" . ' class="input-text" /></p>'; + $form_body .= "<p>" . elgg_echo('tidypics:settings:smallsize') . "<br />"; + $form_body .= 'width: <input style="width: 20%;" type="text" name="small_thumb_width" value=' . "\"{$image_sizes['small_image_width']}\"" . ' class="input-text" /> '; + $form_body .= 'height: <input style="width: 20%;" type="text" name="small_thumb_height" value=' . "\"{$image_sizes['small_image_height']}\"" . ' class="input-text" /></p>'; + $form_body .= "<p>" . elgg_echo('tidypics:settings:thumbsize') . "<br />"; + $form_body .= 'width: <input style="width: 20%;" type="text" name="thumb_width" value=' . "\"{$image_sizes['thumb_image_width']}\"" . ' class="input-text" /> '; + $form_body .= 'height: <input style="width: 20%;" type="text" name="thumb_height" value=' . "\"{$image_sizes['thumb_image_height']}\"" . ' class="input-text" /></p>'; + + + // Group permission override + $grp_perm_override = $plugin->grp_perm_override; + if(!$grp_perm_override) $grp_perm_override = "enabled"; + $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:grp_perm_override') => 'enabled'), 'internalname' => 'grp_perm_override', 'value' => $grp_perm_override )) . "</p>"; + + $form_body .= elgg_view('input/submit', array('value' => elgg_echo("save"))); + echo elgg_view('input/form', array('action' => $action, 'body' => $form_body)); diff --git a/views/default/tidypics/gallery.php b/views/default/tidypics/gallery.php index 29c706bb1..dd7c1cdcf 100644 --- a/views/default/tidypics/gallery.php +++ b/views/default/tidypics/gallery.php @@ -1,64 +1,64 @@ -<?php
-/**
- * view a gallery of photos or albums
- *
- */
-
-$context = $vars['context'];
-$offset = $vars['offset'];
-$entities = $vars['entities'];
-$limit = $vars['limit'];
-$count = $vars['count'];
-$baseurl = $vars['baseurl'];
-$context = $vars['context'];
-$viewtype = $vars['viewtype'];
-$pagination = $vars['pagination'];
-$fullview = $vars['fullview'];
-
-$html = "";
-$nav = "";
-
-if (isset($vars['viewtypetoggle'])) {
- $viewtypetoggle = $vars['viewtypetoggle'];
-} else {
- $viewtypetoggle = true;
-}
-
-if ($context == "search" && $count > 0 && $viewtypetoggle) {
- $nav .= elgg_view('navigation/viewtype', array(
- 'baseurl' => $baseurl,
- 'offset' => $offset,
- 'count' => $count,
- 'viewtype' => $viewtype,
- ));
-}
-
-if ($pagination) {
- $nav .= elgg_view('navigation/pagination',array(
- 'baseurl' => $baseurl,
- 'offset' => $offset,
- 'count' => $count,
- 'limit' => $limit,
- ));
-}
-
-$html .= $nav;
-if ($viewtype == 'list') {
- if (is_array($entities) && sizeof($entities) > 0) {
- foreach($entities as $entity) {
- $html .= elgg_view_entity($entity, $fullview);
- }
- }
-} else {
- if (is_array($entities) && sizeof($entities) > 0) {
- $html .= elgg_view('entities/gallery', array('entities' => $entities));
- }
-}
-
-$html .= '<div class="clearfloat"></div>';
-
-if ($count) {
- $html .= $nav;
-}
-
+<?php +/** + * view a gallery of photos or albums + * + */ + +$context = $vars['context']; +$offset = $vars['offset']; +$entities = $vars['entities']; +$limit = $vars['limit']; +$count = $vars['count']; +$baseurl = $vars['baseurl']; +$context = $vars['context']; +$viewtype = $vars['viewtype']; +$pagination = $vars['pagination']; +$fullview = $vars['fullview']; + +$html = ""; +$nav = ""; + +if (isset($vars['viewtypetoggle'])) { + $viewtypetoggle = $vars['viewtypetoggle']; +} else { + $viewtypetoggle = true; +} + +if ($context == "search" && $count > 0 && $viewtypetoggle) { + $nav .= elgg_view('navigation/viewtype', array( + 'baseurl' => $baseurl, + 'offset' => $offset, + 'count' => $count, + 'viewtype' => $viewtype, + )); +} + +if ($pagination) { + $nav .= elgg_view('navigation/pagination',array( + 'baseurl' => $baseurl, + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + )); +} + +$html .= $nav; +if ($viewtype == 'list') { + if (is_array($entities) && sizeof($entities) > 0) { + foreach($entities as $entity) { + $html .= elgg_view_entity($entity, $fullview); + } + } +} else { + if (is_array($entities) && sizeof($entities) > 0) { + $html .= elgg_view('entities/gallery', array('entities' => $entities)); + } +} + +$html .= '<div class="clearfloat"></div>'; + +if ($count) { + $html .= $nav; +} + echo $html;
\ No newline at end of file diff --git a/views/default/tidypics/groupprofile_albums.php b/views/default/tidypics/groupprofile_albums.php index 7f28705c7..a7e143ae9 100644 --- a/views/default/tidypics/groupprofile_albums.php +++ b/views/default/tidypics/groupprofile_albums.php @@ -1,15 +1,15 @@ -<?php
-
-/***********************************************
- *
- * This is used on the group profile page
- *
- ***********************************************/
-
-if ($vars['entity']->photos_enable != 'no') {
- echo '<div id="tidypics_group_profile">';
- echo '<h2>' . elgg_echo('album:group') . '</h2>';
- echo elgg_view('tidypics/albums', array('num_albums' => 5));
- echo '</div>';
-}
+<?php + +/*********************************************** + * + * This is used on the group profile page + * + ***********************************************/ + +if ($vars['entity']->photos_enable != 'no') { + echo '<div id="tidypics_group_profile">'; + echo '<h2>' . elgg_echo('album:group') . '</h2>'; + echo elgg_view('tidypics/albums', array('num_albums' => 5)); + echo '</div>'; +} ?>
\ No newline at end of file diff --git a/views/default/tidypics/hover_menu.php b/views/default/tidypics/hover_menu.php index a36c4be17..240891f51 100644 --- a/views/default/tidypics/hover_menu.php +++ b/views/default/tidypics/hover_menu.php @@ -1,12 +1,12 @@ -<?php
-
- /**
- * Elgg hoverover extender for tidypics
- *
- */
-
-?>
-
- <p class="user_menu_file <?php if(get_context() == 'photos') echo 'profile_select';?>">
- <a href="<?php echo $vars['url']; ?>pg/photos/owned/<?php echo $vars['entity']->username; ?>"><?php echo elgg_echo("albums"); ?></a>
+<?php + + /** + * Elgg hoverover extender for tidypics + * + */ + +?> + + <p class="user_menu_file <?php if(get_context() == 'photos') echo 'profile_select';?>"> + <a href="<?php echo $vars['url']; ?>pg/photos/owned/<?php echo $vars['entity']->username; ?>"><?php echo elgg_echo("albums"); ?></a> </p>
\ No newline at end of file diff --git a/views/default/tidypics/image_menu.php b/views/default/tidypics/image_menu.php index 9e7a53969..983f900b4 100644 --- a/views/default/tidypics/image_menu.php +++ b/views/default/tidypics/image_menu.php @@ -1,51 +1,51 @@ -<?php
-
- /**************************************************************************
- *
- * Tidypics Image Menu
- *
- * This is the menu that appears below an image. Admins can override the
- * menu with a different view to provide a look and feel that matches
- * their themes. The view can be extended to provide additional controls.
- *
- **************************************************************************/
-
- $image_guid = $vars['image_guid'];
- $viewer = $vars['viewer'];
- $owner = $vars['owner'];
- $anytags = $vars['anytags'];
- $album = $vars['album'];
-
- if (get_plugin_setting('tagging', 'tidypics') != "disabled") {
-
- $can_tag = false;
-
- $container = get_entity($album->container_guid);
- if ($container instanceof ElggGroup) {
- $can_tag = $viewer && $container->isMember($viewer);
- } else {
- $can_tag = $viewer && $viewer->guid == $owner->guid || user_is_friend($owner->guid, $viewer->guid);
- }
-
- // only owner and friends of owner can tag
- if ($can_tag) {
-?>
-<li id="start_tagging"><a id="tidypics_tag_control" href="javascript:void(0)" onclick="startTagging()"><?php echo 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()"><?php elgg_echo('tidypics:deletetag'); ?></a></li>
-<?php
- }
- }
-
- if (get_plugin_setting('download_link', 'tidypics') != "disabled") {
- $download_url = $vars['url'] . "pg/photos/download/{$image_guid}/";
-?>
-<li id="download_image"><a href="<?php echo $download_url; ?>"><?php echo elgg_echo("image:download"); ?></a></li>
-<?php
- }
+<?php + + /************************************************************************** + * + * Tidypics Image Menu + * + * This is the menu that appears below an image. Admins can override the + * menu with a different view to provide a look and feel that matches + * their themes. The view can be extended to provide additional controls. + * + **************************************************************************/ + + $image_guid = $vars['image_guid']; + $viewer = $vars['viewer']; + $owner = $vars['owner']; + $anytags = $vars['anytags']; + $album = $vars['album']; + + if (get_plugin_setting('tagging', 'tidypics') != "disabled") { + + $can_tag = false; + + $container = get_entity($album->container_guid); + if ($container instanceof ElggGroup) { + $can_tag = $viewer && $container->isMember($viewer); + } else { + $can_tag = $viewer && $viewer->guid == $owner->guid || user_is_friend($owner->guid, $viewer->guid); + } + + // only owner and friends of owner can tag + if ($can_tag) { +?> +<li id="start_tagging"><a id="tidypics_tag_control" href="javascript:void(0)" onclick="startTagging()"><?php echo 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()"><?php elgg_echo('tidypics:deletetag'); ?></a></li> +<?php + } + } + + if (get_plugin_setting('download_link', 'tidypics') != "disabled") { + $download_url = $vars['url'] . "pg/photos/download/{$image_guid}/"; +?> +<li id="download_image"><a href="<?php echo $download_url; ?>"><?php echo elgg_echo("image:download"); ?></a></li> +<?php + } ?>
\ No newline at end of file diff --git a/views/default/tidypics/tagging.php b/views/default/tidypics/tagging.php index 9ebec7c1e..ae3fa2b27 100644 --- a/views/default/tidypics/tagging.php +++ b/views/default/tidypics/tagging.php @@ -1,87 +1,87 @@ -<?php
-
- $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 ($tag_info) {
-?>
-<div id="tidypics_phototags_list">
- <h3><?php echo elgg_echo('tidypics:inthisphoto') ?></h3>
- <ul>
-<?php
- 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>
-</div>
-<?php
- }
-?>
-<div id='tidypics_tag_instructions'>
- <div id='tidypics_tag_instruct_text'><?php echo elgg_echo('tidypics:taginstruct'); ?></div>
- <div id='tidypics_tag_instruct_button_div'><button class='submit_button' id='tidypics_tag_instruct_button' onclick='stopTagging()'><?php echo elgg_echo('tidypics:finish_tagging'); ?></button></div>
-</div>
-<div id="tidypics_tag_menu" class="tidypics_popup">
- <div class='tidypics_popup_header'><h3><?php echo elgg_echo('tidypics:tagthisphoto'); ?></h3></div>
-<?php
-
- if ($viewer) {
-
- $people_list = tp_get_tag_list($viewer);
-
- $content = "<div id='tidypics_tagmenu_left'>";
- $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='' />";
-
- $content .= "<ul id='tidypics_phototag_list'>";
- $content .= "<li><a href='javascript:void(0)' onclick='selectUser({$viewer->getGUID()},\"{$viewer->name}\")'> {$viewer->name} (" . elgg_echo('me') . ")</a></li>";
-
- if ($people_list) {
- foreach($people_list as $friend_guid => $friend_name) {
- $content .= "<li><a href='javascript:void(0)' onclick='selectUser({$friend_guid}, \"{$friend_name}\")'>{$friend_name}</a></li>";
- }
- }
-
- $content .= "</ul></div>";
-
- $content .= "<div id='tidypics_tagmenu_right'><input type='submit' value='" . elgg_echo('tidypics:actiontag') . "' class='submit_button' /></div>";
-
- echo elgg_view('input/form', array('internalid' => 'quicksearch', 'internalname' => 'tidypics_phototag_form', 'class' => 'quicksearch', 'action' => "{$vars['url']}action/tidypics/addtag", 'method' => 'post', 'body' => $content));
- }
-
-?>
-<div class="clearfloat"></div>
-</div>
-<div id="tidypics_delete_tag_menu" class="tidypics_popup">
-<div class='tidypics_popup_header'><h3><?php echo elgg_echo('tidypics:deltag_title'); ?></h3></div>
-<?php
- if ($tag_info) {
- $content = "<input type='hidden' name='image_guid' value='{$image->guid}' />";
- foreach ($tag_info['links'] as $id => $link) {
- $text = htmlentities($link['text'], ENT_QUOTES, 'UTF-8');
- $content .= "<label><input type=\"checkbox\" class=\"input-checkboxes\" name=\"tags[{$id}]\" value=\"{$text}\" />{$text}</label><br />";
- }
-
- $content .= "<input type='submit' value='" . elgg_echo('tidypics:actiondelete') . "' class='submit_button' />";
- $content .= "<input type='button' value='" . elgg_echo('cancel') . "' class='cancel_button' onclick='hideDeleteMenu();' />";
-
- echo elgg_view('input/form', array('internalname' => 'phototag_deletetag_form', 'action' => "{$vars['url']}action/tidypics/deletetag", 'method' => 'post', 'body' => $content));
-
- }
- echo '</div>'; // tidypics_delete_tag_menu
-
- echo elgg_view('js/tagging', array('photo_tags_json' => $photo_tags_json,) );
+<?php + + $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 ($tag_info) { +?> +<div id="tidypics_phototags_list"> + <h3><?php echo elgg_echo('tidypics:inthisphoto') ?></h3> + <ul> +<?php + 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> +</div> +<?php + } +?> +<div id='tidypics_tag_instructions'> + <div id='tidypics_tag_instruct_text'><?php echo elgg_echo('tidypics:taginstruct'); ?></div> + <div id='tidypics_tag_instruct_button_div'><button class='submit_button' id='tidypics_tag_instruct_button' onclick='stopTagging()'><?php echo elgg_echo('tidypics:finish_tagging'); ?></button></div> +</div> +<div id="tidypics_tag_menu" class="tidypics_popup"> + <div class='tidypics_popup_header'><h3><?php echo elgg_echo('tidypics:tagthisphoto'); ?></h3></div> +<?php + + if ($viewer) { + + $people_list = tp_get_tag_list($viewer); + + $content = "<div id='tidypics_tagmenu_left'>"; + $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='' />"; + + $content .= "<ul id='tidypics_phototag_list'>"; + $content .= "<li><a href='javascript:void(0)' onclick='selectUser({$viewer->getGUID()},\"{$viewer->name}\")'> {$viewer->name} (" . elgg_echo('me') . ")</a></li>"; + + if ($people_list) { + foreach($people_list as $friend_guid => $friend_name) { + $content .= "<li><a href='javascript:void(0)' onclick='selectUser({$friend_guid}, \"{$friend_name}\")'>{$friend_name}</a></li>"; + } + } + + $content .= "</ul></div>"; + + $content .= "<div id='tidypics_tagmenu_right'><input type='submit' value='" . elgg_echo('tidypics:actiontag') . "' class='submit_button' /></div>"; + + echo elgg_view('input/form', array('internalid' => 'quicksearch', 'internalname' => 'tidypics_phototag_form', 'class' => 'quicksearch', 'action' => "{$vars['url']}action/tidypics/addtag", 'method' => 'post', 'body' => $content)); + } + +?> +<div class="clearfloat"></div> +</div> +<div id="tidypics_delete_tag_menu" class="tidypics_popup"> +<div class='tidypics_popup_header'><h3><?php echo elgg_echo('tidypics:deltag_title'); ?></h3></div> +<?php + if ($tag_info) { + $content = "<input type='hidden' name='image_guid' value='{$image->guid}' />"; + foreach ($tag_info['links'] as $id => $link) { + $text = htmlentities($link['text'], ENT_QUOTES, 'UTF-8'); + $content .= "<label><input type=\"checkbox\" class=\"input-checkboxes\" name=\"tags[{$id}]\" value=\"{$text}\" />{$text}</label><br />"; + } + + $content .= "<input type='submit' value='" . elgg_echo('tidypics:actiondelete') . "' class='submit_button' />"; + $content .= "<input type='button' value='" . elgg_echo('cancel') . "' class='cancel_button' onclick='hideDeleteMenu();' />"; + + echo elgg_view('input/form', array('internalname' => 'phototag_deletetag_form', 'action' => "{$vars['url']}action/tidypics/deletetag", 'method' => 'post', 'body' => $content)); + + } + echo '</div>'; // tidypics_delete_tag_menu + + echo elgg_view('js/tagging', array('photo_tags_json' => $photo_tags_json,) ); ?>
\ No newline at end of file diff --git a/views/default/widgets/album_view/edit.php b/views/default/widgets/album_view/edit.php index 1fea6764a..992699cb0 100644 --- a/views/default/widgets/album_view/edit.php +++ b/views/default/widgets/album_view/edit.php @@ -1,24 +1,24 @@ -<p>
-<?php
-
- echo elgg_echo("tidypics:widget:num_albums") . ": ";
-
-
- if($vars['entity']->num_display == '') $vars['entity']->num_display = 5;
-
-?>
- <select name="params[num_display]">
- <option value="1" <?php if($vars['entity']->num_display == 1) echo "SELECTED"; ?>>1</option>
- <option value="2" <?php if($vars['entity']->num_display == 2) echo "SELECTED"; ?>>2</option>
- <option value="3" <?php if($vars['entity']->num_display == 3) echo "SELECTED"; ?>>3</option>
- <option value="4" <?php if($vars['entity']->num_display == 4) echo "SELECTED"; ?>>4</option>
- <option value="5" <?php if($vars['entity']->num_display == 5) echo "SELECTED"; ?>>5</option>
- <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option>
- <option value="7" <?php if($vars['entity']->num_display == 7) echo "SELECTED"; ?>>7</option>
- <option value="8" <?php if($vars['entity']->num_display == 8) echo "SELECTED"; ?>>8</option>
- <option value="9" <?php if($vars['entity']->num_display == 9) echo "SELECTED"; ?>>9</option>
- <option value="10" <?php if($vars['entity']->num_display == 10) echo "SELECTED"; ?>>10</option>
- <option value="15" <?php if($vars['entity']->num_display == 15) echo "SELECTED"; ?>>15</option>
- <option value="20" <?php if($vars['entity']->num_display == 20) echo "SELECTED"; ?>>20</option>
- </select>
+<p> +<?php + + echo elgg_echo("tidypics:widget:num_albums") . ": "; + + + if($vars['entity']->num_display == '') $vars['entity']->num_display = 5; + +?> + <select name="params[num_display]"> + <option value="1" <?php if($vars['entity']->num_display == 1) echo "SELECTED"; ?>>1</option> + <option value="2" <?php if($vars['entity']->num_display == 2) echo "SELECTED"; ?>>2</option> + <option value="3" <?php if($vars['entity']->num_display == 3) echo "SELECTED"; ?>>3</option> + <option value="4" <?php if($vars['entity']->num_display == 4) echo "SELECTED"; ?>>4</option> + <option value="5" <?php if($vars['entity']->num_display == 5) echo "SELECTED"; ?>>5</option> + <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option> + <option value="7" <?php if($vars['entity']->num_display == 7) echo "SELECTED"; ?>>7</option> + <option value="8" <?php if($vars['entity']->num_display == 8) echo "SELECTED"; ?>>8</option> + <option value="9" <?php if($vars['entity']->num_display == 9) echo "SELECTED"; ?>>9</option> + <option value="10" <?php if($vars['entity']->num_display == 10) echo "SELECTED"; ?>>10</option> + <option value="15" <?php if($vars['entity']->num_display == 15) echo "SELECTED"; ?>>15</option> + <option value="20" <?php if($vars['entity']->num_display == 20) echo "SELECTED"; ?>>20</option> + </select> </p>
\ No newline at end of file diff --git a/views/default/widgets/latest_photos/edit.php b/views/default/widgets/latest_photos/edit.php index 15a56af82..3b334d722 100644 --- a/views/default/widgets/latest_photos/edit.php +++ b/views/default/widgets/latest_photos/edit.php @@ -1,15 +1,15 @@ -<p>
-<?php
- echo elgg_echo("tidypics:widget:num_latest") . ": ";
-
- if($vars['entity']->num_display == '') $vars['entity']->num_display = 6;
-
-?>
- <select name="params[num_display]">
- <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option>
- <option value="9" <?php if($vars['entity']->num_display == 9) echo "SELECTED"; ?>>9</option>
- <option value="12" <?php if($vars['entity']->num_display == 12) echo "SELECTED"; ?>>12</option>
- <option value="15" <?php if($vars['entity']->num_display == 15) echo "SELECTED"; ?>>15</option>
- <option value="18" <?php if($vars['entity']->num_display == 18) echo "SELECTED"; ?>>18</option>
- </select>
+<p> +<?php + echo elgg_echo("tidypics:widget:num_latest") . ": "; + + if($vars['entity']->num_display == '') $vars['entity']->num_display = 6; + +?> + <select name="params[num_display]"> + <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option> + <option value="9" <?php if($vars['entity']->num_display == 9) echo "SELECTED"; ?>>9</option> + <option value="12" <?php if($vars['entity']->num_display == 12) echo "SELECTED"; ?>>12</option> + <option value="15" <?php if($vars['entity']->num_display == 15) echo "SELECTED"; ?>>15</option> + <option value="18" <?php if($vars['entity']->num_display == 18) echo "SELECTED"; ?>>18</option> + </select> </p>
\ No newline at end of file |