PageRenderTime 39ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/plugins/editors-xtd/pagebreak/pagebreak.php

https://github.com/joebushi/joomla
PHP | 47 lines | 21 code | 8 blank | 18 comment | 0 complexity | 71d08c2ac12b4105066274df4445af82 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. <?php
  2. /**
  3. * @version $Id$
  4. * @package Joomla
  5. * @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
  6. * @license GNU General Public License version 2 or later; see LICENSE.txt
  7. */
  8. // no direct access
  9. defined('_JEXEC') or die;
  10. jimport('joomla.plugin.plugin');
  11. /**
  12. * Editor Pagebreak buton
  13. *
  14. * @package Editors-xtd
  15. * @since 1.5
  16. */
  17. class plgButtonPagebreak extends JPlugin
  18. {
  19. /**
  20. * Display the button
  21. *
  22. * @return array A two element array of (imageName, textToInsert)
  23. */
  24. function onDisplay($name)
  25. {
  26. $app = JFactory::getApplication();
  27. $doc = & JFactory::getDocument();
  28. $template = $app->getTemplate();
  29. $link = 'index.php?option=com_content&amp;task=ins_pagebreak&amp;tmpl=component&amp;e_name='.$name;
  30. JHtml::_('behavior.modal');
  31. $button = new JObject;
  32. $button->set('modal', true);
  33. $button->set('link', $link);
  34. $button->set('text', JText::_('Pagebreak'));
  35. $button->set('name', 'pagebreak');
  36. $button->set('options', "{handler: 'iframe', size: {x: 400, y: 85}}");
  37. return $button;
  38. }
  39. }