/components/com_jce/editor/tiny_mce/plugins/source/classes/source.php

https://bitbucket.org/pastor399/newcastleunifc · PHP · 49 lines · 16 code · 9 blank · 24 comment · 0 complexity · a4d3316396b6a276152aa2fe2f8efde7 MD5 · raw file

  1. <?php
  2. /**
  3. * @package JCE
  4. * @copyright Copyright (c) 2009-2013 Ryan Demmer. All rights reserved.
  5. * @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  6. * JCE is free software. This version may have been modified pursuant
  7. * to the GNU General Public License, and as distributed it includes or
  8. * is derivative of works licensed under the GNU General Public License or
  9. * other free or open source software licenses.
  10. */
  11. require_once (WF_EDITOR_LIBRARIES . '/classes/plugin.php');
  12. final class WFSourcePlugin extends WFEditorPlugin {
  13. public function display() {
  14. $document = WFDocument::getInstance();
  15. $view = $this->getView();
  16. $view->addTemplatePath(WF_EDITOR_PLUGIN . '/tmpl');
  17. $document->setTitle(WFText::_('WF_' . strtoupper($this->getName() . '_TITLE')));
  18. $theme = $this->getParam('source.theme', 'textmate');
  19. //$editor = 'codemirror';
  20. $document->addScript(array('tiny_mce_popup'), 'tiny_mce');
  21. $document->addScript(array('editor', 'format'), 'plugins');
  22. $document->addStyleSheet(array('editor'), 'plugins');
  23. $document->addScript(array('codemirror-compressed'), 'jce.tiny_mce.plugins.source.js.codemirror');
  24. $document->addStyleSheet(array('codemirror', 'theme/' . $theme), 'jce.tiny_mce.plugins.source.css.codemirror');
  25. /*switch ($editor) {
  26. case 'ace':
  27. $document->addScript(array('ace', 'mode-html'), 'jce.tiny_mce.plugins.source.js.ace');
  28. if ($theme != 'textmate') {
  29. $document->addScript(array('theme-' . $theme), 'jce.tiny_mce.plugins.source.js.ace');
  30. }
  31. break;
  32. case 'codemirror':
  33. $document->addScript(array('codemirror-compressed'), 'jce.tiny_mce.plugins.source.js.codemirror');
  34. $document->addStyleSheet(array('codemirror', 'theme/' . $theme), 'jce.tiny_mce.plugins.source.css.codemirror');
  35. break;
  36. }*/
  37. }
  38. }