From 65548983c054a48fe0adb94c327847a7101db390 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 13:13:46 -0400 Subject: admin settings form divided into subviews --- views/default/admin/settings/photos/settings.php | 6 +- views/default/forms/photos/admin/settings.php | 107 +++------------------ .../forms/photos/admin/settings/activity.php | 31 ++++++ .../forms/photos/admin/settings/image_lib.php | 20 ++++ views/default/forms/photos/admin/settings/main.php | 28 ++++++ .../forms/photos/admin/settings/thumbnails.php | 33 +++++++ 6 files changed, 126 insertions(+), 99 deletions(-) create mode 100644 views/default/forms/photos/admin/settings/activity.php create mode 100644 views/default/forms/photos/admin/settings/image_lib.php create mode 100644 views/default/forms/photos/admin/settings/main.php create mode 100644 views/default/forms/photos/admin/settings/thumbnails.php (limited to 'views') diff --git a/views/default/admin/settings/photos/settings.php b/views/default/admin/settings/photos/settings.php index 3645e749a..6ea444392 100644 --- a/views/default/admin/settings/photos/settings.php +++ b/views/default/admin/settings/photos/settings.php @@ -1,6 +1,6 @@ '; } -echo elgg_view('output/longtext', array('value' => elgg_echo('tidypics:admin:instructions'))); - -echo elgg_view_form('photos/admin/settings'); \ No newline at end of file +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 16d5eb0ce..2b6399a67 100644 --- a/views/default/forms/photos/admin/settings.php +++ b/views/default/forms/photos/admin/settings.php @@ -7,104 +7,21 @@ $plugin = elgg_get_plugin_from_id('tidypics'); -// main settings -$checkboxes = array('tagging', 'view_count', 'uploader', 'exif', 'download_link'); -foreach ($checkboxes as $checkbox) { - echo '
'; - $checked = $plugin->$checkbox ? 'checked' : false; - echo elgg_view('input/checkbox', array( - 'name' => "params[$checkbox]", - 'value' => true, - 'checked' => (bool)$plugin->$checkbox, - )); - echo ' ' . elgg_echo("tidypics:settings:$checkbox"); - echo '
'; -} - -// max image size -echo '
'; -echo elgg_echo('tidypics:settings:maxfilesize'); -echo elgg_view('input/text', array( - 'name' => 'params[maxfilesize]', - 'value' => $plugin->maxfilesize, -)); -echo '
'; - -// image library -echo '

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

'; -echo'
'; -echo elgg_echo('tidypics:settings:image_lib') . ': '; -echo elgg_view('input/dropdown', array( - 'name' => 'params[image_lib]', - 'options_values' => tidypics_get_image_libraries(), - 'value' => $plugin->image_lib, -)); -echo '
'; -echo '
'; -echo elgg_echo('tidypics:settings:im_path') . ' '; -echo elgg_view("input/text", array('name' => 'params[im_path]', 'value' => $plugin->im_path)); -echo '
'; - +$title = elgg_echo('tidypics:settings:main'); +$content = elgg_view('forms/photos/admin/settings/main', array('plugin' => $plugin)); +echo elgg_view_module('inline', $title, $content); -// river integration -echo '

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

'; -echo '
'; -echo elgg_echo('tidypics:settings:img_river_view') . ': '; -echo elgg_view('input/dropdown', array( - 'name' => 'params[img_river_view]', - 'options_values' => array( - 'all' => elgg_echo('tidypics:option:all'), - 'batch' => '1', - 'none' => elgg_echo('tidypics:option:none'), - ), - 'value' => $plugin->img_river_view, -)); -echo '
'; -echo '
'; -echo elgg_echo('tidypics:settings:album_river_view') . ': '; -echo elgg_view('input/dropdown', array( - 'name' => 'params[album_river_view]', - 'options_values' => array( - 'cover' => elgg_echo('tidypics:option:cover'), - 'set' => elgg_echo('tidypics:option:set'), - ), - 'value' => $plugin->album_river_view, -)); -echo '
'; - - -// thumbnail sizes -echo '
'; -echo '

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

