Permalink
Browse files

FIX Remove instances of lines longer than 120c

The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit.  This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
  • Loading branch information...
1 parent 28bd939 commit 1f7fc1f76a0931bb0aae260346dd869bbba1bfd8 @sminnee sminnee committed Sep 26, 2012
Showing with 4,786 additions and 2,646 deletions.
  1. +12 −5 _register_database.php
  2. +21 −4 admin/_config.php
  3. +2 −1 admin/code/AdminRootController.php
  4. +6 −2 admin/code/CMSBatchActionHandler.php
  5. +2 −1 admin/code/CMSMenu.php
  6. +12 −9 admin/code/GroupImportForm.php
  7. +50 −24 admin/code/LeftAndMain.php
  8. +11 −8 admin/code/MemberImportForm.php
  9. +17 −6 admin/code/ModelAdmin.php
  10. +11 −5 admin/code/SecurityAdmin.php
  11. +27 −27 admin/javascript/LeftAndMain.FieldHelp.js
  12. +6 −3 admin/tests/CMSMenuTest.php
  13. +3 −2 admin/tests/LeftAndMainTest.php
  14. +8 −4 api/DataFormatter.php
  15. +15 −3 api/JSONDataFormatter.php
  16. +10 −4 api/RSSFeed.php
  17. +8 −3 api/RestfulService.php
  18. +2 −1 api/XMLDataFormatter.php
  19. +24 −12 cache/Cache.php
  20. +4 −2 cli-script.php
  21. +26 −12 conf/ConfigureFromEnv.php
  22. +13 −8 control/ContentNegotiator.php
  23. +24 −11 control/Controller.php
  24. +4 −2 control/Cookie.php
  25. +75 −45 control/Director.php
  26. +12 −6 control/HTTP.php
  27. +9 −6 control/HTTPRequest.php
  28. +2 −1 control/HTTPResponse.php
  29. +3 −1 control/PjaxResponseNegotiator.php
  30. +51 −29 control/RequestHandler.php
  31. +13 −8 control/Session.php
  32. +2 −1 control/injector/Injector.php
  33. +83 −45 core/Config.php
  34. +2 −1 core/Convert.php
  35. +11 −4 core/Core.php
  36. +14 −6 core/DAG.php
  37. +2 −1 core/Diff.php
  38. +39 −24 core/Object.php
  39. +57 −27 core/manifest/ConfigManifest.php
  40. +17 −8 core/manifest/TokenisedRegularExpression.php
  41. +5 −2 dev/Backtrace.php
  42. +2 −1 dev/CSSContentParser.php
  43. +8 −4 dev/Cli.php
  44. +12 −8 dev/CliTestReporter.php
  45. +6 −3 dev/CsvBulkLoader.php
  46. +23 −13 dev/Debug.php
  47. +2 −1 dev/DebugView.php
  48. +5 −2 dev/Deprecation.php
  49. +5 −3 dev/DevelopmentAdmin.php
  50. +27 −15 dev/FunctionalTest.php
  51. +6 −5 dev/JSTestRunner.php
  52. +2 −1 dev/LogErrorEmailFormatter.php
  53. +2 −1 dev/MigrationTask.php
  54. +4 −2 dev/Profiler.php
  55. +9 −3 dev/SapphireREPL.php
  56. +22 −10 dev/SapphireTest.php
  57. +16 −8 dev/SapphireTestReporter.php
  58. +4 −1 dev/TaskRunner.php
  59. +4 −2 dev/TeamCityListener.php
  60. +5 −2 dev/TestMailer.php
  61. +24 −13 dev/TestRunner.php
  62. +6 −3 dev/TestSession.php
  63. +10 −5 dev/YamlFixture.php
  64. +5 −2 dev/install/DatabaseAdapterRegistry.php
  65. +4 −1 dev/install/install.php
  66. +4 −2 dev/phpunit/PhpUnitWrapper_3_4.php
  67. +376 −376 docs/en/tutorials/_images/layout.css
  68. +30 −17 email/Email.php
  69. +36 −22 email/Mailer.php
  70. +19 −8 filesystem/File.php
  71. +2 −1 filesystem/Filesystem.php
  72. +21 −9 filesystem/Folder.php
  73. +7 −4 filesystem/GD.php
  74. +7 −3 filesystem/Upload.php
  75. +7 −3 forms/AjaxUniqueTextField.php
  76. +9 −4 forms/CheckboxSetField.php
  77. +30 −15 forms/ComplexTableField.php
  78. +7 −2 forms/CompositeField.php
  79. +11 −5 forms/ConfirmedPasswordField.php
  80. +4 −2 forms/CountryDropdownField.php
  81. +9 −5 forms/CreditCardField.php
  82. +9 −4 forms/CurrencyField.php
  83. +14 −7 forms/DateField.php
  84. +8 −4 forms/DatetimeField.php
  85. +9 −6 forms/DropdownField.php
  86. +2 −1 forms/EmailField.php
  87. +19 −10 forms/FieldList.php
  88. +2 −1 forms/FileIFrameField.php
  89. +37 −21 forms/Form.php
  90. +13 −7 forms/FormField.php
  91. +13 −4 forms/FormScaffolder.php
  92. +28 −12 forms/HasManyComplexTableField.php
  93. +13 −6 forms/HasOneComplexTableField.php
  94. +4 −3 forms/HeaderField.php
  95. +25 −12 forms/HtmlEditorConfig.php
  96. +66 −31 forms/HtmlEditorField.php
  97. +6 −3 forms/ImageField.php
  98. +8 −3 forms/ImageFormAction.php
  99. +6 −3 forms/InlineFormAction.php
  100. +5 −2 forms/ListboxField.php
  101. +11 −5 forms/ManyManyComplexTableField.php
  102. +44 −20 forms/MemberDatetimeOptionsetField.php
  103. +3 −1 forms/MoneyField.php
  104. +9 −4 forms/NullableField.php
  105. +4 −1 forms/PasswordField.php
  106. +3 −2 forms/PhoneNumberField.php
  107. +3 −1 forms/RequiredFields.php
  108. +2 −1 forms/SelectionGroup.php
  109. +8 −2 forms/SimpleImageField.php
  110. +2 −1 forms/TabSet.php
  111. +12 −8 forms/TableField.php
  112. +88 −30 forms/TableListField.php
  113. +3 −1 forms/TextareaField.php
  114. +23 −13 forms/TreeDropdownField.php
  115. +23 −8 forms/TreeMultiselectField.php
  116. +28 −15 forms/UploadField.php
  117. +8 −3 forms/Validator.php
  118. +51 −21 forms/gridfield/GridField.php
  119. +23 −10 forms/gridfield/GridFieldAddExistingAutocompleter.php
  120. +2 −1 forms/gridfield/GridFieldAddNewButton.php
  121. +2 −1 forms/gridfield/GridFieldDataColumns.php
  122. +6 −3 forms/gridfield/GridFieldDeleteAction.php
  123. +16 −7 forms/gridfield/GridFieldDetailForm.php
  124. +3 −1 forms/gridfield/GridFieldExportButton.php
  125. +4 −2 forms/gridfield/GridFieldFilterHeader.php
  126. +9 −4 forms/gridfield/GridFieldPaginator.php
  127. +3 −1 forms/gridfield/GridFieldPrintButton.php
  128. +11 −5 forms/gridfield/GridFieldSortableHeader.php
  129. +24 −13 i18n/i18n.php
  130. +25 −10 i18n/i18nTextCollector.php
  131. +16 −15 javascript/lang/nl_NL.js
  132. +6 −2 model/Aggregate.php
  133. +9 −4 model/ArrayList.php
  134. +2 −1 model/ComponentSet.php
  135. +5 −2 model/DB.php
  136. +4 −2 model/DataExtension.php
  137. +26 −14 model/DataList.php
  138. +131 −67 model/DataObject.php
  139. +2 −1 model/DataObjectDecorator.php
  140. +7 −6 model/DataObjectInterface.php
  141. +2 −1 model/DataObjectSet.php
  142. +23 −13 model/DataQuery.php
  143. +60 −29 model/Database.php
  144. +9 −4 model/DatabaseAdmin.php
  145. +4 −2 model/Filterable.php
  146. +3 −3 model/HTMLValue.php
  147. +9 −3 model/HasManyList.php
  148. +41 −17 model/Hierarchy.php
  149. +12 −6 model/Image.php
  150. +9 −3 model/ManyManyList.php
  151. +4 −2 model/Map.php
  152. +85 −34 model/MySQLDatabase.php
  153. +26 −11 model/SQLQuery.php
  154. +2 −2 model/Transliterator.php
  155. +3 −1 model/URLSegmentFilter.php
  156. +2 −1 model/ValidationResult.php
  157. +53 −20 model/Versioned.php
  158. +8 −1 model/fieldtypes/Boolean.php
  159. +4 −2 model/fieldtypes/CompositeDBField.php
  160. +13 −8 model/fieldtypes/DBField.php
  161. +2 −1 model/fieldtypes/Date.php
  162. +2 −1 model/fieldtypes/Datetime.php
  163. +6 −1 model/fieldtypes/Decimal.php
  164. +8 −3 model/fieldtypes/Enum.php
  165. +6 −1 model/fieldtypes/Float.php
  166. +21 −13 model/fieldtypes/HTMLText.php
  167. +7 −1 model/fieldtypes/Int.php
  168. +12 −5 model/fieldtypes/Money.php
  169. +15 −2 model/fieldtypes/MultiEnum.php
  170. +6 −4 model/fieldtypes/StringField.php
  171. +14 −5 model/fieldtypes/Text.php
  172. +2 −1 model/fieldtypes/Varchar.php
  173. +22 −16 oembed/Oembed.php
  174. +23 −14 parsers/ShortcodeParser.php
  175. +2 −1 search/FulltextSearchable.php
  176. +14 −4 search/SearchContext.php
  177. +7 −2 search/filters/SearchFilter.php
  178. +4 −1 security/ChangePasswordForm.php
  179. +18 −6 security/Group.php
  180. +2 −1 security/LoginForm.php
  181. +16 −6 security/Member.php
  182. +4 −1 security/MemberAuthenticator.php
  183. +4 −2 security/MemberLoginForm.php
  184. +11 −5 security/PasswordEncryptor.php
  185. +22 −4 security/PasswordValidator.php
  186. +7 −5 security/Permission.php
  187. +27 −14 security/PermissionCheckboxSetField.php
  188. +2 −1 security/PermissionProvider.php
  189. +38 −15 security/Security.php
  190. +3 −1 tasks/EncryptAllPasswordsTask.php
  191. +4 −4 tasks/ScheduledTask.php
  192. +3 −1 tests/FakeController.php
  193. +5 −3 tests/PhpSyntaxTest.php
  194. +2 −1 tests/api/RSSFeedTest.php
  195. +4 −2 tests/api/XMLDataFormatterTest.php
  196. +24 −13 tests/control/ControllerTest.php
  197. +14 −7 tests/control/DirectorTest.php
  198. +2 −1 tests/control/HTTPTest.php
  199. +12 −8 tests/control/RequestHandlingTest.php
  200. +30 −15 tests/core/ConfigTest.php
  201. +30 −15 tests/core/ConvertTest.php
  202. +6 −3 tests/core/CoreTest.php
  203. +24 −12 tests/core/ObjectTest.php
  204. +4 −2 tests/core/manifest/ConfigManifestTest.php
  205. +3 −1 tests/core/manifest/NamespacedClassManifestTest.php
  206. +8 −4 tests/dev/CSVParserTest.php
  207. +12 −6 tests/dev/CsvBulkLoaderTest.php
  208. +51 −23 tests/filesystem/FileTest.php
  209. +15 −7 tests/filesystem/FolderTest.php
  210. +6 −3 tests/forms/CheckboxFieldTest.php
  211. +1 −1 tests/forms/CheckboxSetFieldTest.php
  212. +4 −2 tests/forms/ComplexTableFieldTest.php
  213. +8 −4 tests/forms/ConfirmedPasswordFieldTest.php
  214. +4 −2 tests/forms/DatetimeFieldTest.php
  215. +4 −2 tests/forms/DropdownFieldTest.php
  216. +13 −3 tests/forms/EmailFieldTest.php
  217. +4 −3 tests/forms/FieldListTest.php
  218. +6 −6 tests/forms/FormFieldTest.php
  219. +18 −9 tests/forms/FormScaffolderTest.php
  220. +4 −2 tests/forms/FormTest.php
  221. +16 −8 tests/forms/GridFieldTest.php
  222. +2 −1 tests/forms/ListboxFieldTest.php
  223. +4 −3 tests/forms/LookupFieldTest.php
  224. +8 −4 tests/forms/MemberDatetimeOptionsetFieldTest.php
  225. +64 −33 tests/forms/RequirementsTest.php
  226. +2 −1 tests/forms/TableListFieldTest.php
  227. +2 −1 tests/forms/TextareaFieldTest.php
  228. +4 −2 tests/forms/gridfield/GridFieldAddExistingAutocompleterTest.php
  229. +2 −1 tests/forms/gridfield/GridFieldDataColumnsTest.php
  230. +16 −8 tests/forms/gridfield/GridFieldDeleteActionTest.php
  231. +10 −5 tests/forms/gridfield/GridFieldDetailFormTest.php
  232. +2 −1 tests/forms/gridfield/GridFieldEditButtonTest.php
  233. +2 −1 tests/forms/gridfield/GridFieldPaginatorTest.php
  234. +33 −14 tests/forms/uploadfield/UploadFieldTest.php
  235. +12 −6 tests/i18n/i18nTest.php
  236. +26 −16 tests/i18n/i18nTextCollectorTest.php
  237. +6 −3 tests/injector/InjectorTest.php
  238. +2 −1 tests/model/ArrayListTest.php
  239. +2 −1 tests/model/CurrencyTest.php
  240. +4 −2 tests/model/DataDifferencerTest.php
  241. +4 −2 tests/model/DataExtensionTest.php
  242. +44 −13 tests/model/DataListTest.php
  243. +15 −8 tests/model/DataObjectDuplicationTest.php
  244. +10 −6 tests/model/DataObjectLazyLoadingTest.php
  245. +2 −1 tests/model/DataObjectSchemaGenerationTest.php
  246. +131 −69 tests/model/DataObjectTest.php
  247. +16 −8 tests/model/DataQueryTest.php
  248. +8 −4 tests/model/DatabaseTest.php
  249. +17 −8 tests/model/DbDatetimeTest.php
  250. +8 −4 tests/model/DecimalTest.php
  251. +10 −5 tests/model/HTMLTextTest.php
  252. +7 −3 tests/model/ImageTest.php
  253. +32 −16 tests/model/ManyManyListTest.php
  254. +2 −1 tests/model/MoneyTest.php
  255. +2 −1 tests/model/PaginatedListTest.php
  256. +17 −6 tests/model/SQLQueryTest.php
  257. +6 −3 tests/model/TextTest.php
  258. +46 −23 tests/model/VersionedTest.php
  259. +11 −4 tests/oembed/OembedTest.php
  260. +12 −6 tests/parsers/ShortcodeParserTest.php
  261. +3 −1 tests/search/FulltextSearchableTest.php
  262. +10 −5 tests/search/SearchFilterApplyRelationTest.php
  263. +8 −4 tests/security/GroupTest.php
  264. +2 −1 tests/security/MemberAuthenticatorTest.php
  265. +10 −5 tests/security/MemberTest.php
  266. +18 −9 tests/security/PasswordEncryptorTest.php
  267. +24 −12 tests/security/PermissionCheckboxSetFieldTest.php
  268. +4 −2 tests/security/PermissionRoleTest.php
  269. +13 −7 tests/security/SecurityTest.php
  270. +2 −1 tests/testing/CSSContentParserTest.php
  271. +4 −2 tests/testing/YamlFixtureTest.php
  272. +21 −21 tests/travis/_config.php
  273. +40 −20 tests/view/SSViewerCacheBlockTest.php
  274. +103 −54 tests/view/SSViewerTest.php
  275. +6 −5 tests/view/ViewableDataTest.php
  276. +2 −1 view/GenericTemplateGlobalProvider.php
  277. +28 −16 view/Requirements.php
  278. +209 −189 view/SSTemplateParser.php
  279. +111 −79 view/SSTemplateParser.php.inc
  280. +59 −24 view/SSViewer.php
  281. +4 −3 view/TemplateGlobalProvider.php
  282. +7 −7 view/TemplateIteratorProvider.php
