version=5.1.0 compatibility=5.1






<?php /*################################################## * 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. * ###################################################*/ /** * @author Votre Nom <votre e-mail> */ class NomModuleComments extends AbstractCommentsExtensionPoint { public function __construct() { parent::__construct('nommodule'); } } ?>
// A supprimer dans la déclaration des constantes const COMMENTS_ENABLED = 'comments_enable'; // // // A supprimer dans la déclaration des méthodes public function enable_comments() { $this->set_property(self::COMMENTS_ENABLED, true); } public function disable_comments() { $this->set_property(self::COMMENTS_ENABLED, false); } public function are_comments_enabled() { return $this->get_property(self::COMMENTS_ENABLED); } // // // A supprimer dans public function get_default_values() { return array ( self::COMMENTS_ENABLED => true,

// A supprimer dans la déclaration des champs $fieldset->add_field(new FormFieldCheckbox('comments_enabled', $this->admin_common_lang['config.comments_enabled'], $this->config->are_comments_enabled())); // // // A supprimer dans private function save() if ($this->form->get_value('comments_enabled')) { $this->config->enable_comments(); } else { $this->config->disable_comments(); }
<?php /*################################################## * 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. * ###################################################*/ /** * @author Votre Nom <votre e-mail> */ class NomModuleNotation extends AbstractNotationExtensionPoint { public function __construct() { parent::__construct('nommodule'); } } ?>
public function notation() { return new NomModuleNotation(); }
// A supprimer dans la déclaration des constantes const NOTATION_ENABLED = 'notation_enabled'; const NOTATION_SCALE = 'notation_scale'; // // // A supprimer dans la déclaration des méthodes public function enable_notation() { $this->set_property(self::NOTATION_ENABLED, true); } public function disable_notation() { $this->set_property(self::NOTATION_ENABLED, false); } public function is_notation_enabled() { return $this->get_property(self::NOTATION_ENABLED); } public function get_notation_scale() { return $this->get_property(self::NOTATION_SCALE); } public function set_notation_scale($notation_scale) { $this->set_property(self::NOTATION_SCALE, $notation_scale); } // // A supprimer dans public function get_default_values() { return array ( self::NOTATION_ENABLED => true, self::NOTATION_SCALE => 5,

