Esempio n. 1
0
 /**
  * Stores countries settings
  *
  * Returns null if nothing is changed.
  * @return    boolean               True on success, false on failure,
  *                                  or null on noop.
  */
 private static function storeCountries()
 {
     // Skip if not submitted or if the list is empty.
     // At least one Country needs to be active.
     // "list1" contains the active Country IDs
     if (empty($_POST['countries']) || empty($_POST['list1'])) {
         return null;
     }
     $list = contrexx_input2raw($_POST['list1']);
     sort($list);
     $arrCountryIdActive = array_keys(\Cx\Core\Country\Controller\Country::getNameArray(true));
     sort($arrCountryIdActive);
     if ($list == $arrCountryIdActive) {
         return null;
     }
     self::$changed = true;
     $strCountryIdActive = join(',', $list);
     return \Cx\Core\Country\Controller\Country::activate($strCountryIdActive);
 }