# HG changeset patch # User Dan # Date 1228016981 18000 # Node ID 6e2671261802817af0ff881c52f8502ded185199 # Parent 6b79a49f85f0dda4024f142b74094bc502456055 Plugins can now register their own custom actions for $_GET["do"]. diff -r 6b79a49f85f0 -r 6e2671261802 index.php --- a/index.php Sat Nov 29 22:44:40 2008 -0500 +++ b/index.php Sat Nov 29 22:49:41 2008 -0500 @@ -51,7 +51,21 @@ switch($_GET['do']) { default: - die_friendly('Invalid action', '
The action "'.htmlspecialchars($_GET['do']).'" is not defined. Return to viewing this page\'s text.
'); + $code = $plugins->setHook('page_action'); + ob_start(); + foreach ( $code as $cmd ) + { + eval($cmd); + } + if ( $contents = ob_get_contents() ) + { + ob_end_clean(); + echo $contents; + } + else + { + die_friendly('Invalid action', 'The action "'.htmlspecialchars($_GET['do']).'" is not defined. Return to viewing this page\'s text.
'); + } break; case 'view': // echo PageUtils::getpage($paths->page, true, ( (isset($_GET['oldid'])) ? $_GET['oldid'] : false ));