PageRenderTime 51ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/Wysiwyg/View/Helper/WysiwygHelper.php

https://github.com/kareypowell/croogo
PHP | 45 lines | 18 code | 5 blank | 22 comment | 1 complexity | 4a0c91b41dfd7f43401df425d8f55593 MD5 | raw file
  1. <?php
  2. App::uses('AppHelper', 'View/Helper');
  3. /**
  4. * Wysiwyg Helper
  5. *
  6. * @category Wysiwyg.Helper
  7. * @package Croogo.Wysiwyg.View.Helper
  8. * @version 1.5
  9. * @author Fahad Ibnay Heylaal <contact@fahad19.com>
  10. * @license http://www.opensource.org/licenses/mit-license.php The MIT License
  11. * @link http://www.croogo.org
  12. */
  13. class WysiwygHelper extends AppHelper {
  14. /**
  15. * Other helpers used by this helper
  16. *
  17. * @var array
  18. * @access public
  19. */
  20. public $helpers = array(
  21. 'Html',
  22. );
  23. /**
  24. * beforeRender
  25. *
  26. * @param string $viewFile
  27. * @return void
  28. */
  29. public function beforeRender($viewFile) {
  30. $uploadsPath = Configure::read('Wysiwyg.uploadsPath');
  31. if ($uploadsPath) {
  32. $uploadsPath = Router::url($uploadsPath);
  33. }
  34. Configure::write('Js.Wysiwyg.uploadsPath', $uploadsPath);
  35. Configure::write('Js.Wysiwyg.attachmentsPath',
  36. $this->Html->url(Configure::read('Wysiwyg.attachmentBrowseUrl'))
  37. );
  38. $this->Html->script('/wysiwyg/js/wysiwyg', array('inline' => false));
  39. }
  40. }