Changeset 1509

Show
Ignore:
Timestamp:
11/25/2006 02:51:43 PM (2 years ago)
Author:
xue
Message:

merge from 3.0 branch till 1508.

Location:
trunk
Files:
16 modified
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/HISTORY

    r1505 r1509  
    2020BUG: Ticket#442 - TPageService getBasePath in namespace form (Qiang) 
    2121BUG: TTableCell should render   only when Text is not set and there's no child (Qiang) 
     22ENH: Ticket#446 - Added TMetaTagCollection.getMetaTagByID method (Qiang) 
    2223CHG: Ticket#437 - __autoload is replaced by spl_autoload_register (Qiang) 
    23 CHG: constructUrl() now encodes & into & by default (Qiang) 
     24CHG: Ticket#454 - Redundant PHP Version Check 
    2425CHG: TRepeater does not render <span> anymore for empty item template (Qiang) 
     26CHG: THttpRequest.constructUrl() now encodes ampersand by default (Qiang) 
    2527 
    2628Version 3.0.5 October 23, 2006 
  • trunk/UPGRADE

    r1482 r1509  
    2424Upgrading from v3.0.5 
    2525--------------------- 
    26 - constructUrl() now encodes & into &amp; by default. 
    2726- TRepeater does not render <span> anymore for empty item template. 
     27- constructUrl() now encodes ampersand by default. This should have minimal 
     28  impact on any existing PRADO applications, though. 
    2829 
    2930Upgrading from v3.0.4 
  • trunk/demos/blog/protected/Common/BlogErrorHandler.php

    r1398 r1509  
    3737                        Prado::log($message,TLogger::ERROR,'BlogApplication'); 
    3838                        $message=urldecode($this->getApplication()->getSecurityManager()->hashData($message)); 
    39                         $this->Response->redirect($this->Service->constructUrl('ErrorReport',array('msg'=>$message))); 
     39                        $this->Response->redirect($this->Service->constructUrl('ErrorReport',array('msg'=>$message),false)); 
    4040                } 
    4141                else 
  • trunk/demos/blog/protected/Common/BlogPage.php

    r1398 r1509  
    3333        public function gotoDefaultPage() 
    3434        { 
    35                 $this->Response->redirect($this->Service->constructUrl($this->Service->DefaultPage)); 
     35                $this->gotoPage($this->Service->DefaultPage); 
    3636        } 
    3737 
    3838        public function gotoPage($pagePath,$getParameters=null) 
    3939        { 
    40                 $this->Response->redirect($this->Service->constructUrl($pagePath,$getParameters)); 
     40                $this->Response->redirect($this->Service->constructUrl($pagePath,$getParameters,false)); 
    4141        } 
    4242 
  • trunk/demos/blog/protected/Portlets/SearchPortlet.php

    r1398 r1509  
    3232        { 
    3333                $keyword=$this->Keyword->Text; 
    34                 $url=$this->Service->constructUrl('SearchPost',array('keyword'=>$keyword)); 
     34                $url=$this->Service->constructUrl('SearchPost',array('keyword'=>$keyword),false); 
    3535                $this->Response->redirect($url); 
    3636        } 
  • trunk/demos/personal/protected/Pages/Layout.php

    r1398 r1509  
    66        { 
    77                $this->Application->getModule('auth')->logout(); 
    8                 $this->Response->redirect($this->Service->constructUrl('Home')); 
     8                $this->Response->redirect($this->Service->constructUrl('Home',null,false)); 
    99        } 
    1010} 
  • trunk/demos/quickstart/protected/controls/SearchBox.php

    r1398 r1509  
    11<?php 
    22 
    3 class SearchBox extends TTemplateControl  
     3class SearchBox extends TTemplateControl 
    44{ 
    5         public function getText()  
     5        public function getText() 
    66        { 
    77        $this->ensureChildControls(); 
    88        return $this->getRegisteredObject('search')->getText(); 
    99    } 
    10      
     10 
    1111    public function getTextBox() 
    1212    { 
     
    1414        return $this->getRegisteredObject('search'); 
    1515    } 
    16          
     16 
    1717        public function getButton() 
    1818        { 
     
    2020        return $this->getRegisteredObject('find'); 
    2121        } 
    22          
     22 
    2323        public function onInit($param) 
    2424        { 
     
    3333                { 
    3434                        $ps = $this->getApplication()->getPageService(); 
    35                         $page = $ps->constructUrl('Search', array('q' => $query));                       
     35                        $page = $ps->constructUrl('Search', array('q' => $query), false); 
    3636                        $this->getApplication()->getResponse()->redirect($page); 
    3737                } 
  • trunk/demos/quickstart/protected/pages/Controls/Repeater.page

    r1398 r1509  
    2020<com:TTextHighlighter Language="php" CssClass="source"> 
    2121class MyPage extends TPage { 
    22     protected function onLoad($param) { 
     22    public function onLoad($param) { 
    2323        parent::onLoad($param); 
    2424        if(!$this->IsPostBack) { 
  • trunk/demos/quickstart/protected/pages/GettingStarted/Introduction.page

    r1398 r1509  
    22<h1 id="101">Welcome to the PRADO Quickstart Tutorial</h1> 
    33<p> 
    4 This Quickstart tutorial is provided to help you quickly start building your own Web applications based on PRADO version 3.0. 
     4This Quickstart tutorial is provided to help you quickly start building your own Web applications based on PRADO version 3.x. 
    55</p> 
    66<p> 
     
    88</p> 
    99<ul> 
     10  <li><a href="http://www.pradosoft.com/docs/classdoc/">PRADO Classes</a></li> 
    1011  <li><a href="http://www.pradosoft.com/docs/manual/">PRADO API Documentation</a></li> 
    1112  <li><a href="http://www.pradosoft.com/forum/">PRADO Forum</a></li> 
    1213  <li><a href="http://www.pradosoft.com/wiki/">PRADO Wiki</a></li> 
    13   <li><a href="http://trac.pradosoft.com/wiki/">PRADO Trac</a></li> 
     14  <li><a href="http://trac.pradosoft.com/prado/">PRADO Trac</a></li> 
    1415</ul> 
    1516 
  • trunk/framework/I18N/core/DateFormat.php

    r1398 r1509  
    111111        public function format($time, $pattern='F', $charset='UTF-8') 
    112112        { 
    113                 if(is_string($time)) 
     113                if (is_numeric($time)) //assumes unix epoch 
     114                        $time = floatval($time); 
     115                else if(is_string($time)) 
    114116                        $time = @strtotime($time); 
    115117 
     
    117119                        $pattern = 'F'; 
    118120 
    119                 $date = @getdate($time); 
     121                $s = Prado::createComponent('System.Util.TDateTimeStamp'); 
     122 
     123                $date = $s->getDate($time); 
    120124 
    121125                $pattern = $this->getPattern($pattern); 
  • trunk/framework/TApplication.php

    r1484 r1509  
    13191319                { 
    13201320                        $fileName=$this->getStateFilePath(); 
    1321                         if(version_compare(phpversion(),'5.1.0','>=')) 
    1322                                 file_put_contents($fileName,$content,LOCK_EX); 
    1323                         else 
    1324                                 file_put_contents($fileName,$content); 
     1321                        file_put_contents($fileName,$content,LOCK_EX); 
    13251322                } 
    13261323        } 
  • trunk/framework/Util/TDateTimeStamp.php

    r1399 r1509  
    194194                return $this->_getDateInternal($d); 
    195195        } 
     196 
     197 
    196198 
    197199        /** 
  • trunk/framework/Web/THttpRequest.php

    r1482 r1509  
    484484         * @param array GET parameters, null if not needed 
    485485         * @param boolean whether to encode the ampersand in URL, defaults to true. 
    486          * @param boolean whether to encode the GET parameters (their names and values), defaults to true. 
     486         * @param boolean whether to encode the GET parameters (their names and values), defaults to false. 
    487487         * @return string URL 
    488488         * @see parseUrl 
  • trunk/framework/Web/THttpResponse.php

    r1410 r1509  
    319319                if($url[0]==='/') 
    320320                        $url=$this->getRequest()->getBaseUrl().$url; 
    321                 header('Location: '.$url); 
     321                header('Location: '.str_replace('&amp;','&',$url)); 
    322322                exit(); 
    323323        } 
  • trunk/framework/Web/UI/WebControls/THead.php

    r1398 r1509  
    343343                        throw new TInvalidDataTypeException('metatagcollection_metatag_invalid'); 
    344344        } 
     345 
     346        /** 
     347         * Finds the lowest cardinal index of the meta tag whose id is the one being looked for. 
     348         * @param string the ID of the meta tag to be looked for 
     349         * @return integer the index of the meta tag found, -1 if not found. 
     350         */ 
     351        public function findIndexByID($id) 
     352        { 
     353                $index=0; 
     354                foreach($this as $item) 
     355                { 
     356                        if($item->getID()===$id) 
     357                                return $index; 
     358                        $index++; 
     359                } 
     360                return -1; 
     361        } 
     362 
     363        /** 
     364         * Finds the item whose value is the one being looked for. 
     365         * @param string the id of the meta tag to be looked for 
     366         * @return TMetaTag the meta tag found, null if not found. 
     367         */ 
     368        public function findMetaTagByID($id) 
     369        { 
     370                if(($index=$this->findIndexByID($id))>=0) 
     371                        return $this->itemAt($index); 
     372                else 
     373                        return null; 
     374        } 
    345375} 
    346376 
  • trunk/requirements/index.php

    r1507 r1509  
    236236                $langs=getUserLanguages(); 
    237237                $lang=explode('-',$langs[0]); 
    238                 if(empty($lang[0]) || !ctype_alpha($lang[0])) 
     238                if(empty($lang[0]) || !function_exists('ctype_alpha') || !ctype_alpha($lang[0])) 
    239239                        $language='en'; 
    240240                else