diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2014-02-02 21:39:36 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2014-02-02 21:39:36 +0100 |
commit | 4984215c105d8b4618373340d524e08f53e67f14 (patch) | |
tree | b1eb6aebc21512410e704a004412f7398de3f437 /framework/pradolite.php | |
parent | 98e2ef4e124bdf1e33c676e516a8337d587d9d9e (diff) |
Rebuild pradolite.php
Diffstat (limited to 'framework/pradolite.php')
-rw-r--r-- | framework/pradolite.php | 81 |
1 files changed, 37 insertions, 44 deletions
diff --git a/framework/pradolite.php b/framework/pradolite.php index dfe5e1d2..fcf73364 100644 --- a/framework/pradolite.php +++ b/framework/pradolite.php @@ -1,7 +1,7 @@ <?php /** * File Name: pradolite.php - * Last Update: 2013/11/26 10:04:34 + * Last Update: 2014/02/02 21:38:53 * Generated By: buildscripts/phpbuilder/build.php * * This file is used in lieu of prado.php to boost PRADO application performance. @@ -81,14 +81,6 @@ class PradoBase { return PRADO_DIR; } - public static function serialize($data) - { - return serialize($data); - } - public static function unserialize($str) - { - return unserialize($str); - } public static function createComponent($type) { if(!isset(self::$classExists[$type])) @@ -2799,6 +2791,13 @@ class TJavaScript else return ''; } + public static function renderScriptBlocksCallback($scripts) + { + if(count($scripts)) + return implode("\n",$scripts)."\n"; + else + return ''; + } public static function renderScriptBlock($script) { return "<script type=\"text/javascript\">\n/*<![CDATA[*/\n{$script}\n/*]]>*/\n</script>\n"; @@ -4524,7 +4523,7 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable const IS_DISABLE_THEMING=0x10; const IS_CHILD_CREATED=0x20; const IS_CREATING_CHILD=0x40; - const RF_CONTROLS=0; const RF_CHILD_STATE=1; const RF_NAMED_CONTROLS=2; const RF_NAMED_CONTROLS_ID=3; const RF_SKIN_ID=4; const RF_DATA_BINDINGS=5; const RF_EVENTS=6; const RF_CONTROLSTATE=7; const RF_NAMED_OBJECTS=8; const RF_ADAPTER=9; const RF_AUTO_BINDINGS=10; + const RF_CONTROLS=0; const RF_CHILD_STATE=1; const RF_NAMED_CONTROLS=2; const RF_NAMED_CONTROLS_ID=3; const RF_SKIN_ID=4; const RF_DATA_BINDINGS=5; const RF_EVENTS=6; const RF_CONTROLSTATE=7; const RF_NAMED_OBJECTS=8; const RF_ADAPTER=9; const RF_AUTO_BINDINGS=10; private $_id=''; private $_uid; private $_parent; @@ -5191,15 +5190,9 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable $control->evaluateDynamicContent(); } } - $this->addToPostDataLoader(); } $this->_stage=self::CS_PRERENDERED; } - protected function addToPostDataLoader() - { - if($this instanceof IPostBackDataHandler) - $this->getPage()->registerPostDataLoader($this); - } protected function unloadRecursive() { if(!($this->_flags & self::IS_ID_SET)) @@ -7050,8 +7043,6 @@ class TClientScriptManager extends TApplicationComponent $optionString=TJavaScript::encode($options); $code="new {$class}({$optionString});"; $this->_endScripts[sprintf('%08X', crc32($code))]=$code; - $this->_hiddenFields[TPage::FIELD_POSTBACK_TARGET]=''; - $this->_hiddenFields[TPage::FIELD_POSTBACK_PARAMETER]=''; $this->registerPradoScriptInternal('prado'); $params=func_get_args(); $this->_page->registerCachingAction('Page.ClientScript','registerPostBackControl',$params); @@ -7069,7 +7060,6 @@ class TClientScriptManager extends TApplicationComponent $options = TJavaScript::encode($this->getDefaultButtonOptions($panelID, $buttonID)); $code = "new Prado.WebUI.DefaultButton($options);"; $this->_endScripts['prado:'.$panelID]=$code; - $this->_hiddenFields[TPage::FIELD_POSTBACK_TARGET]=''; $this->registerPradoScriptInternal('prado'); $params=array($panelID,$buttonID); $this->_page->registerCachingAction('Page.ClientScript','registerDefaultButton',$params); @@ -7085,11 +7075,10 @@ class TClientScriptManager extends TApplicationComponent } public function registerFocusControl($target) { - $this->registerPradoScriptInternal('effects'); + $this->registerPradoScriptInternal('jquery'); if($target instanceof TControl) $target=$target->getClientID(); - $id = TJavaScript::quoteString($target); - $this->_endScripts['prado:focus'] = 'new Effect.ScrollTo('.$id.'); Prado.Element.focus('.$id.');'; + $this->_endScripts['prado:focus'] = 'new Prado.Element.scrollTo(\''.$target.'\'); jQuery(\'#'.$target.'\').focus();'; $params=func_get_args(); $this->_page->registerCachingAction('Page.ClientScript','registerFocusControl',$params); } @@ -7271,6 +7260,14 @@ class TClientScriptManager extends TApplicationComponent { $writer->write(TJavaScript::renderScriptBlocks($this->_endScripts)); } + public function renderBeginScriptsCallback($writer) + { + $writer->write(TJavaScript::renderScriptBlocksCallback($this->_beginScripts)); + } + public function renderEndScriptsCallback($writer) + { + $writer->write(TJavaScript::renderScriptBlocksCallback($this->_endScripts)); + } public function renderHiddenFieldsBegin($writer) { $this->renderHiddenFieldsInt($writer,true); @@ -7281,8 +7278,11 @@ class TClientScriptManager extends TApplicationComponent } public function flushScriptFiles($writer, $control=null) { - $this->_page->ensureRenderInForm($control); - $this->renderAllPendingScriptFiles($writer); + if(!$this->_page->getIsCallback()) + { + $this->_page->ensureRenderInForm($control); + $this->renderAllPendingScriptFiles($writer); + } } protected function renderHiddenFieldsInt($writer, $initial) { @@ -7389,7 +7389,6 @@ class TPage extends TTemplateControl private $_statePersister; private $_cachingStack; private $_clientState=''; - protected $_postDataLoaders=array(); protected $_isLoadingPostData=false; private $_enableJavaScript=true; private $_writer; @@ -7465,6 +7464,9 @@ class TPage extends TTemplateControl { Prado::using('System.Web.UI.ActiveControls.TActivePageAdapter'); $this->setAdapter(new TActivePageAdapter($this)); + $callbackEventParameter = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER); + if(strlen($callbackEventParameter) > 0) + $this->_postData[TPage::FIELD_CALLBACK_PARAMETER]=TJavaScript::jsonDecode((string)$callbackEventParameter); if (($g=$this->getApplication()->getGlobalization(false))!==null && strtoupper($enc=$g->getCharset())!='UTF-8') foreach ($this->_postData as $k=>$v) @@ -7515,15 +7517,6 @@ class TPage extends TTemplateControl { $this->getAdapter()->setCallbackEventParameter($value); } - public function registerPostDataLoader($control) - { - $id=is_string($control)?$control:$control->getUniqueID(); - $this->_postDataLoaders[$id] = true; - } - public function getPostDataLoaders() - { - return array_keys($this->_postDataLoaders); - } public function getForm() { return $this->_form; @@ -7721,7 +7714,6 @@ class TPage extends TTemplateControl { $id=is_string($control)?$control:$control->getUniqueID(); $this->_controlsRegisteredForPostData[$id]=true; - $this->registerPostDataLoader($id); $params=func_get_args(); foreach($this->getCachingStack() as $item) $item->registerAction('Page','registerRequiresPostData',array($id)); @@ -7978,9 +7970,9 @@ class TPageStateFormatter { $sm=$page->getApplication()->getSecurityManager(); if($page->getEnableStateValidation()) - $str=$sm->hashData(Prado::serialize($data)); + $str=$sm->hashData(serialize($data)); else - $str=Prado::serialize($data); + $str=serialize($data); if($page->getEnableStateCompression() && extension_loaded('zlib')) $str=gzcompress($str); if($page->getEnableStateEncryption()) @@ -8002,10 +7994,10 @@ class TPageStateFormatter if($page->getEnableStateValidation()) { if(($str=$sm->validateData($str))!==false) - return Prado::unserialize($str); + return unserialize($str); } else - return Prado::unserialize($str); + return unserialize($str); } return null; } @@ -10674,10 +10666,10 @@ class TApplication extends TComponent $config=new TApplicationConfiguration; $config->loadFromFile($this->_configFile); if($this->_cacheFile!==null) - file_put_contents($this->_cacheFile,Prado::serialize($config),LOCK_EX); + file_put_contents($this->_cacheFile,serialize($config),LOCK_EX); } else - $config=Prado::unserialize(file_get_contents($this->_cacheFile)); + $config=unserialize(file_get_contents($this->_cacheFile)); $this->applyConfiguration($config,false); } if(($serviceID=$this->getRequest()->resolveRequest(array_keys($this->_services)))===null) @@ -11118,18 +11110,18 @@ class TApplicationStatePersister extends TModule implements IStatePersister public function load() { if(($cache=$this->getApplication()->getCache())!==null && ($value=$cache->get(self::CACHE_NAME))!==false) - return Prado::unserialize($value); + return unserialize($value); else { if(($content=@file_get_contents($this->getStateFilePath()))!==false) - return Prado::unserialize($content); + return unserialize($content); else return null; } } public function save($state) { - $content=Prado::serialize($state); + $content=serialize($state); $saveFile=true; if(($cache=$this->getApplication()->getCache())!==null) { @@ -11152,3 +11144,4 @@ class TShellApplication extends TApplication $this->initApplication(); } } +?>
\ No newline at end of file |