Added to main CMS controllers

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@49888 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-02-20 09:41:33 +00:00
parent 6546f66ebb
commit f7474bf059
7 changed files with 111 additions and 24 deletions

View File

@ -13,6 +13,21 @@
*/
class AssetAdmin extends LeftAndMain {
static $tree_class = "File";
static $allowed_actions = array(
'addfolder',
'deletefolder',
'deletemarked',
'deleteUnusedThumbnails',
'doUpload',
'getfile',
'getsubtree',
'movemarked',
'removefile',
'save',
'savefile',
'uploadiframe',
);
public function Link($action=null) {
if(!$action) $action = "index";

View File

@ -13,11 +13,41 @@
* @todo Create some base classes to contain the generic functionality that will be replicated.
*/
class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionProvider {
static $tree_class = "SiteTree";
static $subitem_class = "Member";
static $allowed_actions = array(
'addmember',
'addpage',
'buildbrokenlinks',
'canceldraftchangesdialog',
'compareversions',
'createtranslation',
'delete',
'deletefromlive',
'deleteitems',
'dialog',
'duplicate',
'duplicatewithchildren',
'getpagecount',
'getpagemembers',
'getversion',
'publishall',
'publishitems',
'restorepage',
'revert',
'rollback',
'sidereport',
'submit',
'switchlanguage',
'tasklist',
'unpublish',
'versions',
'waitingon',
);
/**
* SiteTree Columns that can be filtered using the the Site Tree Search button
*/
@ -1324,29 +1354,6 @@ JS
return $this->returnItemToUser($newrecord);
}
// HACK HACK HACK - Dont remove without telling simon ;-)
/**
* This is only used by parents inc.
* TODO Work out a better way of handling control to the individual page objects.
*/
function sethottip($data,$form) {
$page = DataObject::get_by_id("SiteTree", $_REQUEST['ID']);
return $page->sethottip($data,$form);
}
/**
* This is only used by parents inc.
* TODO Work out a better way of handling control to the individual page objects.
*/
function notifyInvitation($data,$form) {
$page = DataObject::get_by_id("SiteTree", $_REQUEST['ID']);
return $page->notifyInvitation($data,$form);
}
function testInvitation($data,$form) {
$page = DataObject::get_by_id("SiteTree", $_REQUEST['ID']);
return $page->testInvitation($data,$form);
}
/**
* Provide the permission codes used by LeftAndMain.
* Can't put it on LeftAndMain since that's an abstract base class.

View File

@ -11,6 +11,14 @@
* @subpackage comments
*/
class CommentAdmin extends LeftAndMain {
static $allowed_actions = array(
'approvedmarked',
'deleteall',
'deletemarked',
'hammarked',
'showtable',
'spammarked',
);
public function init() {
parent::init();

View File

@ -13,6 +13,14 @@
* @subpackage core
*/
abstract class GenericDataAdmin extends LeftAndMain {
static $allowed_actions = array(
'createRecord',
'delete',
'export',
'getResults',
'save',
'show',
);
public $filter;

View File

@ -16,6 +16,19 @@ abstract class LeftAndMain extends Controller {
static $extra_menu_items = array(), $removed_menu_items = array(), $replaced_menu_items = array();
static $ForceReload;
static $allowed_actions = array(
'ajaxupdateparent',
'ajaxupdatesort',
'callPageMethod',
'deleteitems',
'getitem',
'getsubtree',
'myprofile',
'printable',
'save',
'show',
);
function init() {
Director::set_site_mode('cms');

View File

@ -14,6 +14,31 @@ class NewsletterAdmin extends LeftAndMain {
static $subitem_class = "Member";
static $template_path = null; // defaults to (project)/templates/email
static $allowed_actions = array(
'adddraft',
'addgroup',
'addtype',
'autocomplete',
'displayfilefield',
'getformcontent',
'getsentstatusreport',
'getsitetree',
'memberblacklisttoggle',
'newmember',
'remove',
'removebouncedmember',
'removenewsletter',
'save',
'savemember',
'savenewsletter',
'sendnewsletter',
'showdrafts',
'showmailtype',
'shownewsletter',
'showrecipients',
'showsent',
);
public function init() {
// Check permissions

View File

@ -13,6 +13,17 @@
class SecurityAdmin extends LeftAndMain implements PermissionProvider {
static $tree_class = "Group";
static $subitem_class = "Member";
static $allowed_actions = array(
'addgroup',
'addmember',
'autocomplete',
'getmember',
'listmembers',
'newmember',
'removememberfromgroup',
'savemember',
);
public function init() {
// Check permissions