'; -echo '
' . elgg_echo('tidypics:settings:sizes:instructs') . '
'; -$image_sizes = unserialize($plugin->image_sizes); -echo ''; -$sizes = array('large', 'small', 'tiny'); -foreach ($sizes as $size) { - echo ''; - echo ''; - echo ''; -} -echo '
'; - echo elgg_echo("tidypics:settings:{$size}size"); - echo ''; - echo 'width: '; - echo elgg_view('input/text', array( - 'name' => "{$size}_image_width", - 'value' => $image_sizes["{$size}_image_width"], - 'class' => 'tidypics-input-thin', - )); - echo ''; - echo 'height: '; - echo elgg_view('input/text', array( - 'name' => "{$size}_image_height", - 'value' => $image_sizes["{$size}_image_height"], - 'class' => 'tidypics-input-thin', - )); - echo '
'; -echo '
'; +$title = elgg_echo('tidypics:settings:heading:img_lib'); +$content = elgg_view('forms/photos/admin/settings/image_lib', array('plugin' => $plugin)); +echo elgg_view_module('inline', $title, $content); +$title = elgg_echo('tidypics:settings:heading:river'); +$content = elgg_view('forms/photos/admin/settings/activity', array('plugin' => $plugin)); +echo elgg_view_module('inline', $title, $content); +$title = elgg_echo('tidypics:settings:heading:sizes'); +$content = elgg_view('forms/photos/admin/settings/thumbnails', array('plugin' => $plugin)); +echo elgg_view_module('inline', $title, $content); echo elgg_view('input/submit', array('value' => elgg_echo("save"))); diff --git a/views/default/forms/photos/admin/settings/activity.php b/views/default/forms/photos/admin/settings/activity.php new file mode 100644 index 000000000..d62901af6 --- /dev/null +++ b/views/default/forms/photos/admin/settings/activity.php @@ -0,0 +1,31 @@ +'; +echo elgg_echo('tidypics:settings:img_river_view') . ': '; +echo elgg_view('input/dropdown', array( + 'name' => 'params[img_river_view]', + 'options_values' => array( + 'all' => elgg_echo('tidypics:option:all'), + 'batch' => '1', + 'none' => elgg_echo('tidypics:option:none'), + ), + 'value' => $plugin->img_river_view, +)); +echo ''; +echo '
'; +echo elgg_echo('tidypics:settings:album_river_view') . ': '; +echo elgg_view('input/dropdown', array( + 'name' => 'params[album_river_view]', + 'options_values' => array( + 'cover' => elgg_echo('tidypics:option:cover'), + 'set' => elgg_echo('tidypics:option:set'), + ), + 'value' => $plugin->album_river_view, +)); +echo '
'; + diff --git a/views/default/forms/photos/admin/settings/image_lib.php b/views/default/forms/photos/admin/settings/image_lib.php new file mode 100644 index 000000000..4e3f7f2a0 --- /dev/null +++ b/views/default/forms/photos/admin/settings/image_lib.php @@ -0,0 +1,20 @@ +'; +echo elgg_echo('tidypics:settings:image_lib') . ': '; +echo elgg_view('input/dropdown', array( + 'name' => 'params[image_lib]', + 'options_values' => tidypics_get_image_libraries(), + 'value' => $plugin->image_lib, +)); +echo ''; +echo '
'; +echo elgg_echo('tidypics:settings:im_path') . ' '; +echo elgg_view("input/text", array('name' => 'params[im_path]', 'value' => $plugin->im_path)); +echo '
'; + diff --git a/views/default/forms/photos/admin/settings/main.php b/views/default/forms/photos/admin/settings/main.php new file mode 100644 index 000000000..349c951f9 --- /dev/null +++ b/views/default/forms/photos/admin/settings/main.php @@ -0,0 +1,28 @@ +'; + $checked = $plugin->$checkbox ? 'checked' : false; + echo elgg_view('input/checkbox', array( + 'name' => "params[$checkbox]", + 'value' => true, + 'checked' => (bool)$plugin->$checkbox, + )); + echo ' ' . elgg_echo("tidypics:settings:$checkbox"); + echo ''; +} + +// max image size +echo '
'; +echo elgg_echo('tidypics:settings:maxfilesize'); +echo elgg_view('input/text', array( + 'name' => 'params[maxfilesize]', + 'value' => $plugin->maxfilesize, +)); +echo '
'; diff --git a/views/default/forms/photos/admin/settings/thumbnails.php b/views/default/forms/photos/admin/settings/thumbnails.php new file mode 100644 index 000000000..ec7a6d1b2 --- /dev/null +++ b/views/default/forms/photos/admin/settings/thumbnails.php @@ -0,0 +1,33 @@ +' . elgg_echo('tidypics:settings:sizes:instructs') . ''; +$image_sizes = unserialize($plugin->image_sizes); +echo ''; +$sizes = array('large', 'small', 'tiny'); +foreach ($sizes as $size) { + echo ''; + echo ''; + echo ''; +} +echo '
'; + echo elgg_echo("tidypics:settings:{$size}size"); + echo ''; + echo 'width: '; + echo elgg_view('input/text', array( + 'name' => "{$size}_image_width", + 'value' => $image_sizes["{$size}_image_width"], + 'class' => 'tidypics-input-thin', + )); + echo ''; + echo 'height: '; + echo elgg_view('input/text', array( + 'name' => "{$size}_image_height", + 'value' => $image_sizes["{$size}_image_height"], + 'class' => 'tidypics-input-thin', + )); + echo '
'; -- cgit v1.2.3