Changeset 178


Ignore:
Timestamp:
Jun 22, 2006 9:27:31 PM (18 years ago)
Author:
scdev
Message:

Q - update FormValidator? so err() prints a different class type depending on error type.

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/ACL.inc.php

    r177 r178  
    529529       
    530530        $db->query("REPLACE INTO acl_tbl VALUES ('$aro_id', '$aco_id', '$axo_id', '$allow', NOW())");
     531        $app->logMsg(sprintf('Set %s: %s -> %s -> %s.', $allow, $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
    531532       
    532533        return true;
     
    582583        if (substr_count($final_where, 'IS NOT NULL') == 3) {
    583584            // Null on all three tables will delete ALL entries including the root -> root -> root = deny.
    584             $app->logMsg(sprintf('Cannot allow deletion of all acl entries.', null), LOG_NOTICE, __FILE__, __LINE__);
     585            $app->logMsg(sprintf('Cannot allow deletion of ALL acl entries.', null), LOG_NOTICE, __FILE__, __LINE__);
    585586            return false;
    586587        }
  • trunk/lib/FormValidator.inc.php

    r166 r178  
    4343    var $errors = array();
    4444   
    45     // Default error marker.
    46     var $marker = ' sc-msg-error ';
    47 
    4845    /**
    4946     * Return the current list of errors.
     
    9289            foreach ($this->errors as $err) {
    9390                if ($err['name'] == $form_name) {
    94                     return true;
     91                    return $err['type'];
    9592                }
    9693            }
     
    160157    function err($form_name, $marker=null)
    161158    {
    162         if ($this->anyErrors($form_name)) {
     159        if (false !== ($type = $this->anyErrors($form_name))) {
    163160            if (isset($marker)) {
    164161                echo $marker;
    165162            } else {
    166                 echo $this->marker;
     163                switch ($type) {
     164                case MSG_ERR:
     165                default:
     166                    echo ' sc-msg-error ';
     167                    break;
     168
     169                case MSG_WARNING:
     170                    echo ' sc-msg-warning ';
     171                    break;
     172
     173                case MSG_SUCCESS:
     174                    echo ' sc-msg-success ';
     175                    break;
     176
     177                case MSG_NOTICE:
     178                    echo ' sc-msg-notice ';
     179                    break;
     180                }
    167181            }
    168182        }
Note: See TracChangeset for help on using the changeset viewer.