示例#1
0
 function defaultAction()
 {
     $item = Core::$sql->row('*', DB . 'content', 'id=' . Core::$sql->s($this->id));
     translateFields(array('title', 'description'), $item);
     $page = new PageCommon($item['title']);
     $html = '<div class="row"><div class="col-md-offset-1 col-md-7">' . '<h1>' . escape($item['title']) . '</h1>' . $item['description'] . '</div></div>';
     return $page->start() . $html . $page->stop();
 }
示例#2
0
    function okAction()
    {
        $html = '';
        $page = new PageCommon(s('Feedback'));
        $html .= $page->start();
        $html .= '<div class="row" style="margin-bottom:200px"><div class="col-md-offset-2 col-md-8"><h2>' . s('Thanks for subscribing!') . '</h2>';
        $html .= '<p>' . s('We will answer shortly.') . '</p>
			<p><a href="' . Core::$config['http_home'] . '">' . s('Home') . '</a></p>
			</div></div>';
        $html .= $page->stop();
        return $html;
    }
    function okAction()
    {
        $html = '';
        $page = new PageCommon(s('Newsletter'));
        $html .= $page->start();
        $html .= '<div class="row"><div class="col-md-offset-1 col-md-6">
			<h3>' . s('Thanks for subscribing!') . '</strong></h3>
			<p>' . s('Your email was added to the newsletter list.') . '</p>
			<p><a href="../">' . s('Home') . '</a></p>
		</div></div>';
        $html .= $page->stop();
        return $html;
    }
示例#4
0
 function defaultAction()
 {
     $html = '';
     $page = new PageCommon(s('News'));
     $html .= $page->start();
     $html .= '<div class="row" style="margin-bottom:200px"><div class="col-md-offset-1 col-md-7"><h1>' . s('News') . '</h1><ul class="news-list">';
     foreach (Core::$sql->get('*', DB . 'news order by datetime_stamp desc') as $row) {
         translateFields(array('title', 'description'), $row);
         $html .= '<li><div class="item-date">' . time_format_date($row['datetime_stamp']) . '</div>' . '<h3><a name="' . $row['id'] . '"></a>' . $row['title'] . '</h3>' . '<p>' . $row['description'] . '</p>' . '</li>';
     }
     $html .= '</ul></div></div>';
     $html .= $page->stop();
     return $html;
 }
示例#5
0
    function lostPasswordChangedAction()
    {
        $html = '';
        $page = new PageCommon(s('Смена пароля'));
        $html .= $page->start();
        $html .= '<div class="offset2 span6 text">
			<h3>' . s('Смена пароля') . '</strong></h3>
			<p>' . s('Пароль успешно изменен.') . '</p>
			<ul>
				<li><a href="' . core::$config['http_home'] . 'login/">' . s('Войти') . '</a></li>
				<li><a href="' . core::$config['http_home'] . '">' . s('Вернуться на главную') . '</a></li>
			</ul>
		</div>';
        $html .= $page->stop();
        return $html;
    }
