function save() { $mainframe =& JFactory::getApplication(); JRequest::checkToken() or jexit('Invalid Token'); require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'models' . DS . 'item.php'; $model = new K2ModelItem(); $model->save(true); $mainframe->close(); }
function save() { $mainframe = JFactory::getApplication(); JRequest::checkToken() or jexit('Invalid Token'); JRequest::setVar('tmpl', 'component'); $language = JFactory::getLanguage(); $language->load('com_k2', JPATH_ADMINISTRATOR); require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'models' . DS . 'item.php'; $model = new K2ModelItem(); $model->save(true); $mainframe->close(); }