/** * */ public function ajax() { $app = JFactory::getApplication(); $input = $app->input; try { $container = RokCommon_Service::getContainer(); foreach ($container['roksprocket.layouts'] as $layout) { if (isset($layout->paths) && isset($layout->ajax->dir)) { $paths = $layout->paths; $ajax_dir = $layout->ajax->dir; foreach ($paths as $priority => $path) { $ajax_path = $path . '/' . $ajax_dir; if (is_dir($ajax_path)) { RokCommon_Ajax::addModelPath($ajax_path, 'RokSprocketSiteLayoutAjaxModel', $priority); } } } } $model = $input->get('model', null, 'word'); $action = $input->get('model_action', $input->get('action', null, 'word'), 'word'); if (isset($_REQUEST['params'])) { $params = RokCommon_Ajax::smartStripSlashes($_REQUEST['params']); } echo RokCommon_Ajax::run($model, $action, $params); } catch (Exception $e) { $result = new RokCommon_Ajax_Result(); $result->setAsError(); $result->setMessage($e->getMessage()); echo json_encode($result); } }
public function ajax() { try { RokCommon_Ajax::addModelPath(JPATH_SITE . '/components/com_rokgallery/lib/RokGallery/Site/Ajax/Model', 'RokGallerySiteAjaxModel'); $model = JRequest::getString('model'); $action = JRequest::getString('action'); $params = JRequest::getString('params'); echo RokCommon_Ajax::run($model, $action, $params); } catch (Exception $e) { $result = new RokCommon_Ajax_Result(); $result->setAsError(); $result->setMessage($e->getMessage()); echo json_encode($result); } }
public function ajax() { try { RokCommon_Ajax::addModelPath(JPATH_SITE . '/components/com_rokgallery/lib/RokGallery/Admin/Ajax/Model', 'RokGalleryAdminAjaxModel'); $model = JRequest::getString('model'); $action = JRequest::getString('action'); if (isset($_REQUEST['params'])) { $params = $this->smartstripslashes($_REQUEST['params']); } echo RokCommon_Ajax::run($model, $action, $params); } catch (Exception $e) { $result = new RokCommon_Ajax_Result(); $result->setAsError(); $result->setMessage($e->getMessage()); echo json_encode($result); } }
/** * */ public function ajax() { try { $app = JFactory::getApplication(); $input = $app->input; RokCommon_Ajax::addModelPath(JPATH_SITE . '/components/com_roksprocket/lib/RokSprocket/Admin/Ajax/Model', 'RokSprocketAdminAjaxModel'); $model = $input->getWord('model', null); $action = $input->getWord('model_action', null); if (isset($_REQUEST['params'])) { $params = $this->smartstripslashes($_REQUEST['params']); } echo RokCommon_Ajax::run($model, $action, $params); } catch (Exception $e) { $result = new RokCommon_Ajax_Result(); $result->setAsError(); $result->setMessage($e->getMessage()); echo json_encode($result); } }