示例#6
0
    function defaultAction()
    {
        $page = new PageCommon(s('Metro4all'));
        $page->addResource('style', 'css/metro4all-promo.css');
        $page->addResource('style', 'css/metro4all-index.css');
        $html = '

	<div id="carousel-example-generic" class="carousel slide">
		<!-- Indicators -->
		<ol class="carousel-indicators">
			<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
			<li data-target="#carousel-example-generic" data-slide-to="1"></li>
			<li data-target="#carousel-example-generic" data-slide-to="2"></li>
			<li data-target="#carousel-example-generic" data-slide-to="3"></li>
		</ol>

		<!-- Wrapper for slides -->
		<div class="carousel-inner">
			<div class="item active">
				<img src="/img/part-1.jpg">
				<div class="carousel-caption">
					' . s('We surveyed all subway stations of Moscow and Saint-Petersburg') . '
				</div>
				<div class="photo-copyright">Фото: Wikipedia <a href="http://commons.wikimedia.org/wiki/File:Metro_SPB_Line1_Lesnaya_pavilion.jpg?uselang=ru">1</a> <a href="http://commons.wikimedia.org/wiki/File:Kunts_12.jpg">2</a></div>
			</div>
			<div class="item">
				<img src="/img/part-4.jpg">
				<div class="carousel-caption">
					 ' . s('...and measured all elements of infrastructure important for movement of people...') . '
				</div>
				<div class="photo-copyright">Фото: Максим Дубинин//NextGIS</div>
			</div>
			<div class="item">
				<img src="/img/part-3.jpg">
				<div class="carousel-caption">
					' . s('...especially for people with special needs ...') . '
				</div>
				<div class="photo-copyright">Фото: Максим Дубинин//NextGIS</div>
			</div>
			<div class="item">
				<img src="/img/part-2.jpg">
				<div class="carousel-caption">
					' . s('...start using it now...') . '
				</div>
			</div>
		</div>

		<!-- Controls -->
		<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
			<span class="icon-prev"></span>
		</a>
		<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
			<span class="icon-next"></span>
		</a>
	</div>
';
        /*
        $html .= '
        	<div class="row">
        		<div class="col-md-8 col-md-offset-2">
        			<div class="news">
        				<h2><a href="news/" style="color: #D8A300;">' . s('News') . '</a></h2>
        				<ul>
        ';
        
        		foreach (Core::$sql->get('*', DB . 'news order by datetime_stamp desc limit 3') as $row)
        		{
        			$html .= '<li><div class="item-date">' . time_format_date($row['datetime_stamp']) . '</div>'
        				. '<h3><a href="news/#' . $row['id'] . '">' . ($row['title_' . Core::$config['current_language']] ? $row['title_' . Core::$config['current_language']] : $row['title_en']) . '</a></h3>'
        				. '<p>' . ($row['description_' . Core::$config['current_language']] ? $row['description_' . Core::$config['current_language']] : $row['title_en']) . '</p>'
        				. '</li>';
        		}
        
        $html .= '
        				</ul>
        			</div>
        		</div>
        	</div>
        ';
        */
        $html .= '
<script type="text/javascript">

	$(document).ready(function () {
		$(".carousel").carousel({
			interval: 5000,
			cycle: true
		})
	});

</script>

	';
        return $page->start() . $html . $page->stop();
    }
