Changeset 1538

Show
Ignore:
Timestamp:
12/01/2006 03:39:16 PM (2 years ago)
Author:
xue
Message:

merge from 3.0 branch till 1537.

Location:
trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/HISTORY

    r1532 r1538  
    1919============================== 
    2020BUG: Ticket#442 - TPageService getBasePath in namespace form (Qiang) 
     21BUG: Ticket#443 - Template comment tag messed up with HTML comment tag (Qiang) 
    2122BUG: Ticket#467 - typo in TUrlMapping.php (Qiang) 
    2223BUG: TTableCell should render   only when Text is not set and there's no child (Qiang) 
     
    2425BUG: TPager would not display if it was invisible previously (Qiang) 
    2526ENH: Ticket#446 - Added TMetaTagCollection.getMetaTagByID method (Qiang) 
     27ENH: Ticket#468 - Added support of using all property tags in skins (Qiang) 
    2628ENH: Ticket#471 - Added methods in TAssetManager to expose published path and URL (Qiang) 
    2729CHG: Ticket#437 - __autoload is replaced by spl_autoload_register (Qiang) 
  • trunk/framework/Exceptions/messages.txt

    r1504 r1538  
    126126template_content_unexpected                             = Unexpected content is encountered when instantiating template: {0}. 
    127127template_include_invalid                                = Invalid template inclusion. Make sure {0} is a valid namespace pointing to an existing template file whose extension is .tpl. 
     128template_tag_unexpected                                 = Initialization for property {0} contains an unknown tag type {1}. 
    128129 
    129130xmldocument_file_read_failed                    = TXmlDocument is unable to read file '{0}'. 
     
    158159theme_property_readonly                                 = Skin is being applied to a read-only control property '{0}.{1}'. 
    159160theme_property_undefined                                = Skin is being applied to an inexistent control property '{0}.{1}'. 
     161theme_tag_unexpected                                    = Initialization for property {0} contains an unknown tag type {1}. 
    160162 
    161163control_object_reregistered                             = Duplicated object ID '{0}' found. 
  • trunk/framework/Web/UI/TTemplateManager.php

    r1490 r1538  
    178178         *  '<prop:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/>' - group subproperty tags 
    179179         */ 
    180         const REGEX_RULES='/<!--.*?--!>|<!--.*?-->|<\/?com:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?")*)\s*%>|<%[%#~\\$=\\[](.*?)%>|<prop:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/>/msS'; 
     180        const REGEX_RULES='/<!--.*?--!?>|<\/?com:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?")*)\s*%>|<%[%#~\\$=\\[](.*?)%>|<prop:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/>/msS'; 
    181181 
    182182        /** 
     
    485485                                        break; 
    486486                                default:        // an error if reaching here 
     487                                        throw new TConfigurationException('template_tag_unexpected',$name,$value[1]); 
    487488                                        break; 
    488489                        } 
     
    530531                                        break; 
    531532                                default:        // an error if reaching here 
     533                                        throw new TConfigurationException('template_tag_unexpected',$name,$value[1]); 
    532534                                        break; 
    533535                        } 
  • trunk/framework/Web/UI/TThemeManager.php

    r1398 r1538  
    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; 
  • trunk/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php

    r1398 r1538  
    2525                // verify specific table tags 
    2626                $this->verifyElementPresent("ctl0_body_DataGrid"); 
    27                 $this->verifyAttribute("ctl0_body_DataGrid@rules","all"); 
    2827                $this->verifyAttribute("ctl0_body_DataGrid@cellpadding","2"); 
    29                 $this->verifyAttribute("ctl0_body_DataGrid@cellspacing","0"); 
    3028        } 
    3129} 
  • trunk/tests/FunctionalTests/tickets/protected/pages/Ticket205.page

    r1398 r1538  
    2121                OnServerValidate="customValidate" 
    2222                ClientValidationFunction="clientSideCustomValidate" 
    23                 ClientSide.OnError="alert('error')" 
     23                ClientSide.OnValidationError="alert('error')" 
    2424                ErrorMessage="must equal to 'Prado'" /> 
    2525        <com:TButton ID="button1" Text="Submit!" /> 
  • trunk/tests/FunctionalTests/tickets/protected/pages/Ticket207.page

    r1398 r1538  
    77                ControlToValidate="text1" Text="Error" 
    88                ClientSide.ObserveChanges="false" 
    9             ClientSide.OnError="alert('error on text1 fired')" /> 
     9            ClientSide.OnValidationError="alert('error on text1 fired')" /> 
    1010          <br /> 
    1111          <com:TTextBox ID="text2" /><br />