private function templatePlaces() { GWF_Website::addJavascript($this->googleMapsPath()); GWF_Website::addJavascript(GWF_WEB_ROOT_NO_LANG . 'js/module/Profile/profile.js?v=57'); // GWF_Website::addJavascript(GWF_WEB_ROOT_NO_LANG.'js/3p/fancybox/jquery.fancybox.pack.js'); // GWF_Website::addCSS(GWF_WEB_ROOT_NO_LANG.'js/3p/fancybox/jquery.fancybox.css'); // GWF_Website::addCSS(GWF_WEB_ROOT_NO_LANG.'css/profile_poi.css'); $user = GWF_User::getStaticOrGuest(); $userid = $user->getID(); $table = GDO::table('GWF_ProfilePOI'); $tVars = array('user_id' => $userid, 'is_admin' => $user->isAdmin() ? 'true' : 'false', 'total' => $table->countRows(), 'visible' => $table->countRows(GWF_ProfilePOI::wherePermissions(), array('users', 'profiles', 'whitelist')), 'js_trans' => $this->jsTrans(), 'form_delete' => $this->formDelete(), 'pois' => GWF_ProfilePOI::getPOICount($userid), 'maxp' => $this->module->cfgAllowedPOIs(), 'api_key' => $this->module->cfgMapsApiKey(), 'protocol' => Common::getProtocol(), 'init_lat' => 0, 'init_lon' => 0); return $this->module->templatePHP('places.php', $tVars); }
public function execute() { GWF_Website::plaintext(); GWF3::setConfig('store_last_url', false); if (!$this->module->canReadPOIs()) { return $this->module->ajaxErr('err_poi_read_perm'); } $minlat = $this->module->lat('minlat'); $maxlat = $this->module->lat('maxlat'); $minlon = $this->module->lon('minlon'); $maxlon = $this->module->lon('maxlon'); $where_perms = GWF_ProfilePOI::wherePermissions(); $where_place = GWF_ProfilePOI::whereLocations($minlat, $maxlat, $minlon, $maxlon); $where = "({$where_perms}) AND ({$where_place})"; $joins = array('users', 'profiles', 'whitelist'); $result = GDO::table('GWF_ProfilePOI')->selectAll('pp_id, pp_uid, user_name, pp_lat, pp_lon, pp_descr', $where, '', $joins); die(json_encode($result)); }