1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 05:37:32 +02:00

Usersettings error message styling and general cleanup.

This commit is contained in:
Cameron
2015-01-27 11:32:09 -08:00
parent 489a9cb49c
commit e36b68933c
6 changed files with 39 additions and 22 deletions

View File

@@ -32,7 +32,6 @@ e107::css('core', 'bootstrap/css/tooltip.css','jquery');
e107::js('core', 'bootstrap-notify/js/bootstrap-notify.js','jquery'); e107::js('core', 'bootstrap-notify/js/bootstrap-notify.js','jquery');
e107::css('core', 'bootstrap-notify/css/bootstrap-notify.css','jquery'); e107::css('core', 'bootstrap-notify/css/bootstrap-notify.css','jquery');
e107::js('core', 'jquery.h5validate.min.js','jquery');
// ------------------ // ------------------

View File

@@ -114,7 +114,7 @@ class e107_user_extended
$this->systemCount = 0; $this->systemCount = 0;
$this->userCount = 0; $this->userCount = 0;
if($sql->db_Select('user_extended_struct', '*', "user_extended_struct_text != '_system_' ORDER BY user_extended_struct_order ASC")) if($sql->select('user_extended_struct', '*', "user_extended_struct_text != '_system_' ORDER BY user_extended_struct_order ASC"))
{ {
while($row = $sql->db_Fetch(MYSQL_ASSOC)) while($row = $sql->db_Fetch(MYSQL_ASSOC))
{ {
@@ -344,7 +344,7 @@ class e107_user_extended
$ret = array(); $ret = array();
$sql = e107::getDb('ue'); $sql = e107::getDb('ue');
if($sql->db_Select("user_extended_struct", "*", "user_extended_struct_type = 0 ORDER BY user_extended_struct_order ASC")) if($sql->select("user_extended_struct", "*", "user_extended_struct_type = 0 ORDER BY user_extended_struct_order ASC"))
{ {
if($byID == TRUE) if($byID == TRUE)
{ {
@@ -600,23 +600,23 @@ class e107_user_extended
// field of type category // field of type category
if($field_info) if($field_info)
{ {
$sql->db_Select_gen("ALTER TABLE #user_extended MODIFY user_".$tp -> toDB($name, true)." ".$field_info); $sql->gen("ALTER TABLE #user_extended MODIFY user_".$tp -> toDB($name, true)." ".$field_info);
} }
$newfield_info = " $newfield_info = "
user_extended_struct_text = '".$tp -> toDB($text, true)."', user_extended_struct_text = '".$tp -> toDB($text, true)."',
user_extended_struct_type = '".intval($type)."', user_extended_struct_type = '".intval($type)."',
user_extended_struct_parms = '".$tp -> toDB($parms, true)."', user_extended_struct_parms = '".$tp -> toDB($parms, true)."',
user_extended_struct_values = '".$tp -> toDB($values, true)."', user_extended_struct_values = '".$tp -> toDB($values, true)."',
user_extended_struct_default = '".$tp -> toDB($default, true)."', user_extended_struct_default = '".$tp -> toDB($default, true)."',
user_extended_struct_required = '".intval($required)."', user_extended_struct_required = '".intval($required)."',
user_extended_struct_read = '".intval($read)."', user_extended_struct_read = '".intval($read)."',
user_extended_struct_write = '".intval($write)."', user_extended_struct_write = '".intval($write)."',
user_extended_struct_applicable = '".intval($applicable)."', user_extended_struct_applicable = '".intval($applicable)."',
user_extended_struct_parent = '".intval($parent)."' user_extended_struct_parent = '".intval($parent)."'
WHERE user_extended_struct_id = '".intval($id)."' WHERE user_extended_struct_id = '".intval($id)."'
"; ";
return $sql->db_Update("user_extended_struct", $newfield_info); return $sql->update("user_extended_struct", $newfield_info);
} }
} }
@@ -630,7 +630,7 @@ class e107_user_extended
{ {
// FIXME - no table structure changes for categories // FIXME - no table structure changes for categories
// but no good way to detect it right now - ignore the sql error for now, fix it asap // but no good way to detect it right now - ignore the sql error for now, fix it asap
$sql->db_Select_gen("ALTER TABLE #user_extended DROP user_".$tp -> toDB($name, true)); $sql->gen("ALTER TABLE #user_extended DROP user_".$tp -> toDB($name, true));
if(is_numeric($id)) if(is_numeric($id))
{ {
@@ -809,7 +809,7 @@ class e107_user_extended
$sql = e107::getDb('ue'); $sql = e107::getDb('ue');
$order = ($choices[3]) ? "ORDER BY ".$tp -> toDB($choices[3], true) : ""; $order = ($choices[3]) ? "ORDER BY ".$tp -> toDB($choices[3], true) : "";
if($sql->db_Select($tp -> toDB($choices[0], true), $tp -> toDB($choices[1], true).",".$tp -> toDB($choices[2], true), "1 $order")){ if($sql->select($tp -> toDB($choices[0], true), $tp -> toDB($choices[1], true).",".$tp -> toDB($choices[2], true), "1 $order")){
$choiceList = $sql->db_getList('ALL',FALSE); $choiceList = $sql->db_getList('ALL',FALSE);
$ret = "<select id='{$fid}' {$include} name='{$fname}' {$required} >\n"; $ret = "<select id='{$fid}' {$include} name='{$fname}' {$required} >\n";
$ret .= "<option value=''>&nbsp;</option>\n"; // ensures that the user chose it. $ret .= "<option value=''>&nbsp;</option>\n"; // ensures that the user chose it.
@@ -1018,7 +1018,7 @@ class e107_user_extended
VALUES ({$uid}, {$newvalue}) VALUES ({$uid}, {$newvalue})
ON DUPLICATE KEY UPDATE {$field_name} = {$newvalue} ON DUPLICATE KEY UPDATE {$field_name} = {$newvalue}
"; ";
return $sql->db_Select_gen($qry); return $sql->gen($qry);
} }

View File

@@ -1403,6 +1403,7 @@ class validatorClass
if(empty($vars['failed'][$f])) if(empty($vars['failed'][$f]))
{ {
$vars['failed'][$f] = LAN_VALIDATE_191; $vars['failed'][$f] = LAN_VALIDATE_191;
print_a($vars['failed']);
} }
$curLine = str_replace('%v', filter_var($vars['failed'][$f], FILTER_SANITIZE_SPECIAL_CHARS), $curLine); $curLine = str_replace('%v', filter_var($vars['failed'][$f], FILTER_SANITIZE_SPECIAL_CHARS), $curLine);
$curLine = str_replace('%f', $f, $curLine); $curLine = str_replace('%f', $f, $curLine);

View File

@@ -1,5 +1,9 @@
$(document).ready(function() $(document).ready(function()
{ {
$('form').h5Validate(
{ errorClass: 'has-error' }
); // allow older browsers to use html5 validation.
// Change hash when a tab changes // Change hash when a tab changes
$('.nav-tabs a').on('shown', function (event) { $('.nav-tabs a').on('shown', function (event) {
var hash = event.target.href.toString().split('#')[1], form = $(event.target).parents('form')[0]; var hash = event.target.href.toString().split('#')[1], form = $(event.target).parents('form')[0];

View File

@@ -13,7 +13,7 @@ $(document).ready(function()
{ {
$(".e-hideme").hide(); $(".e-hideme").hide();
$(".e-expandit").show(); $(".e-expandit").show();
$('form').h5Validate(); // allow older browsers to use html5 validation.
// $(".e-spinner").spinner(); //FIXME breaks tooltips // $(".e-spinner").spinner(); //FIXME breaks tooltips

View File

@@ -778,7 +778,7 @@ if (!$error && !$promptPassword)
if ($error) if ($error)
{ {
require_once (e_HANDLER.'message_handler.php'); // require_once (e_HANDLER.'message_handler.php');
$temp = array(); $temp = array();
if (count($extraErrors)) if (count($extraErrors))
{ {
@@ -792,7 +792,20 @@ if ($error)
{ {
$temp[] = '<br />'.validatorClass::makeErrorList($eufVals,'USER_ERR_','%n - %x - %t: %v', '<br />', NULL); $temp[] = '<br />'.validatorClass::makeErrorList($eufVals,'USER_ERR_','%n - %x - %t: %v', '<br />', NULL);
} }
message_handler('P_ALERT', implode('<br />', $temp)); // message_handler('P_ALERT', implode('<br />', $temp));
$errorMsg = implode('<br />', $temp);
if(deftrue('BOOTSTRAP'))
{
echo e107::getMessage()->addError($errorMsg)->render();
}
else
{
$ns->tablerender($caption, $message);
}
// $adref = $_POST['adminreturn']; // $adref = $_POST['adminreturn'];
} }