From aa190ea7a5229dd1c8ab26a111c9393b46067c82 Mon Sep 17 00:00:00 2001 From: Stephen Shkardoon Date: Thu, 22 Aug 2013 23:38:26 +1200 Subject: [PATCH] Fix deprecation warnings for master --- _config.php | 8 ++++---- code/DMSDocument.php | 12 ++++++------ code/DMSDocument_versions.php | 18 +++++++++--------- code/DMSSiteTreeExtension.php | 8 ++++---- code/DMSTag.php | 6 +++--- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/_config.php b/_config.php index 0b6b732..1703523 100644 --- a/_config.php +++ b/_config.php @@ -1,6 +1,7 @@ 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 @@ -8,15 +9,14 @@ DMSDocumentAddController::add_allowed_extensions(); //add an array of additional 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('DMSDocument_Controller', 'dms_link_shortcode_handler')); -if (DMSDocument_versions::$enable_versions) { +if ($config->get('DMSDocument_versions', 'enable_versions')) { //using the same db relations for the versioned documents, as for the actual documents - Config::inst()->update('DMSDocument_versions', 'db', DMSDocument::$db); + $config->update('DMSDocument_versions', 'db', $config->get('DMSDocument', 'db')); } diff --git a/code/DMSDocument.php b/code/DMSDocument.php index 35e3e32..a13e072 100755 --- a/code/DMSDocument.php +++ b/code/DMSDocument.php @@ -1,6 +1,6 @@ "Varchar(255)", // eg. 3469~2011-energysaving-report.pdf "Folder" => "Varchar(255)", // eg. 0 "Title" => 'Varchar(1024)', // eg. "Energy Saving Report for Year 2011, New Zealand LandCorp" @@ -14,27 +14,27 @@ class DMSDocument extends DataObject implements DMSDocumentInterface { "ExpireAtDate" => 'SS_DateTime' ); - static $many_many = array( + private static $many_many = array( 'Pages' => 'SiteTree', 'Tags' => 'DMSTag' ); - static $many_many_extraFields = array( + private static $many_many_extraFields = array( 'Pages' => array( 'DocumentSort' => 'Int' ), ); - static $display_fields = array( + private static $display_fields = array( 'ID'=>'ID', 'Title'=>'Title', 'FilenameWithoutID'=>'Filename', 'LastChanged'=>'LastChanged' ); - static $singular_name = 'Document'; + private static $singular_name = 'Document'; - static $plural_name = 'Documents'; + private static $plural_name = 'Documents'; public function canView($member = null) { diff --git a/code/DMSDocument_versions.php b/code/DMSDocument_versions.php index fe34803..a6924ac 100644 --- a/code/DMSDocument_versions.php +++ b/code/DMSDocument_versions.php @@ -6,37 +6,37 @@ */ class DMSDocument_versions extends DataObject { - static $enable_versions = true; //flag that turns on or off versions of documents when replacing them + public static $enable_versions = true; //flag that turns on or off versions of documents when replacing them - static $db = array( + private static $db = array( 'VersionCounter' => 'Int', 'VersionViewCount' => 'Int' ); //config system call in _config creates this to mirror DMSDocument - static $has_one = array( + private static $has_one = array( 'Document' => 'DMSDocument' //ID of the original DMSDocument object this is a version of ); - static $defaults = array( + private static $defaults = array( 'VersionCounter' => 0 ); - static $display_fields = array( + private static $display_fields = array( 'VersionCounter' => 'Version Counter', 'FilenameWithoutID' => 'Filename', 'LastChanged' => 'Last Changed' ); - static $summary_fields = array( + private static $summary_fields = array( 'VersionCounter', 'FilenameWithoutID' ); - static $field_labels = array( + private static $field_labels = array( 'FilenameWithoutID'=>'Filename' ); - static $default_sort = array( + private static $default_sort = array( 'LastChanged' => 'DESC' ); @@ -210,4 +210,4 @@ class DMSDocument_versions extends DataObject { } -?> \ No newline at end of file +?> diff --git a/code/DMSSiteTreeExtension.php b/code/DMSSiteTreeExtension.php index 237aba7..a29bea5 100644 --- a/code/DMSSiteTreeExtension.php +++ b/code/DMSSiteTreeExtension.php @@ -1,12 +1,12 @@ 'DMSDocument' ); - static $noDocumentsList = array(); - static $showDocumentsList = array(); + private static $noDocumentsList = array(); + private static $showDocumentsList = array(); /** * Do not show the documents tab on the array of pages set here @@ -153,4 +153,4 @@ class DMSSiteTreeExtension extends DataExtension { function getTitleWithNumberOfDocuments() { return $this->owner->Title . ' (' . $this->owner->Documents()->Count() . ')'; } -} \ No newline at end of file +} diff --git a/code/DMSTag.php b/code/DMSTag.php index 6cf2c14..2270e37 100644 --- a/code/DMSTag.php +++ b/code/DMSTag.php @@ -4,13 +4,13 @@ */ class DMSTag extends DataObject { - static $db = array( + private static $db = array( 'Category' => 'Varchar(1024)', 'Value' => 'Varchar(1024)', 'MultiValue' => 'Boolean(1)' ); - static $belongs_many_many = array( + private static $belongs_many_many = array( 'Documents' => 'DMSDocument' ); -} \ No newline at end of file +}