<?xml version="1.0" encoding="UTF-8" ?>
<!-- RSS generated by PHPBoost on Wed, 29 Apr 2026 06:10:48 +0200 -->
<rss version="2.0" xmlns:atom="https://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Wiki]]></title>
		<atom:link href="https://www.phpboost.com/syndication/rss/wiki/41" rel="self" type="application/rss+xml"/>
		<link>https://www.phpboost.com</link>
		<description><![CDATA[Derniers articles de la catégorie Migrer un module vers une nouvelle version]]></description>
		<copyright>(C) 2005-2026 PHPBoost</copyright>
		<language>fr</language>
		<generator>PHPBoost</generator>
		
            <item>
                <title><![CDATA[Mettre à jour son module 5.0 en 5.1]]></title>
                <link>https://www.phpboost.com/wiki/mettre-a-jour-son-module-5-0-en-5-1</link>
                <guid>https://www.phpboost.com/wiki/mettre-a-jour-son-module-5-0-en-5-1</guid>
                <description><![CDATA[<br /><br />
<span class="message-helper bgc warning">Si aucun des éléments se trouvant dans cette documentation ne vous aide, référez-vous au forum et faites une demande de support.</span><br /><br />
<br /><br />
Cette documentation permet de rendre votre module compatible avec la version 5.1 de PHPBoost sans trop de modifications dans le code. Elle n'a pas pour but de le convertir en utilisant le modèle MVC s'il n'est pas MVC. Effectuez les différentes étapes suivantes (peu importe l'ordre) pour mettre à jour votre module.<br /><br />
<br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-le-fichier-de-configuration-obligatoire">Le fichier de configuration - OBLIGATOIRE</h2><br /><br />
<br />
<br /><br />
Les seuls changements à effectuer dans le fichier <em>/module/config.ini</em> pour rendre votre module compatible avec la nouvelle version sont les paramètres "compatibility" et "version". Remplacez la valeur de "compatibility" par <strong>5.1</strong> et augmentez le numéro de version de votre module pour plus de cohérence.<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">version=5.1.0
compatibility=5.1</pre></pre></div></div><br /><br />
<br /><br />
<span class="message-helper bgc warning"><strong>La modification du config.ini est obligatoire</strong></span><br /><br />
<br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-encodage-de-vos-fichiers-en-utf8-sans-bom-obligatoire">Encodage de vos fichiers en UTF8 sans BOM - OBLIGATOIRE</h2><br /><br />
<br />
<br /><br />
Voici la démarche à suivre avec Notepad++ (c'est un exemple, d'autres éditeurs font la même chose) pour que tous les nouveaux documents créés soient en UTF8 sans Bom (<a class="offload" href="https://fr.wikipedia.org/wiki/Indicateur_d%27ordre_des_octets">UTF8 et BOM - Explications</a>):<br /><br />
<br /><br />
<img src="https://resources.phpboost.com/documentation/installation/migration_module_non_officiel_5_0_to_5_1/img_01_notepad_utf8.png" alt="img_01_notepad_utf8" /><br /><br />
<br /><br />
Si vous voulez convertir en UTF8 sans Bom tous vos documents ouverts, voici ce qu'il faut faire (toujours avec Notepad++) :<br /><br />
<br /><br />
<img src="https://resources.phpboost.com/documentation/installation/migration_module_non_officiel_5_0_to_5_1/img_02_notepad_utf8.png" alt="img_02_notepad_utf8" /><br /><br />
<br /><br />
<span class="message-helper bgc warning"><strong>La modification des fichiers lang est obligatoire</strong></span><br /><br />
<br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-gestion-des-categories-et-des-elements-en-front-obligatoire">Gestion des catégories et des éléments en front  - OBLIGATOIRE</h2><br /><br />
<br />
<br /><br />
Dans le cas d'utilisation des catégories - Exemples en image :<br /><br />
<br /><br />
En 5.0, la gestion des catégories se trouve en <em>back</em> :<br /><br />
<img src="https://resources.phpboost.com/documentation/installation/migration_module_non_officiel_5_0_to_5_1/categories_manage_admin_5_0.png" alt="categories_manage_admin_5_0" /><br /><br />
<br /><br />
En 5.1, la gestion des catégories se trouve en <em>front</em> :<br /><br />
<br /><br />
<img src="https://resources.phpboost.com/documentation/installation/migration_module_non_officiel_5_0_to_5_1/categories_manage_front_5_1.png" alt="categories_manage_front_5_1" /><br /><br />
<br /><br />
Il en est de même pour la gestion des éléments. Elle passe donc en <em>front</em> en 5.1 .<br /><br />
<br /><br />
En 5.0 :<br /><br />
<img src="https://resources.phpboost.com/documentation/installation/migration_module_non_officiel_5_0_to_5_1/categories_add_admin_5_0.png" alt="categories_add_admin_5_0" /><br /><br />
<br /><br />
En 5.1 :<br /><br />
<img src="https://resources.phpboost.com/documentation/installation/migration_module_non_officiel_5_0_to_5_1/categories_add_front_5_1.png" alt="categories_add_front_5_1" /><br /><br />
<br /><br />
<i class="fa fa-arrow-right" aria-hidden="true"></i> Renommer le fichier AdminMonModuleManageController.class.php en MonModuleManageController.class.php.<br /><br />
<br /><br />
Maintenant, il va falloir effectuer l'ensemble des modifications décrites dans ce <a class="offload" href="https://github.com/PHPBoost/PHPBoost/commit/bd22a217220dfc67b8d5859d2a54f0a01175eafd?diff=split"><strong>lien</strong></a>. En rouge, le code à effacer et en vert le code à ajouter. Le module Articles a encore été pris en exemple.<br /><br />
<br /><br />
Les fichiers concernés sont :<br /><br />
<ul class="formatter-ul">
    <li class="formatter-li">monmodule/controllers/AdminMonModuleManageController ->monmodule/controllers/MonModuleManageController.class.php
    </li><li class="formatter-li">monmodule/controllers/AdminMonModuleConfigController.class.php
    </li><li class="formatter-li">monmodule/controllers/categories/MonModuleCategoriesFormController.class.php
    </li><li class="formatter-li">monmodules/controllers/categories/MonModuleCategoriesManageController.class.php
    </li><li class="formatter-li">monmodule/controllers/categories/MonModuleDeleteCategoryController.class.php
    </li><li class="formatter-li">monmodule/index.php
    </li><li class="formatter-li">monmodule/phpboost/MonModuleTreeLinks.class.php
    </li><li class="formatter-li">monmodule/services/MonModuleAuthorizationsService.class.php
    </li><li class="formatter-li">monmodule/util/AdminMonModuleDisplayResponse.class.php
    </li><li class="formatter-li">monmodule/util/MonModuleUrlBuilder.class.php<br /><br />
</li></ul><br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-gestion-globale-dans-l-administration">Gestion globale dans l'administration </h2><br /><br />
<br />
<br /><br />
En 5.1, la gestion du système de commentaire ainsi que celui de la notation a été entièrement transférée dans la rubrique <strong>contenu</strong> de l'administration générale.<br /><br />
Si vos modules utilisaient ces fonctionnalités en 5.0, veuillez suivre les modifications ci-dessous.<br /><br />
<br /><br />
De plus, Phpboost 5.1 offre une nouvelle fonction New Content que vous allez pouvoir ajouter.<br /><br />
<br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-les-commentaires-facultatif">Les commentaires (facultatif)</h3><br /><br />
<br />
<br /><br />
Création du fichier NomModuleComments.class.php dans NomModule/phpboost/<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">NomModuleComments.class.php : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #FF0000; font-weight: normal;"><?php</span>
<span style="color: #008000; font-style: italic;">/*##################################################
 *                      NomModuleComments.class.php
 *                            -------------------
 *   begin            : *champ à renseigner
 *   copyright     : *champ à renseigner
 *   email            : *champ à renseigner
 *
 *
 ###################################################
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 ###################################################*/</span>
<span style="color: #008000; font-style: italic;">/**
 * @author Votre Nom  <votre e-mail>
 */</span>
<span style="color: #0000FF; font-weight: bold;">class</span> NomModuleComments <span style="color: #0000FF; font-weight: bold;">extends</span> AbstractCommentsExtensionPoint
<span style="color: #8000FF;">&#123;</span>
    <span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> __construct<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
        parent<span style="color: #8000FF;">::</span>__construct<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'nommodule'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span>
<span style="color: #8000FF;">&#125;</span>
<span style="color: #FF0000; font-weight: normal;">?></span>
&nbsp;</pre></pre></div></div><br /><br />
<br /><br />
Puisque l'activation des commentaires doit se faire à partir de l'administration générale et non dans la configuration de votre module, voici les quelques lignes de codes à supprimer (si bien-entendu elles existent dans votre module) :<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">NomModuleConfig.class.php : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #008000; font-style: italic;">// A supprimer dans la déclaration des constantes</span>
<span style="color: #0000FF; font-weight: bold;">const</span> COMMENTS_ENABLED <span style="color: #8000FF;">=</span> <span style="color: #808080;">'comments_enable'</span><span style="color: #8000FF;">;</span> 
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">// A supprimer dans la déclaration des méthodes</span>
    <span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> enable_comments<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
        <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_property</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">self</span><span style="color: #8000FF;">::</span><span style="color: #000000;">COMMENTS_ENABLED</span><span style="color: #8000FF;">,</span> <span style="">true</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span>
&nbsp;
    <span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> disable_comments<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
        <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_property</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">self</span><span style="color: #8000FF;">::</span><span style="color: #000000;">COMMENTS_ENABLED</span><span style="color: #8000FF;">,</span> <span style="">false</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span>
&nbsp;
    <span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> are_comments_enabled<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
        <span style="color: #0000FF; font-weight: bold;">return</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_property</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">self</span><span style="color: #8000FF;">::</span><span style="color: #000000;">COMMENTS_ENABLED</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">// A supprimer dans public function get_default_values() {    return array (</span>
<span style="color: #0000FF; font-weight: bold;">self</span><span style="color: #8000FF;">::</span><span style="color: #000000;">COMMENTS_ENABLED</span> <span style="color: #8000FF;">=></span> <span style="">true</span><span style="color: #8000FF;">,</span>
&nbsp;</pre></pre></div></div><br /><br />
<br /><br />
Nous allons maintenant supprimer le champ d'activation des commentaires de la configuration de votre module :<br /><br />
<img src="https://resources.phpboost.com/documentation/installation/migration_module_non_officiel_5_0_to_5_1/config_commentaires_5_0.png" alt="config_commentaires_5_0" /><br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">AdminNomModuleConfigController.class.php : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #008000; font-style: italic;">// A supprimer dans la déclaration des champs</span>
<span style="color: #000080;">$fieldset</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_field</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">new</span> FormFieldCheckbox<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'comments_enabled'</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">admin_common_lang</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'config.comments_enabled'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">are_comments_enabled</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">// A supprimer dans private function save()</span>
        <span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">form</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_value</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'comments_enabled'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span>
        <span style="color: #8000FF;">&#123;</span>
            <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">enable_comments</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
        <span style="color: #8000FF;">&#125;</span>
        <span style="color: #0000FF; font-weight: bold;">else</span>
        <span style="color: #8000FF;">&#123;</span>
            <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">disable_comments</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
        <span style="color: #8000FF;">&#125;</span>
&nbsp;</pre></pre></div></div><br /><br />
<br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-le-systeme-de-notation-facultatif">Le système de notation (facultatif)</h3><br /><br />
<br />
<br /><br />
Création du fichier NomModuleNotation.class.php dans NomModule/phpboost/<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">NomModuleNotation.class.php : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #FF0000; font-weight: normal;"><?php</span>
<span style="color: #008000; font-style: italic;">/*##################################################
 *                      NomModuleNotation.class.php
 *                            -------------------
 *   begin                :  *champ à renseigner
 *   copyright         :  *champ à renseigner
 *   email                :  *champ à renseigner
 *
 *
 ###################################################
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 ###################################################*/</span>
<span style="color: #008000; font-style: italic;">/**
 * @author Votre Nom  <votre e-mail>
 */</span>
<span style="color: #0000FF; font-weight: bold;">class</span> NomModuleNotation <span style="color: #0000FF; font-weight: bold;">extends</span> AbstractNotationExtensionPoint
<span style="color: #8000FF;">&#123;</span>
    <span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> __construct<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
        parent<span style="color: #8000FF;">::</span>__construct<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'nommodule'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span>
<span style="color: #8000FF;">&#125;</span>
<span style="color: #FF0000; font-weight: normal;">?></span>
&nbsp;</pre></pre></div></div><br /><br />
<br /><br />
Ensuite ajoutez dans NomModuleExtensionPointProvider.class.php dans NomModule/phpboost/<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">NomModuleExtensionPointProvider.class.php : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> notation<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
        <span style="color: #0000FF; font-weight: bold;">return</span> <span style="color: #0000FF; font-weight: bold;">new</span> NomModuleNotation<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span></pre></pre></div></div><br /><br />
<br /><br />
Puisque l'activation de la notation doit se faire à partir de l'administration générale et non dans la configuration de votre module, voici les quelques lignes de codes à supprimer (si bien-entendu elles existent dans votre module) :<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">NomModuleConfig.class.php : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #008000; font-style: italic;">// A supprimer dans la déclaration des constantes</span>
<span style="color: #0000FF; font-weight: bold;">const</span> NOTATION_ENABLED <span style="color: #8000FF;">=</span> <span style="color: #808080;">'notation_enabled'</span><span style="color: #8000FF;">;</span>
<span style="color: #0000FF; font-weight: bold;">const</span> NOTATION_SCALE <span style="color: #8000FF;">=</span> <span style="color: #808080;">'notation_scale'</span><span style="color: #8000FF;">;</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">// A supprimer dans la déclaration des méthodes</span>
    <span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> enable_notation<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
        <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_property</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">self</span><span style="color: #8000FF;">::</span><span style="color: #000000;">NOTATION_ENABLED</span><span style="color: #8000FF;">,</span> <span style="">true</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span>
&nbsp;
    <span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> disable_notation<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
        <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_property</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">self</span><span style="color: #8000FF;">::</span><span style="color: #000000;">NOTATION_ENABLED</span><span style="color: #8000FF;">,</span> <span style="">false</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span>
&nbsp;
    <span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> is_notation_enabled<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
        <span style="color: #0000FF; font-weight: bold;">return</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_property</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">self</span><span style="color: #8000FF;">::</span><span style="color: #000000;">NOTATION_ENABLED</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span>
&nbsp;
    <span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> get_notation_scale<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
        <span style="color: #0000FF; font-weight: bold;">return</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_property</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">self</span><span style="color: #8000FF;">::</span><span style="color: #000000;">NOTATION_SCALE</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span>
&nbsp;
    <span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> set_notation_scale<span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$notation_scale</span><span style="color: #8000FF;">&#41;</span> 
    <span style="color: #8000FF;">&#123;</span>
        <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_property</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">self</span><span style="color: #8000FF;">::</span><span style="color: #000000;">NOTATION_SCALE</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$notation_scale</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">// A supprimer dans public function get_default_values() {    return array (</span>
<span style="color: #0000FF; font-weight: bold;">self</span><span style="color: #8000FF;">::</span><span style="color: #000000;">NOTATION_ENABLED</span> <span style="color: #8000FF;">=></span> <span style="">true</span><span style="color: #8000FF;">,</span>
<span style="color: #0000FF; font-weight: bold;">self</span><span style="color: #8000FF;">::</span><span style="color: #000000;">NOTATION_SCALE</span> <span style="color: #8000FF;">=></span> <span style="color: #FF8000;">5</span><span style="color: #8000FF;">,</span>
&nbsp;</pre></pre></div></div><br /><br />
<br /><br />
Nous allons maintenant supprimer les champs de configuration de la notation de votre module :<br /><br />
<br /><br />
<img src="https://resources.phpboost.com/documentation/installation/migration_module_non_officiel_5_0_to_5_1/config_notation_5_0.png" alt="config_notation_5_0" /><br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">AdminNomModuleConfigController.class.php : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #008000; font-style: italic;">// A supprimer dans public function execute(HTTPRequestCustom $request)</span>
<span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">form</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_field_by_id</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'notation_scale'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_hidden</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">!</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">is_notation_enabled</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">// A supprimer dans la déclaration des champs</span>
<span style="color: #000080;">$fieldset</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_field</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">new</span> FormFieldCheckbox<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'notation_enabled'</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">admin_common_lang</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'config.notation_enabled'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">is_notation_enabled</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span> <a href="http://www.php.net/array"><span style="color: #0000FF; font-weight: bold;">array</span></a><span style="color: #8000FF;">&#40;</span>
            <span style="color: #808080;">'events'</span> <span style="color: #8000FF;">=></span> <a href="http://www.php.net/array"><span style="color: #0000FF; font-weight: bold;">array</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'click'</span> <span style="color: #8000FF;">=></span> <span style="color: #808080;">'
                if (HTMLForms.getField("notation_enabled").getValue()) {
                    HTMLForms.getField("notation_scale").enable();
                } else {
                    HTMLForms.getField("notation_scale").disable();
                }'</span>
            <span style="color: #8000FF;">&#41;</span>
<span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">// A supprimer dans private function save()</span>
<span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">form</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_value</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'notation_enabled'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span>
<span style="color: #8000FF;">&#123;</span>
<span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">enable_notation</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_notation_scale</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">form</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_value</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'notation_scale'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">form</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_value</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'notation_scale'</span><span style="color: #8000FF;">&#41;</span> <span style="color: #8000FF;">!=</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_notation_scale</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span>
    NotationService<span style="color: #8000FF;">::</span><span style="color: #000000;">update_notation_scale</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'nommodule'</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_notation_scale</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">form</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_value</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'notation_scale'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #8000FF;">&#125;</span>
<span style="color: #0000FF; font-weight: bold;">else</span>
<span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">disable_notation</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
&nbsp;</pre></pre></div></div><br /><br />
<br /><br />
Dans services/NomModule.class.php<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">NomModule.class.php : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #008000; font-style: italic;">// A supprimer dans la déclaration des attributs et des constantes</span>
<span style="color: #0000FF; font-weight: bold;">private</span> <span style="color: #000080;">$notation_enabled</span><span style="color: #8000FF;">;</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #0000FF; font-weight: bold;">const</span> NOTATION_DISABLED <span style="color: #8000FF;">=</span> <span style="color: #FF8000;">0</span><span style="color: #8000FF;">;</span>
<span style="color: #0000FF; font-weight: bold;">const</span> NOTATION_ENABLED <span style="color: #8000FF;">=</span> <span style="color: #FF8000;">1</span><span style="color: #8000FF;">;</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">//</span>
    <span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> get_notation_enabled<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
        <span style="color: #0000FF; font-weight: bold;">return</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">notation_enabled</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span>
    <span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> set_notation_enabled<span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$enabled</span><span style="color: #8000FF;">&#41;</span> 
    <span style="color: #8000FF;">&#123;</span>
        <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">notation_enabled</span> <span style="color: #8000FF;">=</span> <span style="color: #000080;">$enabled</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span>
<span style="color: #008000; font-style: italic;">// A supprimer dans public function get_properties()  { return array(</span>
<span style="color: #808080;">'notation_enabled'</span> <span style="color: #8000FF;">=></span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_notation_enabled</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">// A supprimer dans public function set_properties(array $properties)    {</span>
<span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_notation_enabled</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$properties</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'notation_enabled'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #008000; font-style: italic;">// Dans la même méthode, ajouter sous $notation = new Notation();</span>
<span style="color: #000080;">$notation_config</span> <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> NomModuleNotation<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">//A supprimer dans public function init_default_properties($id_category = Category::ROOT_CATEGORY)</span>
<span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">notation_enabled</span> <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">self</span><span style="color: #8000FF;">::</span><span style="color: #000000;">NOTATION_ENABLED</span><span style="color: #8000FF;">;</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">//</span>
<span style="color: #008000; font-style: italic;">// Dans public function get_array_tpl_vars() , ajouter :</span>
<span style="color: #000080;">$notation_config</span> <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> NomModuleNotation<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #008000; font-style: italic;">// Et dans return array( modifier :</span>
<span style="color: #808080;">'C_NOTATION_ENABLED'</span> <span style="color: #8000FF;">=></span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_notation_enabled</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span>
<span style="color: #008000; font-style: italic;">// par</span>
<span style="color: #808080;">'C_NOTATION_ENABLED'</span> <span style="color: #8000FF;">=></span> <span style="color: #000080;">$notation_config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">is_notation_enabled</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span>
&nbsp;</pre></pre></div></div><br /><br />
<br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-activation-du-new-content-facultatif">Activation du New-Content (facultatif)</h3><br /><br />
<br />
<br /><br />
Création du fichier NomModuleNewContent.class.php dans NomModule/phpboost/<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">NomModuleNewContent.class.php : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #FF0000; font-weight: normal;"><?php</span>
<span style="color: #008000; font-style: italic;">/*##################################################
 *                      NomModuleNewContent.class.php
 *                            -------------------
 *   begin                :  *champ à renseigner
 *   copyright         :  *champ à renseigner
 *   email                :  *champ à renseigner
 *
 *
 ###################################################
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 ###################################################*/</span>
<span style="color: #008000; font-style: italic;">/**
 * @author Votre Nom  <votre e-mail>
 */</span>
<span style="color: #0000FF; font-weight: bold;">class</span> NomModuleNewContent <span style="color: #0000FF; font-weight: bold;">extends</span> AbstractNewContentExtensionPoint
<span style="color: #8000FF;">&#123;</span>
    <span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> __construct<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
        parent<span style="color: #8000FF;">::</span>__construct<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'nommodule'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span>
<span style="color: #8000FF;">&#125;</span>
<span style="color: #FF0000; font-weight: normal;">?></span>
&nbsp;</pre></pre></div></div><br /><br />
<br /><br />
Ensuite ajoutez dans NomModuleExtensionPointProvider.class.php dans NomModule/phpboost/<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">NomModuleExtensionPointProvider.class.php : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> newcontent<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
        <span style="color: #0000FF; font-weight: bold;">return</span> <span style="color: #0000FF; font-weight: bold;">new</span> NomModuleNewContent<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #8000FF;">&#125;</span></pre></pre></div></div><br /><br />
<br /><br />
Dans la majorité des cas, il faudra modifier NomModule.class.php en ajoutant :<br /><br />
<br /><br />
- pour créer l'objet :<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #000080;">$new_content</span> <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> NomModuleContent<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span></pre></pre></div></div><br /><br />
<br /><br />
- pour créer la variable template :<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #808080;">'C_NEW_CONTENT'</span>                   <span style="color: #8000FF;">=></span> <span style="color: #000080;">$new_content</span><span style="color: #8000FF;">-></span><span style="color: #000000;">check_if_is_new_content</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">publishing_start_date</span> <span style="color: #8000FF;">!=</span> <span style="">null</span> ? <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">publishing_start_date</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_timestamp</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span> <span style="color: #8000FF;">:</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_date_created</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_timestamp</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span> <span style="color: #8000FF;">&&</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">is_published</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></pre></pre></div></div><br /><br />
<br /><br />
Exemple avec le module Articles (L 11 et L 36):<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Articles.class.php : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> get_array_tpl_vars<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #8000FF;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000080;">$category</span>         <span style="color: #8000FF;">=</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_category</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000080;">$contents</span>      <span style="color: #8000FF;">=</span> FormatingHelper<span style="color: #8000FF;">::</span><span style="color: #000000;">second_parse</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">contents</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000080;">$description</span>      <span style="color: #8000FF;">=</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_real_description</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000080;">$user</span>             <span style="color: #8000FF;">=</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_author_user</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000080;">$user_group_color</span> <span style="color: #8000FF;">=</span> User<span style="color: #8000FF;">::</span><span style="color: #000000;">get_group_color</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$user</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_groups</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$user</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_level</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span> <span style="">true</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000080;">$sources</span>          <span style="color: #8000FF;">=</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_sources</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000080;">$nbr_sources</span>      <span style="color: #8000FF;">=</span> <a href="http://www.php.net/count"><span style="color: #0000FF; font-weight: bold;">count</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$sources</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000080;">$new_content</span>      <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> ArticlesNewContent<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000080;">$notation_config</span>  <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> ArticlesNotation<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #0000FF; font-weight: bold;">return</span> <a href="http://www.php.net/array_merge"><span style="color: #0000FF; font-weight: bold;">array_merge</span></a><span style="color: #8000FF;">&#40;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <a href="http://www.php.net/date"><span style="color: #0000FF; font-weight: bold;">Date</span></a><span style="color: #8000FF;">::</span><span style="color: #000000;">get_array_tpl_vars</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">date_created</span><span style="color: #8000FF;">,</span> <span style="color: #808080;">'date'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <a href="http://www.php.net/date"><span style="color: #0000FF; font-weight: bold;">Date</span></a><span style="color: #8000FF;">::</span><span style="color: #000000;">get_array_tpl_vars</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">date_updated</span><span style="color: #8000FF;">,</span> <span style="color: #808080;">'date_updated'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <a href="http://www.php.net/date"><span style="color: #0000FF; font-weight: bold;">Date</span></a><span style="color: #8000FF;">::</span><span style="color: #000000;">get_array_tpl_vars</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">publishing_start_date</span><span style="color: #8000FF;">,</span> <span style="color: #808080;">'publishing_start_date'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <a href="http://www.php.net/date"><span style="color: #0000FF; font-weight: bold;">Date</span></a><span style="color: #8000FF;">::</span><span style="color: #000000;">get_array_tpl_vars</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">publishing_end_date</span><span style="color: #8000FF;">,</span> <span style="color: #808080;">'publishing_end_date'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <a href="http://www.php.net/array"><span style="color: #0000FF; font-weight: bold;">array</span></a><span style="color: #8000FF;">&#40;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #008000; font-style: italic;">//Conditions</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_EDIT'</span>                          <span style="color: #8000FF;">=></span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">is_authorized_to_edit</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_DELETE'</span>                        <span style="color: #8000FF;">=></span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">is_authorized_to_delete</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_HAS_PICTURE'</span>                   <span style="color: #8000FF;">=></span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">has_picture</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_USER_GROUP_COLOR'</span>              <span style="color: #8000FF;">=></span> <span style="color: #8000FF;">!</span><a href="http://www.php.net/empty"><span style="color: #0000FF; font-weight: bold;">empty</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$user_group_color</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_PUBLISHED'</span>                     <span style="color: #8000FF;">=></span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">is_published</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_PUBLISHING_START_AND_END_DATE'</span> <span style="color: #8000FF;">=></span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">publishing_start_date</span> <span style="color: #8000FF;">!=</span> <span style="">null</span> <span style="color: #8000FF;">&&</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">publishing_end_date</span> <span style="color: #8000FF;">!=</span> <span style="">null</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_PUBLISHING_START_DATE'</span>         <span style="color: #8000FF;">=></span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">publishing_start_date</span> <span style="color: #8000FF;">!=</span> <span style="">null</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_PUBLISHING_END_DATE'</span>           <span style="color: #8000FF;">=></span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">publishing_end_date</span> <span style="color: #8000FF;">!=</span> <span style="">null</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_DATE_UPDATED'</span>                  <span style="color: #8000FF;">=></span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">date_updated</span> <span style="color: #8000FF;">!=</span> <span style="">null</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_AUTHOR_DISPLAYED'</span>              <span style="color: #8000FF;">=></span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_author_name_displayed</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_AUTHOR_CUSTOM_NAME'</span>               <span style="color: #8000FF;">=></span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">is_author_custom_name_enabled</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_NOTATION_ENABLED'</span>              <span style="color: #8000FF;">=></span> <span style="color: #000080;">$notation_config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">is_notation_enabled</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_READ_MORE'</span>                     <span style="color: #8000FF;">=></span> <span style="color: #8000FF;">!</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_description_enabled</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span> <span style="color: #8000FF;">&&</span> TextHelper<span style="color: #8000FF;">::</span><a href="http://www.php.net/strlen"><span style="color: #0000FF; font-weight: bold;">strlen</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$contents</span><span style="color: #8000FF;">&#41;</span> <span style="color: #8000FF;">></span> ArticlesConfig<span style="color: #8000FF;">::</span><span style="color: #000000;">load</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_number_character_to_cut</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span> <span style="color: #8000FF;">&&</span> <span style="color: #000080;">$description</span> <span style="color: #8000FF;">!=</span> <span style="color: #8000FF;">@</span><a href="http://www.php.net/strip_tags"><span style="color: #0000FF; font-weight: bold;">strip_tags</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$contents</span><span style="color: #8000FF;">,</span> <span style="color: #808080;">'<br><br/>'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_SOURCES'</span>                       <span style="color: #8000FF;">=></span> <span style="color: #000080;">$nbr_sources</span> <span style="color: #8000FF;">></span> <span style="color: #FF8000;">0</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_DIFFERED'</span>                      <span style="color: #8000FF;">=></span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">published</span> <span style="color: #8000FF;">==</span> <span style="color: #0000FF; font-weight: bold;">self</span><span style="color: #8000FF;">::</span><span style="color: #000000;">PUBLISHED_DATE</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808080;">'C_NEW_CONTENT'</span>                   <span style="color: #8000FF;">=></span> <span style="color: #000080;">$new_content</span><span style="color: #8000FF;">-></span><span style="color: #000000;">check_if_is_new_content</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">publishing_start_date</span> <span style="color: #8000FF;">!=</span> <span style="">null</span> ? <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">publishing_start_date</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_timestamp</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span> <span style="color: #8000FF;">:</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_date_created</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_timestamp</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span> <span style="color: #8000FF;">&&</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">is_published</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></pre></div></div><br /><br />
<br /><br />
<i class="fa fa-warning fa-2x" aria-hidden="true"></i>La variable C_NEW_CONTENT peut être différente suivant les champs utilisés dans votre module. Si votre module utilise une date de publication :<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #808080;">'C_NEW_CONTENT'</span>   <span style="color: #8000FF;">=></span> <span style="color: #000080;">$new_content</span><span style="color: #8000FF;">-></span><span style="color: #000000;">check_if_is_new_content</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">publishing_start_date</span> <span style="color: #8000FF;">!=</span> <span style="">null</span> ? <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">publishing_start_date</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_timestamp</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span> <span style="color: #8000FF;">:</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_date_created</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_timestamp</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span> <span style="color: #8000FF;">&&</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">is_published</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></pre></pre></div></div><br /><br />
<br /><br />
Sinon :<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #808080;">'C_NEW_CONTENT'</span> <span style="color: #8000FF;">=></span> <span style="color: #000080;">$new_content</span><span style="color: #8000FF;">-></span><span style="color: #000000;">check_if_is_new_content</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_creation_date</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_timestamp</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span></pre></pre></div></div><br /><br />
<br /><br />
Il ne reste maintenant qu'à intégrer notre variable C_NEW_CONTENT dans le template<br /><br />
Voici deux exemples avec le module Articles:<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">ArticlesDisplayArticlesController.tpl : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;"><span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"content"</span>></span>
        <span style="color:#9915AF; font-weight: bold;">#</span> <span style="color:#000066; font-weight: bold;">INCLUDE </span> <span style="color:#8F5211;"></span><span style="color:#FF6600; font-weight: bold;">NOT_VISIBLE_MESSAGE</span> <span style="color:#9915AF; font-weight: bold;">#</span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_article.asp"><span style="color: #000000; font-weight: bold;">article</span></a> itemscope<span style="color: #66cc66;">=</span><span style="color: #ff0000;">"itemscope"</span> itemtype<span style="color: #66cc66;">=</span><span style="color: #ff0000;">"http://schema.org/Article"</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"article-articles-<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">ID</span><span style="color:#7F3300;">}</span>"</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"article-articles# IF C_NEW_CONTENT # new-content<span style="color:#9915AF; font-weight: bold;">#</span> <span style="color:#000066; font-weight: bold;">ENDIF</span> <span style="color:#9915AF; font-weight: bold;">#</span>"</span>></span>
&nbsp;</pre></div></div><br /><br />
<br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">ArticlesDisplaySeveralArticlesController.tpl : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"content elements-container# IF C_SEVERAL_COLUMNS # columns-<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">NUMBER_COLUMNS</span><span style="color:#7F3300;">}</span># ENDIF#"</span>></span>
            <span style="color:#9915AF; font-weight: bold;">#</span> <span style="color:#000066; font-weight: bold;">START</span> <span style="color:#8F5211;"></span><span style="color:#FF6600; font-weight: bold;">articles</span> <span style="color:#9915AF; font-weight: bold;">#</span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_article.asp"><span style="color: #000000; font-weight: bold;">article</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"article-articles-<span style="color:#7F3300;">{</span><span style="color:#8F5211;">articles.</span><span style="color:#FF6600; font-weight: bold;">ID</span><span style="color:#7F3300;">}</span>"</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"article-articles article-several# IF C_MOSAIC # block<span style="color:#9915AF; font-weight: bold;">#</span> <span style="color:#000066; font-weight: bold;">ENDIF</span> <span style="color:#9915AF; font-weight: bold;">#</span># IF articles.C_NEW_CONTENT # new-content<span style="color:#9915AF; font-weight: bold;">#</span> <span style="color:#000066; font-weight: bold;">ENDIF</span> <span style="color:#9915AF; font-weight: bold;">#</span>"</span> itemscope<span style="color: #66cc66;">=</span><span style="color: #ff0000;">"itemscope"</span> itemtype<span style="color: #66cc66;">=</span><span style="color: #ff0000;">"http://schema.org/CreativeWork"</span>></span>
&nbsp;</pre></div></div><br /><br />
<br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-affichage-des-categories-d-un-formulaire-s-il-existe-au-moins-une-categorie-facultatif">Affichage des catégories d'un formulaire s'il existe au moins une catégorie (facultatif)</h2><br /><br />
<br />
<br /><br />
Ce formulaire ne sera pas affiché s'il n'y a pas de catégorie créée :<br /><br />
<img src="https://resources.phpboost.com/documentation/installation/migration_module_non_officiel_5_0_to_5_1/form_display_localisation.png" alt="form_display_localisation" /><br /><br />
<br /><br />
Utilisation de <strong>MonModuleService::get_categories_manager()->get_categories_cache()->has_categories()</strong>.<br /><br />
<br /><br />
Exemple avec le module Articles, on ajoute la condition :<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #8000FF;">&#40;</span>ArticlesService<span style="color: #8000FF;">::</span><span style="color: #000000;">get_categories_manager</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_categories_cache</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">has_categories</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span>
        <span style="color: #8000FF;">&#123;</span> <span style="color: #8000FF;">......</span><span style="color: #8000FF;">&#125;</span></pre></pre></div></div><br /><br />
à<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #000080;">$search_category_children_options</span> <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> SearchCategoryChildrensOptions<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
            <span style="color: #000080;">$search_category_children_options</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_authorizations_bits</span><span style="color: #8000FF;">&#40;</span>Category<span style="color: #8000FF;">::</span><span style="color: #000000;">CONTRIBUTION_AUTHORIZATIONS</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
            <span style="color: #000080;">$search_category_children_options</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_authorizations_bits</span><span style="color: #8000FF;">&#40;</span>Category<span style="color: #8000FF;">::</span><span style="color: #000000;">WRITE_AUTHORIZATIONS</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
            <span style="color: #000080;">$fieldset</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_field</span><span style="color: #8000FF;">&#40;</span>ArticlesService<span style="color: #8000FF;">::</span><span style="color: #000000;">get_categories_manager</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_select_categories_form_field</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'id_category'</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">common_lang</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'form.category'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_article</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_id_category</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$search_category_children_options</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span></pre></pre></div></div><br /><br />
<br /><br />
<i class="fa fa-warning fa-2x" aria-hidden="true"></i><strong>Il faut faire de même pour la méthode save().</strong><br /><br />
<br /><br />
Voici les deux modifications en exemple :<br /><br />
<br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">ArticlesFormController.class.php : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">    <span style="color: #0000FF; font-weight: bold;">private</span> <span style="color: #0000FF; font-weight: bold;">function</span> build_form<span style="color: #8000FF;">&#40;</span>HTTPRequestCustom <span style="color: #000080;">$request</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
<span style="color: #8000FF;">.</span>
<span style="color: #8000FF;">.</span>
<span style="color: #8000FF;">.</span>
<span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #8000FF;">&#40;</span>ArticlesService<span style="color: #8000FF;">::</span><span style="color: #000000;">get_categories_manager</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_categories_cache</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">has_categories</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span>
        <span style="color: #8000FF;">&#123;</span>
            <span style="color: #000080;">$search_category_children_options</span> <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> SearchCategoryChildrensOptions<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
            <span style="color: #000080;">$search_category_children_options</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_authorizations_bits</span><span style="color: #8000FF;">&#40;</span>Category<span style="color: #8000FF;">::</span><span style="color: #000000;">CONTRIBUTION_AUTHORIZATIONS</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
            <span style="color: #000080;">$search_category_children_options</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_authorizations_bits</span><span style="color: #8000FF;">&#40;</span>Category<span style="color: #8000FF;">::</span><span style="color: #000000;">WRITE_AUTHORIZATIONS</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
            <span style="color: #000080;">$fieldset</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_field</span><span style="color: #8000FF;">&#40;</span>ArticlesService<span style="color: #8000FF;">::</span><span style="color: #000000;">get_categories_manager</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_select_categories_form_field</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'id_category'</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">common_lang</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'form.category'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_article</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_id_category</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$search_category_children_options</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
        <span style="color: #8000FF;">&#125;</span>
<span style="color: #8000FF;">.</span>
<span style="color: #8000FF;">.</span>
<span style="color: #8000FF;">.</span>
<span style="color: #8000FF;">.</span>
    <span style="color: #0000FF; font-weight: bold;">private</span> <span style="color: #0000FF; font-weight: bold;">function</span> save<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
    <span style="color: #8000FF;">&#123;</span>
        <span style="color: #000080;">$article</span> <span style="color: #8000FF;">=</span> <span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_article</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
&nbsp;
        <span style="color: #000080;">$article</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_title</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">form</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_value</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'title'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
&nbsp;
        <span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #8000FF;">&#40;</span>ArticlesService<span style="color: #8000FF;">::</span><span style="color: #000000;">get_categories_manager</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_categories_cache</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">has_categories</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span>
            <span style="color: #000080;">$article</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_id_category</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$this</span><span style="color: #8000FF;">-></span><span style="color: #000000;">form</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_value</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'id_category'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_raw_value</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #8000FF;">.</span>
<span style="color: #8000FF;">.</span>
<span style="color: #8000FF;">.</span></pre></pre></div></div><br />]]></description>
                <pubDate>Fri, 19 Jan 2018 00:32:43 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Mettre à jour son module 4.1 en 5.0]]></title>
                <link>https://www.phpboost.com/wiki/mettre-a-jour-son-module-4-1-en-5-0</link>
                <guid>https://www.phpboost.com/wiki/mettre-a-jour-son-module-4-1-en-5-0</guid>
                <description><![CDATA[<span class="message-helper bgc warning">Si aucun des éléments se trouvant dans cette documentation ne vous aide, référez-vous au forum et demandez de l'aide.</span><br /><br /><br /><br />
Cette documentation permet de rendre votre module compatible avec la version 5.0 de PHPBoost sans trop de modifications dans le code. Elle n'a pas pour but de le convertir en utilisant le modèle MVC et d'utiliser les nouvelles fonctionnalités. Effectuez les différentes étapes suivantes (peu importe l'ordre) pour mettre à jour votre module.<br /><br /><br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-le-fichier-de-configuration">Le fichier de configuration</h2><br /><br />
<br /><br /><br /><br />
Le seul changement à effectuer dans le fichier <em>/module/config.ini</em> pour rendre votre module compatible avec la nouvelle version est le paramètre "compatibility". Remplacez la valeur par <strong>5.0</strong>.<br /><br /><br /><br />
Pensez également à mettre à jour le numéro de version de votre module pour plus de cohérence.<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">compatibility="5.0"</pre></pre></div></div><br /><br /><br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-changements-dans-l-api">Changements dans l'API</h2><br /><br />
<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-requetes-sql">Requêtes SQL</h3><br /><br />
<br /><br /><br /><br />
L'ancien système utilisé pour les requêtes Sql (PersistenceContext::get_sql(), variable $Sql, requêtes se terminant par <pre style="display:inline;"><span style="">__LINE__</span><span style="color: #8000FF;">,</span> <span style="">__FILE__</span></pre>) a été complètement supprimé.<br /><br /><br /><br />
Référez-vous à cette documentation pour convertir vos requêtes Sql : <a class="offload" href="https://www.phpboost.com/wiki/executer-des-requetes-sql">Exécuter des requêtes SQL</a>.<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-suppression-de-certaines-variables-globales">Suppression de certaines variables globales</h3><br /><br />
<br /><br /><br /><br />
Les variables globales suivantes ont été supprimées : <pre style="display:inline;"><span style="color: #000080;">$Sql</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$Session</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$User</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$Template</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$Cache</span></pre>.<br /><br /><br /><br />
Equivalents :<br /><br /><br /><br />
Remplacer <pre style="display:inline;"><span style="color: #000080;">$Sql</span></pre> par <pre style="display:inline;">PersistenceContext<span style="color: #8000FF;">::</span><span style="color: #000000;">get_querier</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre>.<br /><br /><br /><br />
Remplacer <pre style="display:inline;"><span style="color: #000080;">$Session</span></pre> par <pre style="display:inline;">AppContext<span style="color: #8000FF;">::</span><span style="color: #000000;">get_session</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre>.<br /><br /><br /><br />
Remplacer <pre style="display:inline;"><span style="color: #000080;">$User</span></pre> par <pre style="display:inline;">AppContext<span style="color: #8000FF;">::</span><a href="http://www.php.net/get_current_user"><span style="color: #0000FF; font-weight: bold;">get_current_user</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre>.<br /><br /><br /><br />
La variable <pre style="display:inline;"><span style="color: #000080;">$Template</span></pre> est dépréciée depuis la 4.1. Utilisez la documentation pour <a class="offload" href="https://www.phpboost.com/wiki/systeme-de-templates#paragraph_les-templates-en-php">déclarer les templates en PHP</a>.<br /><br /><br /><br />
La variable <pre style="display:inline;"><span style="color: #000080;">$Cache</span></pre> est dépréciée et a été supprimée. Si vous avez vraiment besoin d'un cache pour votre module (pour affichage d'éléments dans un mini module par exemple), prenez exemple sur celui du module Téléchargements par exemple.<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-fonctions-relatives-aux-utilisateurs">Fonctions relatives aux utilisateurs</h3><br /><br />
<br /><br /><br /><br />
Pensez à remplacer <pre style="display:inline;">login</pre> par <pre style="display:inline;">display_name</pre> dans vos requêtes faisant appel à la table member.<br /><br /><br /><br />
Remplacer <pre style="display:inline;">get_utheme<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre> par <pre style="display:inline;">AppContext<span style="color: #8000FF;">::</span><a href="http://www.php.net/get_current_user"><span style="color: #0000FF; font-weight: bold;">get_current_user</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_theme</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre>.<br /><br /><br /><br />
Remplacer <pre style="display:inline;">get_ulang<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre> par <pre style="display:inline;">AppContext<span style="color: #8000FF;">::</span><a href="http://www.php.net/get_current_user"><span style="color: #0000FF; font-weight: bold;">get_current_user</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_locale</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre>.<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-classe-date">classe Date</h3><br /><br />
<br /><br /><br /><br />
La fonction <pre style="display:inline;"><a href="http://www.php.net/gmdate"><span style="color: #0000FF; font-weight: bold;">gmdate</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre> a été supprimée.<br /><br /><br /><br />
Proccédez de la manière suivante pour récupérer une date à partir d'un timestamp stocké en base de données (pour afficher la date au format JJ/MM/AAAA par exemple) :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #000080;">$date</span> <span style="color: #8000FF;">=</span> <span style="color: #8000FF;">!</span><a href="http://www.php.net/empty"><span style="color: #0000FF; font-weight: bold;">empty</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$row</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'timestamp'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">&#41;</span> ? <span style="color: #0000FF; font-weight: bold;">new</span> <a href="http://www.php.net/date"><span style="color: #0000FF; font-weight: bold;">Date</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$row</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'timestamp'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">,</span> Timezone<span style="color: #8000FF;">::</span><span style="color: #000000;">SERVER_TIMEZONE</span><span style="color: #8000FF;">&#41;</span> <span style="color: #8000FF;">:</span> <span style="">null</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$tpl</span><span style="color: #8000FF;">-></span><span style="color: #000000;">put_all</span><span style="color: #8000FF;">&#40;</span><a href="http://www.php.net/array"><span style="color: #0000FF; font-weight: bold;">array</span></a><span style="color: #8000FF;">&#40;</span>
    <span style="color: #808080;">'DATE'</span> <span style="color: #8000FF;">=></span> <span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">!</span><a href="http://www.php.net/empty"><span style="color: #0000FF; font-weight: bold;">empty</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$date</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span> ? <span style="color: #000080;">$date</span><span style="color: #8000FF;">-></span><span style="color: #000000;">format</span><span style="color: #8000FF;">&#40;</span><a href="http://www.php.net/date"><span style="color: #0000FF; font-weight: bold;">Date</span></a><span style="color: #8000FF;">::</span><span style="color: #000000;">FORMAT_DAY_MONTH_YEAR</span><span style="color: #8000FF;">&#41;</span> <span style="color: #8000FF;">:</span> <span style="color: #808080;">''</span>
<span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
&nbsp;</pre></pre></div></div><br /><br /><br /><br />
Consultez la documentation sur le <a class="offload" href="https://www.phpboost.com/wiki/traitement-des-dates">traitement des dates</a> pour obtenir les autres formats d'affichage.<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-configuration-du-module">Configuration du module</h3><br /><br />
<br /><br /><br /><br />
L'utilisation des paramètres de configuration serialisés dans le fichier desc.ini a été supprimée.<br /><br /><br /><br />
Utilisez la documentation <a class="offload" href="https://www.phpboost.com/wiki/creer-une-configuration-pour-votre-module">créer une configuration pour votre module</a> pour convertir les paramètres de configuration du module.<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-systeme-de-categories">Système de catégories</h3><br /><br />
<br /><br /><br /><br />
L'ancien système de catégories a été complètement supprimé.<br /><br /><br /><br />
Pour utiliser le nouveau système de catégories, consultez <a class="offload" href="https://www.phpboost.com/wiki/systeme-de-categories-utilisation-basique">cette documentation</a>.<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-mini-modules">Mini-modules</h3><br /><br />
<br /><br /><br /><br />
Si vous utilisez un mini-module, ajoutez les fonctions suivantes dans la classe <em>NomDeVotreModuleModuleMiniMenu.class.php</em> :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> get_menu_id<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
<span style="color: #8000FF;">&#123;</span>
    <span style="color: #0000FF; font-weight: bold;">return</span> <span style="color: #808080;">'module-mini-nomdumodule'</span><span style="color: #8000FF;">;</span>
<span style="color: #8000FF;">&#125;</span>
<span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> get_menu_title<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
<span style="color: #8000FF;">&#123;</span>
    <span style="color: #0000FF; font-weight: bold;">return</span> <span style="color: #808080;">'Module title'</span><span style="color: #8000FF;">;</span>
<span style="color: #8000FF;">&#125;</span>
<span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> is_displayed<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
<span style="color: #8000FF;">&#123;</span>
    <span style="color: #008000; font-style: italic;">//Vérifiez ici les autorisations d'affichage si besoin</span>
    <span style="color: #0000FF; font-weight: bold;">return</span> <span style="">true</span><span style="color: #8000FF;">;</span>
<span style="color: #8000FF;">&#125;</span>
&nbsp;</pre></pre></div></div><br /><br /><br /><br />
Remplacez la fonction <pre style="display:inline;">display<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre> par <pre style="display:inline;">get_menu_content<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre>.<br /><br /><br /><br />
Au niveau du template lié au mini-module, supprimez les div <pre style="display:inline;">module-mini-container</pre>, <pre style="display:inline;">module-mini-top</pre>, <pre style="display:inline;">module-mini-contents</pre> et <pre style="display:inline;">module-mini-bottom</pre> pour ne garder que le contenu.<br /><br /><br /><br />
Remplacez :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module-mini-container"</span># IF C_HORIZONTAL # <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"width:auto;"</span><span style="color:#9915AF; font-weight: bold;">#</span> <span style="color:#000066; font-weight: bold;">ENDIF</span> <span style="color:#9915AF; font-weight: bold;">#</span>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module-mini-top"</span>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_h5.asp"><span style="color: #000000; font-weight: bold;">h5</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"sub-title"</span>></span>Titre<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_h5.asp"><span style="color: #000000; font-weight: bold;">h5</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module-mini-contents"</span>></span>
Contenu
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module-mini-bottom"</span>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
&nbsp;</pre></div></div><br /><br /><br /><br />
Par :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
Contenu
&nbsp;</pre></div></div><br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-javascript">Javascript</h3><br /><br />
<br /><br /><br /><br />
Remplacez les fonctions spécifiques javascript scriptaculous par leur équivalent jQuery dans tous vox fichiers de templates si vous utilisiez des fonctions spécifiques comme Effect par exemple.<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-constantes-pour-les-messages-d-erreur">Constantes pour les messages d'erreur</h3><br /><br />
<br /><br /><br /><br />
Les anciennes constantes pour les messages d'erreur ont été supprimées.<br /><br /><br /><br />
Effectuez les remplacement suivants :<br /><br /><br /><br />
<ul class="formatter-ul">
<li class="formatter-li">[font= courier new]E_USER_SUCCESS[/font] à remplacer par [font= courier new]MessageHelper::SUCCESS[/font]
</li><li class="formatter-li">[font= courier new]E_USER_NOTICE[/font] à remplacer par [font= courier new]MessageHelper::NOTICE[/font]
</li><li class="formatter-li">[font= courier new]E_USER_WARNING[/font] à remplacer par [font= courier new]MessageHelper::WARNING[/font]
</li><li class="formatter-li">[font= courier new]E_USER_ERROR[/font] à remplacer par [font= courier new]MessageHelper::ERROR[/font]<br /><br /><br /><br />
</li></ul><br /><br /><br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-securite">Sécurité</h2><br /><br />
<br /><br /><br /><br />
La sécurité de l'ensemble de PHPBoost a été renforcée dans cette nouvelle version.<br /><br /><br /><br />
Assurez-vous d'avoir l'input token dans tous vos formulaires :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_input.asp"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"hidden"</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"token"</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">TOKEN</span><span style="color:#7F3300;">}</span>"</span>></span>
&nbsp;</pre></div></div><br /><br /><br /><br />
Supprimez tous les accès directs aux variables <pre style="display:inline;"><span style="color: #000080;">$_GET</span></pre> et <pre style="display:inline;"><span style="color: #000080;">$_POST</span></pre>.<br /><br /><br /><br />
Utilisez la fonction <pre style="display:inline;">retrieve<span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$var_type</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$var_name</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$default_value</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$force_type</span> <span style="color: #8000FF;">=</span> <span style="">NULL</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$flags</span> <span style="color: #8000FF;">=</span> <span style="color: #FF8000;">0</span><span style="color: #8000FF;">&#41;</span></pre> à la place.<br /><br /><br /><br />
Exemple :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #000080;">$id</span> <span style="color: #8000FF;">=</span> retrieve<span style="color: #8000FF;">&#40;</span>POST<span style="color: #8000FF;">,</span> <span style="color: #808080;">'id'</span><span style="color: #8000FF;">,</span> <span style="color: #FF8000;">0</span><span style="color: #8000FF;">,</span> TINTEGER<span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
&nbsp;</pre></pre></div></div><br /><br /><br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-templates-d-administration">Templates d'administration</h2><br /><br />
<br /><br /><br /><br />
Les liens dans les templates d'administration doivent être mis à jour pour être affichés correctement dans le nouveau design de l'administration.<br /><br /><br /><br />
Remplacez :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"admin-quick-menu"</span>></span>
    <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_ul.asp"><span style="color: #000000; font-weight: bold;">ul</span></a>></span>
        <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_li.asp"><span style="color: #000000; font-weight: bold;">li</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"title-menu"</span>></span><span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">TITLE</span><span style="color:#7F3300;">}</span><span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_li.asp"><span style="color: #000000; font-weight: bold;">li</span></a>></span>
        <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_li.asp"><span style="color: #000000; font-weight: bold;">li</span></a>></span>
            <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_a.asp"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"admin_menu_1.php"</span>><<a href="https://www.w3schools.com/tags/tag_img.asp"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"icone.png"</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_MENU_1</span><span style="color:#7F3300;">}</span>"</span> <span style="color: #66cc66;">/</span>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_a.asp"><span style="color: #000000; font-weight: bold;">a</span></a>></span>
&nbsp;
            <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_a.asp"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"admin_menu_1.php"</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"quick-link"</span>></span><span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_MENU_1</span><span style="color:#7F3300;">}</span><span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_a.asp"><span style="color: #000000; font-weight: bold;">a</span></a>></span>
        <span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_li.asp"><span style="color: #000000; font-weight: bold;">li</span></a>></span>
        <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_li.asp"><span style="color: #000000; font-weight: bold;">li</span></a>></span>
            <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_a.asp"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"admin_menu_2.php"</span>><<a href="https://www.w3schools.com/tags/tag_img.asp"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"icone.png"</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_MENU_2</span><span style="color:#7F3300;">}</span>"</span> <span style="color: #66cc66;">/</span>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_a.asp"><span style="color: #000000; font-weight: bold;">a</span></a>></span>
&nbsp;
            <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_a.asp"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"admin_menu_2.php"</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"quick-link"</span>></span><span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_MENU_2</span><span style="color:#7F3300;">}</span><span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_a.asp"><span style="color: #000000; font-weight: bold;">a</span></a>></span>
        <span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_li.asp"><span style="color: #000000; font-weight: bold;">li</span></a>></span>
    <span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_ul.asp"><span style="color: #000000; font-weight: bold;">ul</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
&nbsp;</pre></div></div><br /><br /><br /><br />
Par :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_nav.asp"><span style="color: #000000; font-weight: bold;">nav</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"admin-quick-menu"</span>></span>
    <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_a.asp"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">""</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"js-menu-button"</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"open_submenu('admin-quick-menu');return false;"</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_MANAGEMENT</span><span style="color:#7F3300;">}</span>"</span>></span>
        <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_i.asp"><span style="color: #000000; font-weight: bold;">i</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"fa fa-bars"</span>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_i.asp"><span style="color: #000000; font-weight: bold;">i</span></a>></span> <span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_MANAGEMENT</span><span style="color:#7F3300;">}</span>
    <span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_a.asp"><span style="color: #000000; font-weight: bold;">a</span></a>></span>
    <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_ul.asp"><span style="color: #000000; font-weight: bold;">ul</span></a>></span>
        <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_li.asp"><span style="color: #000000; font-weight: bold;">li</span></a>></span>
            <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_a.asp"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"admin_menu_1.php"</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"quick-link"</span>></span><span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_MENU_1</span><span style="color:#7F3300;">}</span><span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_a.asp"><span style="color: #000000; font-weight: bold;">a</span></a>></span>
        <span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_li.asp"><span style="color: #000000; font-weight: bold;">li</span></a>></span>
        <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_li.asp"><span style="color: #000000; font-weight: bold;">li</span></a>></span>
            <span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_a.asp"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"admin_menu_2.php"</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"quick-link"</span>></span><span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_MENU_2</span><span style="color:#7F3300;">}</span><span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_a.asp"><span style="color: #000000; font-weight: bold;">a</span></a>></span>
        <span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_li.asp"><span style="color: #000000; font-weight: bold;">li</span></a>></span>
    <span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_ul.asp"><span style="color: #000000; font-weight: bold;">ul</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_nav.asp"><span style="color: #000000; font-weight: bold;">nav</span></a>></span>
