-
Notifications
You must be signed in to change notification settings - Fork 3
/
e_help.php
119 lines (97 loc) · 2.74 KB
/
e_help.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
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
109
110
111
112
113
114
115
116
117
118
119
<?php
/**
* @file
* Add-on file to display help block on Admin UI.
*/
if(!defined('e107_INIT'))
{
exit;
}
// [PLUGINS]/simplemde/languages/[LANGUAGE]/[LANGUAGE]_admin.php
e107::lan('simplemde', true, true);
/**
* Class simplemde_help.
*/
class simplemde_help
{
/**
* @var mixed
*/
private $action;
/**
* Constructor.
*/
public function __construct()
{
$this->action = varset($_GET['action'], '');
$this->renderHelpBlock();
}
/**
* Get block contents.
*/
public function renderHelpBlock()
{
switch($this->action)
{
default:
$block = $this->getHelpBlockDefault();
break;
}
if(!empty($block))
{
e107::getRender()->tablerender($block['title'], $block['body']);
}
}
/**
* Get default block contents.
*
* @return array
*/
public function getHelpBlockDefault()
{
e107::js('footer', 'https://buttons.github.io/buttons.js');
$content = '';
$issue = array(
'href="https://github.com/lonalore/simplemde/issues"',
'class="github-button"',
'data-icon="octicon-issue-opened"',
'data-style="mega"',
'data-count-api="/repos/lonalore/simplemde#open_issues_count"',
'data-count-aria-label="# issues on GitHub"',
'aria-label="Issue lonalore/simplemde on GitHub"',
);
$star = array(
'href="https://github.com/lonalore/simplemde"',
'class="github-button"',
'data-icon="octicon-star"',
'data-style="mega"',
'data-count-href="/lonalore/simplemde/stargazers"',
'data-count-api="/repos/lonalore/simplemde#stargazers_count"',
'data-count-aria-label="# stargazers on GitHub"',
'aria-label="Star lonalore/simplemde on GitHub"',
);
$content .= '<p class="text-center">' . LAN_SIMPLEMDE_ADMIN_HELP_03 . '</p>';
$content .= '<p class="text-center">';
$content .= '<a ' . implode(" ", $issue) . '>' . LAN_SIMPLEMDE_ADMIN_HELP_04 . '</a>';
$content .= '</p>';
$content .= '<p class="text-center">' . LAN_SIMPLEMDE_ADMIN_HELP_02 . '</p>';
$content .= '<p class="text-center">';
$content .= '<a ' . implode(" ", $star) . '>' . LAN_SIMPLEMDE_ADMIN_HELP_05 . '</a>';
$content .= '</p>';
$beerImage = '<img src="https://beerpay.io/lonalore/simplemde/badge.svg" />';
$beerWishImage = '<img src="https://beerpay.io/lonalore/simplemde/make-wish.svg" />';
$content .= '<p class="text-center">' . LAN_SIMPLEMDE_ADMIN_HELP_06 . '</p>';
$content .= '<p class="text-center">';
$content .= '<a href="https://beerpay.io/lonalore/simplemde">' . $beerImage . '</a>';
$content .= '</p>';
$content .= '<p class="text-center">';
$content .= '<a href="https://beerpay.io/lonalore/simplemde">' . $beerWishImage . '</a>';
$content .= '</p>';
$block = array(
'title' => LAN_SIMPLEMDE_ADMIN_HELP_01,
'body' => $content,
);
return $block;
}
}
new simplemde_help();