-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInlineEditor.module.php
More file actions
67 lines (56 loc) · 2.04 KB
/
InlineEditor.module.php
File metadata and controls
67 lines (56 loc) · 2.04 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
require_once(__DIR__ . '/../NetDesign/NetDesign.module.php');
class InlineEditor extends NetDesign {
public function __construct() {
$this->RegisterClassDirectory(cms_join_path($this->GetModulePath(), 'libs'), '');
parent::__construct();
}
function GetVersion() {
return '1.0.0';
}
function GetAdminSection() {
return 'content';
}
function GetDependencies() {
if (self::GetCMSVersion() == 1) return array('NetDesign' => '1.0.0', 'ThumbnailEditor' => '1.0.0', 'TinyMCE' => '2.9.12');
else return array('NetDesign' => '1.0.0', 'ThumbnailEditor' => '1.0.0', 'MicroTiny' => '2.0');
}
function GetAdminMenuItems() {
if (!$this->CheckPermission('InlineEditor')) return array();
$ret = CmsAdminMenuItem::from_module($this);
$ret->title = $this->Lang('friendlyname');
return array($ret);
}
function VisibleToAdminUser() {
return $this->CheckPermission('InlineEditor');
}
function Install() {
// Create database table
$db = $this->db;
$table = $this->GetTable();
$query = "
CREATE TABLE IF NOT EXISTS `$table` (
`site_id` varchar(50) NOT NULL,
`page_alias` varchar(50) NOT NULL,
`name` varchar(50) NOT NULL,
`config` varchar(255) NOT NULL,
`value` longblob,
PRIMARY KEY (`site_id`, `page_alias`, `name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
";
$db->Execute($query);
// Create permission
$this->CreatePermission('InlineEditor', 'NetDesign CMS: Inline editing');
return false;
}
function Uninstall() {
// Remove database table
$db = $this->db;
$dict = NewDataDictionary($db);
$sql = $dict->DropTableSQL($this->GetTable());
$ret = $dict->ExecuteSQLArray($sql);
// Remove permission
$this->RemovePermission('InlineEditor');
return false;
}
}