Changeset 1225

Show
Ignore:
Timestamp:
07/02/2006 01:05:42 PM (2 years ago)
Author:
xue
Message:

Merge from 3.0 branch till 1224.

Location:
trunk
Files:
1 removed
12 modified
17 copied

Legend:

Unmodified
Added
Removed
  • trunk/HISTORY

    r1219 r1225  
    1414BUG: Ticket#182 - List and validator controls cause problem in child classes (Qiang) 
    1515BUG: Ticket#191 - Duplicated postbacks occur when using TButton with validators (Qiang) 
     16BUG: Ticket#207 - Validators ClientSide.OnError triggered twice (Wei) 
    1617BUG: Ticket#213 - PRADO Requirements Checker charset error (Qiang) 
     18BUG: Ticket#227 - Enabled property doesn't works with THtmlArea (Wei) 
    1719BUG: Ticket#234 - Postback target could be out of date (Qiang) 
    1820BUG: Ticket#239 - Ondeactivate handler for the first View of MultiView is always fired (Qiang) 
    1921BUG: Ticket#244 - redirect() needs absolute URL (Qiang) 
    2022BUG: Ticket#245 - getIsSecureConnection() is not working correctly (Qiang) 
     23BUG: Ticket#246 - TDatePicker wrong popup position in scrolled div (Wei) 
    2124BUG: Ticket#260 - Wrong value of a configuration option in setUseTransparentSessionID (Qiang) 
    2225CHG: ensureChildControls() is now invoked in TControl::initRecursive (Qiang) 
     
    2932ENH: Ticket#256 - Datagrid columns can now be accessed via IDs (Qiang) 
    3033ENH: Ticket#257 - OnSelectedIndexChanged event of TDataList and TDataGrid now passes the original command parameter (Qiang) 
     34ENH: Ticket#262 - Added TCheckBox.Value property (Qiang) 
    3135ENH: TRepeater, TDataList and TDataGrid will store data indices in DataKeys if DataKeyField is not set. (Qiang) 
    3236ENH: Added TPageService.BasePageClass property (Qiang) 
    3337ENH: Added TDataGrid.EmptyTemplate property (Qiang) 
    3438ENH: Added paging feature to all TDataBoundControl-derived controls (Qiang) 
     39ENH: ClientSide.ObserveChanges="false" to only revalidate client side validator when control changes (Wei) 
    3540NEW: Added TPager (Qiang) 
    3641NEW: Added Dreamweaver taglib extension (Stanislav, Qiang) 
     42NEW: Prado Command line script to create a new project, see framework/prado-cli.php (Wei) 
    3743 
    3844Version 3.0.1 June 4, 2006 
  • trunk/demos/quickstart/protected/application.xml

    r1209 r1225  
    1717  <paths> 
    1818    <using namespace="Application.controls.*" /> 
    19         <using namespace="Application.comments.*" /> 
    2019  </paths> 
    2120  <services> 
    2221    <service id="page" class="TPageService" DefaultPage="GettingStarted.Introduction" /> 
    2322  </services> 
    24   <parameters> 
    25         <parameter id="enableNewComment" value="false" /> 
    26   </parameters> 
    2723</application> 
  • trunk/demos/quickstart/protected/controls/Layout.tpl

    r1167 r1225  
    3333<com:TContentPlaceHolder ID="body" /> 
    3434</div> 
    35 <com:CommentList Visible="true" /> 
    3635</td> 
    3736</tr> 
  • trunk/framework/Util/TLogRouter.php

    r943 r1225  
    2323 * The format is as follows, 
    2424 * <code> 
    25  *   &lt;route class="TFileLogRoute" Categories="System.Web.UI" Levels="Warning" /&gt; 
    26  *   &lt;route class="TEmailLogRoute" Categories="Application" Levels="Fatal" Emails="admin@pradosoft.com" /&gt; 
     25 *   <route class="TFileLogRoute" Categories="System.Web.UI" Levels="Warning" /> 
     26 *   <route class="TEmailLogRoute" Categories="Application" Levels="Fatal" Emails="admin@pradosoft.com" /> 
    2727 * </code> 
    2828 * You can specify multiple routes with different filtering conditions and different 
  • trunk/framework/Web/Javascripts/colorpicker/colorpicker.js

    r1100 r1225  
    6969                        var constructor = mode == "Basic" ? "getBasicPickerContainer": "getFullPickerContainer" 
    7070                        this.element = this[constructor](this.options['ID'], this.options['Palette']) 
    71                         document.body.appendChild(this.element); 
     71                        this.input.parentNode.appendChild(this.element); 
    7272                        this.element.style.display = "none"; 
    7373 
     
    9191                if(!this.showing) 
    9292                { 
    93                         var pos = Position.cumulativeOffset(this.input); 
     93                        var pos = Position.positionedOffset(this.input); 
    9494                        pos[1] += this.input.offsetHeight; 
    9595 
  • trunk/framework/Web/Javascripts/datepicker/datepicker.js

    r1149 r1225  
    248248                        this.iePopUp.scrolling="no" 
    249249                        this.iePopUp.frameBorder="0" 
    250                         document.body.appendChild(this.iePopUp); 
    251                 } 
    252  
    253                 document.body.appendChild(this._calDiv); 
     250                        this.control.parentNode.appendChild(this.iePopUp); 
     251                } 
     252 
     253                this.control.parentNode.appendChild(this._calDiv); 
    254254                 
    255255                this.update(); 
     
    543543                if(!this.showing) 
    544544                { 
    545                         var pos = Position.cumulativeOffset(this.control); 
    546                          
     545                        var pos = Position.positionedOffset(this.control); 
     546                                                 
    547547                        pos[1] += this.getDatePickerOffsetHeight(); 
    548548                         
  • trunk/framework/Web/Javascripts/js/colorpicker.js

    r1100 r1225  
    3434{var constructor=mode=="Basic"?"getBasicPickerContainer":"getFullPickerContainer" 
    3535this.element=this[constructor](this.options['ID'],this.options['Palette']) 
    36 document.body.appendChild(this.element);this.element.style.display="none";if(Prado.Browser().ie) 
     36this.input.parentNode.appendChild(this.element);this.element.style.display="none";if(Prado.Browser().ie) 
    3737{this.iePopUp=document.createElement('iframe');this.iePopUp.src=Prado.WebUI.TColorPicker.UIImages['button.gif'];this.iePopUp.style.position="absolute" 
    3838this.iePopUp.scrolling="no" 
     
    4343this.show(mode);},show:function(type) 
    4444{if(!this.showing) 
    45 {var pos=Position.cumulativeOffset(this.input);pos[1]+=this.input.offsetHeight;this.element.style.top=(pos[1]-1)+"px";this.element.style.left=pos[0]+"px";this.element.style.display="block";this.ieHack(type);this._documentClickEvent=this.hideOnClick.bindEvent(this,type);this._documentKeyDownEvent=this.keyPressed.bindEvent(this,type);Event.observe(document.body,"click",this._documentClickEvent);Event.observe(document,"keydown",this._documentKeyDownEvent);this.showing=true;if(type=="Full") 
     45{var pos=Position.positionedOffset(this.input);pos[1]+=this.input.offsetHeight;this.element.style.top=(pos[1]-1)+"px";this.element.style.left=pos[0]+"px";this.element.style.display="block";this.ieHack(type);this._documentClickEvent=this.hideOnClick.bindEvent(this,type);this._documentKeyDownEvent=this.keyPressed.bindEvent(this,type);Event.observe(document.body,"click",this._documentClickEvent);Event.observe(document,"keydown",this._documentKeyDownEvent);this.showing=true;if(type=="Full") 
    4646{this.observeMouseMovement();var color=Rico.Color.createFromHex(this.input.value);this.inputs.oldColor.style.backgroundColor=color.asHex();this.setColor(color,true);}}},hide:function(event) 
    4747{if(this.showing) 
  • trunk/framework/Web/Javascripts/js/datepicker.js

    r1149 r1225  
    2323this.iePopUp.scrolling="no" 
    2424this.iePopUp.frameBorder="0" 
    25 document.body.appendChild(this.iePopUp);} 
    26 document.body.appendChild(this._calDiv);this.update();this.updateHeader();this.ieHack(true);previousMonth.hideFocus=true;nextMonth.hideFocus=true;todayButton.hideFocus=true;Event.observe(previousMonth,"click",this.prevMonth.bindEvent(this));Event.observe(nextMonth,"click",this.nextMonth.bindEvent(this));Event.observe(todayButton,"click",this.selectToday.bindEvent(this));Event.observe(this._monthSelect,"change",this.monthSelect.bindEvent(this));Event.observe(this._yearSelect,"change",this.yearSelect.bindEvent(this));Event.observe(this._calDiv,"mousewheel",this.mouseWheelChange.bindEvent(this));Event.observe(calendarBody,"click",this.selectDate.bindEvent(this));Prado.Element.focus(this.control);},ieHack:function(cleanup) 
     25this.control.parentNode.appendChild(this.iePopUp);} 
     26this.control.parentNode.appendChild(this._calDiv);this.update();this.updateHeader();this.ieHack(true);previousMonth.hideFocus=true;nextMonth.hideFocus=true;todayButton.hideFocus=true;Event.observe(previousMonth,"click",this.prevMonth.bindEvent(this));Event.observe(nextMonth,"click",this.nextMonth.bindEvent(this));Event.observe(todayButton,"click",this.selectToday.bindEvent(this));Event.observe(this._monthSelect,"change",this.monthSelect.bindEvent(this));Event.observe(this._yearSelect,"change",this.yearSelect.bindEvent(this));Event.observe(this._calDiv,"mousewheel",this.mouseWheelChange.bindEvent(this));Event.observe(calendarBody,"click",this.selectDate.bindEvent(this));Prado.Element.focus(this.control);},ieHack:function(cleanup) 
    2727{if(this.iePopUp) 
    2828{this.iePopUp.style.display="block";this.iePopUp.style.top=(this._calDiv.offsetTop-1)+"px";this.iePopUp.style.left=(this._calDiv.offsetLeft-1)+"px";this.iePopUp.style.width=Math.abs(this._calDiv.offsetWidth-2)+"px";this.iePopUp.style.height=(this._calDiv.offsetHeight+1)+"px";if(cleanup)this.iePopUp.style.display="none";}},keyPressed:function(ev) 
     
    9393return this.control.offsetHeight;var control=Prado.WebUI.TDatePicker.getDayListControl(this.control);if(control)return control.offsetHeight;var control=Prado.WebUI.TDatePicker.getMonthListControl(this.control);if(control)return control.offsetHeight;var control=Prado.WebUI.TDatePicker.getYearListControl(this.control);if(control)return control.offsetHeight;return 0;},show:function() 
    9494{this.create();if(!this.showing) 
    95 {var pos=Position.cumulativeOffset(this.control);pos[1]+=this.getDatePickerOffsetHeight();this._calDiv.style.display="block";this._calDiv.style.top=(pos[1]-1)+"px";this._calDiv.style.left=pos[0]+"px";this.ieHack(false);this.documentClickEvent=this.hideOnClick.bindEvent(this);this.documentKeyDownEvent=this.keyPressed.bindEvent(this);Event.observe(document.body,"click",this.documentClickEvent);var date=this.getDateFromInput();if(date) 
     95{var pos=Position.positionedOffset(this.control);pos[1]+=this.getDatePickerOffsetHeight();this._calDiv.style.display="block";this._calDiv.style.top=(pos[1]-1)+"px";this._calDiv.style.left=pos[0]+"px";this.ieHack(false);this.documentClickEvent=this.hideOnClick.bindEvent(this);this.documentKeyDownEvent=this.keyPressed.bindEvent(this);Event.observe(document.body,"click",this.documentClickEvent);var date=this.getDateFromInput();if(date) 
    9696{this.selectedDate=date;this.setSelectedDate(date);} 
    9797Event.observe(document,"keydown",this.documentKeyDownEvent);this.showing=true;}},getDateFromInput:function() 
  • trunk/framework/Web/UI/WebControls/TBaseValidator.php

    r1169 r1225  
    125125 
    126126        /** 
    127          * Adds attributes to renderer. Calls parent implementation and renders the  
     127         * Adds attributes to renderer. Calls parent implementation and renders the 
    128128         * client control scripts. 
    129129         * @param THtmlWriter the renderer 
     
    238238                $this->updateControlCssClass(); 
    239239        } 
    240          
     240 
    241241        /** 
    242242         * Update the ControlToValidate component's css class depending 
     
    636636 
    637637        /** 
     638         * @param boolean true to revalidate when the control to validate changes value. 
     639         */ 
     640        public function setObserveChanges($value) 
     641        { 
     642                $this->setOption('ObserveChanges', TPropertyValue::ensureBoolean($value)); 
     643        } 
     644 
     645        /** 
     646         * @return boolean true to observe changes. 
     647         */ 
     648        public function getObserveChanges() 
     649        { 
     650                if(($option=$this->getOption('ObserveChanges'))!==null) 
     651                        return $option; 
     652                else 
     653                        return true; 
     654        } 
     655 
     656        /** 
    638657         * Ensure the string is a valid javascript function. If the string begins 
    639658         * with "javascript:" valid javascript function is assumed, otherwise the 
  • trunk/framework/Web/UI/WebControls/TCheckBox.php

    r1200 r1225  
    6161        { 
    6262                $checked=$this->getChecked(); 
    63                 if(isset($values[$key])!=$checked) 
    64                 { 
    65                         $this->setChecked(!$checked); 
    66                         return true; 
    67                 } 
    68                 else 
    69                         return false; 
     63                if($newChecked=isset($values[$key])) 
     64                        $this->setValue($values[$key]); 
     65                $this->setChecked($newChecked); 
     66                return $newChecked!==$checked; 
    7067        } 
    7168 
     
    132129        { 
    133130                $this->setViewState('Text',$value,''); 
     131        } 
     132 
     133        /** 
     134         * @return string the value of the checkbox. Defaults to empty. 
     135         */ 
     136        public function getValue() 
     137        { 
     138                return $this->getViewState('Value',''); 
     139        } 
     140 
     141        /** 
     142         * @param string the value of the checkbox 
     143         */ 
     144        public function setValue($value) 
     145        { 
     146                $this->setViewState('Value',$value,''); 
    134147        } 
    135148 
     
    310323        protected function getValueAttribute() 
    311324        { 
    312                 $attributes=$this->getViewState('InputAttributes',null); 
    313                 if($attributes && $attributes->contains('value')) 
    314                         return $attributes->itemAt('value'); 
    315                 else if($this->hasAttribute('value')) 
    316                         return $this->getAttribute('value'); 
     325                if(($value=$this->getValue())!=='') 
     326                        return $value; 
    317327                else 
    318                         return ''; 
     328                { 
     329                        $attributes=$this->getViewState('InputAttributes',null); 
     330                        if($attributes && $attributes->contains('value')) 
     331                                return $attributes->itemAt('value'); 
     332                        else if($this->hasAttribute('value')) 
     333                                return $this->getAttribute('value'); 
     334                        else 
     335                                return ''; 
     336                } 
    319337        } 
    320338 
     
    346364                        $writer->addAttribute('id',$clientID); 
    347365                $writer->addAttribute('type','checkbox'); 
    348                 if(($value = $this->getValueAttribute()) !== '') 
     366                if(($value=$this->getValueAttribute())!=='') 
    349367                        $writer->addAttribute('value',$value); 
    350368                if(!empty($onclick)) 
  • trunk/framework/Web/UI/WebControls/THtmlArea.php

    r1156 r1225  
    220220        protected function addAttributesToRender($writer) 
    221221        { 
    222                 if($this->getEnableVisualEdit()) 
     222                if($this->getEnableVisualEdit() && $this->getEnabled(true)) 
    223223                { 
    224224                        $writer->addAttribute('id',$this->getClientID()); 
  • trunk/framework/Web/UI/WebControls/TRadioButton.php

    r1156 r1225  
    102102        } 
    103103 
     104        /** 
     105         * @return string the value attribute to be rendered 
     106         */ 
    104107        protected function getValueAttribute() 
    105108        {