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

https://bitbucket.org/eternaware/joomus · PHP · 59 lines · 25 code · 8 blank · 26 comment · 0 complexity · 820c83c82dc8c5b59ae1441985257cd7 MD5 · raw file

  1. <?php
  2. /**
  3. * @package Joomla.Plugin
  4. * @subpackage Editors-xtd.pagebreak
  5. *
  6. * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. */
  9. defined('_JEXEC') or die;
  10. /**
  11. * Editor Pagebreak buton
  12. *
  13. * @package Joomla.Plugin
  14. * @subpackage Editors-xtd.pagebreak
  15. * @since 1.5
  16. */
  17. class plgButtonPagebreak extends JPlugin
  18. {
  19. /**
  20. * Constructor
  21. *
  22. * @param object $subject The object to observe
  23. * @param array $config An array that holds the plugin configuration
  24. * @since 1.5
  25. */
  26. public function __construct(& $subject, $config)
  27. {
  28. parent::__construct($subject, $config);
  29. $this->loadLanguage();
  30. }
  31. /**
  32. * Display the button
  33. *
  34. * @return array A two element array of (imageName, textToInsert)
  35. */
  36. public function onDisplay($name)
  37. {
  38. $app = JFactory::getApplication();
  39. $doc = JFactory::getDocument();
  40. $template = $app->getTemplate();
  41. $link = 'index.php?option=com_content&amp;view=article&amp;layout=pagebreak&amp;tmpl=component&amp;e_name='.$name;
  42. JHtml::_('behavior.modal');
  43. $button = new JObject;
  44. $button->modal = true;
  45. $button->link = $link;
  46. $button->text = JText::_('PLG_EDITORSXTD_PAGEBREAK_BUTTON_PAGEBREAK');
  47. $button->name = 'copy';
  48. $button->options = "{handler: 'iframe', size: {x: 500, y: 300}}";
  49. return $button;
  50. }
  51. }