Permalink
Browse files

API Marked statics private, use Config API instead (#8317)

See "Static configuration properties are now immutable, you must use Config API." in the 3.1 change log for details.
  • Loading branch information...
1 parent f55bd9d commit 3334eafcb1c42b917dcafe46d87ea32f2b1014b8 @chillu chillu committed Mar 21, 2013
Showing with 2,086 additions and 1,533 deletions.
  1. +3 −1 _config/config.yml
  2. +2 −2 admin/code/AdminRootController.php
  3. +5 −5 admin/code/CMSBatchActionHandler.php
  4. +1 −1 admin/code/CMSMenu.php
  5. +4 −4 admin/code/CMSProfileController.php
  6. +78 −43 admin/code/LeftAndMain.php
  7. +20 −11 admin/code/ModelAdmin.php
  8. +20 −16 admin/code/SecurityAdmin.php
  9. +3 −3 admin/tests/CMSMenuTest.php
  10. +4 −4 admin/tests/LeftAndMainTest.php
  11. +9 −9 admin/tests/ModelAdminTest.php
  12. +2 −30 admin/tests/SecurityAdminTest.php
  13. +8 −7 api/JSONDataFormatter.php
  14. +4 −4 api/RSSFeed.php
  15. +31 −11 api/RestfulService.php
  16. +9 −7 api/XMLDataFormatter.php
  17. +1 −1 cli/CliController.php
  18. +2 −2 conf/ConfigureFromEnv.php
  19. +40 −15 control/ContentNegotiator.php
  20. +2 −2 control/Controller.php
  21. +13 −4 control/Cookie.php
  22. +71 −29 control/Director.php
  23. +4 −2 control/RequestHandler.php
  24. +87 −33 control/Session.php
  25. +1 −1 core/Core.php
  26. +1 −1 core/Extension.php
  27. +3 −2 core/Object.php
  28. +1 −1 core/manifest/ConfigManifest.php
  29. +1 −1 core/manifest/ManifestFileFinder.php
  30. +5 −3 dev/Backtrace.php
  31. +1 −1 dev/BulkLoader.php
  32. +34 −26 dev/Debug.php
  33. +2 −2 dev/DevelopmentAdmin.php
  34. +6 −5 dev/FixtureBlueprint.php
  35. +19 −7 dev/FunctionalTest.php
  36. +1 −1 dev/InstallerTest.php
  37. +2 −2 dev/JSTestRunner.php
  38. +1 −1 dev/Log.php
  39. +15 −5 dev/LogEmailWriter.php
  40. +1 −1 dev/SapphireInfo.php
  41. +1 −1 dev/SapphireREPL.php
  42. +18 −32 dev/SapphireTest.php
  43. +2 −2 dev/TaskRunner.php
  44. +2 −2 dev/TestRunner.php
  45. +1 −1 dev/install/DatabaseAdapterRegistry.php
  46. +0 −18 dev/install/install.php5
  47. +1 −1 dev/phpunit/PhpUnitWrapper_3_4.php
  48. +1 −1 dev/phpunit/PhpUnitWrapper_3_5.php
  49. +1 −1 docs/en/changelogs/3.0.0.md
  50. +81 −9 docs/en/changelogs/3.1.0.md
  51. +1 −1 docs/en/howto/cache-control.md
  52. +3 −4 docs/en/howto/cms-alternating-button.md
  53. +8 −8 docs/en/howto/csv-import.md
  54. +2 −2 docs/en/howto/customize-cms-menu.md
  55. +2 −2 docs/en/howto/customize-cms-pages-list.md
  56. +3 −6 docs/en/howto/extend-cms-interface.md
  57. +1 −1 docs/en/howto/grouping-dataobjectsets.md
  58. +2 −2 docs/en/howto/simple-contact-form.md
  59. +4 −2 docs/en/installation/common-problems.md
  60. +1 −1 docs/en/reference/cms-architecture.md
  61. +6 −6 docs/en/reference/dataextension.md
  62. +14 −14 docs/en/reference/dataobject.md
  63. +1 −1 docs/en/reference/datefield.md
  64. +1 −1 docs/en/reference/execution-pipeline.md
  65. +3 −3 docs/en/reference/grid-field.md
  66. +6 −6 docs/en/reference/member.md
  67. +10 −10 docs/en/reference/modeladmin.md
  68. +6 −3 docs/en/reference/preview.md
  69. +4 −12 docs/en/reference/requirements.md
  70. +1 −1 docs/en/reference/searchcontext.md
  71. +1 −1 docs/en/reference/siteconfig.md
  72. +9 −9 docs/en/reference/sitetree.md
  73. +1 −1 docs/en/reference/sqlquery.md
  74. +3 −5 docs/en/reference/templates.md
  75. +6 −5 docs/en/reference/uploadfield.md
  76. +3 −9 docs/en/topics/configuration.md
  77. +5 −5 docs/en/topics/controller.md
  78. +3 −3 docs/en/topics/datamodel.md
  79. +40 −37 docs/en/topics/debugging.md
  80. +8 −6 docs/en/topics/email.md
  81. +29 −0 docs/en/topics/environment-management.md
  82. +1 −1 docs/en/topics/form-validation.md
  83. +5 −4 docs/en/topics/i18n.md
  84. +1 −1 docs/en/topics/page-types.md
  85. +1 −1 docs/en/topics/rich-text-editing.md
  86. +1 −1 docs/en/topics/search.md
  87. +4 −4 docs/en/topics/security.md
  88. +1 −1 docs/en/topics/testing/create-functional-test.md
  89. +1 −1 docs/en/topics/testing/create-silverstripe-test.md
  90. +5 −3 docs/en/topics/theme-development.md
  91. +1 −1 docs/en/topics/themes.md
  92. +9 −12 docs/en/tutorials/2-extending-a-basic-site.md
  93. +2 −2 docs/en/tutorials/3-forms.md
  94. +7 −7 docs/en/tutorials/5-dataobject-relationship-management.md
  95. +37 −39 email/Email.php
  96. +32 −21 filesystem/File.php
  97. +2 −2 filesystem/FileFinder.php
  98. +10 −7 filesystem/FileNameFilter.php
  99. +11 −3 filesystem/Filesystem.php
  100. +3 −3 filesystem/Folder.php
  101. +17 −9 filesystem/GD.php
  102. +8 −4 filesystem/ImagickBackend.php
  103. +7 −6 filesystem/Upload.php
  104. +4 −4 forms/CountryDropdownField.php
  105. +17 −14 forms/DateField.php
  106. +8 −3 forms/DatetimeField.php
  107. +1 −1 forms/FileField.php
  108. +1 −1 forms/Form.php
  109. +3 −2 forms/HtmlEditorConfig.php
  110. +5 −4 forms/HtmlEditorField.php
  111. +8 −3 forms/TimeField.php
  112. +2 −2 forms/TreeDropdownField.php
  113. +7 −5 forms/UploadField.php
  114. +1 −1 forms/gridfield/GridField.php
  115. +1 −1 forms/gridfield/GridFieldDetailForm.php
  116. +4 −3 forms/gridfield/GridFieldPageCount.php
  117. +47 −22 i18n/i18n.php
  118. +5 −4 i18n/i18nTextCollector.php
  119. +1 −1 main.php
  120. +1 −1 model/Aggregate.php
  121. +46 −23 model/DataObject.php
  122. +6 −7 model/Database.php
  123. +1 −1 model/DatabaseAdmin.php
  124. +28 −23 model/Image.php
  125. +1 −10 model/Image_Backend.php
  126. +10 −3 model/MySQLDatabase.php
  127. +4 −3 model/Transliterator.php
  128. +10 −7 model/URLSegmentFilter.php
  129. +8 −8 model/Versioned.php
  130. +16 −5 model/fieldtypes/Currency.php
  131. +4 −2 model/fieldtypes/DBField.php
  132. +1 −1 model/fieldtypes/Enum.php
  133. +1 −1 model/fieldtypes/ForeignKey.php
  134. +2 −2 model/fieldtypes/HTMLText.php
  135. +1 −1 model/fieldtypes/HTMLVarchar.php
  136. +2 −2 model/fieldtypes/Money.php
  137. +1 −1 model/fieldtypes/PrimaryKey.php
  138. +1 −1 model/fieldtypes/StringField.php
  139. +1 −1 model/fieldtypes/Text.php
  140. +1 −1 model/fieldtypes/Varchar.php
  141. +1 −1 oembed/Oembed.php
  142. +40 −15 parsers/BBCodeParser.php
  143. +9 −5 security/BasicAuth.php
  144. +6 −6 security/Group.php
  145. +6 −9 security/LoginAttempt.php
  146. +82 −51 security/Member.php
  147. +4 −4 security/MemberAuthenticator.php
  148. +4 −4 security/MemberLoginForm.php
  149. +5 −5 security/MemberPassword.php
  150. +2 −1 security/PasswordEncryptor.php
  151. +3 −2 security/PasswordValidator.php
  152. +29 −31 security/Permission.php
  153. +2 −1 security/PermissionCheckboxSetField.php
  154. +9 −7 security/PermissionRole.php
  155. +2 −2 security/PermissionRoleCode.php
  156. +64 −34 security/Security.php
  157. +21 −0 statics.diff
  158. +1 −1 tasks/EncryptAllPasswordsTask.php
  159. +4 −4 tests/api/RSSFeedTest.php
  160. +5 −5 tests/api/RestfulServiceTest.php
  161. +2 −2 tests/api/XMLDataFormatterTest.php
  162. +1 −1 tests/control/CMSProfileControllerTest.php
  163. +9 −9 tests/control/ControllerTest.php
  164. +3 −3 tests/control/DirectorTest.php
  165. +1 −1 tests/control/HTTPRequestTest.php
  166. +3 −3 tests/control/HTTPTest.php
  167. +16 −16 tests/control/RequestHandlingTest.php
  168. +2 −2 tests/control/SessionTest.php
  169. +2 −2 tests/core/ClassInfoTest.php
  170. +34 −21 tests/core/ConfigTest.php
  171. +3 −3 tests/core/ConvertTest.php
  172. +8 −7 tests/core/ObjectTest.php
  173. +9 −5 tests/dev/BacktraceTest.php
  174. +6 −6 tests/dev/CsvBulkLoaderTest.php
  175. +4 −4 tests/dev/FixtureFactoryTest.php
  176. +19 −15 tests/filesystem/FileTest.php
  177. +1 −1 tests/filesystem/FolderTest.php
  178. +9 −3 tests/filesystem/UploadTest.php
  179. +1 −1 tests/forms/CheckboxFieldTest.php
  180. +4 −4 tests/forms/CheckboxSetFieldTest.php
  181. +4 −3 tests/forms/DateFieldTest.php
  182. +9 −7 tests/forms/DatetimeFieldTest.php
  183. +1 −1 tests/forms/EmailFieldTest.php
  184. +9 −9 tests/forms/FormScaffolderTest.php
  185. +8 −8 tests/forms/FormTest.php
  186. +10 −10 tests/forms/GridFieldTest.php
  187. +3 −3 tests/forms/HtmlEditorFieldTest.php
  188. +5 −5 tests/forms/ListboxFieldTest.php
  189. +1 −1 tests/forms/LookupFieldTest.php
  190. +1 −1 tests/forms/MemberDatetimeOptionsetFieldTest.php
  191. +2 −2 tests/forms/MoneyFieldTest.php
  192. +4 −3 tests/forms/TimeFieldTest.php
  193. +1 −1 tests/forms/gridfield/GridFieldAddExistingAutocompleterTest.php
  194. +2 −2 tests/forms/gridfield/GridFieldDeleteActionTest.php
  195. +12 −12 tests/forms/gridfield/GridFieldDetailFormTest.php
  196. +2 −2 tests/forms/gridfield/GridFieldEditButtonTest.php
  197. +2 −2 tests/forms/gridfield/GridFieldExportButtonTest.php
  198. +1 −1 tests/forms/gridfield/GridFieldPaginatorTest.php
  199. +6 −6 tests/forms/uploadfield/UploadFieldTest.php
  200. +5 −5 tests/i18n/i18nSSLegacyAdapterTest.php
  201. +11 −11 tests/i18n/i18nTest.php
  202. +3 −3 tests/i18n/i18nTextCollectorTest.php
  203. +4 −4 tests/i18n/i18nTextCollectorTestMyObject.php
  204. +4 −4 tests/i18n/i18nTextCollectorTestMySubObject.php
  205. +2 −1 tests/injector/InjectorTest.php
  206. +10 −10 tests/model/AggregateTest.php
  207. +4 −4 tests/model/ComponentSetTest.php
  208. +2 −2 tests/model/CompositeDBFieldTest.php
  209. +4 −18 tests/model/DBTest.php
  210. +9 −9 tests/model/DataDifferencerTest.php
  211. +11 −11 tests/model/DataExtensionTest.php
  212. +1 −1 tests/model/DataListTest.php
  213. +7 −7 tests/model/DataObjectDuplicationTest.php
  214. +5 −5 tests/model/DataObjectLazyLoadingTest.php
  215. +5 −4 tests/model/DataObjectSchemaGenerationTest.php
  216. +24 −24 tests/model/DataObjectTest.php
  217. +1 −1 tests/model/DataObjectTest_Namespaced.php
  218. +8 −8 tests/model/DataQueryTest.php
  219. +2 −2 tests/model/DatabaseTest.php
  220. +2 −2 tests/model/DbDatetimeTest.php
  221. +3 −3 tests/model/DecimalTest.php
  222. +1 −1 tests/model/HasManyListTest.php
  223. +3 −3 tests/model/HierarchyTest.php
  224. +1 −1 tests/model/ImageTest.php
  225. +1 −1 tests/model/ManyManyListTest.php
  226. +1 −1 tests/model/MapTest.php
  227. +2 −2 tests/model/MoneyTest.php
  228. +2 −2 tests/model/MySQLDatabaseTest.php
  229. +1 −1 tests/model/PaginatedListTest.php
  230. +5 −5 tests/model/SQLQueryTest.php
  231. +1 −1 tests/model/TransactionTest.php
  232. +6 −6 tests/model/UnsavedRelationListTest.php
  233. +7 −7 tests/model/VersionedTest.php
  234. +17 −17 tests/search/SearchContextTest.php
  235. +15 −15 tests/search/SearchFilterApplyRelationTest.php
  236. +4 −4 tests/security/BasicAuthTest.php
  237. +1 −1 tests/security/GroupCsvBulkLoaderTest.php
  238. +1 −1 tests/security/GroupTest.php
  239. +6 −6 tests/security/MemberAuthenticatorTest.php
  240. +2 −2 tests/security/MemberCsvBulkLoaderTest.php
  241. +10 −10 tests/security/MemberTest.php
  242. +1 −1 tests/security/PermissionCheckboxSetFieldTest.php
  243. +1 −1 tests/security/PermissionRoleTest.php
  244. +4 −4 tests/security/PermissionTest.php
  245. +8 −8 tests/security/SecurityTest.php
  246. +4 −4 tests/testing/YamlFixtureTest.php
  247. +1 −7 tests/travis/_config.php
  248. +22 −23 tests/view/SSViewerTest.php
  249. +3 −3 tests/view/ViewableDataTest.php
  250. +1 −1 view/Requirements.php
  251. +1 −1 view/SSTemplateParser.php
  252. +63 −25 view/SSViewer.php
  253. +5 −4 view/ViewableData.php
View
@@ -3,4 +3,6 @@ Name: coreconfig
---
Upload:
# Replace an existing file rather than renaming the new one.
- replaceFile: false
+ replaceFile: false
+MySQLDatabase:
+ connection_charset: utf8
@@ -8,15 +8,15 @@ class AdminRootController extends Controller {
* The url base that all LeftAndMain derived panels will live under
* Won't automatically update the base route if you change this - that has to be done seperately
*/
- static $url_base = 'admin';
+ private static $url_base = 'admin';
/**
* @var string
* @config
* The LeftAndMain child that will be used as the initial panel to display if none is selected (i.e. if you
* visit /admin)
*/
- static $default_panel = 'SecurityAdmin';
+ private static $default_panel = 'SecurityAdmin';
/**
* @var array
@@ -8,9 +8,10 @@
*/
class CMSBatchActionHandler extends RequestHandler {
- static $batch_actions = array();
+ /** @config */
+ private static $batch_actions = array();
- static $url_handlers = array(
+ private static $url_handlers = array(
'$BatchAction/applicablepages' => 'handleApplicablePages',
'$BatchAction/confirmation' => 'handleConfirmation',
'$BatchAction' => 'handleBatchAction',
@@ -40,9 +41,8 @@ class CMSBatchActionHandler extends RequestHandler {
*/
public static function register($urlSegment, $batchActionClass, $recordClass = 'SiteTree') {
if(is_subclass_of($batchActionClass, 'CMSBatchAction')) {
- self::$batch_actions[$urlSegment] = array(
- 'class' => $batchActionClass,
- 'recordClass' => $recordClass
+ Config::inst()->update('CMSBatchActionHandler', 'batch_actions',
+ array($urlSegment => array('class' => $batchActionClass, 'recordClass' => $recordClass))
);
} else {
user_error("CMSBatchActionHandler::register() - Bad class '$batchActionClass'", E_USER_ERROR);
View
@@ -219,7 +219,7 @@ public static function clear_menu() {
* {@link remove_menu_item}. Also used as a CSS-class for icon customization.
* @param string $menuTitle Localized title showing in the menu bar
* @param string $url A relative URL that will be linked in the menu bar.
- * Make sure to add a matching route via {@link Director::addRules()} to this url.
+ * Make sure to add a matching route via {@link Director::$rules} to this url.
* @param string $controllerClass The controller class for this menu, used to check permisssions.
* If blank, it's assumed that this is public, and always shown to users who
* have the rights to access some other part of the admin area.
@@ -1,12 +1,12 @@
<?php
class CMSProfileController extends LeftAndMain {
- static $url_segment = 'myprofile';
+ private static $url_segment = 'myprofile';
- static $menu_title = 'My Profile';
+ private static $menu_title = 'My Profile';
- static $required_permission_codes = false;
- static $tree_class = 'Member';
+ private static $required_permission_codes = false;
+ private static $tree_class = 'Member';
public function getResponseNegotiator() {
$neg = parent::getResponseNegotiator();
View
@@ -16,63 +16,72 @@ class LeftAndMain extends Controller implements PermissionProvider {
* Note that if this is changed, many javascript
* behaviours need to be updated with the correct url
*
+ * @config
* @var string $url_base
*/
- static $url_base = "admin";
+ private static $url_base = "admin";
/**
* The current url segment attached to the LeftAndMain instance
*
+ * @config
* @var string
*/
- static $url_segment;
+ private static $url_segment;
/**
+ * @config
* @var string
*/
- static $url_rule = '/$Action/$ID/$OtherID';
+ private static $url_rule = '/$Action/$ID/$OtherID';
/**
+ * @config
* @var string
*/
- static $menu_title;
+ private static $menu_title;
/**
+ * @config
* @var string
*/
- static $menu_icon;
+ private static $menu_icon;
/**
+ * @config
* @var int
*/
- static $menu_priority = 0;
+ private static $menu_priority = 0;
/**
+ * @config
* @var int
*/
- static $url_priority = 50;
+ private static $url_priority = 50;
/**
* A subclass of {@link DataObject}.
*
* Determines what is managed in this interface, through
* {@link getEditForm()} and other logic.
*
+ * @config
* @var string
*/
- static $tree_class = null;
+ private static $tree_class = null;
/**
* The url used for the link in the Help tab in the backend
- *
+ *
+ * @config
* @var string
*/
- static $help_link = 'http://3.0.userhelp.silverstripe.org';
+ private static $help_link = 'http://3.0.userhelp.silverstripe.org';
/**
* @var array
*/
- static $allowed_actions = array(
+ private static $allowed_actions = array(
'index',
'save',
'savetreenode',
@@ -88,34 +97,45 @@ class LeftAndMain extends Controller implements PermissionProvider {
);
/**
+ * @config
* @var Array Codes which are required from the current user to view this controller.
* If multiple codes are provided, all of them are required.
* All CMS controllers require "CMS_ACCESS_LeftAndMain" as a baseline check,
* and fall back to "CMS_ACCESS_<class>" if no permissions are defined here.
* See {@link canView()} for more details on permission checks.
*/
- static $required_permission_codes;
+ private static $required_permission_codes;
/**
+ * @config
* @var String Namespace for session info, e.g. current record.
* Defaults to the current class name, but can be amended to share a namespace in case
* controllers are logically bundled together, and mainly separated
* to achieve more flexible templating.
*/
- static $session_namespace;
+ private static $session_namespace;
/**
* Register additional requirements through the {@link Requirements} class.
* Used mainly to work around the missing "lazy loading" functionality
* for getting css/javascript required after an ajax-call (e.g. loading the editform).
*
- * @var array $extra_requirements
+ * @config
+ * @var array
*/
- protected static $extra_requirements = array(
- 'javascript' => array(),
- 'css' => array(),
- 'themedcss' => array(),
- );
+ private static $extra_requirements_javascript = array();
+
+ /**
+ * @config
+ * @var array See {@link extra_requirements_javascript}
+ */
+ private static $extra_requirements_css = array();
+
+ /**
+ * @config
+ * @var array See {@link extra_requirements_javascript}
+ */
+ private static $extra_requirements_themedCss = array();
/**
* @var PjaxResponseNegotiator
@@ -161,13 +181,13 @@ public function canView($member = null) {
public function init() {
parent::init();
- SSViewer::setOption('rewriteHashlinks', false);
+ Config::inst()->update('SSViewer', 'rewrite_hash_links', false);
// set language
$member = Member::currentUser();
if(!empty($member->Locale)) i18n::set_locale($member->Locale);
- if(!empty($member->DateFormat)) i18n::set_date_format($member->DateFormat);
- if(!empty($member->TimeFormat)) i18n::set_time_format($member->TimeFormat);
+ if(!empty($member->DateFormat)) i18n::config()->date_format = $member->DateFormat;
+ if(!empty($member->TimeFormat)) i18n::config()->time_format = $member->TimeFormat;
// can't be done in cms/_config.php as locale is not set yet
CMSMenu::add_link(
@@ -231,8 +251,8 @@ public function init() {
// Use theme from the site config
if(class_exists('SiteConfig') && ($config = SiteConfig::current_site_config()) && $config->Theme) {
$theme = $config->Theme;
- } elseif(SSViewer::current_theme()) {
- $theme = SSViewer::current_theme();
+ } elseif(Config::inst()->get('SSViewer', 'theme')) {
+ $theme = Config::inst()->get('SSViewer', 'theme');
} else {
$theme = false;
}
@@ -335,22 +355,26 @@ public function init() {
}
// Custom requirements
- foreach (self::$extra_requirements['javascript'] as $file) {
- Requirements::javascript($file[0]);
+ $extraJs = $this->stat('extra_requirements_javascript');
+
+ if($extraJs) foreach($extraJs as $file => $config) {
+ Requirements::javascript($file);
}
- foreach (self::$extra_requirements['css'] as $file) {
- Requirements::css($file[0], $file[1]);
+ $extraCss = $this->stat('extra_requirements_css');
+ if($extraCss) foreach($extraCss as $file => $config) {
+ Requirements::css($file, isset($config['media']) ? $config['media'] : null);
}
- foreach (self::$extra_requirements['themedcss'] as $file) {
- Requirements::themedCSS($file[0], $file[1]);
+ $extraThemedCss = $this->stat('extra_requirements_themedcss');
+ if($extraThemedCss) foreach ($extraThemedCss as $file => $config) {
+ Requirements::themedCSS($file, isset($config['media']) ? $config['media'] : null);
}
$dummy = null;
$this->extend('init', $dummy);
// The user's theme shouldn't affect the CMS, if, for example, they have replaced
// TableListField.ss or Form.ss.
- SSViewer::set_theme(null);
+ Config::inst()->update('SSViewer', 'theme', null);
}
public function handleRequest(SS_HTTPRequest $request, DataModel $model = null) {
@@ -430,11 +454,15 @@ public function ShowSwitchView() {
*/
public function Link($action = null) {
// Handle missing url_segments
- if(!$this->stat('url_segment', true)) self::$url_segment = $this->class;
+ if($this->config()->url_segment) {
+ $segment = $this->config()->get('url_segment', Config::FIRST_SET);
+ } else {
+ $segment = $this->class;
+ };
$link = Controller::join_links(
$this->stat('url_base', true),
- $this->stat('url_segment', true),
+ $segment,
'/', // trailing slash needed if $action is null!
"$action"
);
@@ -1441,39 +1469,43 @@ public function SiteConfig() {
* The href for the anchor on the Silverstripe logo.
* Set by calling LeftAndMain::set_application_link()
*
+ * @config
* @var String
*/
- static $application_link = 'http://www.silverstripe.org/';
+ private static $application_link = 'http://www.silverstripe.org/';
/**
* Sets the href for the anchor on the Silverstripe logo in the menu
*
* @param String $link
*/
public static function set_application_link($link) {
- self::$application_link = $link;
+ Deprecation::notice('3.2', 'Use the "LeftAndMain.application_link" config setting instead');
+ Config::inst()->update('LeftAndMain', 'application_link', $link);
}
/**
* @return String
*/
public function ApplicationLink() {
- return self::$application_link;
+ return $this->stat('application_link');
}
/**
* The application name. Customisable by calling
* LeftAndMain::setApplicationName() - the first parameter.
- *
+ *
+ * @config
* @var String
*/
- static $application_name = 'SilverStripe';
+ private static $application_name = 'SilverStripe';
/**
* @param String $name
*/
public static function setApplicationName($name) {
- self::$application_name = $name;
+ Deprecation::notice('3.2', 'Use the "LeftAndMain.application_name" config setting instead');
+ Config::inst()->update('LeftAndMain', 'application_name', $name);
}
/**
@@ -1482,7 +1514,7 @@ public static function setApplicationName($name) {
* @return string
*/
public function getApplicationName() {
- return self::$application_name;
+ return $this->stat('application_name');
}
/**
@@ -1571,7 +1603,8 @@ public function providePermissions() {
* Filenames should be relative to the base, eg, FRAMEWORK_DIR . '/javascript/loader.js'
*/
public static function require_javascript($file) {
- self::$extra_requirements['javascript'][] = array($file);
+ Deprecation::notice('3.2', 'Use "LeftAndMain.extra_requirements_javascript" config setting instead');
+ Config::inst()->update('LeftAndMain', 'extra_requirements_javascript', array($file => array()));
}
/**
@@ -1582,7 +1615,8 @@ public static function require_javascript($file) {
* @see http://www.w3.org/TR/REC-CSS2/media.html
*/
public static function require_css($file, $media = null) {
- self::$extra_requirements['css'][] = array($file, $media);
+ Deprecation::notice('3.2', 'Use "LeftAndMain.extra_requirements_css" config setting instead');
+ Config::inst()->update('LeftAndMain', 'extra_requirements_css', array($file => array('media' => $media)));
}
/**
@@ -1594,7 +1628,8 @@ public static function require_css($file, $media = null) {
* @param $media String Comma-separated list of media-types (e.g. "screen,projector")
*/
public static function require_themed_css($name, $media = null) {
- self::$extra_requirements['themedcss'][] = array($name, $media);
+ Deprecation::notice('3.2', 'Use "LeftAndMain.extra_requirements_css" config setting instead');
+ Config::inst()->update('LeftAndMain', 'extra_requirements_css', array($name => array('media' => $media)));
}
}
Oops, something went wrong.

0 comments on commit 3334eaf

Please sign in to comment.