cosmetics

master
Jean-Christian Paul Denis 2021-11-05 00:43:37 +01:00
parent b60bec7897
commit c32ece6a5e
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
4 changed files with 25 additions and 25 deletions

View File

@ -1,6 +1,7 @@
0.2.x 0.2.x
- add update from external repositories - add update from external repositories
- fix permissions - fix permissions
- add copy to clipboard button
0.2.0 - 2021.09.28 0.2.0 - 2021.09.28
- use xmlTag() to manage file content - use xmlTag() to manage file content

View File

@ -1,36 +1,37 @@
<?php <?php
/** /**
* @brief tweakStores, a plugin for Dotclear 2 * @brief tweakStores, a plugin for Dotclear 2
* *
* @package Dotclear * @package Dotclear
* @subpackage Plugin * @subpackage Plugin
* *
* @author Jean-Christian Denis and Contributors * @author Jean-Christian Denis and Contributors
* *
* @copyright Jean-Christian Denis * @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/ */
if (!defined('DC_CONTEXT_MODULE')) { if (!defined('DC_CONTEXT_MODULE')) {
return null; return null;
} }
$redir = empty($_REQUEST['redir']) ? dcPage::checkSuper();
$redir = empty($_REQUEST['redir']) ?
$list->getURL() . '#plugins' : $_REQUEST['redir']; $list->getURL() . '#plugins' : $_REQUEST['redir'];
# -- Get settings -- # -- Get settings --
$core->blog->settings->addNamespace('tweakStores'); $core->blog->settings->addNamespace('tweakStores');
$s = $core->blog->settings->tweakStores; $s = $core->blog->settings->tweakStores;
$tweakStores_active = $s->active; $tweakStores_active = $s->active;
$tweakStores_packman = $s->packman; $tweakStores_packman = $s->packman;
$tweakStores_file_pattern = $s->file_pattern; $tweakStores_file_pattern = $s->file_pattern;
# -- Set settings -- # -- Set settings --
if (!empty($_POST['save'])) { if (!empty($_POST['save'])) {
try { try {
$tweakStores_active = !empty($_POST['tweakStores_active']); $tweakStores_active = !empty($_POST['tweakStores_active']);
$tweakStores_packman = !empty($_POST['tweakStores_packman']); $tweakStores_packman = !empty($_POST['tweakStores_packman']);
$tweakStores_file_pattern = $_POST['tweakStores_file_pattern']; $tweakStores_file_pattern = $_POST['tweakStores_file_pattern'];
$s->put('active', $tweakStores_active); $s->put('active', $tweakStores_active);
@ -38,7 +39,7 @@ if (!empty($_POST['save'])) {
$s->put('file_pattern', $tweakStores_file_pattern); $s->put('file_pattern', $tweakStores_file_pattern);
dcPage::addSuccessNotice( dcPage::addSuccessNotice(
__('Configuration has been successfully updated.') __('Configuration successfully updated')
); );
http::redirect( http::redirect(
$list->getURL('module=tweakStores&conf=1&redir=' . $list->getRedir()) $list->getURL('module=tweakStores&conf=1&redir=' . $list->getRedir())
@ -56,20 +57,20 @@ echo '
<p><label class="classic" for="tweakStores_active">' . <p><label class="classic" for="tweakStores_active">' .
form::checkbox('tweakStores_active', 1, $tweakStores_active) . ' ' . form::checkbox('tweakStores_active', 1, $tweakStores_active) . ' ' .
__('Enable plugin') . '</label></p> __('Enable plugin') . '</label></p>
<p class="form-note">' . __('If enabled, new tab "Tweak stores" allows your to perfom actions relative to third-party repositories.') .'</p> <p class="form-note">' . __('If enabled, new tab "Tweak stores" allows your to perfom actions relative to third-party repositories.') . '</p>
<p><label class="classic" for="tweakStores_packman">' . <p><label class="classic" for="tweakStores_packman">' .
form::checkbox('tweakStores_packman', 1, $tweakStores_packman) . ' ' . form::checkbox('tweakStores_packman', 1, $tweakStores_packman) . ' ' .
__('Enable packman behaviors') . '</label></p> __('Enable packman behaviors') . '</label></p>
<p class="form-note">' . __('If enabled, plugin pacKman will (re)generate on the fly dcstore.xml file at root directory of the module.') .'</p> <p class="form-note">' . __('If enabled, plugin pacKman will (re)generate on the fly dcstore.xml file at root directory of the module.') . '</p>
<p><label class="classic" for="tweakStores_file_pattern">'. __('Predictable URL to zip file on the external repository') . <p><label class="classic" for="tweakStores_file_pattern">' . __('Predictable URL to zip file on the external repository') .
form::field('tweakStores_file_pattern', 65, 255, $tweakStores_file_pattern, 'maximal') . ' form::field('tweakStores_file_pattern', 65, 255, $tweakStores_file_pattern, 'maximal') . '
</label></p> </label></p>
<p class="form-note">' . <p class="form-note">' .
__('You can use widcard like %author%, %type%, %id%, %version%.') . '<br /> ' . __('You can use widcard like %author%, %type%, %id%, %version%.') . '<br /> ' .
__('For example on github https://github.com/MyGitName/%id%/releases/download/v%version%/%type%-%id%.zip') . '<br />' . __('For example on github https://github.com/MyGitName/%id%/releases/download/v%version%/%type%-%id%.zip') . '<br />' .
__('Note: on github, you must create a release and join to it the module zip file.') . ' __('Note: on github, you must create a release and join to it the module zip file.') . '
</p> </p>
</div>'; </div>';

View File

@ -1,16 +1,15 @@
<?php <?php
/** /**
* @brief tweakStores, a plugin for Dotclear 2 * @brief tweakStores, a plugin for Dotclear 2
* *
* @package Dotclear * @package Dotclear
* @subpackage Plugin * @subpackage Plugin
* *
* @author Jean-Christian Denis and Contributors * @author Jean-Christian Denis and Contributors
* *
* @copyright Jean-Christian Denis * @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/ */
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {
return null; return null;
} }
@ -28,4 +27,4 @@ $this->registerModule(
'details' => 'https://plugins.dotaddict.org/dc2/details/tweakStores', 'details' => 'https://plugins.dotaddict.org/dc2/details/tweakStores',
'repository' => 'https://raw.githubusercontent.com/JcDenis/tweakStores/master/' 'repository' => 'https://raw.githubusercontent.com/JcDenis/tweakStores/master/'
] ]
); );

View File

@ -1,18 +1,17 @@
<?php <?php
/** /**
* @brief tweakStores, a plugin for Dotclear 2 * @brief tweakStores, a plugin for Dotclear 2
* *
* @package Dotclear * @package Dotclear
* @subpackage Plugin * @subpackage Plugin
* *
* @author Jean-Christian Denis and Contributors * @author Jean-Christian Denis and Contributors
* *
* @copyright Jean-Christian Denis * @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/ */
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {
return null; return null;
} }
$__autoload['tweakStores'] = dirname(__FILE__) . '/inc/class.tweakstores.php'; $__autoload['tweakStores'] = dirname(__FILE__) . '/inc/class.tweakstores.php';