1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 04:38:27 +01:00

Admin UI minor improvements; cleanup - warnings removal; various minor bugfixes

This commit is contained in:
secretr 2010-10-30 15:34:48 +00:00
parent 63f83d6f38
commit d9527349ad
6 changed files with 77 additions and 7 deletions

View File

@ -1309,6 +1309,7 @@ class e_admin_dispatcher
{
case 'caption':
$k2 = 'text';
$v = defset($v, $v);
break;
case 'url':
@ -3021,6 +3022,43 @@ class e_admin_ui extends e_admin_controller_ui
protected $pid;
protected $listQry;
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
@ -3659,11 +3697,17 @@ class e_admin_form_ui extends e_form
if($controller->getId())
{
$legend = LAN_UPDATE.' record #'.$controller->getId();
$form_start = vartrue($controller->headerUpdateMarkup);
$form_end = vartrue($controller->footerUpdateMarkup);
}
else
{
$legend = 'New record';
$form_start = vartrue($controller->headerCreateMarkup);
$form_end = vartrue($controller->footerCreateMarkup);
}
$forms = $models = array();
$forms[] = array(
'id' => $this->getElementId(),
@ -3674,6 +3718,8 @@ class e_admin_form_ui extends e_form
'create' => array(
'legend' => $legend,
'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_default' => $request->getPosted('__after_submit_action', $controller->getDefaultAction()), // or true for default redirect options
'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['class'] = 'tbox input-text filter';
$controller = $this->getController();
$filter_pre = vartrue($controller->preFiliterMarkup);
$filter_post = vartrue($controller->postFiliterMarkup);
$text = "
<form method='get' action='".e_SELF."'>
<fieldset class='e-filter'>
<legend class='e-hideme'>Filter</legend>
".$filter_pre."
<div class='left'>
".$this->text('searchquery', $current_query[0], 50, $input_options)."
".$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...' />
</span>
</div>
".$filter_post."
</fieldset>
</form>
";
@ -3876,6 +3927,7 @@ class e_admin_form_ui extends e_form
switch($val['type'])
{
case 'bool':
case 'boolean': //TODO modify description based on $val['parm]
$option['bool__'.$key.'__1'] = LAN_YES;
$option['bool__'.$key.'__0'] = LAN_NO;

View File

@ -609,9 +609,9 @@ class e_parse
function toForm($text)
{
if($text == '')
if(empty($text)) // fix - handle proper 0, Space etc values.
{
return '';
return $text;
}
$search = array('&#036;', '&quot;', '<', '>');
$replace = array('$', '"', '&lt;', '&gt;');

View File

@ -1845,6 +1845,7 @@ class e_form
$text .= "
<form method='post' action='".$url."' id='{$form['id']}-form' enctype='multipart/form-data'>
<div>
".vartrue($form['header'])."
".$this->token()."
";
@ -1855,6 +1856,7 @@ class e_form
}
$text .= "
".vartrue($form['footer'])."
</div>
</form>
";

View File

@ -92,6 +92,7 @@ class e_db_mysql
public $mySQLtableList = array(); // list of all Db tables.
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
/**

View File

@ -751,20 +751,34 @@ class e_validator
e107::getMessage()->addStack(sprintf($err_message, $err_code, $field_title), $this->_message_stack, (true === $custom ? E_MESSAGE_ERROR : $custom));
return $this;
}
//Additional message
$lan = LAN_VALIDATE_FAILMSG;
$dbgmsg = false;
if($err_message)
{
$lan = (strpos($err_message, '%1$s') !== false ? '' : '<strong>&quot;%1$s&quot;</strong> - ').$err_message; // custom, e.g. // default '<strong>&quot;%1$s&quot;</strong> field error: Custom error message. '
$dbgmsg = LAN_VALIDATE_FAILMSG;
}
//Core message
$msg = sprintf(
LAN_VALIDATE_FAILMSG, //'<strong>&quot;%s&quot;</strong> validation error: [#%d] %s. '
$lan, // default '<strong>&quot;%1$s&quot;</strong> validation error: [#%2$d] %3$s. '
$field_title,
$err_code,
$this->getErrorByCode($err_code)
);
//Additional message
if($err_message)
if($dbgmsg && defset('e107_DEBUG_LEVEL'))
{
$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);
return $this;

View File

@ -278,6 +278,7 @@ define("LAN_UPLOAD_SERVEROFF", "This option is disabled as file uploading is not
define("LAN_DISABLED","Disabled");
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_CONFIGURE", "Configure");