diff options
-rw-r--r-- | .gitattributes | 2 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | build.xml | 27 | ||||
-rw-r--r-- | buildscripts/classtree/DWExtension.php | 255 | ||||
-rw-r--r-- | buildscripts/classtree/DWExtensionReadme.txt | 22 | ||||
-rw-r--r-- | buildscripts/classtree/build.php | 93 | ||||
-rw-r--r-- | buildscripts/texbuilder/pages.php | 1 | ||||
-rw-r--r-- | framework/Caching/TMemCache.php | 2 | ||||
-rw-r--r-- | framework/Caching/TSqliteCache.php | 2 | ||||
-rw-r--r-- | framework/Exceptions/TErrorHandler.php | 2 | ||||
-rw-r--r-- | framework/Exceptions/messages.txt | 4 | ||||
-rw-r--r-- | framework/Web/THttpSession.php | 2 | ||||
-rw-r--r-- | framework/Web/UI/TTemplateManager.php | 6 | ||||
-rw-r--r-- | framework/Web/UI/TThemeManager.php | 10 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TDataGrid.php | 19 | ||||
-rw-r--r-- | index.html | 68 |
16 files changed, 455 insertions, 62 deletions
diff --git a/.gitattributes b/.gitattributes index 487302b1..04b42000 100644 --- a/.gitattributes +++ b/.gitattributes @@ -310,6 +310,8 @@ buildscripts/PhpDocumentor/user/error.ini -text buildscripts/PhpDocumentor/user/pear-makedocs.ini -text buildscripts/PhpDocumentor/user/prado.ini -text buildscripts/PhpDocumentor/user/testdocbook.ini -text +buildscripts/classtree/DWExtension.php -text +buildscripts/classtree/DWExtensionReadme.txt -text buildscripts/classtree/build.php -text buildscripts/index/api_index.php -text buildscripts/index/build.php -text @@ -18,6 +18,7 @@ BUG: Ticket#234 - Postback target could be out of date (Qiang) BUG: Ticket#239 - Ondeactivate handler for the first View of MultiView is always fired (Qiang)
BUG: Ticket#244 - redirect() needs absolute URL (Qiang)
BUG: Ticket#245 - getIsSecureConnection() is not working correctly (Qiang)
+BUG: Ticket#260 - Wrong value of a configuration option in setUseTransparentSessionID (Qiang)
CHG: ensureChildControls() is now invoked in TControl::initRecursive (Qiang)
CHG: Postback enabled control will always disable default client-side browser action. (Qiang)
CHG: CSS and JS files in a theme are now included in page in alphabetic order (Qiang)
@@ -32,6 +33,7 @@ ENH: Added TPageService.BasePageClass property (Qiang) ENH: Added TDataGrid.EmptyTemplate property (Qiang)
ENH: Added paging feature to all TDataBoundControl-derived controls (Qiang)
NEW: Added TPager (Qiang)
+NEW: Added Dreamweaver taglib extension (Stanislav, Qiang)
Version 3.0.1 June 4, 2006
==========================
@@ -132,6 +132,8 @@ <fileset refid="misc"/> </copy> + <copy file="buildscripts/classtree/DWExtensionReadme.txt" tofile="${build.src.dir}/editors/Dreamweaver/readme.txt" /> + <echo>Changing file permissions...</echo> <chmod mode="0777"> <fileset refid="writables" /> @@ -221,7 +223,30 @@ <fileset dir="${build.doc.dir}/manual/HTMLSmartyConverter"> <include name="**/**" /> </fileset> - </move> + </move> + + <echo> + + + Distribution Not Completed Yet!!! + +The following steps need to be manually performed in order to complete +the PRADO distribution: + +1. Package DreamWeaver extension by running DW extension manager with + buildscripts/classtree/PRADO.mxi and saving the generated file as + "${build.src.dir}/editors/Dreamweaver/PRADO.mxp" + +2. If building on Linux, the CHM doc file needs to be generated by compiling + "${build.doc.dir}/manual/CHMdefaultConverter/phpdoc.hhp" + and saving the generated file as + "${build.src.dir}/docs/manual.chm" + +3. Use winzip (on Windows) and gzip (on Linux) to generate the compressed + release files of the direcotry + "${build.src.dir}". + + </echo> </target> <target name="js" description="Compiling Javascript distribution files"> diff --git a/buildscripts/classtree/DWExtension.php b/buildscripts/classtree/DWExtension.php new file mode 100644 index 00000000..f85f100d --- /dev/null +++ b/buildscripts/classtree/DWExtension.php @@ -0,0 +1,255 @@ +<?php
+
+/**
+ * PradoVTMDocument class
+ *
+ * @author Stanislav Yordanov <stanprog[at]stanprog.com>
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ */
+class PradoVTMDocument
+{
+ private $_document;
+ private $_attributes;
+
+ public function __construct($controlName)
+ {
+ $this->_document = new DOMDocument('1.0', 'utf-8');
+ $this->prepareDocument($controlName);
+ }
+
+ protected function prepareDocument($controlName)
+ {
+ $this->_document->formatOutput = true;
+
+ //--- add <tag>
+ $tag = $this->_document->createElement('tag');
+ $tag->setAttribute('name',$controlName);
+ $tag->setAttribute('casesensitive','yes');
+ $this->_document->appendChild($tag);
+
+ //--- add <tagformat>
+ $tagFormat = $this->_document->createElement('tagformat');
+ $tagFormat->setAttribute('nlbeforetag','1');
+ $tagFormat->setAttribute('nlaftertag','1');
+ $tagFormat->setAttribute('indentcontents','yes');
+ $tag->appendChild($tagFormat);
+
+ //--- add <tagdialog file="Control.htm" />
+ //$tagDialog = $this->_document->createElement('tagdialog');
+ //$tagDialog->setAttribute('file',$controlName.'.htm');
+ //$tag->appendChild($tagDialog);
+
+ $this->_attributes = $this->_document->createElement('attributes');
+ $tag->appendChild($this->_attributes);
+ }
+
+ public function getDocument()
+ {
+ return $this->_document;
+ }
+
+ public function addAttribute($attribName, $attribType)
+ {
+ //--- add <attrib>
+ $attrib = $this->_document->createElement('attrib');
+ $attrib->setAttribute('name',$attribName);
+ if (is_array($attribType))
+ {
+ $attrib->setAttribute('type','Enumerated');
+ foreach ($attribType as $value)
+ {
+ $option = $this->_document->createElement('attriboption');
+ $option->setAttribute('value',$value);
+ $option->setAttribute('caption','');
+ $attrib->appendChild($option);
+ }
+ }
+ else if($attribType!=='')
+ {
+ $attrib->setAttribute('type',$attribType);
+ }
+ $attrib->setAttribute('casesensitive','yes');
+ $this->_attributes->appendChild($attrib);
+ }
+
+ public function addEvent($eventName)
+ {
+ //--- add <attrib>
+ $this->addAttribute($eventName,'');
+ //--- add <event>
+ $event = $this->_document->createElement('event');
+ $event->setAttribute('name',$eventName);
+ $this->_attributes->appendChild($event);
+ }
+
+ public function getXML()
+ {
+ return $this->_document->saveXML();
+ }
+}
+
+/**
+ * PradoMXIDocument class
+ *
+ * @author Stanislav Yordanov <stanprog@stanprog.com>
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ */
+class PradoMXIDocument
+{
+ private $_tagLibraryElement;
+ private $_filesElement;
+ private $_document;
+
+ public function __construct($version)
+ {
+ $this->_document = new DOMDocument('1.0', 'utf-8');
+ $this->prepareDocument($version);
+ }
+
+ protected function prepareDocument($version)
+ {
+ $this->_document->formatOutput = true;
+ //--- add root element
+ $rootElement = $this->_document->createElement('macromedia-extension');
+ $rootElement->setAttribute('name','PRADO Taglib');
+ $rootElement->setAttribute('version',$version);
+ $rootElement->setAttribute('type','Suite');
+ $rootElement->setAttribute('requires-restart','true');
+ $this->_document->appendChild($rootElement);
+ //--- add <author>
+ $element = $this->_document->createElement('author');
+ $element->setAttribute('name','Stanislav Yordanov, Qiang Xue');
+ $rootElement->appendChild($element);
+ $time = date('F j, Y, h:i:s a',time());
+ //--- add <description>
+ $description = <<<EOD
+PRADO $version Tag Library
+Authors: Stanislav Yordanov <stanprog@stanprog.com> and Qiang Xue <qiang.xue@gmail.com>
+Time: $time
+Requirement: Macromedia Dreamweaver MX/MX 2004/8.0 or above
+Description: This suite adds PRADO tag library. The tag library contains PRADO component
+tags, properties and events that are commonly used on PRADO templates.
+EOD;
+ $element = $this->_document->createElement('description');
+ $element->appendChild($this->_document->createCDATASection($description));
+ $rootElement->appendChild($element);
+ //--- add <products>
+ $productsElement = $this->_document->createElement('products');
+ $rootElement->appendChild($productsElement);
+ //--- add <product>
+ $product = $this->_document->createElement('product');
+ $product->setAttribute('name','Dreamweaver');
+ $product->setAttribute('version','6');
+ $product->setAttribute('primary','false');
+ $productsElement->appendChild($product);
+ //--- add <ui-access>
+ $element = $this->_document->createElement('ui-access');
+ $element->appendChild($this->_document->createCDATASection("PRADO"));
+ $rootElement->appendChild($element);
+ //--- add <files>
+ $this->_filesElement = $this->_document->createElement('files');
+ $rootElement->appendChild($this->_filesElement);
+ //--- add <configuration-changes>
+ $configChangeElement = $this->_document->createElement('configuration-changes');
+ $rootElement->appendChild($configChangeElement);
+ //--- add <taglibrary-changes>
+ $tagLibChangeElement = $this->_document->createElement('taglibrary-changes');
+ $configChangeElement->appendChild($tagLibChangeElement);
+ //--- add <taglibrary-insert>
+ $tagLibInsertElement = $this->_document->createElement('taglibrary-insert');
+ $tagLibChangeElement->appendChild($tagLibInsertElement);
+ //--- add <taglibrary>
+ $this->_tagLibraryElement = $element = $this->_document->createElement('taglibrary');
+ $element->setAttribute('doctypes','HTML,DWTemplate');
+ $element->setAttribute('id','DWTagLibrary_PRADO_tags');
+ $element->setAttribute('name','PRADO tags');
+ $element->setAttribute('prefix','<com:');
+ $element->setAttribute('tagchooser','PRADO/TagChooser.xml');
+ $tagLibInsertElement->appendChild($element);
+
+ $element = $this->_document->createElement('file');
+ $element->setAttribute('name','Configuration/TagLibraries/PRADO/TagChooser.xml');
+ $element->setAttribute('destination','$dreamweaver/Configuration/TagLibraries/PRADO/TagChooser.xml');
+ $this->_filesElement->appendChild($element);
+ }
+
+ public function addTag($tagName)
+ {
+ $element = $this->_document->createElement('file');
+ $element->setAttribute('name','Configuration/TagLibraries/PRADO/'.$tagName.'.vtm');
+ $element->setAttribute('destination','$dreamweaver/Configuration/TagLibraries/PRADO/'.$tagName.'.vtm');
+ $this->_filesElement->appendChild($element);
+
+ $element = $this->_document->createElement('tagref');
+ $element->setAttribute('file','PRADO/'.$tagName.'.vtm');
+ $element->setAttribute('name',$tagName);
+ $this->_tagLibraryElement->appendChild($element);
+ }
+
+ public function getDocument()
+ {
+ return $this->_document;
+ }
+
+ public function getXML()
+ {
+ return $this->_document->saveXML();
+ }
+}
+
+/**
+ * PradoTagChooser class
+ *
+ * @author Stanislav Yordanov <stanprog[at]stanprog.com>
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ */
+class PradoTagChooser
+{
+ private $_document;
+ private $_tclibrary;
+ private $_category;
+
+ public function __construct()
+ {
+ $this->_document = new DOMDocument('1.0', 'utf-8');
+ $this->prepareDocument();
+ }
+
+ protected function prepareDocument()
+ {
+ $this->_document->standalone = true;
+ $this->_document->formatOutput = true;
+ $tclibrary = $this->_document->createElement('tclibrary');
+ $tclibrary->setAttribute('name','PRADO tags');
+ $tclibrary->setAttribute('desc','A collection of all PRADO tags.');
+ $tclibrary->setAttribute('reference','PRADO');
+ $this->_document->appendChild($tclibrary);
+
+ $this->_category = $this->_document->createElement('category');
+ $this->_category->setAttribute('name','General');
+ $this->_category->setAttribute('icon','Configuration/TagLibraries/Icons/Elements.gif');
+ $tclibrary->appendChild($this->_category);
+ }
+
+ public function addElement($elementName)
+ {
+ $element = $this->_document->createElement('element');
+ $element->setAttribute('name','com:'.$elementName);
+ $element->setAttribute('value','<com:'.$elementName.'>');
+ $element->setAttribute('reference','PRADO,COM:'.strtoupper($elementName));
+ $this->_category->appendChild($element);
+ }
+
+ public function getXML()
+ {
+ $this->_document->normalize();
+ /*
+ $resultXML = $this->_document->saveXML();
+ $resultXML = str_replace('>','>',$resultXML);
+ $resultXML = str_replace('<','<',$resultXML);
+ return $resultXML;
+ */
+ return $this->_document->saveXML();
+ }
+}
+?>
\ No newline at end of file diff --git a/buildscripts/classtree/DWExtensionReadme.txt b/buildscripts/classtree/DWExtensionReadme.txt new file mode 100644 index 00000000..e273abd6 --- /dev/null +++ b/buildscripts/classtree/DWExtensionReadme.txt @@ -0,0 +1,22 @@ +This directory contains the Macromedia Dreamweaver Extension for PRADO.
+
+This PRADO extension contains a tag library that enables Dreamweaver to
+auto-complete PRADO component tags when you use it to edit PRADO templates.
+
+Before installation, make sure you have uninstalled any older versions
+of the PRADO extension.
+
+To install this extension, run Dreamweaver's extension manager program and
+select the file PRADO.mxp to install.
+
+After installation, restart Dreamweaver. Open a new HTML document and start typing
+in PRADO component tags. You will see as you are typing, a dropdown list may
+pop up which contains the available component names, properties and events.
+Some property types are also handled.
+
+This extension is tested with Dreamweaver 2004 MX. Please let me know if you find it
+working on other versions.
+
+Enjoy!
+
+Qiang
diff --git a/buildscripts/classtree/build.php b/buildscripts/classtree/build.php index bc95d1c8..d7f74828 100644 --- a/buildscripts/classtree/build.php +++ b/buildscripts/classtree/build.php @@ -1,7 +1,10 @@ <?php
-$rootPath=dirname(__FILE__).'/../../framework';
-require_once($rootPath.'/prado.php');
+$basePath=dirname(__FILE__);
+$frameworkPath=realpath($basePath.'/../../framework');
+require_once($frameworkPath.'/prado.php');
+require_once($basePath.'/DWExtension.php');
+
$exclusions=array(
'prado.php',
'pradolite.php',
@@ -11,25 +14,26 @@ $exclusions=array( '/I18N/core',
'/3rdParty',
);
-$a=new ClassTreeBuilder($rootPath,$exclusions);
+$a=new ClassTreeBuilder($frameworkPath,$exclusions);
$a->buildTree();
-$a->saveToFile('classes.data');
+$a->saveToFile($basePath.'/classes.data');
+$a->saveAsDWExtension($basePath);
class ClassTreeBuilder
{
const REGEX_RULES='/^\s*(abstract\s+)?class\s+(\w+)(\s+extends\s+(\w+)\s*|\s*)/msS';
- private $_basePath;
+ private $_frameworkPath;
private $_exclusions;
private $_classes=array();
- public function __construct($basePath,$exclusions)
+ public function __construct($frameworkPath,$exclusions)
{
- $this->_basePath=realpath($basePath);
+ $this->_frameworkPath=realpath($frameworkPath);
$this->_exclusions=array();
foreach($exclusions as $exclusion)
{
if($exclusion[0]==='/')
- $this->_exclusions[realpath($basePath.'/'.$exclusion)]=true;
+ $this->_exclusions[realpath($frameworkPath.'/'.$exclusion)]=true;
else
$this->_exclusions[$exclusion]=true;
}
@@ -37,7 +41,7 @@ class ClassTreeBuilder public function buildTree()
{
- $sourceFiles=$this->getSourceFiles($this->_basePath);
+ $sourceFiles=$this->getSourceFiles($this->_frameworkPath);
foreach($sourceFiles as $sourceFile)
$this->parseFile($sourceFile);
ksort($this->_classes);
@@ -73,7 +77,7 @@ class ClassTreeBuilder protected function parseFile($sourceFile)
{
include_once($sourceFile);
- $classFile=strtr(substr($sourceFile,strlen($this->_basePath)),'\\','/');
+ $classFile=strtr(substr($sourceFile,strlen($this->_frameworkPath)),'\\','/');
echo "Parsing $classFile...\n";
$content=file_get_contents($sourceFile);
if(preg_match('/@package\s+([\w\.]+)\s*/msS',$content,$matches)>0)
@@ -175,8 +179,75 @@ class ClassTreeBuilder return $files;
}
- public function saveAsTagLib($fileName)
+ public function saveAsDWExtension($basePath)
+ {
+ $tagPath=$basePath.'/Configuration/TagLibraries/PRADO';
+
+ // prepare the directory to save tag lib
+ @mkdir($basePath.'/Configuration');
+ @mkdir($basePath.'/Configuration/TagLibraries');
+ @mkdir($basePath.'/Configuration/TagLibraries/PRADO');
+
+ $docMXI = new PradoMXIDocument(Prado::getVersion());
+ $tagChooser = new PradoTagChooser;
+
+ $controlClass = new ReflectionClass('TControl');
+
+ foreach($this->_classes as $className=>$classInfo)
+ {
+ $class = new ReflectionClass($className);
+ if($class->isInstantiable() && ($className==='TControl' || $class->isSubclassOf($controlClass)))
+ {
+ $docMXI->addTag($className);
+ $tagChooser->addElement($className);
+ $docVTM = new PradoVTMDocument($className);
+ foreach($classInfo['Properties'] as $name=>$property)
+ {
+ $type=$property['type'];
+ if(isset($this->_classes[$type]) && ($type==='TFont' || strrpos($type,'Style')===strlen($type)-5 && $type!=='TStyle'))
+ $this->processObjectType($type,$this->_classes[$type],$name,$docVTM);
+ if($property['readonly'] || $property['protected'])
+ continue;
+ if(($type=$this->checkType($className,$name,$property['type']))!=='')
+ $docVTM->addAttribute($name,$type);
+ }
+ foreach($classInfo['Events'] as $name=>$event)
+ {
+ $docVTM->addEvent($name);
+ }
+ file_put_contents($tagPath.'/'.$className.'.vtm',$docVTM->getXML());
+ }
+ }
+
+ file_put_contents($basePath.'/PRADO.mxi',$docMXI->getXML());
+ file_put_contents($tagPath.'/TagChooser.xml',$tagChooser->getXML());
+
+ }
+
+ private function processObjectType($objectType,$objectInfo,$prefix,$doc)
+ {
+ foreach($objectInfo['Properties'] as $name=>$property)
+ {
+ if($property['type']==='TFont')
+ $this->processObjectType('TFont',$this->_classes['TFont'],$prefix.'.'.$name,$doc);
+ if($property['readonly'] || $property['protected'])
+ continue;
+ if(($type=$this->checkType($objectType,$name,$property['type']))!=='')
+ $doc->addAttribute($prefix.'.'.$name,$type);
+ }
+ }
+
+ private function checkType($className,$propertyName,$type)
{
+ if(strrpos($propertyName,'Color')===strlen($propertyName)-5)
+ return 'color';
+ if($propertyName==='Style')
+ return 'style';
+ if($type==='boolean')
+ return array('true','false');
+ if($type==='string' || $type==='integer' || $type==='ITemplate')
+ return 'text';
+ return '';
}
}
diff --git a/buildscripts/texbuilder/pages.php b/buildscripts/texbuilder/pages.php index ec6e0155..f49d15fd 100644 --- a/buildscripts/texbuilder/pages.php +++ b/buildscripts/texbuilder/pages.php @@ -50,6 +50,7 @@ $pages['Control Reference : Standard Controls'] = array( 'Controls/LinkButton.page',
'Controls/Literal.page',
'Controls/MultiView.page',
+ 'Controls/Pager.page',
'Controls/Panel.page',
'Controls/PlaceHolder.page',
'Controls/RadioButton.page',
diff --git a/framework/Caching/TMemCache.php b/framework/Caching/TMemCache.php index dd229312..bd1ae189 100644 --- a/framework/Caching/TMemCache.php +++ b/framework/Caching/TMemCache.php @@ -53,7 +53,7 @@ *
* TMemCache may be configured in application configuration file as follows
* <code>
- * <module id="cache" type="System.Caching.TMemCache" Host="localhost" Port=11211 />
+ * <module id="cache" class="System.Caching.TMemCache" Host="localhost" Port="11211" />
* </code>
* where {@link getHost Host} and {@link getPort Port} are configurable properties
* of TMemCache.
diff --git a/framework/Caching/TSqliteCache.php b/framework/Caching/TSqliteCache.php index dc4bf13f..b94b39fe 100644 --- a/framework/Caching/TSqliteCache.php +++ b/framework/Caching/TSqliteCache.php @@ -55,7 +55,7 @@ *
* TSqliteCache may be configured in application configuration file as follows
* <code>
- * <module id="cache" type="System.Caching.TSqliteCache" DbFile="Application.Data.site" />
+ * <module id="cache" class="System.Caching.TSqliteCache" DbFile="Application.Data.site" />
* </code>
* where {@link getDbFile DbFile} is a property specifying the location of the
* SQLite DB file (in the namespace format).
diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php index 25f421e3..e18de7ab 100644 --- a/framework/Exceptions/TErrorHandler.php +++ b/framework/Exceptions/TErrorHandler.php @@ -42,7 +42,7 @@ * by the application object to handle errors.
*
* TErrorHandler may be configured in application configuration file as follows
- * <module id="error" type="TErrorHandler" ErrorTemplatePath="System.Exceptions" />
+ * <module id="error" class="TErrorHandler" ErrorTemplatePath="System.Exceptions" />
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Revision: $ $Date: $
diff --git a/framework/Exceptions/messages.txt b/framework/Exceptions/messages.txt index 38541fed..22b28a42 100644 --- a/framework/Exceptions/messages.txt +++ b/framework/Exceptions/messages.txt @@ -144,7 +144,9 @@ authmanager_usermanager_invalid = TAuthManager.UserManager '{0}' does not refe authmanager_usermanager_unchangeable = TAuthManager.UserManager cannot be modified after the module is initialized.
authmanager_session_required = TAuthManager requires a session application module.
-thememanager_basepath_invalid = TThemeManager.BasePath '{0}' is not a valid directory.
+thememanager_service_unavailable = TThemeManager requires TPageService to be available. This error often occurs when you configure TThemeManager outside of the page service configuration.
+thememanager_basepath_invalid = TThemeManager.BasePath '{0}' is not a valid path alias. Make sure you have defined this alias in configuration and it points to a valid directory.
+thememanager_basepath_invalid2 = TThemeManager.BasePath '{0}' is not a valid directory.
thememanager_basepath_unchangeable = TThemeManager.BasePath cannot be modified after the module is initialized.
theme_baseurl_required = TThemeManager.BasePath is required. By default, a directory named 'themes' under the directory containing the application entry script is assumed.
diff --git a/framework/Web/THttpSession.php b/framework/Web/THttpSession.php index f95cb72d..4439cf57 100644 --- a/framework/Web/THttpSession.php +++ b/framework/Web/THttpSession.php @@ -376,7 +376,7 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar if($this->_started)
throw new TInvalidOperationException('httpsession_transid_unchangeable');
else
- ini_set('session.use_only_cookies',TPropertyValue::ensureBoolean($value)?'1':'0');
+ ini_set('session.use_trans_sid',TPropertyValue::ensureBoolean($value)?'1':'0');
}
/**
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index caa1dcbc..c13b5a9d 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -680,7 +680,7 @@ class TTemplate extends TApplicationComponent implements ITemplate if($matchStart>$textStart)
{
$value=substr($input,$textStart,$matchStart-$textStart);
- if(strrpos($prop,'template')===strlen($prop)-8)
+ if(substr($prop,-8,8)==='template')
$value=$this->parseTemplateProperty($value,$textStart);
else
$value=$this->parseAttribute($value);
@@ -701,7 +701,7 @@ class TTemplate extends TApplicationComponent implements ITemplate }
else if(strpos($str,'<!--')===0) // comments
{
- if(strrpos($str,'--!>')===strlen($str)-4) // template comments
+ if(substr($str,-4,4)==='--!>') // template comments
{
if($expectPropEnd)
throw new TConfigurationException('template_comments_forbidden');
@@ -799,7 +799,7 @@ class TTemplate extends TApplicationComponent implements ITemplate if(isset($attributes[$name]))
throw new TConfigurationException('template_property_duplicated',$name);
$value=$match[2][0];
- if(strrpos($name,'template')===strlen($name)-8)
+ if(substr($name,-8,8)==='template')
{
if($value[0]==='\'' || $value[0]==='"')
$attributes[$name]=$this->parseTemplateProperty(substr($value,1,strlen($value)-2),$match[2][1]+1);
diff --git a/framework/Web/UI/TThemeManager.php b/framework/Web/UI/TThemeManager.php index 66bfa8be..245f8049 100644 --- a/framework/Web/UI/TThemeManager.php +++ b/framework/Web/UI/TThemeManager.php @@ -10,6 +10,8 @@ * @package System.Web.UI
*/
+Prado::using('System.Web.Services.TPageService');
+
/**
* TThemeManager class
*
@@ -63,7 +65,11 @@ class TThemeManager extends TModule public function init($config)
{
$this->_initialized=true;
- $this->getService()->setThemeManager($this);
+ $service=$this->getService();
+ if($service instanceof TPageService)
+ $service->setThemeManager($this);
+ else
+ throw new TConfigurationException('thememanager_service_unavailable');
}
/**
@@ -105,7 +111,7 @@ class TThemeManager extends TModule {
$this->_basePath=dirname($this->getRequest()->getApplicationFilePath()).'/'.self::DEFAULT_BASEPATH;
if(($basePath=realpath($this->_basePath))===false || !is_dir($basePath))
- throw new TConfigurationException('thememanager_basepath_invalid',$this->_basePath);
+ throw new TConfigurationException('thememanager_basepath_invalid2',$this->_basePath);
$this->_basePath=$basePath;
}
return $this->_basePath;
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php index f811edaf..fead5344 100644 --- a/framework/Web/UI/WebControls/TDataGrid.php +++ b/framework/Web/UI/WebControls/TDataGrid.php @@ -954,9 +954,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer {
foreach($columns as $column)
$column->initialize();
- if($allowPaging)
- $this->_topPager=$this->createPager();
- $this->_header=$this->createItemInternal(-1,-1,self::IT_HEADER,true,null,$columns);
+
$selectedIndex=$this->getSelectedItemIndex();
$editIndex=$this->getEditItemIndex();
foreach($data as $key=>$row)
@@ -965,6 +963,12 @@ class TDataGrid extends TBaseDataList implements INamingContainer $keys->add($this->getDataFieldValue($row,$keyField));
else
$keys->add($key);
+ if($index===0)
+ {
+ if($allowPaging)
+ $this->_topPager=$this->createPager();
+ $this->_header=$this->createItemInternal(-1,-1,self::IT_HEADER,true,null,$columns);
+ }
if($index===$editIndex)
$itemType=self::IT_EDITITEM;
else if($index===$selectedIndex)
@@ -977,9 +981,12 @@ class TDataGrid extends TBaseDataList implements INamingContainer $index++;
$dsIndex++;
}
- $this->_footer=$this->createItemInternal(-1,-1,self::IT_FOOTER,true,null,$columns);
- if($allowPaging)
- $this->_bottomPager=$this->createPager();
+ if($index>0)
+ {
+ $this->_footer=$this->createItemInternal(-1,-1,self::IT_FOOTER,true,null,$columns);
+ if($allowPaging)
+ $this->_bottomPager=$this->createPager();
+ }
}
$this->setViewState('ItemCount',$index,0);
if(!$dsIndex && $this->_emptyTemplate!==null)
@@ -59,6 +59,13 @@ The installation is done! You will see the following subdirectories, <li><a href="demos/peronsal/index.php">Personal Website</a> (incomplete)</li>
</ul>
+<h2>Editor Support</h2>
+<p>
+A Macromedia Dreamweaver extension can be found under <b>editors/Dreamweaver</b>.
+This extension contains a tag library that enables Dreamweaver to auto-complete
+PRADO component tags when you use it to edit PRADO templates.
+</p>
+
<h2>Documentation</h2>
<ul>
<li><a href="docs/manual/index.html">API documentation</a></li>
@@ -98,6 +105,7 @@ The installation is done! You will see the following subdirectories, <h3>Special Credits To</h3>
<ul>
<li>Stever for providing an Apple G3 notebook for testing safari browser issues.</li>
+<li>Stanislav Yordanov - the script of generating Dreameweaver extension for PRADO</li>
<li>All PRADO users - great suggestions, feedback and support</li>
<li>ASP.NET 2.0 for its great inspiration and reference</li>
<li>All <a href="framework/3rdParty/readme.html">third-party work</a> used in PRADO</li>
@@ -105,47 +113,39 @@ The installation is done! You will see the following subdirectories, <h2>License</h2>
-<p>PRADO is free software released under the terms of the following BSD license.
+<p>
+The PRADO framework and the included demos are freeware. They are released under
+the terms of the following BSD License.
</p>
-<p>Copyright © 2004-2006, PradoSoft (http://www.pradosoft.com)<br/>
+<p>
+Copyright 2004-2006 by The PRADO Group (http://www.pradosoft.com)<br/>
All rights reserved.
</p>
<p>
-Redistribution and use in source and binary forms,
-with or without modification, are permitted provided
-that the following conditions are met:
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+</p>
<ul>
-<li>Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer. </li>
-
-<li>Redistributions in binary form must reproduce
- the above copyright notice, this list of conditions
- and the following disclaimer in the documentation
- and/or other materials provided with the distribution.</li>
-
-<li>Neither the name of the developer nor the names of
- its contributors may be used to endorse or promote
- products derived from this software without specific
- prior written permission. </li>
+<li>Redistributions of source code must retain the above copyright notice, this
+list of conditions and the following disclaimer. </li>
+<li>Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation and/or
+other materials provided with the distribution.</li>
+<li>Neither the name of the PRADO Group nor the names of its contributors may be
+used to endorse or promote products derived from this software without specific
+prior written permission.</li>
</ul>
-</p>
<p>
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
-AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
-THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
-THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.
</p>
</body>
</html>
|