예제 #1
0
 /**
  * singleton getter
  *
  * @param void
  * @return PApps
  */
 public static function get()
 {
     if (!isset(self::$_instance)) {
         $c = __CLASS__;
         self::$_instance = new $c();
     }
     return self::$_instance;
 }
예제 #2
0
 /**
  * @return select-option box with all the countries
  */
 private function getAllCountriesSelectOption()
 {
     $countries = MOD_geo::get()->getAllCountries();
     $out = "<select name=\"country\">\n";
     foreach ($countries as $countryId => $country) {
         $out .= '<option value="' . $countryId . '">' . $country . "</option>\n";
     }
     $out .= "</select>\n";
     $geonames = MOD_geonames::get();
     // get the singleton instance
     $id = $geonames->getUpdate();
     return $out;
 }
예제 #3
0
 public function AdminCallback($args, $action, $mem_redirect, $mem_resend)
 {
     $post_args = $args->post;
     $mem_redirect->action = $action = $post_args['action'];
     if ($action == 'renew') {
         set_time_limit(0);
         $mem_redirect->renew = $result = $this->_model->RenewGeo();
         $mem_redirect->counter = $result['counter'];
         $mem_redirect->error = $result['error'];
     }
     if ($action == 'recount') {
         set_time_limit(0);
         $mem_redirect->recount = $result = $this->_model->updateGeoCounters();
     }
     if ($action == 'byId') {
         $mem_redirect = $result = $this->_model->getDataById($post_args['id'], 'de');
     }
     if ($action == 'getUpdates') {
         $geonames = MOD_geonames::get();
         $mem_redirect = $result1 = $geonames->getUpdate();
         $mem_redirect = $result2 = $geonames->getAltnamesUpdate();
     }
 }