示例#7
0
    function updateAction()
    {
        if (!$this->is_admin) {
            go(core::$config['http_home'] . 'faq/');
        }
        if (($item = $this->getQa(request_int('id'))) === false) {
            go(core::$config['http_home']);
        }
        $html = '';
        $errors = array();
        $is_posted = request_int('is_posted');
        $jump_to = 'update_qa_title';
        if ($is_posted) {
            if (!count($errors) && !request_str('title')) {
                $errors[] = s('Пожалуйста, укажите вопрос.');
                $jump_to = 'update_qa_title';
            }
            if (!count($errors) && !request_str('group_title')) {
                $errors[] = s('Пожалуйста, укажите группу.');
                $jump_to = 'insert_qa_group_title';
            }
            if (!count($errors)) {
                $fields = array();
                foreach (Core::$config['languages'] as $url => $languages) {
                    $fields['title_' . $url] = core::$sql->s(request_str('title_' . $url));
                    $fields['group_title_' . $url] = core::$sql->s(request_str('group_title_' . $url));
                    $fields['description_' . $url] = core::$sql->s(request_str('description_' . $url));
                }
                core::$sql->update($fields, DB . 'qa', 'id=' . core::$sql->i($item['id']));
                go(core::$config['http_home'] . 'faq/');
            }
        }
        $page = new PageCommon(s('Изменить вопрос'));
        $html .= $page->start();
        $html .= '<p><a href="./">' . s('Q&A') . '</a> &rarr;</p>
				<h2>' . s('Изменить вопрос') . '</h2>';
        if (count($errors)) {
            $html .= '<div class="alert alert-error"><p>' . escape($errors[0]) . '</p></div>';
        }
        $form = new Form('update_qa', false, 'post');
        $html .= '<div class="well">' . $form->start() . $form->addVariable('is_posted', 1) . $form->addVariable('action', 'update');
        foreach (Core::$config['languages'] as $url => $language) {
            $html .= $form->addString('title_' . $url, s('Вопрос') . ' ' . $language['title'], $is_posted ? request_str('title_' . $url) : $item['title_' . $url], array('class' => 'span7'));
        }
        foreach (Core::$config['languages'] as $url => $language) {
            $html .= $form->addString('group_title_' . $url, s('Группа') . ' ' . $language['title'], $is_posted ? request_str('group_title_' . $url) : $item['group_title_' . $url], array('class' => 'span7'));
        }
        foreach (Core::$config['languages'] as $url => $language) {
            $html .= $form->addString('description_' . $url, s('Ответ') . ' ' . $language['title'], $is_posted ? request_str('description_' . $url) : $item['description_' . $url], array('class' => 'span7', 'style' => 'height:250px;'));
        }
        $html .= $form->submit(s('Update')) . '</div>';
        $html .= '<script> $(document).ready(function() { $("#' . $jump_to . '").focus(); }); </script>';
        $html .= $page->stop();
        return $html;
    }
示例#8
0
    function defaultAction()
    {
        $page = new PageCommon(s('Metro4all'));
        $page->addResource('style', 'vendor/select2-3.4.2/select2.css');
        $page->addResource('script', 'vendor/select2-3.4.2/select2.js');
        $page->addResource('script', 'vendor/select2-3.4.2/select2_locale_ru.js');
        $page->addResource('style', 'vendor/leaflet-0.6.4/leaflet.css');
        $page->addResource('style', 'vendor/leaflet-0.6.4/leaflet.ie.css', 'lte IE 8');
        $page->addResource('script', 'vendor/leaflet-0.6.4/leaflet.js');
        $page->addResource('style', 'http://demo.nextgis.ru/metro4all/static/leaflet.label.css');
        $page->addResource('style', 'http://demo.nextgis.ru/metro4all/static/lightbox2/css/lightbox.css');
        $page->addResource('style', 'css/m4a.css');
        $city = Core::$config['cities'][$this->currentCity];
        $globalConfig = 'var global_config = {
              mainmap: {"center": [' . $city['lat'] . ',' . $city['lon'] . '], "zoom": 10 },
              city: "' . $this->currentCity . '",
              route_css_class: "' . $city['route_css_class'] . '",
              language: "' . Core::$config['current_language'] . '"
        }';
        $html = '
