From 98664daa72a390fe760b69116af8bfa9327826e3 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 19 Nov 2011 18:43:35 -0500 Subject: album creation and editing is working --- views/default/forms/photos/admin/settings.php | 179 ++++++++++++++++++++++++ views/default/forms/photos/ajax_upload.php | 141 +++++++++++++++++++ views/default/forms/photos/album/save.php | 48 +++++++ views/default/forms/photos/basic_upload.php | 104 ++++++++++++++ views/default/forms/tidypics/admin/settings.php | 179 ------------------------ views/default/forms/tidypics/ajax_upload.php | 141 ------------------- views/default/forms/tidypics/basic_upload.php | 104 -------------- 7 files changed, 472 insertions(+), 424 deletions(-) create mode 100644 views/default/forms/photos/admin/settings.php create mode 100644 views/default/forms/photos/ajax_upload.php create mode 100644 views/default/forms/photos/album/save.php create mode 100644 views/default/forms/photos/basic_upload.php delete mode 100644 views/default/forms/tidypics/admin/settings.php delete mode 100644 views/default/forms/tidypics/ajax_upload.php delete mode 100644 views/default/forms/tidypics/basic_upload.php (limited to 'views/default/forms') diff --git a/views/default/forms/photos/admin/settings.php b/views/default/forms/photos/admin/settings.php new file mode 100644 index 000000000..06b3f4cb9 --- /dev/null +++ b/views/default/forms/photos/admin/settings.php @@ -0,0 +1,179 @@ +' . elgg_echo('tidypics:settings:heading:main') . ''; + +// Tagging +$tagging = $plugin->tagging; +if (!$tagging) { + $tagging = "enabled"; +} +$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:tagging') => 'enabled'), 'internalname' => 'tagging', 'value' => $tagging )) . "

"; + +// Download Link +$download_link = $plugin->download_link; +if (!$download_link) { + $download_link = "enabled"; +} +$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:download_link') => 'enabled'), 'internalname' => 'download_link', 'value' => $download_link )) . "

"; + +// Ratings +$photo_ratings = $plugin->photo_ratings; +if (!$photo_ratings) { + $photo_ratings = "disabled"; +} +$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:photo_ratings') => 'enabled'), 'internalname' => 'photo_ratings', 'value' => $photo_ratings )) . "

"; + +// Show EXIF +$exif = $plugin->exif; +if (!$exif) { + $exif = "disabled"; +} +$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:exif') => 'enabled'), 'internalname' => 'exif', 'value' => $exif )) . "

"; + +// Show View count +$view_count = $plugin->view_count; +if (!$view_count) { + $view_count = "enabled"; +} +$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:view_count') => 'enabled'), 'internalname' => 'view_count', 'value' => $view_count )) . "

"; + +// Use flash uploader +$uploader = $plugin->uploader; +if (!$uploader) { + $uploader = "enabled"; +} +$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:uploader') => 'enabled'), 'internalname' => 'uploader', 'value' => $uploader )) . "

"; + +// Watermark Text +$form_body .= "

" . elgg_echo('tidypics:settings:watermark') . "
"; +$form_body .= elgg_view("input/text",array('internalname' => 'params[watermark_text]', 'value' => $plugin->watermark_text)) . "

"; + +// Max Image Size +$maxfilesize = $plugin->maxfilesize; +if (!$maxfilesize) { + $maxfilesize = (int)5; // 5 MB +} +$form_body .= "

" . elgg_echo('tidypics:settings:maxfilesize') . "
"; +$form_body .= elgg_view("input/text",array('internalname' => 'params[maxfilesize]', 'value' => $maxfilesize)) . "

"; + +// Quota Size +$quota = $plugin->quota; +if (!$quota) { + $quota = 0; +} +$form_body .= "

" . elgg_echo('tidypics:settings:quota') . "
"; +$form_body .= elgg_view("input/text",array('internalname' => 'params[quota]', 'value' => $quota)) . "

