PageRenderTime 246ms CodeModel.GetById 101ms app.highlight 7ms RepoModel.GetById 94ms 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
 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
 9// no direct access
10defined('_JEXEC') or die;
11
12jimport('joomla.plugin.plugin');
13
14/**
15 * Editor Pagebreak buton
16 *
17 * @package Editors-xtd
18 * @since 1.5
19 */
20class plgButtonPagebreak extends JPlugin
21{
22	/**
23	 * Display the button
24	 *
25	 * @return array A two element array of (imageName, textToInsert)
26	 */
27	function onDisplay($name)
28	{
29		$app = JFactory::getApplication();
30
31		$doc = & JFactory::getDocument();
32		$template = $app->getTemplate();
33
34		$link = 'index.php?option=com_content&amp;task=ins_pagebreak&amp;tmpl=component&amp;e_name='.$name;
35
36		JHtml::_('behavior.modal');
37
38		$button = new JObject;
39		$button->set('modal', true);
40		$button->set('link', $link);
41		$button->set('text', JText::_('Pagebreak'));
42		$button->set('name', 'pagebreak');
43		$button->set('options', "{handler: 'iframe', size: {x: 400, y: 85}}");
44
45		return $button;
46	}
47}