-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
34 lines (25 loc) · 730 Bytes
/
index.php
File metadata and controls
34 lines (25 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace Parser\Classes;
/**
* @var obj $obj
*/
//init
require_once("init.php");
$news = new News();
$flash = new Flash();
(!empty($_SESSION['alert']) && $_SESSION['alert'] == 'success') ? $flash->success($obj) : null;
(!empty($_SESSION['alert']) && $_SESSION['alert'] == 'fail') ? $flash->fail($obj) : null;
if (!empty($_REQUEST['id']) && (int)$_REQUEST['id'] >0){
//news by ID
$news->get_news_object_by_id($obj, $_REQUEST['id']);
$obj->parse("CONTEXT", ".news_read");
} else {
//all news
$news->get_news_list($obj);
$obj->parse("CONTEXT", ".news");
}
//light menu
$obj->assign("ACTIVE_NEWS", 'active');
$obj->no_strict(); //для отладки
$obj->parse('result', "index");
$obj->FastPrint('result');