From 9b814dd2124a8c71dec3a8d510d288f040b03b9e Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 20 Nov 2011 18:41:34 -0500 Subject: working on settings --- views/default/forms/photos/admin/settings.php | 80 ++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 7 deletions(-) (limited to 'views/default/forms') 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 '
'; +$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 '
'; + +// Thumbnail sizes +echo '
'; +echo '

' . elgg_echo('tidypics:settings:heading:sizes') . '

'; +echo "
You must edit the css if you change the default sizes
"; +$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:    '; +$form_body .= 'height:

'; + +$form_body .= "

" . elgg_echo('tidypics:settings:smallsize') . "
"; +$form_body .= 'width and height:    '; +//$form_body .= 'height:

'; + +$form_body .= "

" . elgg_echo('tidypics:settings:thumbsize') . "
"; +$form_body .= 'width and height:    '; +//$form_body .= 'height:

'; +echo '
'; + +echo elgg_view('input/submit', array('value' => elgg_echo("save"))); + +return true; // Main settings -$form_body = '

' . elgg_echo('tidypics:settings:heading:main') . '

'; +echo '

' . elgg_echo('tidypics:settings:heading:main') . '

'; // Tagging -$tagging = $plugin->tagging; -if (!$tagging) { - $tagging = "enabled"; -} -$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:tagging') => 'enabled'), 'internalname' => 'tagging', 'value' => $tagging )) . "

"; +$tagging = $plugin->tagging ? $plugin->tagging : 'enabled'; +echo '
'; +echo elgg_view("input/checkboxes", array( + 'name' => 'tagging', + 'value' => $tagging, + 'options' => array( + elgg_echo('tidypics:settings:tagging') => 'enabled' + ), +)); +echo "
"; // Download Link $download_link = $plugin->download_link; -- cgit v1.2.3