Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

# [#29979] Codestyle pass 1. Thanks Elin.

  • Loading branch information...
commit 77ca11f76a2f76d254d7fe317132bba98ea68397 1 parent 3e54c05
@elinw elinw authored infograf768 committed
Showing with 4,036 additions and 2,629 deletions.
  1. +15 −12 administrator/components/com_admin/controllers/profile.php
  2. +18 −12 administrator/components/com_admin/helpers/html/directory.php
  3. +22 −14 administrator/components/com_admin/helpers/html/phpsetting.php
  4. +6 −4 administrator/components/com_admin/helpers/html/system.php
  5. +47 −16 administrator/components/com_admin/models/help.php
  6. +28 −16 administrator/components/com_admin/models/profile.php
  7. +52 −19 administrator/components/com_admin/models/sysinfo.php
  8. +16 −9 administrator/components/com_admin/script.php
  9. +1 −1  administrator/components/com_admin/views/help/view.html.php
  10. +4 −3 administrator/components/com_admin/views/profile/tmpl/edit.php
  11. +3 −2 administrator/components/com_admin/views/profile/view.html.php
  12. +1 −1  administrator/components/com_admin/views/sysinfo/tmpl/default_directory.php
  13. +3 −2 administrator/components/com_admin/views/sysinfo/view.html.php
  14. +4 −4 administrator/components/com_banners/controller.php
  15. +1 −1  administrator/components/com_banners/controllers/banner.php
  16. +15 −10 administrator/components/com_banners/controllers/banners.php
  17. +1 −1  administrator/components/com_banners/controllers/client.php
  18. +1 −1  administrator/components/com_banners/controllers/clients.php
  19. +8 −5 administrator/components/com_banners/controllers/tracks.php
  20. +11 −10 administrator/components/com_banners/controllers/tracks.raw.php
  21. +25 −16 administrator/components/com_banners/helpers/banners.php
  22. +2 −2 administrator/components/com_banners/helpers/html/banner.php
  23. +7 −4 administrator/components/com_banners/models/banner.php
  24. +34 −24 administrator/components/com_banners/models/banners.php
  25. +33 −26 administrator/components/com_banners/models/client.php
  26. +16 −11 administrator/components/com_banners/models/clients.php
  27. +9 −8 administrator/components/com_banners/models/download.php
  28. +3 −3 administrator/components/com_banners/models/fields/bannerclient.php
  29. +3 −3 administrator/components/com_banners/models/fields/clicks.php
  30. +3 −3 administrator/components/com_banners/models/fields/impmade.php
  31. +3 −3 administrator/components/com_banners/models/fields/imptotal.php
  32. +5 −4 administrator/components/com_banners/models/fields/ordering.php
  33. +83 −50 administrator/components/com_banners/models/tracks.php
  34. +32 −24 administrator/components/com_banners/tables/banner.php
  35. +14 −10 administrator/components/com_banners/tables/client.php
  36. +13 −8 administrator/components/com_banners/views/banner/tmpl/edit.php
  37. +13 −7 administrator/components/com_banners/views/banner/view.html.php
  38. +7 −3 administrator/components/com_banners/views/banners/tmpl/default.php
  39. +4 −3 administrator/components/com_banners/views/client/tmpl/edit.php
  40. +12 −6 administrator/components/com_banners/views/client/view.html.php
  41. +7 −3 administrator/components/com_banners/views/clients/tmpl/default.php
  42. +15 −8 administrator/components/com_banners/views/clients/view.html.php
  43. +1 −1  administrator/components/com_banners/views/download/tmpl/default.php
  44. +2 −1  administrator/components/com_banners/views/download/view.html.php
  45. +7 −3 administrator/components/com_banners/views/tracks/tmpl/default.php
  46. +7 −4 administrator/components/com_banners/views/tracks/view.html.php
  47. +2 −1  administrator/components/com_banners/views/tracks/view.raw.php
  48. +11 −7 administrator/components/com_cache/controller.php
  49. +4 −4 administrator/components/com_cache/helpers/cache.php
  50. +17 −10 administrator/components/com_cache/models/cache.php
  51. +5 −3 administrator/components/com_cache/views/cache/view.html.php
  52. +3 −2 administrator/components/com_cache/views/purge/view.html.php
  53. +13 −10 administrator/components/com_categories/controller.php
  54. +21 −14 administrator/components/com_categories/controllers/categories.php
  55. +1 −1  administrator/components/com_categories/controllers/category.php
  56. +7 −7 administrator/components/com_categories/helpers/categories.php
  57. +1 −1  administrator/components/com_categories/helpers/html/categoriesadministrator.php
  58. +11 −11 administrator/components/com_categories/models/categories.php
  59. +3 −3 administrator/components/com_categories/models/category.php
  60. +5 −4 administrator/components/com_categories/models/fields/categoryedit.php
  61. +13 −8 administrator/components/com_categories/models/fields/categoryparent.php
  62. +7 −3 administrator/components/com_categories/views/categories/tmpl/default.php
  63. +5 −3 administrator/components/com_categories/views/categories/view.html.php
  64. +2 −1  administrator/components/com_categories/views/category/tmpl/edit.php
  65. +1 −1  administrator/components/com_categories/views/category/tmpl/edit_metadata.php
  66. +27 −14 administrator/components/com_categories/views/category/view.html.php
  67. +7 −5 administrator/components/com_checkin/controller.php
  68. +22 −15 administrator/components/com_checkin/models/checkin.php
  69. +5 −3 administrator/components/com_checkin/views/checkin/view.html.php
  70. +11 −8 administrator/components/com_config/controller.php
  71. +22 −14 administrator/components/com_config/controllers/application.php
  72. +9 −6 administrator/components/com_config/controllers/component.php
  73. +2 −1  administrator/components/com_config/helper/component.php
  74. +14 −13 administrator/components/com_config/models/application.php
  75. +31 −21 administrator/components/com_config/models/component.php
  76. +9 −7 administrator/components/com_config/models/fields/filters.php
  77. +4 −2 administrator/components/com_config/views/application/tmpl/default.php
  78. +1 −1  administrator/components/com_config/views/application/tmpl/default_navigation.php
  79. +5 −3 administrator/components/com_config/views/application/view.html.php
  80. +2 −1  administrator/components/com_config/views/component/tmpl/default.php
  81. +1 −1  administrator/components/com_config/views/component/tmpl/default_navigation.php
  82. +4 −2 administrator/components/com_config/views/component/view.html.php
  83. +5 −5 administrator/components/com_contact/controller.php
  84. +1 −1  administrator/components/com_contact/controllers/contact.php
  85. +19 −14 administrator/components/com_contact/controllers/contacts.php
  86. +19 −13 administrator/components/com_contact/helpers/contact.php
  87. +14 −10 administrator/components/com_contact/helpers/html/contact.php
  88. +69 −51 administrator/components/com_contact/models/contact.php
  89. +33 −21 administrator/components/com_contact/models/contacts.php
  90. +7 −5 administrator/components/com_contact/models/fields/modal/contacts.php
  91. +5 −4 administrator/components/com_contact/models/fields/ordering.php
  92. +62 −29 administrator/components/com_contact/tables/contact.php
  93. +2 −1  administrator/components/com_contact/views/contact/tmpl/edit.php
  94. +17 −9 administrator/components/com_contact/views/contact/view.html.php
  95. +7 −3 administrator/components/com_contact/views/contacts/tmpl/default.php
  96. +18 −10 administrator/components/com_contact/views/contacts/view.html.php
  97. +7 −6 administrator/components/com_content/controller.php
  98. +2 −2 administrator/components/com_content/controllers/article.php
  99. +18 −14 administrator/components/com_content/controllers/articles.php
  100. +8 −5 administrator/components/com_content/controllers/featured.php
  101. +55 −31 administrator/components/com_content/helpers/content.php
  102. +11 −7 administrator/components/com_content/helpers/html/contentadministrator.php
  103. +86 −60 administrator/components/com_content/models/article.php
  104. +47 −30 administrator/components/com_content/models/articles.php
  105. +7 −7 administrator/components/com_content/models/feature.php
  106. +24 −14 administrator/components/com_content/models/featured.php
  107. +12 −7 administrator/components/com_content/models/fields/modal/article.php
  108. +6 −4 administrator/components/com_content/views/article/tmpl/edit.php
  109. +1 −1  administrator/components/com_content/views/article/tmpl/edit_metadata.php
  110. +17 −9 administrator/components/com_content/views/article/view.html.php
  111. +7 −3 administrator/components/com_content/views/articles/tmpl/default.php
  112. +8 −4 administrator/components/com_content/views/articles/tmpl/modal.php
  113. +18 −10 administrator/components/com_content/views/articles/view.html.php
  114. +15 −8 administrator/components/com_content/views/featured/view.html.php
  115. +2 −1  administrator/components/com_cpanel/views/cpanel/tmpl/default.php
  116. +1 −1  administrator/components/com_finder/controller.php
  117. +2 −1  administrator/components/com_finder/helpers/indexer/stemmer/snowball.php
  118. +1 −1  administrator/components/com_finder/views/filter/tmpl/edit.php
  119. +11 −5 administrator/components/com_finder/views/filters/tmpl/default.php
  120. +20 −9 administrator/components/com_finder/views/index/tmpl/default.php
  121. +9 −4 administrator/components/com_finder/views/maps/tmpl/default.php
  122. +1 −1  administrator/components/com_installer/controller.php
  123. +3 −3 administrator/components/com_installer/controllers/discover.php
  124. +6 −4 administrator/components/com_installer/controllers/install.php
  125. +5 −5 administrator/components/com_installer/controllers/manage.php
  126. +3 −3 administrator/components/com_installer/controllers/update.php
  127. +1 −1  administrator/components/com_installer/helpers/installer.php
  128. +1 −1  administrator/components/com_installer/models/database.php
  129. +5 −5 administrator/components/com_installer/models/discover.php
  130. +3 −3 administrator/components/com_installer/models/extension.php
  131. +7 −7 administrator/components/com_installer/models/install.php
  132. +1 −1  administrator/components/com_installer/models/languages.php
  133. +5 −5 administrator/components/com_installer/models/manage.php
  134. +11 −11 administrator/components/com_installer/models/update.php
  135. +2 −2 administrator/components/com_installer/models/warnings.php
  136. +1 −1  administrator/components/com_installer/views/database/tmpl/default.php
  137. +2 −2 administrator/components/com_installer/views/database/view.html.php
  138. +3 −3 administrator/components/com_installer/views/default/view.php
  139. +2 −2 administrator/components/com_installer/views/discover/view.html.php
  140. +15 −6 administrator/components/com_installer/views/install/tmpl/default.php
  141. +2 −2 administrator/components/com_installer/views/install/view.html.php
  142. +2 −2 administrator/components/com_installer/views/manage/view.html.php
  143. +2 −2 administrator/components/com_installer/views/update/view.html.php
  144. +7 −3 administrator/components/com_installer/views/warnings/tmpl/default.php
  145. +2 −2 administrator/components/com_installer/views/warnings/view.html.php
  146. +5 −4 administrator/components/com_joomlaupdate/controller.php
  147. +5 −4 administrator/components/com_joomlaupdate/controllers/update.php
  148. +1 −1  administrator/components/com_joomlaupdate/helpers/download.php
  149. +1 −1  administrator/components/com_joomlaupdate/helpers/joomlaupdate.php
  150. +31 −16 administrator/components/com_joomlaupdate/models/default.php
  151. +5 −5 administrator/components/com_languages/controller.php
  152. +8 −8 administrator/components/com_languages/controllers/override.php
  153. +1 −1  administrator/components/com_languages/controllers/overrides.php
  154. +4 −4 administrator/components/com_languages/controllers/strings.json.php
  155. +13 −11 administrator/components/com_languages/helpers/html/languages.php
  156. +5 −5 administrator/components/com_languages/helpers/jsonresponse.php
  157. +7 −6 administrator/components/com_languages/helpers/languages.php
  158. +59 −44 administrator/components/com_languages/models/installed.php
  159. +33 −25 administrator/components/com_languages/models/language.php
  160. +29 −23 administrator/components/com_languages/models/languages.php
  161. +12 −11 administrator/components/com_languages/models/override.php
  162. +13 −12 administrator/components/com_languages/models/overrides.php
  163. +2 −2 administrator/components/com_languages/models/strings.php
  164. +5 −3 administrator/components/com_languages/views/installed/view.html.php
  165. +4 −3 administrator/components/com_languages/views/language/tmpl/edit.php
  166. +17 −9 administrator/components/com_languages/views/languages/view.html.php
  167. +6 −3 administrator/components/com_languages/views/override/tmpl/edit.php
  168. +2 −2 administrator/components/com_languages/views/override/view.html.php
  169. +1 −1  administrator/components/com_languages/views/overrides/tmpl/default.php
  170. +3 −3 administrator/components/com_languages/views/overrides/view.html.php
  171. +10 −8 administrator/components/com_login/controller.php
  172. +17 −9 administrator/components/com_login/models/login.php
  173. +6 −5 administrator/components/com_media/controller.php
  174. +4 −2 administrator/components/com_media/controllers/file.json.php
  175. +6 −6 administrator/components/com_media/controllers/file.php
  176. +6 −3 administrator/components/com_media/controllers/folder.php
  177. +42 −22 administrator/components/com_media/helpers/media.php
  178. +18 −9 administrator/components/com_media/models/list.php
  179. +8 −4 administrator/components/com_media/models/manager.php
  180. +7 −4 administrator/components/com_media/views/images/view.html.php
  181. +10 −4 administrator/components/com_media/views/imageslist/view.html.php
  182. +14 −7 administrator/components/com_media/views/media/view.html.php
  183. +21 −9 administrator/components/com_media/views/medialist/view.html.php
  184. +4 −4 administrator/components/com_menus/controller.php
  185. +20 −11 administrator/components/com_menus/controllers/items.php
  186. +15 −10 administrator/components/com_menus/controllers/menu.php
  187. +25 −14 administrator/components/com_menus/controllers/menus.php
  188. +1 −1  administrator/components/com_menus/helpers/html/menus.php
  189. +45 −27 administrator/components/com_menus/helpers/menus.php
  190. +7 −5 administrator/components/com_menus/models/fields/menuordering.php
  191. +11 −7 administrator/components/com_menus/models/fields/menuparent.php
  192. +3 −3 administrator/components/com_menus/models/fields/menutype.php
  193. +175 −117 administrator/components/com_menus/models/item.php
  194. +38 −24 administrator/components/com_menus/models/items.php
  195. +46 −36 administrator/components/com_menus/models/menu.php
  196. +1 −1  administrator/components/com_menus/models/menus.php
  197. +79 −42 administrator/components/com_menus/models/menutypes.php
  198. +9 −4 administrator/components/com_menus/views/item/tmpl/edit.php
  199. +22 −11 administrator/components/com_menus/views/item/view.html.php
  200. +7 −3 administrator/components/com_menus/views/items/tmpl/default.php
  201. +43 −22 administrator/components/com_menus/views/items/view.html.php
  202. +2 −1  administrator/components/com_menus/views/menu/tmpl/edit.php
  203. +16 −8 administrator/components/com_menus/views/menu/view.html.php
  204. +4 −2 administrator/components/com_menus/views/menus/tmpl/default.php
  205. +11 −6 administrator/components/com_menus/views/menus/view.html.php
  206. +6 −5 administrator/components/com_messages/controller.php
  207. +8 −4 administrator/components/com_messages/controllers/config.php
  208. +3 −3 administrator/components/com_messages/controllers/message.php
  209. +4 −3 administrator/components/com_messages/helpers/html/messages.php
  210. +7 −6 administrator/components/com_messages/helpers/messages.php
  211. +22 −15 administrator/components/com_messages/models/config.php
  212. +11 −8 administrator/components/com_messages/models/fields/usermessages.php
  213. +43 −30 administrator/components/com_messages/models/message.php
  214. +14 −10 administrator/components/com_messages/models/messages.php
  215. +18 −12 administrator/components/com_messages/tables/message.php
  216. +2 −1  administrator/components/com_messages/views/config/tmpl/default.php
  217. +2 −1  administrator/components/com_messages/views/config/view.html.php
  218. +4 −2 administrator/components/com_messages/views/message/tmpl/edit.php
  219. +10 −5 administrator/components/com_messages/views/message/view.html.php
  220. +13 −7 administrator/components/com_messages/views/messages/view.html.php
  221. +6 −5 administrator/components/com_modules/controller.php
  222. +2 −2 administrator/components/com_modules/controllers/module.php
  223. +5 −3 administrator/components/com_modules/controllers/modules.php
  224. +6 −4 administrator/components/com_modules/helpers/html/modules.php
  225. +3 −3 administrator/components/com_modules/helpers/modules.php
  226. +1 −1  administrator/components/com_modules/models/module.php
  227. +52 −32 administrator/components/com_modules/models/modules.php
  228. +25 −16 administrator/components/com_modules/models/positions.php
  229. +11 −8 administrator/components/com_modules/models/select.php
  230. +4 −2 administrator/components/com_modules/views/module/tmpl/edit.php
  231. +23 −11 administrator/components/com_modules/views/module/tmpl/edit_assignment.php
  232. +18 −9 administrator/components/com_modules/views/module/view.html.php
  233. +7 −3 administrator/components/com_modules/views/modules/tmpl/default.php
  234. +17 −9 administrator/components/com_modules/views/modules/view.html.php
  235. +2 −1  administrator/components/com_modules/views/positions/view.html.php
  236. +6 −5 administrator/components/com_newsfeeds/controller.php
  237. +1 −1  administrator/components/com_newsfeeds/controllers/newsfeed.php
  238. +12 −9 administrator/components/com_newsfeeds/helpers/html/newsfeed.php
  239. +13 −8 administrator/components/com_newsfeeds/helpers/newsfeeds.php
  240. +7 −5 administrator/components/com_newsfeeds/models/fields/modal/newsfeeds.php
  241. +3 −3 administrator/components/com_newsfeeds/models/fields/newsfeeds.php
  242. +5 −4 administrator/components/com_newsfeeds/models/fields/ordering.php
  243. +73 −51 administrator/components/com_newsfeeds/models/newsfeed.php
  244. +24 −15 administrator/components/com_newsfeeds/models/newsfeeds.php
  245. +36 −21 administrator/components/com_newsfeeds/tables/newsfeed.php
  246. +3 −2 administrator/components/com_newsfeeds/views/newsfeed/tmpl/edit.php
  247. +12 −6 administrator/components/com_newsfeeds/views/newsfeed/view.html.php
  248. +7 −3 administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default.php
  249. +17 −9 administrator/components/com_newsfeeds/views/newsfeeds/view.html.php
  250. +6 −5 administrator/components/com_plugins/controller.php
  251. +12 −8 administrator/components/com_plugins/helpers/plugins.php
  252. +5 −4 administrator/components/com_plugins/models/fields/ordering.php
  253. +58 −44 administrator/components/com_plugins/models/plugin.php
  254. +40 −26 administrator/components/com_plugins/models/plugins.php
  255. +2 −1  administrator/components/com_plugins/views/plugin/tmpl/edit.php
  256. +9 −5 administrator/components/com_plugins/views/plugin/view.html.php
  257. +7 −3 administrator/components/com_plugins/views/plugins/tmpl/default.php
  258. +1 −1  administrator/components/com_plugins/views/plugins/view.html.php
  259. +7 −6 administrator/components/com_redirect/controller.php
  260. +8 −5 administrator/components/com_redirect/controllers/links.php
  261. +6 −5 administrator/components/com_redirect/helpers/html/redirect.php
  262. +6 −5 administrator/components/com_redirect/helpers/redirect.php
  263. +35 −29 administrator/components/com_redirect/models/link.php
  264. +18 −13 administrator/components/com_redirect/models/links.php
  265. +19 −13 administrator/components/com_redirect/tables/link.php
  266. +2 −1  administrator/components/com_redirect/views/link/tmpl/edit.php
  267. +13 −7 administrator/components/com_redirect/views/link/view.html.php
  268. +22 −12 administrator/components/com_redirect/views/links/view.html.php
  269. +5 −5 administrator/components/com_search/controller.php
  270. +3 −2 administrator/components/com_search/controllers/searches.php
  271. +46 −25 administrator/components/com_search/helpers/search.php
  272. +20 −14 administrator/components/com_search/models/searches.php
  273. +7 −4 administrator/components/com_search/views/searches/view.html.php
  274. +7 −6 administrator/components/com_templates/controller.php
  275. +31 −24 administrator/components/com_templates/controllers/source.php
  276. +1 −1  administrator/components/com_templates/controllers/style.php
  277. +9 −6 administrator/components/com_templates/controllers/styles.php
  278. +2 −1  administrator/components/com_templates/controllers/template.php
  279. +1 −1  administrator/components/com_templates/helpers/html/templates.php
  280. +12 −8 administrator/components/com_templates/helpers/templates.php
  281. +37 −25 administrator/components/com_templates/models/source.php
  282. +99 −66 administrator/components/com_templates/models/style.php
  283. +16 −11 administrator/components/com_templates/models/styles.php
  284. +26 −20 administrator/components/com_templates/models/template.php
  285. +19 −14 administrator/components/com_templates/models/templates.php
  286. +11 −10 administrator/components/com_templates/tables/style.php
  287. +2 −1  administrator/components/com_templates/views/source/tmpl/edit.php
  288. +5 −3 administrator/components/com_templates/views/source/view.html.php
  289. +2 −1  administrator/components/com_templates/views/style/tmpl/edit.php
  290. +16 −8 administrator/components/com_templates/views/style/view.html.php
  291. +15 −8 administrator/components/com_templates/views/styles/view.html.php
  292. +3 −2 administrator/components/com_templates/views/template/view.html.php
  293. +14 −11 administrator/components/com_templates/views/templates/view.html.php
  294. +17 −12 administrator/components/com_users/controller.php
  295. +13 −11 administrator/components/com_users/controllers/group.php
  296. +17 −12 administrator/components/com_users/controllers/groups.php
  297. +13 −9 administrator/components/com_users/controllers/level.php
  298. +2 −2 administrator/components/com_users/controllers/levels.php
  299. +5 −2 administrator/components/com_users/controllers/mail.php
  300. +1 −1  administrator/components/com_users/controllers/users.php
