lexicon.class.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /*
  3. * This file is part of MODX Revolution.
  4. *
  5. * Copyright (c) MODX, LLC. All Rights Reserved.
  6. *
  7. * For complete copyright and license information, see the COPYRIGHT and LICENSE
  8. * files found in the top-level directory of this distribution.
  9. */
  10. /**
  11. * Loads lexicon management
  12. *
  13. * @package modx
  14. * @subpackage manager.controllers
  15. */
  16. class WorkspacesLexiconManagerController extends modManagerController {
  17. /**
  18. * Check for any permissions or requirements to load page
  19. * @return bool
  20. */
  21. public function checkPermissions() {
  22. return $this->modx->hasPermission('lexicons');
  23. }
  24. /**
  25. * Register custom CSS/JS for the page
  26. * @return void
  27. */
  28. public function loadCustomCssJs() {
  29. $mgrUrl = $this->modx->getOption('manager_url',null,MODX_MANAGER_URL);
  30. $this->addJavascript($mgrUrl.'assets/modext/widgets/core/modx.grid.local.property.js');
  31. $this->addJavascript($mgrUrl.'assets/modext/workspace/lexicon/combos.js');
  32. $this->addJavascript($mgrUrl.'assets/modext/workspace/lexicon/lexicon.grid.js');
  33. $this->addJavascript($mgrUrl.'assets/modext/workspace/lexicon/lexicon.panel.js');
  34. $this->addJavascript($mgrUrl.'assets/modext/workspace/lexicon/index.js');
  35. $this->addHtml("<script>
  36. Ext.onReady(function() {
  37. MODx.add('modx-page-lexicon-management');
  38. });</script>");
  39. }
  40. /**
  41. * Custom logic code here for setting placeholders, etc
  42. * @param array $scriptProperties
  43. * @return mixed
  44. */
  45. public function process(array $scriptProperties = array()) {}
  46. /**
  47. * Return the pagetitle
  48. *
  49. * @return string
  50. */
  51. public function getPageTitle() {
  52. return $this->modx->lexicon('lexicon_management');
  53. }
  54. /**
  55. * Return the location of the template file
  56. * @return string
  57. */
  58. public function getTemplateFile() {
  59. return '';
  60. }
  61. /**
  62. * Specify the language topics to load
  63. * @return array
  64. */
  65. public function getLanguageTopics() {
  66. return array('package_builder','lexicon','namespace');
  67. }
  68. /**
  69. * Get the Help URL
  70. * @return string
  71. */
  72. public function getHelpUrl() {
  73. return 'Internationalization';
  74. }
  75. }