This commit is contained in:
Pierre 2022-12-29 17:21:12 +01:00
parent 4fb5940939
commit 8f27e41937
4 changed files with 13 additions and 15 deletions

View file

@ -16,7 +16,7 @@ $this->registerModule(
'moreCSS', 'moreCSS',
'Another CSS stylesheet for the active theme', 'Another CSS stylesheet for the active theme',
'Osku and contributors', 'Osku and contributors',
'1.4', '2.0',
[ [
'requires' => [['core', '2.24']], 'requires' => [['core', '2.24']],
'permissions' => dcCore::app()->auth->makePermissions([ 'permissions' => dcCore::app()->auth->makePermissions([

View file

@ -16,7 +16,7 @@ dcCore::app()->addBehavior('publicHeadContent',array('moreCSSpublicBehaviors','s
class moreCSSpublicBehaviors class moreCSSpublicBehaviors
{ {
public static function stylesheet($core) public static function stylesheet()
{ {
$css = base64_decode(dcCore::app()->blog->settings->themes->morecss_min); $css = base64_decode(dcCore::app()->blog->settings->themes->morecss_min);

View file

@ -1,5 +1,5 @@
v1.4 - 19/12/2022 - Pierre Van Glabeke v2.0 - 19/12/2022 - Pierre Van Glabeke
* màj dc2.24 à compléter * màj dc2.24
v1.3 - 23/01/2018 - Pierre Van Glabeke v1.3 - 23/01/2018 - Pierre Van Glabeke
* ajout js pour fermeture * ajout js pour fermeture

View file

@ -14,8 +14,6 @@ if (!defined('DC_CONTEXT_ADMIN')) { return; }
$page_title = __('Style sheet'); $page_title = __('Style sheet');
$p_url = 'plugin.php?p=' . basename(dirname(__FILE__));
$config = array(); $config = array();
$s =& dcCore::app()->blog->settings->themes; $s =& dcCore::app()->blog->settings->themes;
@ -36,7 +34,7 @@ if (isset($_POST['file_content'])) {
$css_min = str_replace(array(' , ',' ,',', '),',', $css_min); $css_min = str_replace(array(' , ',' ,',', '),',', $css_min);
$s->put('morecss_min',base64_encode($css_min)); $s->put('morecss_min',base64_encode($css_min));
http::redirect($p_url.'&config=1'); http::redirect(dcCore::app()->admin->getPageURL().'&config=1');
} catch (Exception $e) { } catch (Exception $e) {
dcCore::app()->error->add($e->getMessage()); dcCore::app()->error->add($e->getMessage());
} }
@ -48,13 +46,13 @@ $css_content = base64_decode($s->morecss);
<html> <html>
<head> <head>
<title><?php echo $page_title; ?></title> <title><?php echo $page_title; ?></title>
<script type="text/javascript"> <script>
<?php echo dcPage::jsVar('dotclear.msg.saving_document',__("Saving document...")); ?> <?php echo dcPage::jsJson('dotclear.msg.saving_document',__("Saving document...")); ?>
<?php echo dcPage::jsVar('dotclear.msg.document_saved',__("Document saved")); ?> <?php echo dcPage::jsJson('dotclear.msg.document_saved',__("Document saved")); ?>
<?php echo dcPage::jsVar('dotclear.msg.error_occurred',__("An error occurred:")); ?> <?php echo dcPage::jsJson('dotclear.msg.error_occurred',__("An error occurred:")); ?>
</script> </script>
<?php echo dcPage::jsConfirmClose('file-form'); ?> <?php echo dcPage::jsConfirmClose('file-form'); ?>
<script type="text/javascript" src="index.php?pf=moreCSS/script.js"></script> <script src="index.php?pf=moreCSS/script.js"></script>
</head> </head>
<body> <body>
<?php <?php
@ -68,7 +66,7 @@ $css_content = base64_decode($s->morecss);
<?php <?php
echo echo
'<form action="'.$p_url.'" id="file-form" method="post">'. '<form action="'.dcCore::app()->admin->getPageURL().'" id="file-form" method="post">'.
'<div>'. '<div>'.
'<p><label for="file_content">'.__('Style sheet:').'</label></p>'. '<p><label for="file_content">'.__('Style sheet:').'</label></p>'.