use latest Helper fo dotclear 2.26-dev
This commit is contained in:
parent
1877d40fce
commit
675906d600
20 changed files with 116 additions and 196 deletions
|
@ -14,16 +14,11 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve;
|
||||
|
||||
/* dotclear */
|
||||
use ArrayObject;
|
||||
use dcCore;
|
||||
use dcModuleDefine;
|
||||
use dcPage;
|
||||
|
||||
/* clearbricks */
|
||||
use http;
|
||||
|
||||
/* php */
|
||||
use ArrayObject;
|
||||
use Dotclear\Helper\Network\Http;
|
||||
|
||||
/**
|
||||
* Improve action class helper
|
||||
|
@ -247,7 +242,7 @@ abstract class Action
|
|||
);
|
||||
dcCore::app()->blog->triggerBlog();
|
||||
dcPage::addSuccessNotice(__('Configuration successfully updated'));
|
||||
http::redirect($url);
|
||||
Http::redirect($url);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -14,16 +14,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve;
|
||||
|
||||
/* dotclear */
|
||||
use dcAdmin;
|
||||
use dcCore;
|
||||
use dcPage;
|
||||
use dcFavorites;
|
||||
use dcNsProcess;
|
||||
|
||||
/* clearbricks */
|
||||
use Dotclear\Helper\File\Files;
|
||||
use Dotclear\Helper\Clearbricks;
|
||||
use files;
|
||||
|
||||
/**
|
||||
* Improve admin class
|
||||
|
@ -68,7 +65,7 @@ class Backend extends dcNsProcess
|
|||
dcCore::app()->auth->isSuperAdmin()
|
||||
);
|
||||
|
||||
foreach (files::scandir(Utils::getActionsDir()) as $file) {
|
||||
foreach (Files::scandir(Utils::getActionsDir()) as $file) {
|
||||
if (is_file(Utils::getActionsDir() . $file) && '.php' == substr($file, -4)) {
|
||||
Clearbricks::lib()->autoload([Utils::getActionsNS() . substr($file, 0, -4) => Utils::getActionsDir() . $file]);
|
||||
dcCore::app()->addBehavior('improveAddAction', [Utils::getActionsNS() . substr($file, 0, -4), 'create']); /* @phpstan-ignore-line */
|
||||
|
|
|
@ -14,12 +14,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve;
|
||||
|
||||
/* dotclear */
|
||||
use dcCore;
|
||||
use dcPage;
|
||||
use dcNsProcess;
|
||||
|
||||
/* clearbricks */
|
||||
use Dotclear\Helper\Html\Form\{
|
||||
Checkbox,
|
||||
Div,
|
||||
|
@ -29,8 +26,6 @@ use Dotclear\Helper\Html\Form\{
|
|||
Para,
|
||||
Text
|
||||
};
|
||||
|
||||
/* php */
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
|
|
21
src/Core.php
21
src/Core.php
|
@ -14,17 +14,12 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve;
|
||||
|
||||
/* dotclear */
|
||||
use ArrayObject;
|
||||
use dcCore;
|
||||
use dcLog;
|
||||
use dcModuleDefine;
|
||||
|
||||
/* clearbricks */
|
||||
use path;
|
||||
use files;
|
||||
|
||||
/* php */
|
||||
use ArrayObject;
|
||||
use Dotclear\Helper\File\Files;
|
||||
use Dotclear\Helper\File\Path;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
|
@ -248,7 +243,7 @@ class Core
|
|||
));
|
||||
}
|
||||
}
|
||||
files::putContent($file[0], $content);
|
||||
Files::putContent($file[0], $content);
|
||||
}
|
||||
foreach ($workers as $action) {
|
||||
// action: after closing a file. full path, extension
|
||||
|
@ -280,7 +275,7 @@ class Core
|
|||
|
||||
private static function getModuleFiles(string $path, string $dir = '', array $res = []): array
|
||||
{
|
||||
$path = path::real($path);
|
||||
$path = Path::real($path);
|
||||
if (!$path) {
|
||||
return [];
|
||||
}
|
||||
|
@ -291,7 +286,7 @@ class Core
|
|||
$dir = $path;
|
||||
}
|
||||
$res[] = [$dir, '', false];
|
||||
$files = files::scandir($path);
|
||||
$files = Files::scandir($path);
|
||||
|
||||
foreach ($files as $file) {
|
||||
if (substr($file, 0, 1) == '.') {
|
||||
|
@ -304,7 +299,7 @@ class Core
|
|||
$res
|
||||
);
|
||||
} else {
|
||||
$res[] = [$dir . '/' . $file, files::getExtension($file), true];
|
||||
$res[] = [$dir . '/' . $file, Files::getExtension($file), true];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -330,7 +325,7 @@ class Core
|
|||
}
|
||||
if (!empty($in)) {
|
||||
foreach ($in as $v) {
|
||||
$v = trim(files::getExtension('a.' . $v));
|
||||
$v = trim(Files::getExtension('a.' . $v));
|
||||
if (!empty($v)) {
|
||||
$out[] = $v;
|
||||
}
|
||||
|
|
|
@ -14,12 +14,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve;
|
||||
|
||||
/* dotclear */
|
||||
use dcCore;
|
||||
use dcNamespace;
|
||||
use dcNsProcess;
|
||||
|
||||
/* php */
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,19 +14,24 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve;
|
||||
|
||||
/* dotclear */
|
||||
use dcCore;
|
||||
use dcPage;
|
||||
use dcAdminNotices;
|
||||
use dcThemes;
|
||||
use dcUtils;
|
||||
use dcNsProcess;
|
||||
|
||||
/* clearbricks */
|
||||
use html;
|
||||
use form;
|
||||
|
||||
/* php */
|
||||
use Dotclear\Helper\Html\Html;
|
||||
use Dotclear\Helper\Html\Form\{
|
||||
Checkbox,
|
||||
Div,
|
||||
Form,
|
||||
Hidden,
|
||||
Label,
|
||||
Para,
|
||||
Select,
|
||||
Submit,
|
||||
Text
|
||||
};
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
|
@ -233,27 +238,32 @@ class Manage extends dcNsProcess
|
|||
echo '
|
||||
<h3>' . sprintf(__('Configure module "%s"'), self::$action->name()) . '</h3>
|
||||
<p><a class="back" href="' . $back_url . '">' . __('Back') . '</a></p>
|
||||
<h4>' . html::escapeHTML(self::$action->description()) . '</h4>
|
||||
<form action="' . dcCore::app()->adminurl->get('admin.plugin.' . My::id()) . '" method="post" id="form-actions">' .
|
||||
(empty($res) ? '<p class="message">' . __('Nothing to configure') . '</p>' : $res) . '
|
||||
<p class="clear"><input type="submit" name="save" value="' . __('Save') . '" />' .
|
||||
form::hidden('type', self::$type) .
|
||||
form::hidden('config', self::$action->id()) .
|
||||
form::hidden('redir', $redir) .
|
||||
dcCore::app()->formNonce() . '</p>' .
|
||||
'</form>';
|
||||
<h4>' . Html::escapeHTML(self::$action->description()) . '</h4>' .
|
||||
|
||||
(new Form('form-actions'))->method('post')->action(dcCore::app()->adminurl->get('admin.plugin.' . My::id()))->fields([
|
||||
empty($res) ? (new Text('p', __('Nothing to configure')))->class('message') : (new Text('', $res)),
|
||||
(new Para())->class('clear')->items([
|
||||
(new Submit(['save']))->value(__('Save')),
|
||||
(new Hidden('type', self::$type)),
|
||||
(new Hidden('config', self::$action->id())),
|
||||
(new Hidden('redir', $redir)),
|
||||
dcCore::app()->formNonce(false),
|
||||
]),
|
||||
])->render();
|
||||
}
|
||||
}
|
||||
|
||||
private static function displayActions(): void
|
||||
{
|
||||
echo
|
||||
'<form method="get" action="' . dcCore::app()->adminurl->get('admin.plugin.' . My::id()) . '" id="improve_menu">' .
|
||||
'<p class="anchor-nav"><label for="type" class="classic">' . __('Goto:') . ' </label>' .
|
||||
form::combo('type', [__('Plugins') => 'plugin', __('Themes') => 'theme'], self::$type) . ' ' .
|
||||
'<input type="submit" value="' . __('Ok') . '" />' .
|
||||
form::hidden('p', My::id()) . '</p>' .
|
||||
'</form>';
|
||||
(new Form('improve_menu'))->method('get')->action(dcCore::app()->adminurl->get('admin.plugin.' . My::id()))->fields([
|
||||
(new Para())->class('anchor-nav')->items([
|
||||
(new Label(__('Goto:')))->for('type')->class('classic'),
|
||||
(new Select('type'))->default(self::$type)->items([__('Plugins') => 'plugin', __('Themes') => 'theme']),
|
||||
(new Submit('simenu'))->value(__('Save')),
|
||||
(new Hidden('p', My::id())),
|
||||
]),
|
||||
])->render();
|
||||
|
||||
$combo_modules = self::comboModules();
|
||||
if (count($combo_modules) == 1) {
|
||||
|
@ -272,17 +282,14 @@ class Manage extends dcNsProcess
|
|||
}
|
||||
echo
|
||||
'<tr class="line' . ($action->isConfigured() ? '' : ' offline') . '">' .
|
||||
'<td class="minimal">' . form::checkbox(
|
||||
['actions[]',
|
||||
'action_' . $action->id(), ],
|
||||
$action->id(),
|
||||
in_array($action->id(), self::getPreference()) && $action->isConfigured(),
|
||||
'',
|
||||
'',
|
||||
!$action->isConfigured()
|
||||
) . '</td>' .
|
||||
'<td class="minimal">' .
|
||||
(new Checkbox(
|
||||
['actions[]', 'action_' . $action->id()],
|
||||
in_array($action->id(), self::getPreference()) && $action->isConfigured()
|
||||
))->value($action->id())->disabled(!$action->isConfigured())->render() .
|
||||
'</td>' .
|
||||
'<td class="minimal nowrap">' .
|
||||
'<label for="action_' . $action->id() . '" class="classic">' . html::escapeHTML($action->name()) . '</label>' .
|
||||
(new Label(Html::escapeHTML($action->name())))->for('action_' . $action->id())->class('classic')->render() .
|
||||
'</td>' .
|
||||
'<td class="maximal">' . $action->description() . '</td>' .
|
||||
'<td class="minimal nowrap modules">' . (
|
||||
|
@ -294,19 +301,21 @@ class Manage extends dcNsProcess
|
|||
'</tr>';
|
||||
}
|
||||
|
||||
echo '</tbody></table>
|
||||
<div class="two-cols">
|
||||
<p class="col left"><label for="save_preferences" class="classic">' .
|
||||
form::checkbox('save_preferences', 1, !empty($_POST['save_preferences'])) .
|
||||
__('Save fields selection as preference') . '</label></p>
|
||||
<p class="col right"><label for="module" class="classic">' . __('Select a module:') . ' </label>' .
|
||||
form::combo('module', $combo_modules, self::$module) .
|
||||
' <input type="submit" name="fix" value="' . __('Fix it') . '" />' .
|
||||
form::hidden(['type'], self::$type) .
|
||||
dcCore::app()->formNonce() . '
|
||||
</p>
|
||||
</div>
|
||||
<br class="clear" />
|
||||
echo '</tbody></table>' .
|
||||
(new Div())->class('two-cols')->items([
|
||||
(new Para())->class('col left')->items([
|
||||
(new Checkbox('save_preferences', !empty($_POST['save_preferences'])))->value(1),
|
||||
(new Label(__('Save fields selection as preference'), Label::OUTSIDE_LABEL_AFTER))->for('save_preferences')->class('classic'),
|
||||
]),
|
||||
(new Para())->class('col right')->items([
|
||||
(new Label(__('Select a module:')))->for('module')->class('classic'),
|
||||
(new Select('module'))->default(self::$module)->items($combo_modules),
|
||||
(new Submit('fix'))->value(__('Fix it')),
|
||||
(new Hidden(['type'], self::$type)),
|
||||
dcCore::app()->formNonce(false),
|
||||
]),
|
||||
])->render() .
|
||||
'<br class="clear" />
|
||||
</form>';
|
||||
|
||||
if (!empty($_REQUEST['upd']) && !dcCore::app()->blog->settings->get(My::id())->get('nodetails')) {
|
||||
|
|
|
@ -14,8 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve;
|
||||
|
||||
/* clearbricks */
|
||||
use path;
|
||||
use Dotclear\Helper\File\Path;
|
||||
|
||||
/**
|
||||
* Improve module helper
|
||||
|
@ -179,7 +178,7 @@ class Module
|
|||
'name' => $name,
|
||||
'oname' => $oname,
|
||||
'sname' => self::sanitizeString($name),
|
||||
'sroot' => path::real($properties['root']),
|
||||
'sroot' => Path::real($properties['root']),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve\Module;
|
||||
|
||||
/* dotclear */
|
||||
use dcCore;
|
||||
use Dotclear\Helper\Html\Form\{
|
||||
Checkbox,
|
||||
|
@ -27,14 +26,8 @@ use Dotclear\Helper\Html\Form\{
|
|||
Select,
|
||||
Textarea
|
||||
};
|
||||
|
||||
/* improve */
|
||||
use Dotclear\Helper\Html\Html;
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
|
||||
/* clearbricks */
|
||||
use html;
|
||||
|
||||
/* php */
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
|
@ -145,7 +138,7 @@ class cssheader extends Action
|
|||
// bloc_content
|
||||
(new Para())->items([
|
||||
(new Label(__('Bloc content:')))->for('bloc_content'),
|
||||
(new Textarea('bloc_content', html::escapeHTML($this->bloc_content)))->cols(120)->rows(10),
|
||||
(new Textarea('bloc_content', Html::escapeHTML($this->bloc_content)))->cols(120)->rows(10),
|
||||
]),
|
||||
(new Note())->text(sprintf(
|
||||
__('You can use wildcards %s'),
|
||||
|
@ -155,7 +148,7 @@ class cssheader extends Action
|
|||
// exemple
|
||||
(new Para())->items([
|
||||
(new Label(__('Exemple:')))->for('content_exemple'),
|
||||
(new Textarea('content_exemple', html::escapeHTML(self::$exemple)))->cols(120)->rows(10)->extra('readonly="true"'),
|
||||
(new Textarea('content_exemple', Html::escapeHTML(self::$exemple)))->cols(120)->rows(10)->readonly(true),
|
||||
]),
|
||||
]),
|
||||
])->render();
|
||||
|
|
|
@ -14,13 +14,10 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve\Module;
|
||||
|
||||
/* improve */
|
||||
use Dotclear\Helper\File\Files;
|
||||
use Dotclear\Helper\File\Path;
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
|
||||
/* clearbricks */
|
||||
use files;
|
||||
use path;
|
||||
|
||||
/**
|
||||
* Improve action module Dotclear depreciated
|
||||
*/
|
||||
|
@ -45,11 +42,11 @@ class dcdeprecated extends Action
|
|||
|
||||
private function loadDeprecatedDefinition(): void
|
||||
{
|
||||
$path = path::real(__DIR__ . '/dcdeprecated');
|
||||
$path = Path::real(__DIR__ . '/dcdeprecated');
|
||||
if (!$path || !is_dir($path) || !is_readable($path)) {
|
||||
return;
|
||||
}
|
||||
$files = files::scandir($path);
|
||||
$files = Files::scandir($path);
|
||||
|
||||
foreach ($files as $file) {
|
||||
if (substr($file, 0, 1) == '.') {
|
||||
|
|
|
@ -14,8 +14,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve\Module;
|
||||
|
||||
/* improve */
|
||||
use DOMDocument;
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
use Dotclear\Helper\File\Files;
|
||||
use Dotclear\Helper\Html\Form\{
|
||||
Div,
|
||||
Fieldset,
|
||||
|
@ -25,14 +26,8 @@ use Dotclear\Helper\Html\Form\{
|
|||
Note,
|
||||
Para
|
||||
};
|
||||
|
||||
/* clearbricks */
|
||||
use files;
|
||||
use text;
|
||||
use xmlTag;
|
||||
use DOMDocument;
|
||||
|
||||
/* php */
|
||||
use Dotclear\Helper\Html\XmlTag;
|
||||
use Dotclear\Helper\Text;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
|
@ -97,7 +92,7 @@ class dcstore extends Action
|
|||
$content = $this->prettyXML($content);
|
||||
|
||||
try {
|
||||
files::putContent($this->module->get('root') . DIRECTORY_SEPARATOR . 'dcstore.xml', $content);
|
||||
Files::putContent($this->module->get('root') . DIRECTORY_SEPARATOR . 'dcstore.xml', $content);
|
||||
$this->setSuccess(__('Write dcstore.xml file.'));
|
||||
} catch (Exception $e) {
|
||||
$this->setError(__('Failed to write dcstore.xml file'));
|
||||
|
@ -111,7 +106,7 @@ class dcstore extends Action
|
|||
public function generateXML(): string
|
||||
{
|
||||
$xml = ['<modules xmlns:da="http://dotaddict.org/da/">'];
|
||||
$rsp = new xmlTag('module');
|
||||
$rsp = new XmlTag('module');
|
||||
|
||||
# id
|
||||
$rsp->id = $this->module->getId();
|
||||
|
@ -168,35 +163,35 @@ class dcstore extends Action
|
|||
if (empty($this->module->get('dc_min'))) {
|
||||
$this->setWarning(__('no minimum dotclear version'));
|
||||
} else {
|
||||
$rsp->insertNode(new xmlTag('da:dcmin', $this->module->get('dc_min')));
|
||||
$rsp->insertNode(new XmlTag('da:dcmin', $this->module->get('dc_min')));
|
||||
}
|
||||
|
||||
# da details
|
||||
if (empty($this->module->get('details'))) {
|
||||
$this->setWarning(__('no details URL'));
|
||||
} else {
|
||||
$rsp->insertNode(new xmlTag('da:details', $this->module->get('details')));
|
||||
$rsp->insertNode(new XmlTag('da:details', $this->module->get('details')));
|
||||
}
|
||||
|
||||
# da sshot
|
||||
//$rsp->insertNode(new xmlTag('da:sshot', $this->module['sshot']));
|
||||
//$rsp->insertNode(new XmlTag('da:sshot', $this->module['sshot']));
|
||||
|
||||
# da section
|
||||
if (!empty($this->module->get('section'))) {
|
||||
$rsp->insertNode(new xmlTag('da:section', $this->module->get('section')));
|
||||
$rsp->insertNode(new XmlTag('da:section', $this->module->get('section')));
|
||||
}
|
||||
|
||||
# da support
|
||||
if (empty($this->module->get('support'))) {
|
||||
$this->setWarning(__('no support URL'));
|
||||
} else {
|
||||
$rsp->insertNode(new xmlTag('da:support', $this->module->get('support')));
|
||||
$rsp->insertNode(new XmlTag('da:support', $this->module->get('support')));
|
||||
}
|
||||
|
||||
# da tags
|
||||
//$rsp->insertNode(new xmlTag('da:tags', $this->module['tags']));
|
||||
//$rsp->insertNode(new XmlTag('da:tags', $this->module['tags']));
|
||||
|
||||
$res = new xmlTag('modules', $rsp);
|
||||
$res = new XmlTag('modules', $rsp);
|
||||
$res->insertAttr('xmlns:da', 'http://dotaddict.org/da/');
|
||||
|
||||
return self::prettyXML($res->toXML());
|
||||
|
@ -218,7 +213,7 @@ class dcstore extends Action
|
|||
|
||||
private function parseFilePattern(): string
|
||||
{
|
||||
return text::tidyURL(str_replace(
|
||||
return Text::tidyURL(str_replace(
|
||||
[
|
||||
'%type%',
|
||||
'%id%',
|
||||
|
|
|
@ -14,7 +14,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve\Module;
|
||||
|
||||
/* dotclear */
|
||||
use Dotclear\Helper\Html\Form\{
|
||||
Checkbox,
|
||||
Div,
|
||||
|
@ -24,12 +23,8 @@ use Dotclear\Helper\Html\Form\{
|
|||
Note,
|
||||
Para
|
||||
};
|
||||
|
||||
/* improve */
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
|
||||
/* clearbricks */
|
||||
|
||||
/**
|
||||
* Improve action module end of file
|
||||
*/
|
||||
|
|
|
@ -14,7 +14,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve\Module;
|
||||
|
||||
/* dotclear */
|
||||
use dcCore;
|
||||
use Dotclear\Helper\Html\Form\{
|
||||
Checkbox,
|
||||
|
@ -26,12 +25,8 @@ use Dotclear\Helper\Html\Form\{
|
|||
Note,
|
||||
Para
|
||||
};
|
||||
|
||||
/* improve */
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
|
||||
/* clearbricks */
|
||||
|
||||
/**
|
||||
* Improve action module Github shields.io
|
||||
*/
|
||||
|
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve\Module;
|
||||
|
||||
/* dotclear */
|
||||
use Dotclear\Helper\File\Files;
|
||||
use Dotclear\Helper\Html\Form\{
|
||||
Checkbox,
|
||||
Div,
|
||||
|
@ -24,14 +24,7 @@ use Dotclear\Helper\Html\Form\{
|
|||
Para,
|
||||
Select
|
||||
};
|
||||
|
||||
/* improve */
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
|
||||
/* clearbricks */
|
||||
use files;
|
||||
|
||||
/* php */
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
|
@ -137,7 +130,7 @@ class licensefile extends Action
|
|||
|
||||
return null;
|
||||
}
|
||||
files::putContent($this->module->get('root') . DIRECTORY_SEPARATOR . 'LICENSE', str_replace("\r\n", "\n", $full));
|
||||
Files::putContent($this->module->get('root') . DIRECTORY_SEPARATOR . 'LICENSE', str_replace("\r\n", "\n", $full));
|
||||
$this->setSuccess(__('Write new license file "LICENSE"'));
|
||||
} catch (Exception $e) {
|
||||
$this->setError(__('Failed to write new license file'));
|
||||
|
@ -154,7 +147,7 @@ class licensefile extends Action
|
|||
if ($only_one && $file != 'LICENSE') {
|
||||
continue;
|
||||
}
|
||||
if (!files::isDeletable($this->module->get('root') . DIRECTORY_SEPARATOR . $file)) {
|
||||
if (!Files::isDeletable($this->module->get('root') . DIRECTORY_SEPARATOR . $file)) {
|
||||
$this->setWarning(sprintf(__('Old license file is not deletable (%s)'), $file));
|
||||
} elseif (!@unlink($this->module->get('root') . DIRECTORY_SEPARATOR . $file)) {
|
||||
$this->setError(sprintf(__('Failed to delete old license file (%s)'), $file));
|
||||
|
|
|
@ -14,7 +14,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve\Module;
|
||||
|
||||
/* dotclear */
|
||||
use Dotclear\Helper\Html\Form\{
|
||||
Div,
|
||||
Fieldset,
|
||||
|
@ -24,13 +23,9 @@ use Dotclear\Helper\Html\Form\{
|
|||
Note,
|
||||
Para
|
||||
};
|
||||
|
||||
/* improve */
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
use Dotclear\Plugin\improve\Core;
|
||||
|
||||
/* clearbricks */
|
||||
|
||||
/**
|
||||
* Improve action module new line
|
||||
*/
|
||||
|
|
|
@ -14,13 +14,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve\Module;
|
||||
|
||||
/* improve */
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
use Dotclear\Plugin\improve\My;
|
||||
|
||||
/* dotclear */
|
||||
use dcCore;
|
||||
use dcPage;
|
||||
use Dotclear\Helper\File\Path;
|
||||
use Dotclear\Helper\Html\Form\{
|
||||
Div,
|
||||
Fieldset,
|
||||
|
@ -31,12 +27,9 @@ use Dotclear\Helper\Html\Form\{
|
|||
Para,
|
||||
Textarea
|
||||
};
|
||||
|
||||
/* clearbricks */
|
||||
use html;
|
||||
use path;
|
||||
|
||||
/* php */
|
||||
use Dotclear\Helper\Html\Html;
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
use Dotclear\Plugin\improve\My;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
|
@ -121,7 +114,7 @@ class phpcsfixer extends Action
|
|||
// file_content
|
||||
(new Para())->items([
|
||||
(new Label(__('PHP CS Fixer configuration file:')))->for('file_content'),
|
||||
(new Textarea('file_content', html::escapeHTML($content)))->class('maximal')->cols(120)->rows(14)->extra('readonly="true"'),
|
||||
(new Textarea('file_content', Html::escapeHTML($content)))->class('maximal')->cols(120)->rows(14)->readonly(true),
|
||||
]),
|
||||
]),
|
||||
])->render() . (
|
||||
|
@ -174,7 +167,7 @@ class phpcsfixer extends Action
|
|||
if (empty($phpexe_path) && !empty(PHP_BINDIR)) {
|
||||
$phpexe_path = PHP_BINDIR;
|
||||
}
|
||||
$phpexe_path = (string) path::real($phpexe_path);
|
||||
$phpexe_path = (string) Path::real($phpexe_path);
|
||||
if (!empty($phpexe_path)) {
|
||||
$phpexe_path .= '/';
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve\Module;
|
||||
|
||||
/* dotclear */
|
||||
use dcCore;
|
||||
use Dotclear\Helper\Html\Form\{
|
||||
Checkbox,
|
||||
|
@ -27,14 +26,8 @@ use Dotclear\Helper\Html\Form\{
|
|||
Select,
|
||||
Textarea
|
||||
};
|
||||
|
||||
/* improve */
|
||||
use Dotclear\Helper\Html\Html;
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
|
||||
/* clearbricks */
|
||||
use html;
|
||||
|
||||
/* php */
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
|
@ -144,7 +137,7 @@ class phpheader extends Action
|
|||
// bloc_content
|
||||
(new Para())->items([
|
||||
(new Label(__('Bloc content:')))->for('bloc_content'),
|
||||
(new Textarea('bloc_content', html::escapeHTML($this->bloc_content)))->cols(120)->rows(10),
|
||||
(new Textarea('bloc_content', Html::escapeHTML($this->bloc_content)))->cols(120)->rows(10),
|
||||
]),
|
||||
(new Note())->text(sprintf(
|
||||
__('You can use wildcards %s'),
|
||||
|
@ -154,7 +147,7 @@ class phpheader extends Action
|
|||
// exemple
|
||||
(new Para())->items([
|
||||
(new Label(__('Exemple:')))->for('content_exemple'),
|
||||
(new Textarea('content_exemple', html::escapeHTML(self::$exemple)))->cols(120)->rows(10)->extra('readonly="true"'),
|
||||
(new Textarea('content_exemple', Html::escapeHTML(self::$exemple)))->cols(120)->rows(10)->readonly(true),
|
||||
]),
|
||||
]),
|
||||
])->render();
|
||||
|
|
|
@ -14,13 +14,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve\Module;
|
||||
|
||||
/* improve */
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
use Dotclear\Plugin\improve\My;
|
||||
|
||||
/* dotclear */
|
||||
use dcCore;
|
||||
use dcPage;
|
||||
use Dotclear\Helper\File\Path;
|
||||
use Dotclear\Helper\Html\Form\{
|
||||
Checkbox,
|
||||
Div,
|
||||
|
@ -33,12 +29,9 @@ use Dotclear\Helper\Html\Form\{
|
|||
Para,
|
||||
Textarea
|
||||
};
|
||||
|
||||
/* clearbricks */
|
||||
use html;
|
||||
use path;
|
||||
|
||||
/* php */
|
||||
use Dotclear\Helper\Html\Html;
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
use Dotclear\Plugin\improve\My;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
|
@ -164,7 +157,7 @@ class phpstan extends Action
|
|||
// file_content
|
||||
(new Para())->items([
|
||||
(new Label(__('PHPStan configuration file:')))->for('file_content'),
|
||||
(new Textarea('file_content', html::escapeHTML($content)))->class('maximal')->cols(120)->rows(14)->extra('readonly="true"'),
|
||||
(new Textarea('file_content', Html::escapeHTML($content)))->class('maximal')->cols(120)->rows(14)->readonly(true),
|
||||
]),
|
||||
]),
|
||||
])->render() . (
|
||||
|
@ -273,7 +266,7 @@ class phpstan extends Action
|
|||
if (empty($phpexe_path) && !empty(PHP_BINDIR)) {
|
||||
$phpexe_path = PHP_BINDIR;
|
||||
}
|
||||
$phpexe_path = (string) path::real($phpexe_path);
|
||||
$phpexe_path = (string) Path::real($phpexe_path);
|
||||
if (!empty($phpexe_path)) {
|
||||
$phpexe_path .= '/';
|
||||
}
|
||||
|
@ -292,9 +285,9 @@ class phpstan extends Action
|
|||
],
|
||||
[
|
||||
$this->run_level,
|
||||
(string) path::real($this->module->get('root'), false),
|
||||
(string) path::real(DC_ROOT, false),
|
||||
(string) path::real(__DIR__ . '/phpstan', false),
|
||||
(string) Path::real($this->module->get('root'), false),
|
||||
(string) Path::real(DC_ROOT, false),
|
||||
(string) Path::real(__DIR__ . '/phpstan', false),
|
||||
],
|
||||
(string) file_get_contents(__DIR__ . '/phpstan/phpstan.rules.' . $full . 'conf')
|
||||
);
|
||||
|
|
|
@ -14,14 +14,11 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve\Module;
|
||||
|
||||
/* improve */
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
|
||||
/* clearbricks */
|
||||
use l10n;
|
||||
|
||||
/* php */
|
||||
|
||||
/**
|
||||
* Improve action module dcstore.xml
|
||||
*/
|
||||
|
|
|
@ -14,7 +14,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve\Module;
|
||||
|
||||
/* improve */
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,8 +14,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\improve\Module;
|
||||
|
||||
/* dotclear */
|
||||
use dcCore;
|
||||
use Dotclear\Helper\File\Files;
|
||||
use Dotclear\Helper\File\Path;
|
||||
use Dotclear\Helper\Html\Form\{
|
||||
Checkbox,
|
||||
Div,
|
||||
|
@ -26,14 +27,8 @@ use Dotclear\Helper\Html\Form\{
|
|||
Note,
|
||||
Para
|
||||
};
|
||||
|
||||
/* improve */
|
||||
use Dotclear\Plugin\improve\Action;
|
||||
|
||||
/* clearbricks */
|
||||
use path;
|
||||
use files;
|
||||
|
||||
/**
|
||||
* Improve action module zip
|
||||
*/
|
||||
|
@ -125,7 +120,7 @@ class zip extends Action
|
|||
(new Note())->text(sprintf(
|
||||
__('Preconization: %s'),
|
||||
dcCore::app()->blog->public_path ?
|
||||
path::real(dcCore::app()->blog->public_path) : __("Blog's public directory")
|
||||
Path::real(dcCore::app()->blog->public_path) : __("Blog's public directory")
|
||||
))->class('form-note'),
|
||||
]),
|
||||
(new Fieldset())->class('fieldset')->legend((new Legend(__('Files'))))->fields([
|
||||
|
@ -199,7 +194,7 @@ class zip extends Action
|
|||
);
|
||||
$parts = explode('/', $file);
|
||||
foreach ($parts as $i => $part) {
|
||||
$parts[$i] = files::tidyFileName($part);
|
||||
$parts[$i] = Files::tidyFileName($part);
|
||||
}
|
||||
$path = $this->getSetting('pack_repository') . '/' . implode('/', $parts) . '.zip';
|
||||
if (file_exists($path) && empty($this->getSetting('pack_overwrite'))) {
|
||||
|
@ -223,7 +218,7 @@ class zip extends Action
|
|||
$zip->addExclusion($e);
|
||||
}
|
||||
$zip->addDirectory(
|
||||
path::real($this->module->get('root')),
|
||||
Path::real($this->module->get('root')),
|
||||
$this->module->getId(),
|
||||
true
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue