✨💄 auto-handle plugin descriptions
This commit is contained in:
parent
35b2aa6559
commit
9818143bac
21 changed files with 35 additions and 100 deletions
|
@ -219,7 +219,8 @@ body.login {
|
|||
PLUGINS
|
||||
*/
|
||||
|
||||
.plugin-form label {
|
||||
.plugin-form label:not(:first-child),
|
||||
.plugin-form > div:not(:first-child) > label {
|
||||
display: block;
|
||||
margin-top: 1rem !important;
|
||||
}
|
||||
|
@ -359,4 +360,4 @@ img.profilePicture {
|
|||
|
||||
.switch-icon-publish {
|
||||
color: #1cb11c;
|
||||
}
|
||||
}
|
|
@ -27,14 +27,23 @@
|
|||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php
|
||||
<?php if ($plugin->description()): ?>
|
||||
<p class="alert alert-primary">
|
||||
<?php echo $plugin->description(); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
// Token CSRF
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$security->getTokenCSRF()
|
||||
));
|
||||
?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body plugin-form">
|
||||
<?php
|
||||
|
||||
// Print the plugin form
|
||||
echo $plugin->form();
|
||||
|
|
|
@ -15,11 +15,7 @@ class pluginAbout extends Plugin
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('Label') . '</label>';
|
||||
$html .= '<input name="label" type="text" dir="auto" value="' . $this->getValue('label') . '">';
|
||||
$html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';
|
||||
|
|
|
@ -17,11 +17,7 @@ class pluginCategories extends Plugin
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('Label') . '</label>';
|
||||
$html .= '<input name="label" type="text" dir="auto" value="' . $this->getValue('label') . '">';
|
||||
$html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';
|
||||
|
|
|
@ -15,10 +15,8 @@ class pluginCustomFieldsParser extends Plugin {
|
|||
global $L;
|
||||
global $site;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html = '';
|
||||
|
||||
$jsondb = $this->getValue('jsondb', false);
|
||||
$database = json_decode($jsondb, true);
|
||||
|
||||
|
|
|
@ -17,11 +17,7 @@ class pluginDisqus extends Plugin
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('disqus-shortname') . '</label>';
|
||||
$html .= '<input name="shortname" id="jsshortname" type="text" dir="auto" value="' . $this->getValue('shortname') . '">';
|
||||
$html .= '<span class="tip">' . $L->get('Get the shortname from the Disqus general settings') . '</span>';
|
||||
|
|
|
@ -28,13 +28,8 @@ class pluginHitCounter extends Plugin
|
|||
return $html;
|
||||
}
|
||||
|
||||
// Show the description of the plugin in the settings
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
// Label of the plugin to show in the sidebar
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('Label') . '</label>';
|
||||
$html .= '<input name="label" type="text" dir="auto" value="' . $this->getValue('label') . '">';
|
||||
$html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';
|
||||
|
|
|
@ -18,11 +18,7 @@ class pluginHTMLCode extends Plugin {
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<h2>'.$L->g('Website').'</h2>';
|
||||
$html = '<h2>'.$L->g('Website').'</h2>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>Head</label>';
|
||||
|
|
|
@ -65,11 +65,7 @@ class pluginLinks extends Plugin
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('Label') . '</label>';
|
||||
$html .= '<input name="label" class="form-control" type="text" dir="auto" value="' . $this->getValue('label') . '">';
|
||||
$html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';
|
||||
|
|
|
@ -15,11 +15,7 @@ class pluginMaintenanceMode extends Plugin
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('Enable maintenance mode') . '</label>';
|
||||
$html .= '<select name="enable">';
|
||||
$html .= '<option value="true" ' . ($this->getValue('enable') === true ? 'selected' : '') . '>Enabled</option>';
|
||||
|
|
|
@ -18,11 +18,7 @@ class pluginNavigation extends Plugin
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('Label') . '</label>';
|
||||
$html .= '<input id="jslabel" name="label" type="text" dir="auto" value="' . $this->getValue('label') . '">';
|
||||
$html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';
|
||||
|
|
|
@ -16,11 +16,7 @@ class pluginOpenGraph extends Plugin
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('Default image') . '</label>';
|
||||
$html .= '<input id="jsdefaultImage" name="defaultImage" type="text" dir="auto" value="' . $this->getValue('defaultImage') . '" placeholder="https://">';
|
||||
$html .= '<span class="tip">' . $L->g('set-a-default-image-for-content') . '</span>';
|
||||
|
|
|
@ -24,11 +24,7 @@ class pluginRemoteContent extends Plugin
|
|||
return '<div class="alert alert-success">' . $language->get('the-extension-zip-is-not-installed') . '</div>';
|
||||
}
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $language->get('Webhook') . '</label>';
|
||||
$html .= '<input id="jswebhook" name="webhook" type="text" dir="auto" value="' . $this->getValue('webhook') . '">';
|
||||
$html .= '<span class="tip">' . DOMAIN_BASE . $this->getValue('webhook') . '</span>';
|
||||
|
|
|
@ -11,11 +11,7 @@ class pluginRobots extends Plugin {
|
|||
|
||||
public function form()
|
||||
{
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>'.DOMAIN.'/robots.txt</label>';
|
||||
$html .= '<textarea name="robotstxt" id="jsrobotstxt">'.$this->getValue('robotstxt').'</textarea>';
|
||||
$html .= '</div>';
|
||||
|
|
|
@ -16,11 +16,7 @@ class pluginRSS extends Plugin
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('RSS URL') . '</label>';
|
||||
$html .= '<a href="' . Theme::rssUrl() . '">' . Theme::rssUrl() . '</a>';
|
||||
$html .= '</div>';
|
||||
|
|
|
@ -21,11 +21,7 @@ class pluginSearch extends Plugin
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('Label') . '</label>';
|
||||
$html .= '<input name="label" type="text" dir="auto" value="' . $this->getValue('label') . '">';
|
||||
$html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';
|
||||
|
|
|
@ -15,11 +15,7 @@ class pluginSitemap extends Plugin {
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>'.$L->get('Sitemap URL').'</label>';
|
||||
$html .= '<a href="'.Theme::sitemapUrl().'">'.Theme::sitemapUrl().'</a>';
|
||||
$html .= '</div>';
|
||||
|
|
|
@ -17,11 +17,7 @@ class pluginStaticPages extends Plugin
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('Label') . '</label>';
|
||||
$html .= '<input id="jslabel" name="label" type="text" dir="auto" value="' . $this->getValue('label') . '">';
|
||||
$html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';
|
||||
|
|
|
@ -14,11 +14,7 @@ class pluginTags extends Plugin
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('Label') . '</label>';
|
||||
$html .= '<input id="jslabel" name="label" type="text" dir="auto" value="' . $this->getValue('label') . '">';
|
||||
$html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';
|
||||
|
|
|
@ -22,11 +22,7 @@ class pluginTinymce extends Plugin
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('toolbar-top') . '</label>';
|
||||
$html .= '<input name="toolbar1" id="jstoolbar1" type="text" dir="auto" value="' . $this->getValue('toolbar1') . '">';
|
||||
$html .= '</div>';
|
||||
|
|
|
@ -15,11 +15,7 @@ class pluginTwitterCards extends Plugin
|
|||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('Default image') . '</label>';
|
||||
$html .= '<input id="jsdefaultImage" name="defaultImage" type="text" dir="auto" value="' . $this->getValue('defaultImage') . '" placeholder="https://">';
|
||||
$html .= '</div>';
|
||||
|
|
Loading…
Reference in a new issue