Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 41 lines (31 sloc) 0.906 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
<?php

/**
* @package cms
*/
class CMSPagesController extends CMSMain {

static $url_segment = 'pages';
static $url_rule = '/$Action/$ID/$OtherID';
static $url_priority = 41;
static $menu_title = 'Pages';

function init() {
parent::init();

Requirements::javascript(CMS_DIR . '/javascript/CMSPagesController.Tree.js');
}

function show($request) {
if($request->param('ID')) {
$c = new CMSPageEditController();
return $this->redirect(Controller::join_links($c->Link('show'), $request->param('ID')));
}

return parent::show($request);
}

function Link($action = null) {
// Special case: All show links should redirect to the page edit interface instead (mostly from tree nodes)
if(preg_match('/^show/', $action)) {
return singleton('CMSPageEditController')->Link($action);
}

return parent::Link($action);
}

function PreviewLink() {
return false;
}

}
Something went wrong with that request. Please try again.