// A supprimer dans public function execute(HTTPRequestCustom $request) $this->form->get_field_by_id('notation_scale')->set_hidden(!$this->config->is_notation_enabled()); // // // A supprimer dans la déclaration des champs $fieldset->add_field(new FormFieldCheckbox('notation_enabled', $this->admin_common_lang['config.notation_enabled'], $this->config->is_notation_enabled(), array( 'events' => array('click' => ' if (HTMLForms.getField("notation_enabled").getValue()) { HTMLForms.getField("notation_scale").enable(); } else { HTMLForms.getField("notation_scale").disable(); }' ) ))); // // // A supprimer dans private function save() if ($this->form->get_value('notation_enabled')) { $this->config->enable_notation(); $this->config->set_notation_scale($this->form->get_value('notation_scale')); if ($this->form->get_value('notation_scale') != $this->config->get_notation_scale()) NotationService::update_notation_scale('nommodule', $this->config->get_notation_scale(), $this->form->get_value('notation_scale')); } else $this->config->disable_notation();
// A supprimer dans la déclaration des attributs et des constantes private $notation_enabled; // // const NOTATION_DISABLED = 0; const NOTATION_ENABLED = 1; // // public function get_notation_enabled() { return $this->notation_enabled; } public function set_notation_enabled($enabled) { $this->notation_enabled = $enabled; } // A supprimer dans public function get_properties() { return array( 'notation_enabled' => $this->get_notation_enabled(), // // // A supprimer dans public function set_properties(array $properties) { $this->set_notation_enabled($properties['notation_enabled']); // Dans la même méthode, ajouter sous $notation = new Notation(); $notation_config = new NomModuleNotation(); // // //A supprimer dans public function init_default_properties($id_category = Category::ROOT_CATEGORY) $this->notation_enabled = self::NOTATION_ENABLED; // // // Dans public function get_array_tpl_vars() , ajouter : $notation_config = new NomModuleNotation(); // Et dans return array( modifier : 'C_NOTATION_ENABLED' => $this->get_notation_enabled(), // par 'C_NOTATION_ENABLED' => $notation_config->is_notation_enabled(),
<?php /*################################################## * 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. * ###################################################*/ /** * @author Votre Nom <votre e-mail> */ class NomModuleNewContent extends AbstractNewContentExtensionPoint { public function __construct() { parent::__construct('nommodule'); } } ?>
public function newcontent() { return new NomModuleNewContent(); }
$new_content = new NomModuleContent();
'C_NEW_CONTENT' => $new_content->check_if_is_new_content($this->publishing_start_date != null ? $this->publishing_start_date->get_timestamp() : $this->get_date_created()->get_timestamp()) && $this->is_published(),
public function get_array_tpl_vars() { $category = $this->get_category(); $contents = FormatingHelper::second_parse($this->contents); $description = $this->get_real_description(); $user = $this->get_author_user(); $user_group_color = User::get_group_color($user->get_groups(), $user->get_level(), true); $sources = $this->get_sources(); $new_content = new ArticlesNewContent(); $notation_config = new ArticlesNotation(); //Conditions 'C_EDIT' => $this->is_authorized_to_edit(), 'C_DELETE' => $this->is_authorized_to_delete(), 'C_HAS_PICTURE' => $this->has_picture(), 'C_PUBLISHED' => $this->is_published(), 'C_PUBLISHING_START_AND_END_DATE' => $this->publishing_start_date != null && $this->publishing_end_date != null, 'C_PUBLISHING_START_DATE' => $this->publishing_start_date != null, 'C_PUBLISHING_END_DATE' => $this->publishing_end_date != null, 'C_DATE_UPDATED' => $this->date_updated != null, 'C_AUTHOR_DISPLAYED' => $this->get_author_name_displayed(), 'C_AUTHOR_CUSTOM_NAME' => $this->is_author_custom_name_enabled(), 'C_NOTATION_ENABLED' => $notation_config->is_notation_enabled(), 'C_READ_MORE' => !$this->get_description_enabled() && TextHelper::strlen($contents) > ArticlesConfig::load()->get_number_character_to_cut() && $description != @strip_tags($contents, '<br><br/>'), 'C_SOURCES' => $nbr_sources > 0, 'C_DIFFERED' => $this->published == self::PUBLISHED_DATE, 'C_NEW_CONTENT' => $new_content->check_if_is_new_content($this->publishing_start_date != null ? $this->publishing_start_date->get_timestamp() : $this->get_date_created()->get_timestamp()) && $this->is_published(),
'C_NEW_CONTENT' => $new_content->check_if_is_new_content($this->publishing_start_date != null ? $this->publishing_start_date->get_timestamp() : $this->get_date_created()->get_timestamp()) && $this->is_published(),
'C_NEW_CONTENT' => $new_content->check_if_is_new_content($this->get_creation_date()->get_timestamp()),
<div class="content elements-container# IF C_SEVERAL_COLUMNS # columns-{NUMBER_COLUMNS}# ENDIF#"> # START articles # <article id="article-articles-{articles.ID}" class="article-articles article-several# IF C_MOSAIC # block# ENDIF ## IF articles.C_NEW_CONTENT # new-content# ENDIF #" itemscope="itemscope" itemtype="http://schema.org/CreativeWork">

if (ArticlesService::get_categories_manager()->get_categories_cache()->has_categories()) { ......}
$search_category_children_options = new SearchCategoryChildrensOptions(); $search_category_children_options->add_authorizations_bits(Category::CONTRIBUTION_AUTHORIZATIONS); $search_category_children_options->add_authorizations_bits(Category::WRITE_AUTHORIZATIONS); $fieldset->add_field(ArticlesService::get_categories_manager()->get_select_categories_form_field('id_category', $this->common_lang['form.category'], $this->get_article()->get_id_category(), $search_category_children_options));
private function build_form(HTTPRequestCustom $request) { . . . if (ArticlesService::get_categories_manager()->get_categories_cache()->has_categories()) { $search_category_children_options = new SearchCategoryChildrensOptions(); $search_category_children_options->add_authorizations_bits(Category::CONTRIBUTION_AUTHORIZATIONS); $search_category_children_options->add_authorizations_bits(Category::WRITE_AUTHORIZATIONS); $fieldset->add_field(ArticlesService::get_categories_manager()->get_select_categories_form_field('id_category', $this->common_lang['form.category'], $this->get_article()->get_id_category(), $search_category_children_options)); } . . . . private function save() { $article = $this->get_article(); $article->set_title($this->form->get_value('title')); if (ArticlesService::get_categories_manager()->get_categories_cache()->has_categories()) $article->set_id_category($this->form->get_value('id_category')->get_raw_value()); . . .