|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Ubiquity\core\postinstall; |
|
4
|
|
|
|
|
5
|
|
|
use Ubiquity\core\Framework; |
|
6
|
|
|
use Ubiquity\themes\ThemesManager; |
|
7
|
|
|
use Ubiquity\controllers\Router; |
|
8
|
|
|
|
|
9
|
2 |
|
class Display { |
|
10
|
2 |
|
private static $links=[ |
|
11
|
2 |
|
"Website"=>"https://ubiquity.kobject.net", |
|
12
|
2 |
|
"Guide"=>"https://micro-framework.readthedocs.io/en/latest/?badge=latest", |
|
13
|
2 |
|
"Documentation API"=>"https://api.kobject.net/ubiquity/", |
|
14
|
2 |
|
"GitHub"=>"https://github.com/phpMv/ubiquity" |
|
15
|
|
|
]; |
|
16
|
2 |
|
|
|
17
|
|
|
public static function semanticMenu($id, $semantic) { |
|
18
|
|
|
$links=self::getLinks(); |
|
19
|
|
|
$menu=$semantic->htmlMenu($id, array_keys($links)); |
|
20
|
|
|
$menu->asLinks(array_values($links), 'new'); |
|
21
|
|
|
$menu->setSecondary(); |
|
22
|
|
|
return $menu; |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
public static function getLinks(){ |
|
26
|
|
|
$links=self::$links; |
|
27
|
|
|
if (Framework::hasAdmin()) { |
|
28
|
|
|
$links['UbiquityMyAdmin']='Admin'; |
|
29
|
|
|
} |
|
30
|
|
|
return $links; |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
public static function getPageInfos(){ |
|
34
|
|
|
return ['Controller'=>Framework::getController(), |
|
35
|
|
|
'Action'=>Framework::getAction(), |
|
36
|
|
|
'Route'=>Framework::getUrl(), |
|
37
|
|
|
'Path'=>Router::path(''), |
|
38
|
|
|
'ActiveTheme'=>ThemesManager::getActiveTheme() |
|
39
|
|
|
]; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public static function getDefaultPage(){ |
|
43
|
|
|
$activeTheme=ThemesManager::getActiveTheme(); |
|
44
|
|
|
if($activeTheme==null){ |
|
45
|
|
|
$activeTheme="index"; |
|
46
|
|
|
} |
|
47
|
|
|
return '@framework/index/'.$activeTheme.'.html'; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
public static function getThemes(){ |
|
51
|
|
|
return ThemesManager::getAvailableThemes(); |
|
52
|
|
|
} |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
|