Example #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();
 }
Example #2
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;
 }
Example #3
0
    function defaultAction()
    {
        $html = '';
        $page = new PageCommon(s('Q&A'));
        $html .= $page->start();
        /*
        if (core::$config['current_language'] == 'en') {
        	$html .= '<div class="alert alert-info">Please let us know if you have any questions  <a href="mailto:info@gisconf.ru">info@gisconf.ru</a></div>';
        }
        */
        $html .= '<div class="row"><div class="col-md-offset-1 col-md-7">';
        $html .= '<h1>' . s('Q&A') . '</h1>';
        if ($this->is_admin) {
            $html .= '<p><a class="btn btn-primary" href="?action=insert">' . s('Add') . '</a></p>';
        }
        $data = core::$sql->get('*', DB . 'qa' . ' order by group_title_ru, title_ru');
        if (count($data)) {
            $last_group_title = '';
            $i = 0;
            $html .= '<ul>';
            foreach ($data as $row) {
                translateFields(array('group_title', 'title', 'description'), $row);
                if ($last_group_title != $row['group_title']) {
                    if ($i > 0) {
                        $html .= '</ul></li>';
                    }
                    $html .= '<li><a href="#' . crc32($row['group_title']) . '">' . escape($row['group_title']) . '</a><ul>';
                    $last_group_title = $row['group_title'];
                }
                $html .= '<li><a class="question-link" data-id="' . $row['id'] . '" href="#' . $row['id'] . '">' . escape($row['title']) . '</a></li>';
                $i++;
            }
            $html .= '</ul></li></ul>';
            $last_group_title = '';
            foreach ($data as $row) {
                translateFields(array('group_title', 'title', 'description'), $row);
                if ($last_group_title != $row['group_title']) {
                    $html .= '<h3><a name="' . crc32($row['group_title']) . '"></a>' . escape($row['group_title']) . '</h3>';
                    $last_group_title = $row['group_title'];
                }
                $html .= '<div id="question-block-' . $row['id'] . '" class="question-block"> <p style="margin-bottom:10px;"><strong><a name="' . $row['id'] . '"></a>' . escape($row['title']) . '</strong>';
                if ($this->is_admin) {
                    $html .= ' <a class="btn btn-xs" href="?action=update&id=' . $row['id'] . '"><spam>' . s('Edit') . '</a>' . ' <a class="btn btn-xs btn-danger btn-confirm" confirm-href="?action=delete&id=' . $row['id'] . '" confirm-question="' . s('Really delete?') . '"><spam>' . s('Delete') . '</a>';
                }
                $html .= '</p>
						<div class="qa-question-body" style="margin-left:10px;">
							<p>' . str_replace("\r\n", '<br>', str_replace("\r\n\r\n", '</p><p>', $row['description'])) . '</p>
						</div>
					</div>';
            }
        }
        $html .= '<script>
			$(document).ready(function () {
				$(".question-link").click(function () {
					$(".question-block").removeClass("hilite");
					$("#question-block-" + $(this).data("id")).addClass("hilite");
				});
				
				if (window.location.hash != "") {
					$(".question-block").removeClass("hilite");
					$("#question-block-" + parseInt(window.location.hash.substr(1))).addClass("hilite");
				}
			});
		</script>';
        $html .= '</div></div>';
        $html .= $page->stop();
        return $html;
    }