From d38334fc8aac7b4488a6fa10fe6acc219665c3bd Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 19 Feb 2006 01:22:03 +0000 Subject: Updated architecture tutorial page for change of asset manager. --- .gitattributes | 2 - .../protected/pages/Fundamentals/Architecture.page | 2 +- .../protected/pages/Fundamentals/classtree.gif | Bin 19840 -> 18320 bytes .../protected/pages/Fundamentals/classtree.vsd | Bin 72192 -> 72704 bytes .../protected/pages/Fundamentals/objectdiagram.gif | Bin 8129 -> 7700 bytes .../protected/pages/Fundamentals/objectdiagram.vsd | Bin 156672 -> 159744 bytes framework/Web/Javascripts/TClientScript.php | 140 -------------------- .../Web/Javascripts/TJavascriptSerializer.php | 141 --------------------- 8 files changed, 1 insertion(+), 284 deletions(-) delete mode 100644 framework/Web/Javascripts/TClientScript.php delete mode 100644 framework/Web/Javascripts/TJavascriptSerializer.php diff --git a/.gitattributes b/.gitattributes index 5a91ab0c..0623b51b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -587,10 +587,8 @@ framework/Security/TUserManager.php -text framework/TApplication.php -text framework/TApplicationComponent.php -text framework/TComponent.php -text -framework/Web/Javascripts/TClientScript.php -text framework/Web/Javascripts/TJSON.php -text framework/Web/Javascripts/TJavaScript.php -text -framework/Web/Javascripts/TJavascriptSerializer.php -text framework/Web/Javascripts/colorpicker/background.png -text framework/Web/Javascripts/colorpicker/button.gif -text framework/Web/Javascripts/colorpicker/colorpicker.js -text diff --git a/demos/quickstart/protected/pages/Fundamentals/Architecture.page b/demos/quickstart/protected/pages/Fundamentals/Architecture.page index 8ccb20a0..d53b7ee1 100644 --- a/demos/quickstart/protected/pages/Fundamentals/Architecture.page +++ b/demos/quickstart/protected/pages/Fundamentals/Architecture.page @@ -2,7 +2,7 @@

Architecture

-PRADO is primarily a presentational framework, although it is not limited to be so. The framework focuses on making Web programming, which deals most of the time with user interactions, to be component-based and event-driven so that developers can be more productive. The following class tree depicts the skeleton classes provided by PRADO, +PRADO is primarily a presentational framework, although it is not limited to be so. The framework focuses on making Web programming, which deals most of the time with user interactions, to be component-based and event-driven so that developers can be more productive. The following class tree depicts some of the major classes provided by PRADO,

