/** * 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); } }
/** * Only show the documents tab on the list of pages set here. Any pages set in the no_documents_tab array will * still not be shown. If this isn't called, or if it is called with an empty array, all pages will get Document tabs. * @static * @param $array Array of page types to show the Documents tab on */ static function show_documents_tab($array = array()) { if (empty($array)) { return; } if (is_array($array)) { self::$showDocumentsList = $array; } else { self::$showDocumentsList = array($array); } }
<?php $config = Config::inst(); $config->update('DMSDocument_versions', 'enable_versions', true); DMSSiteTreeExtension::show_documents_tab(); //show the Documents tab on all pages DMSSiteTreeExtension::no_documents_tab(); //and don't exclude it from any pages DMSDocumentAddController::add_allowed_extensions(); //add an array of additional allowed extensions define('DMS_DIR', 'dms'); if (!file_exists(BASE_PATH . DIRECTORY_SEPARATOR . DMS_DIR)) { user_error("DMS directory named incorrectly. Please install the DMS module into a folder named: " . DMS_DIR); } CMSMenu::remove_menu_item('DMSDocumentAddController'); ShortcodeParser::get('default')->register('dms_document_link', array('DMSShortcodeHandler', 'handle')); if ($config->get('DMSDocument_versions', 'enable_versions')) { //using the same db relations for the versioned documents, as for the actual documents $config->update('DMSDocument_versions', 'db', $config->get('DMSDocument', 'db')); }