From c6b4190fab88201f4efaa0d00a6aa823b180f482 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 10 Jun 2006 11:28:30 +0000 Subject: Merge from 3.0 branch till 1148. --- framework/PradoBase.php | 4 ++-- framework/Security/TAuthorizationRule.php | 2 +- framework/Web/Javascripts/datepicker/datepicker.js | 28 +++++++++------------- framework/Web/Javascripts/js/datepicker.js | 7 +++--- framework/Web/Javascripts/prado/controls.js | 1 + framework/Web/Services/TPageService.php | 4 ++-- framework/Web/UI/TControl.php | 2 +- framework/Web/UI/WebControls/TLinkButton.php | 10 ++++---- 8 files changed, 27 insertions(+), 31 deletions(-) (limited to 'framework') diff --git a/framework/PradoBase.php b/framework/PradoBase.php index 9c6ef96b..608784e9 100644 --- a/framework/PradoBase.php +++ b/framework/PradoBase.php @@ -90,7 +90,7 @@ class PradoBase /** * Class autoload loader. - * This method is provided to be invoked within an __auload() magic method. + * This method is provided to be invoked within an __autoload() magic method. * @param string class name */ public static function autoload($className) @@ -645,4 +645,4 @@ else // PHP < 5.1.0 } } -?> \ No newline at end of file +?> diff --git a/framework/Security/TAuthorizationRule.php b/framework/Security/TAuthorizationRule.php index 8248a45a..5c8f0f9b 100644 --- a/framework/Security/TAuthorizationRule.php +++ b/framework/Security/TAuthorizationRule.php @@ -137,7 +137,7 @@ class TAuthorizationRule extends TComponent } /** - * @var boolean if this rule applies to everyone + * @return boolean if this rule applies to everyone */ public function getEveryoneApplied() { diff --git a/framework/Web/Javascripts/datepicker/datepicker.js b/framework/Web/Javascripts/datepicker/datepicker.js index e704e950..11bee07e 100644 --- a/framework/Web/Javascripts/datepicker/datepicker.js +++ b/framework/Web/Javascripts/datepicker/datepicker.js @@ -239,13 +239,6 @@ Prado.WebUI.TDatePicker.prototype = var buttonText = today.SimpleFormat(this.Format,this); todayButton.value = buttonText; div.appendChild(todayButton); - - /*var clearButton = document.createElement("button"); - clearButton.className = "clearButton"; - buttonText = "Clear"; - clearButton.appendChild(document.createTextNode(buttonText)); - div.appendChild(clearButton); - */ if(Prado.Browser().ie) { @@ -283,10 +276,9 @@ Prado.WebUI.TDatePicker.prototype = Event.observe(calendarBody, "click", this.selectDate.bindEvent(this)); - Event.observe(this.control, "blur", this.hide.bind(this)); Prado.Element.focus(this.control); - },A + }, ieHack : function(cleanup) { @@ -308,7 +300,7 @@ Prado.WebUI.TDatePicker.prototype = if (!ev) ev = document.parentWindow.event; var kc = ev.keyCode != null ? ev.keyCode : ev.charCode; - if(kc == Event.KEY_RETURN || kc == Event.KEY_SPACEBAR) + if(kc == Event.KEY_RETURN || kc == Event.KEY_SPACEBAR || kc == Event.KEY_TAB) { this.setSelectedDate(this.selectedDate); Event.stop(ev); @@ -318,8 +310,7 @@ Prado.WebUI.TDatePicker.prototype = { Event.stop(ev); this.hide(); } - - + var getDaysPerMonth = function (nMonth, nYear) { nMonth = (nMonth + 12) % 12; @@ -600,6 +591,7 @@ Prado.WebUI.TDatePicker.prototype = if(!within) this.hide(); }, + hide : function() { if(this.showing) @@ -667,11 +659,13 @@ Prado.WebUI.TDatePicker.prototype = hover : function(ev) { - //conditionally add the hover class to the event target element. - if(ev.type == "mouseover") - Event.element(ev).addClassName("hover"); - else - Event.element(ev).removeClassName("hover"); + if(Event.element(ev).tagName) + { + if(ev.type == "mouseover") + Event.element(ev).addClassName("hover"); + else + Event.element(ev).removeClassName("hover"); + } }, updateHeader : function () { diff --git a/framework/Web/Javascripts/js/datepicker.js b/framework/Web/Javascripts/js/datepicker.js index e0bba502..090f3cbd 100644 --- a/framework/Web/Javascripts/js/datepicker.js +++ b/framework/Web/Javascripts/js/datepicker.js @@ -23,10 +23,10 @@ div=document.createElement("div");div.className="calendarFooter";this._calDiv.ap this.iePopUp.scrolling="no" this.iePopUp.frameBorder="0" document.body.appendChild(this.iePopUp);} -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));Event.observe(this.control,"blur",this.hide.bind(this));Prado.Element.focus(this.control);},ieHack:function(cleanup) +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) {if(this.iePopUp) {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) -{if(!this.showing)return;if(!ev)ev=document.parentWindow.event;var kc=ev.keyCode!=null?ev.keyCode:ev.charCode;if(kc==Event.KEY_RETURN||kc==Event.KEY_SPACEBAR) +{if(!this.showing)return;if(!ev)ev=document.parentWindow.event;var kc=ev.keyCode!=null?ev.keyCode:ev.charCode;if(kc==Event.KEY_RETURN||kc==Event.KEY_SPACEBAR||kc==Event.KEY_TAB) {this.setSelectedDate(this.selectedDate);Event.stop(ev);this.hide();} if(kc==Event.KEY_ESC) {Event.stop(ev);this.hide();} @@ -110,7 +110,8 @@ for(i=1;i<=monthLength;i++,index++){var slot=this.dateSlot[index];var slotNode=s if(d1.toISODate()==selected){slotNode.className+=" selected";} d1=new Date(d1.getFullYear(),d1.getMonth(),d1.getDate()+1);} var lastDateIndex=index;while(index<42){this.dateSlot[index].value=-1;this.dateSlot[index].data.data=String.fromCharCode(160);this.dateSlot[index].data.parentNode.className="empty";++index;}},hover:function(ev) +{if(Event.element(ev).tagName) {if(ev.type=="mouseover") Event.element(ev).addClassName("hover");else -Event.element(ev).removeClassName("hover");},updateHeader:function(){var options=this._monthSelect.options;var m=this.selectedDate.getMonth();for(var i=0;igetAttributes(); if(($id=$properties->itemAt('id'))===null) throw new TConfigurationException('pageserviceconf_page_invalid',$configPath); - if($id===$page) + if(strcasecmp($id,$page)===0) $this->_properties=array_merge($this->_properties,$properties->toArray()); } } diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index eced51ea..d5079382 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -1165,6 +1165,7 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable */ protected function initRecursive($namingContainer=null) { + $this->ensureChildControls(); if($this->getHasControls()) { if($this instanceof INamingContainer) @@ -1235,7 +1236,6 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable if($this->getVisible(false)) { - $this->ensureChildControls(); if(isset($this->_rf[self::RF_ADAPTER])) $this->_rf[self::RF_ADAPTER]->onPreRender(null); else diff --git a/framework/Web/UI/WebControls/TLinkButton.php b/framework/Web/UI/WebControls/TLinkButton.php index 7f9baab8..7487b37a 100644 --- a/framework/Web/UI/WebControls/TLinkButton.php +++ b/framework/Web/UI/WebControls/TLinkButton.php @@ -85,18 +85,18 @@ class TLinkButton extends TWebControl implements IPostBackEventHandler, IButtonC else if($this->getEnabled()) // in this case, parent will not render 'disabled' $writer->addAttribute('disabled','disabled'); } - + /** * Renders the client-script code. */ protected function renderClientControlScript($writer) { //create unique no-op url references - $nop = "#".$this->getClientID(); + $nop = "javascript:;//".$this->getClientID(); $writer->addAttribute('href', $nop); - $cs = $this->getPage()->getClientScript(); + $cs = $this->getPage()->getClientScript(); $cs->registerPostBackControl(get_class($this),$this->getPostBackOptions()); - } + } /** * Returns postback specifications for the button. @@ -252,4 +252,4 @@ class TLinkButton extends TWebControl implements IPostBackEventHandler, IButtonC } } -?> \ No newline at end of file +?> -- cgit v1.2.3