1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

e-spinner and $frm->number() function added.

This commit is contained in:
CaMer0n 2012-11-01 00:34:38 +00:00
parent f57297982c
commit f0d232a639
3 changed files with 21 additions and 9 deletions

View File

@ -652,18 +652,18 @@ class media_admin_ui extends e_admin_ui
'im_height' => array('title'=> "Avatar Height", 'type'=>'number', 'data'=>'int', 'writeParms'=>'help=Avatar images will be constrained to these dimensions (in pixels)'),
'resize_dimensions' => array('title'=> "Resize-Image Dimensions", 'type'=>'method', 'data'=>'str'),
'watermark_activate' => array('title'=> 'Watermark Activation', 'type' => 'text', 'data' => 'str', 'help'=>'All images with a width or height greater than this value will be given a watermark during resizing.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
'watermark_activate' => array('title'=> 'Watermark Activation', 'type' => 'number', 'data' => 'str', 'help'=>'All images with a width or height greater than this value will be given a watermark during resizing.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
'watermark_text' => array('title'=> 'Watermark Text', 'type' => 'text', 'data' => 'str', 'help'=>'Optional Watermark Text'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
'watermark_font' => array('title'=> 'Watermark Font', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Optional Watermark Font. Upload more .ttf fonts to the /fonts folder in your theme directory.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
'watermark_size' => array('title'=> 'Watermark Size', 'type' => 'text', 'data' => 'int', 'help'=>'Size of the font in pts'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
'watermark_size' => array('title'=> 'Watermark Size', 'type' => 'number', 'data' => 'int', 'help'=>'Size of the font in pts'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
'watermark_pos' => array('title'=> 'Watermark Position', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Watermark Position'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
'watermark_margin' => array('title'=> 'Watermark Margin', 'type' => 'text', 'data' => 'int', 'help'=>'The distance that watermark will appear from the edge of the image.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
'watermark_margin' => array('title'=> 'Watermark Margin', 'type' => 'number', 'data' => 'int', 'help'=>'The distance that watermark will appear from the edge of the image.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
'watermark_color' => array('title'=> 'Watermark Color', 'type' => 'text', 'data' => 'str', 'help'=>'Color of the watermark eg. 000000'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
'watermark_shadowcolor' => array('title'=> 'Watermark Shadow-Color', 'type' => 'text', 'data' => 'str', 'help'=>'Shadow Color of the watermark eg. ffffff '), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
'watermark_opacity' => array('title'=> 'Watermark Opacity', 'type' => 'text', 'data' => 'int', 'help'=>'Enter a number between 1 and 100'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
'watermark_opacity' => array('title'=> 'Watermark Opacity', 'type' => 'number', 'data' => 'int', 'help'=>'Enter a number between 1 and 100'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
);

View File

@ -690,7 +690,7 @@ $text .= "
<tr>
<td class='label'>".PRFLAN_136."</td>
<td class='control'>
".$frm->text('signup_maxip', $pref['signup_maxip'], 3)."
".$frm->number('signup_maxip', $pref['signup_maxip'], 3)."
<div class='field-help'>".PRFLAN_78."</div>
</td>
</tr>
@ -884,7 +884,7 @@ $text .= "
<tr>
<td class='label'>".CUSTSIG_16."</td>
<td class='control'>
".$frm->text('signup_pass_len', $pref['signup_pass_len'], 2)."
".$frm->number('signup_pass_len', $pref['signup_pass_len'], 2)."
</td>
</tr>
@ -914,13 +914,13 @@ $text .= "
<tr>
<td class='label'>".PRFLAN_158.":</td>
<td class='control'>
".$frm->text('displayname_maxlength', $pref['displayname_maxlength'], 3)."
".$frm->number('displayname_maxlength', $pref['displayname_maxlength'], 3)."
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_172.":</td>
<td class='control'>
".$frm->text('loginname_maxlength', $pref['loginname_maxlength'], 3)."
".$frm->number('loginname_maxlength', $pref['loginname_maxlength'], 3)."
</td>
</tr>
";
@ -1269,7 +1269,7 @@ $text .= "
<tr>
<td class='label'>".PRFLAN_36.":</td>
<td class='control'>
".$frm->text('antiflood_timeout', $pref['antiflood_timeout'], 3)."
".$frm->number('antiflood_timeout', $pref['antiflood_timeout'], 3)."
<div class='smalltext field-help'>".PRFLAN_38."</div>
</td>
</tr>

View File

@ -118,6 +118,18 @@ class e_form
return "<input type='text' name='{$name}' value='{$value}' maxlength='{$maxlength}'".$this->get_attributes($options, $name)." />";
}
function number($name, $value, $maxlength = 200, $options = array())
{
$maxlength = vartrue($parms['maxlength'], 255);
unset($parms['maxlength']);
if(!vartrue($parms['size'])) $parms['size'] = 15;
if(!vartrue($parms['class'])) $parms['class'] = 'tbox number e-spinner';
if(!$value) $value = '0';
return $this->text($key, $value, $maxlength, $parms);
}
function email($name, $value, $maxlength = 200, $options = array())
{
$options = $this->format_options('text', $name, $options);