Exemplo n.º 1
0
 function saveZoneGroup()
 {
     global $toC_Json, $osC_Language;
     $data = array('zone_name' => $_REQUEST['geo_zone_name'], 'zone_description' => $_REQUEST['geo_zone_description']);
     if (osC_ZoneGroups_Admin::save(isset($_REQUEST['geo_zone_id']) && is_numeric($_REQUEST['geo_zone_id']) && $_REQUEST['geo_zone_id'] != -1 ? $_REQUEST['geo_zone_id'] : null, $data)) {
         $response = array('success' => true, 'feedback' => $osC_Language->get('ms_success_action_performed'));
     } else {
         $response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed'));
     }
     echo $toC_Json->encode($response);
 }
Exemplo n.º 2
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     if (isset($_GET['zID']) && is_numeric($_GET['zID'])) {
         $this->_page_contents = 'edit.php';
     } else {
         $this->_page_contents = 'new.php';
     }
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         $data = array('zone_name' => $_POST['zone_name'], 'zone_description' => $_POST['zone_description']);
         if (osC_ZoneGroups_Admin::save(isset($_GET['zID']) && is_numeric($_GET['zID']) ? $_GET['zID'] : null, $data)) {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
         } else {
             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
         }
         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module));
     }
 }