users_control_points.php
2.49 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
68
69
70
71
72
73
74
75
76
77
78
79
<?php
class users_control_points{
public function __construct(){
global $MAIN_PAGE;
define('M_PATH',MAIN_SOURCE_PATH.'/modules/'.$MAIN_PAGE -> dirname() );
define('M_URL',MAIN_SOURCE_URL.'/modules/'.$MAIN_PAGE -> dirname() );
include_once(M_PATH.'/inc/url.php');
include_once(MAIN_SOURCE_PATH.'/inc/class.config.php');
//include_once(MAIN_SOURCE_PATH.'/inc/class.html.php');
$this -> points = array(
'points_register_user' => M_USERS_POINTS_REGISTER,
'points_auth' => M_USERS_POINTS_AUTH ,
'points_invite' => M_USERS_POINTS_INVITE,
'points_del_comment' => M_USERS_POINTS_DEL_COMMENT,
'points_add_comment' => M_USERS_POINTS_ADD_COMMENT,
'points_add_news' => M_USERS_POINTS_ADD_NEWS ,
'points_del_news' => M_USERS_POINTS_DEL_NEWS ,
'points_add_articles' => M_USERS_POINTS_ADD_ARTICLES ,
'points_del_articles' => M_USERS_POINTS_DEL_ARTICLES ,
'points_add_questions' => M_USERS_POINTS_ADD_QUESTION ,
'points_del_questions' => M_USERS_POINTS_DEL_QUESTION ,
'points_add_answer' => M_USERS_POINTS_ADD_ANSWER ,
'points_del_answer' => M_USERS_POINTS_DEL_ANSWER ,
'points_best_answer' => M_USERS_POINTS_BEST_ANSWER,
'points_add_pub' => M_USERS_POINTS_ADD_PUB ,
'points_del_pub' => M_USERS_POINTS_DEL_PUB ,
'points_add_post_blog' => M_USERS_POINTS_ADD_POST_BLOG ,
'points_del_post_blog' => M_USERS_POINTS_DEL_POST_BLOG ,
'points_interview' => M_USERS_POINTS_INTERVIEW ,
'points_add_brand' => M_USERS_POINTS_ADD_BRAND ,
'points_del_brand' => M_USERS_POINTS_DEL_BRAND ,
'points_add_goods' => M_USERS_POINTS_ADD_GOODS ,
'points_del_goods' => M_USERS_POINTS_DEL_GOODS ,
'points_register_org' => M_USERS_POINTS_REG_ORG ,
);
}
public function get(){
global $MAIN_PAGE;
if ( !empty($_REQUEST['send']) ){
$this -> save();
// ïåðåçàãðóæàåì îáíîâë¸ííûå ïåðåìåííûå
}
$t = new PHPTAL( M_PATH.'/tmpl/control_points/main.html' );
$t -> ADMIN_URL = sys_url(ADMIN_URL);
$t -> URL_USERS_CONTROL_POSTS = sys_url(URL_USERS_CONTROL_POSTS);
include(M_PATH.'/cache/points.php');
$rows = array();
foreach( $this -> points as $k=>$v ){
$rows[]=array('name'=>$k,'lang'=>$v,'value'=>$MAIN_PAGE -> config($k) );
}
$t -> points = $rows;
return $t -> execute();
}
private function save(){
include_once(MAIN_SOURCE_PATH.'/inc/class.config.php');
$c = new config(M_PATH.'/cache/points.php');
foreach( $this -> points as $k=>$v ){
$c -> set_str($k,$_REQUEST[$k]);
}
$c -> save();
}
}
?>