Changeset 1444
- Timestamp:
- 09/23/2006 09:20:54 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 12 modified
-
HISTORY (modified) (1 diff)
-
demos/blog/protected/application.xml (modified) (1 diff)
-
demos/quickstart/protected/pages/Advanced/I18N.page (modified) (2 diffs)
-
demos/quickstart/protected/pages/Configurations/UrlMapping.page (modified) (3 diffs)
-
framework/I18N/TGlobalization.php (modified) (4 diffs)
-
framework/I18N/Translation.php (modified) (1 diff)
-
framework/Web/THttpRequest.php (modified) (1 diff)
-
framework/Web/TUrlMapping.php (modified) (6 diffs, 1 prop)
-
requirements/index.php (modified) (1 diff)
-
requirements/messages-bg.txt (modified) (1 diff)
-
requirements/messages-zh.txt (modified) (1 diff)
-
requirements/messages.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/HISTORY
r1438 r1444 17 17 ENH: Ticket#361 - Introduced include template tag that supports including external templates (Qiang) 18 18 ENH: Ticket#366 - white spaces are now allowed around attribute names in template (Qiang) 19 ENH: Added an interactive PHP shell, usage: "prado-cli.php shell" (Wei)19 ENH: Ticket#378 - PRADO applications can now run in command line (Qiang) 20 20 ENH: Ticket#379 - TAuthorizationRule performance enhancement (Qiang) 21 21 ENH: Easier to customize the TDatePicker using CssClass (Wei) 22 ENH: Added an interactive PHP shell, usage: "prado-cli.php shell" (Wei) 22 23 NEW: TLiteralColumn (Qiang) 23 N SW: TUrlMapping (Wei)24 NEW: TUrlMapping (Wei) 24 25 25 26 Version 3.0.4 September 4, 2006 -
trunk/demos/blog/protected/application.xml
r1436 r1444 16 16 </module> 17 17 <module class="System.Util.TParameterModule" ParameterFile="Application.Data.Settings" /> 18 19 <!-- use TUrlMapping to map URL patterns to particular requests --> 18 20 <module id="friendly-url" class="System.Web.TUrlMapping"> 19 <url pageClass="Posts.ViewPost" pattern="post/{id}/?" parameters.id="\d+" />20 <url pageClass="Posts.ListPost" pattern="archive/{time}/?" parameters.time="\d{6}" />21 <url pageClass="Posts.ListPost" pattern="category/{cat}/?" parameters.cat="\d+" />21 <url ServiceParameter="Posts.ViewPost" pattern="post/{id}/?" parameters.id="\d+" /> 22 <url ServiceParameter="Posts.ListPost" pattern="archive/{time}/?" parameters.time="\d{6}" /> 23 <url ServiceParameter="Posts.ListPost" pattern="category/{cat}/?" parameters.cat="\d+" /> 22 24 </module> 23 25 </modules> -
trunk/demos/quickstart/protected/pages/Advanced/I18N.page
r1398 r1444 41 41 <translation type="XLIFF" 42 42 source="MyApp.messages" 43 marker="@@" 43 44 autosave="true" cache="true" /> 44 45 </module> … … 49 50 attribute if enabled, saves untranslated messages back into the message catalogue. 50 51 With <tt>cache</tt> enabled, translated messages are saved in the application <tt>runtime/i18n</tt> directory. 52 The <tt>marker</tt> value is used to surround any untranslated text. 51 53 </p> 52 54 -
trunk/demos/quickstart/protected/pages/Configurations/UrlMapping.page
r1436 r1444 21 21 <com:TTextHighlighter Language="xml" CssClass="source"> 22 22 <module id="friendly-url" class="System.Web.TUrlMapping"> 23 <url pageClass="ClassName" pattern="regexp" parameters.id="regexp" />23 <url serviceParameter="ClassName" pattern="regexp" parameters.id="regexp" /> 24 24 </module> 25 25 </com:TTextHighlighter> 26 26 </p> 27 27 28 <p>The <tt>PageClass</tt> set the name of class that the matched URL will 29 be requested.</p> The <tt>Pattern</tt> and <tt>Parameters</tt> attribute 28 <p>The <tt>ServiceParameter</tt> and <tt>ServiceID</tt> 29 (the default ID is 'page') set the service parameter and service ID respectively. 30 The service parameter for the <tt>TPageService</tt> service is the 31 Page class name, e.g., for an URL "index.php?page=Home", "page" is the service ID and the service 32 parameter is "Home". Other services may use the service parameter and ID differently. 33 See <a href="?page=Fundamentals.Services">Services</a> for further details. 34 </p> 35 36 <p> 37 The <tt>Pattern</tt> and <tt>Parameters</tt> attribute 30 38 values are regular expression patterns that 31 39 determine the mapping criteria. The <tt>Pattern</tt> property takes … … 35 43 For example, 36 44 <com:TTextHighlighter Language="xml" CssClass="source"> 37 <url pageClass="Pages.ShowArticles" pattern="articles/{year}/{month}/{day}"45 <url ServiceParameter="Pages.ShowArticles" pattern="articles/{year}/{month}/{day}" 38 46 parameters.year="\d{4}" parameters.month="\d{2}" parameters.day="\d+" /> 39 47 </com:TTextHighlighter> … … 41 49 The example is equivalent, using regular expression only, to 42 50 <com:TTextHighlighter Language="xml" CssClass="source"> 43 <url pageClass="Pages.ShowArticles">51 <url ServiceParmaeter="Pages.ShowArticles"> 44 52 <![CDATA[ 45 53 articles/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d+) -
trunk/framework/I18N/TGlobalization.php
r1398 r1444 94 94 public function setDefaultCulture($culture) 95 95 { 96 $this->_defaultC harset= str_replace('-','_',$culture);96 $this->_defaultCulture = str_replace('-','_',$culture); 97 97 } 98 98 … … 161 161 * $config['autosave'] = 'true'; //save untranslated message 162 162 * $config['cache'] = 'true'; //cache translated message 163 * $config['marker'] = '@@'; // surround untranslated text with '@@' 163 164 * </code> 164 165 * Throws exception is source is not found. … … 177 178 throw new TConfigurationException('globalization_source_path_failed', 178 179 $config['source']); 179 chmod($config['source'], 0777); //make it deletable 180 chmod($config['source'], 0777); //make it deletable 180 181 } 181 182 } … … 193 194 throw new TConfigurationException('globalization_cache_path_failed', 194 195 $config['cache']); 195 chmod($config['cache'], 0777); //make it deletable 196 chmod($config['cache'], 0777); //make it deletable 196 197 } 197 198 } -
trunk/framework/I18N/Translation.php
r1398 r1444 55 55 self::$formatter = new MessageFormat($source, $app->getCharset()); 56 56 57 //mark untranslated text 58 if($ps=$config['marker']) 59 self::$formatter->setUntranslatedPS(array($ps,$ps)); 60 57 61 //save the message on end request 58 62 Prado::getApplication()->attachEventHandler( -
trunk/framework/Web/THttpRequest.php
r1436 r1444 597 597 } 598 598 599 protected function getRequestResolved() 600 { 601 return $this->_requestResolved; 602 } 603 599 604 /** 600 605 * @return array IDs of the available services -
trunk/framework/Web/TUrlMapping.php
- Property svn:keywords set to Id
r1436 r1444 22 22 * <code> 23 23 * <module id="friendly-url" class="System.Web.TUrlMapping"> 24 * <url pageClass="Posts.ViewPost" pattern="post/{id}/?" parameters.id="\d+" />25 * <url pageClass="Posts.ListPost" pattern="archive/{time}/?" parameters.time="\d{6}" />26 * <url pageClass="Posts.ListPost" pattern="category/{cat}/?" parameters.cat="\d+" />24 * <url ServiceParameter="Posts.ViewPost" pattern="post/{id}/?" parameters.id="\d+" /> 25 * <url ServiceParameter="Posts.ListPost" pattern="archive/{time}/?" parameters.time="\d{6}" /> 26 * <url ServiceParameter="Posts.ListPost" pattern="category/{cat}/?" parameters.cat="\d+" /> 27 27 * </module> 28 28 * </code> … … 190 190 $request = $this->getRequest(); 191 191 $id = $pattern->getServiceID(); 192 $pa ge = $pattern->getPageClass();192 $param = $pattern->getServiceParameter(); 193 193 $request->setServiceID($id); 194 $request->setServiceParameter($pa ge);195 $request->add($id,$pa ge);194 $request->setServiceParameter($param); 195 $request->add($id,$param); 196 196 } 197 197 } … … 228 228 * object. For example, <tt>$this->Request['year']</tt>. 229 229 * 230 * The {@link setPageClass PageClass} and {@link setServiceID ServiceID} 231 * (the default ID is 'page') set the class and the service that will 232 * handle the matching URL. 230 * The {@link setServiceParameter ServiceParameter} and {@link setServiceID ServiceID} 231 * (the default ID is 'page') set the service parameter and service id respectively. 232 * The service parameter for the TPageService is the Page class name, other service 233 * may use the service parameter differently. 233 234 * 234 235 * For more complicated mappings, the body of the <tt><url></tt> … … 243 244 { 244 245 /** 245 * @var string page class name.246 */ 247 private $_ pageClass;246 * @var string service parameter such as Page class name. 247 */ 248 private $_serviceParameter; 248 249 /** 249 250 * @var string service ID, default is 'page'. … … 278 279 if(strlen($body)>0) 279 280 $this->setPattern($body); 280 if(is_null($this->_ pageClass))281 if(is_null($this->_serviceParameter)) 281 282 { 282 283 throw new TConfigurationException( 283 'dispatcher_url_ page_class_missing', $this->getPattern());284 'dispatcher_url_service_parameter_missing', $this->getPattern()); 284 285 } 285 286 $this->initializePattern(); … … 311 312 312 313 /** 313 * @param string name of the page class to handle the request.314 */ 315 public function set PageClass($value)316 { 317 $this->_ pageClass=$value;318 } 319 320 /** 321 * @return string page class name.322 */ 323 public function get PageClass()324 { 325 return $this->_ pageClass;314 * @param string service parameter, such as page class name. 315 */ 316 public function setServiceParameter($value) 317 { 318 $this->_serviceParameter=$value; 319 } 320 321 /** 322 * @return string service parameter, such as page class name. 323 */ 324 public function getServiceParameter() 325 { 326 return $this->_serviceParameter; 326 327 } 327 328 -
trunk/requirements/index.php
r1398 r1444 55 55 '$_SERVER["PATH_INFO"] check', 56 56 'PATH_INFO required'), 57 array( 58 true, 59 class_exists('Reflection',false), 60 'Reflection extension check', 61 'Reflection extension required'), 57 62 array( 58 63 true, -
trunk/requirements/messages-bg.txt
r1398 r1444 12 12 Zlib extension check = Проверка за Zlib 13 13 Zlib extension optional = Zlib разширението е незадължително. Ако не е заредено, състоянието на страницата няма да бъде компресирано и размера на страницата може да се увеличи. 14 Reflection extension check = Проверка за Reflection разширението 15 Reflection extension required = Reflection разширението е задължително за PRADO. 14 16 DOM extension check = Проверка за DOM разширението 15 17 DOM extension required = DOM разширението е задължително за PRADO. Използва се в TXmlDocument за анализ на XML-базирани конфигурации. -
trunk/requirements/messages-zh.txt
r1398 r1444 12 12 Zlib extension check = Zlib模块检查 13 13 Zlib extension optional = Zlib模块是可选的。如果它不存在,页面的状态信息将无法压缩,由此可能导致您的页面传送数据量增大。 14 Reflection extension check = Reflection模块检查 15 Reflection extension required = Reflection模块是必须的。如果它不存在,PRADO将无法验证控件模板的正确性。 14 16 DOM extension check = DOM模块检查 15 17 DOM extension required = DOM模块是必须的。如果它不存在,基于XML的各种配置文件将无法解析。 -
trunk/requirements/messages.txt
r1398 r1444 12 12 Zlib extension check = Zlib extension check 13 13 Zlib extension optional = Zlib extension is optional. If it is absent, page state will not be compressed and your page size may increase. 14 Reflection extension check = Reflection extension check 15 Reflection extension required = Reflection extension is required by PRADO. It is used in by PRADO to check the validity of page templates. 14 16 DOM extension check = DOM extension check 15 17 DOM extension required = DOM extension is required by PRADO. It is used in TXmlDocument to parse all sorts of XML-based configurations.
