-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMobile.php
More file actions
108 lines (91 loc) · 3.7 KB
/
Mobile.php
File metadata and controls
108 lines (91 loc) · 3.7 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
namespace thebuggenie\modules\mobile;
use thebuggenie\core\framework;
/**
* Autogenerated module Mobile
*
* @author
* @version 0.1
* @license http://www.opensource.org/licenses/mozilla1.1.php Mozilla Public License 1.1 (MPL 1.1)
* @package mobile
* @subpackage core
*/
/**
* Autogenerated module Mobile
*
* @package mobile
* @subpackage core
*
* @Table(name="\thebuggenie\core\entities\tables\Modules")
*/
class Mobile extends \thebuggenie\core\entities\Module
{
const VERSION = '0.1';
protected $_name = 'mobile';
protected $_longname = 'Mobile';
protected $_module_config_title = 'Mobile';
protected $_module_config_description = 'Mobile - flexible layout for tablet and mobile';
protected $_description = 'Mobile - flexible layout for tablet and mobile';
protected function _initialize()
{
}
protected function _addAvailablePermissions()
{
}
protected function _addListeners()
{
framework\Event::listen('core', 'layout.php::header-begins', array($this, 'addMobileContent'));
// framework\Event::listen('core', 'header_submenu_decider', array($this, 'hideTopMenu'));
// framework\Event::listen('core', 'header_mainmenu_decider', array($this, 'hideTopMenu'));
// framework\Event::listen('core', 'header_usermenu_decider', array($this, 'hideTopMenu'));
framework\Event::listen('core', 'header_before_logo', array($this, 'addMobileMenuAnchor'));
framework\Event::listen('core', 'header_menu_end', array($this, 'addMobileMenu'));
framework\Event::listen('core', 'viewissue_left_bottom', array($this, 'disableDetailsResizing'));
}
protected function _install($scope)
{
if ($scope == framework\Settings::getDefaultScopeID()) {
$mobile_css_path = THEBUGGENIE_PATH . THEBUGGENIE_PUBLIC_FOLDER_NAME . DS . 'css' . DS . 'mobile.css';
if (!is_writable(pathinfo($mobile_css_path, PATHINFO_DIRNAME))) {
throw new framework\exceptions\ConfigurationException("Cannot save the file {$mobile_css_path}", framework\exceptions\ConfigurationException::PERMISSION_DENIED);
}
if (file_exists($mobile_css_path)) {
unlink($mobile_css_path);
}
symlink(THEBUGGENIE_MODULES_PATH . 'mobile' . DS . 'css' . DS . 'mobile.css', $mobile_css_path);
}
}
protected function _loadFixtures($scope)
{
}
protected function _uninstall()
{
if (framework\Context::getScope()->isDefault()) {
$filename = THEBUGGENIE_PATH . THEBUGGENIE_PUBLIC_FOLDER_NAME . DS . 'css' . DS . 'mobile.css';
if (file_exists($filename)) {
unlink($filename);
}
}
}
public function addMobileContent(framework\Event $event)
{
include_component('mobile/header');
}
public function addMobileMenuAnchor(framework\Event $event)
{
include_component('mobile/menuanchor');
}
public function addMobileMenu(framework\Event $event)
{
include_component('mobile/menu');
include_component('mobile/usermenu');
}
public function hideTopMenu(framework\Event $event)
{
$event->setReturnValue(false);
}
public function disableDetailsResizing(framework\Event $event)
{
include_component('mobile/disableissuedetailsresizing');
}
}