aboutsummaryrefslogtreecommitdiff
path: root/views/default/forms
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/forms')
-rw-r--r--views/default/forms/photos/admin/settings.php2
-rw-r--r--views/default/forms/photos/admin/settings/main.php10
-rw-r--r--views/default/forms/photos/ajax_upload.php54
-rw-r--r--views/default/forms/photos/basic_upload.php75
-rw-r--r--views/default/forms/photos/image/tag.php33
5 files changed, 47 insertions, 127 deletions
diff --git a/views/default/forms/photos/admin/settings.php b/views/default/forms/photos/admin/settings.php
index 403203f69..e0b8a9880 100644
--- a/views/default/forms/photos/admin/settings.php
+++ b/views/default/forms/photos/admin/settings.php
@@ -5,7 +5,7 @@
* @todo remove original image, group only upload not delete
*/
-$plugin = elgg_get_plugin_from_id('tidypics');
+$plugin = elgg_get_plugin_from_id('lightpics');
$title = elgg_echo('tidypics:settings:main');
$content = elgg_view('forms/photos/admin/settings/main', array('plugin' => $plugin));
diff --git a/views/default/forms/photos/admin/settings/main.php b/views/default/forms/photos/admin/settings/main.php
index e893efc81..a35c9ab59 100644
--- a/views/default/forms/photos/admin/settings/main.php
+++ b/views/default/forms/photos/admin/settings/main.php
@@ -5,7 +5,7 @@
$plugin = $vars['plugin'];
-$checkboxes = array('tagging', 'view_count', 'uploader', 'exif', 'download_link');
+$checkboxes = array('view_count', 'exif', 'download_link');
foreach ($checkboxes as $checkbox) {
echo '<div>';
echo elgg_view('input/checkbox', array(
@@ -26,14 +26,6 @@ echo elgg_view('input/text', array(
));
echo '</div>';
-// Watermark Text
-echo '<div>' . elgg_echo('tidypics:settings:watermark');
-echo elgg_view("input/text", array(
- 'name' => 'params[watermark_text]',
- 'value' => $plugin->watermark_text,
-));
-echo '</div>';
-
// Quota Size
$quota = $plugin->quota;
if (!$quota) {
diff --git a/views/default/forms/photos/ajax_upload.php b/views/default/forms/photos/ajax_upload.php
deleted file mode 100644
index 3ab578a38..000000000
--- a/views/default/forms/photos/ajax_upload.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-/**
- * Tidypics ajax upload form body
- *
- * @uses $vars['entity']
- */
-
-$album = $vars['entity'];
-
-$ts = time();
-$batch = time();
-$tidypics_token = md5(session_id() . get_site_secret() . $ts . elgg_get_logged_in_user_entity()->salt);
-$basic_uploader_url = current_page_url() . '/basic';
-
-$maxfilesize = (float) elgg_get_plugin_setting('maxfilesize', 'tidypics');
-if (!$maxfilesize) {
- $maxfilesize = 5;
-}
-
-?>
-
-<p>
-<?php
- echo elgg_echo('tidypics:uploader:instructs', array($maxfilesize, $basic_uploader_url));
-?>
-</p>
-
-<ul id="tidypics-uploader-steps">
- <li class="mbm">
- <div id="tidypics-uploader">
- <a id="tidypics-choose-button" href="<?php echo $basic_uploader_url; ?>">
- 1. <?php echo elgg_echo('tidypics:uploader:choose'); ?>
- </a>
- <div id="tidypics-flash-uploader">
- <input type="file" id="uploadify" name="uploadify" class="hidden" />
- <input type="hidden" name="album_guid" value="<?php echo $album->getGUID(); ?>" />
- <input type="hidden" name="batch" value="<?php echo $batch; ?>" />
- <input type="hidden" name="tidypics_token" value="<?php echo $tidypics_token; ?>" />
- <input type="hidden" name="user_guid" value="<?php echo elgg_get_logged_in_user_guid(); ?>" />
- <input type="hidden" name="Elgg" value="<?php echo session_id(); ?>" />
- </div>
- </div>
- </li>
- <li class="mbm">
- <a id="tidypics-upload-button" class="tidypics-disable" href="#">
- 2. <?php echo elgg_echo('tidypics:uploader:upload'); ?>
- </a>
- </li>
- <li class="mbm">
- <a id="tidypics-describe-button" class="tidypics-disable" href="#">
- 3. <?php echo elgg_echo('tidypics:uploader:describe'); ?>
- </a>
- </li>
-</ul>
diff --git a/views/default/forms/photos/basic_upload.php b/views/default/forms/photos/basic_upload.php
index ba849d1b4..9e71cf59e 100644
--- a/views/default/forms/photos/basic_upload.php
+++ b/views/default/forms/photos/basic_upload.php
@@ -1,48 +1,63 @@
<?php
-/**
- * Basic uploader form
- *
- * This only handled uploading the images. Editing the titles and descriptions
- * are handled with the edit forms.
- *
- * @uses $vars['entity']
- *
- * @author Cash Costello
- * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
- */
-
$album = $vars['entity'];
-$access_id = $album->access_id;
+$help = elgg_echo('tidypics:uploader:help');
-$maxfilesize = (float) elgg_get_plugin_setting('maxfilesize', 'tidypics');
+$input = elgg_view('input/file', array(
+ 'name' => 'images[]',
+ 'multiple' => 'multiple',
+ 'class' => 'hidden-js',
+));
-$instructions = elgg_echo("tidypics:uploader:upload");
-$max = elgg_echo('tidypics:uploader:basic', array($maxfilesize));
+$button = elgg_view('output/url', array(
+ 'text' => elgg_echo('tidypics:uploader:upload') . $input,
+ 'class' => 'elgg-button elgg-button-action fileinput-button',
+));
-$list = '';
-for ($x = 0; $x < 10; $x++) {
- $list .= '<li>' . elgg_view('input/file', array('name' => 'images[]')) . '</li>';
-}
+$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")));
-$form_body = <<<HTML
+echo <<<HTML
<div>
$max
</div>
-<div>
- <ol>
- $list
- </ol>
+<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;
-echo elgg_view('input/form', array(
- 'body' => $form_body,
- 'action' => 'action/photos/image/upload',
- 'enctype' => 'multipart/form-data',
-));
+?>
+
+<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/views/default/forms/photos/image/tag.php b/views/default/forms/photos/image/tag.php
deleted file mode 100644
index 31869be9e..000000000
--- a/views/default/forms/photos/image/tag.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-/**
- * Tag select form body
- *
- * @uses $vars['entity']
- *
- * @author Cash Costello
- * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
- */
-
-echo '<div class="elgg-col elgg-col-4of5">';
-
-echo elgg_view('input/autocomplete', array(
- 'name' => 'username',
- 'match_on' => 'friends',
-));
-
-echo elgg_view('input/hidden', array(
- 'name' => 'guid',
- 'value' => $vars['entity']->getGUID(),
-));
-
-echo elgg_view('input/hidden', array(
- 'name' => 'coordinates',
-));
-
-echo '</div>';
-
-echo '<div class="elgg-col elgg-col-1of5 center">';
-echo elgg_view('input/submit', array(
- 'value' => elgg_echo('tidypics:actiontag'),
-));
-echo '</div>';