aboutsummaryrefslogtreecommitdiff
path: root/mod/lightpics/views/default/forms/photos
diff options
context:
space:
mode:
Diffstat (limited to 'mod/lightpics/views/default/forms/photos')
-rw-r--r--mod/lightpics/views/default/forms/photos/admin/settings.php26
-rw-r--r--mod/lightpics/views/default/forms/photos/admin/settings/activity.php31
-rw-r--r--mod/lightpics/views/default/forms/photos/admin/settings/image_lib.php20
-rw-r--r--mod/lightpics/views/default/forms/photos/admin/settings/main.php39
-rw-r--r--mod/lightpics/views/default/forms/photos/admin/settings/thumbnails.php33
-rw-r--r--mod/lightpics/views/default/forms/photos/album/save.php48
-rw-r--r--mod/lightpics/views/default/forms/photos/album/sort.php28
-rw-r--r--mod/lightpics/views/default/forms/photos/basic_upload.php63
-rw-r--r--mod/lightpics/views/default/forms/photos/batch/edit.php33
-rw-r--r--mod/lightpics/views/default/forms/photos/batch/edit/image.php35
-rw-r--r--mod/lightpics/views/default/forms/photos/image/save.php48
11 files changed, 404 insertions, 0 deletions
diff --git a/mod/lightpics/views/default/forms/photos/admin/settings.php b/mod/lightpics/views/default/forms/photos/admin/settings.php
new file mode 100644
index 000000000..e0b8a9880
--- /dev/null
+++ b/mod/lightpics/views/default/forms/photos/admin/settings.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Tidypics admin settings form body
+ *
+ * @todo remove original image, group only upload not delete
+ */
+
+$plugin = elgg_get_plugin_from_id('lightpics');
+
+$title = elgg_echo('tidypics:settings:main');
+$content = elgg_view('forms/photos/admin/settings/main', array('plugin' => $plugin));
+echo elgg_view_module('inline', $title, $content);
+
+$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/mod/lightpics/views/default/forms/photos/admin/settings/activity.php b/mod/lightpics/views/default/forms/photos/admin/settings/activity.php
new file mode 100644
index 000000000..d62901af6
--- /dev/null
+++ b/mod/lightpics/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/mod/lightpics/views/default/forms/photos/admin/settings/image_lib.php b/mod/lightpics/views/default/forms/photos/admin/settings/image_lib.php
new file mode 100644
index 000000000..4e3f7f2a0
--- /dev/null
+++ b/mod/lightpics/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/mod/lightpics/views/default/forms/photos/admin/settings/main.php b/mod/lightpics/views/default/forms/photos/admin/settings/main.php
new file mode 100644
index 000000000..a35c9ab59
--- /dev/null
+++ b/mod/lightpics/views/default/forms/photos/admin/settings/main.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Primary settings for Elgg
+ */
+
+$plugin = $vars['plugin'];
+
+$checkboxes = array('view_count', 'exif', 'download_link');
+foreach ($checkboxes as $checkbox) {
+ echo '<div>';
+ 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>';
+
+// Quota Size
+$quota = $plugin->quota;
+if (!$quota) {
+ $quota = 0;
+}
+echo '<div>' . elgg_echo('tidypics:settings:quota');
+echo elgg_view('input/text', array(
+ 'name' => 'params[quota]',
+ 'value' => $quota,
+));
+echo '</div>';
diff --git a/mod/lightpics/views/default/forms/photos/admin/settings/thumbnails.php b/mod/lightpics/views/default/forms/photos/admin/settings/thumbnails.php
new file mode 100644
index 000000000..ec7a6d1b2
--- /dev/null
+++ b/mod/lightpics/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>';
diff --git a/mod/lightpics/views/default/forms/photos/album/save.php b/mod/lightpics/views/default/forms/photos/album/save.php
new file mode 100644
index 000000000..8a1202c07
--- /dev/null
+++ b/mod/lightpics/views/default/forms/photos/album/save.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Save album form body
+ *
+ * @author Cash Costello
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
+ */
+
+$title = elgg_extract('title', $vars, '');
+$description = elgg_extract('description', $vars, '');
+$tags = elgg_extract('tags', $vars, '');
+$access_id = elgg_extract('access_id', $vars, get_default_access());
+$container_guid = elgg_extract('container_guid', $vars, elgg_get_page_owner_guid());
+$guid = elgg_extract('guid', $vars, 0);
+
+?>
+
+<div>
+ <label><?php echo elgg_echo('album:title'); ?></label>
+ <?php echo elgg_view('input/text', array('name' => 'title', 'value' => $title)); ?>
+</div>
+<div>
+ <label><?php echo elgg_echo('album:desc'); ?></label>
+ <?php echo elgg_view('input/longtext', array('name' => 'description', 'value' => $description)); ?>
+</div>
+<div>
+ <label><?php echo elgg_echo('tags'); ?></label>
+ <?php echo elgg_view('input/tags', array('name' => 'tags', 'value' => $tags)); ?>
+</div>
+<?php
+
+$categories = elgg_view('input/categories', $vars);
+if ($categories) {
+ echo $categories;
+}
+
+?>
+<div>
+ <label><?php echo elgg_echo('access'); ?></label>
+ <?php echo elgg_view('input/access', array('name' => 'access_id', 'value' => $access_id)); ?>
+</div>
+<div class="elgg-foot">
+<?php
+echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $guid));
+echo elgg_view('input/hidden', array('name' => 'container_guid', 'value' => $container_guid));
+echo elgg_view('input/submit', array('value' => elgg_echo('save')));
+?>
+</div>
diff --git a/mod/lightpics/views/default/forms/photos/album/sort.php b/mod/lightpics/views/default/forms/photos/album/sort.php
new file mode 100644
index 000000000..49bd016aa
--- /dev/null
+++ b/mod/lightpics/views/default/forms/photos/album/sort.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Album sorting view
+ */
+
+$album = $vars['album'];
+$image_guids = $album->getImageList();
+
+echo '<div>';
+echo elgg_echo('tidypics:sort:instruct');
+echo '</div>';
+
+echo '<div>';
+echo elgg_view('input/hidden', array('name' => 'guids'));
+echo elgg_view('input/hidden', array('name' => 'album_guid', 'value' => $album->guid));
+echo elgg_view('input/submit', array('value' => elgg_echo('save')));
+echo '</div>';
+
+echo '<div class="elgg-foot">';
+echo '<ul id="tidypics-sort" class="elgg-gallery">';
+foreach ($image_guids as $image_guid) {
+ $image = get_entity($image_guid);
+ $img = elgg_view('output/img', array(
+ 'src' => $image->getIconURL(),
+ ));
+ echo "<li class=\"mam\" id=\"$image_guid\">$img</li>";
+}
+echo '</ul>';
diff --git a/mod/lightpics/views/default/forms/photos/basic_upload.php b/mod/lightpics/views/default/forms/photos/basic_upload.php
new file mode 100644
index 000000000..9e71cf59e
--- /dev/null
+++ b/mod/lightpics/views/default/forms/photos/basic_upload.php
@@ -0,0 +1,63 @@
+<?php
+$album = $vars['entity'];
+$help = elgg_echo('tidypics:uploader:help');
+
+$input = elgg_view('input/file', array(
+ 'name' => 'images[]',
+ 'multiple' => 'multiple',
+ 'class' => 'hidden-js',
+));
+
+$button = elgg_view('output/url', array(
+ 'text' => elgg_echo('tidypics:uploader:upload') . $input,
+ 'class' => 'elgg-button elgg-button-action fileinput-button',
+));
+
+$reset = elgg_view('input/reset', array(
+ 'value' => elgg_echo('cancel'),
+ 'class' => 'hidden',
+));
+
+$foot = elgg_view('input/hidden', array('name' => 'guid', 'value' => $album->getGUID()));
+$foot .= elgg_view('input/submit', array('value' => elgg_echo("save")));
+
+echo <<<HTML
+<div>
+ $max
+</div>
+<div class="fileinput-container">
+ $button
+ $reset
+ <p class="elgg-text-help">$help</p>
+</div>
+<div class="mtm"><!-- The table listing the files available for upload/download -->
+ <table role="presentation" class="elgg-table-alt clearfloat mtm">
+ <tbody class="files"></tbody>
+ </table>
+</div>
+<div class='elgg-foot'>
+ $foot
+</div>
+HTML;
+
+?>
+
+<noscript><style type="text/css">hidden-nojs {display: hidden}</style></noscript>
+
+<!-- The template to display files available for upload -->
+<script id="template-upload" type="text/x-tmpl">
+{% for (var i=0, file; file=o.files[i]; i++) { %}
+ <tr class="template-upload fade">
+ {% if (file.error) { %}
+ <td class="error"><span class="elgg-message elgg-state-error">{%=locale.fileupload.error%} {%=locale.fileupload.errors[file.error] || file.error%}</span></td>
+ {% } else { %}
+ <td class="preview"><span class="fade"></span></td>
+ {% } %}
+ <td class="name"><span>{%=file.name%}</span></td>
+ <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
+
+ </tr>
+{% } %}
+</script>
+<!-- The template to display files available for download -->
+<script id="template-download" type="text/x-tmpl" />
diff --git a/mod/lightpics/views/default/forms/photos/batch/edit.php b/mod/lightpics/views/default/forms/photos/batch/edit.php
new file mode 100644
index 000000000..d843d8349
--- /dev/null
+++ b/mod/lightpics/views/default/forms/photos/batch/edit.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Edit properties on a batch of images
+ *
+ * @uses $vars['batch'] ElggObject
+ *
+ * @author Cash Costello
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
+ */
+
+$batch = $vars['batch'];
+$album = $batch->getContainerEntity();
+
+$images = elgg_get_entities_from_relationship(array(
+ 'type' => 'object',
+ 'subtype' => 'image',
+ 'relationship' => 'belongs_to_batch',
+ 'relationship_guid' => $batch->getGUID(),
+ 'inverse_relationship' => true,
+ 'limit' => 0
+));
+
+echo '<ul>';
+foreach ($images as $image) {
+ echo '<li>';
+ echo elgg_view('forms/photos/batch/edit/image', array('entity' => $image));
+ echo '</li>';
+}
+echo '</ul>';
+
+echo '<div class="elgg-foot">';
+echo elgg_view('input/submit', array('value' => elgg_echo('save')));
+echo '</div>';
diff --git a/mod/lightpics/views/default/forms/photos/batch/edit/image.php b/mod/lightpics/views/default/forms/photos/batch/edit/image.php
new file mode 100644
index 000000000..eed804e90
--- /dev/null
+++ b/mod/lightpics/views/default/forms/photos/batch/edit/image.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Form component for editing a single image
+ *
+ * @uses $vars['entity']
+ *
+ * @author Cash Costello
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
+ */
+
+$image = $vars['entity'];
+
+echo '<div class="elgg-image-block">';
+
+echo '<div class="elgg-image">';
+echo elgg_view_entity_icon($image, 'small', array('href' => false));
+echo '</div>';
+
+echo '<div class="elgg-body"><fieldset class="mlm">';
+echo '<div><label>' . elgg_echo('album:title') . '</label>';
+echo elgg_view('input/text', array('name' => 'title[]', 'value' => $title,));
+echo '</div>';
+
+echo '<div><label>' . elgg_echo('caption') . '</label>';
+echo elgg_view('input/longtext', array('name' => 'caption[]'));
+echo '</div>';
+
+echo '<div><label>' . elgg_echo("tags") . '</label>';
+echo elgg_view('input/tags', array('name' => 'tags[]'));
+echo '</div>';
+
+echo elgg_view('input/hidden', array('name' => 'guid[]', 'value' => $image->getGUID()));
+echo '<fieldset></div>';
+
+echo '</div>';
diff --git a/mod/lightpics/views/default/forms/photos/image/save.php b/mod/lightpics/views/default/forms/photos/image/save.php
new file mode 100644
index 000000000..47a08640a
--- /dev/null
+++ b/mod/lightpics/views/default/forms/photos/image/save.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Save image form body
+ *
+ * @author Cash Costello
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
+ */
+
+$title = elgg_extract('title', $vars, '');
+$description = elgg_extract('description', $vars, '');
+$tags = elgg_extract('tags', $vars, '');
+$access_id = elgg_extract('access_id', $vars, get_default_access());
+$container_guid = elgg_extract('container_guid', $vars, elgg_get_page_owner_guid());
+$guid = elgg_extract('guid', $vars, 0);
+
+?>
+
+<div>
+ <label><?php echo elgg_echo('album:title'); ?></label>
+ <?php echo elgg_view('input/text', array('name' => 'title', 'value' => $title)); ?>
+</div>
+<div>
+ <label><?php echo elgg_echo('album:desc'); ?></label>
+ <?php echo elgg_view('input/longtext', array('name' => 'description', 'value' => $description)); ?>
+</div>
+<div>
+ <label><?php echo elgg_echo('tags'); ?></label>
+ <?php echo elgg_view('input/tags', array('name' => 'tags', 'value' => $tags)); ?>
+</div>
+<?php
+
+$categories = elgg_view('input/categories', $vars);
+if ($categories) {
+ echo $categories;
+}
+
+?>
+<div>
+ <label><?php echo elgg_echo('access'); ?></label>
+ <?php echo elgg_view('input/access', array('name' => 'access_id', 'value' => $access_id)); ?>
+</div>
+<div class="elgg-foot">
+<?php
+echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $guid));
+echo elgg_view('input/hidden', array('name' => 'container_guid', 'value' => $container_guid));
+echo elgg_view('input/submit', array('value' => elgg_echo('save')));
+?>
+</div>