Your IP : 216.73.216.209


Current Path : /home/musicpassiondjs40/djandreidis/plugins/pagebuilderck/module/
Upload File :
Current File : /home/musicpassiondjs40/djandreidis/plugins/pagebuilderck/module/module.php

<?php
/**
 * @copyright	Copyright (C) 2015 Cédric KEIFLIN alias ced1870
 * http://www.template-creator.com
 * http://www.joomlack.fr
 * @license		GNU/GPL
 * */
 
defined('_JEXEC') or die('Restricted access');
jimport('joomla.event.plugin');

class plgPagebuilderckModule extends JPlugin {

	private $context = 'PLG_PAGEBUILDERCK_MODULE';

	private $type = 'module';

	function __construct(&$subject, $params) {

		parent::__construct($subject, $params);
	}

	/* 
	 * Construct the Menu Item to drag into the interface
	 *
	 * Return Object with item data
	 */
	public function onPagebuilderckAddItemToMenu() {
		// load the language files of the plugin
		$this->loadLanguage();
		// create the menu item
		$menuitem = new stdClass();
		$menuitem->type = $this->type;
		$menuitem->group = 'other';
		$menuitem->title = JText::_($this->context . '_MENUITEM_TITLE');
		$menuitem->description = JText::_($this->context . '_MENUITEM_DESC');
		$menuitem->image = JUri::root(true) . '/plugins/pagebuilderck/module/assets/images/module.png';

		return $menuitem;
	}

	/* 
	 * Display the html code for the item to be used into the interface
	 *
	 * Return String the html code
	 */
	public function onPagebuilderckLoadItemContentModule() {
		$input = JFactory::getApplication()->input;
		$id = $input->get('ckid', '', 'string');
		// ckstyle and inner classes are needed to get the styles from the interface
		?>
		<div id="<?php echo $id; ?>" class="cktype" data-type="module" >
			<div class="ckstyle">
			</div>
			<div class="moduleck inner">
				<img style="display:block;margin:0 auto;padding:3px;" src="<?php echo PAGEBUILDERCK_MEDIA_URI ?>/images/module-fake.png" width="32" height="32" data-src="" />
				<h4 class="modulerow_title"><?php echo JText::_('CK_MODULE') ?></h4>
				<div class="moduleck_content"><?php echo JText::_('CK_MODULE_NOT_SELECTED') ?></div>
			</div>
		</div>
		<?php
	}

	/* 
	 * Load the interface for the item edition
	 *
	 * Return String the html code
	 */
	public function onPagebuilderckLoadItemOptionsModule() {
		// load the language files of the plugin
		$this->loadLanguage();
		// load the interface for the options
		$tpl = JPATH_SITE . '/plugins/pagebuilderck/module/layouts/edit_module.php';
		return $tpl;
	}

	/* 
	 * Display the html code for the item to be used into the frontend page
	 * @param string the item object from simple_html_dom
	 * 
	 * Return String the html code
	 */
	public function onPagebuilderckRenderItemModule($item) {
		return $item->innertext;
	}
}