示例#1
0
 public function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     parent::__construct();
     if (isset($_GET['zeID']) && is_numeric($_GET['zeID'])) {
         $this->_page_contents = 'entries_edit.php';
     } else {
         $this->_page_contents = 'entries_new.php';
     }
     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
         $data = array('group_id' => $_GET[$this->_module], 'country_id' => $_POST['zone_country_id'], 'zone_id' => $_POST['zone_id']);
         if (osC_ZoneGroups_Admin::saveEntry(isset($_GET['zeID']) && is_numeric($_GET['zeID']) ? $_GET['zeID'] : 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 . '=' . $_GET[$this->_module]));
     }
 }
示例#2
0
 function saveZoneEntry()
 {
     global $toC_Json, $osC_Language;
     $data = array('group_id' => $_REQUEST['geo_zone_id'], 'country_id' => $_REQUEST['countries_id'], 'zone_id' => $_REQUEST['zone_id']);
     if (osC_ZoneGroups_Admin::saveEntry(isset($_REQUEST['geo_zone_entry_id']) && is_numeric($_REQUEST['geo_zone_entry_id']) ? $_REQUEST['geo_zone_entry_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);
 }