Permalink
Browse files

Add basic setup for SS3.1 support

  • Loading branch information...
1 parent f188276 commit 8f89fe7cc0d0d89174b5d0c3946854080ad064fe @mlewis-everley mlewis-everley committed Jun 19, 2013
Showing with 16 additions and 26 deletions.
  1. +1 −1 README.md
  2. +4 −4 _config.php
  3. +4 −8 code/extensions/CustomMenuExtension.php
  4. +5 −11 code/extensions/CustomMenuHolder_SubsiteExtension.php
  5. +2 −2 composer.json
View
2 README.md
@@ -7,7 +7,7 @@ Developed and maintained by [i-lateral](http://www.i-lateral.com)
Requirements
------------
-SilverStripe 3.0 or greater.
+SilverStripe 3.1 or greater.
Installation Instructions
View
8 _config.php
@@ -2,9 +2,9 @@
i18n::include_locale_file('custommenus', 'en_US');
// Add custom menu controller to ContentController
-Object::add_extension('ContentController', 'CustomMenu');
-Object::add_extension('SiteTree','CustomMenuExtension');
-Object::add_extension('LeftAndMain', 'CustomMenu_LeftAndMain');
+ContentController::add_extension('CustomMenu');
+SiteTree::add_extension('CustomMenuExtension');
+LeftAndMain::add_extension('CustomMenu_LeftAndMain');
// Enable Subsite Support if needed
-if(class_exists('Subsite')) Object::add_extension('CustomMenuHolder', 'CustomMenuHolder_SubsiteExtension');
+if(class_exists('Subsite')) CustomMenuHolder::add_extension('CustomMenuHolder_SubsiteExtension');
View
12 code/extensions/CustomMenuExtension.php
@@ -1,10 +1,6 @@
<?php
class CustomMenuExtension extends DataExtension {
- function extraStatics($class = null, $extension = null) {
- return array(
- 'belongs_many_many' => array(
- 'CustomMenus' => 'CustomMenuHolder'
- )
- );
- }
-}
+ private static $belongs_many_many => array(
+ 'CustomMenus' => 'CustomMenuHolder'
+ );
+}
View
16 code/extensions/CustomMenuHolder_SubsiteExtension.php
@@ -6,15 +6,9 @@
* @author morven
*/
class CustomMenuHolder_SubsiteExtension extends DataExtension {
- public function extraStatics($class = null, $extension = null) {
- return array(
- 'has_one' => array(
- 'Subsite' => 'Subsite'
- )
- );
- }
+ private static $has_one => array(
+ 'Subsite' => 'Subsite'
+ );
- function updateCMSFields(FieldList $fields) {
-
- }
-}
+ public function updateCMSFields(FieldList $fields) {}
+}
View
4 composer.json
@@ -15,8 +15,8 @@
"issues": "http://github.com/i-lateral/silverstripe-custommenus/issues"
},
"require": {
- "silverstripe/framework": ">=3.0",
- "silverstripe/cms": ">=3.0"
+ "silverstripe/framework": ">=3.1",
+ "silverstripe/cms": ">=3.1"
},
"extra": {
"installer-name": "custommenus"

0 comments on commit 8f89fe7

Please sign in to comment.