Sorry, we could not display the entire diff because too many files (640) changed.
View
27 administrator/components/com_admin/controllers/profile.php
@@ -23,11 +23,11 @@ class AdminControllerProfile extends JControllerForm
*
* Extended classes can override this if necessary.
*
- * @param array An array of input data.
- * @param string The name of the key for the primary key.
+ * @param array An array of input data.
+ * @param string The name of the key for the primary key.
*
- * @return boolean
- * @since 1.6
+ * @return boolean
+ * @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
@@ -37,17 +37,19 @@ protected function allowEdit($data = array(), $key = 'id')
/**
* Overrides parent save method to check the submitted passwords match.
*
- * @return mixed Boolean or JError.
- * @since 1.6
+ * @return mixed Boolean or JError.
+ * @since 1.6
*/
public function save($key = null, $urlVar = null)
{
$data = $this->input->post->get('jform', array(), 'array');
// TODO: JForm should really have a validation handler for this.
- if (isset($data['password']) && isset($data['password2'])) {
+ if (isset($data['password']) && isset($data['password2']))
+ {
// Check the passwords match.
- if ($data['password'] != $data['password2']) {
+ if ($data['password'] != $data['password2'])
+ {
$this->setMessage(JText::_('JLIB_USER_ERROR_PASSWORD_NOT_MATCH'), 'warning');
$this->setRedirect(JRoute::_('index.php?option=com_admin&view=profile&layout=edit&id='.JFactory::getUser()->id, false));
return false;
@@ -58,7 +60,8 @@ public function save($key = null, $urlVar = null)
$return = parent::save();
- if ($this->getTask() != 'apply') {
+ if ($this->getTask() != 'apply')
+ {
// Redirect to the main page.
$this->setRedirect(JRoute::_('index.php', false));
}
@@ -69,10 +72,10 @@ public function save($key = null, $urlVar = null)
/**
* Method to cancel an edit.
*
- * @param string $key The name of the primary key of the URL variable.
+ * @param string $key The name of the primary key of the URL variable.
*
- * @return Boolean True if access level checks pass, false otherwise.
- * @since 1.6
+ * @return Boolean True if access level checks pass, false otherwise.
+ * @since 1.6
*/
public function cancel($key = null)
{
View
30 administrator/components/com_admin/helpers/html/directory.php
@@ -21,16 +21,18 @@
/**
* Method to generate a (un)writable message for directory
*
- * @param boolean $writable is the directory writable?
+ * @param boolean $writable is the directory writable?
*
- * @return string html code
+ * @return string html code
*/
public static function writable($writable)
{
- if ($writable) {
+ if ($writable)
+ {
return '<span class="badge badge-success">'. JText::_('COM_ADMIN_WRITABLE') .'</span>';
}
- else {
+ else
+ {
return '<span class="badge badge-important">'. JText::_('COM_ADMIN_UNWRITABLE') .'</span>';
}
}
@@ -38,24 +40,28 @@ public static function writable($writable)
/**
* Method to generate a message for a directory
*
- * @param string $dir the directory
- * @param boolean $message the message
- * @param boolean $visible is the $dir visible?
+ * @param string $dir the directory
+ * @param boolean $message the message
+ * @param boolean $visible is the $dir visible?
*
- * @return string html code
+ * @return string html code
*/
public static function message($dir, $message, $visible=true)
{
- if ($visible) {
+ if ($visible)
+ {
$output = $dir;
}
- else {
+ else
+ {
$output = '';
}
- if (empty($message)) {
+ if (empty($message))
+ {
return $output;
}
- else {
+ else
+ {
return $output.' <strong>'.JText::_($message).'</strong>';
}
}
View
36 administrator/components/com_admin/helpers/html/phpsetting.php
@@ -19,60 +19,68 @@
abstract class JHtmlPhpSetting
{
/**
- * method to generate a boolean message for a value
+ * Method to generate a boolean message for a value
*
* @param boolean $val is the value set?
*
- * @return string html code
+ * @return string html code
*/
public static function boolean($val)
{
- if ($val) {
+ if ($val)
+ {
return JText::_('JON');
}
- else {
+ else
+ {
return JText::_('JOFF');
}
}
/**
- * method to generate a boolean message for a value
+ * Method to generate a boolean message for a value
*
* @param boolean $val is the value set?
*
- * @return string html code
+ * @return string html code
*/
public static function set($val)
{
- if ($val) {
+ if ($val)
+ {
return JText::_('JYES');
- } else {
+ }
+ else
+ {
return JText::_('JNO');
}
}
/**
- * method to generate a string message for a value
+ * Method to generate a string message for a value
*
* @param string $val a php ini value
*
- * @return string html code
+ * @return string html code
*/
public static function string($val)
{
- if (empty($val)) {
+ if (empty($val))
+ {
return JText::_('JNONE');
- } else {
+ }
+ else
+ {
return $val;
}
}
/**
- * method to generate an integer from a value
+ * Method to generate an integer from a value
*
* @param string $val a php ini value
*
- * @return string html code
+ * @return string html code
*
* @deprecated 4.0 Use intval() or casting instead.
*/
View
10 administrator/components/com_admin/helpers/html/system.php
@@ -19,18 +19,20 @@
abstract class JHtmlSystem
{
/**
- * method to generate a string message for a value
+ * Method to generate a string message for a value
*
* @param string $val a php ini value
*
- * @return string html code
+ * @return string html code
*/
public static function server($val)
{
- if (empty($val)) {
+ if (empty($val))
+ {
return JText::_('COM_ADMIN_NA');
}
- else {
+ else
+ {
return $val;
}
}
View
63 administrator/components/com_admin/models/help.php
@@ -19,37 +19,56 @@
class AdminModelHelp extends JModelLegacy
{
/**
- * @var string the search string
+ * The search string
+ * @var string
+ *
+ * @since 1.6
*/
protected $help_search = null;
/**
- * @var string the page to be viewed
+ * The page to be viewed
+ * @var string
+ *
+ * @since 1.6
*/
protected $page = null;
/**
- * @var string the iso language tag
+ * The iso language tag
+ * @var string
+ *
+ * @since 1.6
*/
protected $lang_tag = null;
/**
- * @var array Table of contents
+ * Table of contents
+ *
+ * @var array
+ * @since 1.6
*/
protected $toc = null;
/**
- * @var string url for the latest version check
+ * URL for the latest version check
+ *
+ * @var string
+ * @since 1.6
*/
protected $latest_version_check = null;
/**
* Method to get the help search string
- * @return string Help search string
+ *
+ * @return string Help search string
+ *
+ * @since 1.6
*/
public function &getHelpSearch()
{
- if (is_null($this->help_search)) {
+ if (is_null($this->help_search))
+ {
$this->help_search = JFactory::getApplication()->input->getString('helpsearch');
}
return $this->help_search;
@@ -57,7 +76,10 @@ public function &getHelpSearch()
/**
* Method to get the page
- * @return string page
+ *
+ * @return string The page
+ *
+ * @since 1.6
*/
public function &getPage()
{
@@ -73,6 +95,8 @@ public function &getPage()
* Method to get the lang tag
*
* @return string lang iso tag
+ *
+ * @since 1.6
*/
public function getLangTag()
{
@@ -88,12 +112,14 @@ public function getLangTag()
}
}
+
return $this->lang_tag;
}
/**
* Method to get the toc
- * @return array Table of contents
+ *
+ * @return array Table of contents
*/
public function &getToc()
{
@@ -107,20 +133,22 @@ public function &getToc()
jimport('joomla.filesystem.folder');
$files = JFolder::files(JPATH_BASE . '/help/' . $lang_tag, '\.xml$|\.html$');
$this->toc = array();
- foreach($files as $file)
+ foreach ($files as $file)
{
$buffer = file_get_contents(JPATH_BASE . '/help/' . $lang_tag . '/' . $file);
if (preg_match('#<title>(.*?)</title>#', $buffer, $m))
{
$title = trim($m[1]);
- if ($title) {
+ if ($title)
+ {
// Translate the page title
$title = JText::_($title);
// strip the extension
$file = preg_replace('#\.xml$|\.html$#', '', $file);
if ($help_search)
{
- if (JString::strpos(JString::strtolower(strip_tags($buffer)), JString::strtolower($help_search)) !== false) {
+ if (JString::strpos(JString::strtolower(strip_tags($buffer)), JString::strtolower($help_search)) !== false)
+ {
// Add an item in the Table of Contents
$this->toc[$file] = $title;
}
@@ -136,20 +164,23 @@ public function &getToc()
// Sort the Table of Contents
asort($this->toc);
}
+
return $this->toc;
}
/**
- * Method to get the latest version check;
- * @return string Latest Version Check URL
+ * Method to get the latest version check
+ *
+ * @return string Latest Version Check URL
*/
public function &getLatestVersionCheck()
{
- if (!$this->latest_version_check) {
+ if (!$this->latest_version_check)
+ {
$override = 'http://help.joomla.org/proxy/index.php?option=com_help&keyref=Help{major}{minor}:Joomla_Version_{major}_{minor}_{maintenance}';
$this->latest_version_check = JHelp::createUrl('JVERSION', false, $override);
}
+
return $this->latest_version_check;
}
-
}
View
44 administrator/components/com_admin/models/profile.php
@@ -23,16 +23,19 @@ class AdminModelProfile extends UsersModelUser
/**
* Method to get the record form.
*
- * @param array $data An optional array of data for the form to interogate.
- * @param boolean $loadData True if the form is to load its own data (default case), false if not.
- * @return JForm A JForm object on success, false on failure
- * @since 1.6
+ * @param array $data An optional array of data for the form to interogate.
+ * @param boolean $loadData True if the form is to load its own data (default case), false if not.
+ *
+ * @return JForm A JForm object on success, false on failure
+ *
+ * @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_admin.profile', 'profile', array('control' => 'jform', 'load_data' => $loadData));
- if (empty($form)) {
+ if (empty($form))
+ {
return false;
}
if (!JComponentHelper::getParams('com_users')->get('change_login_name'))
@@ -48,15 +51,17 @@ public function getForm($data = array(), $loadData = true)
/**
* Method to get the data that should be injected in the form.
*
- * @return mixed The data for the form.
- * @since 1.6
+ * @return mixed The data for the form.
+ *
+ * @since 1.6
*/
protected function loadFormData()
{
// Check the session for previously entered form data.
$data = JFactory::getApplication()->getUserState('com_users.edit.user.data', array());
- if (empty($data)) {
+ if (empty($data))
+ {
$data = $this->getItem();
}
@@ -69,7 +74,8 @@ protected function loadFormData()
$results = $dispatcher->trigger('onContentPrepareData', array('com_admin.profile', $data));
// Check for errors encountered while preparing the data.
- if (count($results) && in_array(false, $results, true)) {
+ if (count($results) && in_array(false, $results, true))
+ {
$this->setError($dispatcher->getError());
}
@@ -79,8 +85,9 @@ protected function loadFormData()
/**
* Method to get a single record.
*
- * @return mixed Object on success, false on failure.
- * @since 1.6
+ * @return mixed Object on success, false on failure.
+ *
+ * @since 1.6
*/
public function getItem($pk = null)
{
@@ -92,10 +99,11 @@ public function getItem($pk = null)
/**
* Method to save the form data.
*
- * @param array $data The form data.
+ * @param array $data The form data.
+ *
+ * @return boolean True on success.
*
- * @return boolean True on success.
- * @since 1.6
+ * @since 1.6
*/
public function save($data)
{
@@ -107,16 +115,20 @@ public function save($data)
unset($data['block']);
// Bind the data.
- if (!$user->bind($data)) {
+ if (!$user->bind($data))
+ {
$this->setError($user->getError());
+
return false;
}
$user->groups = null;
// Store the data.
- if (!$user->save()) {
+ if (!$user->save())
+ {
$this->setError($user->getError());
+
return false;
}
View
71 administrator/components/com_admin/models/sysinfo.php
@@ -19,32 +19,42 @@
class AdminModelSysInfo extends JModelLegacy
{
/**
- * @var array some php settings
+ * @var array Some PHP settings
+ * @since 1.6
*/
protected $php_settings = null;
/**
- * @var array config values
+ * @var array Config values
+ * @since 1.6
*/
protected $config = null;
/**
- * @var array somme system values
+ * @var array Some system values
+ * @since 1.6
*/
protected $info = null;
/**
- * @var string php info
+ * @var string PHP info
+ * @since 1.6
*/
protected $php_info = null;
/**
- * @var array informations about writable state of directories
+ * Information about writable state of directories
+ *
+ * @var array
+ * @since 1.6
*/
protected $directories = null;
/**
- * @var string The current editor.
+ * The current editor.
+ *
+ * @var string
+ * @since 1.6
*/
protected $editor = null;
@@ -52,6 +62,8 @@ class AdminModelSysInfo extends JModelLegacy
* Method to get the ChangeLog
*
* @return array some php settings
+ *
+ * @since 1.6
*/
public function &getPhpSettings()
{
@@ -75,13 +87,16 @@ public function &getPhpSettings()
$this->php_settings['mbstring'] = extension_loaded('mbstring');
$this->php_settings['iconv'] = function_exists('iconv');
}
+
return $this->php_settings;
}
/**
- * method to get the config
+ * Method to get the config
*
- * @return array config values
+ * @return array config values
+ *
+ * @since 1.6
*/
public function &getConfig()
{
@@ -90,17 +105,21 @@ public function &getConfig()
$registry = new JRegistry(new JConfig);
$this->config = $registry->toArray();
$hidden = array('host', 'user', 'password', 'ftp_user', 'ftp_pass', 'smtpuser', 'smtppass');
- foreach($hidden as $key) {
+ foreach ($hidden as $key)
+ {
$this->config[$key] = 'xxxxxx';
}
}
+
return $this->config;
}
/**
- * method to get the system information
+ * Method to get the system information
+ *
+ * @return array system information values
*
- * @return array system information values
+ * @since 1.6
*/
public function &getInfo()
{
@@ -110,7 +129,8 @@ public function &getInfo()
$version = new JVersion;
$platform = new JPlatform;
$db = JFactory::getDBO();
- if (isset($_SERVER['SERVER_SOFTWARE'])) {
+ if (isset($_SERVER['SERVER_SOFTWARE']))
+ {
$sf = $_SERVER['SERVER_SOFTWARE'];
}
else {
@@ -130,9 +150,11 @@ public function &getInfo()
}
/**
- * method to get the PHP info
+ * Method to get the PHP info
+ *
+ * @return string PHP info
*
- * @return string PHP info
+ * @since 1.6
*/
public function &getPHPInfo()
{
@@ -153,13 +175,16 @@ public function &getPHPInfo()
$output = str_replace('</div>', '', $output);
$this->php_info = $output;
}
+
return $this->php_info;
}
/**
- * method to get the directory states
+ * Method to get the directory states
+ *
+ * @return array States of directories
*
- * @return array states of directories
+ * @since 1.6
*/
public function getDirectory()
{
@@ -268,17 +293,25 @@ public function getDirectory()
return $this->directories;
}
+ /**
+ * Method to add a directory
+ *
+ * @return void
+ * @since 1.6
+ */
private function _addDirectory($name, $path, $message = '')
{
$this->directories[$name] = array('writable' => is_writable($path), 'message' => $message);
}
/**
- * method to get the editor
+ * Method to get the editor
+ *
+ * @return string The default editor
*
- * @return string the default editor
+ * @note: has to be removed (it is present in the config...)
*
- * has to be removed (it is present in the config...)
+ * @since 1.6
*/
public function &getEditor()
{
View
25 administrator/components/com_admin/script.php
@@ -19,9 +19,9 @@
class joomlaInstallerScript
{
/**
- * method to update Joomla!
+ * Method to update Joomla!
*
- * @param JInstallerFile $installer The class calling this method
+ * @param JInstallerFile $installer The class calling this method
*
* @return void
*/
@@ -205,7 +205,8 @@ protected function updateManifestCaches()
$query = $db->getQuery(true);
$query->select('*');
$query->from('#__extensions');
- foreach ($extensions as $extension) {
+ foreach ($extensions as $extension)
+ {
$query->where('type='.$db->quote($extension[0]).' AND element='.$db->quote($extension[1]).' AND folder='.$db->quote($extension[2]).' AND client_id='.$extension[3], 'OR');
}
$db->setQuery($query);
@@ -217,8 +218,10 @@ protected function updateManifestCaches()
echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $db->getErrorNum(), $db->getErrorMsg()).'<br />';
return;
}
- foreach ($extensions as $extension) {
- if (!$installer->refreshManifestCache($extension->extension_id)) {
+ foreach ($extensions as $extension)
+ {
+ if (!$installer->refreshManifestCache($extension->extension_id))
+ {
echo JText::sprintf('FILES_JOOMLA_ERROR_MANIFEST', $extension->type, $extension->element, $extension->name, $extension->client_id).'<br />';
}
}
@@ -568,15 +571,19 @@ public function deleteUnexistingFiles()
);
jimport('joomla.filesystem.file');
- foreach ($files as $file) {
- if (JFile::exists(JPATH_ROOT . $file) && !JFile::delete(JPATH_ROOT . $file)) {
+ foreach ($files as $file)
+ {
+ if (JFile::exists(JPATH_ROOT . $file) && !JFile::delete(JPATH_ROOT . $file))
+ {
echo JText::sprintf('FILES_JOOMLA_ERROR_FILE_FOLDER', $file).'<br />';
}
}
jimport('joomla.filesystem.folder');
- foreach ($folders as $folder) {
- if (JFolder::exists(JPATH_ROOT . $folder) && !JFolder::delete(JPATH_ROOT . $folder)) {
+ foreach ($folders as $folder)
+ {
+ if (JFolder::exists(JPATH_ROOT . $folder) && !JFolder::delete(JPATH_ROOT . $folder))
+ {
echo JText::sprintf('FILES_JOOMLA_ERROR_FILE_FOLDER', $folder).'<br />';
}
}
View
2  administrator/components/com_admin/views/help/view.html.php
@@ -65,7 +65,7 @@ public function display($tpl = null)
/**
* Setup the Toolbar
*
- * @since 1.6
+ * @since 1.6
*/
protected function addToolbar()
{
View
7 administrator/components/com_admin/views/profile/tmpl/edit.php
@@ -23,7 +23,8 @@
<script type="text/javascript">
Joomla.submitbutton = function(task)
{
- if (task == 'profile.cancel' || document.formvalidator.isValid(document.id('profile-form'))) {
+ if (task == 'profile.cancel' || document.formvalidator.isValid(document.id('profile-form')))
+ {
Joomla.submitform(task, document.getElementById('profile-form'));
}
}
@@ -44,7 +45,7 @@
<div class="tab-content">
<div class="tab-pane active" id="account">
- <?php foreach($this->form->getFieldset('user_details') as $field) :?>
+ <?php foreach ($this->form->getFieldset('user_details') as $field) : ?>
<div class="control-group">
<div class="control-label"><?php echo $field->label; ?></div>
<div class="controls"><?php echo $field->input; ?></div>
@@ -58,7 +59,7 @@
endif;
?>
<div class="tab-pane" id="settings-<?php echo $fieldset->name;?>">
- <?php foreach($this->form->getFieldset($fieldset->name) as $field): ?>
+ <?php foreach ($this->form->getFieldset($fieldset->name) as $field) : ?>
<?php if ($field->hidden): ?>
<div class="control-group">
<div class="controls"><?php echo $field->input; ?></div>
View
5 administrator/components/com_admin/views/profile/view.html.php
@@ -34,7 +34,8 @@ public function display($tpl = null)
$this->state = $this->get('State');
// Check for errors.
- if (count($errors = $this->get('Errors'))) {
+ if (count($errors = $this->get('Errors')))
+ {
JError::raiseError(500, implode("\n", $errors));
return false;
}
@@ -49,7 +50,7 @@ public function display($tpl = null)
/**
* Add the page title and toolbar.
*
- * @since 1.6
+ * @since 1.6
*/
protected function addToolbar()
{
View
2  administrator/components/com_admin/views/sysinfo/tmpl/default_directory.php
@@ -28,7 +28,7 @@
</tr>
</tfoot>
<tbody>
- <?php foreach($this->directory as $dir => $info):?>
+ <?php foreach ($this->directory as $dir => $info) : ?>
<tr>
<td>
<?php echo JHtml::_('directory.message', $dir, $info['message']);?>
View
5 administrator/components/com_admin/views/sysinfo/view.html.php
@@ -49,7 +49,8 @@ class AdminViewSysinfo extends JViewLegacy
public function display($tpl = null)
{
// Access check.
- if (!JFactory::getUser()->authorise('core.admin')) {
+ if (!JFactory::getUser()->authorise('core.admin'))
+ {
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
@@ -88,7 +89,7 @@ protected function _setSubMenu()
/**
* Setup the Toolbar
*
- * @since 1.6
+ * @since 1.6
*/
protected function addToolbar()
{
View
8 administrator/components/com_banners/controller.php
@@ -21,11 +21,11 @@ class BannersController extends JControllerLegacy
/**
* Method to display a view.
*
- * @param boolean If true, the view output will be cached
- * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
+ * @param boolean If true, the view output will be cached
+ * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
- * @return JController This object to support chaining.
- * @since 1.5
+ * @return JController This object to support chaining.
+ * @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
View
2  administrator/components/com_banners/controllers/banner.php
@@ -95,7 +95,7 @@ protected function allowEdit($data = array(), $key = 'id')
*
* @param string $model The model
*
- * @return boolean True on success.
+ * @return boolean True on success.
*
* @since 2.5
*/
View
25 administrator/components/com_banners/controllers/banners.php
@@ -20,16 +20,16 @@ class BannersControllerBanners extends JControllerAdmin
{
/**
* @var string The prefix to use with controller messages.
- * @since 1.6
+ * @since 1.6
*/
protected $text_prefix = 'COM_BANNERS_BANNERS';
/**
* Constructor.
*
- * @param array An optional associative array of configuration settings.
+ * @param array An optional associative array of configuration settings.
* @see JController
- * @since 1.6
+ * @since 1.6
*/
public function __construct($config = array())
{
@@ -40,7 +40,7 @@ public function __construct($config = array())
/**
* Proxy for getModel.
- * @since 1.6
+ * @since 1.6
*/
public function getModel($name = 'Banner', $prefix = 'BannersModel', $config = array('ignore_request' => true))
{
@@ -49,7 +49,7 @@ public function getModel($name = 'Banner', $prefix = 'BannersModel', $config = a
}
/**
- * @since 1.6
+ * @since 1.6
*/
public function sticky_publish()
{
@@ -61,17 +61,22 @@ public function sticky_publish()
$task = $this->getTask();
$value = JArrayHelper::getValue($values, $task, 0, 'int');
- if (empty($ids)) {
+ if (empty($ids))
+ {
JError::raiseWarning(500, JText::_('COM_BANNERS_NO_BANNERS_SELECTED'));
- } else {
+ }
+ else
+ {
// Get the model.
$model = $this->getModel();
// Change the state of the records.
- if (!$model->stick($ids, $value)) {
+ if (!$model->stick($ids, $value))
+ {
JError::raiseWarning(500, $model->getError());
} else {
- if ($value == 1) {
+ if ($value == 1)
+ {
$ntext = 'COM_BANNERS_N_BANNERS_STUCK';
} else {
$ntext = 'COM_BANNERS_N_BANNERS_UNSTUCK';
@@ -86,7 +91,7 @@ public function sticky_publish()
/**
* Method to save the submitted ordering values for records via AJAX.
*
- * @return void
+ * @return void
*
* @since 3.0
*/
View
2  administrator/components/com_banners/controllers/client.php
@@ -20,7 +20,7 @@ class BannersControllerClient extends JControllerForm
{
/**
* @var string The prefix to use with controller messages.
- * @since 1.6
+ * @since 1.6
*/
protected $text_prefix = 'COM_BANNERS_CLIENT';
}
View
2  administrator/components/com_banners/controllers/clients.php
@@ -20,7 +20,7 @@ class BannersControllerClients extends JControllerAdmin
{
/**
* @var string The prefix to use with controller messages.
- * @since 1.6
+ * @since 1.6
*/
protected $text_prefix = 'COM_BANNERS_CLIENTS';
View
13 administrator/components/com_banners/controllers/tracks.php
@@ -20,7 +20,7 @@ class BannersControllerTracks extends JControllerLegacy
{
/**
* @var string The context for persistent state.
- * @since 1.6
+ * @since 1.6
*/
protected $context = 'com_banners.tracks';
@@ -44,8 +44,8 @@ public function getModel($name = 'Tracks', $prefix = 'BannersModel', $config = a
/**
* Method to remove a record.
*
- * @return void
- * @since 1.6
+ * @return void
+ * @since 1.6
*/
public function delete()
{
@@ -78,9 +78,12 @@ public function delete()
$count = $model->getTotal();
// Remove the items.
- if (!$model->delete()) {
+ if (!$model->delete())
+ {
JError::raiseWarning(500, $model->getError());
- } else {
+ }
+ else
+ {
$this->setMessage(JText::plural('COM_BANNERS_TRACKS_N_ITEMS_DELETED', $count));
}
View
21 administrator/components/com_banners/controllers/tracks.raw.php
@@ -20,18 +20,18 @@ class BannersControllerTracks extends JControllerLegacy
{
/**
* @var string The context for persistent state.
- * @since 1.6
+ * @since 1.6
*/
protected $context = 'com_banners.tracks';
/**
* Proxy for getModel.
*
- * @param string $name The name of the model.
- * @param string $prefix The prefix for the model class name.
+ * @param string $name The name of the model.
+ * @param string $prefix The prefix for the model class name.
*
- * @return JModel
- * @since 1.6
+ * @return JModel
+ * @since 1.6
*/
public function getModel($name = 'Tracks', $prefix = 'BannersModel', $config = array())
{
@@ -42,11 +42,11 @@ public function getModel($name = 'Tracks', $prefix = 'BannersModel', $config = a
/**
* Display method for the raw track data.
*
- * @param boolean If true, the view output will be cached
- * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
+ * @param boolean If true, the view output will be cached
+ * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
- * @return JController This object to support chaining.
- * @since 1.5
+ * @return JController This object to support chaining.
+ * @since 1.5
* @todo This should be done as a view, not here!
*/
public function display($cachable = false, $urlparams = false)
@@ -57,7 +57,8 @@ public function display($cachable = false, $urlparams = false)
$vFormat = 'raw';
// Get and render the view.
- if ($view = $this->getView($vName, $vFormat)) {
+ if ($view = $this->getView($vName, $vFormat))
+ {
// Get the model for the view.
$model = $this->getModel($vName);
View
41 administrator/components/com_banners/helpers/banners.php
@@ -21,10 +21,10 @@ class BannersHelper
/**
* Configure the Linkbar.
*
- * @param string The name of the active view.
+ * @param string The name of the active view.
*
- * @return void
- * @since 1.6
+ * @return void
+ * @since 1.6
*/
public static function addSubmenu($vName)
{
@@ -39,7 +39,8 @@ public static function addSubmenu($vName)
'index.php?option=com_categories&extension=com_banners',
$vName == 'categories'
);
- if ($vName == 'categories') {
+ if ($vName == 'categories')
+ {
JToolbarHelper::title(
JText::sprintf('COM_CATEGORIES_CATEGORIES_TITLE', JText::_('com_banners')),
'banners-categories');
@@ -61,27 +62,31 @@ public static function addSubmenu($vName)
/**
* Gets a list of the actions that can be performed.
*
- * @param int The category ID.
+ * @param integer The category ID.
*
- * @return JObject
- * @since 1.6
+ * @return JObject
+ * @since 1.6
*/
public static function getActions($categoryId = 0)
{
$user = JFactory::getUser();
$result = new JObject;
- if (empty($categoryId)) {
+ if (empty($categoryId))
+ {
$assetName = 'com_banners';
$level = 'component';
- } else {
+ }
+ else
+ {
$assetName = 'com_banners.category.'.(int) $categoryId;
$level = 'category';
}
$actions = JAccess::getActions('com_banners', $level);
- foreach ($actions as $action) {
+ foreach ($actions as $action)
+ {
$result->set($action->name, $user->authorise($action->name, $assetName));
}
@@ -89,8 +94,8 @@ public static function getActions($categoryId = 0)
}
/**
- * @return boolean
- * @since 1.6
+ * @return boolean
+ * @since 1.6
*/
public static function updateReset()
{
@@ -118,21 +123,25 @@ public static function updateReset()
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables');
- foreach ($rows as $row) {
+ foreach ($rows as $row)
+ {
$purchase_type = $row->purchase_type;
- if ($purchase_type < 0 && $row->cid) {
+ if ($purchase_type < 0 && $row->cid)
+ {
$client = JTable::getInstance('Client', 'BannersTable');
$client->load($row->cid);
$purchase_type = $client->purchase_type;
}
- if ($purchase_type < 0) {
+ if ($purchase_type < 0)
+ {
$params = JComponentHelper::getParams('com_banners');
$purchase_type = $params->get('purchase_type');
}
- switch($purchase_type) {
+ switch($purchase_type)
+ {
case 1:
$reset = $nullDate;
break;
View
4 administrator/components/com_banners/helpers/html/banner.php
@@ -45,8 +45,8 @@ public static function clients()
/**
* Method to get the field options.
*
- * @return array The field option objects.
- * @since 1.6
+ * @return array The field option objects.
+ * @since 1.6
*/
public static function clientlist()
{
View
11 administrator/components/com_banners/models/banner.php
@@ -31,7 +31,7 @@ class BannersModelBanner extends JModelAdmin
* @param array $pks An array of item ids.
* @param array $contexts An array of item contexts.
*
- * @return boolean Returns true on success, false on failure.
+ * @return boolean Returns true on success, false on failure.
*
* @since 2.5
*/
@@ -489,12 +489,14 @@ protected function prepareTable($table)
$date = JFactory::getDate();
$user = JFactory::getUser();
- if (empty($table->id)) {
+ if (empty($table->id))
+ {
// Set the values
$table->created = $date->toSql();
// Set ordering to the last item if not set
- if (empty($table->ordering)) {
+ if (empty($table->ordering))
+ {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM #__banners');
$max = $db->loadResult();
@@ -502,7 +504,8 @@ protected function prepareTable($table)
$table->ordering = $max + 1;
}
}
- else {
+ else
+ {
// Set the values
$table->modified = $date->toSql();
$table->modified_by = $user->get('id');
View
58 administrator/components/com_banners/models/banners.php
@@ -21,13 +21,14 @@ class BannersModelBanners extends JModelList
/**
* Constructor.
*
- * @param array An optional associative array of configuration settings.
+ * @param array An optional associative array of configuration settings.
* @see JController
- * @since 1.6
+ * @since 1.6
*/
public function __construct($config = array())
{
- if (empty($config['filter_fields'])) {
+ if (empty($config['filter_fields']))
+ {
$config['filter_fields'] = array(
'id', 'a.id',
'cid', 'a.cid', 'client_name',
@@ -55,11 +56,12 @@ public function __construct($config = array())
/**
* Method to get the maximum ordering value for each category.
*
- * @since 1.6
+ * @since 1.6
*/
public function &getCategoryOrders()
{
- if (!isset($this->cache['categoryorders'])) {
+ if (!isset($this->cache['categoryorders']))
+ {
$db = $this->getDbo();
$query = $db->getQuery(true);
$query->select('MAX(ordering) as '.$db->quoteName('max').', catid');
@@ -75,8 +77,8 @@ public function &getCategoryOrders()
/**
* Build an SQL query to load the list data.
*
- * @return JDatabaseQuery
- * @since 1.6
+ * @return JDatabaseQuery
+ * @since 1.6
*/
protected function getListQuery()
{
@@ -117,28 +119,34 @@ protected function getListQuery()
// Filter by published state
$published = $this->getState('filter.state');
- if (is_numeric($published)) {
+ if (is_numeric($published))
+ {
$query->where('a.state = '.(int) $published);
- } elseif ($published === '') {
+ } elseif ($published === '')
+ {
$query->where('(a.state IN (0, 1))');
}
// Filter by category.
$categoryId = $this->getState('filter.category_id');
- if (is_numeric($categoryId)) {
+ if (is_numeric($categoryId))
+ {
$query->where('a.catid = '.(int) $categoryId);
}
// Filter by client.
$clientId = $this->getState('filter.client_id');
- if (is_numeric($clientId)) {
+ if (is_numeric($clientId))
+ {
$query->where('a.cid = '.(int) $clientId);
}
// Filter by search in title
$search = $this->getState('filter.search');
- if (!empty($search)) {
- if (stripos($search, 'id:') === 0) {
+ if (!empty($search))
+ {
+ if (stripos($search, 'id:') === 0)
+ {
$query->where('a.id = '.(int) substr($search, 3));
} else {
$search = $db->Quote('%'.$db->escape($search, true).'%');
@@ -147,14 +155,16 @@ protected function getListQuery()
}
// Filter on the language.
- if ($language = $this->getState('filter.language')) {
+ if ($language = $this->getState('filter.language'))
+ {
$query->where('a.language = ' . $db->quote($language));
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'ordering');
$orderDirn = $this->state->get('list.direction', 'ASC');
- if ($orderCol == 'ordering' || $orderCol == 'category_title') {
+ if ($orderCol == 'ordering' || $orderCol == 'category_title')
+ {
$orderCol = 'c.title '.$orderDirn.', a.ordering';
}
if($orderCol == 'client_name')
@@ -172,9 +182,9 @@ protected function getListQuery()
* different modules that might need different sets of data or different
* ordering requirements.
*
- * @param string $id A prefix for the store id.
- * @return string A store id.
- * @since 1.6
+ * @param string $id A prefix for the store id.
+ * @return string A store id.
+ * @since 1.6
*/
protected function getStoreId($id = '')
{
@@ -191,11 +201,11 @@ protected function getStoreId($id = '')
/**
* Returns a reference to the a Table object, always creating it.
*
- * @param type The table type to instantiate
- * @param string A prefix for the table class name. Optional.
- * @param array Configuration array for model. Optional.
- * @return JTable A database object
- * @since 1.6
+ * @param type The table type to instantiate
+ * @param string A prefix for the table class name. Optional.
+ * @param array Configuration array for model. Optional.
+ * @return JTable A database object
+ * @since 1.6
*/
public function getTable($type = 'Banner', $prefix = 'BannersTable', $config = array())
{
@@ -207,7 +217,7 @@ public function getTable($type = 'Banner', $prefix = 'BannersTable', $config = a
*
* Note. Calling getState in this method will result in recursion.
*
- * @since 1.6
+ * @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
{
View
59 administrator/components/com_banners/models/client.php
@@ -21,19 +21,22 @@ class BannersModelClient extends JModelAdmin
/**
* Method to test whether a record can be deleted.
*
- * @param object A record object.
- * @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
- * @since 1.6
+ * @param object A record object.
+ * @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
+ * @since 1.6
*/
protected function canDelete($record)
{
- if (!empty($record->id)) {
- if ($record->state != -2) {
+ if (!empty($record->id))
+ {
+ if ($record->state != -2)
+ {
return;
}
$user = JFactory::getUser();
- if (!empty($record->catid)) {
+ if (!empty($record->catid))
+ {
return $user->authorise('core.delete', 'com_banners.category.'.(int) $record->catid);
}
else {
@@ -45,18 +48,20 @@ protected function canDelete($record)
/**
* Method to test whether a record can be deleted.
*
- * @param object A record object.
- * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
- * @since 1.6
+ * @param object A record object.
+ * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
+ * @since 1.6
*/
protected function canEditState($record)
{
$user = JFactory::getUser();
- if (!empty($record->catid)) {
+ if (!empty($record->catid))
+ {
return $user->authorise('core.edit.state', 'com_banners.category.'.(int) $record->catid);
}
- else {
+ else
+ {
return $user->authorise('core.edit.state', 'com_banners');
}
}
@@ -64,11 +69,11 @@ protected function canEditState($record)
/**
* Returns a reference to the a Table object, always creating it.
*
- * @param type The table type to instantiate
- * @param string A prefix for the table class name. Optional.
- * @param array Configuration array for model. Optional.
- * @return JTable A database object
- * @since 1.6
+ * @param type The table type to instantiate
+ * @param string A prefix for the table class name. Optional.
+ * @param array Configuration array for model. Optional.
+ * @return JTable A database object
+ * @since 1.6
*/
public function getTable($type = 'Client', $prefix = 'BannersTable', $config = array())
{
@@ -78,16 +83,17 @@ public function getTable($type = 'Client', $prefix = 'BannersTable', $config = a
/**
* Method to get the record form.
*
- * @param array $data Data for the form.
- * @param boolean $loadData True if the form is to load its own data (default case), false if not.
- * @return mixed A JForm object on success, false on failure
- * @since 1.6
+ * @param array $data Data for the form.
+ * @param boolean $loadData True if the form is to load its own data (default case), false if not.
+ * @return mixed A JForm object on success, false on failure
+ * @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{