mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
ENHANCEMENT: not showing the Documents tab on certain pages
This commit is contained in:
parent
950833583a
commit
d023300626
@ -5,7 +5,26 @@ class DMSSiteTreeExtension extends DataExtension {
|
|||||||
'Documents' => 'DMSDocument'
|
'Documents' => 'DMSDocument'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
static $noDocumentsList = array(
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do not show the documents tab on the array of pages set here
|
||||||
|
* @static
|
||||||
|
* @param $mixed Array of page types to not show the Documents tab on
|
||||||
|
*/
|
||||||
|
static function no_documents_tab($array) {
|
||||||
|
if (is_array($array)) {
|
||||||
|
self::$noDocumentsList = $array;
|
||||||
|
} else {
|
||||||
|
self::$noDocumentsList = array($array);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function updateCMSFields(FieldList $fields){
|
function updateCMSFields(FieldList $fields){
|
||||||
|
//prevent certain pages from having a Document tab in the CMS
|
||||||
|
if (in_array($this->owner->ClassName,self::$noDocumentsList)) return;
|
||||||
|
|
||||||
//javascript to customize the grid field for the DMS document (overriding entwine in FRAMEWORK_DIR.'/javascript/GridField.js'
|
//javascript to customize the grid field for the DMS document (overriding entwine in FRAMEWORK_DIR.'/javascript/GridField.js'
|
||||||
Requirements::javascript('dms/javascript/DMSGridField.js');
|
Requirements::javascript('dms/javascript/DMSGridField.js');
|
||||||
Requirements::css('dms/css/DMSMainCMS.css');
|
Requirements::css('dms/css/DMSMainCMS.css');
|
||||||
|
Loading…
Reference in New Issue
Block a user