PageRenderTime 29ms CodeModel.GetById 26ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): LGPL-2.1
 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
10defined('_JEXEC') or die;
11
12/**
13 * Editor Pagebreak buton
14 *
15 * @package     Joomla.Plugin
16 * @subpackage  Editors-xtd.pagebreak
17 * @since       1.5
18 */
19class plgButtonPagebreak extends JPlugin
20{
21	/**
22	 * Constructor
23	 *
24	 * @param       object  $subject The object to observe
25	 * @param       array   $config  An array that holds the plugin configuration
26	 * @since       1.5
27	 */
28	public function __construct(& $subject, $config)
29	{
30		parent::__construct($subject, $config);
31		$this->loadLanguage();
32	}
33
34	/**
35	 * Display the button
36	 *
37	 * @return array A two element array of (imageName, textToInsert)
38	 */
39	public function onDisplay($name)
40	{
41		$app = JFactory::getApplication();
42
43		$doc = JFactory::getDocument();
44		$template = $app->getTemplate();
45
46		$link = 'index.php?option=com_content&amp;view=article&amp;layout=pagebreak&amp;tmpl=component&amp;e_name='.$name;
47
48		JHtml::_('behavior.modal');
49
50		$button = new JObject;
51		$button->modal = true;
52		$button->link  = $link;
53		$button->text  = JText::_('PLG_EDITORSXTD_PAGEBREAK_BUTTON_PAGEBREAK');
54		$button->name  = 'copy';
55		$button->options = "{handler: 'iframe', size: {x: 500, y: 300}}";
56
57		return $button;
58	}
59}