-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension.driver.php
53 lines (48 loc) · 1.09 KB
/
extension.driver.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
<?php
Class extension_modern_theme extends Extension
{
/**
* About this extension:
*/
public function about()
{
return array(
'name' => 'Theme: Modern',
'version' => '1.0',
'release-date' => '2020-07-30',
'author' => array(
'name' => 'The Bold',
'website' => 'https://www.thebold.nz'),
'description' => 'A more modern theme for Symphony CMS'
);
}
/**
* Set the delegates
*/
public function getSubscribedDelegates()
{
return array(
array(
'page' => '/backend/',
'delegate' => 'InitaliseAdminPageHead',
'callback' => 'addScriptToHead'
)
);
}
/**
* Add script to the <head>-section of the admin area
*/
public function addScriptToHead($context)
{
Administration::instance()->Page->addStylesheetToHead(URL.'/extensions/modern_theme/assets/modern_theme.theme.css?v=' . $this->get_git_commit());
}
public function get_git_commit() {
$git = DOCROOT . '/.git/FETCH_HEAD';
if (file_exists($git)) {
$git_head = substr(file_get_contents($git), 0, 40);
return $git_head;
}
return rand();
}
}
?>