Changeset 1453 for trunk/wifidog-auth/wifidog/classes/Node.php
- Timestamp:
- 02/25/10 15:56:33 (2 years ago)
- Files:
-
- 1 modified
-
trunk/wifidog-auth/wifidog/classes/Node.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/wifidog/classes/Node.php
r1444 r1453 825 825 $this->refresh(); 826 826 } 827 827 828 /** 829 * Returns whether the node should be shown on a map or is invisible 830 * 831 */ 832 833 public function showOnMap() 834 { 835 return (($this->_row['show_node_on_map'] == 't') ? true : false); 836 } 837 838 /** Set if this node be shown on map 839 * @param $value The new value, true or false 840 * @return true on success, false on failure */ 841 function setShowOnMap($value) 842 { 843 $retval = true; 844 if ($value != $this->showOnMap()) 845 { 846 $db = AbstractDb::getObject(); 847 $value ? $value = 'TRUE' : $value = 'FALSE'; 848 $retval = $db->execSqlUpdate("UPDATE nodes SET show_node_on_map = {$value} WHERE node_id = '{$this->getId()}'", false); 849 $this->refresh(); 850 } 851 return $retval; 852 } 853 828 854 public function getCivicNumber() 829 855 { … … 1307 1333 $_data = InterfaceElements::generateInputText("node_" . $node_id . "_map_url", $this->getMapURL(), "node_map_url_input"); 1308 1334 $_html_node_gis_data[] = InterfaceElements::generateAdminSectionContainer("node_map_url", $_title, $_data); 1335 1336 $_title = _("Show node on map"); 1337 $help = _("Should this node be visible on the map when deployed?"); 1338 $_data = InterfaceElements::generateInputCheckbox("node_" . $node_id . "_show_on_map", "", _("Yes"), $this->showOnMap(), "node_show_on_map_input"); 1339 $_html_node_gis_data[] = InterfaceElements::generateAdminSectionContainer("node_show_on_map", $_title, $_data, $help); 1309 1340 1310 1341 // Build section … … 1509 1540 $this->setGisLocation(new GisPoint($_REQUEST[$gis_lat_name], $_REQUEST[$gis_long_name], .0)); 1510 1541 } 1542 1543 $name = "node_".$node_id."_show_on_map"; 1544 $this->setShowOnMap(empty ($_REQUEST[$name]) ? false : true); 1511 1545 1512 1546 // Statistics
