Changeset 316 for trunk

Show
Ignore:
Timestamp:
07/08/09 02:35:59 (3 years ago)
Author:
john
Message:

bug fixes / updates

Location:
trunk/trax/vendor/trax
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/trax/vendor/trax/action_view/helpers/active_record_helper.php

    r308 r316  
    173173            $header_sub_message = isset($options['header_sub_message']) ? 
    174174                $options['header_sub_message'] : "There were problems with the following fields:"; 
    175                  
     175 
    176176            return $this->content_tag("div", 
    177177                $this->content_tag( 
  • trunk/trax/vendor/trax/action_view/helpers/date_helper.php

    r230 r316  
    15911591    $date_helper = new DateHelper($object, $attribute); 
    15921592    return $date_helper->expiration_date_select($options);         
     1593}  
     1594 
     1595/** 
     1596 *  Make a new DateHelper object and call its select_year() method 
     1597 * 
     1598 *  Generate HTML/XML for year selector pull-down menu using only 
     1599 *  explicit month specification.<br /> 
     1600 *  <b>NB:</b>  An attempt to get value of an attribute will always 
     1601 *  fail because there is no way to set 
     1602 *  {@link DateHelper::object_name} and 
     1603 *  {@link DateHelper::attribute_name}. 
     1604 *  @uses DateHelper::select_year() 
     1605 */ 
     1606function select_year() { 
     1607    $date_helper = new DateHelper(); 
     1608    $args = func_get_args(); 
     1609    return call_user_func_array(array($date_helper, 'select_year'), $args);     
    15931610} 
    15941611 
  • trunk/trax/vendor/trax/action_view/helpers/form_helper.php

    r311 r316  
    367367 * is set to 0 which is convenient for boolean values. Usually unchecked checkboxes don't post anything. 
    368368 * We work around this problem by adding a hidden value with the same name as the checkbox. 
    369 # 
     369 * 
    370370 * Example: Imagine that $post->validated is 1: 
    371371 *   check_box("post", "validated"); 
     
    373373 *   <input type="checkbox" id="post_validate" name="post[validated] value="1" checked="checked" /> 
    374374 *   <input name="post[validated]" type="hidden" value="0" /> 
    375 # 
     375 * 
    376376 * Example: Imagine that $puppy->gooddog is no: 
    377377 *   check_box("puppy", "gooddog", array(), "yes", "no"); 
  • trunk/trax/vendor/trax/action_view/helpers/form_options_helper.php

    r308 r316  
    202202    function to_select_tag($choices, $options, $html_options) { 
    203203        $html_options = $this->add_default_name_and_id($html_options); 
    204         $value = $this->value(); 
     204        $value = isset($options['selected']) ? $options['selected'] : $this->value(); 
    205205        return $this->error_wrapping( 
    206206            $this->content_tag( 
  • trunk/trax/vendor/trax/session.php

    r300 r316  
    202202     */ 
    203203    function is_aol_host() { 
    204         if(ereg("proxy\.aol\.com$", gethostbyaddr($_SERVER['REMOTE_ADDR'])) || 
     204        if(isset($_SERVER['REMOTE_ADDR']) && ereg("proxy\.aol\.com$", gethostbyaddr($_SERVER['REMOTE_ADDR'])) || 
    205205           stristr($_SERVER['HTTP_USER_AGENT'], "AOL")) { 
    206206            return true; 
  • trunk/trax/vendor/trax/trax.php

    r314 r316  
    9898        ini_set("log_errors", "On"); 
    9999        ini_set("error_log", self::$log_path."/".TRAX_ENV.".log"); 
    100  
     100          
    101101        if(TRAX_ENV == "development") { 
    102102            # Display errors to browser if in development mode for debugging 
     
    128128        include_once("router.php"); 
    129129 
    130         # Make sure database settings are cleared out 
    131         ActiveRecord::$database_settings = array(); 
     130        self::load_active_record_connections_config(); 
     131 
     132    }   
     133     
     134    function load_active_record_connections_config() { 
     135        # Make sure database settings are cleared out  
     136        ActiveRecord::$database_settings = array();    
     137        ActiveRecord::clear_all_connections(); 
    132138        if(file_exists(self::$config_path."/database.ini")) { 
    133139            # Load databse settings  
    134             ActiveRecord::$database_settings = parse_ini_file(self::$config_path."/database.ini", true); 
     140            ActiveRecord::$database_settings = parse_ini_file(self::$config_path."/database.ini", true);  
     141            #error_log("db settings:".print_r(ActiveRecord::$database_settings, true)); 
    135142        } 
    136         ActiveRecord::$environment = TRAX_ENV; 
    137  
     143        ActiveRecord::$environment = TRAX_ENV;         
    138144    } 
    139145