-
Notifications
You must be signed in to change notification settings - Fork 0
/
controller.php
68 lines (54 loc) · 1.81 KB
/
controller.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php /** @noinspection PhpUnusedLocalVariableInspection */
/** @noinspection PhpUndefinedConstantInspection */
/** @noinspection PhpUndefinedFunctionInspection */
/** @noinspection PhpUndefinedClassInspection */
/** @noinspection AutoloadingIssuesInspection */
/** @noinspection PhpUnused */
defined('C5_EXECUTE') or die("Access Denied.");
/**
* Class C5BeautifierPackage
* @method configurePackage(C5BeautifierPackage $pkg)
*/
class C5BeautifierPackage extends Package
{
protected $pkgHandle = 'c5_beautifier';
protected $appVersionRequired = "5.4.1";
protected $pkgVersion = "0.1.1";
public function getPackageDescription()
{
return t("CodeMirror syntax highlighter for textarea working together with tinyMCE in Concrete5 ");
}
public function GetPackageName()
{
return t("C5 syntax highlighter based on CodeMirror v0.1");
}
public function install()
{
$pkg = parent::install();
/* @var $fh FileHelper */
$fh = Loader::helper('file');
$sourceCSS = DIR_PACKAGES . "/" . $this->pkgHandle . "/css/";
$targetCSS = DIR_BASE . "/css/";
$fh->copyAll($sourceCSS, $targetCSS, $mode = null); // @ $mode = 0777
$sourceJS = DIR_PACKAGES . "/" . $this->pkgHandle . "/js/.";
$targetJS = DIR_BASE . "/js/";
$fh->copyAll($sourceJS, $targetJS, null);
}
public function uninstall()
{
parent::uninstall();
/* @var $fh FileHelper */
$fh = Loader::helper('file');
$targetJS = DIR_BASE . "/js/";
$fh->removeAll($targetJS);
$targetCSS = DIR_BASE . "/css/";
$fh->removeAll($targetCSS);
}
public function upgrade()
{
$pkg = $this;
parent::upgrade();
$this->configurePackage($pkg);
}
}
// vim: set noexpandtab ts=4 :