index.php
changeset 314 f379fdf3b4d7
parent 294 444c34a3886b
child 318 eec2dfd2f0a3
equal deleted inserted replaced
313:6080514218ca 314:f379fdf3b4d7
    57     $_GET['do'] = 'view';
    57     $_GET['do'] = 'view';
    58   }
    58   }
    59   switch($_GET['do'])
    59   switch($_GET['do'])
    60   {
    60   {
    61     default:
    61     default:
    62       die_friendly('Invalid action', '<p>The action "'.htmlspecialchars($_GET['do']).'" is not defined. Return to <a href="'.makeUrl($paths->page).'">viewing this page\'s text</a>.</p>');
    62       $code = $plugins->setHook('page_action');
       
    63       ob_start();
       
    64       foreach ( $code as $cmd )
       
    65       {
       
    66         eval($cmd);
       
    67       }
       
    68       if ( $contents = ob_get_contents() )
       
    69       {
       
    70         ob_end_clean();
       
    71         echo $contents;
       
    72       }
       
    73       else
       
    74       {
       
    75         die_friendly('Invalid action', '<p>The action "'.htmlspecialchars($_GET['do']).'" is not defined. Return to <a href="'.makeUrl($paths->page).'">viewing this page\'s text</a>.</p>');
       
    76       }
    63       break;
    77       break;
    64     case 'view':
    78     case 'view':
    65       // echo PageUtils::getpage($paths->page, true, ( (isset($_GET['oldid'])) ? $_GET['oldid'] : false ));
    79       // echo PageUtils::getpage($paths->page, true, ( (isset($_GET['oldid'])) ? $_GET['oldid'] : false ));
    66       $rev_id = ( (isset($_GET['oldid'])) ? intval($_GET['oldid']) : 0 );
    80       $rev_id = ( (isset($_GET['oldid'])) ? intval($_GET['oldid']) : 0 );
    67       $page = new PageProcessor( $paths->page_id, $paths->namespace, $rev_id );
    81       $page = new PageProcessor( $paths->page_id, $paths->namespace, $rev_id );