"; + +// Image Library +if (extension_loaded('imagick')) { + $img_lib_options['ImageMagickPHP'] = 'imagick PHP extension'; +} + +$disablefunc = explode(',', ini_get('disable_functions')); +if (is_callable('exec') && !in_array('exec',$disablefunc)) { + $img_lib_options['ImageMagick'] = 'ImageMagick Cmdline'; +} + +$img_lib_options['GD'] = 'GD'; + +$form_body .= '

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

'; +$image_lib = $plugin->image_lib; +if (!$image_lib) { + $image_lib = 'GD'; +} +$form_body .= '

' . elgg_echo('tidypics:settings:image_lib') . ': '; +$form_body .= elgg_view('input/pulldown', array( + 'internalname' => 'params[image_lib]', + 'options_values' => $img_lib_options, + 'value' => $image_lib +)); +$form_body .= '
Note: If you want to select ImageMagick Command Line, first confirm that it is installed on your server.

'; + +if (is_callable('exec') && !in_array('exec', $disablefunc)) { + // Image Magick Path + $im_path = $plugin->im_path; + if(!$im_path) { + $im_path = ""; + } + $form_body .= "

" . elgg_echo('tidypics:settings:im_path') . "
"; + $form_body .= elgg_view("input/text",array('internalname' => 'params[im_path]', 'value' => $im_path)) . "

"; +} + + +// River Image options +$form_body .= '

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

'; +$img_river_view = $plugin->img_river_view; +if (!$img_river_view) { + $img_river_view = 'batch'; +} +$form_body .= '

' . elgg_echo('tidypics:settings:img_river_view') . ': '; +$form_body .= elgg_view('input/pulldown', array( + 'internalname' => 'params[img_river_view]', + 'options_values' => array( + 'all' => 'all', + 'batch' => '1', + 'none' => 'none', + ), + 'value' => $img_river_view +)); +$form_body .= '

'; + +// River Album options +$album_river_view = $plugin->album_river_view; +if (!$album_river_view) { + $album_river_view = 'set'; +} +$form_body .= '

' . elgg_echo('tidypics:settings:album_river_view') . ': '; +$form_body .= elgg_view('input/pulldown', array( + 'internalname' => 'params[album_river_view]', + 'options_values' => array( + 'cover' => 'cover', + 'set' => 'set', + ), + 'value' => $album_river_view +)); +$form_body .= '

'; + +// Thumbnail sizes +$form_body .= '

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

'; +$form_body .= "
You must edit the css if you change the default sizes
"; +$image_sizes = $plugin->image_sizes; +if(!$image_sizes) { + $image_sizes = array(); // set default values + $image_sizes['large_image_width'] = $image_sizes['large_image_height'] = 600; + $image_sizes['small_image_width'] = $image_sizes['small_image_height'] = 153; + $image_sizes['thumb_image_width'] = $image_sizes['thumb_image_height'] = 60; +} else { + $image_sizes = unserialize($image_sizes); +} +$form_body .= "

" . elgg_echo('tidypics:settings:largesize') . "
"; +$form_body .= 'width:    '; +$form_body .= 'height:

'; + +$form_body .= "

" . elgg_echo('tidypics:settings:smallsize') . "
"; +$form_body .= 'width and height:    '; +//$form_body .= 'height:

'; + +$form_body .= "

" . elgg_echo('tidypics:settings:thumbsize') . "
"; +$form_body .= 'width and height:    '; +//$form_body .= 'height:

'; + + +// Group permission override +$form_body .= '

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

'; +$grp_perm_override = $plugin->grp_perm_override; +if (!$grp_perm_override) { + $grp_perm_override = "enabled"; +} +$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:grp_perm_override') => 'enabled'), 'internalname' => 'grp_perm_override', 'value' => $grp_perm_override )) . "

