index.php
changeset 759 6e2671261802
parent 685 17ebe24cdf85
child 798 ddfc1b554a08
equal deleted inserted replaced
758:6b79a49f85f0 759:6e2671261802
    49     $_GET['do'] = 'view';
    49     $_GET['do'] = 'view';
    50   }
    50   }
    51   switch($_GET['do'])
    51   switch($_GET['do'])
    52   {
    52   {
    53     default:
    53     default:
    54       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>');
    54       $code = $plugins->setHook('page_action');
       
    55       ob_start();
       
    56       foreach ( $code as $cmd )
       
    57       {
       
    58         eval($cmd);
       
    59       }
       
    60       if ( $contents = ob_get_contents() )
       
    61       {
       
    62         ob_end_clean();
       
    63         echo $contents;
       
    64       }
       
    65       else
       
    66       {
       
    67         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>');
       
    68       }
    55       break;
    69       break;
    56     case 'view':
    70     case 'view':
    57       // echo PageUtils::getpage($paths->page, true, ( (isset($_GET['oldid'])) ? $_GET['oldid'] : false ));
    71       // echo PageUtils::getpage($paths->page, true, ( (isset($_GET['oldid'])) ? $_GET['oldid'] : false ));
    58       $rev_id = ( (isset($_GET['oldid'])) ? intval($_GET['oldid']) : 0 );
    72       $rev_id = ( (isset($_GET['oldid'])) ? intval($_GET['oldid']) : 0 );
    59       $page = new PageProcessor( $paths->page_id, $paths->namespace, $rev_id );
    73       $page = new PageProcessor( $paths->page_id, $paths->namespace, $rev_id );