mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
e_form ready (although need more work and testing), more Administration work
This commit is contained in:
@@ -9,8 +9,8 @@
|
|||||||
* Image Administration Area
|
* Image Administration Area
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_admin/image.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_admin/image.php,v $
|
||||||
* $Revision: 1.16 $
|
* $Revision: 1.17 $
|
||||||
* $Date: 2008-12-12 09:55:33 $
|
* $Date: 2008-12-12 22:39:17 $
|
||||||
* $Author: secretr $
|
* $Author: secretr $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -27,6 +27,8 @@ require_once(e_HANDLER."form_handler.php");
|
|||||||
require_once(e_HANDLER."userclass_class.php");
|
require_once(e_HANDLER."userclass_class.php");
|
||||||
require_once(e_HANDLER."message_handler.php");
|
require_once(e_HANDLER."message_handler.php");
|
||||||
$rs = new form;
|
$rs = new form;
|
||||||
|
$frm = new e_form(); //new form handler
|
||||||
|
|
||||||
$emessage = &eMessage::getInstance();
|
$emessage = &eMessage::getInstance();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -245,7 +247,7 @@ if (isset($_POST['show_avatars']))
|
|||||||
$users = IMALAN_21." | ";
|
$users = IMALAN_21." | ";
|
||||||
$row = array('user_id' => '');
|
$row = array('user_id' => '');
|
||||||
$image_pre = '';
|
$image_pre = '';
|
||||||
$disabled = '';
|
$disabled = false;
|
||||||
if ($sql->db_Select("user", "*", "user_image='-upload-".$tp->toDB($image_name)."' OR user_sess='".$tp->toDB($image_name)."'"))
|
if ($sql->db_Select("user", "*", "user_image='-upload-".$tp->toDB($image_name)."' OR user_sess='".$tp->toDB($image_name)."'"))
|
||||||
{
|
{
|
||||||
$row = $sql->db_Fetch();
|
$row = $sql->db_Fetch();
|
||||||
@@ -263,7 +265,7 @@ if (isset($_POST['show_avatars']))
|
|||||||
|
|
||||||
//Friendly UI - click text to select a form element
|
//Friendly UI - click text to select a form element
|
||||||
$img_src = '<span class="error">'.IMALAN_70.'</span>';
|
$img_src = '<span class="error">'.IMALAN_70.'</span>';
|
||||||
$disabled = ' disabled="disabled"';
|
$disabled = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -289,14 +291,12 @@ if (isset($_POST['show_avatars']))
|
|||||||
<div class='image-users'>{$users}</div>
|
<div class='image-users'>{$users}</div>
|
||||||
<div class='image-preview'>{$img_src}</div>
|
<div class='image-preview'>{$img_src}</div>
|
||||||
<div class='image-delete'>
|
<div class='image-delete'>
|
||||||
<input type='checkbox' class='checkbox' id='image-action-{$count}' name='multiaction[]' value='{$row['user_id']}#{$image_pre}{$image_name}'{$disabled} />
|
".$frm->checkbox('multiaction[]', "{$row['user_id']}#{$image_pre}{$image_name}", false, array('id' => false, 'disabled' => $disabled))."
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
";
|
";
|
||||||
|
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,11 +304,11 @@ if (isset($_POST['show_avatars']))
|
|||||||
<div class='spacer clear'>
|
<div class='spacer clear'>
|
||||||
<div class='buttons-bar'>
|
<div class='buttons-bar'>
|
||||||
<input type='hidden' name='show_avatars' value='1' />
|
<input type='hidden' name='show_avatars' value='1' />
|
||||||
<button class='action' type='button' name='check_all' value='".IMALAN_59."'><span>".IMALAN_59."</span></button>
|
".$frm->admin_button('check_all', IMALAN_59, 'action')."
|
||||||
<button class='action' type='button' name='uncheck_all' value='".IMALAN_60."'><span>".IMALAN_60."</span></button>
|
".$frm->admin_button('uncheck_all', IMALAN_60, 'action')."
|
||||||
<button class='delete' type='submit' name='submit_show_delete_multi' value='".IMALAN_58."'><span>".IMALAN_58."</span></button>
|
".$frm->admin_button('submit_show_delete_multi', IMALAN_58, 'delete')."
|
||||||
<button class='delete' type='submit' name='submit_show_deleteall' value='".IMALAN_25."'><span>".IMALAN_25."</span></button>
|
".$frm->admin_button('submit_show_deleteall', IMALAN_25, 'delete')."
|
||||||
<button class='cancel' type='submit' name='submit_cancel_show' value='".IMALAN_68."'><span>".IMALAN_68."</span></button>
|
".$frm->admin_button('submit_cancel_show', IMALAN_68, 'cancel')."
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
@@ -447,9 +447,9 @@ if (isset($_POST['check_avatar_sizes']))
|
|||||||
</table>
|
</table>
|
||||||
<div class='buttons-bar'>
|
<div class='buttons-bar'>
|
||||||
<input type='hidden' name='check_avatar_sizes' value='1' />
|
<input type='hidden' name='check_avatar_sizes' value='1' />
|
||||||
<button class='action' type='button' name='check_all' value='".IMALAN_59."'><span>".IMALAN_59."</span></button>
|
".$frm->admin_button('check_all', IMALAN_59, 'action')."
|
||||||
<button class='action' type='button' name='uncheck_all' value='".IMALAN_60."'><span>".IMALAN_60."</span></button>
|
".$frm->admin_button('uncheck_all', IMALAN_60, 'action')."
|
||||||
<button class='delete' type='submit' name='submit_avdelete_multi' value='".IMALAN_58."'><span>".IMALAN_58."</span></button>
|
".$frm->admin_button('submit_avdelete_multi', IMALAN_58, 'delete')."
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
@@ -543,7 +543,7 @@ $text = "
|
|||||||
</td>
|
</td>
|
||||||
<td class='control'>
|
<td class='control'>
|
||||||
<div class='auto-toggle-area autocheck'>
|
<div class='auto-toggle-area autocheck'>
|
||||||
<input class='checkbox' type='checkbox' name='image_post' value='1'".($pref['image_post'] ? " checked='checked'" : '')." />
|
".$frm->checkbox('image_post', 1, $pref['image_post'])."
|
||||||
<div class='smalltext field-help'>".IMALAN_2."</div>
|
<div class='smalltext field-help'>".IMALAN_2."</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -563,10 +563,10 @@ $text = "
|
|||||||
".IMALAN_12."
|
".IMALAN_12."
|
||||||
</td>
|
</td>
|
||||||
<td class='control'>
|
<td class='control'>
|
||||||
<select name='image_post_disabled_method' class='tbox select'>
|
".$frm->select_open('image_post_disabled_method')."
|
||||||
<option value='0'".($pref['image_post_disabled_method'] == "0" ? " selected='selected'" : '').">".IMALAN_14."</option>
|
".$frm->option(IMALAN_14, '0', ($pref['image_post_disabled_method'] == "0"))."
|
||||||
<option value='1'".($pref['image_post_disabled_method'] == "1" ? " selected='selected'" : "").">".IMALAN_15."</option>
|
".$frm->option(IMALAN_15, '1', ($pref['image_post_disabled_method'] == "1"))."
|
||||||
</select>
|
".$frm->select_close()."
|
||||||
<div class='smalltext field-help'>".IMALAN_13."</div>
|
<div class='smalltext field-help'>".IMALAN_13."</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -574,11 +574,11 @@ $text = "
|
|||||||
<tr>
|
<tr>
|
||||||
<td class='label'>".IMALAN_3."<div class='label-note'>".IMALAN_54." {$gd_version}</div></td>
|
<td class='label'>".IMALAN_3."<div class='label-note'>".IMALAN_54." {$gd_version}</div></td>
|
||||||
<td class='control'>
|
<td class='control'>
|
||||||
<select name='resize_method' class='tbox'>
|
".$frm->select_open('resize_method')."
|
||||||
<option".($pref['resize_method'] == "gd1" ? " selected='selected'" : '').">gd1</option>
|
".$frm->option('gd1', 'gd1', ($pref['resize_method'] == "gd1"))."
|
||||||
<option".($pref['resize_method'] == "gd2" ? " selected='selected'" : '').">gd2</option>
|
".$frm->option('gd2', 'gd2', ($pref['resize_method'] == "gd2"))."
|
||||||
<option".($pref['resize_method'] == "ImageMagick" ? " selected='selected'" : '').">ImageMagick</option>
|
".$frm->option('ImageMagick', 'ImageMagick', ($pref['resize_method'] == "ImageMagick"))."
|
||||||
</select>
|
".$frm->select_close()."
|
||||||
<div class='smalltext field-help'>".IMALAN_4."</div>
|
<div class='smalltext field-help'>".IMALAN_4."</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -586,7 +586,7 @@ $text = "
|
|||||||
<tr>
|
<tr>
|
||||||
<td class='label'>".IMALAN_5."<div class='label-note'>{$IM_NOTE}</div></td>
|
<td class='label'>".IMALAN_5."<div class='label-note'>{$IM_NOTE}</div></td>
|
||||||
<td class='control'>
|
<td class='control'>
|
||||||
<input class='tbox input-text' type='text' name='im_path' size='40' value='{$pref['im_path']}' maxlength='200' />
|
".$frm->text('im_path', $pref['im_path'])."
|
||||||
<div class='smalltext field-help'>".IMALAN_6."</div>
|
<div class='smalltext field-help'>".IMALAN_6."</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -596,7 +596,7 @@ $text = "
|
|||||||
</td>
|
</td>
|
||||||
<td class='control'>
|
<td class='control'>
|
||||||
<div class='auto-toggle-area autocheck'>
|
<div class='auto-toggle-area autocheck'>
|
||||||
<input type='checkbox' class='checkbox' name='enable_png_image_fix' value='1'".($pref['enable_png_image_fix'] ? " checked='checked'" : '')." />
|
".$frm->checkbox('enable_png_image_fix', 1, ($pref['enable_png_image_fix']))."
|
||||||
<div class='smalltext field-help'>".IMALAN_35."</div>
|
<div class='smalltext field-help'>".IMALAN_35."</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -605,20 +605,20 @@ $text = "
|
|||||||
<tr>
|
<tr>
|
||||||
<td class='label'>".IMALAN_16."</td>
|
<td class='label'>".IMALAN_16."</td>
|
||||||
<td class='control'>
|
<td class='control'>
|
||||||
<button class='action' type='submit' name='show_avatars'><span>".IMALAN_17."</span></button>
|
".$frm->admin_button('show_avatars', IMALAN_17)."
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class='label'>".IMALAN_36."</td>
|
<td class='label'>".IMALAN_36."</td>
|
||||||
<td class='control'>
|
<td class='control'>
|
||||||
<button class='action' type='submit' name='check_avatar_sizes'><span>".IMALAN_17."</span></button>
|
".$frm->admin_button('check_avatar_sizes', IMALAN_17)."
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class='buttons-bar center'>
|
<div class='buttons-bar center'>
|
||||||
<button class='update' type='submit' name='update_options' value='".IMALAN_8."'><span>".IMALAN_8."</span></button>
|
".$frm->admin_button('update_options', IMALAN_8, 'update')."
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>";
|
</form>";
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
* Form Handler
|
* Form Handler
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $
|
||||||
* $Revision: 1.4 $
|
* $Revision: 1.5 $
|
||||||
* $Date: 2008-12-12 16:36:45 $
|
* $Date: 2008-12-12 22:39:17 $
|
||||||
* $Author: secretr $
|
* $Author: secretr $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -38,10 +38,18 @@ if (!defined('e107_INIT')) { exit; }
|
|||||||
*
|
*
|
||||||
* - size => (int) size attribute value (used when needed)
|
* - size => (int) size attribute value (used when needed)
|
||||||
* default: 40
|
* default: 40
|
||||||
|
*
|
||||||
|
* - title (string) title attribute
|
||||||
|
* default: empty string (omitted)
|
||||||
*
|
*
|
||||||
* - readonly => (bool) readonly attribute
|
* - readonly => (bool) readonly attribute
|
||||||
* default: false
|
* default: false
|
||||||
*
|
*
|
||||||
|
* - selected => (bool) selected attribute (used when needed)
|
||||||
|
* default: false
|
||||||
|
*
|
||||||
|
* checked => (bool) checked attribute (used when needed)
|
||||||
|
* default: false
|
||||||
* - disabled => (bool) disabled attribute
|
* - disabled => (bool) disabled attribute
|
||||||
* default: false
|
* default: false
|
||||||
*
|
*
|
||||||
@@ -66,24 +74,113 @@ class e_form
|
|||||||
function text($name, $value, $maxlength = 200, $options = array())
|
function text($name, $value, $maxlength = 200, $options = array())
|
||||||
{
|
{
|
||||||
$options = $this->format_options('text', $name, $options);
|
$options = $this->format_options('text', $name, $options);
|
||||||
return "<input type='text' name='{$name}' value='{$value}' maxlength={$maxlength}".$this->get_attributes($options)." />";
|
return "<input type='text' name='{$name}' value='{$value}' maxlength='{$maxlength}'".$this->get_attributes($options)." />";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function file($name, $options = array())
|
||||||
|
{
|
||||||
|
$options = $this->format_options('text', $name, $options);
|
||||||
|
return "<input type='text' name='{$name}'".$this->get_attributes($options)." />";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function password($name, $maxlength = 50, $options = array())
|
function password($name, $maxlength = 50, $options = array())
|
||||||
{
|
{
|
||||||
$options = $this->format_options('text', $name, $options);
|
$options = $this->format_options('text', $name, $options);
|
||||||
return "<input type='password' name='{$name}' value='' maxlength={$maxlength}".$this->get_attributes($options)." />";
|
return "<input type='password' name='{$name}' value='' maxlength='{$maxlength}'".$this->get_attributes($options)." />";
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------ Work in progress START --------------------------->
|
|
||||||
function textarea($name, $value, $rows, $cols, $options = array())
|
function textarea($name, $value, $rows = 15, $cols = 40, $options = array())
|
||||||
{
|
{
|
||||||
//TODO - Add title to option array
|
$options = $this->format_options('textarea', $name, $options);
|
||||||
|
return "<textarea name='{$name}' rows='{$rows}' cols='{$cols}'".$this->get_attributes($options).">{$value}</textarea>";
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkbox($name, $value, $checked = false, $options = array())
|
||||||
|
{
|
||||||
|
$options['checked'] = $checked; //comes as separate argument just for convenience
|
||||||
|
$options = $this->format_options('checkbox', $name, $options);
|
||||||
|
return "<input type='checkbox' name='{$name}' value='{$value}'".$this->get_attributes($options)." />";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function radio($name, $value, $checked = false, $options = array())
|
||||||
|
{
|
||||||
|
$options['checked'] = $checked; //comes as separate argument just for convenience
|
||||||
|
$options = $this->format_options('radio', $name, $options);
|
||||||
|
return "<input type='radio' name='{$name}' value='".$value."'".$this->get_attributes($options)." />";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function label($text, $for_id, $name = '')
|
||||||
|
{
|
||||||
|
if($name) $for_id = $this->_format_id($for_id, $name);
|
||||||
|
return "<label for='{$for_id}'>{$text}</label>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function select_open($name, $options = array())
|
||||||
|
{
|
||||||
|
$options = $this->format_options('select', $name, $options);
|
||||||
|
return "<select name='{$name}'".$this->get_attributes($options).">";
|
||||||
|
}
|
||||||
|
|
||||||
|
function optgroup_open($label, $disabled)
|
||||||
|
{
|
||||||
|
return "<optgroup class='optgroup' label='{$label}'".($disabled ? " disabled='disabled'" : '').">";
|
||||||
|
}
|
||||||
|
|
||||||
|
function option($option_name, $value, $selected = false, $options = array())
|
||||||
|
{
|
||||||
|
if(false === $value) $value = '';
|
||||||
|
$options['selected'] = $selected; //comes as separate argument just for convenience
|
||||||
|
$options = $this->format_options('option', '', $options);
|
||||||
|
return "<option value='{$value}'".$this->get_attributes($options).">{$option_name}</option>";
|
||||||
|
}
|
||||||
|
|
||||||
//------------------ Work in progress END --------------------------->
|
function optgroup_close()
|
||||||
|
{
|
||||||
|
return "</optgroup>";
|
||||||
|
}
|
||||||
|
|
||||||
|
function select_close()
|
||||||
|
{
|
||||||
|
return "</select>";
|
||||||
|
}
|
||||||
|
|
||||||
|
function hidden($name, $value, $options = array())
|
||||||
|
{
|
||||||
|
$options = $this->format_options('hidden', $name, $options);
|
||||||
|
return "<input type='hidden' name='{$name}' value='{$value}'".$this->get_attributes($options)." />";
|
||||||
|
}
|
||||||
|
|
||||||
|
function submit($name, $value, $options = array())
|
||||||
|
{
|
||||||
|
$options = $this->format_options('submit', $name, $options);
|
||||||
|
return "<input class='button' type='submit' name='{$name}' value='{$value}'".$this->get_attributes($options)." />";
|
||||||
|
}
|
||||||
|
|
||||||
|
function submit_image($name, $value, $image, $options = array())
|
||||||
|
{
|
||||||
|
$options = $this->format_options('submit', $name, $options);
|
||||||
|
return "<input class='image' type='image' src='{$image}' name='{$name}' value='{$value}'".$this->get_attributes($options)." />";
|
||||||
|
}
|
||||||
|
|
||||||
|
function admin_button($name, $value, $action = '', $label = '', $options = array())
|
||||||
|
{
|
||||||
|
$options['class'] = $action; //additional classes not allowed
|
||||||
|
$btype = 'submit';
|
||||||
|
if($action == 'action') $btype = 'button';
|
||||||
|
$options = $this->format_options('admin_button', $name, $options);
|
||||||
|
if(empty($label)) $label = $value;
|
||||||
|
|
||||||
|
return "
|
||||||
|
<button type='{$btype}' name='{$name}' value='{$value}'".$this->get_attributes($options).">
|
||||||
|
<span>{$label}</span>
|
||||||
|
</button>
|
||||||
|
";
|
||||||
|
}
|
||||||
|
|
||||||
function get_attributes($options)
|
function get_attributes($options)
|
||||||
{
|
{
|
||||||
$ret = '';
|
$ret = '';
|
||||||
@@ -103,16 +200,29 @@ class e_form
|
|||||||
case 'size':
|
case 'size':
|
||||||
if($optval) $ret .= " size='{$optval}'";
|
if($optval) $ret .= " size='{$optval}'";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'title':
|
||||||
|
if($optval) $ret .= " title='{$optval}'";
|
||||||
|
break;
|
||||||
|
|
||||||
case 'tabindex':
|
case 'tabindex':
|
||||||
if($optval === false || !$this->_tabindex_enabled) break;
|
if($optval === false || !$this->_tabindex_enabled) break;
|
||||||
$ret .= " tabindex='".($optval ? $optval : $this->_tabindex_counter++)."'";
|
$this->_tabindex_counter++;
|
||||||
|
$ret .= " tabindex='".($optval ? $optval : $this->_tabindex_counter)."'";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'readonly':
|
case 'readonly':
|
||||||
if($optval) $ret .= " readonly='readonly'";
|
if($optval) $ret .= " readonly='readonly'";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'selected':
|
||||||
|
if($optval) $ret .= " selected='selected'";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'checked':
|
||||||
|
if($optval) $ret .= " checked='checked'";
|
||||||
|
break;
|
||||||
|
|
||||||
case 'disabled':
|
case 'disabled':
|
||||||
if($optval) $ret .= " disabled='disabled'";
|
if($optval) $ret .= " disabled='disabled'";
|
||||||
break;
|
break;
|
||||||
@@ -174,11 +284,15 @@ class e_form
|
|||||||
if(isset($this->_cached_attributes[$type])) return $this->_cached_attributes[$type];
|
if(isset($this->_cached_attributes[$type])) return $this->_cached_attributes[$type];
|
||||||
|
|
||||||
$def_options = array(
|
$def_options = array(
|
||||||
|
'id' => '',
|
||||||
'class' => '',
|
'class' => '',
|
||||||
|
'title' => '',
|
||||||
'size' => '',
|
'size' => '',
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
|
'selected' => false,
|
||||||
|
'checked' => false,
|
||||||
'disabled' => false,
|
'disabled' => false,
|
||||||
'tabindex' => $this->_tab_counter,
|
'tabindex' => 0,
|
||||||
'other' => ''
|
'other' => ''
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -189,34 +303,42 @@ class e_form
|
|||||||
|
|
||||||
case 'text':
|
case 'text':
|
||||||
$def_options['class'] = 'tbox input-text';
|
$def_options['class'] = 'tbox input-text';
|
||||||
|
unset($def_options['selected'], $def_options['checked']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
$def_options['class'] = 'tbox textarea';
|
$def_options['class'] = 'tbox textarea';
|
||||||
|
unset($def_options['selected'], $def_options['checked'], $def_options['size']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'select':
|
case 'select':
|
||||||
$def_options['class'] = 'tbox select';
|
$def_options['class'] = 'tbox select';
|
||||||
|
unset($def_options['checked'], $def_options['checked']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'option':
|
||||||
|
$def_options = array('class' => '', 'selected' => false, 'other' => '');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'radio':
|
case 'radio':
|
||||||
$def_options['class'] = 'radio';
|
$def_options['class'] = 'radio';
|
||||||
|
unset($def_options['size'], $def_options['selected']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
$def_options['class'] = 'checkbox';
|
$def_options['class'] = 'checkbox';
|
||||||
|
unset($def_options['size'], $def_options['selected']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'submit':
|
case 'submit':
|
||||||
$def_options['class'] = 'button';
|
$def_options['class'] = 'button';
|
||||||
|
unset($def_options['checked'], $def_options['selected'], $def_options['readonly']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'admin_button':
|
case 'admin_button':
|
||||||
|
unset($def_options['checked'], $def_options['selected'], $def_options['readonly']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'option':
|
|
||||||
$def_options = array('class' => '', 'other' => '');
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_cached_attributes[$type] = $def_options;
|
$this->_cached_attributes[$type] = $def_options;
|
||||||
|
@@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/userclass_class.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/userclass_class.php,v $
|
||||||
| $Revision: 1.22 $
|
| $Revision: 1.23 $
|
||||||
| $Date: 2008-12-07 16:37:37 $
|
| $Date: 2008-12-12 22:39:17 $
|
||||||
| $Author: e107steved $
|
| $Author: secretr $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -280,7 +280,7 @@ class user_class
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only return the select box if we've ended up with some options
|
// Only return the select box if we've ended up with some options
|
||||||
if ($text) $text = "<select class='tbox' name='{$fieldname}' {$extra_js}>\n".$text."</select>\n";
|
if ($text) $text = "<select class='tbox select' name='{$fieldname}' {$extra_js}>\n".$text."</select>\n";
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,7 +388,7 @@ class user_class
|
|||||||
{
|
{
|
||||||
$c = (in_array($k,$curArray)) ? " checked='checked'" : "";
|
$c = (in_array($k,$curArray)) ? " checked='checked'" : "";
|
||||||
if ($showdescription) $v .= " (".$this->uc_get_classdescription($k).")";
|
if ($showdescription) $v .= " (".$this->uc_get_classdescription($k).")";
|
||||||
$ret .= "<label><input type='checkbox' name='{$fieldname}[{$k}]' value='{$k}' {$c} /> ".$v."</label><br />\n";
|
$ret .= "<label><input type='checkbox' class='checkbox' name='{$fieldname}[{$k}]' value='{$k}' {$c} /> ".$v."</label><br />\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,7 +399,7 @@ class user_class
|
|||||||
foreach($tmpl as $lang)
|
foreach($tmpl as $lang)
|
||||||
{
|
{
|
||||||
$c = (in_array($lang, $curArray)) ? " checked='checked' " : "";
|
$c = (in_array($lang, $curArray)) ? " checked='checked' " : "";
|
||||||
$ret .= "<label><input type='checkbox' name='{$fieldname}[{$lang}]' value='1' {$c} /> {$lang}</label><br />";
|
$ret .= "<label><input type='checkbox' class='checkbox' name='{$fieldname}[{$lang}]' value='1' {$c} /> {$lang}</label><br />";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
@@ -501,7 +501,7 @@ class user_class
|
|||||||
// $style = " style='text-indent:".(12*$nest_level)."px'";
|
// $style = " style='text-indent:".(12*$nest_level)."px'";
|
||||||
$style = " style='text-indent:".(1.2*$nest_level)."em'";
|
$style = " style='text-indent:".(1.2*$nest_level)."em'";
|
||||||
}
|
}
|
||||||
return "<div {$style}><input type='checkbox' name='{$treename}[]' id='{$treename}_{$classnum}' value='{$classnum}'{$chk} />".$this->class_tree[$classnum]['userclass_name']."</div>\n";
|
return "<div {$style}><input type='checkbox' class='checkbox' name='{$treename}[]' id='{$treename}_{$classnum}' value='{$classnum}'{$chk} />".$this->class_tree[$classnum]['userclass_name']."</div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -519,7 +519,7 @@ class user_class
|
|||||||
{
|
{
|
||||||
$style = " style='text-indent:".(1.2*$nest_level)."em'";
|
$style = " style='text-indent:".(1.2*$nest_level)."em'";
|
||||||
}
|
}
|
||||||
return "<div {$style}><input type='checkbox' name='{$treename}[]' id='{$treename}_{$classnum}' value='{$classnum}'{$chk} />".$this->class_tree[$classnum]['userclass_name'].' ('.$this->class_tree[$classnum]['userclass_description'].")</div>\n";
|
return "<div {$style}><input type='checkbox' class='checkbox' name='{$treename}[]' id='{$treename}_{$classnum}' value='{$classnum}'{$chk} />".$this->class_tree[$classnum]['userclass_name'].' ('.$this->class_tree[$classnum]['userclass_description'].")</div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user