Changeset 1330
- Timestamp:
- 08/05/2006 04:34:30 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 33 modified
- 10 copied
-
HISTORY (modified) (2 diffs)
-
buildscripts/classtree/build.php (modified) (1 diff)
-
demos/quickstart/protected/controls/DocLink.php (modified) (1 diff)
-
demos/quickstart/protected/pages/Advanced/Themes.page (modified) (1 diff)
-
demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator (copied) (copied from branches/3.0/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator)
-
demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page (copied) (copied from branches/3.0/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page)
-
demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.php (copied) (copied from branches/3.0/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.php)
-
demos/quickstart/protected/pages/Controls/Validation.page (modified) (1 diff)
-
demos/quickstart/protected/pages/Search.php (modified) (4 diffs)
-
framework/Exceptions/messages.txt (modified) (1 diff)
-
framework/I18N/TGlobalization.php (modified) (1 diff)
-
framework/I18N/core/Gettext/MO.php (modified) (1 diff)
-
framework/I18N/core/Gettext/PO.php (modified) (1 diff)
-
framework/I18N/core/MessageSource_XLIFF.php (modified) (1 diff)
-
framework/I18N/core/MessageSource_gettext.php (modified) (1 diff)
-
framework/IO/TTarFileExtractor.php (modified) (2 diffs)
-
framework/PradoBase.php (modified) (1 diff)
-
framework/TApplication.php (modified) (1 diff)
-
framework/Util/TSimpleDateFormatter.php (modified) (1 diff)
-
framework/Web/Javascripts/js/validator.js (modified) (2 diffs)
-
framework/Web/Javascripts/prado/validation3.js (modified) (2 diffs)
-
framework/Web/TAssetManager.php (modified) (1 diff)
-
framework/Web/UI/TClientScriptManager.php (modified) (8 diffs)
-
framework/Web/UI/TPage.php (modified) (2 diffs)
-
framework/Web/UI/WebControls/TBaseValidator.php (modified) (1 diff)
-
framework/Web/UI/WebControls/TDataGrid.php (modified) (1 diff)
-
framework/Web/UI/WebControls/TDataList.php (modified) (1 diff)
-
framework/Web/UI/WebControls/TDataTypeValidator.php (modified) (1 diff)
-
framework/Web/UI/WebControls/TDatePicker.php (modified) (1 diff)
-
framework/Web/UI/WebControls/TOutputCache.php (modified) (1 diff)
-
framework/Web/UI/WebControls/TPanelStyle.php (modified) (1 diff)
-
framework/Web/UI/WebControls/TStyle.php (modified) (6 diffs)
-
framework/Web/UI/WebControls/TStyleSheet.php (modified) (2 diffs)
-
framework/Web/UI/WebControls/TWizard.php (modified) (6 diffs)
-
framework/prado-cli.php (modified) (1 diff)
-
tests/FunctionalTests/features/protected/pages/FocusControl.page (copied) (copied from branches/3.0/tests/FunctionalTests/features/protected/pages/FocusControl.page)
-
tests/FunctionalTests/features/protected/pages/FocusControl.php (copied) (copied from branches/3.0/tests/FunctionalTests/features/protected/pages/FocusControl.php)
-
tests/FunctionalTests/tickets/protected/pages/Ticket274.page (copied) (copied from branches/3.0/tests/FunctionalTests/tickets/protected/pages/Ticket274.page)
-
tests/FunctionalTests/tickets/protected/pages/Ticket278.page (copied) (copied from branches/3.0/tests/FunctionalTests/tickets/protected/pages/Ticket278.page)
-
tests/FunctionalTests/tickets/protected/pages/Ticket278.php (copied) (copied from branches/3.0/tests/FunctionalTests/tickets/protected/pages/Ticket278.php)
-
tests/FunctionalTests/tickets/tests/Ticket274TestCase.php (copied) (copied from branches/3.0/tests/FunctionalTests/tickets/tests/Ticket274TestCase.php)
-
tests/FunctionalTests/tickets/tests/Ticket278TestCase.php (copied) (copied from branches/3.0/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php)
-
tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/HISTORY
r1321 r1330 15 15 BUG: Ticket#264 - Typos in some exception throw statements (Knut) 16 16 BUG: Ticket#268 - THttpResponse.redirect() may fail for some browsers (Qiang) 17 BUG: Ticket#271 - Page method setFocus doesn't work (Wei) 17 18 BUG: Ticket#285 - NumberFormat Rounding Bug (Wei) 18 19 BUG: Ticket#297 - THttpRequest::constructUrl() encoding bug about array GET parameters (Qiang) 20 BUG: Ticket#320 - Typo in calling TDataList::setSelectedItemIndex and a bug in inserting wizard steps (Qiang) 19 21 BUG: TDataGrid may complain getting ItemType on a non-object if the grid is not data-bound (Qiang) 20 22 BUG: TCheckBox.Value should be converted to string (Qiang) … … 32 34 ENH: Ticket#263 - TListBox and TDropDownList support optgroup now (Qiang) 33 35 ENH: Ticket#277 - Added TControl.CustomData property (Qiang) 36 ENH: Ticket#278 - client-side validator enable/disable (conditional) (Wei) 34 37 ENH: Ticket#287 - TControl::broadcastEvent() may raise events now (Qiang) 35 38 ENH: Ticket#292 - Added THttpRequest::parseUrl() so that it is easier to be extended (Qiang) 36 39 ENH: Ticket#309 - Added THttpRequest.UrlParamSeparator property (Qiang) 40 ENH: Ticket#313 - Added TTableStyle.BorderCollapse property (Qiang) 41 ENH: Ticket#316 - Added media type support to CSS files in a theme (Qiang) 42 ENH: Validating TDatePicker does not need to explictly specific the DateFormat in validators. (Wei) 43 ENH: TRequireFieldValidator can be used to validate a valid date (Wei). 37 44 NEW: Added TStyleSheet (Wei) 38 45 -
trunk/buildscripts/classtree/build.php
r1219 r1330 7 7 8 8 $exclusions=array( 9 'prado.php',9 // 'prado.php', 10 10 'pradolite.php', 11 'PradoBase.php',11 // 'PradoBase.php', 12 12 'clientscripts.php', 13 13 '.svn', -
trunk/demos/quickstart/protected/controls/DocLink.php
r801 r1330 23 23 $classFile=array_pop($paths).'.html'; 24 24 $this->setNavigateUrl(self::BASE_URL . '/' . implode('.',$paths) . '/' . $classFile); 25 $this->setText('API Manual'); 25 if($this->getText() === '') 26 $this->setText('API Manual'); 26 27 } 27 28 } -
trunk/demos/quickstart/protected/pages/Advanced/Themes.page
r1265 r1330 29 29 To use the Javascript files and CSS files contained in a theme, a <tt>THead</tt> control must be placed on the page template. This is because the theme will register those files with the page and <tt>THead</tt> is the right place to load those files. 30 30 </p> 31 <p> 32 It is possible to specify media types of CSS files contained in a theme. By default, a CSS file applies to all media types. If the CSS file is named like <tt>mystyle.print.css</tt>, it will be applied only to <tt>print</tt> media type. As another example, <tt>mystyle.screen.css</tt> applies to <tt>screen</tt> media only, and <tt>mystyle.css</tt> applies to all media types. 33 </p> 31 34 32 35 <h2 id="5905">Theme Storage</h2> -
trunk/demos/quickstart/protected/pages/Controls/Validation.page
r1265 r1330 152 152 <com:RunBar PagePath="Controls.Samples.TValidationSummary.Home" /> 153 153 154 <h2>Client and Server Side Conditional Validation</h2> 155 <p> 156 All validators contains the following events. 157 <ul> 158 <li>The <tt>OnValidate</tt> event is raise before the validator validation functions are called.</li> 159 <li>The <tt>OnSuccess</tt> event is raised after the validator has successfully validate the control.</li> 160 <li>The <tt>OnError</tt> event is raised after the validator fails validation.</li> 161 </ul> 162 The corresponding events for the client side is available as sub-properties 163 of the <tt>ClientSide</tt> property of the validator. 164 </p> 165 <p>The following example pop-up a message saying "hello" when the validator fails on the client-side. 166 <com:TTextHighlighter Language="prado" CssClass="source"> 167 <com:TRequiredFieldValidator ... > 168 <prop:ClientSide.OnError> 169 alert("hello"); 170 </prop:ClientSide.OnError> 171 </com:TRequiredFieldValidator> 172 </com:TTextHighlighter> 173 The resulting client-side event callback function is of the following form. 174 <com:TTextHighlighter Language="javascript" CssClass="source"> 175 function onErrorHandler(validator, sender) 176 { 177 alert("hello"); 178 } 179 </com:TTextHighlighter> 180 Where <tt>validator</tt> is the current client-side validator and <tt>sender</tt> 181 is the control that invoked the validator. 182 </p> 183 <h3>Conditional Validation Example</h3> 184 <p> 185 The following example show the use of client-side and server side validator events. The example 186 demonstrates conditional validation. 187 <com:RunBar PagePath="Controls.Samples.TClientSideValidator.Home" /> 188 </p> 154 189 </com:TContent> -
trunk/demos/quickstart/protected/pages/Search.php
r1186 r1330 14 14 $this->quickstart_results->setDataSource($hits_1); 15 15 $this->quickstart_results->dataBind(); 16 16 17 17 $this->emptyResult->setVisible(!count($hits_1)); 18 18 } 19 19 } 20 20 21 21 public function highlightSearch($text) 22 22 { … … 34 34 } 35 35 } 36 36 37 37 $min = $where - 15 < 0 ? 0 : $where - 15; 38 38 $max = $where + 15 > $t ? $t : $where + 15; … … 42 42 return $prefix.implode(' ', $subtext).$suffix; 43 43 } 44 44 45 45 protected function containsKeys($word, $keys) 46 46 { … … 48 48 { 49 49 if(is_int(strpos($word, $key))) 50 return true; 50 return true; 51 51 } 52 52 return false; -
trunk/framework/Exceptions/messages.txt
r1321 r1330 324 324 325 325 tdatepicker_autopostback_unsupported = '{0}' does not support AutoPostBack. 326 326 globalization_cache_path_failed = Unable to create translation message cache path '{0}'. Make sure the parent directory exists and is writable by the Web process. 327 globalization_source_path_failed = Unable to create translation message path '{0}'. Make sure the parent directory exists and is writable by the Web process. 327 328 callback_not_support_no_priority_state_update = Callback request does not support unprioritized pagestate update. 328 329 callback_invalid_callback_options = '{1}' is not a valid TCallbackOptions control for Callback control '{0}'. -
trunk/framework/I18N/TGlobalization.php
r851 r1330 169 169 if($config['type'] == 'XLIFF' || $config['type'] == 'gettext') 170 170 { 171 $config['source'] = Prado::getPathOfNamespace($config['source']); 172 if($config['source']===null || !is_dir($config['source'])) 173 throw new TException("invalid source dir '{$config['source']}'"); 171 if($config['source']) 172 { 173 $config['source'] = Prado::getPathOfNamespace($config['source']); 174 if(!is_dir($config['source'])) 175 { 176 if(@mkdir($config['source'])===false) 177 throw new TConfigurationException('globalization_source_path_failed', 178 $config['source']); 179 chmod($config['source'], 0777); //make it deletable 180 } 181 } 182 else 183 { 184 throw new TConfigurationException("invalid source dir '{$config['source']}'"); 185 } 174 186 } 175 187 if($config['cache']) 188 { 176 189 $config['cache'] = $this->getApplication()->getRunTimePath().'/i18n'; 190 if(!is_dir($config['cache'])) 191 { 192 if(@mkdir($config['cache'])===false) 193 throw new TConfigurationException('globalization_cache_path_failed', 194 $config['cache']); 195 chmod($config['cache'], 0777); //make it deletable 196 } 197 } 177 198 $this->_translation = $config; 178 199 } -
trunk/framework/I18N/core/Gettext/MO.php
r1029 r1330 350 350 @flock($this->_handle, LOCK_UN); 351 351 @fclose($this->_handle); 352 chmod($file,0777); 352 353 return true; 353 354 } -
trunk/framework/I18N/core/Gettext/PO.php
r1029 r1330 155 155 @flock($fh, LOCK_UN); 156 156 @fclose($fh); 157 chmod($file,0777); 157 158 return true; 158 159 } -
trunk/framework/I18N/core/MessageSource_XLIFF.php
r851 r1330 474 474 $file = $this->getSource($variant); 475 475 $dir = dirname($file); 476 if(!is_dir($dir)) @mkdir($dir); 476 if(!is_dir($dir)) 477 { 478 @mkdir($dir); 479 @chmod($dir,0777); 480 } 477 481 if(!is_dir($dir)) 478 482 throw new TException("Unable to create directory $dir"); 479 483 file_put_contents($file, $this->getTemplate($catalogue)); 484 chmod($file, 0777); 480 485 return array($variant, $file); 481 486 } -
trunk/framework/I18N/core/MessageSource_gettext.php
r851 r1330 432 432 433 433 $dir = dirname($mo_file); 434 if(!is_dir($dir)) @mkdir($dir); 434 if(!is_dir($dir)) 435 { 436 @mkdir($dir); 437 @chmod($dir,0777); 438 } 435 439 if(!is_dir($dir)) 436 440 throw new TException("Unable to create directory $dir"); -
trunk/framework/IO/TTarFileExtractor.php
r1029 r1330 461 461 return false; 462 462 } 463 chmod($v_header['filename'], 0777); 463 464 } 464 465 } else { … … 550 551 return false; 551 552 } 553 chmod($p_dir,0777); 552 554 553 555 return true; -
trunk/framework/PradoBase.php
r1321 r1330 517 517 public static function varDump($var,$depth=10,$highlight=false) 518 518 { 519 require_once(PRADO_DIR.'/Util/TVarDumper.php');519 Prado::using('System.Util.TVarDumper'); 520 520 return TVarDumper::dump($var,$depth,$highlight); 521 521 } -
trunk/framework/TApplication.php
r925 r1330 311 311 $this->_runtimePath.='/'.$subdir; 312 312 if(!is_dir($this->_runtimePath)) 313 { 313 314 if(@mkdir($this->_runtimePath)===false) 314 315 throw new TConfigurationException('application_runtimepath_failed',$this->_runtimePath); 316 chmod($this->_runtimePath, 0777); //make it deletable 317 } 315 318 } 316 319 } -
trunk/framework/Util/TSimpleDateFormatter.php
r1321 r1330 186 186 public function isValidDate($value) 187 187 { 188 return !is_null($this->parse($value, false)); 188 if(is_null($value)) 189 return false; 190 else 191 return !is_null($this->parse($value, false)); 189 192 } 190 193 -
trunk/framework/Web/Javascripts/js/validator.js
r1306 r1330 98 98 {if(typeof(this.options.OnValidate)=="function") 99 99 this.options.OnValidate(this,invoker);if(this.enabled) 100 this.isValid=this.evaluateIsValid();if(this.isValid) 100 this.isValid=this.evaluateIsValid();else 101 this.isValid=true;if(this.isValid) 101 102 {if(typeof(this.options.OnSuccess)=="function") 102 103 {this.visible=true;this.message.style.visibility="visible";this.updateControlCssClass(this.control,this.isValid);this.options.OnSuccess(this,invoker);} … … 127 128 switch(this.options.ControlType) 128 129 {case'TDatePicker':if(control.type=="text") 129 return this.trim($F(control));else 130 {value=this.trim($F(control));if(this.options.DateFormat) 131 {date=value.toDate(this.options.DateFormat);return date==null?'':date;} 132 else 133 return value;} 134 else 130 135 {this.observeDatePickerChanges();return Prado.WebUI.TDatePicker.getDropDownDate(control).getTime();} 131 136 case'THtmlArea':if(typeof tinyMCE!="undefined") -
trunk/framework/Web/Javascripts/prado/validation3.js
r1306 r1330 662 662 if(this.enabled) 663 663 this.isValid = this.evaluateIsValid(); 664 else 665 this.isValid = true; 664 666 665 667 if(this.isValid) … … 777 779 case 'TDatePicker': 778 780 if(control.type == "text") 779 return this.trim($F(control)); 781 { 782 value = this.trim($F(control)); 783 784 if(this.options.DateFormat) 785 { 786 date = value.toDate(this.options.DateFormat); 787 return date == null ? '' : date; 788 } 789 else 790 return value; 791 } 780 792 else 781 793 { -
trunk/framework/Web/TAssetManager.php
r1055 r1330 200 200 { 201 201 if(!is_dir($dst)) 202 { 202 203 @mkdir($dst); 204 @chmod($dst, 0777); 205 } 203 206 $dstFile=$dst.'/'.basename($src); 204 207 if(@filemtime($dstFile)<@filemtime($src)) -
trunk/framework/Web/UI/TClientScriptManager.php
r1200 r1330 146 146 } 147 147 148 /** 148 /** 149 149 * Renders the <script> tag that will load the javascript library files. 150 150 * @param THtmlWriter writer that renders the <script> tag. … … 164 164 } 165 165 166 /** 166 /** 167 167 * Returns javascript statement that create a new callback request object. 168 168 * @param ICallbackEventHandler callback response handler … … 245 245 public function registerFocusControl($target) 246 246 { 247 $this->registerPradoScriptInternal('prado'); 248 $this->_endScripts['prado:focus']='Prado.Focus.setFocus("'.TJavaScript::quoteString($target).'");'; 247 $this->registerPradoScriptInternal('effects'); 248 if($target instanceof TControl) 249 $target=$target->getClientID(); 250 $id = TJavaScript::quoteString($target); 251 $this->_endScripts['prado:focus'] = 'new Effect.ScrollTo("'.$id.'"); Prado.Element.focus("'.$id.'");'; 249 252 250 253 $params=func_get_args(); … … 269 272 * @param string a unique key identifying the file 270 273 * @param string URL to the CSS file 271 */ 272 public function registerStyleSheetFile($key,$url) 273 { 274 $this->_styleSheetFiles[$key]=$url; 274 * @param string media type of the CSS (such as 'print', 'screen', etc.). Defaults to empty, meaning the CSS applies to all media types. 275 */ 276 public function registerStyleSheetFile($key,$url,$media='') 277 { 278 if($media==='') 279 $this->_styleSheetFiles[$key]=$url; 280 else 281 $this->_styleSheetFiles[$key]=array($url,$media); 275 282 276 283 $params=func_get_args(); … … 283 290 * @param string CSS block 284 291 */ 285 public function registerStyleSheet($key,$css )292 public function registerStyleSheet($key,$css,$media='') 286 293 { 287 294 $this->_styleSheets[$key]=$css; … … 432 439 return isset($this->_endScripts[$key]); 433 440 } 434 441 435 442 /** 436 443 * @return boolean true if any end scripts are registered. … … 440 447 return count($this->_endScripts) > 0; 441 448 } 442 449 443 450 /** 444 451 * @return boolean true if any begin scripts are registered. … … 465 472 $str=''; 466 473 foreach($this->_styleSheetFiles as $url) 467 $str.="<link rel=\"stylesheet\" type=\"text/css\" href=\"".THttpUtility::htmlEncode($url)."\" />\n"; 474 { 475 if(is_array($url)) 476 $str.="<link rel=\"stylesheet\" type=\"text/css\" media=\"{$url[1]}\" href=\"".THttpUtility::htmlEncode($url[0])."\" />\n"; 477 else 478 $str.="<link rel=\"stylesheet\" type=\"text/css\" href=\"".THttpUtility::htmlEncode($url)."\" />\n"; 479 } 468 480 $writer->write($str); 469 481 } -
trunk/framework/Web/UI/TPage.php
r1265 r1330 638 638 { 639 639 foreach($this->_theme->getStyleSheetFiles() as $url) 640 $cs->registerStyleSheetFile($url,$url );640 $cs->registerStyleSheetFile($url,$url,$this->getCssMediaType($url)); 641 641 foreach($this->_theme->getJavaScriptFiles() as $url) 642 642 $cs->registerHeadScriptFile($url,$url); … …
