diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 10e310fa6..a347fa12d 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -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 = "
Filter + ".$filter_pre."
".$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 Loding...
+ ".$filter_post."
"; @@ -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; diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index a4b566092..27cb59840 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -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('$', '"', '<', '>'); $replace = array('$', '"', '<', '>'); diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 8872d2551..1bd5c4ccf 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -1845,6 +1845,7 @@ class e_form $text .= "
+ ".vartrue($form['header'])." ".$this->token()." "; @@ -1855,6 +1856,7 @@ class e_form } $text .= " + ".vartrue($form['footer'])."
"; diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php index 2e13015a0..9a7b3739e 100644 --- a/e107_handlers/mysql_class.php +++ b/e107_handlers/mysql_class.php @@ -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 /** diff --git a/e107_handlers/validator_class.php b/e107_handlers/validator_class.php index abd1cce76..6bd88bba2 100644 --- a/e107_handlers/validator_class.php +++ b/e107_handlers/validator_class.php @@ -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 ? '' : '"%1$s" - ').$err_message; // custom, e.g. // default '"%1$s" field error: Custom error message. ' + $dbgmsg = LAN_VALIDATE_FAILMSG; + } + //Core message $msg = sprintf( - LAN_VALIDATE_FAILMSG, //'"%s" validation error: [#%d] %s. ' + $lan, // default '"%1$s" 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; diff --git a/e107_languages/English/admin/lan_admin.php b/e107_languages/English/admin/lan_admin.php index 8da2eedec..2191b70ca 100644 --- a/e107_languages/English/admin/lan_admin.php +++ b/e107_languages/English/admin/lan_admin.php @@ -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");