mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Fix for admin-log of Admin-UI DB-inserts and fix for default userclass value in form element.
This commit is contained in:
parent
67d62ce723
commit
3102a6cb07
@ -1783,6 +1783,12 @@ class e_form
|
||||
$name .= '[]';
|
||||
}
|
||||
|
||||
if(empty($current_value) && !empty($uc_options)) // make the first in the opt list the default value.
|
||||
{
|
||||
$tmp = explode(",", $uc_options);
|
||||
$current_value = e107::getUserClass()->getClassFromKey($tmp[0]);
|
||||
}
|
||||
|
||||
return $this->select_open($name, $select_options)."\n".$this->_uc->vetted_tree($name, array($this, '_uc_select_cb'), $current_value, $uc_options, $opt_options)."\n".$this->select_close();
|
||||
}
|
||||
|
||||
|
@ -2911,7 +2911,7 @@ class e_admin_model extends e_front_model
|
||||
$sqlQry = $this->toSqlQuery('create');
|
||||
$table = $this->getModelTable();
|
||||
|
||||
$res = $sql->db_Insert($table, $sqlQry, $this->getParam('db_debug', false));
|
||||
$res = $sql->insert($table, $sqlQry, $this->getParam('db_debug', false));
|
||||
$this->_db_qry = $sql->getLastQuery();
|
||||
if(!$res)
|
||||
{
|
||||
@ -2924,6 +2924,7 @@ class e_admin_model extends e_front_model
|
||||
return false;
|
||||
}
|
||||
|
||||
e107::getAdminLog()->addSuccess('TABLE: '.$table, false);
|
||||
e107::getAdminLog()->save('ADMINUI_01');
|
||||
// e107::getAdminLog()->clear()->addSuccess($table,false)->addArray($sqlQry)->save('ADMINUI_01');
|
||||
|
||||
|
@ -94,6 +94,24 @@ class user_class
|
||||
$this->readTree(TRUE); // Initialise the classes on entry
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Take a key value such as 'member' and return it's numerical value.
|
||||
* @param $text
|
||||
* @return bool
|
||||
*/
|
||||
public function getClassFromKey($text)
|
||||
{
|
||||
if(isset($this->text_class_link[$text]))
|
||||
{
|
||||
return $this->text_class_link[$text];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return value of isAdmin
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user