diff --git a/demos/quickstart/protected/pages/Fundamentals/classtree.gif b/demos/quickstart/protected/pages/Fundamentals/classtree.gif index 63e0194c..b1fbf0d6 100644 Binary files a/demos/quickstart/protected/pages/Fundamentals/classtree.gif and b/demos/quickstart/protected/pages/Fundamentals/classtree.gif differ diff --git a/demos/quickstart/protected/pages/Fundamentals/classtree.vsd b/demos/quickstart/protected/pages/Fundamentals/classtree.vsd index f2fa4391..c000d32f 100644 Binary files a/demos/quickstart/protected/pages/Fundamentals/classtree.vsd and b/demos/quickstart/protected/pages/Fundamentals/classtree.vsd differ diff --git a/demos/quickstart/protected/pages/Fundamentals/objectdiagram.gif b/demos/quickstart/protected/pages/Fundamentals/objectdiagram.gif index ac99faca..7910469c 100644 Binary files a/demos/quickstart/protected/pages/Fundamentals/objectdiagram.gif and b/demos/quickstart/protected/pages/Fundamentals/objectdiagram.gif differ diff --git a/demos/quickstart/protected/pages/Fundamentals/objectdiagram.vsd b/demos/quickstart/protected/pages/Fundamentals/objectdiagram.vsd index e536ec31..b2457220 100644 Binary files a/demos/quickstart/protected/pages/Fundamentals/objectdiagram.vsd and b/demos/quickstart/protected/pages/Fundamentals/objectdiagram.vsd differ diff --git a/framework/Web/Javascripts/TClientScript.php b/framework/Web/Javascripts/TClientScript.php deleted file mode 100644 index 5047959d..00000000 --- a/framework/Web/Javascripts/TClientScript.php +++ /dev/null @@ -1,140 +0,0 @@ -base basic javascript utilities, e.g. $() - * - dom DOM and Form functions, e.g. $F(inputID) to retrive form input values. - * - effects Effects such as fade, shake, move - * - controls Prado client-side components, e.g. Slider, AJAX components - * - validator Prado client-side validators. - * - ajax Prado AJAX library including Prototype's AJAX and JSON. - * - * Dependencies for each library are automatically resolved. - * - * Namespace: System.Web.UI - * - * @author Wei Zhuo - * @version $Revision: 1.1 $ $Date: 2005/11/06 23:02:33 $ - * @package System.Web.UI - */ -class TClientScript -{ - protected $_manager; - - /** - * Client-side javascript library dependencies - * @var array - */ - protected static $_dependencies = array( - 'prado' => array('prado'), - 'effects' => array('prado', 'effects'), - 'ajax' => array('prado', 'effects', 'ajax'), - 'validator' => array('prado', 'validator'), - 'logger' => array('prado', 'logger'), - 'datepicker' => array('prado', 'datepicker'), - 'rico' => array('prado', 'effects', 'ajax', 'rico'), - 'colorpicker' => array('prado', 'colorpicker') - ); - - public function __construct($manager) - { - $this->_manager = $manager; - } - - /** - * Resolve dependencies for the given library. - * @param array list of libraries to load. - * @return array list of libraries including its dependencies. - */ - public function getScripts($scripts) - { - $files = array(); - if(!is_array($scripts)) $scripts = array($scripts); - foreach($scripts as $script) - { - if(isset(self::$_dependencies[$script])) - $files = array_merge($files, self::$_dependencies[$script]); - $files[] = $script; - } - $files = array_unique($files); - return $files; - } - - - /** - * TODO: clean up - * - public function getPostBackEventReference($control,$parameter='',$options=null,$javascriptPrefix=true) - { - if(!$options || (!$options->getPerformValidation() && !$options->getTrackFocus() && $options->getClientSubmit() && $options->getActionUrl()=='')) - { - $this->registerPostBackScript(); - if(($form=$this->_page->getForm())!==null) - $formID=$form->getClientID(); - else - throw new TConfigurationException('clientscriptmanager_form_required'); - $postback=self::POSTBACK_FUNC.'(\''.$formID.'\',\''.$control->getUniqueID().'\',\''.THttpUtility::quoteJavaScriptString($parameter).'\')'; - if($options && $options->getAutoPostBack()) - $postback='setTimeout(\''.THttpUtility::quoteJavaScriptString($postback).'\',0)'; - return $javascriptPrefix?'javascript:'.$postback:$postback; - } - $opt=''; - $flag=false; - if($options->getPerformValidation()) - { - $flag=true; - $this->registerValidationScript(); - $opt.=',true,'; - } - else - $opt.=',false,'; - if($options->getValidationGroup()!=='') - { - $flag=true; - $opt.='"'.$options->getValidationGroup().'",'; - } - else - $opt.='\'\','; - if($options->getActionUrl()!=='') - { - $flag=true; - $this->_page->setCrossPagePostBack(true); - $opt.='"'.$options->getActionUrl().'",'; - } - else - $opt.='null,'; - if($options->getTrackFocus()) - { - $flag=true; - $this->registerFocusScript(); - $opt.='true,'; - } - else - $opt.='false,'; - if($options->getClientSubmit()) - { - $flag=true; - $opt.='true'; - } - else - $opt.='false'; - if(!$flag) - return ''; - $this->registerPostBackScript(); - if(($form=$this->_page->getForm())!==null) - $formID=$form->getClientID(); - else - throw new TConfigurationException('clientscriptmanager_form_required'); - $postback=self::POSTBACK_FUNC.'(\''.$formID.'\',\''.$control->getUniqueID().'\',\''.THttpUtility::quoteJavaScriptString($parameter).'\''.$opt.')'; - if($options && $options->getAutoPostBack()) - $postback='setTimeout(\''.THttpUtility::quoteJavaScriptString($postback).'\',0)'; - return $javascriptPrefix?'javascript:'.$postback:$postback; - }*/ - -} - -?> \ No newline at end of file diff --git a/framework/Web/Javascripts/TJavascriptSerializer.php b/framework/Web/Javascripts/TJavascriptSerializer.php deleted file mode 100644 index 65567762..00000000 --- a/framework/Web/Javascripts/TJavascriptSerializer.php +++ /dev/null @@ -1,141 +0,0 @@ - - * $options['onLoading'] = "doit"; - * $options['onComplete'] = "more"; - * $js = new TJavascriptSerializer($options); - * echo $js->toMap(); - * //expects the following javascript code - * // {'onLoading':'doit','onComplete':'more'} - * - * - * For higher complexity data structures use TJSON to serialize and unserialize. - * - * Namespace: System.Web.UI - * - * @author Wei Zhuo - * @version $Revision: 1.3 $ $Date: 2005/11/10 23:43:26 $ - * @package System.Web.UI - */ -class TJavascriptSerializer -{ - protected $data; - - /** - * Serialize php data type into equivalent javascript type. - * @param mixed data to seralize - */ - public function __construct($data) - { - $this->data = $data; - } - - /** - * Converts data to javascript data string - * @return string javascript equivalent - */ - public function toJavascript($strict=false,$toMap=true) - { - $type = 'to_'.gettype($this->data); - return $this->$type($strict,$toMap); - } - - /** - * Coverts PHP arrays (only the array values) into javascript array. - * @param boolean if true empty string and empty array will be converted - * @return string javascript array as string. - */ - public function toList($strict=false) - { - return $this->to_array($strict); - } - - /** - * Coverts PHP arrays (both key and value) into javascript objects. - * @param boolean if true empty string and empty array will be converted - * @return string javascript object as string. - */ - public function toMap($strict=false) - { - return $this->to_array($strict, true); - } - - protected function to_array($strict=false,$toMap=false) - { - $results = array(); - foreach($this->data as $k => $v) - { - if($strict || (!$strict && $v !== '' && $v !== array())) - { - $serializer = new TJavascriptSerializer($v); - $result = $serializer->toJavascript($strict,$toMap); - $results[] = $toMap ? "'{$k}':$result" : $result; - } - } - $brackets = $toMap ? array('{','}') : array('[',']'); - return $brackets[0].implode(',', $results).$brackets[1]; - } - - protected function to_object($strict=false,$toMap=false) - { - if($this->data instanceof TComponent) - return $this->to_component($strict=false,$toMap=false); - - $serializer = new TJavascriptSerializer(get_object_vars($this->data)); - return $serializer->toMap($strict,$toMap); - } - - protected function to_component($strict=false,$toMap=false) - { - throw new TException("component object too complex to serialize"); - } - - protected function to_boolean() - { - return $this->data ? 'true' : 'false'; - } - - protected function to_integer() - { - return "{$this->data}"; - } - - protected function to_double() - { - if($this->data === -INF) - return 'Number.NEGATIVE_INFINITY'; - if($this->data === INF) - return 'Number.POSITIVE_INFINITY'; - return "{$this->data}"; - } - - /** - * Escapes string to javascript strings. If data to convert is string - * and is bracketed with {} or [], it is assumed that the data - * is already a javascript object or array and no further coversion is done. - */ - protected function to_string() - { - //ignore strings surrounded with {} or [], assume they are list or map - if(strlen($this->data)>1) - { - $first = $this->data[0]; $last = $this->data[strlen($this->data)-1]; - if($first == '[' && $last == ']' || - ($first == '{' && $last == '}')) - return $this->data; - } - return "'".preg_replace("/\r\n/", '\n', addslashes($this->data))."'"; - } - - protected function to_null() - { - return 'null'; - } -} - -?> \ No newline at end of file -- cgit v1.2.3