public function addModuleAjax() { // Get the input $input = JFactory::getApplication()->input; $extensionid = $input->get('extensionid', 0, 'int'); $position = $input->get('position', '', 'string'); $ordering = $input->get('ordering', 0, 'int'); $type = $input->get('type', '', 'string'); // Get the model $model = $this->getModel('Module'); // Save the ordering $return = $model->addmodule($extensionid, $position, $ordering, $type); if ($return) { if (!class_exists('CKModulesManager')) { include_once JPATH_ROOT . '/components/com_modulesmanagerck/helpers/modulesmanager.php'; } $ckmodulesmanager = new CKModulesManager(); echo $ckmodulesmanager->createModule($return); return $ckmodulesmanager->createModule($return); } return false; // Close the application JFactory::getApplication()->close(); }
<?php /** * @name Modules Manager CK * @package com_modulesmanagerck * @copyright Copyright (C) 2013. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author Cedric Keiflin - http://www.template-creator.com - http://www.joomlack.fr */ // no direct access defined('_JEXEC') or die; $document = JFactory::getDocument(); $ckmodulesmanager = new CKModulesManager(); $input = new JInput(); $id = $input->get('id', 0, 'int'); $position = $input->get('position', '', 'string'); $title = $input->get('title', '', 'string'); $type = $input->get('type', '', 'string'); $ckmodulesmanager->createModule($id, $position, $title, $type);