Compare commits
No commits in common. "master" and "v1.2" have entirely different histories.
@ -1,10 +1,3 @@
|
||||
filesAlias 1.2.1 - 2023.11.04
|
||||
===========================================================
|
||||
* Require Dotclear 2.28
|
||||
* Require PHP 8.1
|
||||
* Fix typo
|
||||
* Code review
|
||||
|
||||
filesAlias 1.2 - 2023.10.17
|
||||
===========================================================
|
||||
* Require Dotclear 2.28
|
||||
|
@ -1,7 +1,7 @@
|
||||
# README
|
||||
|
||||
[![Release](https://img.shields.io/badge/release-1.2.1-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/filesAlias/releases)
|
||||
![Date](https://img.shields.io/badge/date-2023.11.04-c44d58.svg)
|
||||
[![Release](https://img.shields.io/badge/release-1.2-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/filesAlias/releases)
|
||||
![Date](https://img.shields.io/badge/date-2023.10.17-c44d58.svg)
|
||||
[![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download)
|
||||
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/filesAlias)
|
||||
[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/filesAlias/src/branch/master/LICENSE)
|
||||
@ -32,7 +32,6 @@ You can change public URL handler (default is _pub/_) by using plugin myUrlhandl
|
||||
* [Packages & details](https://git.dotclear.watch/JcDenis/filesAlias/releases) (or on [Dotaddict](https://plugins.dotaddict.org/dc2/details/filesAlias))
|
||||
* [Sources & contributions](https://git.dotclear.watch/JcDenis/filesAlias) (or on [GitHub](https://github.com/JcDenis/filesAlias))
|
||||
* [Issues & security](https://git.dotclear.watch/JcDenis/filesAlias/issues) (or on [GitHub](https://github.com/JcDenis/filesAlias/issues))
|
||||
* [Discuss & help](https://forum.dotclear.org/viewtopic.php?id=42317)
|
||||
|
||||
## CONTRIBUTORS
|
||||
|
||||
|
@ -18,7 +18,7 @@ $this->registerModule(
|
||||
'Files alias',
|
||||
"Manage aliases of your blog's media",
|
||||
'Osku and contributors',
|
||||
'1.2.1',
|
||||
'1.2',
|
||||
[
|
||||
'requires' => [['core', '2.28']],
|
||||
'permissions' => 'My',
|
||||
|
@ -2,10 +2,10 @@
|
||||
<modules xmlns:da="http://dotaddict.org/da/">
|
||||
<module id="filesAlias">
|
||||
<name>Files alias</name>
|
||||
<version>1.2.1</version>
|
||||
<version>1.2</version>
|
||||
<author>Osku and contributors</author>
|
||||
<desc>Manage aliases of your blog's media</desc>
|
||||
<file>https://git.dotclear.watch/JcDenis/filesAlias/releases/download/v1.2.1/plugin-filesAlias.zip</file>
|
||||
<file>https://git.dotclear.watch/JcDenis/filesAlias/releases/download/v1.2/plugin-filesAlias.zip</file>
|
||||
<da:dcmin>2.28</da:dcmin>
|
||||
<da:details>https://git.dotclear.watch/JcDenis/filesAlias/src/branch/master/README.md</da:details>
|
||||
<da:support>https://git.dotclear.watch/JcDenis/filesAlias/issues</da:support>
|
||||
|
@ -29,7 +29,8 @@ class Frontend extends Process
|
||||
}
|
||||
|
||||
// add path to template
|
||||
App::frontend()->template()->appendPath(
|
||||
App::frontend()->template()->setPath(
|
||||
App::frontend()->template()->getPath(),
|
||||
My::path() . DIRECTORY_SEPARATOR . 'default-templates'
|
||||
);
|
||||
// register template value for file alias
|
||||
|
@ -24,7 +24,7 @@ class FrontendTemplate
|
||||
*
|
||||
* - any filters See Tpl::getFilters()
|
||||
*
|
||||
* @param ArrayObject<string, mixed> $attr The attributes
|
||||
* @param ArrayObject $attr The attributes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
@ -67,7 +67,7 @@ class Manage extends Process
|
||||
$password = empty($_POST['filesalias_password']) ? '' : $_POST['filesalias_password'];
|
||||
|
||||
if (preg_match('/^' . preg_quote(App::media()->root_url, '/') . '/', $target)) {
|
||||
$target = (string) preg_replace('/^' . preg_quote(App::media()->root_url, '/') . '/', '', $target);
|
||||
$target = preg_replace('/^' . preg_quote(App::media()->root_url, '/') . '/', '', $target);
|
||||
$found = Utils::getMediaId($target);
|
||||
|
||||
if (!empty($found)) {
|
||||
@ -139,19 +139,19 @@ class Manage extends Process
|
||||
// destination
|
||||
(new Para())->items([
|
||||
(new Label(__('Destination:')))->for('filesalias_destination')->class('required'),
|
||||
(new Input('filesalias_destination'))->size(70)->maxlength(255),
|
||||
(new Input('filesalias_destination'))->size(70)->maxlenght(255),
|
||||
]),
|
||||
(new Note())->text(__('Destination file must be in media manager.'))->class('form-note'),
|
||||
// url
|
||||
(new Para())->items([
|
||||
(new Label(__('URL (alias):')))->for('filesalias_url')->class('required'),
|
||||
(new Input('filesalias_url'))->size(70)->maxlength(255),
|
||||
(new Input('filesalias_url'))->size(70)->maxlenght(255),
|
||||
]),
|
||||
(new Note())->text(__('Leave empty to get a randomize alias.'))->class('form-note'),
|
||||
// password
|
||||
(new Para())->items([
|
||||
(new Label(__('Password:')))->for('filesalias_password')->class('required'),
|
||||
(new Input('filesalias_password'))->size(70)->maxlength(255),
|
||||
(new Input('filesalias_password'))->size(70)->maxlenght(255),
|
||||
]),
|
||||
// disposable
|
||||
(new Para())->items([
|
||||
@ -198,13 +198,13 @@ class Manage extends Process
|
||||
|
||||
$lines .= '<tr class="line" id="l_' . $i . '">' .
|
||||
'<td>' .
|
||||
(new Input(['a[' . $i . '][filesalias_destination]']))->size(50)->maxlength(255)->value(Html::escapeHTML($destination))->render() .
|
||||
(new Input(['a[' . $i . '][filesalias_destination]']))->size(50)->maxlenght(255)->value(Html::escapeHTML($destination))->render() .
|
||||
'</td>' .
|
||||
'<td>' .
|
||||
(new Input(['a[' . $i . '][filesalias_url]']))->size(50)->maxlength(255)->value(Html::escapeHTML($url))->render() .
|
||||
(new Input(['a[' . $i . '][filesalias_url]']))->size(50)->maxlenght(255)->value(Html::escapeHTML($url))->render() .
|
||||
'<a href="' . $full . '">' . __('link') . '</a></td>' .
|
||||
'<td>' .
|
||||
(new Input(['a[' . $i . '][filesalias_password]']))->size(50)->maxlength(255)->value(Html::escapeHTML($password))->render() .
|
||||
(new Input(['a[' . $i . '][filesalias_password]']))->size(50)->maxlenght(255)->value(Html::escapeHTML($password))->render() .
|
||||
'</td>' .
|
||||
'<td class="maximal">' .
|
||||
(new Checkbox(['a[' . $i . '][filesalias_disposable]'], $disposable))->value(1)->render() .
|
||||
|
@ -177,6 +177,6 @@ class Utils
|
||||
->and('media_file = ' . $sql->quote($target))
|
||||
->select();
|
||||
|
||||
return !is_null($rs) && $rs->count() ? (int) $rs->f('media_id') : 0;
|
||||
return $rs->count() ? (int) $rs->f('media_id') : 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user