/** * This method handles all ajax related things; * * @param object $jinput Joomla's jinput Object. * * @since 1.0 * @return Json format result. */ function TjShip_AjaxCallHandler($jinput) { $post = $jinput->post; $qtcshiphelper = new qtcshiphelper(); $qtczoneShipHelper = new qtczoneShipHelper(); $ajaxTask = $jinput->get('plugtask'); if (empty($ajaxTask)) { $ajaxTask = $post->get('plugtask'); } switch ($ajaxTask) { case "addShipMethRate": $result = $qtcshiphelper->addShipMethRate($jinput); break; case "qtcDelshipMethRate": $result = $qtcshiphelper->qtcDelshipMethRate($jinput); break; case "updateShipMethRate": $result = $qtcshiphelper->qtcUpdateShipMethRate($jinput); break; case "getFieldHtmlForShippingType": $fieldData = $jinput->get('fieldData', array(), "ARRAY"); $result = $qtczoneShipHelper->getFieldHtmlForShippingType($fieldData); break; } // Return json formatted result return $result; }