aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/default/admin/settings/photos/settings.php6
-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
6 files changed, 126 insertions, 99 deletions
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 @@
<?php
/**
- * Tidypics main settings
+ * Tidypics settings
*/
if (tidypics_is_upgrade_available()) {
@@ -15,6 +15,4 @@ if (tidypics_is_upgrade_available()) {
echo '</div>';
}
-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 '<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>';