aboutsummaryrefslogtreecommitdiffstats
path: root/admin/photos_add.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-12-23 10:22:51 +0000
committerplegall <plg@piwigo.org>2010-12-23 10:22:51 +0000
commit16371ed5fd9f0df6e8c3d6d349845bc2ec057081 (patch)
tree72de44930e073221bae0f0145f3c6c3b9ef46f5c /admin/photos_add.php
parent732eb6bfba05cd1969fb5898e5bc50c978b2ff0b (diff)
feature 2083 added: implement method pwg.images.addSimple in core
makes admin/include/function_upload.inc.php not dependant from include/ws_functions.inc.php (moves functions file_path_for_type and ready_for_upload_message) cleaner method to initialize the upload settings git-svn-id: http://piwigo.org/svn/trunk@8249 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/photos_add.php')
-rw-r--r--admin/photos_add.php134
1 files changed, 2 insertions, 132 deletions
diff --git a/admin/photos_add.php b/admin/photos_add.php
index 889395985..a4db30bf2 100644
--- a/admin/photos_add.php
+++ b/admin/photos_add.php
@@ -43,134 +43,9 @@ check_status(ACCESS_ADMINISTRATOR);
// | Load configuration |
// +-----------------------------------------------------------------------+
-// automatic fill of configuration parameters
-$upload_form_config = array(
- 'websize_resize' => array(
- 'default' => true,
- 'can_be_null' => false,
- ),
-
- 'websize_maxwidth' => array(
- 'default' => 800,
- 'min' => 100,
- 'max' => 1600,
- 'pattern' => '/^\d+$/',
- 'can_be_null' => true,
- 'error_message' => l10n('The websize maximum width must be a number between %d and %d'),
- ),
-
- 'websize_maxheight' => array(
- 'default' => 600,
- 'min' => 100,
- 'max' => 1200,
- 'pattern' => '/^\d+$/',
- 'can_be_null' => true,
- 'error_message' => l10n('The websize maximum height must be a number between %d and %d'),
- ),
-
- 'websize_quality' => array(
- 'default' => 95,
- 'min' => 50,
- 'max' => 100,
- 'pattern' => '/^\d+$/',
- 'can_be_null' => false,
- 'error_message' => l10n('The websize image quality must be a number between %d and %d'),
- ),
-
- 'thumb_maxwidth' => array(
- 'default' => 128,
- 'min' => 50,
- 'max' => 300,
- 'pattern' => '/^\d+$/',
- 'can_be_null' => false,
- 'error_message' => l10n('The thumbnail maximum width must be a number between %d and %d'),
- ),
-
- 'thumb_maxheight' => array(
- 'default' => 96,
- 'min' => 50,
- 'max' => 300,
- 'pattern' => '/^\d+$/',
- 'can_be_null' => false,
- 'error_message' => l10n('The thumbnail maximum height must be a number between %d and %d'),
- ),
-
- 'thumb_quality' => array(
- 'default' => 95,
- 'min' => 50,
- 'max' => 100,
- 'pattern' => '/^\d+$/',
- 'can_be_null' => false,
- 'error_message' => l10n('The thumbnail image quality must be a number between %d and %d'),
- ),
-
- 'hd_keep' => array(
- 'default' => true,
- 'can_be_null' => false,
- ),
-
- 'hd_resize' => array(
- 'default' => false,
- 'can_be_null' => false,
- ),
-
- 'hd_maxwidth' => array(
- 'default' => 2000,
- 'min' => 500,
- 'max' => 20000,
- 'pattern' => '/^\d+$/',
- 'can_be_null' => false,
- 'error_message' => l10n('The high definition maximum width must be a number between %d and %d'),
- ),
-
- 'hd_maxheight' => array(
- 'default' => 2000,
- 'min' => 500,
- 'max' => 20000,
- 'pattern' => '/^\d+$/',
- 'can_be_null' => false,
- 'error_message' => l10n('The high definition maximum height must be a number between %d and %d'),
- ),
-
- 'hd_quality' => array(
- 'default' => 95,
- 'min' => 50,
- 'max' => 100,
- 'pattern' => '/^\d+$/',
- 'can_be_null' => false,
- 'error_message' => l10n('The high definition image quality must be a number between %d and %d'),
- ),
- );
-
-$inserts = array();
-
-foreach ($upload_form_config as $param_shortname => $param)
-{
- $param_name = 'upload_form_'.$param_shortname;
-
- if (!isset($conf[$param_name]))
- {
- $param_value = boolean_to_string($param['default']);
-
- array_push(
- $inserts,
- array(
- 'param' => $param_name,
- 'value' => $param_value,
- )
- );
- $conf[$param_name] = $param_value;
- }
-}
+prepare_upload_configuration();
-if (count($inserts) > 0)
-{
- mass_inserts(
- CONFIG_TABLE,
- array_keys($inserts[0]),
- $inserts
- );
-}
+$upload_form_config = get_upload_form_config();
// +-----------------------------------------------------------------------+
// | Tabs |
@@ -238,11 +113,6 @@ $template->set_filenames(
)
);
-// $template->append(
-// 'head_elements',
-// '<link rel="stylesheet" type="text/css" href="'.UPLOAD_FORM_PATH.'upload.css">'."\n"
-// );
-
// +-----------------------------------------------------------------------+
// | Load the tab |
// +-----------------------------------------------------------------------+