&nbsp;</pre></div></div>]]></description>
                <pubDate>Mon, 14 Mar 2016 11:23:29 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Mettre à jour son module 4.0 en 4.1]]></title>
                <link>https://www.phpboost.com/wiki/mettre-a-jour-son-module-4-0-en-4-1</link>
                <guid>https://www.phpboost.com/wiki/mettre-a-jour-son-module-4-0-en-4-1</guid>
                <description><![CDATA[<span class="message-helper bgc warning">Si aucun des éléments se trouvant dans cette documentation ne vous aide, référez-vous au forum et demandez de l'aide.</span><br /><br /><br /><br />
Cette documentation permet de rendre votre module compatible avec la version 4.1 de PHPBoost sans trop de modifications dans le code. Elle n'a pas pour but de le convertir en utilisant le modèle MVC et d'utiliser les nouvelles fonctionnalités. Effectuez les différentes étapes suivantes (peu importe l'ordre) pour mettre à jour votre module.<br /><br /><br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-le-fichier-de-configuration">Le fichier de configuration</h2><br /><br />
<br /><br /><br /><br />
Le seul changement à effectuer dans le fichier <em>/module/config.ini</em> pour rendre votre module compatible avec la nouvelle version est le paramètre "compatibility". Remplacez la valeur par <strong>4.1</strong>.<br /><br /><br /><br />
Pensez également à mettre à jour le numéro de version de votre module pour plus de cohérence.<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">compatibility="4.1"</pre></pre></div></div><br /><br /><br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-changements-dans-l-api">Changements dans l'API</h2><br /><br />
<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-systeme-de-categories">Système de catégories</h3><br /><br />
<br /><br /><br /><br />
Si votre module fait appel au système de catégories, il faut changer l'appel à la classe <strong>CategoriesManager</strong> en <strong>DeprecatedCategoriesManager</strong> dans le fichier <em>/module/phpboost/ModuleCats.class.php</em> :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #0000FF; font-weight: bold;">class</span> DownloadCats <span style="color: #0000FF; font-weight: bold;">extends</span> DeprecatedCategoriesManager</pre></pre></div></div><br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-liens-dans-l-administration">Liens dans l'administration</h3><br /><br />
<br /><br /><br /><br />
Un nouveau système a été mis en place pour les liens dans l'administration. Ces liens apparaissent maintenant également sur le site à droite du fil d'ariane.<br /><br /><br /><br />
Pour le mettre en place, ajoutez la fonction suivante dans la classe du fichier <em>/module/phpboost/ModuleExtensionPointProvider.class.php</em> (en remplaçant Module par le nom de votre module) :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> tree_links<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
<span style="color: #8000FF;">&#123;</span>
<span style="color: #0000FF; font-weight: bold;">return</span> <span style="color: #0000FF; font-weight: bold;">new</span> ModuleTreeLinks<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #8000FF;">&#125;</span>
&nbsp;</pre></pre></div></div><br /><br /><br /><br />
Créez ensuite le fichier <em>/module/phpboost/ModuleTreeLinks.class.php</em> (exemple pour le module download) :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #FF0000; font-weight: normal;"><?php</span>
<span style="color: #008000; font-style: italic;">/*##################################################
 *                         DownloadTreeLinks.class.php
 *                            -------------------
 *   begin                : November 23, 2013
 *   copyright            : (C) 2013 Julien BRISWALTER
 *   email                : julienseth78@phpboost.com
 *
 *
 ###################################################
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 ###################################################*/</span>
<span style="color: #008000; font-style: italic;">/**
 * @author Julien BRISWALTER <julienseth78@phpboost.com>
 */</span>
<span style="color: #0000FF; font-weight: bold;">class</span> DownloadTreeLinks implements ModuleTreeLinksExtensionPoint
<span style="color: #8000FF;">&#123;</span>
<span style="color: #0000FF; font-weight: bold;">public</span> <span style="color: #0000FF; font-weight: bold;">function</span> get_actions_tree_links<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span>
<span style="color: #8000FF;">&#123;</span>
<span style="color: #0000FF; font-weight: bold;">global</span> <span style="color: #000080;">$DOWNLOAD_LANG</span><span style="color: #8000FF;">;</span>
load_module_lang<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'download'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span> <span style="color: #008000; font-style: italic;">//Chargement de la langue du module.</span>
<span style="color: #0000FF; font-weight: bold;">require_once</span><span style="color: #8000FF;">&#40;</span>PATH_TO_ROOT <span style="color: #8000FF;">.</span> <span style="color: #808080;">'/download/download_auth.php'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$tree</span> <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> ModuleTreeLinks<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #008000; font-style: italic;">//Gestion et ajout de catégories dans l'administration</span>
<span style="color: #000080;">$manage_categories_link</span> <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> AdminModuleLink<span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$DOWNLOAD_LANG</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'admin.categories.manage'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">,</span> <span style="color: #0000FF; font-weight: bold;">new</span> Url<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'/download/admin_download_cat.php'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$manage_categories_link</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_sub_link</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">new</span> AdminModuleLink<span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$DOWNLOAD_LANG</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'admin.categories.manage'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">,</span> <span style="color: #0000FF; font-weight: bold;">new</span> Url<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'/download/admin_download_cat.php'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$manage_categories_link</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_sub_link</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">new</span> AdminModuleLink<span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$DOWNLOAD_LANG</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'add_category'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">,</span> <span style="color: #0000FF; font-weight: bold;">new</span> Url<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'/download/admin_download_cat.php?new=1'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$tree</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_link</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$manage_categories_link</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #008000; font-style: italic;">//Gestion et ajout de fichiers dans l'administration</span>
<span style="color: #000080;">$manage_download_link</span> <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> AdminModuleLink<span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$DOWNLOAD_LANG</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'files.manage'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">,</span> <span style="color: #0000FF; font-weight: bold;">new</span> Url<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'/download/admin_download.php'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$manage_download_link</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_sub_link</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">new</span> AdminModuleLink<span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$DOWNLOAD_LANG</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'files.manage'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">,</span> <span style="color: #0000FF; font-weight: bold;">new</span> Url<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'/download/admin_download.php'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$manage_download_link</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_sub_link</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">new</span> AdminModuleLink<span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$DOWNLOAD_LANG</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'add_file'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">,</span> <span style="color: #0000FF; font-weight: bold;">new</span> Url<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'/download/management.php?new=1'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$tree</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_link</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$manage_download_link</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #008000; font-style: italic;">//Gestion de la configuration du module dans l'administration</span>
<span style="color: #000080;">$tree</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_link</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">new</span> AdminModuleLink<span style="color: #8000FF;">&#40;</span>LangLoader<span style="color: #8000FF;">::</span><span style="color: #000000;">get_message</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'configuration'</span><span style="color: #8000FF;">,</span> <span style="color: #808080;">'admin'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span> <span style="color: #0000FF; font-weight: bold;">new</span> Url<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'/download/admin_download_config.php'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #008000; font-style: italic;">//Lien pour ajouter un fichier sur le site</span>
<span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">!</span>AppContext<span style="color: #8000FF;">::</span><a href="http://www.php.net/get_current_user"><span style="color: #0000FF; font-weight: bold;">get_current_user</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">check_level</span><span style="color: #8000FF;">&#40;</span>User<span style="color: #8000FF;">::</span><span style="color: #000000;">ADMIN_LEVEL</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span>
<span style="color: #8000FF;">&#123;</span>
<span style="color: #000080;">$tree</span><span style="color: #8000FF;">-></span><span style="color: #000000;">add_link</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">new</span> ModuleLink<span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$DOWNLOAD_LANG</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'add_file'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">,</span> <span style="color: #0000FF; font-weight: bold;">new</span> Url<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'/download/management.php?new=1'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span> AppContext<span style="color: #8000FF;">::</span><a href="http://www.php.net/get_current_user"><span style="color: #0000FF; font-weight: bold;">get_current_user</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">check_auth</span><span style="color: #8000FF;">&#40;</span>DownloadConfig<span style="color: #8000FF;">::</span><span style="color: #000000;">load</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_authorizations</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span> DOWNLOAD_WRITE_CAT_AUTH_BIT<span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #8000FF;">&#125;</span>
<span style="color: #0000FF; font-weight: bold;">return</span> <span style="color: #000080;">$tree</span><span style="color: #8000FF;">;</span>
<span style="color: #8000FF;">&#125;</span>
<span style="color: #8000FF;">&#125;</span>
<span style="color: #FF0000; font-weight: normal;">?></span>
&nbsp;</pre></pre></div></div><br /><br /><br /><br />
<span class="message-helper bgc notice">La classe <pre style="display:inline;">AdminModuleLink<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre> permet d'afficher des liens dans l'administration et sur le site pour les administrateurs.<br /><br /><br /><br />
La classe <pre style="display:inline;">ModuleLink<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre> des liens uniquement sur la partie site (pas dans l'administration). Les limitations d'accès à ce lien sont définies dans le 3e paramètre.</span><br /><br /><br /><br />
Vous pouvez ensuite supprimer les liens <pre style="display:inline;">admin_links</pre> dans <em>/module/lang/french/desc.ini</em> (idem pour les autres langues).<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-pagination">Pagination</h3><br /><br />
<br /><br /><br /><br />
L'API de pagination a été améliorée. Il faut faire des changements au niveau du code php et des templates pour l'utiliser parce-que l'ancienne API n'est plus supportée.<br /><br /><br /><br />
Si vous utilisiez la classe Pagination dans la version 4.0, veuillez maintenant passer à la nouvelle classe ModulePagination.<br /><br /><br /><br />
<h4 class="formatter-title wiki-paragraph-4" id="paragraph-fichiers-php">Fichiers php</h4><br /><br />
<br /><br /><br /><br />
Remplacez l'ancienne déclaration de la pagination :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000080;">$Pagination</span> <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> DeprecatedPagination<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$tpl</span><span style="color: #8000FF;">-></span><span style="color: #000000;">put_all</span><span style="color: #8000FF;">&#40;</span><a href="http://www.php.net/array"><span style="color: #0000FF; font-weight: bold;">array</span></a><span style="color: #8000FF;">&#40;</span>
<span style="color: #808080;">'PAGINATION'</span> <span style="color: #8000FF;">=></span> <span style="color: #000080;">$Pagination</span><span style="color: #8000FF;">-></span><span style="color: #000000;">display</span><span style="color: #8000FF;">&#40;</span>PATH_TO_ROOT <span style="color: #8000FF;">.</span> <span style="color: #808080;">'/module/page.php?p=%d'</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$number_elements</span><span style="color: #8000FF;">,</span> <span style="color: #808080;">'p'</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$_NBR_ELEMENTS_PER_PAGE</span><span style="color: #8000FF;">,</span> <span style="color: #FF8000;">3</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span>
<span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
&nbsp;</pre></pre></div></div><br /><br /><br /><br />
Par :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000080;">$page</span> <span style="color: #8000FF;">=</span> AppContext<span style="color: #8000FF;">::</span><span style="color: #000000;">get_request</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_getint</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'p'</span><span style="color: #8000FF;">,</span> <span style="color: #FF8000;">1</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$pagination</span> <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> ModulePagination<span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$page</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$number_elements</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$_NBR_ELEMENTS_PER_PAGE</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$pagination</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_url</span><span style="color: #8000FF;">&#40;</span><span style="color: #0000FF; font-weight: bold;">new</span> Url<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'/module/page.php?p=%d'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$pagination</span><span style="color: #8000FF;">-></span><span style="color: #000000;">current_page_is_empty</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span> <span style="color: #8000FF;">&&</span> <span style="color: #000080;">$page</span> <span style="color: #8000FF;">></span> <span style="color: #FF8000;">1</span><span style="color: #8000FF;">&#41;</span>
<span style="color: #8000FF;">&#123;</span>
<span style="color: #000080;">$error_controller</span> <span style="color: #8000FF;">=</span> PHPBoostErrors<span style="color: #8000FF;">::</span><span style="color: #000000;">unexisting_page</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
DispatchManager<span style="color: #8000FF;">::</span><span style="color: #000000;">redirect</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$error_controller</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #8000FF;">&#125;</span>
<span style="color: #000080;">$tpl</span><span style="color: #8000FF;">-></span><span style="color: #000000;">put_all</span><span style="color: #8000FF;">&#40;</span><a href="http://www.php.net/array"><span style="color: #0000FF; font-weight: bold;">array</span></a><span style="color: #8000FF;">&#40;</span>
<span style="color: #808080;">'C_PAGINATION'</span> <span style="color: #8000FF;">=></span> <span style="color: #000080;">$pagination</span><span style="color: #8000FF;">-></span><span style="color: #000000;">has_several_pages</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span>
<span style="color: #808080;">'PAGINATION'</span> <span style="color: #8000FF;">=></span> <span style="color: #000080;">$pagination</span><span style="color: #8000FF;">-></span><span style="color: #000000;">display</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span>
<span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
&nbsp;</pre></pre></div></div><br /><br /><br /><br />
La variable <pre style="display:inline;"><span style="color: #000080;">$number_elements</span></pre> représente le nombre total d'éléments (généralement récupéré par une requête SQL avant) et la variable <pre style="display:inline;"><span style="color: #000080;">$_NBR_ELEMENTS_PER_PAGE</span></pre> représente le nombre d'éléments à afficher sur la page (généralement défini dans la configuration du module).<br /><br /><br /><br />
Remplacez également la limitation du nombre de page dans la requête SQL :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000080;">$Sql</span><span style="color: #8000FF;">-></span><span style="color: #000000;">limit</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$Pagination</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_first_msg</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$_NBR_ELEMENTS_PER_PAGE</span><span style="color: #8000FF;">,</span> <span style="color: #808080;">'p'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$_NBR_ELEMENTS_PER_PAGE</span><span style="color: #8000FF;">&#41;</span>
&nbsp;</pre></pre></div></div><br /><br /><br /><br />
Par :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000080;">$Sql</span><span style="color: #8000FF;">-></span><span style="color: #000000;">limit</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$pagination</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_display_from</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span> <span style="color: #000080;">$_NBR_ELEMENTS_PER_PAGE</span><span style="color: #8000FF;">&#41;</span>
&nbsp;</pre></pre></div></div><br /><br /><br /><br />
<h4 class="formatter-title wiki-paragraph-4" id="paragraph-templates">Templates</h4><br /><br />
<br /><br /><br /><br />
Remplacez l'appel à la pagination dans les templates <pre style="display:inline; font-color:courier new;"><span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">PAGINATION</span><span style="color:#7F3300;">}</span></pre> par :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
# IF C_PAGINATION # <span style="color:#9915AF; font-weight: bold;">#</span> <span style="color:#000066; font-weight: bold;">INCLUDE </span> <span style="color:#8F5211;"></span><span style="color:#FF6600; font-weight: bold;">PAGINATION</span> <span style="color:#9915AF; font-weight: bold;">#</span> <span style="color:#9915AF; font-weight: bold;">#</span> <span style="color:#000066; font-weight: bold;">ENDIF</span> <span style="color:#9915AF; font-weight: bold;">#</span>
&nbsp;</pre></div></div><br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-notation">Notation</h3><br /><br />
<br /><br /><br /><br />
La fonction <pre style="display:inline;">set_average_notes<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre> a été ajoutée dans la classe <strong>Notation</strong>.<br /><br /><br /><br />
Initialisation de la notation :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000080;">$notation</span> <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> Notation<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$notation</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_module_name</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'module'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$notation</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_id_in_module</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$id</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$notation</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_notation_scale</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$max_note</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$result</span> <span style="color: #8000FF;">=</span> <span style="color: #000080;">$Sql</span><span style="color: #8000FF;">-></span><span style="color: #000000;">query_while</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">"SELECT module.*, notes.average_notes
FROM "</span> <span style="color: #8000FF;">.</span> PREFIX <span style="color: #8000FF;">.</span> <span style="color: #808080;">"module module
LEFT JOIN "</span> <span style="color: #8000FF;">.</span> DB_TABLE_AVERAGE_NOTES <span style="color: #8000FF;">.</span> <span style="color: #808080;">" notes ON module.id = notes.id_in_module AND notes.module_name = 'module'"</span><span style="color: #8000FF;">,</span> <span style="">__LINE__</span><span style="color: #8000FF;">,</span> <span style="">__FILE__</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #0000FF; font-weight: bold;">while</span> <span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$row</span> <span style="color: #8000FF;">=</span> <span style="color: #000080;">$Sql</span><span style="color: #8000FF;">-></span><span style="color: #000000;">fetch_assoc</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$result</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span>
<span style="color: #8000FF;">&#123;</span>
<span style="color: #000080;">$notation</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_id_in_module</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$row</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'id'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$notation</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_average_notes</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$row</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'average_notes'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #8000FF;">&#125;</span>
&nbsp;</pre></pre></div></div><br /><br /><br /><br />
Appel de la notation active (notation lors du clic) :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000080;">$tpl</span><span style="color: #8000FF;">-></span><span style="color: #000000;">put_all</span><span style="color: #8000FF;">&#40;</span><a href="http://www.php.net/array"><span style="color: #0000FF; font-weight: bold;">array</span></a><span style="color: #8000FF;">&#40;</span>
<span style="color: #808080;">'NOTE'</span> <span style="color: #8000FF;">=></span> NotationService<span style="color: #8000FF;">::</span><span style="color: #000000;">display_active_image</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$notation</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span>
<span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
&nbsp;</pre></pre></div></div><br /><br /><br /><br />
Appel de la notation statique (affichage uniquement) :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000080;">$tpl</span><span style="color: #8000FF;">-></span><span style="color: #000000;">put_all</span><span style="color: #8000FF;">&#40;</span><a href="http://www.php.net/array"><span style="color: #0000FF; font-weight: bold;">array</span></a><span style="color: #8000FF;">&#40;</span>
<span style="color: #808080;">'NOTE'</span> <span style="color: #8000FF;">=></span> NotationService<span style="color: #8000FF;">::</span><span style="color: #000000;">display_static_image</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$notation</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">,</span>
<span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
&nbsp;</pre></pre></div></div><br /><br /><br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-templates">Templates</h2><br /><br />
<br /><br /><br /><br />
Il y a eu pas mal de changements dans le nom des classes CSS. La plupart du temps il suffit de remplacer le _ par un -. Référez-vous à la documentation des thèmes pour plus d'informations.<br /><br /><br /><br />
<ul class="formatter-ul">
  <li class="formatter-li"><pre style="display:inline; font-color:courier new;">text_strong</pre> devient <pre style="display:inline; font-color:courier new;">text-strong</pre>
  </li><li class="formatter-li"><pre style="display:inline; font-color:courier new;">text_center</pre> devient <pre style="display:inline; font-color:courier new;">center</pre>
  </li><li class="formatter-li"><pre style="display:inline; font-color:courier new;">text_small</pre> devient <pre style="display:inline; font-color:courier new;">smaller</pre><br /><br /><br /><br />
</li></ul><br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-tableaux">Tableaux</h3><br /><br />
<br /><br /><br /><br />
Les classes CSS <strong>module-table</strong>, <strong>row1</strong>, <strong>row2</strong> et <strong>row3</strong> ont été supprimées et le style des tableaux a été mis à jour pour respecter les standards.<br /><br /><br /><br />
Un tableau doit être de la forme :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_table.asp"><span style="color: #000000; font-weight: bold;">table</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_caption.asp"><span style="color: #000000; font-weight: bold;">caption</span></a>></span>Titre du tableau<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_caption.asp"><span style="color: #000000; font-weight: bold;">caption</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_thead.asp"><span style="color: #000000; font-weight: bold;">thead</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_tr.asp"><span style="color: #000000; font-weight: bold;">tr</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_th.asp"><span style="color: #000000; font-weight: bold;">th</span></a>></span>Titre<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_th.asp"><span style="color: #000000; font-weight: bold;">th</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_tr.asp"><span style="color: #000000; font-weight: bold;">tr</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_thead.asp"><span style="color: #000000; font-weight: bold;">thead</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_tfoot.asp"><span style="color: #000000; font-weight: bold;">tfoot</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_tr.asp"><span style="color: #000000; font-weight: bold;">tr</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_th.asp"><span style="color: #000000; font-weight: bold;">th</span></a>></span>Pied de page<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_th.asp"><span style="color: #000000; font-weight: bold;">th</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_tr.asp"><span style="color: #000000; font-weight: bold;">tr</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_tfoot.asp"><span style="color: #000000; font-weight: bold;">tfoot</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_tbody.asp"><span style="color: #000000; font-weight: bold;">tbody</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_tr.asp"><span style="color: #000000; font-weight: bold;">tr</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_td.asp"><span style="color: #000000; font-weight: bold;">td</span></a>></span>Contenu<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_td.asp"><span style="color: #000000; font-weight: bold;">td</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_tr.asp"><span style="color: #000000; font-weight: bold;">tr</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_tbody.asp"><span style="color: #000000; font-weight: bold;">tbody</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_table.asp"><span style="color: #000000; font-weight: bold;">table</span></a>></span>
&nbsp;</pre></div></div><br /><br /><br /><br />
<span class="message-helper bgc notice">La déclaration du pied de page se fait bien avant la déclaration du contenu, ce n'est pas une erreur. Les sections <strong>caption</strong>, <strong>thead</strong> et <strong>tfoot</strong> ne sont pas obligatoires. Le style des tableaux se personnalise dans les fichiers CSS du thème (voir la documentation sur les thèmes).</span><br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-icones">Icônes</h3><br /><br />
<br /><br /><br /><br />
Les images des thèmes ont été remplacées par des icônes de la librairie <a class="offload" href="http://fontawesome.io/icons/">Font-Awesome</a>.<br /><br /><br /><br />
Vous pouvez avoir un aperçu des différentes icônes utilisées dans les modules dans le module <strong>bac à sable</strong>.<br /><br /><br /><br />
<span style="text-decoration: underline;">Principaux changements</span> :<br /><br /><br /><br />
Remplacez :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_img.asp"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">PATH_TO_ROOT</span><span style="color:#7F3300;">}</span>/templates/<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">THEME</span><span style="color:#7F3300;">}</span>/images/<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">LANG</span><span style="color:#7F3300;">}</span>/edit.png"</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"valign_middle"</span> <span style="color: #66cc66;">/</span>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_img.asp"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">PATH_TO_ROOT</span><span style="color:#7F3300;">}</span>/templates/<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">THEME</span><span style="color:#7F3300;">}</span>/images/<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">LANG</span><span style="color:#7F3300;">}</span>/delete.png"</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"valign_middle"</span> <span style="color: #66cc66;">/</span>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_img.asp"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">PATH_TO_ROOT</span><span style="color:#7F3300;">}</span>/templates/<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">THEME</span><span style="color:#7F3300;">}</span>/images/refresh.png"</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">""</span> <span style="color: #66cc66;">/</span>></span>
&nbsp;</pre></div></div><br /><br /><br /><br />
Par :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_i.asp"><span style="color: #000000; font-weight: bold;">i</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"fa fa-edit"</span>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_i.asp"><span style="color: #000000; font-weight: bold;">i</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_i.asp"><span style="color: #000000; font-weight: bold;">i</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"fa fa-delete"</span>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_i.asp"><span style="color: #000000; font-weight: bold;">i</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_i.asp"><span style="color: #000000; font-weight: bold;">i</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"fa fa-refresh fa-2x"</span>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_i.asp"><span style="color: #000000; font-weight: bold;">i</span></a>></span>
&nbsp;</pre></div></div><br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-boutons">Boutons</h3><br /><br />
<br /><br /><br /><br />
Les boutons des formulaires doivent être mis à jour pour respecter la sémantique HTML5.<br /><br /><br /><br />
Remplacez :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_input.asp"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"submit"</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"valid"</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_SUBMIT</span><span style="color:#7F3300;">}</span>"</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"submit"</span>></span>
  
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_input.asp"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_PREVIEW</span><span style="color:#7F3300;">}</span>"</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"XMLHttpRequest_preview();"</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"submit"</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"button"</span>></span>
  
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_input.asp"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"reset"</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_RESET</span><span style="color:#7F3300;">}</span>"</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"reset"</span>></span>
&nbsp;</pre></div></div><br /><br /><br /><br />
Par :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_button.asp"><span style="color: #000000; font-weight: bold;">button</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"submit"</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"valid"</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"true"</span>></span><span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_SUBMIT</span><span style="color:#7F3300;">}</span><span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_button.asp"><span style="color: #000000; font-weight: bold;">button</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_button.asp"><span style="color: #000000; font-weight: bold;">button</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"button"</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_PREVIEW</span><span style="color:#7F3300;">}</span>"</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"XMLHttpRequest_preview();"</span>></span><span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_PREVIEW</span><span style="color:#7F3300;">}</span><span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_button.asp"><span style="color: #000000; font-weight: bold;">button</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_button.asp"><span style="color: #000000; font-weight: bold;">button</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"reset"</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"true"</span>></span><span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_RESET</span><span style="color:#7F3300;">}</span><span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_button.asp"><span style="color: #000000; font-weight: bold;">button</span></a>></span>
&nbsp;</pre></div></div><br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-formulaires">Formulaires</h3><br /><br />
<br /><br /><br /><br />
Certaines parties des formulaires ont été mises à jour. Le plus gros changement consiste à remplacer les _ dans les noms des classes CSS par des -.<br /><br /><br /><br />
Remplacez :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_dl.asp"><span style="color: #000000; font-weight: bold;">dl</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_dt.asp"><span style="color: #000000; font-weight: bold;">dt</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_label.asp"><span style="color: #000000; font-weight: bold;">label</span></a> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"name"</span>></span><span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_NAME</span><span style="color:#7F3300;">}</span><span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_label.asp"><span style="color: #000000; font-weight: bold;">label</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_span.asp"><span style="color: #000000; font-weight: bold;">span</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"test_small"</span>></span><span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_NAME_EXPLAIN</span><span style="color:#7F3300;">}</span><span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_span.asp"><span style="color: #000000; font-weight: bold;">span</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_dt.asp"><span style="color: #000000; font-weight: bold;">dt</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_dd.asp"><span style="color: #000000; font-weight: bold;">dd</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_input.asp"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"text"</span> <span style="color: #000066;">size</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"65"</span> <span style="color: #000066;">maxlength</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"100"</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"name"</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"name"</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">NAME</span><span style="color:#7F3300;">}</span>"</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"text"</span>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_dd.asp"><span style="color: #000000; font-weight: bold;">dd</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_dl.asp"><span style="color: #000000; font-weight: bold;">dl</span></a>></span>
&nbsp;</pre></div></div><br /><br /><br /><br />
Par :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"form-element"</span>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_label.asp"><span style="color: #000000; font-weight: bold;">label</span></a> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"name"</span>></span>
<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_NAME</span><span style="color:#7F3300;">}</span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_span.asp"><span style="color: #000000; font-weight: bold;">span</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"field-description"</span>></span><span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">L_NAME_EXPLAIN</span><span style="color:#7F3300;">}</span><span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_span.asp"><span style="color: #000000; font-weight: bold;">span</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_label.asp"><span style="color: #000000; font-weight: bold;">label</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"form-field"</span>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_input.asp"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"text"</span> <span style="color: #000066;">size</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"65"</span> <span style="color: #000066;">maxlength</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"100"</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"name"</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"name"</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"<span style="color:#7F3300;">{</span><span style="color:#FF6600; font-weight: bold;">NAME</span><span style="color:#7F3300;">}</span>"</span>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
&nbsp;</pre></div></div><br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-templates-des-pages">Templates des pages</h3><br /><br />
<br /><br /><br /><br />
L'affichage des pages a été mis à jour pour respecter les standards HTML5.<br /><br /><br /><br />
Remplacez :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module_position"</span>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module_top_l"</span>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module_top_r"</span>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module_top"</span>></span>Titre<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module_contents"</span>></span>
Contenu
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module_bottom_l"</span>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module_bottom_r"</span>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module_bottom"</span>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
&nbsp;</pre></div></div><br /><br /><br /><br />
Par :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_section.asp"><span style="color: #000000; font-weight: bold;">section</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_header.asp"><span style="color: #000000; font-weight: bold;">header</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_h1.asp"><span style="color: #000000; font-weight: bold;">h1</span></a>></span>Titre<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_h1.asp"><span style="color: #000000; font-weight: bold;">h1</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_header.asp"><span style="color: #000000; font-weight: bold;">header</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"content"</span>></span>
Contenu
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_footer.asp"><span style="color: #000000; font-weight: bold;">footer</span></a>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_footer.asp"><span style="color: #000000; font-weight: bold;">footer</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_section.asp"><span style="color: #000000; font-weight: bold;">section</span></a>></span>
&nbsp;</pre></div></div><br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-mini-modules">Mini-modules</h3><br /><br />
<br /><br /><br /><br />
Remplacez les _ dans les noms des classes CSS par des -. Ce qui donne :<br /><br /><br /><br />
<div class="formatter-container formatter-code code-TPL"><span class="formatter-title">Code TPL : </span><div class="formatter-content"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module-mini-container"</span># IF C_HORIZONTAL # <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"width:auto;"</span><span style="color:#9915AF; font-weight: bold;">#</span> <span style="color:#000066; font-weight: bold;">ENDIF</span> <span style="color:#9915AF; font-weight: bold;">#</span>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module-mini-top"</span>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_h5.asp"><span style="color: #000000; font-weight: bold;">h5</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"sub-title"</span>></span>Titre<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_h5.asp"><span style="color: #000000; font-weight: bold;">h5</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module-mini-contents"</span>></span>
Contenu
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"module-mini-bottom"</span>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_div.asp"><span style="color: #000000; font-weight: bold;">div</span></a>></span>
&nbsp;</pre></div></div>]]></description>
                <pubDate>Wed, 27 Jan 2016 15:39:45 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Mettre à jour son module 3.0 en 4.0]]></title>
                <link>https://www.phpboost.com/wiki/mettre-a-jour-son-module-3-0-en-4-0</link>
                <guid>https://www.phpboost.com/wiki/mettre-a-jour-son-module-3-0-en-4-0</guid>
                <description><![CDATA[<span class="message-helper bgc warning">Si aucun des éléments se trouvant dans cette documentation ne vous aide, référez-vous au forum et demandez de l'aide.</span><br /><br /><br /><br />
<br /><br /><br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-le-fichier-de-configuration">Le fichier de configuration</h2><br /><br />
<br /><br /><br /><br /><br /><br />
Dans la version 3.0, un fichier rassemblait les différentes informations sur le module : <strong>le fichier config.ini dans chaque dossier de langue</strong>.<br /><br /><br /><br />
<br /><br /><br /><br />
Pour être plus cohérent, nous avons <strong>décidé de scinder ce fichier</strong>.<br /><br /><br /><br />
<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-le-fichier-de-configuration-config-ini">Le fichier de configuration : config.ini</h3><br /><br />
<br /><br /><br /><br /><br /><br />
Le nouveau fichier de configuration va se trouver à la racine de votre module.<br /><br /><br /><br />
<br /><br /><br /><br />
Dans un premier temps, veuillez le fichier config.ini pour le coller à la racine de votre module.<br /><br /><br /><br />
<br /><br /><br /><br />
Veuillez renommer :<br /><br /><br /><br />
<br /><br /><br /><br />
<ul class="formatter-ul">
    <li class="formatter-li"> author_link en author_website
    </li><li class="formatter-li"> starteable_page en home_page
    </li><li class="formatter-li"> url_rewrite en rewrite_rules[]<br /><br /><br /><br />
</li></ul><br /><br /><br /><br />
<br /><br /><br /><br />
Supprimez les champs suivants : info, admin_links, name, css, cache, sql_table, com, note<br /><br /><br /><br />
<br /><br /><br /><br />
<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-le-fichier-de-description-desc-ini">Le fichier de description : desc.ini</h3><br /><br />
<br /><br /><br /><br /><br /><br />
Veuillez ensuite <strong>renommer le fichier config.ini</strong> dans les dossiers de langues <strong>en desc.ini</strong>.<br /><br /><br /><br />
<br /><br /><br /><br />
Ouvrez le fichier et gardez <strong>seulement les champs name, info et admin_links</strong>.<br /><br /><br /><br />
<br /><br /><br /><br />
Il vous faudra ensuite <strong>renommer le champ info en desc</strong>.<br /><br /><br /><br />
<br /><br /><br /><br />
Pour plus d'informations concernant les fichiers <em>config.ini</em> et <em>desc.ini</em> dans la version 4.0, référez-vous à cet article : <a class="offload" href="https://www.phpboost.com/wiki/les-bases">Les bases</a><br /><br /><br /><br />
<br /><br /><br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-creation-et-suppression-des-tables-du-module">Création et suppression des tables du module</h2><br /><br />
<br /><br /><br /><br /><br /><br />
Si vous utilisez des tables spécifiques pour votre module, vous avez un dossier nommé db à la racine.<br /><br /><br /><br />
<br /><br /><br /><br />
Celui-ci centralise les fichiers SQL permettant de créer et de supprimer les tables en question lors de l'installation et la désinstallation de votre module.<br /><br /><br /><br />
<br /><br /><br /><br />
Nous avons intégré un tout nouveau système permettant de gérer cela plus proprement.<br /><br /><br /><br />
<br /><br /><br /><br />
Dorénavant vous allez avoir un seul et même fichier.<br /><br /><br /><br />
<br /><br /><br /><br />
Veuillez créer un dossier phpboost à la racine de votre site. Vous pourrez y mettre tout ce qui est relatif à PHPBoost dans son ensemble.<br /><br /><br /><br />
<br /><br /><br /><br />
Pour créer le nouveau fichier vous permettant de créer vos tables, veuillez vous reporter aux articles :<br /><br /><br /><br />
<br /><br /><br /><br />
- <a class="offload" href="https://www.phpboost.com/wiki/mise-en-place-du-modulesetup">Mise en place du ModuleSetup</a>.<br /><br /><br /><br />
- <a class="offload" href="https://www.phpboost.com/wiki/operations-sur-la-base-de-donnees">Opérations sur la base de données</a>.<br /><br /><br /><br />
- Référez-vous au ModuleSetup d'un module existant en v4.0 pour vous aider si besoin<br /><br /><br /><br />
<br /><br /><br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-les-extensionpointprovider">Les ExtensionPointProvider</h2><br /><br />
<br /><br /><br /><br /><br /><br />
Dans la précédente version, il était déjà possible de communiquer entre plusieurs modules.<br /><br /><br /><br />
Cela est rendu encore plus facile et lisible sur la version 4.0 grâce à un tout nouveau système : Les ExtensionPoint.<br /><br /><br /><br />
<br /><br /><br /><br />
Veuillez suivre <a class="offload" href="https://www.phpboost.com/wiki/la-communication-entre-module">cet article</a>.<br /><br /><br /><br />
<br /><br /><br /><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-changements-dans-l-api">Changements dans l'API</h2><br /><br />
<br /><br /><br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-templates">Templates</h3><br /><br />
<br /><br /><br /><br /><br /><br />
- Ce n'est plus la classe <pre style="display:inline;">Template</pre> qu'il faut instancier mais <pre style="display:inline;">FileTemplate</pre><br /><br /><br /><br />
- La fonction <pre style="display:inline;">parse<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre> est dépréciée, utilisez <pre style="display:inline;">render<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre><br /><br /><br /><br />
- La fonction <pre style="display:inline;">assign_vars<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre> est renommée en <pre style="display:inline;">put_all<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre><br /><br /><br /><br />
<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-gestion-des-erreurs">Gestion des erreurs</h3><br /><br />
<br /><br /><br /><br /><br /><br />
L'utilisation de la classe <pre style="display:inline;">Errorh</pre> devient obsolète.<br /><br /><br /><br />
Elle est remplacée par :<br /><br /><br /><br />
<br /><br /><br /><br />
- Un bon nombre d'erreurs prédéfinies dans une classe nommée <pre style="display:inline;">PHPBoostErrors</pre>. Pour l'utiliser, voici un exemple :<br /><br /><br /><br />
<br /><br /><br /><br />
L'erreur "la page n'existe pas" est affichée de cette manière :<br /><br /><br /><br />
<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">DispatchManager<span style="color: #8000FF;">::</span><span style="color: #000000;">redirect</span><span style="color: #8000FF;">&#40;</span>PHPBoostErrors<span style="color: #8000FF;">::</span><span style="color: #000000;">unexisting_page</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span></pre></pre></div></div><br /><br /><br /><br />
<br /><br /><br /><br />
- Pour créer une erreur personnalisée, utilisez la classe <pre style="display:inline;">UserErrorController</pre> :<br /><br /><br /><br />
<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #000080;">$controller</span> <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> UserErrorController<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'Titre de l\'erreur'</span><span style="color: #8000FF;">,</span> <span style="color: #808080;">'Description de l\'erreur'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
DispatchManager<span style="color: #8000FF;">::</span><span style="color: #000000;">redirect</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$controller</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span></pre></pre></div></div><br /><br /><br /><br />
<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-editeurs-de-texte">Editeurs de texte</h3><br /><br />
<br /><br /><br /><br /><br /><br />
- <pre style="display:inline;">second_parse<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre> devient <pre style="display:inline;">FormatingHelper<span style="color: #8000FF;">::</span><span style="color: #000000;">second_parse</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre>, <pre style="display:inline;">parse<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre> devient <pre style="display:inline;">FormatingHelper<span style="color: #8000FF;">::</span><span style="color: #000000;">parse</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre>, <pre style="display:inline;">unparse<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre> devient <pre style="display:inline;">FormatingHelper<span style="color: #8000FF;">::</span><span style="color: #000000;">unparse</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre><br /><br /><br /><br />
- <pre style="display:inline;">display_editor<span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'nom_de_votre_textarea'</span><span style="color: #8000FF;">&#41;</span></pre> devient :<br /><br /><br /><br />
<br /><br /><br /><br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #000080;">$editor</span> <span style="color: #8000FF;">=</span> AppContext<span style="color: #8000FF;">::</span><span style="color: #000000;">get_content_formatting_service</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_default_editor</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$editor</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_identifier</span><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'nom_de_votre_textarea'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$editor</span><span style="color: #8000FF;">-></span><span style="color: #000000;">display</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span></pre></pre></div></div><br /><br /><br /><br />
<br /><br /><br /><br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-divers">Divers</h3><br /><br />
<br /><br /><br /><br /><br /><br />
- La classe utilisée dans la version 3.0 pour la pagination se nomme maintenant <pre style="display:inline;">DeprecatedPagination</pre>. Si vous souhaitez utiliser la nouvelle classe, référez vous à cet <a class="offload" href="https://www.phpboost.com/wiki/systeme-de-pagination">article</a>.<br /><br /><br /><br />
- Pour créer une redirection, utilisez <pre style="display:inline;">AppContext<span style="color: #8000FF;">::</span><span style="color: #000000;">get_response</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">-></span><span style="color: #000000;">redirect</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre><br /><br /><br /><br />
- L'utilisation de la fonction <pre style="display:inline;">import<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span></pre> n'est plus utile, les classes sont automatiquement chargées à travers l'autoload.]]></description>
                <pubDate>Mon, 18 Feb 2013 17:10:26 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Migrer un module vers une nouvelle version]]></title>
                <link>https://www.phpboost.com/wiki/migrer-un-module-vers-une-nouvelle-version</link>
                <guid>https://www.phpboost.com/wiki/migrer-un-module-vers-une-nouvelle-version</guid>
                <description><![CDATA[Dans cette catégorie, vous trouverez différents articles vous permettant de mettre à jour votre module vers une nouvelle version de PHPBoost.]]></description>
                <pubDate>Tue, 08 Jan 2013 12:57:56 +0100</pubDate>
                
            </item>
		
	</channel>
</rss>
