autocatalog_view.php
1.41 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/**
* @author: Bunzia Alexander <nifus@mail.ru> <http://www.weblancer.net/users/nifus/>
* @copyright: Copyright (c) 2010, Bunzia Alexander
* @version: 1.0
* @license: http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @package HiLo CMS
*/
class autocatalog_view{
static $error = false;
static $act = 'index';
static $table = 'menu';
static $tmpl_path = false;
static $m_path = false;
static $m_url = false;
function __construct(){
}
static function get(){
global $MAIN_PAGE;
//self::$tmpl_path = MAIN_PATH.'/tmp/view/project/controls/'.$MAIN_PAGE -> dirname();
self::$m_path = MAIN_SOURCE_PATH.'/modules/'.$MAIN_PAGE -> dirname();
self::$m_url = MAIN_SOURCE_URL.'/modules/'.$MAIN_PAGE -> dirname();
include_once(self::$m_path.'/inc/url.php');
include_once(self::$m_path.'/inc/class.autocatalog.php');
include_once(MAIN_SOURCE_PATH.'/inc/class.html.php');
self::$act = !empty($_REQUEST['act']) ? $_REQUEST['act'] : self::$act;
if ( false===is_callable('self::'.self::$act, false)){
sys_error(ERROR_404);
}
$func = self::$act;
return self::$func();
}
static function index(){
$p = autoCatalog::query('f');
//$p -> set_debug(1);
$p -> orderby_sort('ASC');
$p -> where_alias($_GET['alias']);
$p -> get('*, images as imagesArray',false);
$t = new PHPTAL( self::$m_path.'/tmpl/view/main.html' );
$t -> row = $p -> row();
return $t -> execute();
}
}