2011-04-20 22:50:13 +02:00
|
|
|
<?php
|
2011-08-19 02:32:31 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @package cms
|
|
|
|
*/
|
2011-04-20 22:50:13 +02:00
|
|
|
class CMSPagesController extends CMSMain {
|
|
|
|
|
|
|
|
static $url_segment = 'pages';
|
|
|
|
static $url_rule = '/$Action/$ID/$OtherID';
|
|
|
|
static $url_priority = 41;
|
|
|
|
static $menu_title = 'Pages';
|
2012-03-05 16:07:53 +01:00
|
|
|
static $required_permission_codes = 'CMS_ACCESS_CMSMain';
|
2011-04-20 22:50:13 +02:00
|
|
|
|
|
|
|
function init() {
|
|
|
|
parent::init();
|
|
|
|
|
|
|
|
Requirements::javascript(CMS_DIR . '/javascript/CMSPagesController.Tree.js');
|
|
|
|
}
|
|
|
|
|
|
|
|
function show($request) {
|
2011-06-08 01:30:54 +02:00
|
|
|
if($request->param('ID')) {
|
|
|
|
$c = new CMSPageEditController();
|
|
|
|
return $this->redirect(Controller::join_links($c->Link('show'), $request->param('ID')));
|
|
|
|
}
|
2011-08-19 02:32:31 +02:00
|
|
|
|
|
|
|
return parent::show($request);
|
2011-04-20 22:50:13 +02:00
|
|
|
}
|
|
|
|
|
2011-07-04 16:09:07 +02:00
|
|
|
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);
|
|
|
|
}
|
2011-08-19 02:32:31 +02:00
|
|
|
|
|
|
|
return parent::Link($action);
|
2011-07-04 16:09:07 +02:00
|
|
|
}
|
|
|
|
|
2011-10-29 19:13:19 +02:00
|
|
|
function PreviewLink() {
|
|
|
|
return false;
|
|
|
|
}
|
2012-02-14 16:00:48 +01:00
|
|
|
|
2012-03-08 17:31:02 +01:00
|
|
|
function AddLink() {
|
|
|
|
return singleton("CMSPageAddController")->Link();
|
|
|
|
}
|
|
|
|
|
2012-02-14 16:00:48 +01:00
|
|
|
public function currentPageID() {
|
|
|
|
return false;
|
|
|
|
}
|
2011-04-20 22:50:13 +02:00
|
|
|
}
|