cf CHANGELOG

master
brol 2018-01-23 03:37:27 +01:00
parent 128303194f
commit d97c03b17f
11 changed files with 95 additions and 89 deletions

View File

@ -1,3 +1,12 @@
v1.3 - 21-01-2018 - Pierre Van Glabeke
* modif setting
* modif index
* modif localisation
v1.2 - 12-06-2016 - Pierre Van Glabeke
* ajout code sécu resources.php
* modif intitulé dans admin
v1.1 - 05-03-2015 - Pierre Van Glabeke
* compatibilité dc2.7
* cosmétique dc2.6

View File

@ -15,7 +15,7 @@
\***************************************************************/
if (!defined('DC_CONTEXT_ADMIN')) { return; }
$_menu['Blog']->addItem(__('Theme switcher'),'plugin.php?p=arlequin',
$_menu['Blog']->addItem(__('Arlequin'),'plugin.php?p=arlequin',
'index.php?pf=arlequin/icon.png',
preg_match('/plugin.php\?p=arlequin(&.*)?$/',$_SERVER['REQUEST_URI']),
$core->auth->check('contentadmin',$core->blog->id));
@ -27,7 +27,7 @@ $core->addBehavior('adminDashboardFavorites','arlequinDashboardFavorites');
function arlequinDashboardFavorites($core,$favs)
{
$favs->register('arlequin', array(
'title' => __('Theme switcher'),
'title' => __('Arlequin'),
'url' => 'plugin.php?p=arlequin',
'small-icon' => 'index.php?pf=arlequin/icon.png',
'large-icon' => 'index.php?pf=arlequin/icon-big.png',

View File

@ -19,12 +19,12 @@ $this->registerModule(
/* Name */ 'Arlequin',
/* Description*/ 'Allows visitors choose a theme',
/* Author */ 'Oleksandr Syenchuk, Pierre Van Glabeke',
/* Version */ '1.1',
/* Version */ '1.3',
/* Properties */
array(
'permissions' => 'contentadmin',
'type' => 'plugin',
'dc_min' => '2.7',
'dc_min' => '2.12',
'support' => 'http://forum.dotclear.org/viewtopic.php?id=48345',
'details' => 'http://plugins.dotaddict.org/dc2/details/arlequin'
)

View File

@ -64,8 +64,8 @@ class publicArlequinEngine
public static function switchTheme($blog,$theme)
{
if ($blog->settings->multitheme->mt_exclude) {
if (in_array($theme,explode('/',$blog->settings->multitheme->mt_exclude))) {
if ($blog->settings->arlequinMulti->mt_exclude) {
if (in_array($theme,explode('/',$blog->settings->arlequinMulti->mt_exclude))) {
return;
}
}
@ -93,7 +93,7 @@ class publicArlequinInterface
if ($w->offline)
return;
$cfg = @unserialize($core->blog->settings->multitheme->get('mt_cfg'));
$cfg = @unserialize($core->blog->settings->arlequinMulti->get('mt_cfg'));
if (($w->homeonly == 1 && $core->url->type != 'default') ||
($w->homeonly == 2 && $core->url->type == 'default')) {
@ -172,10 +172,10 @@ class publicArlequinInterface
{
global $core;
$mt_exclude = $core->blog->settings->multitheme->mt_exclude;
$mt_exclude = $core->blog->settings->arlequinMulti->mt_exclude;
$exclude = array();
if (!empty($mt_exclude)) {
$exclude = array_flip(explode('/',$core->blog->settings->multitheme->mt_exclude));
$exclude = array_flip(explode('/',$core->blog->settings->arlequinMulti->mt_exclude));
}
$names = array_diff_key($core->themes->getModules(),$exclude);

View File

@ -50,8 +50,8 @@ class adminArlequin
global $core;
$initialized = false;
$mt_cfg = @unserialize($settings->multitheme->get('mt_cfg'));
$mt_exclude = $settings->multitheme->get('mt_exclude');
$mt_cfg = @unserialize($settings->arlequinMulti->get('mt_cfg'));
$mt_exclude = $settings->arlequinMulti->get('mt_exclude');
// Paramètres corrompus ou inexistants
if ($mt_cfg === false ||
@ -61,9 +61,9 @@ class adminArlequin
isset($mt_cfg['s_html'])))
{
$mt_cfg = adminArlequin::getDefaults();
$settings->addNameSpace('multitheme');
$settings->multitheme->put('mt_cfg',serialize($mt_cfg),'string','Arlequin configuration');
$settings->multitheme->put('mt_exclude','customCSS','string','Excluded themes');
$settings->addNameSpace('arlequinMulti');
$settings->arlequinMulti->put('mt_cfg',serialize($mt_cfg),'string','Arlequin configuration');
$settings->arlequinMulti->put('mt_exclude','customCSS','string','Excluded themes');
$initialized = true;
$core->blog->triggerBlog();
}

View File

@ -26,7 +26,7 @@ try
/* Initialisation
--------------------------------------------------- */
$core->blog->settings->addNameSpace('multitheme');
$core->blog->settings->addNameSpace('arlequinMulti');
list($mt_cfg,$mt_exclude) =
adminArlequin::loadSettings ($core->blog->settings,$initialized);
@ -46,16 +46,16 @@ try
if (isset($_POST['mt_action_config']))
{
$core->blog->settings->multitheme->put('mt_cfg',serialize($mt_cfg));
$core->blog->settings->multitheme->put('mt_exclude',$mt_exclude);
$core->blog->settings->arlequinMulti->put('mt_cfg',serialize($mt_cfg));
$core->blog->settings->arlequinMulti->put('mt_exclude',$mt_exclude);
$messages[] = __('Settings have been successfully updated.');
$core->blog->triggerBlog();
http::redirect($p_url.'&config=1');
}
if (isset($_POST['mt_action_restore']))
{
$core->blog->settings->multitheme->drop('mt_cfg');
$core->blog->settings->multitheme->drop('mt_exclude');
$core->blog->settings->arlequinMulti->drop('mt_cfg');
$core->blog->settings->arlequinMulti->drop('mt_exclude');
$core->blog->triggerBlog();
http::redirect($p_url.'&restore=1');
}
@ -124,15 +124,16 @@ echo
form::textArea('s_html',50,10,html::escapeHTML($mt_cfg['s_html'])).'</p>
<div class="col">
<p><label>'.__('Item HTML code:').' '.
form::field('e_html',35,'',html::escapeHTML($mt_cfg['e_html'])).'</label></p>
form::field('e_html',50,'',html::escapeHTML($mt_cfg['e_html'])).'</label></p>
<p><label>'.__('Active item HTML code:').' '.
form::field('a_html',35,'',html::escapeHTML($mt_cfg['a_html'])).'</label></p>
form::field('a_html',50,'',html::escapeHTML($mt_cfg['a_html'])).'</label></p>
</div><br class="clear" />
<p><label>'.__('Excluded themes (separated by slashs \'/\'):').' '.
form::field(array('mt_exclude'),40,'',html::escapeHTML($mt_exclude)).'</label></p>
form::field(array('mt_exclude'),50,'',html::escapeHTML($mt_exclude)).'</label></p>
<p class="info">'.__('The names to be taken into account are those of the theme files.').'</p>
</div>
<p><input type="submit" name="mt_action_config" value="'.__('Update').'" />
<p><input type="submit" name="mt_action_config" value="'.__('Save').'" />
<input type="submit" name="mt_action_restore" value="'.__('Restore defaults').'" />'.
(is_callable(array($core,'formNonce')) ? $core->formNonce() : '').'</p>
</form>';

View File

@ -8,7 +8,7 @@
<dl>
<dt>With a widget</dt>
<dd>The easiest way is to use the <em>Theme Selector</em>
<dd>The easiest way is to use the <em>Arlequin / Theme Selector</em>
<a href="plugin.php?p=widgets">widget</a> that displays a list of available themes.</dd>
<dt>In the template file</dt>

View File

@ -13,7 +13,7 @@
* if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
\***************************************************************/
if (!defined('DC_RC_PATH')){return;}
if (!isset($__resources['help']['arlequin']))
{
$__resources['help']['arlequin'] = dirname(__FILE__).'/help/arlequin.html';

View File

@ -9,7 +9,7 @@
<dl>
<dt>Avec un widget</dt>
<dd>Le plus simple est d'utiliser le <a href="plugin.php?p=widgets">widget</a>
<em>Sélecteur de thème</em> qui affiche la liste des thèmes disponibles.</dd>
<em>Arlequin / Sélecteur de thème</em> qui affiche la liste des thèmes disponibles.</dd>
<dt>Dans le fichier template</dt>
<dd>Le sélecteur peut aussi être intégré dans l'interface du blog en éditant

View File

@ -1,17 +1,68 @@
# Language: Français
# Module: arlequin - 1.3
# Date: 2018-01-22 17:11:42
# Translated with translater 2017.05.10
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: Dotclear 2 Arlequin v1.1 module\n"
"Project-Id-Version: arlequin 1.3\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2009-10-20 21:01+0100\n"
"Last-Translator: brol <contact@brol.info>\n"
"PO-Revision-Date: 2018-01-22T17:11:42+00:00\n"
"Last-Translator: brol\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: French\n"
"X-Poedit-KeywordsList: __\n"
"X-Poedit-Basepath: ../..\n"
"X-Poedit-SearchPath-0: .\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: _widgets.php:26
msgid "Theme switcher"
msgstr "Sélecteur de thème"
#: _widgets.php:27
msgid "Choose a theme"
msgstr "Choisissez un thème"
#: index.php:72
#: index.php:116
msgid "Settings have been reinitialized."
msgstr "Les paramètres ont été réinitialisés."
#: index.php:95
msgid "Predefined models"
msgstr "Modèles prédéfinis"
#: index.php:96
msgid "Select a model"
msgstr "Sélectionnez un modèle"
#: index.php:121
msgid "Switcher display format"
msgstr "Format d'affichage du sélecteur"
#: index.php:123
msgid "Switcher HTML code:"
msgstr "Code HTML du sélecteur :"
#: index.php:126
msgid "Item HTML code:"
msgstr "Code HTML d'un item :"
#: index.php:128
msgid "Active item HTML code:"
msgstr "Code HTML d'un item actif :"
#: index.php:134
msgid "The names to be taken into account are those of the theme files."
msgstr "Les noms à prendre en compte sont ceux des dossiers de thème."
#: index.php:137
msgid "Restore defaults"
msgstr "Réinitialiser les paramètres"
#: models.php:22
msgid "Model name"
msgstr "Nom du modèle"
#: models.php:32
msgid "Bullets list"
@ -25,67 +76,12 @@ msgstr "Liste déroulante"
msgid "active theme"
msgstr "thème actif"
#: forms.php:22
msgid "Switcher display format"
msgstr "Format d'affichage du sélecteur"
#: forms.php:24
msgid "Switcher HTML code:"
msgstr "Code HTML du sélecteur :"
#: forms.php:27
msgid "Item HTML code:"
msgstr "Code HTML d'un item :"
#: forms.php:29
msgid "Active item HTML code:"
msgstr "Code HTML d'un item actif :"
#: forms.php:35
msgid "Excluded themes (separated by slashs '/'):"
msgstr "Thèmes exclus (séparés par des slashs \"/\") :"
#: forms.php:38
msgid "Update"
msgstr "Mettre à jour"
#: forms.php:39
msgid "Restore defaults"
msgstr "Réinitialiser les paramètres"
#: _admin.php:18
#: _admin.php:29
msgid "Theme switcher"
msgstr "Sélecteur de thème"
#: _admin.php:32
msgid "Choose a theme"
msgstr "Choisissez un thème"
#: index.php:51
msgid "Settings have been successfully updated."
msgstr "Les paramètres ont été mis à jour avec succès."
#: index.php:71
msgid "Settings have been reinitialized."
msgstr "Les paramètres ont été réinitialisés."
#: index.php:18
msgid "Arlequin - theme switcher configuration"
msgstr "Arlequin - configuration du sélecteur de thème"
#: index.php:95
msgid "Predefined models"
msgstr "Modèles prédéfinis"
#: index.php:96
msgid "Select a model"
msgstr "Sélectionnez un modèle"
#: index.php:97
msgid "User defined"
msgstr "Défini par l'utilisateur"
msgid "Allows visitors choose a theme"
msgstr "Permettre aux visiteurs de choisir un thème"

View File

@ -13,7 +13,7 @@
* if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
\***************************************************************/
if (!defined('DC_RC_PATH')){return;}
if (!isset($__resources['help']['arlequin']))
{
$__resources['help']['arlequin'] = dirname(__FILE__).'/help/arlequin.html';