From 53349bde3438dfccfc6c32c94e92aca730cc1049 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 25 Aug 2009 23:36:20 +0000 Subject: restructured admin views --- views/default/tidypics/admin/settings.php | 25 +++++ views/default/tidypics/admin/stats.php | 35 +++++++ views/default/tidypics/admin/tidypics.php | 36 ++++++++ views/default/tidypics/forms/admin.php | 147 ------------------------------ views/default/tidypics/forms/settings.php | 147 ++++++++++++++++++++++++++++++ views/default/tidypics/settings.php | 25 ----- views/default/tidypics/stats.php | 35 ------- 7 files changed, 243 insertions(+), 207 deletions(-) create mode 100644 views/default/tidypics/admin/settings.php create mode 100644 views/default/tidypics/admin/stats.php create mode 100644 views/default/tidypics/admin/tidypics.php delete mode 100644 views/default/tidypics/forms/admin.php create mode 100644 views/default/tidypics/forms/settings.php delete mode 100644 views/default/tidypics/settings.php delete mode 100644 views/default/tidypics/stats.php (limited to 'views/default') diff --git a/views/default/tidypics/admin/settings.php b/views/default/tidypics/admin/settings.php new file mode 100644 index 000000000..1b449cfc7 --- /dev/null +++ b/views/default/tidypics/admin/settings.php @@ -0,0 +1,25 @@ + elgg_echo("tidypics:admin:instructions"))); + + global $CONFIG; + $system_url = $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php'; + $upgrade_url = $CONFIG->wwwroot . 'mod/tidypics/actions/upgrade.php'; + + $upgrade = false; + if (!get_subtype_class('object', 'image') || !get_subtype_class('object', 'album')) + $upgrade = true; +?> +

+ +Upgrade
+ +Run Server Analysis +

+ \ No newline at end of file diff --git a/views/default/tidypics/admin/stats.php b/views/default/tidypics/admin/stats.php new file mode 100644 index 000000000..8de3415a1 --- /dev/null +++ b/views/default/tidypics/admin/stats.php @@ -0,0 +1,35 @@ +dbprefix}entities where subtype={$img_type}"; + $total = get_data_row($query); + $num_images = $total->total; + + $img_type = get_subtype_id('object', 'album'); + $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}"; + $total = get_data_row($query); + $num_albums = $total->total; + + $num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment'); + $num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment'); + + $num_views = count_annotations(0, 'object', 'image', 'tp_view'); + + if (get_plugin_setting('tagging', 'tidypics') != "disabled") + $num_tags = count_annotations(0, 'object', 'image', 'phototag'); +?> +

+
+Photos:
+Albums:
+Comments on photos:
+Comments on albums:
+Total views:
+ +Photo tags:
+ +

\ No newline at end of file diff --git a/views/default/tidypics/admin/tidypics.php b/views/default/tidypics/admin/tidypics.php new file mode 100644 index 000000000..7d6aa220c --- /dev/null +++ b/views/default/tidypics/admin/tidypics.php @@ -0,0 +1,36 @@ + +
+
+
    +
  • >
  • +
  • >
  • +
+
+ +
diff --git a/views/default/tidypics/forms/admin.php b/views/default/tidypics/forms/admin.php deleted file mode 100644 index c52348ecc..000000000 --- a/views/default/tidypics/forms/admin.php +++ /dev/null @@ -1,147 +0,0 @@ -version) { - set_plugin_setting('version', 1.62, 'tidypics'); - } - - if (extension_loaded('imagick')) - $img_lib_options['ImageMagickPHP'] = 'IMagick PHP'; - - $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'; - - - // Image Library - $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 = "/usr/bin/"; - $form_body .= "

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

"; - } - - // 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 )) . "

"; - - // 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)) . "

"; - - // River Image options - $img_river_view = $plugin->img_river_view; - if (!$img_river_view) $img_river_view = '1'; - $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', - '1' => '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 - $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:    '; - $form_body .= 'height:

'; - $form_body .= "

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

'; - - - // Group permission override - $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 elgg_view('input/form', array('action' => $action, 'body' => $form_body)); diff --git a/views/default/tidypics/forms/settings.php b/views/default/tidypics/forms/settings.php new file mode 100644 index 000000000..d493a623b --- /dev/null +++ b/views/default/tidypics/forms/settings.php @@ -0,0 +1,147 @@ +version) { + set_plugin_setting('version', 1.62, 'tidypics'); + } + + 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'; + + + // Image Library + $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 = "/usr/bin/"; + $form_body .= "

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

"; + } + + // 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 )) . "

"; + + // 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)) . "

"; + + // River Image options + $img_river_view = $plugin->img_river_view; + if (!$img_river_view) $img_river_view = '1'; + $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', + '1' => '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 + $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:    '; + $form_body .= 'height:

'; + $form_body .= "

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

'; + + + // Group permission override + $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 elgg_view('input/form', array('action' => $action, 'body' => $form_body)); diff --git a/views/default/tidypics/settings.php b/views/default/tidypics/settings.php deleted file mode 100644 index 9e082d9ab..000000000 --- a/views/default/tidypics/settings.php +++ /dev/null @@ -1,25 +0,0 @@ - elgg_echo("tidypics:admin:instructions"))); - - global $CONFIG; - $system_url = $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php'; - $upgrade_url = $CONFIG->wwwroot . 'mod/tidypics/actions/upgrade.php'; - - $upgrade = false; - if (!get_subtype_class('object', 'image') || !get_subtype_class('object', 'album')) - $upgrade = true; -?> -

- -Upgrade
- -Run Server Analysis -

- \ No newline at end of file diff --git a/views/default/tidypics/stats.php b/views/default/tidypics/stats.php deleted file mode 100644 index 8de3415a1..000000000 --- a/views/default/tidypics/stats.php +++ /dev/null @@ -1,35 +0,0 @@ -dbprefix}entities where subtype={$img_type}"; - $total = get_data_row($query); - $num_images = $total->total; - - $img_type = get_subtype_id('object', 'album'); - $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}"; - $total = get_data_row($query); - $num_albums = $total->total; - - $num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment'); - $num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment'); - - $num_views = count_annotations(0, 'object', 'image', 'tp_view'); - - if (get_plugin_setting('tagging', 'tidypics') != "disabled") - $num_tags = count_annotations(0, 'object', 'image', 'phototag'); -?> -

-
-Photos:
-Albums:
-Comments on photos:
-Comments on albums:
-Total views:
- -Photo tags:
- -

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