function output() { global $main, $construct, $vars, $lang; if ($this->hide) { return; } if (file_exists(ROOT_PATH . 'config/mylogo.png')) { $this->tpl['mylogo'] = TRUE; $this->tpl['mylogo_dir'] = surl('/config/'); } $this->tpl['link_home'] = make_ref('/'); $this->tpl['link_login_form'] = make_ref('/users/loginform'); $this->tpl['link_logout'] = make_ref('/users', array('action' => 'logout')); $this->tpl['current_language'] = $vars['info']['current_language']; $this->tpl['search_url'] = make_ref('/search'); foreach ($vars['language']['enabled'] as $key => $value) { if ($value) { $this->tpl['languages'][$key]['name'] = $lang['languages'][$key] == '' ? $key : $lang['languages'][$key]; $this->tpl['languages'][$key]['link'] = self_ref(array("session_lang" => $key)); } } if ($main->userdata->logged) { $this->tpl['logged'] = $main->userdata->logged; $this->tpl['logged_username'] = isset($main->userdata->info['username']) ? $main->userdata->info['username'] : ""; $this->tpl['logged_title'] = get_user_title(); $this->tpl['link_user_profile'] = make_ref('/users', array("user" => $main->userdata->user)); } else { $this->tpl['link_register'] = make_ref('/users', array("user" => "add")); $this->tpl['link_restore_password'] = make_ref('/users', array("action" => "restore")); $this->tpl['link_register'] = make_ref('/users', array("user" => "add")); } return template($this->tpl, __FILE__); }
function installation_session() { /* * Begin session */ session_start(); define('ROOT_PATH', './'); if (!isset($_SESSION['config'])) { require_once dirname(__FILE__) . '/../config-sample/config.php'; $_SESSION['config'] = $config; // Add url staf $_SESSION['config']['site']['domain'] = $_SERVER['HTTP_HOST']; $absolute = explode('/', surl('/')); array_splice($absolute, -2); $absolute = implode('/', $absolute) . '/'; $_SESSION['config']['site']['url'] = abs_surl($absolute); } }
function output() { if ($_SERVER['REQUEST_METHOD'] == 'POST' && method_exists($this, 'output_onpost_' . $_POST['form_name'])) { return call_user_func(array($this, 'output_onpost_' . $_POST['form_name'])); } global $construct, $db, $vars, $main; $main->html->head->add_script("text/javascript", "./templates/basic/scripts/javascripts/fancyzoom/js-global/FancyZoom_packed.js"); $main->html->head->add_script("text/javascript", "./templates/basic/scripts/javascripts/fancyzoom/js-global/FancyZoomHTML_packed.js"); $main->html->body->tags['onload'] = "setupZoom();"; if ($db->cnt('', 'nodes ' . 'INNER JOIN users_nodes ON users_nodes.node_id = nodes.id ' . 'INNER JOIN users ON users_nodes.user_id = users.id', "nodes.id = " . intval(get('node')) . ' AND users.status = "activated"') == 0) { $main->message->set_fromlang('error', 'node_not_found'); return; } $this->tpl['node'] = $db->get('nodes.id, nodes.name, nodes.date_in, nodes.latitude, nodes.longitude, nodes.elevation, nodes.info, nodes.status, nodes.due_date, areas.name as area_name, regions.name as region_name, users.username AS owner_username, users.email AS owner_email', 'nodes LEFT JOIN areas ON nodes.area_id = areas.id LEFT JOIN regions ON areas.region_id = regions.id LEFT JOIN users_nodes ON users_nodes.node_id = nodes.id LEFT JOIN users ON users.id = users_nodes.user_id', "nodes.id = " . intval(get('node')) . " AND (users_nodes.owner = 'Y' OR users_nodes.owner IS NULL)"); $this->tpl['node'] = $this->tpl['node'][0]; $this->tpl['link_contact'] = self_ref(array("subpage" => "contact")); $this->tpl['table_ip_ranges'] = $construct->table($this->table_ip_ranges(), __FILE__); $this->tpl['table_ip_ranges_v6'] = $construct->table($this->table_ip_ranges_v6(), __FILE__); $this->tpl['table_dns'] = $construct->table($this->table_dns(), __FILE__); $this->tpl['table_nameservers'] = $construct->table($this->table_nameservers(), __FILE__); $this->tpl['table_links_p2p'] = $construct->table($this->table_links_p2p(), __FILE__); $t = $db->get('id, type', 'links', "node_id = " . intval(get('node'))); foreach ((array) $t as $key => $value) { if ($value['type'] == 'ap') { $this->tpl['table_links_ap'][$value['id']] = $construct->table($this->table_links_ap($value['id']), __FILE__); } } $this->tpl['table_links_free'] = $construct->table($this->table_links_free(intval(get('node'))), __FILE__); $this->tpl['table_ipaddr_subnets'] = $construct->table($this->table_ipaddr_subnets(), __FILE__); $this->tpl['table_services'] = $construct->table($this->table_services(), __FILE__); $t = $db->get('id, date_in, view_point, info', 'photos', "node_id = " . intval(get('node'))); foreach ((array) $t as $key => $value) { $this->tpl['photosview'][$value['view_point']] = $value; $this->tpl['photosview'][$value['view_point']]['image_s'] = surl($vars['folders']['photos'] . 'photo-' . $this->tpl['photosview'][$value['view_point']]['id'] . '-s.jpg'); $this->tpl['photosview'][$value['view_point']]['image'] = surl($vars['folders']['photos'] . 'photo-' . $this->tpl['photosview'][$value['view_point']]['id'] . '.jpg'); } $this->tpl['link_plot_link'] = make_ref('/nodes/plot_link', array("a_node" => $this->tpl['node']['id'])); if (isset($main->userdata->privileges['admin']) && $main->userdata->privileges['admin'] === TRUE || $db->cnt('', "users_nodes", "node_id = " . get('node') . " AND user_id = '" . $main->userdata->user . "'") > 0) { $this->tpl['edit_node'] = make_ref('/node_editor', array("node" => get('node'))); } include_map('map'); return template($this->tpl, __FILE__); }
* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ // Create configuration content $config_content = "<?php\n" . "\$config = " . var_export($_SESSION['config'], true) . ";\n"; if (!@file_put_contents($_GLOBALS['root_path'] . '/config/config.php', $config_content)) { show_error('Cannot write configuration at "<strong>config\\config.php</strong>. Check file permissions.'); } else { ?> <div class="finish"><em>You have succesfully finished installing WiND!</em> <p>In order to <a href="<?php echo surl('/../'); ?> ">view</a> the site, You have to <strong>remove folder "install"</strong>, eitherwise WiND will prevent you from normal operation.</p> <p>Don't forget that you can further parametrize WiND by directly editing <strong>config/config.php</strong>. You can find a documented configuration sample at <strong>config-sample/config.php</strong></p> </div> <?php }
function table_photosview() { global $db, $vars; $table_photosview = new table(array('TABLE_NAME' => 'table_photosview', 'FORM_NAME' => 'table_photosview')); $table_photosview->db_data('photos.id, photos.date_in, photos.view_point, photos.info', 'photos', 'photos.node_id = ' . intval(get('node'))); $i = 1; $t[0] = $table_photosview->data[0]; $t[0]['photo'] = 'photo'; foreach ((array) array('N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW', 'PANORAMIC') as $value) { foreach ((array) $table_photosview->data as $key => $valuek) { if ($table_photosview->data[$key]['view_point'] == $value) { $p = $key; break; } unset($p); } if (isset($p) && $table_photosview->data[$p]['view_point'] == $value) { $table_photosview->data[$p]['photo'] = surl($vars['folders']['photos'] . 'photo-' . $table_photosview->data[$p]['id'] . '-s.jpg'); $t[$i] = $table_photosview->data[$p]; } else { $t[$i] = array('id' => '', 'date_in' => '', 'view_point' => $value, 'info' => '', 'photo' => ''); } $i++; } $table_photosview->data = $t; $table_photosview->db_data_multichoice('photos', 'id'); $table_photosview->info['MULTICHOICE_LABEL'] = 'delete'; $table_photosview->db_data_remove('id'); return $table_photosview; }
echo surl('/../templates/basic/css/styles_packed.css'); ?> " > <link rel="icon" type="image/png" href="<?php echo surl('/../templates/basic/images/favicon_32.png'); ?> " / > <link rel="stylesheet" href="install.css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script> </head> <body> <div class="header"> <img alt="WiND Logo" src="<?php echo surl('/../templates/basic/images/main_logo.png'); ?> "> <ul class="steps"> <?php foreach ($step_keys as $idx => $sk) { if ($idx < $step_current_index) { echo '<li class="previous"><span>' . ($idx + 1) . '</span></li>'; } else { if ($idx == $step_current_index) { echo '<li class="current"><span>' . ($idx + 1) . '</span></li>'; } else { echo '<li class="next"><span>' . ($idx + 1) . '</span></li>'; } } }
/** * Include map backend dependencies */ function include_map_dependencies() { global $main, $smarty, $vars; // Include needed javascript include_js_language_tokens(); $js_dir = surl($smarty->template_dir . "/scripts/javascripts/"); if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') { $main->html->head->add_script('text/javascript', 'https://maps.google.com/maps/api/js?v=3&sensor=false'); } else { $main->html->head->add_script('text/javascript', 'http://maps.google.com/maps/api/js?v=3&sensor=false'); } $main->html->head->add_script('text/javascript', "{$js_dir}/map.js"); $main->html->head->add_script('text/javascript', "{$js_dir}/openlayers/OpenLayers.js"); $map_options = array(); $map_options['bound_sw'] = array($vars['map']['bounds']['min_latitude'], $vars['map']['bounds']['min_longitude']); $map_options['bound_ne'] = array($vars['map']['bounds']['max_latitude'], $vars['map']['bounds']['max_longitude']); $map_options['topology_url'] = make_ref('/map/json', array("node" => get('node'))); $map_options_string = json_encode($map_options); $main->html->head->add_extra("<script type=\"text/javascript\">\r\n\t\t\tmap_options = {$map_options_string};\r\n\t\t\t</script>"); }