1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +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::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->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))
{
@@ -344,7 +344,7 @@ class e107_user_extended
$ret = array();
$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)
{
@@ -600,7 +600,7 @@ class e107_user_extended
// field of type category
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 = "
@@ -616,7 +616,7 @@ class e107_user_extended
user_extended_struct_parent = '".intval($parent)."'
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
// 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))
{
@@ -809,7 +809,7 @@ class e107_user_extended
$sql = e107::getDb('ue');
$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);
$ret = "<select id='{$fid}' {$include} name='{$fname}' {$required} >\n";
$ret .= "<option value=''>&nbsp;</option>\n"; // ensures that the user chose it.
@@ -1018,7 +1018,7 @@ class e107_user_extended
VALUES ({$uid}, {$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]))
{
$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('%f', $f, $curLine);

View File

@@ -1,5 +1,9 @@
$(document).ready(function()
{
$('form').h5Validate(
{ errorClass: 'has-error' }
); // allow older browsers to use html5 validation.
// Change hash when a tab changes
$('.nav-tabs a').on('shown', function (event) {
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-expandit").show();
$('form').h5Validate(); // allow older browsers to use html5 validation.
// $(".e-spinner").spinner(); //FIXME breaks tooltips

View File

@@ -778,7 +778,7 @@ if (!$error && !$promptPassword)
if ($error)
{
require_once (e_HANDLER.'message_handler.php');
// require_once (e_HANDLER.'message_handler.php');
$temp = array();
if (count($extraErrors))
{
@@ -792,7 +792,20 @@ if ($error)
{
$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'];
}