Exemplo n.º 1
0
 public function ajax_redirect_save()
 {
     global $hook_suffix;
     $hook_suffix = '';
     $red_id = intval($_POST['id']);
     $this->check_ajax_referer('redirection-redirect_save_' . $red_id);
     $redirect = Red_Item::get_by_id($red_id);
     if ($redirect) {
         $redirect->update($_POST);
         $pager = new Redirection_Table(array());
         $json = array('html' => $pager->column_url($redirect), 'code' => $redirect->get_action_code());
     } else {
         $json['error'] = __('Unable to perform action') . ' - could not find redirect';
     }
     $this->output_ajax_response($json);
 }