aboutsummaryrefslogtreecommitdiff
path: root/views/default/forms/photos/admin
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-07-14 13:13:46 -0400
committerCash Costello <cash.costello@gmail.com>2012-07-14 13:13:46 -0400
commit65548983c054a48fe0adb94c327847a7101db390 (patch)
treea07a448fc4b67279d3a60993f06a586e3717ad9f /views/default/forms/photos/admin
parentf7f38da31ca53c25775d1a28668a1dd9aefd5277 (diff)
downloadelgg-65548983c054a48fe0adb94c327847a7101db390.tar.gz
elgg-65548983c054a48fe0adb94c327847a7101db390.tar.bz2
admin settings form divided into subviews
Diffstat (limited to 'views/default/forms/photos/admin')
-rw-r--r--views/default/forms/photos/admin/settings.php107
-rw-r--r--views/default/forms/photos/admin/settings/activity.php31
-rw-r--r--views/default/forms/photos/admin/settings/image_lib.php20
-rw-r--r--views/default/forms/photos/admin/settings/main.php28
-rw-r--r--views/default/forms/photos/admin/settings/thumbnails.php33
5 files changed, 124 insertions, 95 deletions
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 '<div>';
- $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 '</div>';
-}
-
-// max image size
-echo '<div>';
-echo elgg_echo('tidypics:settings:maxfilesize');
-echo elgg_view('input/text', array(
- 'name' => 'params[maxfilesize]',
- 'value' => $plugin->maxfilesize,
-));
-echo '</div>';
-
-// image library
-echo '<h3>' . elgg_echo('tidypics:settings:heading:img_lib') . '</h3>';
-echo'<div>';
-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 '</div>';
-echo '<div>';
-echo elgg_echo('tidypics:settings:im_path') . ' ';
-echo elgg_view("input/text", array('name' => 'params[im_path]', 'value' => $plugin->im_path));
-echo '</div>';
-
+$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 '<h3>' . elgg_echo('tidypics:settings:heading:river') . '</h3>';
-echo '<div>';
-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 '</div>';
-echo '<div>';
-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 '</div>';
-
-
-// thumbnail sizes
-echo '<div>';
-echo '<h3>' . elgg_echo('tidypics:settings:heading:sizes') . '</h3>';
-echo '<h6>' . elgg_echo('tidypics:settings:sizes:instructs') . '</h6>';
-$image_sizes = unserialize($plugin->image_sizes);
-echo '<table>';
-$sizes = array('large', 'small', 'tiny');
-foreach ($sizes as $size) {
- echo '<tr>';
- echo '<td class="pas">';
- echo elgg_echo("tidypics:settings:{$size}size");
- echo '</td><td class="pas">';
- echo 'width: ';
- echo elgg_view('input/text', array(
- 'name' => "{$size}_image_width",
- 'value' => $image_sizes["{$size}_image_width"],
- 'class' => 'tidypics-input-thin',
- ));
- echo '</td><td class="pas">';
- echo 'height: ';
- echo elgg_view('input/text', array(
- 'name' => "{$size}_image_height",
- 'value' => $image_sizes["{$size}_image_height"],
- 'class' => 'tidypics-input-thin',
- ));
- echo '</td>';
- echo '</tr>';
-}
-echo '</table>';
-echo '</div>';
+$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 @@
+<?php
+/**
+ * River integration
+ */
+
+$plugin = $vars['plugin'];
+
+echo '<div>';
+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 '</div>';
+echo '<div>';
+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 '</div>';
+
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 @@
+<?php
+/**
+ * Image library settings
+ */
+
+$plugin = $vars['plugin'];
+
+echo'<div>';
+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 '</div>';
+echo '<div>';
+echo elgg_echo('tidypics:settings:im_path') . ' ';
+echo elgg_view("input/text", array('name' => 'params[im_path]', 'value' => $plugin->im_path));
+echo '</div>';
+
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 @@
+<?php
+/**
+ * Primary settings for Elgg
+ */
+
+$plugin = $vars['plugin'];
+
+$checkboxes = array('tagging', 'view_count', 'uploader', 'exif', 'download_link');
+foreach ($checkboxes as $checkbox) {
+ echo '<div>';
+ $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 '</div>';
+}
+
+// max image size
+echo '<div>';
+echo elgg_echo('tidypics:settings:maxfilesize');
+echo elgg_view('input/text', array(
+ 'name' => 'params[maxfilesize]',
+ 'value' => $plugin->maxfilesize,
+));
+echo '</div>';
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 @@
+<?php
+/**
+ * Thumbnail sizes
+ */
+
+$plugin = $vars['plugin'];
+
+echo '<span class="elgg-text-help">' . elgg_echo('tidypics:settings:sizes:instructs') . '</span>';
+$image_sizes = unserialize($plugin->image_sizes);
+echo '<table>';
+$sizes = array('large', 'small', 'tiny');
+foreach ($sizes as $size) {
+ echo '<tr>';
+ echo '<td class="pas">';
+ echo elgg_echo("tidypics:settings:{$size}size");
+ echo '</td><td class="pas">';
+ echo 'width: ';
+ echo elgg_view('input/text', array(
+ 'name' => "{$size}_image_width",
+ 'value' => $image_sizes["{$size}_image_width"],
+ 'class' => 'tidypics-input-thin',
+ ));
+ echo '</td><td class="pas">';
+ echo 'height: ';
+ echo elgg_view('input/text', array(
+ 'name' => "{$size}_image_height",
+ 'value' => $image_sizes["{$size}_image_height"],
+ 'class' => 'tidypics-input-thin',
+ ));
+ echo '</td>';
+ echo '</tr>';
+}
+echo '</table>';