"; + +$form_body .= elgg_view('input/submit', array('value' => elgg_echo("save"))); + +echo $form_body; diff --git a/views/default/forms/photos/ajax_upload.php b/views/default/forms/photos/ajax_upload.php new file mode 100644 index 000000000..a1d13e80b --- /dev/null +++ b/views/default/forms/photos/ajax_upload.php @@ -0,0 +1,141 @@ +salt); + +$basic_uploader_url = current_page_url() . '/basic'; +$upload_endpoint_url = "{$vars['url']}action/tidypics/ajax_upload/"; +$upload_complete_url = "{$vars['url']}action/tidypics/ajax_upload_complete/"; + +$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics'); +if (!$maxfilesize) { + $maxfilesize = 5; +} + +$quota = get_plugin_setting('quota','tidypics'); +if ($quota) { + $image_repo_size_md = get_metadata_byname($album->container_guid, "image_repo_size"); + $image_repo_size = (int)$image_repo_size_md->value; + $image_repo_size = $image_repo_size / 1024 / 1024; + $quote_percentage = round(100 * ($image_repo_size / $quota)); + // for small quotas, so one decimal place + if ($quota < 10) { + $image_repo_size = sprintf('%.1f', $image_repo_size); + } else { + $image_repo_size = round($image_repo_size); + } + if ($image_repo_size > $quota) { + $image_repo_size = $quota; + } +} + +?> + +
+ +

+ + +
+ + diff --git a/views/default/forms/photos/album/save.php b/views/default/forms/photos/album/save.php new file mode 100644 index 000000000..8a1202c07 --- /dev/null +++ b/views/default/forms/photos/album/save.php @@ -0,0 +1,48 @@ + + +
+ + 'title', 'value' => $title)); ?> +
+
+ + 'description', 'value' => $description)); ?> +
+
+ + 'tags', 'value' => $tags)); ?> +
+ +
+ + 'access_id', 'value' => $access_id)); ?> +
+
+ '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'))); +?> +
diff --git a/views/default/forms/photos/basic_upload.php b/views/default/forms/photos/basic_upload.php new file mode 100644 index 000000000..55ab854a4 --- /dev/null +++ b/views/default/forms/photos/basic_upload.php @@ -0,0 +1,104 @@ +access_id; + +$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics'); +if (!$maxfilesize) { + $maxfilesize = 5; +} + +$quota = get_plugin_setting('quota','tidypics'); +if ($quota) { + $image_repo_size_md = get_metadata_byname($album->container_guid, "image_repo_size"); + $image_repo_size = (int)$image_repo_size_md->value; + $image_repo_size = $image_repo_size / 1024 / 1024; + $quote_percentage = round(100 * ($image_repo_size / $quota)); + // for small quotas, so one decimal place + if ($quota < 10) { + $image_repo_size = sprintf('%.1f', $image_repo_size); + } else { + $image_repo_size = round($image_repo_size); + } + if ($image_repo_size > $quota) { + $image_repo_size = $quota; + } +} + +?> +
+
+ +

+
+
+ +
+ +

+
+
...
+
+
    + ' . elgg_view("input/file",array('internalname' => "upload_$x")) . ''; + } + ?> +
+

+

+ guid . '" />'; + } + if ($access_id) { + echo ''; + } + ?> + " onclick="displayProgress();" /> +

+ +
+ \ No newline at end of file diff --git a/views/default/forms/tidypics/admin/settings.php b/views/default/forms/tidypics/admin/settings.php deleted file mode 100644 index 06b3f4cb9..000000000 --- a/views/default/forms/tidypics/admin/settings.php +++ /dev/null @@ -1,179 +0,0 @@ -' . elgg_echo('tidypics:settings:heading:main') . ''; - -// Tagging -$tagging = $plugin->tagging; -if (!$tagging) { - $tagging = "enabled"; -} -$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:tagging') => 'enabled'), 'internalname' => 'tagging', 'value' => $tagging )) . "

"; - -// Download Link -$download_link = $plugin->download_link; -if (!$download_link) { - $download_link = "enabled"; -} -$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:download_link') => 'enabled'), 'internalname' => 'download_link', 'value' => $download_link )) . "

"; - -// Ratings -$photo_ratings = $plugin->photo_ratings; -if (!$photo_ratings) { - $photo_ratings = "disabled"; -} -$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:photo_ratings') => 'enabled'), 'internalname' => 'photo_ratings', 'value' => $photo_ratings )) . "

