Changeset 5995


Ignore:
Timestamp:
02/03/12 12:19:37 (4 months ago)
Author:
vain
Message:
  • cleanups on variable names
  • added two todo tags for intercepting smarty exceptions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/exception.core.php

    r5872 r5995  
    102102     * @var string HTML Representation of the Exception Template 
    103103     */ 
    104     private static $exception_template_content = ''; 
     104    private static $exception_template = ''; 
    105105 
    106106    /** 
    107107     * @var string HTML Representation of the Exception Development (RAD) Template 
    108108     */ 
    109     private static $exception_development_template_content = ''; 
     109    private static $exception_dev_template = ''; 
    110110 
    111111    /** 
     
    138138        } 
    139139 
     140        /** 
     141         * @todo 
     142         * 1. catch Smarty "Template Syntax" Errors 
     143         * 2. provide link to templateeditor (file:line) to fix the error 
     144         */ 
     145        #$smartyError = (false !== stristr($this->message, 'Syntax Error in template')) ? true : false; 
     146 
     147        /** 
     148         * @todo 
     149         * 1. catch Smarty "Unable to load template file" Errors 
     150         * 2. provide link to templatefilemanager (module:file) 
     151         */ 
     152 
    140153        echo $this->yellowScreenOfDeath(); 
    141     } 
    142  
    143     /** 
    144      * Method for Conditional Usage (Shortcut/Convenience Method) 
    145      * 
    146      * @example 
    147      * Usage: someFunction() OR throwException(); 
    148      * 
    149      * @param string $message Exception Message 
    150      * @param int $code Exception Code 
    151      */ 
    152     public function throwException($message = null, $code = null) 
    153     { 
    154         throw new Clansuite_Exception($message, $code); 
    155154    } 
    156155 
     
    195194        if(is_file($exception_template_file) === true) 
    196195        { 
    197             self::$exception_template_content = file_get_contents($exception_template_file); 
     196            self::$exception_template = file_get_contents($exception_template_file); 
    198197        } 
    199198    } 
     
    222221        { 
    223222            $content = file_get_contents($exception_template_file); 
    224             self::$exception_development_template_content = $content; 
     223            self::$exception_dev_template = $content; 
    225224            define('RAPIDDEVTPL', true); 
    226225        } 
     
    228227        else 
    229228        { 
    230            # propose to create a new rapid development template 
    231            # link to templateditor 
     229           # @todo propose to create a new rapid development template via tpleditor 
    232230        } 
    233231        */ 
     
    241239    private static function getExceptionDevelopmentTemplate($placeholders) 
    242240    { 
    243         $original_file_content = self::$exception_development_template_content; 
     241        $original_file_content = self::$exception_dev_template; 
    244242        $replaced_content = ''; 
    245243 
     
    307305        # Panel 1 - Exception Message and File 
    308306        $errormessage   .= '<div id="panel"'; 
    309         $errormessage   .= 'style="background: none repeat scroll 0 0 #FDF599; border: 1px dotted red; padding: 0 10px 10px;">'; 
     307        $errormessage   .= 'style="background: none repeat scroll 0 0 #FDF599; border: 1px solid #E03937; border-radius: 3px; padding: 0 10px 10px;">'; 
    310308        $errormessage   .= '<h3>Exception '.$code.'</h3><h4>'.$this->message.'</h4>'; 
    311309        $errormessage   .= '<strong>File: </strong>'.dirname($this->file).DS; 
     
    350348 
    351349        # HEADING <Additional Information> 
    352         if(empty(self::$exception_template_content) === false) 
     350        if(empty(self::$exception_template) === false) 
    353351        { 
    354352            $errormessage  .= '<tr><td colspan="2"><h3>Additional Information & Solution Suggestion</h3></td></tr>'; 
    355             $errormessage  .= '<tr><td colspan="2">'.self::$exception_template_content.'</td></tr>'; 
     353            $errormessage  .= '<tr><td colspan="2">'.self::$exception_template.'</td></tr>'; 
    356354 
    357355            # Split 
Note: See TracChangeset for help on using the changeset viewer.