@@ -18,7 +18,9 @@
'title' => 'SQL Server 2008',
'helperPath' => 'mssql/code/MSSQLDatabaseConfigurationHelper.php',
'supported' => (function_exists('mssql_connect') || function_exists('sqlsrv_connect')),
- 'missingExtensionText' => 'Neither the <a href="http://php.net/mssql">mssql</a> or <a href="http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx">sqlsrv</a> PHP extensions are available. Please install or enable one of them and refresh this page.'
+ 'missingExtensionText' => 'Neither the <a href="http://php.net/mssql">mssql</a> or'
+ . ' <a href="http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx">sqlsrv</a> PHP extensions are'
+ . ' available. Please install or enable one of them and refresh this page.'
)
);
@@ -28,7 +30,8 @@
'title' => 'PostgreSQL 8.3+',
'helperPath' => 'postgresql/code/PostgreSQLDatabaseConfigurationHelper.php',
'supported' => function_exists('pg_query'),
- 'missingExtensionText' => 'The <a href="http://php.net/pgsql">pgsql</a> PHP extension is not available. Please install or enable it and refresh this page.'
+ 'missingExtensionText' => 'The <a href="http://php.net/pgsql">pgsql</a> PHP extension is not available. Please'
+ . ' install or enable it and refresh this page.'
)
);
@@ -38,11 +41,15 @@
'title' => 'SQLite 3.3+',
'helperPath' => 'sqlite3/code/SQLiteDatabaseConfigurationHelper.php',
'supported' => (class_exists('SQLite3') || class_exists('PDO')),
- 'missingExtensionText' => 'The <a href="http://php.net/manual/en/book.sqlite3.php">SQLite3</a> and <a href="http://php.net/manual/en/book.pdo.php">PDO</a> classes are not available. Please install or enable one of them and refresh this page.',
+ 'missingExtensionText' => 'The <a href="http://php.net/manual/en/book.sqlite3.php">SQLite3</a> and'
+ . ' <a href="http://php.net/manual/en/book.pdo.php">PDO</a> classes are not available. Please install or'
+ . ' enable one of them and refresh this page.',
'fields' => array(
'path' => array(
- 'title' => 'Database path<br /><small>Absolute path, writeable by the webserver user.<br />Recommended to be outside of your webroot</small>',
- 'default' => realpath(dirname($_SERVER['SCRIPT_FILENAME'])) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . '.db'
+ 'title' => 'Database path<br /><small>Absolute path, writeable by the webserver user.<br />'
+ . 'Recommended to be outside of your webroot</small>',
+ 'default' => realpath(dirname($_SERVER['SCRIPT_FILENAME'])) . DIRECTORY_SEPARATOR . 'assets'
+ . DIRECTORY_SEPARATOR . '.db'
),
'database' => array(
'title' => 'Database name',
View
@@ -11,16 +11,33 @@
'cleanup_callback' => "sapphiremce_cleanup",
'use_native_selects' => true, // fancy selects are bug as of SS 2.3.0
- 'valid_elements' => "@[id|class|style|title],#a[id|rel|rev|dir|tabindex|accesskey|type|name|href|target|title|class],-strong/-b[class],-em/-i[class],-strike[class],-u[class],#p[id|dir|class|align|style],-ol[class],-ul[class],-li[class],br,img[id|dir|longdesc|usemap|class|src|border|alt=|title|width|height|align],-sub[class],-sup[class],-blockquote[dir|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|dir|id|style],-tr[id|dir|class|rowspan|width|height|align|valign|bgcolor|background|bordercolor|style],tbody[id|class|style],thead[id|class|style],tfoot[id|class|style],#td[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],-th[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],caption[id|dir|class],-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align],address[class|align],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|dir|class|align|style],hr[class],dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir],@[id,style,class]",
- 'extended_valid_elements' => "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap],iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]",
+ 'valid_elements' => "@[id|class|style|title],#a[id|rel|rev|dir|tabindex|accesskey|type|name|href|target|title"
+ . "|class],-strong/-b[class],-em/-i[class],-strike[class],-u[class],#p[id|dir|class|align|style],-ol[class],"
+ . "-ul[class],-li[class],br,img[id|dir|longdesc|usemap|class|src|border|alt=|title|width|height|align],"
+ . "-sub[class],-sup[class],-blockquote[dir|class],"
+ . "-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|dir|id|style],"
+ . "-tr[id|dir|class|rowspan|width|height|align|valign|bgcolor|background|bordercolor|style],"
+ . "tbody[id|class|style],thead[id|class|style],tfoot[id|class|style],"
+ . "#td[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],"
+ . "-th[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],caption[id|dir|class],"
+ . "-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align],address[class|align],"
+ . "-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],"
+ . "-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|dir|class|align|style],hr[class],"
+ . "dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir],@[id,style,class]",
+ 'extended_valid_elements' => "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name"
+ . "|usemap],iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],"
+ . "object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]",
'spellchecker_rpc_url' => THIRDPARTY_DIR . '/tinymce-spellchecker/rpc.php'
));
HtmlEditorConfig::get('cms')->enablePlugins('media', 'fullscreen', 'inlinepopups');
-HtmlEditorConfig::get('cms')->enablePlugins(array('ssbuttons' => sprintf('../../../%s/tinymce_ssbuttons/editor_plugin_src.js', THIRDPARTY_DIR)));
+HtmlEditorConfig::get('cms')->enablePlugins(array(
+ 'ssbuttons' => sprintf('../../../%s/tinymce_ssbuttons/editor_plugin_src.js', THIRDPARTY_DIR)
+));
HtmlEditorConfig::get('cms')->insertButtonsBefore('formatselect', 'styleselect');
-HtmlEditorConfig::get('cms')->addButtonsToLine(2, 'ssmedia', 'ssflash', 'sslink', 'unlink', 'anchor', 'separator','code', 'fullscreen', 'separator');
+HtmlEditorConfig::get('cms')->addButtonsToLine(2,
+ 'ssmedia', 'ssflash', 'sslink', 'unlink', 'anchor', 'separator','code', 'fullscreen', 'separator');
HtmlEditorConfig::get('cms')->removeButtons('tablecontrols');
HtmlEditorConfig::get('cms')->addButtonsToLine(3, 'tablecontrols');
@@ -13,7 +13,8 @@ class AdminRootController extends Controller {
/**
* @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)
+ * 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';
@@ -85,7 +85,9 @@ public function handleAction($request) {
foreach($ids as $k => $v) if(!is_numeric($v)) unset($ids[$k]);
if($ids) {
- if(class_exists('Translatable') && Object::has_extension('SiteTree','Translatable')) Translatable::disable_locale_filter();
+ if(class_exists('Translatable') && Object::has_extension('SiteTree','Translatable')) {
+ Translatable::disable_locale_filter();
+ }
$pages = DataObject::get(
$this->recordClass,
@@ -96,7 +98,9 @@ public function handleAction($request) {
)
);
- if(class_exists('Translatable') && Object::has_extension('SiteTree','Translatable')) Translatable::enable_locale_filter();
+ if(class_exists('Translatable') && Object::has_extension('SiteTree','Translatable')) {
+ Translatable::enable_locale_filter();
+ }
if(Object::has_extension($this->recordClass, 'Versioned')) {
// If we didn't query all the pages, then find the rest on the live site
@@ -77,7 +77,8 @@ protected static function menuitem_for_controller($controllerClass) {
* @param string $code A unique identifier (used to create a CSS ID and its key in {@link $menu_items})
* @param string $menuTitle The link's title in the CMS menu
* @param string $url The url of the link
- * @param integer $priority The menu priority (sorting order) of the menu item. Higher priorities will be further left.
+ * @param integer $priority The menu priority (sorting order) of the menu item. Higher priorities will be further
+ * left.
* @return boolean The result of the operation.
*/
public static function add_link($code, $menuTitle, $url, $priority = -1) {
@@ -17,17 +17,20 @@ public function __construct($controller, $name, $fields = null, $actions = null,
if(!$fields) {
$helpHtml = _t(
'GroupImportForm.Help1',
- '<p>Import one or more groups in <em>CSV</em> format (comma-separated values). <small><a href="#" class="toggle-advanced">Show advanced usage</a></small></p>'
+ '<p>Import one or more groups in <em>CSV</em> format (comma-separated values).'
+ . ' <small><a href="#" class="toggle-advanced">Show advanced usage</a></small></p>'
);
$helpHtml .= _t(
'GroupImportForm.Help2',
'<div class="advanced">
<h4>Advanced usage</h4>
<ul>
<li>Allowed columns: <em>%s</em></li>
- <li>Existing groups are matched by their unique <em>Code</em> value, and updated with any new values from the imported file</li>
+ <li>Existing groups are matched by their unique <em>Code</em> value, and updated with any new values from the
+ imported file</li>
<li>Group hierarchies can be created by using a <em>ParentCode</em> column.</li>
- <li>Permission codes can be assigned by the <em>PermissionCode</em> column. Existing permission codes are not cleared.</li>
+ <li>Permission codes can be assigned by the <em>PermissionCode</em> column. Existing permission codes are not
+ cleared.</li>
</ul>
</div>');
@@ -48,12 +51,12 @@ public function __construct($controller, $name, $fields = null, $actions = null,
$fileField->getValidator()->setAllowedExtensions(array('csv'));
}
- if(!$actions) $actions = new FieldList(
- $importAction = new FormAction('doImport', _t('SecurityAdmin_MemberImportForm.BtnImport', 'Import from CSV'))
- );
-
- $importAction->addExtraClass('ss-ui-button');
-
+ if(!$actions) {
+ $action = new FormAction('doImport', _t('SecurityAdmin_MemberImportForm.BtnImport', 'Import from CSV'));
+ $action->addExtraClass('ss-ui-button');
+ $actions = new FieldList($action);
+ }
+
if(!$validator) $validator = new RequiredFields('CsvFile');
parent::__construct($controller, $name, $fields, $actions, $validator);
@@ -200,9 +200,14 @@ public function init() {
// if no alternate menu items have matched, return a permission error
$messageSet = array(
- 'default' => _t('LeftAndMain.PERMDEFAULT',"Please choose an authentication method and enter your credentials to access the CMS."),
- 'alreadyLoggedIn' => _t('LeftAndMain.PERMALREADY',"I'm sorry, but you can't access that part of the CMS. If you want to log in as someone else, do so below"),
- 'logInAgain' => _t('LeftAndMain.PERMAGAIN',"You have been logged out of the CMS. If you would like to log in again, enter a username and password below."),
+ 'default' => _t('LeftAndMain.PERMDEFAULT',
+ "Please choose an authentication method and enter your credentials to access the CMS."),
+ 'alreadyLoggedIn' => _t('LeftAndMain.PERMALREADY',
+ "I'm sorry, but you can't access that part of the CMS. If you want to log in as someone else, do"
+ . " so below"),
+ 'logInAgain' => _t('LeftAndMain.PERMAGAIN',
+ "You have been logged out of the CMS. If you would like to log in again, enter a username and"
+ . " password below."),
);
return Security::permissionFailure($this, $messageSet);
@@ -683,7 +688,9 @@ public function SiteTreeAsUL() {
* Children, AllChildrenIncludingDeleted, or AllHistoricalChildren
* @return String Nested unordered list with links to each page
*/
- public function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $numChildrenMethod = null, $filterFunction = null, $minNodeCount = 30) {
+ public function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $numChildrenMethod = null,
+ $filterFunction = null, $minNodeCount = 30) {
+
// Filter criteria
$params = $this->request->getVar('q');
if(isset($params['FilterClass']) && $filterClass = $params['FilterClass']){
@@ -696,7 +703,10 @@ public function getSiteTreeFor($className, $rootID = null, $childrenMethod = nul
}
// Default childrenMethod and numChildrenMethod
- if(!$childrenMethod) $childrenMethod = ($filter && $filter->getChildrenMethod()) ? $filter->getChildrenMethod() : 'AllChildrenIncludingDeleted';
+ if(!$childrenMethod) $childrenMethod = ($filter && $filter->getChildrenMethod())
+ ? $filter->getChildrenMethod()
+ : 'AllChildrenIncludingDeleted';
+
if(!$numChildrenMethod) $numChildrenMethod = 'numChildren';
if(!$filterFunction) $filterFunction = ($filter) ? array($filter, 'isPageIncluded') : null;
@@ -714,7 +724,8 @@ public function getSiteTreeFor($className, $rootID = null, $childrenMethod = nul
// NOTE: SiteTree/CMSMain coupling :-(
if(class_exists('SiteTree')) {
- SiteTree::prepopulate_permission_cache('CanEditType', $obj->markedNodeIDs(), 'SiteTree::can_edit_multiple');
+ SiteTree::prepopulate_permission_cache('CanEditType', $obj->markedNodeIDs(),
+ 'SiteTree::can_edit_multiple');
}
// getChildrenAsUL is a flexible and complex way of traversing the tree
@@ -789,20 +800,31 @@ public function updatetreenodes($request) {
$ids = explode(',', $request->getVar('ids'));
foreach($ids as $id) {
$record = $this->getRecord($id);
- $recordController = ($this->stat('tree_class') == 'SiteTree') ? singleton('CMSPageEditController') : $this;
+ $recordController = ($this->stat('tree_class') == 'SiteTree')
+ ? singleton('CMSPageEditController')
+ : $this;
// Find the next & previous nodes, for proper positioning (Sort isn't good enough - it's not a raw offset)
// TODO: These methods should really be in hierarchy - for a start it assumes Sort exists
$next = $prev = null;
$className = $this->stat('tree_class');
- $next = DataObject::get($className)->filter('ParentID', $record->ParentID)->filter('Sort:GreaterThan', $record->Sort)->first();
+ $next = DataObject::get($className)
+ ->filter('ParentID', $record->ParentID)
+ ->filter('Sort:GreaterThan', $record->Sort)
+ ->first();
+
if (!$next) {
- $prev = DataObject::get($className)->filter('ParentID', $record->ParentID)->filter('Sort:LessThan', $record->Sort)->reverse()->first();
+ $prev = DataObject::get($className)
+ ->filter('ParentID', $record->ParentID)
+ ->filter('Sort:LessThan', $record->Sort)
+ ->reverse()
+ ->first();
}
$link = Controller::join_links($recordController->Link("show"), $record->ID);
- $html = LeftAndMain_TreeNode::create($record, $link, $this->isCurrentPage($record))->forTemplate() . '</li>';
+ $html = LeftAndMain_TreeNode::create($record, $link, $this->isCurrentPage($record))
+ ->forTemplate() . '</li>';
$data[$id] = array(
'html' => $html,
@@ -874,7 +896,8 @@ public function savetreenode($request) {
if (!Permission::check('SITETREE_REORGANISE') && !Permission::check('ADMIN')) {
$this->response->setStatusCode(
403,
- _t('LeftAndMain.CANT_REORGANISE',"You do not have permission to rearange the site tree. Your change was not saved.")
+ _t('LeftAndMain.CANT_REORGANISE',
+ "You do not have permission to rearange the site tree. Your change was not saved.")
);
return;
}
@@ -889,7 +912,8 @@ public function savetreenode($request) {
if(($parentID == '0' || $root == 'root') && !SiteConfig::current_site_config()->canCreateTopLevel()){
$this->response->setStatusCode(
403,
- _t('LeftAndMain.CANT_REORGANISE',"You do not have permission to alter Top level pages. Your change was not saved.")
+ _t('LeftAndMain.CANT_REORGANISE',
+ "You do not have permission to alter Top level pages. Your change was not saved.")
);
return;
}
@@ -905,8 +929,7 @@ public function savetreenode($request) {
if(!$node) {
$this->response->setStatusCode(
500,
- _t(
- 'LeftAndMain.PLEASESAVE',
+ _t('LeftAndMain.PLEASESAVE',
"Please Save Page: This page could not be upated because it hasn't been saved yet."
)
);
@@ -933,7 +956,8 @@ public function savetreenode($request) {
}
}
- $this->response->addHeader('X-Status', rawurlencode(_t('LeftAndMain.REORGANISATIONSUCCESSFUL', 'Reorganised the site tree successfully.')));
+ $this->response->addHeader('X-Status',
+ rawurlencode(_t('LeftAndMain.REORGANISATIONSUCCESSFUL', 'Reorganised the site tree successfully.')));
}
// Update sorting
@@ -950,11 +974,13 @@ public function savetreenode($request) {
// Nodes that weren't "actually moved" shouldn't be registered as
// having been edited; do a direct SQL update instead
++$counter;
- DB::query(sprintf("UPDATE \"%s\" SET \"Sort\" = %d WHERE \"ID\" = '%d'", $className, $counter, $id));
+ DB::query(sprintf("UPDATE \"%s\" SET \"Sort\" = %d WHERE \"ID\" = '%d'",
+ $className, $counter, $id));
}
}
- $this->response->addHeader('X-Status', rawurlencode(_t('LeftAndMain.REORGANISATIONSUCCESSFUL', 'Reorganised the site tree successfully.')));
+ $this->response->addHeader('X-Status',
+ rawurlencode(_t('LeftAndMain.REORGANISATIONSUCCESSFUL', 'Reorganised the site tree successfully.')));
}
return Convert::raw2json($statusUpdates);
@@ -1527,7 +1553,8 @@ public function __construct($params = null) {
// We need to recurse up the tree,
// finding ParentIDs for each ID until we run out of parents
while (!empty($parents)) {
- $res = DB::query('SELECT "ParentID", "ID" FROM "SiteTree" WHERE "ID" in ('.implode(',',array_keys($parents)).')');
+ $res = DB::query('SELECT "ParentID", "ID" FROM "SiteTree"'
+ . ' WHERE "ID" in ('.implode(',',array_keys($parents)).')');
$parents = array();
foreach($res as $row) {
@@ -1623,12 +1650,11 @@ public function __construct($obj, $link = null, $isCurrent = false) {
*/
public function forTemplate() {
$obj = $this->obj;
- return "<li id=\"record-$obj->ID\" data-id=\"$obj->ID\" data-pagetype=\"$obj->ClassName\" class=\"" . $this->getClasses() . "\">" .
- "<ins class=\"jstree-icon\">&nbsp;</ins>" .
- "<a href=\"" . $this->getLink() . "\" title=\"" .
- _t('LeftAndMain.PAGETYPE','Page type: ') .
- "$obj->class\" ><ins class=\"jstree-icon\">&nbsp;</ins><span class=\"text\">" . ($obj->TreeTitle).
- "</span></a>";
+ return "<li id=\"record-$obj->ID\" data-id=\"$obj->ID\" data-pagetype=\"$obj->ClassName\" class=\""
+ . $this->getClasses() . "\">" . "<ins class=\"jstree-icon\">&nbsp;</ins>"
+ . "<a href=\"" . $this->getLink() . "\" title=\"" . _t('LeftAndMain.PAGETYPE','Page type: ')
+ . "$obj->class\" ><ins class=\"jstree-icon\">&nbsp;</ins><span class=\"text\">" . ($obj->TreeTitle)
+ . "</span></a>";
}
public function getClasses() {
Oops, something went wrong.

0 comments on commit 1f7fc1f

Please sign in to comment.