Changeset 1536 for branches/3.0

Show
Ignore:
Timestamp:
12/01/2006 01:51:21 PM (2 years ago)
Author:
xue
Message:

fixed #468.

Location:
branches/3.0
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • branches/3.0/HISTORY

    r1535 r1536  
    88BUG: TPager would not display if it was invisible previously (Qiang) 
    99ENH: Ticket#446 - Added TMetaTagCollection.getMetaTagByID method (Qiang) 
     10ENH: Ticket#468 - Added support of using all property tags in skins (Qiang) 
    1011ENH: Ticket#471 - Added methods in TAssetManager to expose published path and URL (Qiang) 
    1112CHG: Ticket#437 - __autoload is replaced by spl_autoload_register (Qiang) 
  • branches/3.0/framework/Exceptions/messages.txt

    r1403 r1536  
    125125template_content_unexpected                             = Unexpected content is encountered when instantiating template: {0}. 
    126126template_include_invalid                                = Invalid template inclusion. Make sure {0} is a valid namespace pointing to an existing template file whose extension is .tpl. 
     127template_tag_unexpected                                 = Initialization for property {0} contains an unknown tag type {1}. 
    127128 
    128129xmldocument_file_read_failed                    = TXmlDocument is unable to read file '{0}'. 
     
    157158theme_property_readonly                                 = Skin is being applied to a read-only control property '{0}.{1}'. 
    158159theme_property_undefined                                = Skin is being applied to an inexistent control property '{0}.{1}'. 
     160theme_tag_unexpected                                    = Initialization for property {0} contains an unknown tag type {1}. 
    159161 
    160162control_object_reregistered                             = Duplicated object ID '{0}' found. 
  • branches/3.0/framework/Web/UI/TTemplateManager.php

    r1535 r1536  
    458458                                        break; 
    459459                                default:        // an error if reaching here 
     460                                        throw new TConfigurationException('template_tag_unexpected',$name,$value[1]); 
    460461                                        break; 
    461462                        } 
     
    503504                                        break; 
    504505                                default:        // an error if reaching here 
     506                                        throw new TConfigurationException('template_tag_unexpected',$name,$value[1]); 
    505507                                        break; 
    506508                        } 
  • branches/3.0/framework/Web/UI/TThemeManager.php

    r1397 r1536  
    302302                                                if(isset($this->_skins[$type][$id])) 
    303303                                                        throw new TConfigurationException('theme_skinid_duplicated',$type,$id,dirname($themePath)); 
     304                                                /* 
    304305                                                foreach($skin[2] as $name=>$value) 
    305306                                                { 
     
    307308                                                                throw new TConfigurationException('theme_databind_forbidden',dirname($themePath),$type,$id); 
    308309                                                } 
     310                                                */ 
    309311                                                $this->_skins[$type][$id]=$skin[2]; 
    310312                                        } 
     
    364366                                if(is_array($value)) 
    365367                                { 
    366                                         if($value[0]===TTemplate::CONFIG_EXPRESSION) 
    367                                                 $value=$this->evaluateExpression($value[1]); 
    368                                         else if($value[0]===TTemplate::CONFIG_ASSET) 
    369                                                 $value=$this->_themeUrl.'/'.ltrim($value[1],'/'); 
     368                                        switch($value[0]) 
     369                                        { 
     370                                                case TTemplate::CONFIG_EXPRESSION: 
     371                                                        $value=$this->evaluateExpression($value[1]); 
     372                                                        break; 
     373                                                case TTemplate::CONFIG_ASSET: 
     374                                                        $value=$this->_themeUrl.'/'.ltrim($value[1],'/'); 
     375                                                        break; 
     376                                                case TTemplate::CONFIG_DATABIND: 
     377                                                        $control->bindProperty($name,$value[1]); 
     378                                                        break; 
     379                                                case TTemplate::CONFIG_PARAMETER: 
     380                                                        $control->setSubProperty($name,$this->getApplication()->getParameters()->itemAt($value[1])); 
     381                                                        break; 
     382                                                case TTemplate::CONFIG_TEMPLATE: 
     383                                                        $control->setSubProperty($name,$value[1]); 
     384                                                        break; 
     385                                                case TTemplate::CONFIG_LOCALIZATION: 
     386                                                        $control->setSubProperty($name,Prado::localize($value[1])); 
     387                                                        break; 
     388                                                default: 
     389                                                        throw new TConfigurationException('theme_tag_unexpected',$name,$value[0]); 
     390                                                        break; 
     391                                        } 
    370392                                } 
    371                                 if(strpos($name,'.')===false)   // is simple property or custom attribute 
     393                                if(!is_array($value)) 
    372394                                { 
    373                                         if($control->hasProperty($name)) 
     395                                        if(strpos($name,'.')===false)   // is simple property or custom attribute 
    374396                                        { 
    375                                                 if($control->canSetProperty($name)) 
     397                                                if($control->hasProperty($name)) 
    376398                                                { 
    377                                                         $setter='set'.$name; 
    378                                                         $control->$setter($value); 
     399                                                        if($control->canSetProperty($name)) 
     400                                                        { 
     401                                                                $setter='set'.$name; 
     402                                                                $control->$setter($value); 
     403                                                        } 
     404                                                        else 
     405                                                                throw new TConfigurationException('theme_property_readonly',$type,$name); 
    379406                                                } 
    380407                                                else 
    381                                                         throw new TConfigurationException('theme_property_readonly',$type,$name); 
     408                                                        throw new TConfigurationException('theme_property_undefined',$type,$name); 
    382409                                        } 
    383                                         else 
    384                                                 throw new TConfigurationException('theme_property_undefined',$type,$name); 
     410                                        else    // complex property 
     411                                                $control->setSubProperty($name,$value); 
    385412                                } 
    386                                 else    // complex property 
    387                                         $control->setSubProperty($name,$value); 
    388413                        } 
    389414                        return true;