forked from mappiamo/mapi-geoCMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mtemplate.php
44 lines (30 loc) · 1.3 KB
/
mtemplate.php
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
<?php
// no direct access to this file
defined( 'DACCESS' ) or die;
class MModule_MTemplate extends M_Module {
public function mtemplate() {
$this->set_page_title( '#mappiamo - Templates' );
}
public function template_list() {
$templates = $this->model( 'get_templates' );
$forinstall = $this->model( 'get_forinstall' );
$this->view( 'default', array( 'installed' => $templates, 'forinstall' => $forinstall ) );
}
public function template_enable() {
$this->set_as_ajax();
if ( isset( $_GET['template_action'] ) && mapi_csrf_check( MGet::string( 'mapi_csrf' ) ) ) $this->model( 'enable_template', $this->get_object() );
}
public function template_disable() {
$this->set_as_ajax();
if ( isset( $_GET['template_action'] ) && mapi_csrf_check( MGet::string( 'mapi_csrf' ) ) ) $this->model( 'disable_template', $this->get_object() );
}
public function template_install() {
$this->set_as_ajax();
if ( isset( $_GET['template_action'] ) && mapi_csrf_check( MGet::string( 'mapi_csrf' ) ) ) $this->model( 'install_template', MGet::string( 'name' ) );
}
public function template_uninstall() {
if ( isset( $_POST['template_uninstall'] ) && mapi_csrf_check( MGet::string( 'mapi_csrf' ) ) ) $this->model( 'uninstall_templates' );
$this->template_list();
}
}
?>