mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
Admin UI minor improvements; cleanup - warnings removal; various minor bugfixes
This commit is contained in:
parent
63f83d6f38
commit
d9527349ad
@ -1309,6 +1309,7 @@ class e_admin_dispatcher
|
|||||||
{
|
{
|
||||||
case 'caption':
|
case 'caption':
|
||||||
$k2 = 'text';
|
$k2 = 'text';
|
||||||
|
$v = defset($v, $v);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'url':
|
case 'url':
|
||||||
@ -3022,6 +3023,43 @@ class e_admin_ui extends e_admin_controller_ui
|
|||||||
protected $listQry;
|
protected $listQry;
|
||||||
protected $editQry;
|
protected $editQry;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Markup to be auto-inserted before List filter
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $preFiliterMarkup = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Markup to be auto-inserted after List filter
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $postFiliterMarkup = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Markup to be auto-inserted at the top of Create form
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $headerCreateMarkup = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Markup to be auto-inserted at the bottom of Create form
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $footerCreateMarkup = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Markup to be auto-inserted at the top of Update form
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $headerUpdateMarkup = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Markup to be auto-inserted at the bottom of Update form
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $footerUpdateMarkup = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param e_admin_request $request
|
* @param e_admin_request $request
|
||||||
@ -3659,11 +3697,17 @@ class e_admin_form_ui extends e_form
|
|||||||
if($controller->getId())
|
if($controller->getId())
|
||||||
{
|
{
|
||||||
$legend = LAN_UPDATE.' record #'.$controller->getId();
|
$legend = LAN_UPDATE.' record #'.$controller->getId();
|
||||||
|
$form_start = vartrue($controller->headerUpdateMarkup);
|
||||||
|
$form_end = vartrue($controller->footerUpdateMarkup);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$legend = 'New record';
|
$legend = 'New record';
|
||||||
|
$form_start = vartrue($controller->headerCreateMarkup);
|
||||||
|
$form_end = vartrue($controller->footerCreateMarkup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$forms = $models = array();
|
$forms = $models = array();
|
||||||
$forms[] = array(
|
$forms[] = array(
|
||||||
'id' => $this->getElementId(),
|
'id' => $this->getElementId(),
|
||||||
@ -3674,6 +3718,8 @@ class e_admin_form_ui extends e_form
|
|||||||
'create' => array(
|
'create' => array(
|
||||||
'legend' => $legend,
|
'legend' => $legend,
|
||||||
'fields' => $controller->getFields(), //see e_admin_ui::$fields
|
'fields' => $controller->getFields(), //see e_admin_ui::$fields
|
||||||
|
'header' => $form_start,
|
||||||
|
'footer' => $form_end,
|
||||||
'after_submit_options' => true, // or true for default redirect options
|
'after_submit_options' => true, // or true for default redirect options
|
||||||
'after_submit_default' => $request->getPosted('__after_submit_action', $controller->getDefaultAction()), // or true for default redirect options
|
'after_submit_default' => $request->getPosted('__after_submit_action', $controller->getDefaultAction()), // or true for default redirect options
|
||||||
'triggers' => 'auto', // standard create/update-cancel triggers
|
'triggers' => 'auto', // standard create/update-cancel triggers
|
||||||
@ -3770,10 +3816,14 @@ class e_admin_form_ui extends e_form
|
|||||||
}
|
}
|
||||||
$input_options['id'] = false;
|
$input_options['id'] = false;
|
||||||
$input_options['class'] = 'tbox input-text filter';
|
$input_options['class'] = 'tbox input-text filter';
|
||||||
|
$controller = $this->getController();
|
||||||
|
$filter_pre = vartrue($controller->preFiliterMarkup);
|
||||||
|
$filter_post = vartrue($controller->postFiliterMarkup);
|
||||||
$text = "
|
$text = "
|
||||||
<form method='get' action='".e_SELF."'>
|
<form method='get' action='".e_SELF."'>
|
||||||
<fieldset class='e-filter'>
|
<fieldset class='e-filter'>
|
||||||
<legend class='e-hideme'>Filter</legend>
|
<legend class='e-hideme'>Filter</legend>
|
||||||
|
".$filter_pre."
|
||||||
<div class='left'>
|
<div class='left'>
|
||||||
".$this->text('searchquery', $current_query[0], 50, $input_options)."
|
".$this->text('searchquery', $current_query[0], 50, $input_options)."
|
||||||
".$this->select_open('filter_options', array('class' => 'tbox select filter', 'id' => false))."
|
".$this->select_open('filter_options', array('class' => 'tbox select filter', 'id' => false))."
|
||||||
@ -3789,6 +3839,7 @@ class e_admin_form_ui extends e_form
|
|||||||
<img src='".e_IMAGE_ABS."generic/loading_16.gif' class='icon action S16' alt='Loding...' />
|
<img src='".e_IMAGE_ABS."generic/loading_16.gif' class='icon action S16' alt='Loding...' />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
".$filter_post."
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
";
|
";
|
||||||
@ -3876,6 +3927,7 @@ class e_admin_form_ui extends e_form
|
|||||||
|
|
||||||
switch($val['type'])
|
switch($val['type'])
|
||||||
{
|
{
|
||||||
|
case 'bool':
|
||||||
case 'boolean': //TODO modify description based on $val['parm]
|
case 'boolean': //TODO modify description based on $val['parm]
|
||||||
$option['bool__'.$key.'__1'] = LAN_YES;
|
$option['bool__'.$key.'__1'] = LAN_YES;
|
||||||
$option['bool__'.$key.'__0'] = LAN_NO;
|
$option['bool__'.$key.'__0'] = LAN_NO;
|
||||||
|
@ -609,9 +609,9 @@ class e_parse
|
|||||||
|
|
||||||
function toForm($text)
|
function toForm($text)
|
||||||
{
|
{
|
||||||
if($text == '')
|
if(empty($text)) // fix - handle proper 0, Space etc values.
|
||||||
{
|
{
|
||||||
return '';
|
return $text;
|
||||||
}
|
}
|
||||||
$search = array('$', '"', '<', '>');
|
$search = array('$', '"', '<', '>');
|
||||||
$replace = array('$', '"', '<', '>');
|
$replace = array('$', '"', '<', '>');
|
||||||
|
@ -1845,6 +1845,7 @@ class e_form
|
|||||||
$text .= "
|
$text .= "
|
||||||
<form method='post' action='".$url."' id='{$form['id']}-form' enctype='multipart/form-data'>
|
<form method='post' action='".$url."' id='{$form['id']}-form' enctype='multipart/form-data'>
|
||||||
<div>
|
<div>
|
||||||
|
".vartrue($form['header'])."
|
||||||
".$this->token()."
|
".$this->token()."
|
||||||
";
|
";
|
||||||
|
|
||||||
@ -1855,6 +1856,7 @@ class e_form
|
|||||||
}
|
}
|
||||||
|
|
||||||
$text .= "
|
$text .= "
|
||||||
|
".vartrue($form['footer'])."
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
";
|
";
|
||||||
|
@ -92,6 +92,7 @@ class e_db_mysql
|
|||||||
public $mySQLtableList = array(); // list of all Db tables.
|
public $mySQLtableList = array(); // list of all Db tables.
|
||||||
|
|
||||||
public $mySQLtableListLanguage = array(); // Db table list for the currently selected language
|
public $mySQLtableListLanguage = array(); // Db table list for the currently selected language
|
||||||
|
public $mySQLtablelist = array();
|
||||||
|
|
||||||
protected $dbFieldDefs = array(); // Local cache - Field type definitions for _FIELD_DEFS and _NOTNULL arrays
|
protected $dbFieldDefs = array(); // Local cache - Field type definitions for _FIELD_DEFS and _NOTNULL arrays
|
||||||
/**
|
/**
|
||||||
|
@ -752,19 +752,33 @@ class e_validator
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Additional message
|
||||||
|
$lan = LAN_VALIDATE_FAILMSG;
|
||||||
|
$dbgmsg = false;
|
||||||
|
if($err_message)
|
||||||
|
{
|
||||||
|
$lan = (strpos($err_message, '%1$s') !== false ? '' : '<strong>"%1$s"</strong> - ').$err_message; // custom, e.g. // default '<strong>"%1$s"</strong> field error: Custom error message. '
|
||||||
|
$dbgmsg = LAN_VALIDATE_FAILMSG;
|
||||||
|
}
|
||||||
|
|
||||||
//Core message
|
//Core message
|
||||||
$msg = sprintf(
|
$msg = sprintf(
|
||||||
LAN_VALIDATE_FAILMSG, //'<strong>"%s"</strong> validation error: [#%d] %s. '
|
$lan, // default '<strong>"%1$s"</strong> validation error: [#%2$d] %3$s. '
|
||||||
$field_title,
|
$field_title,
|
||||||
$err_code,
|
$err_code,
|
||||||
$this->getErrorByCode($err_code)
|
$this->getErrorByCode($err_code)
|
||||||
);
|
);
|
||||||
|
|
||||||
//Additional message
|
if($dbgmsg && defset('e107_DEBUG_LEVEL'))
|
||||||
if($err_message)
|
|
||||||
{
|
{
|
||||||
$msg .= ' '.$err_message;
|
e107::getMessage()->addDebug(sprintf(
|
||||||
|
$dbgmsg,
|
||||||
|
$field_title,
|
||||||
|
$err_code,
|
||||||
|
$this->getErrorByCode($err_code)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
e107::getMessage()->addStack($msg, $this->_message_stack, E_MESSAGE_ERROR);
|
e107::getMessage()->addStack($msg, $this->_message_stack, E_MESSAGE_ERROR);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -278,6 +278,7 @@ define("LAN_UPLOAD_SERVEROFF", "This option is disabled as file uploading is not
|
|||||||
|
|
||||||
define("LAN_DISABLED","Disabled");
|
define("LAN_DISABLED","Disabled");
|
||||||
define("LAN_ENABLED", "Enabled");
|
define("LAN_ENABLED", "Enabled");
|
||||||
|
define("LAN_BOOL_REVERSE", "Invert");
|
||||||
|
|
||||||
define("LAN_PRESET_CONFIRMSAVE","Save current form values as the default for this page?");
|
define("LAN_PRESET_CONFIRMSAVE","Save current form values as the default for this page?");
|
||||||
define("LAN_CONFIGURE", "Configure");
|
define("LAN_CONFIGURE", "Configure");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user