Compare commits

...

3 commits

Author SHA1 Message Date
Kazhnuz
f2fce78e40 💄 some color improvement 2025-01-18 23:55:29 +01:00
Kazhnuz
5311fcd9d0 🐛 fix the active badge 2025-01-18 22:11:18 +01:00
Kazhnuz
9818143bac 💄 auto-handle plugin descriptions 2025-01-18 22:09:15 +01:00
24 changed files with 38 additions and 103 deletions

View file

@ -219,7 +219,8 @@ body.login {
PLUGINS PLUGINS
*/ */
.plugin-form label { .plugin-form label:not(:first-child),
.plugin-form > div:not(:first-child) > label {
display: block; display: block;
margin-top: 1rem !important; margin-top: 1rem !important;
} }
@ -359,4 +360,4 @@ img.profilePicture {
.switch-icon-publish { .switch-icon-publish {
color: #1cb11c; color: #1cb11c;
} }

View file

@ -27,14 +27,23 @@
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="card"> <?php if ($plugin->description()): ?>
<div class="card-body"> <p class="alert alert-primary">
<?php <?php echo $plugin->description(); ?>
</p>
<?php endif; ?>
<?php
// Token CSRF // Token CSRF
echo Bootstrap::formInputHidden(array( echo Bootstrap::formInputHidden(array(
'name'=>'tokenCSRF', 'name'=>'tokenCSRF',
'value'=>$security->getTokenCSRF() 'value'=>$security->getTokenCSRF()
)); ));
?>
<div class="card">
<div class="card-body plugin-form">
<?php
// Print the plugin form // Print the plugin form
echo $plugin->form(); echo $plugin->form();

View file

@ -200,7 +200,7 @@ function table($type) {
<button class="nav-link" id="sticky-tab" data-bs-toggle="tab" data-bs-target="#sticky" role="tab"><?php $L->p('Sticky') ?></button> <button class="nav-link" id="sticky-tab" data-bs-toggle="tab" data-bs-target="#sticky" role="tab"><?php $L->p('Sticky') ?></button>
</li> </li>
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<button class="nav-link" id="scheduled-tab" data-bs-toggle="tab" data-bs-target="#scheduled" role="tab"><?php $L->p('Scheduled') ?> <?php if (count($scheduled)>0) { echo '<span class="badge badge-danger">'.count($scheduled).'</span>'; } ?></button> <button class="nav-link" id="scheduled-tab" data-bs-toggle="tab" data-bs-target="#scheduled" role="tab"><?php $L->p('Scheduled') ?> <?php if (count($scheduled)>0) { echo '<span class="badge bg-primary">'.count($scheduled).'</span>'; } ?></button>
</li> </li>
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<button class="nav-link" id="draft-tab" data-bs-toggle="tab" data-bs-target="#draft" role="tab"><?php $L->p('Draft') ?></button> <button class="nav-link" id="draft-tab" data-bs-toggle="tab" data-bs-target="#draft" role="tab"><?php $L->p('Draft') ?></button>

View file

@ -17,7 +17,7 @@ echo "</div></div>";
?> ?>
<p class="alert alert-info"><?php echo $L->g("Activate or deactivate here plugins that'll be shown in the sidebar") ?></p> <p class="alert alert-primary"><?php echo $L->g("Activate or deactivate here plugins that'll be shown in the sidebar") ?></p>
<?php <?php

View file

@ -20,7 +20,7 @@ foreach ($themes as $theme) {
echo ' echo '
<tr class="card-tablebody"> <tr class="card-tablebody">
<td class="align-middle pt-3 pb-3"> <td class="align-middle pt-3 pb-3">
<div>'.$theme['name'].($theme['dirname']==$site->theme()?'<span class="badge badge-primary ms-2">'.$L->g('Active').'</span>':'').'</div> <div>'.$theme['name'].($theme['dirname']==$site->theme()?'<span class="badge bg-primary ms-2">'.$L->g('Active').'</span>':'').'</div>
<div class="mt-1"> <div class="mt-1">
'; ';

View file

@ -15,11 +15,7 @@ class pluginAbout extends Plugin
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('Label') . '</label>'; $html .= '<label>' . $L->get('Label') . '</label>';
$html .= '<input name="label" type="text" dir="auto" value="' . $this->getValue('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>'; $html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';

View file

@ -17,11 +17,7 @@ class pluginCategories extends Plugin
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('Label') . '</label>'; $html .= '<label>' . $L->get('Label') . '</label>';
$html .= '<input name="label" type="text" dir="auto" value="' . $this->getValue('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>'; $html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';

View file

@ -15,10 +15,8 @@ class pluginCustomFieldsParser extends Plugin {
global $L; global $L;
global $site; global $site;
$html = '<div class="alert alert-primary" role="alert">'; $html = '';
$html .= $this->description();
$html .= '</div>';
$jsondb = $this->getValue('jsondb', false); $jsondb = $this->getValue('jsondb', false);
$database = json_decode($jsondb, true); $database = json_decode($jsondb, true);

View file

@ -17,11 +17,7 @@ class pluginDisqus extends Plugin
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('disqus-shortname') . '</label>'; $html .= '<label>' . $L->get('disqus-shortname') . '</label>';
$html .= '<input name="shortname" id="jsshortname" type="text" dir="auto" value="' . $this->getValue('shortname') . '">'; $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>'; $html .= '<span class="tip">' . $L->get('Get the shortname from the Disqus general settings') . '</span>';

View file

@ -28,13 +28,8 @@ class pluginHitCounter extends Plugin
return $html; 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 // Label of the plugin to show in the sidebar
$html .= '<div>'; $html = '<div>';
$html .= '<label>' . $L->get('Label') . '</label>'; $html .= '<label>' . $L->get('Label') . '</label>';
$html .= '<input name="label" type="text" dir="auto" value="' . $this->getValue('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>'; $html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';

View file

@ -18,11 +18,7 @@ class pluginHTMLCode extends Plugin {
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<h2>'.$L->g('Website').'</h2>';
$html .= $this->description();
$html .= '</div>';
$html .= '<h2>'.$L->g('Website').'</h2>';
$html .= '<div>'; $html .= '<div>';
$html .= '<label>Head</label>'; $html .= '<label>Head</label>';

View file

@ -65,11 +65,7 @@ class pluginLinks extends Plugin
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('Label') . '</label>'; $html .= '<label>' . $L->get('Label') . '</label>';
$html .= '<input name="label" class="form-control" type="text" dir="auto" value="' . $this->getValue('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>'; $html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';

View file

@ -15,11 +15,7 @@ class pluginMaintenanceMode extends Plugin
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('Enable maintenance mode') . '</label>'; $html .= '<label>' . $L->get('Enable maintenance mode') . '</label>';
$html .= '<select name="enable">'; $html .= '<select name="enable">';
$html .= '<option value="true" ' . ($this->getValue('enable') === true ? 'selected' : '') . '>Enabled</option>'; $html .= '<option value="true" ' . ($this->getValue('enable') === true ? 'selected' : '') . '>Enabled</option>';

View file

@ -18,11 +18,7 @@ class pluginNavigation extends Plugin
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('Label') . '</label>'; $html .= '<label>' . $L->get('Label') . '</label>';
$html .= '<input id="jslabel" name="label" type="text" dir="auto" value="' . $this->getValue('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>'; $html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';

View file

@ -16,11 +16,7 @@ class pluginOpenGraph extends Plugin
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('Default image') . '</label>'; $html .= '<label>' . $L->get('Default image') . '</label>';
$html .= '<input id="jsdefaultImage" name="defaultImage" type="text" dir="auto" value="' . $this->getValue('defaultImage') . '" placeholder="https://">'; $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>'; $html .= '<span class="tip">' . $L->g('set-a-default-image-for-content') . '</span>';

View file

@ -24,11 +24,7 @@ class pluginRemoteContent extends Plugin
return '<div class="alert alert-success">' . $language->get('the-extension-zip-is-not-installed') . '</div>'; return '<div class="alert alert-success">' . $language->get('the-extension-zip-is-not-installed') . '</div>';
} }
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $language->get('Webhook') . '</label>'; $html .= '<label>' . $language->get('Webhook') . '</label>';
$html .= '<input id="jswebhook" name="webhook" type="text" dir="auto" value="' . $this->getValue('webhook') . '">'; $html .= '<input id="jswebhook" name="webhook" type="text" dir="auto" value="' . $this->getValue('webhook') . '">';
$html .= '<span class="tip">' . DOMAIN_BASE . $this->getValue('webhook') . '</span>'; $html .= '<span class="tip">' . DOMAIN_BASE . $this->getValue('webhook') . '</span>';

View file

@ -11,11 +11,7 @@ class pluginRobots extends Plugin {
public function form() public function form()
{ {
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>'.DOMAIN.'/robots.txt</label>'; $html .= '<label>'.DOMAIN.'/robots.txt</label>';
$html .= '<textarea name="robotstxt" id="jsrobotstxt">'.$this->getValue('robotstxt').'</textarea>'; $html .= '<textarea name="robotstxt" id="jsrobotstxt">'.$this->getValue('robotstxt').'</textarea>';
$html .= '</div>'; $html .= '</div>';

View file

@ -16,11 +16,7 @@ class pluginRSS extends Plugin
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('RSS URL') . '</label>'; $html .= '<label>' . $L->get('RSS URL') . '</label>';
$html .= '<a href="' . Theme::rssUrl() . '">' . Theme::rssUrl() . '</a>'; $html .= '<a href="' . Theme::rssUrl() . '">' . Theme::rssUrl() . '</a>';
$html .= '</div>'; $html .= '</div>';

View file

@ -21,11 +21,7 @@ class pluginSearch extends Plugin
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('Label') . '</label>'; $html .= '<label>' . $L->get('Label') . '</label>';
$html .= '<input name="label" type="text" dir="auto" value="' . $this->getValue('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>'; $html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';

View file

@ -15,11 +15,7 @@ class pluginSitemap extends Plugin {
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>'.$L->get('Sitemap URL').'</label>'; $html .= '<label>'.$L->get('Sitemap URL').'</label>';
$html .= '<a href="'.Theme::sitemapUrl().'">'.Theme::sitemapUrl().'</a>'; $html .= '<a href="'.Theme::sitemapUrl().'">'.Theme::sitemapUrl().'</a>';
$html .= '</div>'; $html .= '</div>';

View file

@ -17,11 +17,7 @@ class pluginStaticPages extends Plugin
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('Label') . '</label>'; $html .= '<label>' . $L->get('Label') . '</label>';
$html .= '<input id="jslabel" name="label" type="text" dir="auto" value="' . $this->getValue('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>'; $html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';

View file

@ -14,11 +14,7 @@ class pluginTags extends Plugin
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('Label') . '</label>'; $html .= '<label>' . $L->get('Label') . '</label>';
$html .= '<input id="jslabel" name="label" type="text" dir="auto" value="' . $this->getValue('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>'; $html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';

View file

@ -22,11 +22,7 @@ class pluginTinymce extends Plugin
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('toolbar-top') . '</label>'; $html .= '<label>' . $L->get('toolbar-top') . '</label>';
$html .= '<input name="toolbar1" id="jstoolbar1" type="text" dir="auto" value="' . $this->getValue('toolbar1') . '">'; $html .= '<input name="toolbar1" id="jstoolbar1" type="text" dir="auto" value="' . $this->getValue('toolbar1') . '">';
$html .= '</div>'; $html .= '</div>';

View file

@ -15,11 +15,7 @@ class pluginTwitterCards extends Plugin
{ {
global $L; global $L;
$html = '<div class="alert alert-primary" role="alert">'; $html = '<div>';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('Default image') . '</label>'; $html .= '<label>' . $L->get('Default image') . '</label>';
$html .= '<input id="jsdefaultImage" name="defaultImage" type="text" dir="auto" value="' . $this->getValue('defaultImage') . '" placeholder="https://">'; $html .= '<input id="jsdefaultImage" name="defaultImage" type="text" dir="auto" value="' . $this->getValue('defaultImage') . '" placeholder="https://">';
$html .= '</div>'; $html .= '</div>';