"; - -// Show EXIF -$exif = $plugin->exif; -if (!$exif) { - $exif = "disabled"; -} -$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:exif') => 'enabled'), 'internalname' => 'exif', 'value' => $exif )) . "

"; - -// Show View count -$view_count = $plugin->view_count; -if (!$view_count) { - $view_count = "enabled"; -} -$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:view_count') => 'enabled'), 'internalname' => 'view_count', 'value' => $view_count )) . "

"; - -// Use flash uploader -$uploader = $plugin->uploader; -if (!$uploader) { - $uploader = "enabled"; -} -$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:uploader') => 'enabled'), 'internalname' => 'uploader', 'value' => $uploader )) . "

"; - -// Watermark Text -$form_body .= "

" . elgg_echo('tidypics:settings:watermark') . "
"; -$form_body .= elgg_view("input/text",array('internalname' => 'params[watermark_text]', 'value' => $plugin->watermark_text)) . "

"; - -// Max Image Size -$maxfilesize = $plugin->maxfilesize; -if (!$maxfilesize) { - $maxfilesize = (int)5; // 5 MB -} -$form_body .= "

" . elgg_echo('tidypics:settings:maxfilesize') . "
"; -$form_body .= elgg_view("input/text",array('internalname' => 'params[maxfilesize]', 'value' => $maxfilesize)) . "

"; - -// Quota Size -$quota = $plugin->quota; -if (!$quota) { - $quota = 0; -} -$form_body .= "

" . elgg_echo('tidypics:settings:quota') . "
"; -$form_body .= elgg_view("input/text",array('internalname' => 'params[quota]', 'value' => $quota)) . "

"; - -// Image Library -if (extension_loaded('imagick')) { - $img_lib_options['ImageMagickPHP'] = 'imagick PHP extension'; -} - -$disablefunc = explode(',', ini_get('disable_functions')); -if (is_callable('exec') && !in_array('exec',$disablefunc)) { - $img_lib_options['ImageMagick'] = 'ImageMagick Cmdline'; -} - -$img_lib_options['GD'] = 'GD'; - -$form_body .= '

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

'; -$image_lib = $plugin->image_lib; -if (!$image_lib) { - $image_lib = 'GD'; -} -$form_body .= '

' . elgg_echo('tidypics:settings:image_lib') . ': '; -$form_body .= elgg_view('input/pulldown', array( - 'internalname' => 'params[image_lib]', - 'options_values' => $img_lib_options, - 'value' => $image_lib -)); -$form_body .= '
Note: If you want to select ImageMagick Command Line, first confirm that it is installed on your server.

'; - -if (is_callable('exec') && !in_array('exec', $disablefunc)) { - // Image Magick Path - $im_path = $plugin->im_path; - if(!$im_path) { - $im_path = ""; - } - $form_body .= "

" . elgg_echo('tidypics:settings:im_path') . "
"; - $form_body .= elgg_view("input/text",array('internalname' => 'params[im_path]', 'value' => $im_path)) . "

"; -} - - -// River Image options -$form_body .= '

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

'; -$img_river_view = $plugin->img_river_view; -if (!$img_river_view) { - $img_river_view = 'batch'; -} -$form_body .= '

' . elgg_echo('tidypics:settings:img_river_view') . ': '; -$form_body .= elgg_view('input/pulldown', array( - 'internalname' => 'params[img_river_view]', - 'options_values' => array( - 'all' => 'all', - 'batch' => '1', - 'none' => 'none', - ), - 'value' => $img_river_view -)); -$form_body .= '

'; - -// River Album options -$album_river_view = $plugin->album_river_view; -if (!$album_river_view) { - $album_river_view = 'set'; -} -$form_body .= '

' . elgg_echo('tidypics:settings:album_river_view') . ': '; -$form_body .= elgg_view('input/pulldown', array( - 'internalname' => 'params[album_river_view]', - 'options_values' => array( - 'cover' => 'cover', - 'set' => 'set', - ), - 'value' => $album_river_view -)); -$form_body .= '

'; - -// Thumbnail sizes -$form_body .= '

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

