Compare commits

..

No commits in common. "18f27cc20ab3016560703453a1dc8253395d58eb" and "f304f15d871109421448c6e8c53e670a48ea58fd" have entirely different histories.

14 changed files with 119 additions and 381 deletions

View File

@ -1,14 +1,3 @@
2.2 - 2023.07.30
* require Dotclear 2.27
* require PHP 7.4+
* use new svg icon
* update to Dotclear 2.27-dev
2.1 - 2023.05.13
* require Dotclear 2.26
* fix nullsafe warnings
* add plugin Uninstaller features
2.0 - 2023.04.11 2.0 - 2023.04.11
* require Dotclear 2.26 * require Dotclear 2.26
* use namespace * use namespace

View File

@ -3,7 +3,7 @@
[![Release](https://img.shields.io/github/v/release/JcDenis/arlequin)](https://github.com/JcDenis/arlequin/releases) [![Release](https://img.shields.io/github/v/release/JcDenis/arlequin)](https://github.com/JcDenis/arlequin/releases)
[![Date](https://img.shields.io/github/release-date/JcDenis/arlequin)](https://github.com/JcDenis/arlequin/releases) [![Date](https://img.shields.io/github/release-date/JcDenis/arlequin)](https://github.com/JcDenis/arlequin/releases)
[![Issues](https://img.shields.io/github/issues/JcDenis/arlequin)](https://github.com/JcDenis/arlequin/issues) [![Issues](https://img.shields.io/github/issues/JcDenis/arlequin)](https://github.com/JcDenis/arlequin/issues)
[![Dotclear](https://img.shields.io/badge/dotclear-v2.27-blue.svg)](https://fr.dotclear.org/download) [![Dotclear](https://img.shields.io/badge/dotclear-v2.26-blue.svg)](https://fr.dotclear.org/download)
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-green.svg)](https://plugins.dotaddict.org/dc2/details/arlequin) [![Dotaddict](https://img.shields.io/badge/dotaddict-official-green.svg)](https://plugins.dotaddict.org/dc2/details/arlequin)
[![License](https://img.shields.io/github/license/JcDenis/arlequin)](https://github.com/JcDenis/arlequin/blob/master/LICENSE) [![License](https://img.shields.io/github/license/JcDenis/arlequin)](https://github.com/JcDenis/arlequin/blob/master/LICENSE)
@ -18,9 +18,8 @@ It allows visitors to select a theme on your blog.
_arlequin_ requires: _arlequin_ requires:
* content admin permissions to manage theme and public menu * content admin permissions to manage theme and public menu
* Dotclear 2.27 * Dotclear 2.26
* PHP 7.4+
## USAGE ## USAGE

View File

@ -18,11 +18,11 @@ $this->registerModule(
'Arlequin', 'Arlequin',
'Allows visitors choose a theme', 'Allows visitors choose a theme',
'Oleksandr Syenchuk, Pierre Van Glabeke and contributors', 'Oleksandr Syenchuk, Pierre Van Glabeke and contributors',
'2.2', '2.0',
[ [
'requires' => [['core', '2.27']], 'requires' => [['core', '2.26']],
'permissions' => dcCore::app()->auth->makePermissions([ 'permissions' => dcCore::app()->auth->makePermissions([
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, dcAuth::PERMISSION_CONTENT_ADMIN,
]), ]),
'type' => 'plugin', 'type' => 'plugin',
'support' => 'http://forum.dotclear.org/viewtopic.php?id=48345', 'support' => 'http://forum.dotclear.org/viewtopic.php?id=48345',

View File

@ -2,11 +2,11 @@
<modules xmlns:da="http://dotaddict.org/da/"> <modules xmlns:da="http://dotaddict.org/da/">
<module id="arlequin"> <module id="arlequin">
<name>Arlequin</name> <name>Arlequin</name>
<version>2.2</version> <version>2.0</version>
<author>Oleksandr Syenchuk, Pierre Van Glabeke and contributors</author> <author>Oleksandr Syenchuk, Pierre Van Glabeke and contributors</author>
<desc>Allows visitors choose a theme</desc> <desc>Allows visitors choose a theme</desc>
<file>https://github.com/JcDenis/arlequin/releases/download/v2.2/plugin-arlequin.zip</file> <file>https://github.com/JcDenis/arlequin/releases/download/v2.0/plugin-arlequin.zip</file>
<da:dcmin>2.27</da:dcmin> <da:dcmin>2.26</da:dcmin>
<da:details>https://plugins.dotaddict.org/dc2/details/arlequin</da:details> <da:details>https://plugins.dotaddict.org/dc2/details/arlequin</da:details>
<da:support>http://forum.dotclear.org/viewtopic.php?id=48345</da:support> <da:support>http://forum.dotclear.org/viewtopic.php?id=48345</da:support>
</module> </module>

BIN
icon-big.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -1,111 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
<svg
height="251px"
width="251px"
version="1.1"
id="_x32_"
viewBox="0 0 512 512"
xml:space="preserve"
fill="#000000"
stroke="#000000"
sodipodi:docname="icon-dark.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs26"> <style
type="text/css"
id="style4"> .st0{fill:#000000;} </style> </defs><sodipodi:namedview
id="namedview24"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="2.2310757"
inkscape:cx="125.94821"
inkscape:cy="125.5"
inkscape:window-width="1920"
inkscape:window-height="1012"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="_x32_" />
<g
id="SVGRepo_bgCarrier"
stroke-width="0" />
<g
id="SVGRepo_tracerCarrier"
stroke-linecap="round"
stroke-linejoin="round" />
<g
id="g20"
style="fill:#b3b3b3;fill-opacity:1;stroke:none"> <path
class="st0"
d="M 468.277,116.662 C 440.675,75.816 401.617,43.377 355.661,23.934 325.023,10.979 291.311,3.812 256.007,3.812 c -35.303,0 -68.914,7.166 -99.421,20.135 C 126.079,36.917 98.675,55.667 75.642,78.823 29.582,125.11 0.966,189.104 0.014,259.601 v 0.013 C 0.007,260.484 0,261.354 0,262.21 c 0,18.834 2.796,34.96 7.865,48.553 5.056,13.585 12.442,24.608 21.286,32.857 5.892,5.508 12.407,9.77 19.176,12.812 9.037,4.056 18.491,5.946 27.658,5.946 8.187,0 16.147,-1.493 23.485,-4.384 7.331,-2.898 14.065,-7.2 19.587,-12.921 14.641,-15.181 35.708,-24.334 59.042,-24.341 17.401,0.007 33.44,5.262 46.826,14.298 13.373,9.03 24.019,21.854 30.363,36.865 4.234,10.016 6.577,20.998 6.577,32.603 0.007,4.679 -0.753,9.551 -1.966,14.894 -1.192,5.33 -2.843,11.071 -4.281,17.415 -1.35,5.988 -2.014,11.722 -2.014,17.196 -0.028,10.125 2.37,19.388 6.694,27.061 4.302,7.694 10.406,13.654 17.072,17.867 4.446,2.822 9.153,4.905 13.914,6.385 6.351,1.96 12.798,2.864 19.053,2.871 5.857,-0.007 11.564,-0.788 16.976,-2.46 52.951,-16.387 99.058,-48.594 132.012,-91.364 32.946,-42.75 52.69,-96.215 52.677,-154.558 0.011,-52.964 -16.13,-102.298 -43.725,-143.143 z M 435.803,396.25 c -29.157,37.872 -70.167,66.564 -117.261,81.129 -2.165,0.671 -5.076,1.137 -8.207,1.124 -3.775,0.013 -7.852,-0.644 -11.483,-1.946 -3.652,-1.294 -6.816,-3.192 -9.235,-5.549 -1.616,-1.576 -2.932,-3.357 -3.98,-5.508 -1.384,-2.878 -2.343,-6.482 -2.357,-11.496 0,-3.042 0.37,-6.584 1.295,-10.674 1.164,-5.214 2.822,-10.975 4.281,-17.408 1.446,-6.427 2.686,-13.565 2.686,-21.424 0.006,-23.443 -7.153,-45.353 -19.382,-63.439 -12.229,-18.1 -29.52,-32.467 -49.902,-41.086 -13.579,-5.748 -28.541,-8.926 -44.161,-8.926 -31.124,0 -60.014,12.277 -80.403,33.418 -2.274,2.357 -5.378,4.44 -9.118,5.92 -3.727,1.466 -8.057,2.316 -12.592,2.316 -5.714,0 -11.715,-1.329 -17.402,-4.268 -5.686,-2.953 -11.133,-7.475 -15.867,-14.312 -3.151,-4.563 -5.981,-10.167 -8.2,-17.073 -2.967,-9.194 -4.837,-20.703 -4.837,-34.837 0,-0.733 0.007,-1.472 0.014,-2.213 v 0.007 c 0.637,-47.012 15.072,-90.563 39.44,-126.73 24.382,-36.159 58.699,-64.858 99.065,-82.012 26.917,-11.442 56.521,-17.771 87.809,-17.771 46.922,0.007 90.385,14.236 126.524,38.639 36.132,24.403 64.844,58.994 82.013,99.585 11.448,27.068 17.778,56.802 17.778,88.09 -0.013,51.622 -17.36,98.558 -46.518,136.444 z"
id="path6"
style="fill:#b3b3b3;fill-opacity:1;stroke:none" /> <path
class="st0"
d="m 392.273,296.061 c -6.221,-2.631 -13.086,-4.09 -20.225,-4.09 -10.708,-0.007 -20.772,3.282 -29.048,8.886 -8.282,5.59 -14.846,13.496 -18.799,22.834 -2.637,6.22 -4.09,13.085 -4.09,20.217 -0.007,10.715 3.282,20.779 8.879,29.048 5.597,8.29 13.503,14.852 22.841,18.806 6.22,2.638 13.085,4.09 20.217,4.09 10.716,0 20.78,-3.281 29.055,-8.879 8.276,-5.604 14.846,-13.503 18.799,-22.841 2.638,-6.221 4.09,-13.085 4.09,-20.224 0.007,-10.708 -3.281,-20.772 -8.878,-29.048 -5.598,-8.276 -13.504,-14.853 -22.841,-18.799 z m 1.321,62.357 c -2.802,4.152 -6.796,7.467 -11.44,9.427 -3.097,1.302 -6.482,2.028 -10.106,2.035 -5.418,-0.007 -10.345,-1.624 -14.503,-4.433 -4.152,-2.795 -7.468,-6.789 -9.427,-11.434 -1.308,-3.096 -2.034,-6.482 -2.034,-10.106 0.006,-5.419 1.623,-10.345 4.425,-14.51 2.802,-4.152 6.796,-7.454 11.441,-9.42 3.097,-1.308 6.481,-2.034 10.098,-2.034 5.426,0.006 10.352,1.63 14.518,4.426 4.145,2.809 7.461,6.796 9.42,11.441 1.309,3.097 2.035,6.481 2.035,10.098 -0.007,5.426 -1.625,10.352 -4.427,14.51 z"
id="path8"
style="fill:#b3b3b3;fill-opacity:1;stroke:none" /> <path
class="st0"
d="m 126.462,175.094 c -20.998,0 -38.022,17.024 -38.022,38.03 0,20.991 17.024,38.023 38.022,38.023 21.005,0 38.03,-17.032 38.03,-38.023 0,-21.006 -17.025,-38.03 -38.03,-38.03 z"
id="path10"
style="fill:#b3b3b3;fill-opacity:1;stroke:none" /> <path
class="st0"
d="m 193.245,100.274 c -18.265,0 -33.076,14.812 -33.076,33.077 0,18.271 14.812,33.083 33.076,33.083 18.271,0 33.084,-14.812 33.084,-33.083 0,-18.265 -14.813,-33.077 -33.084,-33.077 z"
id="path12"
style="fill:#b3b3b3;fill-opacity:1;stroke:none" /> <path
class="st0"
d="m 288.782,90.382 c -16.387,0 -29.679,13.29 -29.679,29.678 0,16.388 13.292,29.679 29.679,29.679 16.387,0 29.678,-13.291 29.678,-29.679 0,-16.388 -13.291,-29.678 -29.678,-29.678 z"
id="path14"
style="fill:#b3b3b3;fill-opacity:1;stroke:none" /> <path
class="st0"
d="m 361.745,190.392 c 14.599,0 26.431,-11.838 26.431,-26.431 0,-14.599 -11.832,-26.431 -26.431,-26.431 -14.6,0 -26.431,11.832 -26.431,26.431 0,14.592 11.831,26.431 26.431,26.431 z"
id="path16"
style="fill:#b3b3b3;fill-opacity:1;stroke:none" /> <path
class="st0"
d="m 376.933,233.834 c 0,11.42 9.262,20.669 20.676,20.669 11.42,0 20.676,-9.249 20.676,-20.669 0,-11.42 -9.256,-20.67 -20.676,-20.67 -11.414,0 -20.676,9.25 -20.676,20.67 z"
id="path18"
style="fill:#b3b3b3;fill-opacity:1;stroke:none" /> </g>
<ellipse
style="fill:#c44d58;fill-opacity:1;stroke:none;stroke-width:24.5003;stroke-linejoin:round;paint-order:stroke fill markers"
id="path912"
cx="194.98715"
cy="133.4313"
rx="34.984379"
ry="35.986645" /><ellipse
style="fill:#167bba;fill-opacity:1;stroke:none;stroke-width:15.7843;stroke-linejoin:round;paint-order:stroke fill markers"
id="path1132"
cx="131.52965"
cy="214.50272"
rx="45.028"
ry="45.502174" /><ellipse
style="fill:#88c200;fill-opacity:1;stroke:none;stroke-width:17.9477;stroke-linejoin:round;paint-order:stroke fill markers"
id="path1254"
cx="289.29623"
cy="120.40321"
rx="30.856529"
ry="30.494711" /><ellipse
style="fill:#8fcceb;fill-opacity:1;stroke:none;stroke-width:15.7843;stroke-linejoin:round;paint-order:stroke fill markers"
id="path1376"
cx="361.8573"
cy="164.93533"
rx="29.181025"
ry="28.901239" /><ellipse
style="fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:14.3749;stroke-linejoin:round;paint-order:stroke fill markers"
id="path1498"
cx="399.90668"
cy="234.50626"
rx="23.863689"
ry="24.29674" /></svg>

Before

Width:  |  Height:  |  Size: 7.2 KiB

BIN
icon.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

111
icon.svg
View File

@ -1,111 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
<svg
height="251px"
width="251px"
version="1.1"
id="_x32_"
viewBox="0 0 512 512"
xml:space="preserve"
fill="#000000"
stroke="#000000"
sodipodi:docname="icon.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs26"> <style
type="text/css"
id="style4"> .st0{fill:#000000;} </style> </defs><sodipodi:namedview
id="namedview24"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="2.2310757"
inkscape:cx="125.94821"
inkscape:cy="125.5"
inkscape:window-width="1920"
inkscape:window-height="1012"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="_x32_" />
<g
id="SVGRepo_bgCarrier"
stroke-width="0" />
<g
id="SVGRepo_tracerCarrier"
stroke-linecap="round"
stroke-linejoin="round" />
<g
id="g20"
style="fill:#676e78;fill-opacity:1;stroke:none"> <path
class="st0"
d="M 468.277,116.662 C 440.675,75.816 401.617,43.377 355.661,23.934 325.023,10.979 291.311,3.812 256.007,3.812 c -35.303,0 -68.914,7.166 -99.421,20.135 C 126.079,36.917 98.675,55.667 75.642,78.823 29.582,125.11 0.966,189.104 0.014,259.601 v 0.013 C 0.007,260.484 0,261.354 0,262.21 c 0,18.834 2.796,34.96 7.865,48.553 5.056,13.585 12.442,24.608 21.286,32.857 5.892,5.508 12.407,9.77 19.176,12.812 9.037,4.056 18.491,5.946 27.658,5.946 8.187,0 16.147,-1.493 23.485,-4.384 7.331,-2.898 14.065,-7.2 19.587,-12.921 14.641,-15.181 35.708,-24.334 59.042,-24.341 17.401,0.007 33.44,5.262 46.826,14.298 13.373,9.03 24.019,21.854 30.363,36.865 4.234,10.016 6.577,20.998 6.577,32.603 0.007,4.679 -0.753,9.551 -1.966,14.894 -1.192,5.33 -2.843,11.071 -4.281,17.415 -1.35,5.988 -2.014,11.722 -2.014,17.196 -0.028,10.125 2.37,19.388 6.694,27.061 4.302,7.694 10.406,13.654 17.072,17.867 4.446,2.822 9.153,4.905 13.914,6.385 6.351,1.96 12.798,2.864 19.053,2.871 5.857,-0.007 11.564,-0.788 16.976,-2.46 52.951,-16.387 99.058,-48.594 132.012,-91.364 32.946,-42.75 52.69,-96.215 52.677,-154.558 0.011,-52.964 -16.13,-102.298 -43.725,-143.143 z M 435.803,396.25 c -29.157,37.872 -70.167,66.564 -117.261,81.129 -2.165,0.671 -5.076,1.137 -8.207,1.124 -3.775,0.013 -7.852,-0.644 -11.483,-1.946 -3.652,-1.294 -6.816,-3.192 -9.235,-5.549 -1.616,-1.576 -2.932,-3.357 -3.98,-5.508 -1.384,-2.878 -2.343,-6.482 -2.357,-11.496 0,-3.042 0.37,-6.584 1.295,-10.674 1.164,-5.214 2.822,-10.975 4.281,-17.408 1.446,-6.427 2.686,-13.565 2.686,-21.424 0.006,-23.443 -7.153,-45.353 -19.382,-63.439 -12.229,-18.1 -29.52,-32.467 -49.902,-41.086 -13.579,-5.748 -28.541,-8.926 -44.161,-8.926 -31.124,0 -60.014,12.277 -80.403,33.418 -2.274,2.357 -5.378,4.44 -9.118,5.92 -3.727,1.466 -8.057,2.316 -12.592,2.316 -5.714,0 -11.715,-1.329 -17.402,-4.268 -5.686,-2.953 -11.133,-7.475 -15.867,-14.312 -3.151,-4.563 -5.981,-10.167 -8.2,-17.073 -2.967,-9.194 -4.837,-20.703 -4.837,-34.837 0,-0.733 0.007,-1.472 0.014,-2.213 v 0.007 c 0.637,-47.012 15.072,-90.563 39.44,-126.73 24.382,-36.159 58.699,-64.858 99.065,-82.012 26.917,-11.442 56.521,-17.771 87.809,-17.771 46.922,0.007 90.385,14.236 126.524,38.639 36.132,24.403 64.844,58.994 82.013,99.585 11.448,27.068 17.778,56.802 17.778,88.09 -0.013,51.622 -17.36,98.558 -46.518,136.444 z"
id="path6"
style="fill:#676e78;fill-opacity:1;stroke:none" /> <path
class="st0"
d="m 392.273,296.061 c -6.221,-2.631 -13.086,-4.09 -20.225,-4.09 -10.708,-0.007 -20.772,3.282 -29.048,8.886 -8.282,5.59 -14.846,13.496 -18.799,22.834 -2.637,6.22 -4.09,13.085 -4.09,20.217 -0.007,10.715 3.282,20.779 8.879,29.048 5.597,8.29 13.503,14.852 22.841,18.806 6.22,2.638 13.085,4.09 20.217,4.09 10.716,0 20.78,-3.281 29.055,-8.879 8.276,-5.604 14.846,-13.503 18.799,-22.841 2.638,-6.221 4.09,-13.085 4.09,-20.224 0.007,-10.708 -3.281,-20.772 -8.878,-29.048 -5.598,-8.276 -13.504,-14.853 -22.841,-18.799 z m 1.321,62.357 c -2.802,4.152 -6.796,7.467 -11.44,9.427 -3.097,1.302 -6.482,2.028 -10.106,2.035 -5.418,-0.007 -10.345,-1.624 -14.503,-4.433 -4.152,-2.795 -7.468,-6.789 -9.427,-11.434 -1.308,-3.096 -2.034,-6.482 -2.034,-10.106 0.006,-5.419 1.623,-10.345 4.425,-14.51 2.802,-4.152 6.796,-7.454 11.441,-9.42 3.097,-1.308 6.481,-2.034 10.098,-2.034 5.426,0.006 10.352,1.63 14.518,4.426 4.145,2.809 7.461,6.796 9.42,11.441 1.309,3.097 2.035,6.481 2.035,10.098 -0.007,5.426 -1.625,10.352 -4.427,14.51 z"
id="path8"
style="fill:#676e78;fill-opacity:1;stroke:none" /> <path
class="st0"
d="m 126.462,175.094 c -20.998,0 -38.022,17.024 -38.022,38.03 0,20.991 17.024,38.023 38.022,38.023 21.005,0 38.03,-17.032 38.03,-38.023 0,-21.006 -17.025,-38.03 -38.03,-38.03 z"
id="path10"
style="fill:#676e78;fill-opacity:1;stroke:none" /> <path
class="st0"
d="m 193.245,100.274 c -18.265,0 -33.076,14.812 -33.076,33.077 0,18.271 14.812,33.083 33.076,33.083 18.271,0 33.084,-14.812 33.084,-33.083 0,-18.265 -14.813,-33.077 -33.084,-33.077 z"
id="path12"
style="fill:#676e78;fill-opacity:1;stroke:none" /> <path
class="st0"
d="m 288.782,90.382 c -16.387,0 -29.679,13.29 -29.679,29.678 0,16.388 13.292,29.679 29.679,29.679 16.387,0 29.678,-13.291 29.678,-29.679 0,-16.388 -13.291,-29.678 -29.678,-29.678 z"
id="path14"
style="fill:#676e78;fill-opacity:1;stroke:none" /> <path
class="st0"
d="m 361.745,190.392 c 14.599,0 26.431,-11.838 26.431,-26.431 0,-14.599 -11.832,-26.431 -26.431,-26.431 -14.6,0 -26.431,11.832 -26.431,26.431 0,14.592 11.831,26.431 26.431,26.431 z"
id="path16"
style="fill:#676e78;fill-opacity:1;stroke:none" /> <path
class="st0"
d="m 376.933,233.834 c 0,11.42 9.262,20.669 20.676,20.669 11.42,0 20.676,-9.249 20.676,-20.669 0,-11.42 -9.256,-20.67 -20.676,-20.67 -11.414,0 -20.676,9.25 -20.676,20.67 z"
id="path18"
style="fill:#676e78;fill-opacity:1;stroke:none" /> </g>
<ellipse
style="fill:#c44d58;fill-opacity:1;stroke:none;stroke-width:24.5003;stroke-linejoin:round;paint-order:stroke fill markers"
id="path912"
cx="194.98715"
cy="133.4313"
rx="34.984379"
ry="35.986645" /><ellipse
style="fill:#167bba;fill-opacity:1;stroke:none;stroke-width:15.7843;stroke-linejoin:round;paint-order:stroke fill markers"
id="path1132"
cx="131.52965"
cy="214.50272"
rx="45.028"
ry="45.502174" /><ellipse
style="fill:#88c200;fill-opacity:1;stroke:none;stroke-width:17.9477;stroke-linejoin:round;paint-order:stroke fill markers"
id="path1254"
cx="289.29623"
cy="120.40321"
rx="30.856529"
ry="30.494711" /><ellipse
style="fill:#8fcceb;fill-opacity:1;stroke:none;stroke-width:15.7843;stroke-linejoin:round;paint-order:stroke fill markers"
id="path1376"
cx="361.8573"
cy="164.93533"
rx="29.181025"
ry="28.901239" /><ellipse
style="fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:14.3749;stroke-linejoin:round;paint-order:stroke fill markers"
id="path1498"
cx="399.90668"
cy="234.50626"
rx="23.863689"
ry="24.29674" /></svg>

Before

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -14,35 +14,51 @@ declare(strict_types=1);
namespace Dotclear\Plugin\arlequin; namespace Dotclear\Plugin\arlequin;
use dcAdmin;
use dcCore; use dcCore;
use Dotclear\Core\Process; use dcFavorites;
use Dotclear\Core\Backend\{ use dcNsProcess;
Favorites, use dcPage;
Menus
};
class Backend extends Process class Backend extends dcNsProcess
{ {
public static function init(): bool public static function init(): bool
{ {
return self::status(My::checkContext(My::BACKEND)); static::$init = defined('DC_CONTEXT_ADMIN')
&& My::phpCompliant()
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN,
]), dcCore::app()->blog->id);
return static::$init;
} }
public static function process(): bool public static function process(): bool
{ {
if (!self::status()) { if (!static::$init) {
return false; return false;
} }
My::addBackendMenuItem(Menus::MENU_BLOG); dcCore::app()->menu[dcAdmin::MENU_BLOG]->addItem(
My::name(),
dcCore::app()->adminurl->get('admin.plugin.' . My::id()),
dcPage::getPF(My::id() . '/icon.png'),
preg_match(
'/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.' . My::id())) . '(&.*)?$/',
$_SERVER['REQUEST_URI']
),
dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN,
]), dcCore::app()->blog->id)
);
dcCore::app()->addBehaviors([ dcCore::app()->addBehaviors([
'adminDashboardFavoritesV2' => function (Favorites $favs): void { 'adminDashboardFavoritesV2' => function (dcFavorites $favs): void {
$favs->register(My::id(), [ $favs->register(My::id(), [
'title' => My::name(), 'title' => My::name(),
'url' => My::manageUrl(), 'url' => dcCore::app()->adminurl->get('admin.plugin.' . My::id()),
'small-icon' => My::icons(), 'small-icon' => dcPage::getPF(My::id() . '/icon.png'),
'large-icon' => My::icons(), 'large-icon' => dcPage::getPF(My::id() . '/icon-big.png'),
'permissions' => dcCore::app()->auth->makePermissions([ 'permissions' => dcCore::app()->auth->makePermissions([
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, dcCore::app()->auth::PERMISSION_CONTENT_ADMIN,
]), ]),

View File

@ -15,22 +15,24 @@ declare(strict_types=1);
namespace Dotclear\Plugin\arlequin; namespace Dotclear\Plugin\arlequin;
use dcCore; use dcCore;
use Dotclear\Core\Process; use dcNsProcess;
use Dotclear\Helper\Network\Http; use Dotclear\Helper\Network\Http;
class Frontend extends Process class Frontend extends dcNsProcess
{ {
public const COOKIE_THEME_PREFIX = 'dc_theme_'; public const COOKIE_THEME_PREFIX = 'dc_theme_';
public const COOKIE_UPDDT_PREFIX = 'dc_user_upddt_'; public const COOKIE_UPDDT_PREFIX = 'dc_user_upddt_';
public static function init(): bool public static function init(): bool
{ {
return self::status(My::checkContext(My::FRONTEND)); static::$init = true;
return static::$init;
} }
public static function process(): bool public static function process(): bool
{ {
if (!self::status()) { if (!static::$init) {
return false; return false;
} }
@ -41,7 +43,8 @@ class Frontend extends Process
# Redirect if needed # Redirect if needed
if (isset($_GET['theme'])) { if (isset($_GET['theme'])) {
Http::redirect((string) preg_replace('/(\?|&)theme(=.*)?$/', '', Http::getSelfURI())); $p = '/(\?|&)theme(=.*)?$/';
Http::redirect(preg_replace($p, '', Http::getSelfURI()));
} }
# Switch theme # Switch theme
@ -72,8 +75,8 @@ class Frontend extends Process
public static function switchTheme(string $theme): void public static function switchTheme(string $theme): void
{ {
if (My::settings()->get('mt_exclude')) { if (dcCore::app()->blog->settings->get(My::id())->get('mt_exclude')) {
if (in_array($theme, explode('/', My::settings()->get('mt_exclude')))) { if (in_array($theme, explode('/', dcCore::app()->blog->settings->get(My::id())->get('mt_exclude')))) {
return; return;
} }
} }

View File

@ -16,11 +16,8 @@ namespace Dotclear\Plugin\arlequin;
use ArrayObject; use ArrayObject;
use dcCore; use dcCore;
use Dotclear\Core\Process; use dcNsProcess;
use Dotclear\Core\Backend\{ use dcPage;
Notices,
Page
};
use Dotclear\Helper\Html\Form\{ use Dotclear\Helper\Html\Form\{
Div, Div,
Form, Form,
@ -35,21 +32,27 @@ use Dotclear\Helper\Html\Form\{
use Dotclear\Helper\Html\Html; use Dotclear\Helper\Html\Html;
use Exception; use Exception;
class Manage extends Process class Manage extends dcNsProcess
{ {
public static function init(): bool public static function init(): bool
{ {
return self::status(My::checkContext(My::MANAGE)); static::$init = defined('DC_CONTEXT_ADMIN')
&& My::phpCompliant()
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN,
]), dcCore::app()->blog->id);
return static::$init;
} }
public static function process(): bool public static function process(): bool
{ {
if (!self::status()) { if (!static::$init) {
return false; return false;
} }
try { try {
$s = My::settings(); $s = dcCore::app()->blog->settings->get(My::id());
$model = json_decode((string) $s->get('model'), true); $model = json_decode((string) $s->get('model'), true);
$exclude = $s->get('exclude'); $exclude = $s->get('exclude');
@ -61,7 +64,7 @@ class Manage extends Process
$s->put('model', json_encode($model), 'string', 'Arlequin configuration'); $s->put('model', json_encode($model), 'string', 'Arlequin configuration');
$s->put('exclude', 'customCSS', 'string', 'Excluded themes'); $s->put('exclude', 'customCSS', 'string', 'Excluded themes');
Notices::AddSuccessNotice(__('Settings have been reinitialized.')); dcPage::AddSuccessNotice(__('Settings have been reinitialized.'));
dcCore::app()->blog->triggerBlog(); dcCore::app()->blog->triggerBlog();
} }
@ -78,9 +81,9 @@ class Manage extends Process
$s->put('model', json_encode($model)); $s->put('model', json_encode($model));
$s->put('exclude', $exclude); $s->put('exclude', $exclude);
Notices::AddSuccessNotice(__('System settings have been updated.')); dcPage::AddSuccessNotice(__('System settings have been updated.'));
dcCore::app()->blog->triggerBlog(); dcCore::app()->blog->triggerBlog();
My::redirect(['config' => 1]); dcCore::app()->adminurl->redirect('admin.plugin.' . My::id(), ['config' => 1]);
} }
// restore settings // restore settings
@ -88,9 +91,9 @@ class Manage extends Process
$s->drop('model'); $s->drop('model');
$s->drop('exclude'); $s->drop('exclude');
Notices::AddSuccessNotice(__('Settings have been reinitialized.')); dcPage::AddSuccessNotice(__('Settings have been reinitialized.'));
dcCore::app()->blog->triggerBlog(); dcCore::app()->blog->triggerBlog();
My::redirect(['restore' => 1]); dcCore::app()->adminurl->redirect('admin.plugin.' . My::id(), ['restore' => 1]);
} }
} catch (Exception $e) { } catch (Exception $e) {
dcCore::app()->error->add($e->getMessage()); dcCore::app()->error->add($e->getMessage());
@ -101,7 +104,7 @@ class Manage extends Process
public static function render(): void public static function render(): void
{ {
if (!self::status()) { if (!static::$init) {
return; return;
} }
@ -110,13 +113,11 @@ class Manage extends Process
dcCore::app()->callBehavior('arlequinAddModels', $models); dcCore::app()->callBehavior('arlequinAddModels', $models);
$models = iterator_to_array($models); $models = iterator_to_array($models);
$s = My::settings(); $s = dcCore::app()->blog->settings->get(My::id());
$model = json_decode((string) $s->get('model'), true); $model = json_decode((string) $s->get('model'), true);
$model = array_merge(My::defaultModel(), is_array($model) ? $model : []);
$header = ''; $header = '';
foreach ($models as $m) { foreach ($models as $m) {
$m = array_merge(My::defaultModel(), $m);
$header .= "\t" . $header .= "\t" .
'arlequin.addModel(' . 'arlequin.addModel(' .
'"' . Html::escapeJS($m['name']) . '",' . '"' . Html::escapeJS($m['name']) . '",' .
@ -126,9 +127,9 @@ class Manage extends Process
");\n"; ");\n";
} }
Page::openModule( dcPage::openModule(
My::name(), My::name(),
Page::jsLoad('models') . ' dcPage::jsModuleLoad(My::id() . '/js/models.js') . '
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
arlequin.msg.predefined_models = "' . Html::escapeJS(__('Predefined models')) . '"; arlequin.msg.predefined_models = "' . Html::escapeJS(__('Predefined models')) . '";
@ -143,13 +144,13 @@ class Manage extends Process
); );
echo echo
Page::breadcrumb([ dcPage::breadcrumb([
Html::escapeHTML(dcCore::app()->blog->name) => '', Html::escapeHTML(dcCore::app()->blog->name) => '',
My::name() => '', My::name() => '',
]) . ]) .
Notices::getNotices() . dcPage::notices() .
(new Form(My::id() . 'form'))->method('post')->action(dcCore::app()->admin->getPageURL())->fields([ (new Form(My::id() . 'form'))->method('post')->action(dcCore::app()->adminurl->get('admin.plugin.' . My::id()))->fields([
(new Text('h4', __('Switcher display format'))), (new Text('h4', __('Switcher display format'))),
(new Div())->id('models'), (new Div())->id('models'),
(new Div())->class('two-boxes odd')->items([ (new Div())->class('two-boxes odd')->items([
@ -176,13 +177,13 @@ class Manage extends Process
(new Note())->class('form-note')->text('Semicolon separated list of themes IDs (theme folder name). Ex: ductile;berlin'), (new Note())->class('form-note')->text('Semicolon separated list of themes IDs (theme folder name). Ex: ductile;berlin'),
]), ]),
(new Para())->separator(' ')->items([ (new Para())->separator(' ')->items([
dcCore::app()->formNonce(false),
(new Submit(['mt_action_config']))->value(__('Save')), (new Submit(['mt_action_config']))->value(__('Save')),
(new Submit(['mt_action_restore']))->value(__('Restore defaults')), (new Submit(['mt_action_restore']))->value(__('Restore defaults')),
... My::hiddenFields(),
]), ]),
])->render(); ])->render();
Page::helpBlock('arlequin'); dcPage::helpBlock('arlequin');
Page::closeModule(); dcPage::closeModule();
} }
} }

View File

@ -15,20 +15,37 @@ declare(strict_types=1);
namespace Dotclear\Plugin\arlequin; namespace Dotclear\Plugin\arlequin;
use dcCore; use dcCore;
use Dotclear\Module\MyPlugin;
/** /**
* This module definitions. * Plugin definitions.
*/ */
class My extends MyPlugin class My
{ {
public static function checkCustomContext(int $context): ?bool /** @var string Required php version */
public const PHP_MIN = '7.4';
/**
* This module id.
*/
public static function id(): string
{ {
return !in_array($context, [My::BACKEND, My::MANAGE, My::MENU]) ? null : return basename(dirname(__DIR__));
defined('DC_CONTEXT_ADMIN') }
&& dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, /**
]), dcCore::app()->blog->id); * This module name.
*/
public static function name(): string
{
return __((string) dcCore::app()->plugins->moduleInfo(self::id(), 'name'));
}
/**
* Check php version.
*/
public static function phpCompliant(): bool
{
return version_compare(phpversion(), self::PHP_MIN, '>=');
} }
/** /**
@ -68,7 +85,6 @@ class My extends MyPlugin
public static function defaultModel(): array public static function defaultModel(): array
{ {
return [ return [
'name' => __('Default'),
'e_html' => '<li><a href="%1$s%2$s%3$s">%4$s</a></li>', 'e_html' => '<li><a href="%1$s%2$s%3$s">%4$s</a></li>',
'a_html' => '<li><strong>%4$s</strong></li>', 'a_html' => '<li><strong>%4$s</strong></li>',
's_html' => '<ul>%2$s</ul>', 's_html' => '<ul>%2$s</ul>',

View File

@ -1,70 +0,0 @@
<?php
/**
* @brief arlequin, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Oleksandr Syenchuk, Pierre Van Glabeke and contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
declare(strict_types=1);
namespace Dotclear\Plugin\arlequin;
use dcCore;
use Dotclear\Core\Process;
use Dotclear\Plugin\Uninstaller\Uninstaller;
class Uninstall extends Process
{
public static function init(): bool
{
return self::status(My::checkContext(My::UNINSTALL));
}
public static function process(): bool
{
if (!self::status() || !dcCore::app()->plugins->moduleExists('Uninstaller')) {
return false;
}
Uninstaller::instance()
->addUserAction(
'settings',
'delete_all',
My::id()
)
->addUserAction(
'plugins',
'delete',
My::id()
)
->addUserAction(
'versions',
'delete',
My::id()
)
->addDirectAction(
'settings',
'delete_all',
My::id()
)
->addDirectAction(
'plugins',
'delete',
My::id()
)
->addDirectAction(
'versions',
'delete',
My::id()
)
;
// no custom action
return false;
}
}

View File

@ -45,10 +45,9 @@ class Widgets
return ''; return '';
} }
$model = json_decode((string) My::settings()->get('model'), true); $model = json_decode((string) dcCore::app()->blog->settings->get(My::id())->get('model'), true);
$exclude = explode(';', (string) My::settings()->get('exclude')); $names = self::getNames();
$modules = array_diff_key(dcCore::app()->themes->getDefines(['state' => dcModuleDefine::STATE_ENABLED], true), array_flip($exclude)); if (!is_array($model) || empty($names)) {
if (!is_array($model) || empty($modules)) {
return ''; return '';
} }
@ -69,8 +68,8 @@ class Widgets
} }
$res = ''; $res = '';
foreach ($modules as $id => $module) { foreach ($names as $k => $v) {
if ($id == dcCore::app()->public->theme) { if ($k == dcCore::app()->public->theme) {
$format = $model['a_html']; $format = $model['a_html'];
} else { } else {
$format = $model['e_html']; $format = $model['e_html'];
@ -79,21 +78,21 @@ class Widgets
if ($replace) { if ($replace) {
$e_url = preg_replace( $e_url = preg_replace(
'/(\\?|&)(theme\\=)([^&]*)/', '/(\\?|&)(theme\\=)([^&]*)/',
'$1${2}' . addcslashes($id, '$\\'), '$1${2}' . addcslashes($k, '$\\'),
(string) $e_url $e_url
); );
$val = ''; $val = '';
} else { } else {
$val = Html::escapeHTML(rawurlencode($id)); $val = Html::escapeHTML(rawurlencode($k));
} }
$res .= sprintf( $res .= sprintf(
$format, $format,
$e_url, $e_url,
$ext, $ext,
$val, $val,
Html::escapeHTML($module['name']), Html::escapeHTML($v['name']),
Html::escapeHTML($module['desc']), Html::escapeHTML($v['desc']),
Html::escapeHTML($id) Html::escapeHTML($k)
); );
} }
@ -109,4 +108,11 @@ class Widgets
($w->title ? $w->renderTitle(Html::escapeHTML($w->title)) : '') . sprintf($model['s_html'], $s_url, $res) ($w->title ? $w->renderTitle(Html::escapeHTML($w->title)) : '') . sprintf($model['s_html'], $s_url, $res)
); );
} }
public static function getNames(): array
{
$exclude = explode(';', (string) dcCore::app()->blog->settings->get(My::id())->get('exclude'));
return array_diff_key(dcCore::app()->themes->getDefines(['state' => dcModuleDefine::STATE_ENABLED], true), array_flip($exclude));
}
} }