mirror of
https://github.com/e107inc/e107.git
synced 2025-06-05 10:25:17 +02:00
Admin UI - Inline editing for userclasses
This commit is contained in:
parent
a55d70afba
commit
ae9b87a772
@ -213,7 +213,7 @@ class users_admin_ui extends e_admin_ui
|
||||
'user_email' => array('title' => LAN_EMAIL, 'type' => 'text', 'width' => 'auto'),
|
||||
'user_hideemail' => array('title' => LAN_USER_10, 'type' => 'boolean', 'width' => 'auto', 'thclass'=>'center', 'class'=>'center', 'filter'=>true, 'batch'=>true, 'readParms'=>'trueonly=1'),
|
||||
'user_xup' => array('title' => 'Xup', 'type' => 'text', 'width' => 'auto'),
|
||||
'user_class' => array('title' => LAN_USER_12, 'type' => 'userclasses' , 'writeParms' => 'classlist=classes', 'filter'=>true, 'batch'=>true),
|
||||
'user_class' => array('title' => LAN_USER_12, 'type' => 'userclasses' , 'writeParms' => 'classlist=classes', 'inline'=>true, 'filter'=>true, 'batch'=>true),
|
||||
'user_join' => array('title' => LAN_USER_14, 'type' => 'datestamp', 'width' => 'auto', 'writeParms'=>'readonly=1'),
|
||||
'user_lastvisit' => array('title' => LAN_USER_15, 'type' => 'datestamp', 'width' => 'auto'),
|
||||
'user_currentvisit' => array('title' => LAN_USER_16, 'type' => 'datestamp', 'width' => 'auto'),
|
||||
@ -1975,7 +1975,7 @@ class users_admin_form_ui extends e_admin_form_ui
|
||||
|
||||
}
|
||||
|
||||
|
||||
//TODO Reduce to simple edit/delete buttons only Other options included on edit page or available via inline or batch editing.
|
||||
function options($val, $mode) // old drop-down options.
|
||||
{
|
||||
$controller = $this->getController();
|
||||
@ -1995,8 +1995,9 @@ class users_admin_form_ui extends e_admin_form_ui
|
||||
|
||||
<input type='hidden' name='userid[{$user_id}]' value='{$user_id}' />
|
||||
<input type='hidden' name='userip[{$user_id}]' value='{$user_ip}' />
|
||||
<select name='useraction[{$user_id}]' onchange='this.form.submit()' class='tbox' style='width:75%'>
|
||||
<select name='useraction[{$user_id}]' onchange='this.form.submit()' class='e-select tbox' title='Modify' style='text-align:left;width:75%'>
|
||||
<option selected='selected' value=''> </option>";
|
||||
|
||||
if ($user_perms != "0")
|
||||
{
|
||||
// disabled user info <option value='userinfo'>".USRLAN_80."</option>
|
||||
|
@ -313,7 +313,9 @@ class e_form
|
||||
$url .= "&iframe=1";
|
||||
$title = "Media Manager : ".$category;
|
||||
|
||||
$ret = "<a title=\"{$title}\" rel='external' class='e-dialog' href='".$url."'>".$label."</a>";
|
||||
$ret = "<a title=\"{$title}\" rel='external' class='e-dialog' href='".$url."'>".$label."</a>"; // using colorbox.
|
||||
// $ret = "<a title=\"{$title}\" data-toggle='modal' data-cache='false' data-target='#eModal' href='".$url."'>".$label."</a>"; // using bootstrap.
|
||||
|
||||
|
||||
// $footer = "<div style=\'padding:5px;text-align:center\' <a href=\'#\' >Save</a></div>";
|
||||
$footer = '';
|
||||
@ -662,7 +664,7 @@ class e_form
|
||||
|
||||
//TODO Auto-calculate $name_fld from $id_fld ie. append "_usersearch" here ?
|
||||
|
||||
return $this->text($name_fld,$default_name,20, "typeahead=users&readonly=".vartrue($options['readonly']))
|
||||
return $this->text($name_fld,$default_name,20, "class=e-tip&title=Type name of user&typeahead=users&readonly=".vartrue($options['readonly']))
|
||||
.$this->hidden($id_fld,$default_id, array('id' => $this->name2id($id_fld)))." id# ".$default_id;
|
||||
|
||||
|
||||
@ -2180,17 +2182,52 @@ class e_form
|
||||
break;
|
||||
|
||||
case 'userclass':
|
||||
$value = $this->_uc->uc_get_classname($value);
|
||||
$dispvalue = $this->_uc->uc_get_classname($value);
|
||||
// Inline Editing.
|
||||
if(!vartrue($attributes['noedit']) && vartrue($parms['editable']) && !vartrue($parms['link'])) // avoid bad markup, better solution coming up
|
||||
{
|
||||
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
|
||||
|
||||
$array = e107::getUserClass()->uc_required_class_list(); //XXX Ugly looking (non-standard) function naming - TODO discuss name change.
|
||||
$source = str_replace('"',"'",json_encode($array));
|
||||
|
||||
//NOTE Leading ',' required on $value; so it picks up existing value.
|
||||
$value = "<a class='e-tip e-editable' data-placement='left' data-value=',".$value."' data-name='".$field."' data-source=\"".$source."\" title=\"".LAN_EDIT." ".$attributes['title']."\" data-type='select' data-pk='".$id."' data-url='".e_SELF."?mode=&action=inline&id={$id}&ajax_used=1' href='#'>".$dispvalue."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = $dispvalue;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'userclasses':
|
||||
|
||||
$classes = explode(',', $value);
|
||||
$value = array();
|
||||
$uv = array();
|
||||
foreach ($classes as $cid)
|
||||
{
|
||||
$value[] = $this->_uc->uc_get_classname($cid);
|
||||
$uv[] = $this->_uc->uc_get_classname($cid);
|
||||
}
|
||||
$value = implode(vartrue($parms['separator'],"<br />"), $value);
|
||||
$dispvalue = implode(vartrue($parms['separator'],"<br />"), $uv);
|
||||
|
||||
// Inline Editing.
|
||||
if(!vartrue($attributes['noedit']) && vartrue($parms['editable']) && !vartrue($parms['link'])) // avoid bad markup, better solution coming up
|
||||
{
|
||||
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
|
||||
|
||||
$array = e107::getUserClass()->uc_required_class_list('classes'); //XXX Ugly looking (non-standard) function naming - TODO discuss name change.
|
||||
$source = str_replace('"',"'",json_encode($array));
|
||||
|
||||
//NOTE Leading ',' required on $value; so it picks up existing value.
|
||||
$value = "<a class='e-tip e-editable' data-placement='left' data-value=',".$value."' data-name='".$field."' data-source=\"".$source."\" title=\"".LAN_EDIT." ".$attributes['title']."\" data-type='checklist' data-pk='".$id."' data-url='".e_SELF."?mode=&action=inline&id={$id}&ajax_used=1' href='#'>".$dispvalue."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = $dispvalue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
break;
|
||||
|
||||
/*case 'user_name':
|
||||
|
@ -78,7 +78,7 @@ class faq_cat_ui extends e_admin_ui
|
||||
'faq_info_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readParms'=>'editable=1'),
|
||||
'faq_info_about' => array('title'=> LAN_DESCRIPTION, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'), // Display name
|
||||
'faq_info_parent' => array('title'=> LAN_CATEGORY, 'type' => 'text', 'width' => '5%'),
|
||||
'faq_info_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'width' => 'auto', 'data' => 'int'),
|
||||
'faq_info_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'width' => 'auto', 'data' => 'int', 'inline'=>true),
|
||||
'faq_info_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => '5%', 'thclass' => 'left' ),
|
||||
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'center','readParms'=>'sort=1')
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user