[pLog-svn] r4883 - in plog/branches/lifetype-1.2/class: plugin view/admin
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Tue Feb 27 05:56:55 EST 2007
Author: oscar
Date: 2007-02-27 05:56:55 -0500 (Tue, 27 Feb 2007)
New Revision: 4883
Modified:
plog/branches/lifetype-1.2/class/plugin/eventlist.properties.php
plog/branches/lifetype-1.2/class/view/admin/admintemplatedview.class.php
Log:
Added a new event EVENT_PROCESS_BLOG_ADMIN_TEMPLATE_OUTPUT that allows plugins to capture the output of an admin template and dynamically modify its content before it's sent to the client. This should help plugins that want to add links or new functionalities to currently existing admin pages that cannot be easily modified (I'm thinking of the 'edit comments' plugin) Although you may need some complex regexp processing to get your content where you want it, it should work.
Modified: plog/branches/lifetype-1.2/class/plugin/eventlist.properties.php
===================================================================
--- plog/branches/lifetype-1.2/class/plugin/eventlist.properties.php 2007-02-26 13:50:34 UTC (rev 4882)
+++ plog/branches/lifetype-1.2/class/plugin/eventlist.properties.php 2007-02-27 10:56:55 UTC (rev 4883)
@@ -185,4 +185,5 @@
define( "EVENT_POST_UPDATE_PERMISSION", ++$eventValue );
define( "EVENT_PRE_DELETE_PERMISSION", ++$eventValue );
define( "EVENT_POST_DELETE_PERMISSION", ++$eventValue );
+ define( "EVENT_PROCESS_BLOG_ADMIN_TEMPLATE_OUTPUT", ++$eventValue );
?>
\ No newline at end of file
Modified: plog/branches/lifetype-1.2/class/view/admin/admintemplatedview.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/view/admin/admintemplatedview.class.php 2007-02-26 13:50:34 UTC (rev 4882)
+++ plog/branches/lifetype-1.2/class/view/admin/admintemplatedview.class.php 2007-02-27 10:56:55 UTC (rev 4883)
@@ -39,8 +39,11 @@
// assign all the values
$template->assign( $this->_params->getAsArray());
- // and send the results
- print $template->fetch();
+ // and send the results after asking plugins if they need to process anything
+ $output = $template->fetch();
+ $this->notifyEvent( EVENT_PROCESS_BLOG_ADMIN_TEMPLATE_OUTPUT, Array( 'content' => &$output, 'template' => $this->_templateName ));
+
+ print( $output );
}
}
?>
More information about the pLog-svn
mailing list