From 9a7948271efa303929e08c00cb5bae6b98f0febf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=B3na=20Lore?= Date: Wed, 15 Nov 2017 18:29:09 +0100 Subject: [PATCH] Admin help block. --- e_help.php | 121 ++++++++++++++++++++++++++++ languages/English/English_admin.php | 7 ++ 2 files changed, 128 insertions(+) create mode 100644 e_help.php diff --git a/e_help.php b/e_help.php new file mode 100644 index 0000000..c5f914f --- /dev/null +++ b/e_help.php @@ -0,0 +1,121 @@ +action = varset($_GET['action'], ''); + $this->renderHelpBlock(); + } + + /** + * Renders help block. + */ + public function renderHelpBlock() + { + switch($this->action) + { + default: + $block = $this->getHelpBlockGeneral(); + break; + } + + if(!empty($block)) + { + e107::getRender()->tablerender($block['title'], $block['body']); + } + } + + /** + * Gets the general block contents. + * + * @return array + */ + public function getHelpBlockGeneral() + { + e107::js('footer', 'https://buttons.github.io/buttons.js'); + + $content = ''; + + $issue = array( + 'href="https://github.com/lonalore/smartlook/issues"', + 'class="github-button"', + 'data-icon="octicon-issue-opened"', + 'data-style="mega"', + 'data-count-api="/repos/lonalore/smartlook#open_issues_count"', + 'data-count-aria-label="# issues on GitHub"', + 'aria-label="Issue lonalore/smartlook on GitHub"', + ); + + $star = array( + 'href="https://github.com/lonalore/smartlook"', + 'class="github-button"', + 'data-icon="octicon-star"', + 'data-style="mega"', + 'data-count-href="/lonalore/smartlook/stargazers"', + 'data-count-api="/repos/lonalore/smartlook#stargazers_count"', + 'data-count-aria-label="# stargazers on GitHub"', + 'aria-label="Star lonalore/smartlook on GitHub"', + ); + + $content .= '

' . LAN_PLUGIN_SMARTLOOK_ADMIN_HELP_03 . '

'; + $content .= '

'; + $content .= '' . LAN_PLUGIN_SMARTLOOK_ADMIN_HELP_04 . ''; + $content .= '

'; + + $content .= '

' . LAN_PLUGIN_SMARTLOOK_ADMIN_HELP_02 . '

'; + $content .= '

'; + $content .= '' . LAN_PLUGIN_SMARTLOOK_ADMIN_HELP_05 . ''; + $content .= '

'; + + $beerImage = ''; + $beerWishImage = ''; + + $content .= '

' . LAN_PLUGIN_SMARTLOOK_ADMIN_HELP_06 . '

'; + $content .= '

'; + $content .= '' . $beerImage . ''; + $content .= '

'; + $content .= '

'; + $content .= '' . $beerWishImage . ''; + $content .= '

'; + + $block = array( + 'title' => LAN_PLUGIN_SMARTLOOK_ADMIN_HELP_01, + 'body' => $content, + ); + + return $block; + } + +} + + +new smartlook_help(); diff --git a/languages/English/English_admin.php b/languages/English/English_admin.php index e2bf858..f7f869f 100644 --- a/languages/English/English_admin.php +++ b/languages/English/English_admin.php @@ -19,3 +19,10 @@ define('LAN_PLUGIN_SMARTLOOK_ADMIN_10', 'Enter one page per line. The "*" character is a wildcard. FRONTPAGE is the front page.'); define('LAN_PLUGIN_SMARTLOOK_ADMIN_11', 'Add tracking to specific pages'); define('LAN_PLUGIN_SMARTLOOK_ADMIN_12', 'Add tracking for specific class'); + +define("LAN_PLUGIN_SMARTLOOK_ADMIN_HELP_01", "Help & Support"); +define("LAN_PLUGIN_SMARTLOOK_ADMIN_HELP_02", "If you think this plugin is useful and saves you a lot of work, then star it on Github! Thank you!"); +define("LAN_PLUGIN_SMARTLOOK_ADMIN_HELP_03", "Please feel free to report any bug found. Pull requests and issues are more than welcome!"); +define("LAN_PLUGIN_SMARTLOOK_ADMIN_HELP_04", "Issue"); +define("LAN_PLUGIN_SMARTLOOK_ADMIN_HELP_05", "Star"); +define("LAN_PLUGIN_SMARTLOOK_ADMIN_HELP_06", "Support on Beerpay");