function tfuse_ajax_newsletter_save_service() { tf_can_ajax(); if ($this->request->POST('service') == '') { return array('status' => -1, 'message' => __('No newsletter service provided.', 'tfuse')); } if (!in_array($this->request->POST('service'), $this->valid_services)) { return array('status' => -1, 'message' => __('Invalid Service Provided.', 'tfuse')); } $this->model->set_service($this->request->POST('service')); return 1; }
/** * @ajax */ function tfuse_ajax_slider_title_exists() { tf_can_ajax(); if ($this->request->isset_POST('slider_title')) { if ($this->model->title_exists($this->request->POST('slider_title'))) { tfjecho(array('status' => -1, 'message' => apply_filters('tf_ext_slider_ajax_slider_title_exists_1', __('A slider with the title you have provided, already exists. Please give a different title for your slider.', 'tfuse')))); } else { tfjecho(array('status' => 1, 'message' => __('OK', 'tfuse'))); } } else { tfjecho(array('status' => -1, 'message' => apply_filters('tf_ext_slider_ajax_slider_title_exists_2', __('You have not provided a title for your slider. Please, do so.', 'tfuse')))); } die; }
/** * @ajax */ public function tfuse_ajax_sidebars_delete_settings() { tf_can_ajax(); $data = explode('+', $this->request->POST('data')); $vars = array(); if (isset($data[0])) { if (isset($data[1])) { $vars['subtype'] = $data[1]; if (isset($data[2])) { $vars['id'] = $data[2]; } } } if ($this->model->delete_settings($vars)) { tfjecho(array('status' => 1)); } die; }