Permalink
Browse files

Added onBeforeRender Trigger

Added onAfterCacheRender Trigger
Added parse method to JDocument and JDocumentHTML
Moved all "system" triggers inside of JApplication/children

git-svn-id: http://joomlacode.org/svn/joomla/development/trunk@11435 6f6e1ebd-4c2b-0410-823f-f34bde69bce9
  • Loading branch information...
1 parent 5acb915 commit c563a6407df8b87439c58a7887d09b49b947b376 @ircmaxell ircmaxell committed Jan 24, 2009
@@ -79,7 +79,7 @@ function initialise($options = array())
*/
function route()
{
-
+ parent::route();
}
/**
@@ -138,6 +138,7 @@ function dispatch($component = NULL)
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
+ $this->triggerEvent('onAfterDispatch');
}
/**
@@ -162,8 +163,11 @@ function render()
);
$document =& JFactory::getDocument();
+ $document->prepare($params);
+ $this->triggerEvent('onBeforeRender');
$data = $document->render($this->getCfg('caching'), $params );
JResponse::setBody($data);
+ $this->triggerEvent('onAfterRender');
}
/**
View
@@ -35,46 +35,35 @@
$mainframe->initialise(array(
'language' => $mainframe->getUserState( "application.lang", 'lang' )
));
-
-JPluginHelper::importPlugin('system');
-
-// trigger the onAfterInitialise events
+// Profiling
JDEBUG ? $_PROFILER->mark('afterInitialise') : null;
-$mainframe->triggerEvent('onAfterInitialise');
/**
* ROUTE THE APPLICATION
*
* NOTE :
*/
$mainframe->route();
-
-// trigger the onAfterRoute events
+// Profiling
JDEBUG ? $_PROFILER->mark('afterRoute') : null;
-$mainframe->triggerEvent('onAfterRoute');
/**
* DISPATCH THE APPLICATION
*
* NOTE :
*/
-
$mainframe->dispatch();
-
-// trigger the onAfterDispatch events
+// Profiling
JDEBUG ? $_PROFILER->mark('afterDispatch') : null;
-$mainframe->triggerEvent('onAfterDispatch');
/**
* RENDER THE APPLICATION
*
* NOTE :
*/
$mainframe->render();
-
-// trigger the onAfterRender events
+// Profiling
JDEBUG ? $_PROFILER->mark( 'afterRender' ) : null;
-$mainframe->triggerEvent( 'onAfterRender' );
/**
* RETURN THE RESPONSE
View
@@ -76,7 +76,19 @@ public function initialise( $options = array())
* @access public
*/
public function route() {
- parent::route();
+ // get the full request URI
+ $uri = clone(JURI::getInstance());
+
+ $router =& $this->getRouter();
+ $result = $router->parse($uri);
+
+ JRequest::set($result, 'get', false );
+
+ // authorization
+ $Itemid = JRequest::getInt('Itemid');
+ $this->authorize($Itemid);
+
+ $this->triggerEvent('onAfterRoute');
}
/**
@@ -126,6 +138,7 @@ public function dispatch($component = null)
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer( $contents, 'component');
+ $this->triggerEvent('onAfterDispatch');
}
/**
@@ -168,8 +181,11 @@ public function render()
} break;
}
- $data = $document->render( $this->getCfg('caching'), $params);
+ $document->parse($params);
+ $this->triggerEvent('onBeforeRender');
+ $data = $document->render($this->getCfg('caching'), $params );
JResponse::setBody($data);
+ $this->triggerEvent('onAfterRender');
}
/**
View
@@ -24,60 +24,43 @@
*
* NOTE :
*/
-
-
$mainframe =& JFactory::getApplication('site');
/**
* INITIALISE THE APPLICATION
*
* NOTE :
*/
- // set the language
$mainframe->initialise();
-
- JPluginHelper::importPlugin('system');
-
- // trigger the onAfterInitialise events
+ // profiling
JDEBUG ? $_PROFILER->mark('afterInitialise') : null;
- $mainframe->triggerEvent('onAfterInitialise');
/**
* ROUTE THE APPLICATION
*
* NOTE :
*/
$mainframe->route();
-
- // authorization
- $Itemid = JRequest::getInt('Itemid');
- $mainframe->authorize($Itemid);
-
- // trigger the onAfterRoute events
+ // profiling
JDEBUG ? $_PROFILER->mark('afterRoute') : null;
- $mainframe->triggerEvent('onAfterRoute');
/**
* DISPATCH THE APPLICATION
*
* NOTE :
*/
$mainframe->dispatch();
-
- // trigger the onAfterDispatch events
+ // Profiling
JDEBUG ? $_PROFILER->mark('afterDispatch') : null;
- $mainframe->triggerEvent('onAfterDispatch');
/**
* RENDER THE APPLICATION
*
* NOTE :
*/
$mainframe->render();
-
- // trigger the onAfterRender events
+ // Profiling
JDEBUG ? $_PROFILER->mark('afterRender') : null;
- $mainframe->triggerEvent('onAfterRender');
/**
* RETURN THE RESPONSE
View
@@ -28,6 +28,12 @@ COMMITERS
Do not forget to update this page on the wiki when making changes relevant to developers:
http://docs.joomla.org/index.php?title=Version_1.6_Developer_Notes
+24-Jan-2009 Anthony Ferrara
+ + Added onBeforeRender Trigger
+ + Added onAfterCacheRender Trigger
+ + Added parse method to JDocument and JDocumentHTML
+ ^ Moved all "system" triggers inside of JApplication/children
+
24-Jan-2009 Andrew Eddie
^ Move text files to /installation/ folder
@@ -185,6 +185,9 @@ public function initialise($options = array())
$editor = $user->getParam('editor', $this->getCfg('editor'));
$editor = JPluginHelper::isEnabled('editors', $editor) ? $editor : $this->getCfg('editor');
$config->setValue('config.editor', $editor);
+
+ JPluginHelper::importPlugin('system');
+ $this->triggerEvent('onAfterInitialise');
}
/**
@@ -207,6 +210,8 @@ public function route()
$result = $router->parse($uri);
JRequest::set($result, 'get', false );
+
+ $this->triggerEvent('onAfterRoute');
}
/**
@@ -228,6 +233,8 @@ public function dispatch($component = null)
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
+
+ $this->triggerEvent('onAfterDispatch');
}
/**
@@ -249,8 +256,11 @@ public function render()
);
$document =& JFactory::getDocument();
+ $document->parse($params);
+ $this->triggerEvent('onBeforeRender');
$data = $document->render($this->getCfg('caching'), $params );
JResponse::setBody($data);
+ $this->triggerEvent('onAfterRender');
}
/**
@@ -754,6 +754,16 @@ public function &loadRenderer( $type )
}
/**
+ * Parses the document and prepares the buffers
+ *
+ * @access public
+ * @return null
+ */
+ public function parse($params = array()) {
+ return null;
+ }
+
+ /**
* Outputs the document
*
* @access public
Oops, something went wrong.

0 comments on commit c563a64

Please sign in to comment.