aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-09-05 20:49:31 +0000
committerz0rglub <z0rglub@piwigo.org>2004-09-05 20:49:31 +0000
commit21886493a7c8c508b613d35c01fa28c4604408a5 (patch)
tree17cf0632586dc0493b1d1d6f91b7507d23ea9636
parentb220e5db421a78e8cc4c76fba42d4f5049892488 (diff)
- adjustements on length fields
- usage of predefined values for nb_image_line and nb_line_page git-svn-id: http://piwigo.org/svn/trunk@517 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/configuration.php46
-rw-r--r--template/default/admin/configuration.tpl2
2 files changed, 35 insertions, 13 deletions
diff --git a/admin/configuration.php b/admin/configuration.php
index 2a11a1ea0..675753eef 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -46,6 +46,18 @@ $true_false = array('type' => 'radio',
'false' => $lang['no']));
$textfield = array('type' => 'textfield');
+$nb_image_row = array();
+foreach ($conf['nb_image_row'] as $value)
+{
+ $nb_image_row[$value] = $value;
+}
+
+$nb_row_page = array();
+foreach ($conf['nb_row_page'] as $value)
+{
+ $nb_row_page[$value] = $value;
+}
+
$sections = array(
'general' => array(
'mail_webmaster' => $textfield,
@@ -60,32 +72,32 @@ $sections = array(
'comments' => array(
'show_comments' => $true_false,
'comments_forall' => $true_false,
- 'nb_comment_page' => $textfield,
+ 'nb_comment_page' => array('type' => 'textfield','size' => 2),
'comments_validation' => $true_false
),
'default' => array(
'default_language' => array('type' => 'select',
'options' => get_languages()),
- 'nb_image_line' => $textfield,
- 'nb_line_page' => $textfield,
+ 'nb_image_line' => array('type' => 'radio','options' => $nb_image_row),
+ 'nb_line_page' => array('type' => 'radio','options' => $nb_row_page),
'default_template' => array('type' => 'select',
'options' => get_templates()),
- 'recent_period' => $textfield,
+ 'recent_period' => array('type' => 'textfield','size' => 3),
'auto_expand' => $true_false,
'show_nb_comments' => $true_false
),
'upload' => array(
'upload_available' => $true_false,
- 'upload_maxfilesize' => $textfield,
- 'upload_maxwidth' => $textfield,
- 'upload_maxheight' => $textfield,
- 'upload_maxwidth_thumbnail' => $textfield,
- 'upload_maxheight_thumbnail' => $textfield
+ 'upload_maxfilesize' => array('type' => 'textfield','size' => 4),
+ 'upload_maxwidth' => array('type' => 'textfield','size' => 4),
+ 'upload_maxheight' => array('type' => 'textfield','size' => 4),
+ 'upload_maxwidth_thumbnail' => array('type' => 'textfield','size' => 4),
+ 'upload_maxheight_thumbnail' => array('type' => 'textfield','size' => 4)
),
'session' => array(
'authorize_cookies' => $true_false,
- 'session_time' => $textfield,
- 'session_id_size' => $textfield
+ 'session_time' => array('type' => 'textfield','size' => 2),
+ 'session_id_size' => array('type' => 'textfield','size' => 2)
),
'metadata' => array(
'use_exif' => $true_false,
@@ -262,11 +274,21 @@ foreach ($fields as $field_name => $field)
));
if ($field['type'] == 'textfield')
{
+ if (isset($field['size']))
+ {
+ $size = $field['size'];
+ }
+ else
+ {
+ $size = '';
+ }
+
$template->assign_block_vars(
'line.textfield',
array(
'NAME' => $field_name,
- 'VALUE' => $conf[$field_name]
+ 'VALUE' => $conf[$field_name],
+ 'SIZE' => $size
));
}
else if ($field['type'] == 'radio')
diff --git a/template/default/admin/configuration.tpl b/template/default/admin/configuration.tpl
index bcdb4882e..5f9609f47 100644
--- a/template/default/admin/configuration.tpl
+++ b/template/default/admin/configuration.tpl
@@ -30,7 +30,7 @@
<td class="confLineField">
<!-- BEGIN textfield -->
- <input type="text" size="{line.textfield.SIZE}" name="{line.textfield.NAME}" value="{line.textfield.VALUE}" />
+ <input type="text" size="{line.textfield.SIZE}" maxlength="{line.textfield.SIZE}" name="{line.textfield.NAME}" value="{line.textfield.VALUE}" />
<!-- END textfield -->
<!-- BEGIN radio -->