8d65d0ce
andryeyev
init
|
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
<?php
Class Admin_ActionsController Extends baseController {
protected $_navig = array('name'=>"Íîâîñòè");
public function preDispatch(){
$auth = new Auth();
if($auth->is_login_session() == false)Redirect('/admin/auth/');
}
public function index($n = 0)
{
$menu = new Menu($this->lang);
$row = $menu->view_params('actions');
$this->tpl->assign('menu_one',$row);
$this->meta = array('title'=>$row['name']);
$Articles = new Actions($this->lang);
$res = $Articles->getNews(array('actio'=>1));
$this->tpl->assign("news",$res);
}
public function save($id = 0){
$Articles = new Actions($this->lang);
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$this->error = $Articles->valid($this->postParam,$_FILES);
if(!$this->error){
$Articles->save($this->postParam,$_FILES);
Redirect($this->url.'/admin/actions/');
}
}
if($id != null){
$row = $Articles->view($id);
$this->tpl->assign('news', $row);
}
}
public function delete($id = null){
if($id != null){
$Articles = new Actions($this->lang);
$Articles->delete($id);
Redirect($this->url.'/admin/actions/');
}
}
}
?>
|