From 4bfbb194ec1f9fc2647d1cb4e946fb95492076d6 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Wed, 23 Nov 2011 15:25:48 -0500 Subject: settings are good enough for a preview release now --- views/default/forms/photos/admin/settings.php | 290 ++++++++------------------ 1 file changed, 91 insertions(+), 199 deletions(-) (limited to 'views/default/forms/photos/admin') diff --git a/views/default/forms/photos/admin/settings.php b/views/default/forms/photos/admin/settings.php index ea1e12de8..5c71e24f6 100644 --- a/views/default/forms/photos/admin/settings.php +++ b/views/default/forms/photos/admin/settings.php @@ -1,134 +1,132 @@ '; + $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 ''; +} + +// max image size echo '
'; -$checked = $plugin->tagging ? 'checked' : false; -echo elgg_view('input/checkbox', array( - 'name' => 'params[tagging]', - 'value' => true, - 'checked' => (bool)$plugin->tagging, +echo elgg_echo('tidypics:settings:maxfilesize'); +echo elgg_view('input/text', array( + 'name' => 'params[maxfilesize]', + 'value' => $plugin->maxfilesize, )); -echo ' ' . elgg_echo('tidypics:settings:tagging'); echo '
'; -// Thumbnail sizes +// image library +echo '

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

'; +echo'
'; +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 '
'; echo '
'; -echo '

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

'; -echo "
You must edit the css if you change the default sizes
"; -$image_sizes = unserialize($plugin->image_sizes); +echo elgg_echo('tidypics:settings:im_path') . ' '; +echo elgg_view("input/text", array('name' => 'params[im_path]', 'value' => $$plugin->im_path)); +echo '
'; -/* -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); -} - * - */ +// river integration +echo '

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

'; +echo '
'; +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 '
'; +echo '
'; +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 '
'; + + +// thumbnail sizes +echo '
'; +echo '

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

'; +echo '
' . elgg_echo('tidypics:settings:sizes:instructs') . '
'; +$image_sizes = unserialize($plugin->image_sizes); +echo ''; $sizes = array('large', 'small', 'tiny'); foreach ($sizes as $size) { + echo ''; + echo ''; + echo ''; } - -$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:

'; +echo '
'; echo elgg_echo("tidypics:settings:{$size}size"); - echo ' width: '; + echo ''; + echo 'width: '; echo elgg_view('input/text', array( - 'name' => "{$size}_thumb_width", + 'name' => "{$size}_image_width", 'value' => $image_sizes["{$size}_image_width"], - 'style' => 'width: 150px;' + 'class' => 'tidypics-input-thin', )); - echo ' height: '; + echo ''; + echo 'height: '; echo elgg_view('input/text', array( - 'name' => "{$size}_thumb_height", + 'name' => "{$size}_image_height", 'value' => $image_sizes["{$size}_image_height"], - 'style' => 'width: 150px;' + 'class' => 'tidypics-input-thin', )); + echo '
'; echo '
'; -echo elgg_view('input/submit', array('value' => elgg_echo("save"))); -return true; - - -// Main settings -echo '

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

'; - -// Tagging -$tagging = $plugin->tagging ? $plugin->tagging : 'enabled'; +// Group albums +echo '

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

'; echo '
'; -echo elgg_view("input/checkboxes", array( - 'name' => 'tagging', - 'value' => $tagging, - 'options' => array( - elgg_echo('tidypics:settings:tagging') => 'enabled' - ), +$checked = $plugin->grp_perm_override ? 'checked' : false; +echo elgg_view('input/checkbox', array( + 'name' => "params[grp_perm_override]", + 'value' => true, + 'checked' => (bool)$plugin->grp_perm_override, )); -echo "
"; +echo ' ' . elgg_echo("tidypics:settings:grp_perm_override"); +echo ''; -// 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 )) . "

"; +echo elgg_view('input/submit', array('value' => elgg_echo("save"))); -// 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 )) . "

"; +return true; -// 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) { @@ -137,109 +135,3 @@ if (!$quota) { $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; -- cgit v1.2.3