Exemple #1
0
        $map_found = TRUE;
        $map = $anymap;
        if (!preg_match('/^(http|https):\\/\\//', $map['image']['url'])) {
            $map['image']['link'] = LFME_ROOT_PATH . '/storage/' . $data['project']['maps_folder'] . '/' . $map['image']['url'];
        } else {
            $map['image']['link'] = $map['image']['url'];
        }
        // прочитать настройки viewport для конкретной карты (перекрыв глобальные)
        if (isset($map['viewport'])) {
            $display_width = at($map['viewport'], 'width', $display_width);
            $display_height = at($map['viewport'], 'height', $display_height);
        }
    }
}
// проанализировать GET-параметры, перекрыв уже определенные выше.
$display_width = at($_GET, 'width', $display_width);
$display_height = at($_GET, 'height', $display_height);
// теперь 800 надо привести к 800px, а 80% так и оставить
if (strpos($display_height, '%') === FALSE && strpos($display_height, 'px') === FALSE) {
    $display_height .= 'px';
}
if (strpos($display_width, '%') === FALSE && strpos($display_width, 'px') === FALSE) {
    $display_width .= 'px';
}
// form template override values
$template_data = array('project_alias' => $project_alias, 'project_title' => $data['project']['title'], 'map_alias' => $map_alias, 'map_title' => $map['info']['title'], 'map_width' => $map['image']['width'], 'map_height' => $map['image']['height'], 'map_link' => $map['image']['link'], 'zoom_min' => $map['zoom']['zoom_min'], 'zoom_max' => $map['zoom']['zoom_max'], 'zoom_cur' => $map['zoom']['zoom_cur'], 'center_x' => $map['zoom']['center_x'], 'center_y' => $map['zoom']['center_y'], 'back_url' => LFME_ROOT_PATH . '/' . $project_alias, 'leafletmaparea_width' => $display_width, 'leafletmaparea_height' => $display_height, 'lfme_version' => LFME_VERSION, 'lfme_root' => LFME_ROOT_PATH);
// build template
$template_file = 'map_view.html';
$html = websun_parse_template_path($template_data, $template_file, LFME_TEMPLATES_PATH);
// print
echo $html;
<?php

/**
 * User: Arris
 * Date: 07.09.15, time: 1:37
 */
require_once '_required_lme.php';
$auth_result = $auth->activate($_POST['auth:activate_key']);
$html_callback = $auth_result['error'] ? '/' : '/login';
$template_data = array('error_messages' => $auth_result['message'], 'html_callback_timeout' => 10, 'html_callback' => $html_callback);
$tpl_file = 'auth_callbacks/auth.callback.activate.html';
$html = websun_parse_template_path($template_data, $tpl_file, '$/template');
echo $html;
<?php

require_once '_required_lme.php';
$is_can_edit = auth_CanIEdit();
$coords_col = intval($_GET['col']);
$coords_row = intval($_GET['row']);
$hex_coords = $_GET['hexcoord'];
$project_alias = isset($_GET['project_alias']) ? $_GET['project_alias'] : die('No such project!');
$map_alias = isset($_GET['map_alias']) ? $_GET['map_alias'] : die('No such map!');
//
/* @todo: вероятно сейчас надо проверить настройку карты "показывать ли туман войны"
 * посетителю с данной ролью. Кроме того, вероятно следует объединить checkContent и
 * getContent в 1 функцию! *
 */
$revision = $db->getRevisionLast($coords_col, $coords_row, $project_alias, $map_alias);
$dbh = null;
$TEMPLATE_DATA = array('tileinfo_title' => $revision['title'], 'tileinfo_text' => $revision['text']);
$tpl_file = 'get_content.ajaxed.html';
$html = websun_parse_template_path($TEMPLATE_DATA, $tpl_file, '$/template');
echo $html;