'; -$form_body .= "
You must edit the css if you change the default sizes
"; -$image_sizes = $plugin->image_sizes; -if(!$image_sizes) { - $image_sizes = array(); // set default values - $image_sizes['large_image_width'] = $image_sizes['large_image_height'] = 600; - $image_sizes['small_image_width'] = $image_sizes['small_image_height'] = 153; - $image_sizes['thumb_image_width'] = $image_sizes['thumb_image_height'] = 60; -} else { - $image_sizes = unserialize($image_sizes); -} -$form_body .= "

" . elgg_echo('tidypics:settings:largesize') . "
"; -$form_body .= 'width:    '; -$form_body .= 'height:

'; - -$form_body .= "

" . elgg_echo('tidypics:settings:smallsize') . "
"; -$form_body .= 'width and height:    '; -//$form_body .= 'height:

'; - -$form_body .= "

" . elgg_echo('tidypics:settings:thumbsize') . "
"; -$form_body .= 'width and height:    '; -//$form_body .= 'height:

'; - - -// Group permission override -$form_body .= '

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

'; -$grp_perm_override = $plugin->grp_perm_override; -if (!$grp_perm_override) { - $grp_perm_override = "enabled"; -} -$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:grp_perm_override') => 'enabled'), 'internalname' => 'grp_perm_override', 'value' => $grp_perm_override )) . "

"; - -$form_body .= elgg_view('input/submit', array('value' => elgg_echo("save"))); - -echo $form_body; diff --git a/views/default/forms/tidypics/ajax_upload.php b/views/default/forms/tidypics/ajax_upload.php deleted file mode 100644 index a1d13e80b..000000000 --- a/views/default/forms/tidypics/ajax_upload.php +++ /dev/null @@ -1,141 +0,0 @@ -salt); - -$basic_uploader_url = current_page_url() . '/basic'; -$upload_endpoint_url = "{$vars['url']}action/tidypics/ajax_upload/"; -$upload_complete_url = "{$vars['url']}action/tidypics/ajax_upload_complete/"; - -$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics'); -if (!$maxfilesize) { - $maxfilesize = 5; -} - -$quota = get_plugin_setting('quota','tidypics'); -if ($quota) { - $image_repo_size_md = get_metadata_byname($album->container_guid, "image_repo_size"); - $image_repo_size = (int)$image_repo_size_md->value; - $image_repo_size = $image_repo_size / 1024 / 1024; - $quote_percentage = round(100 * ($image_repo_size / $quota)); - // for small quotas, so one decimal place - if ($quota < 10) { - $image_repo_size = sprintf('%.1f', $image_repo_size); - } else { - $image_repo_size = round($image_repo_size); - } - if ($image_repo_size > $quota) { - $image_repo_size = $quota; - } -} - -?> - -
- -

- - -
- - diff --git a/views/default/forms/tidypics/basic_upload.php b/views/default/forms/tidypics/basic_upload.php deleted file mode 100644 index 55ab854a4..000000000 --- a/views/default/forms/tidypics/basic_upload.php +++ /dev/null @@ -1,104 +0,0 @@ -access_id; - -$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics'); -if (!$maxfilesize) { - $maxfilesize = 5; -} - -$quota = get_plugin_setting('quota','tidypics'); -if ($quota) { - $image_repo_size_md = get_metadata_byname($album->container_guid, "image_repo_size"); - $image_repo_size = (int)$image_repo_size_md->value; - $image_repo_size = $image_repo_size / 1024 / 1024; - $quote_percentage = round(100 * ($image_repo_size / $quota)); - // for small quotas, so one decimal place - if ($quota < 10) { - $image_repo_size = sprintf('%.1f', $image_repo_size); - } else { - $image_repo_size = round($image_repo_size); - } - if ($image_repo_size > $quota) { - $image_repo_size = $quota; - } -} - -?> -
-
- -

-
-
- -
- -

-
-
...
-
-
    - ' . elgg_view("input/file",array('internalname' => "upload_$x")) . ''; - } - ?> -
-

-

- guid . '" />'; - } - if ($access_id) { - echo ''; - } - ?> - " onclick="displayProgress();" /> -

- -
- \ No newline at end of file -- cgit v1.2.3