<div class="row">
      <div class="col-md-9">
      <form id="mainform" role="form">
      <div class="col-md-4">
        <legend>' . s('From') . '</legend>
        <div class="form-group">
          <div style="white-space:nowrap">
            <input id="metroStartStation" name="station_from" type="hidden" style="max-width: 87%;">
            <button id="metroStartStationExtent" type="button" class="btn" title="' . s('Zoom to') . '" disabled style="padding:0;background-color:transparent"><span class="glyphicon glyphicon-screenshot" style="font-size:19px"></span></button>
          </div>
        </div>
        <div class="form-group">
          <input class="form-control" id="metroStartInputName" type="text" placeholder="' . s('Choose entrance on the map') . '" disabled>
          <input name="portal_from" class="form-control" id="metroStartInputID" type="hidden">
        </div>
      </div>
      <div class="col-md-4">
        <legend>' . s('To') . '</legend>
        <div class="form-group">
          <div style="white-space:nowrap">
            <input id="metroEndStation" name="station_to" type="hidden" style="max-width: 87%;">
            <button id="metroEndStationExtent" type="button" class="btn" title="' . s('Zoom to') . '" disabled style="padding:0;background-color:transparent"><span class="glyphicon glyphicon-screenshot" style="font-size:19px"></span></button>
          </div>
        </div>
        <div class="form-group">
          <input class="form-control" id="metroEndInputName" type="text" placeholder="' . s('Choose exit on the map') . '" disabled>
          <input name="portal_to" class="form-control" id="metroEndInputID" type="hidden">
        </div>
      </div>
        <div class="col-md-4">
        <legend>' . s('Limitations') . '</legend>
        <div class="btn-group profiles" data-toggle="buttons">
          <label id="profile_man" class="btn btn-default profile" data-profile="man" data-type="sample" title="' . s('I am walking') . '">
            <input type="radio" name="options" id="option1">
          </label>
          <label id="profile_wheelchair" class="btn btn-default profile" data-profile="wheelchair" data-type="input" title="' . s('I am on a wheelchair') . '">
            <input type="radio" name="options" id="option2">
          </label>
          <label id="profile_trolley" class="btn btn-default profile" data-profile="trolley" data-type="input" title="' . s('I am with a cart') . '">
            <input type="radio" name="options" id="option3">
          </label>
        </div>
        <div class="profile-descr"></div>
      </div>
      </form>
      <div class="clearfix"></div>
      <span>&nbsp;</spn>
      <div id="map">
          <div id="mainMap" style="height: 480px;"></div>
      </div>
      </div>
      <div class="col-md-3">
        <legend>' . s('Route') . '</legend>
        <ul class="route-paging pagination pagination-sm"></ul>
        <div id="routePanel" class="city-' . $this->currentCity . '"></div>
      </div>
    </div>

	<script> var ajax="http://' . Core::$config['http_domain'] . '/ajax/"; </script>

	<script>' . $globalConfig . '</script>
	<script src="http://demo.nextgis.ru/metro4all/static/TileLayer.Grayscale.js"></script>
	<script src="http://demo.nextgis.ru/metro4all/static/mustache/mustache.js"></script>
	<script src="http://demo.nextgis.ru/metro4all/static/imagesloaded/imagesloaded.pkgd.min.js"></script>
	<script src="http://demo.nextgis.ru/metro4all/static/m4a/m4a.config.js"></script>

	<script>
		m4a.viewmodel.pathToSchemes = "http://demo.nextgis.ru/metro4all/data/" + global_config.city + "/schemes/";
	</script>

    <script src="http://demo.nextgis.ru/metro4all/static/TileLayer.Grayscale.js"></script>
    <script src="http://demo.nextgis.ru/metro4all/static/leaflet.label.js"></script>
    <script src="http://demo.nextgis.ru/metro4all/static/lightbox2/js/lightbox.js"></script>

    <script src="http://demo.nextgis.ru/metro4all/static/m4a/translations/m4a.' . Core::$config['current_language'] . '.js"></script>
    <script src="http://demo.nextgis.ru/metro4all/static/m4a/m4a.loader.js"></script>
    <script src="http://demo.nextgis.ru/metro4all/static/m4a/m4a.stations.js"></script>
    <script src="http://demo.nextgis.ru/metro4all/static/m4a/m4a.url.js"></script>
    <script src="http://demo.nextgis.ru/metro4all/static/m4a/m4a.profiles.js"></script>
    <script src="http://demo.nextgis.ru/metro4all/static/m4a/m4a.routes.js"></script>
    <script src="http://demo.nextgis.ru/metro4all/static/m4a/mapControls/m4a.extent.js"></script>
    <script src="http://demo.nextgis.ru/metro4all/static/m4a/inline.js"></script>
    <script src="http://demo.nextgis.ru/metro4all/static/blockui/jquery.blockUI.js"></script>';
        return $page->start() . $html . $page->stop();
    }