diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/default/admin/settings/tidypics.php | 11 | ||||
-rw-r--r-- | views/default/forms/photos/admin/settings.php | 80 | ||||
-rw-r--r-- | views/default/object/album/full.php | 10 | ||||
-rw-r--r-- | views/default/object/image/full.php | 66 |
4 files changed, 157 insertions, 10 deletions
diff --git a/views/default/admin/settings/tidypics.php b/views/default/admin/settings/tidypics.php new file mode 100644 index 000000000..aaaebd371 --- /dev/null +++ b/views/default/admin/settings/tidypics.php @@ -0,0 +1,11 @@ +<?php +/** + * Admin page + * + * @author Cash Costello + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 + */ + +echo elgg_view('output/longtext', array('value' => elgg_echo('tidypics:admin:instructions'))); + +echo elgg_view_form('photos/admin/settings'); diff --git a/views/default/forms/photos/admin/settings.php b/views/default/forms/photos/admin/settings.php index 06b3f4cb9..ea1e12de8 100644 --- a/views/default/forms/photos/admin/settings.php +++ b/views/default/forms/photos/admin/settings.php @@ -3,18 +3,84 @@ * Tidypics admin settings form body */ -$plugin = find_plugin_settings('tidypics'); +$plugin = elgg_get_plugin_from_id('tidypics'); + +echo '<div>'; +$checked = $plugin->tagging ? 'checked' : false; +echo elgg_view('input/checkbox', array( + 'name' => 'params[tagging]', + 'value' => true, + 'checked' => (bool)$plugin->tagging, +)); +echo ' ' . elgg_echo('tidypics:settings:tagging'); +echo '</div>'; + +// Thumbnail sizes +echo '<div>'; +echo '<h3>' . elgg_echo('tidypics:settings:heading:sizes') . '</h3>'; +echo "<h6>You must edit the css if you change the default sizes</h6>"; +$image_sizes = unserialize($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); +} + * + */ + +$sizes = array('large', 'small', 'tiny'); +foreach ($sizes as $size) { + echo elgg_echo("tidypics:settings:{$size}size"); + echo ' width: '; + echo elgg_view('input/text', array( + 'name' => "{$size}_thumb_width", + 'value' => $image_sizes["{$size}_image_width"], + 'style' => 'width: 150px;' + )); + echo ' height: '; + echo elgg_view('input/text', array( + 'name' => "{$size}_thumb_height", + 'value' => $image_sizes["{$size}_image_height"], + 'style' => 'width: 150px;' + )); +} + +$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 and height: <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 and height: <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>'; +echo '</div>'; + +echo elgg_view('input/submit', array('value' => elgg_echo("save"))); + +return true; // Main settings -$form_body = '<h3>' . elgg_echo('tidypics:settings:heading:main') . '</h3>'; +echo '<h3>' . elgg_echo('tidypics:settings:heading:main') . '</h3>'; // 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>"; +$tagging = $plugin->tagging ? $plugin->tagging : 'enabled'; +echo '<div>'; +echo elgg_view("input/checkboxes", array( + 'name' => 'tagging', + 'value' => $tagging, + 'options' => array( + elgg_echo('tidypics:settings:tagging') => 'enabled' + ), +)); +echo "</div>"; // Download Link $download_link = $plugin->download_link; diff --git a/views/default/object/album/full.php b/views/default/object/album/full.php index 4d2d8c88b..e350d2327 100644 --- a/views/default/object/album/full.php +++ b/views/default/object/album/full.php @@ -41,9 +41,13 @@ $params = array( $params = $params + $vars; $summary = elgg_view('object/elements/summary', $params); -$body = elgg_view('output/longtext', array( - 'value' => $album->description, -)); +$body = ''; +if ($album->description) { + $body = elgg_view('output/longtext', array( + 'value' => $album->description, + 'class' => 'mbm', + )); +} $body .= elgg_list_entities(array( 'type' => 'object', 'subtype' => 'image', diff --git a/views/default/object/image/full.php b/views/default/object/image/full.php index a4abe2daf..d08c03f9c 100644 --- a/views/default/object/image/full.php +++ b/views/default/object/image/full.php @@ -1,2 +1,68 @@ <?php +/** + * Full view of an image + * + * @uses $vars['entity'] TidypicsImage + * + * @author Cash Costello + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 + */ +$image = $photo = $vars['entity']; + +$img = elgg_view('output/img', array( + 'src' => $image->getSrcURL('large'), + 'alt' => $image->getTitle(), + 'class' => 'elgg-photo', +)); + +$content = elgg_view('output/url', array( + 'text' => $img, + 'href' => $image->getURL(), +)); + +$owner_link = elgg_view('output/url', array( + 'href' => "photos/owner/" . $photo->getOwnerEntity()->username, + 'text' => $photo->getOwnerEntity()->name, +)); +$author_text = elgg_echo('byline', array($owner_link)); + +$owner_icon = elgg_view_entity_icon($photo->getOwnerEntity(), 'tiny'); + +$metadata = elgg_view_menu('entity', array( + 'entity' => $vars['entity'], + 'handler' => 'photos', + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', +)); + +$subtitle = "$author_text $date $categories $comments_link"; + +$params = array( + 'entity' => $photo, + 'title' => false, + 'metadata' => $metadata, + 'subtitle' => $subtitle, + 'tags' => $tags, +); +$list_body = elgg_view('object/elements/summary', $params); + +$params = array('class' => 'mbl'); +$summary = elgg_view_image_block($owner_icon, $list_body, $params); + +echo $summary; + +if ($photo->description) { + echo elgg_view('output/longtext', array( + 'value' => $photo->description, + 'class' => 'mbl', + )); +} + +echo '<div class="tidypics-wrapper-photo">'; +echo elgg_view('tidypics/tagging/help'); +echo elgg_view('tidypics/tagging/select', array('photo' => $photo)); +echo $content; +echo '</div>'; + + echo elgg_view_comments($photo);
\ No newline at end of file |