Your IP : 216.73.216.41


Current Path : /home/purehotels/public_html/plugins/editors-xtd/easyfolderlistingpro/
Upload File :
Current File : /home/purehotels/public_html/plugins/editors-xtd/easyfolderlistingpro/easyfolderlistingpro.php

<?php
/**
* @version		1.5
* @author		Michael A. Gilkes (michael@valorapps.com)
* @copyright	Michael Albert Gilkes
* @license		GNU/GPLv3

Easy Folder Listing Pro Companion Code Helper Plugin
Copyright (C) 2013-2016 Michael Albert Gilkes (Valor Apps)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

//imports
jimport('joomla.plugin.plugin'); //needed for MVC implementation


class plgButtonEasyFolderListingPro extends JPlugin
{
	/**
	 * Load the language file on instantiation.
	 *
	 * @var    boolean
	 * @since  3.1
	 */
	protected $autoloadLanguage = true;

	
	/**
	 * Constructor
	 *
	 * @access      public
	 * @param       object  $subject The object to observe
	 * @param       array   $config  An array that holds the plugin configuration
	 * @since       1.6
	 */
	public function __construct(&$subject, $config)
	{
		parent::__construct($subject, $config);
	}
	
	/**
	 * Display the button
	 *
	 * @param   string  $name  The name of the button to add
	 *
	 * @return array A two element array of (imageName, textToInsert)
	 */
	public function onDisplay($name)
	{
		$doc = JFactory::getDocument();
		$css = '.button2-left .eflp { background: url("../plugins/editors-xtd/easyfolderlistingpro/button2_eflp.png") 100% 0 no-repeat; } ';
		$css.= '.icon-eflp:before { content: url("../plugins/editors-xtd/easyfolderlistingpro/folder-only_16x16.png"); } ';
		$doc->addStyleDeclaration($css);
		
		JHtml::_('behavior.modal');

		$link = 'index.php?option=com_easyfolderlistingpro&amp;view=editorxtd&amp;tmpl=component&amp;e_name='.$name;

		$button = new JObject;
		$button->modal = true;
		$button->class = 'btn';
		$button->link = $link;
		$button->text = JText::_('PLG_EDITORSXTD_EFLP_BUTTON_EASYLISTING');
		$button->name = 'eflp';
		$button->options = "{handler: 'iframe', size: {x: 600, y: 400}}";

		return $button;
	}
}