Deux erreurs dans la page principale d'administration du module:
Message(s): Undefined index: desc dans le fichier /Frameworks/moduleclasses/moduleadmin/moduleadmin.php - ligne 118
Message(s): Undefined index: desc dans le fichier /Frameworks/moduleclasses/moduleadmin/moduleadmin.php - ligne 118
Il faut modifier le fichier /admin/menu.php pour les corriger (variable de description obligatoires pour les liens) et le fichier de langue. Au passage j'en ai profité pour supprimer les liens en dur (pour faciliter le clonage éventuel du module) et rajouté la gestion de la langue anglaise par défaut si le répertoire de langue n'existe pas. Au total 3 fichiers à modifier:
1- /admin/menu.php
<?php
/**
* Created by JetBrains PhpStorm.
* User: Mamba
* Date: 1/25/12
* Time: 7:04 AM
* To change this template use File | Settings | File Templates.
*/
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
//hack slider84
global $xoopsConfig;
$path = dirname(dirname(dirname(dirname(__FILE__))));
include_once $path . '/mainfile.php';
$dirname = basename(dirname(dirname(__FILE__)));
$module_handler = xoops_gethandler('module');
$module = $module_handler->getByDirname($dirname);
$pathIcon32 = $module->getInfo('icons32'); //Frameworks/moduleclasses/icons/32
$pathModuleAdmin = $module->getInfo('dirmoduleadmin');
$pathLanguage = $path . "/" .$pathModuleAdmin;
if (!file_exists($fileinc = $pathLanguage . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/' . 'main.php')) {
$fileinc = $pathLanguage . '/language/english/main.php';
}
include_once $fileinc;
//end hack
$adminmenu = array();
$i = 1;
$adminmenu[$i]["title"] = _MI_WAITING_MENU_HOME;
$adminmenu[$i]["desc"] = _MI_WAITING_MENU_HOME_DESC; //slider84
$adminmenu[$i]["link"] = 'admin/index.php';
$adminmenu[$i]["icon"] = $pathIcon32.'/home.png';
$i++;
$adminmenu[$i]["title"] = _MI_WAITING_MENU_PLUGINS;
$adminmenu[$i]["desc"] = _MI_WAITING_MENU_PLUGINS_DESC; //slider84
$adminmenu[$i]["link"] = 'admin/main.php';
$adminmenu[$i]["icon"] = $pathIcon32.'/search.png';
$i++;
$adminmenu[$i]["title"] = _MI_WAITING_MENU_ABOUT;
$adminmenu[$i]["desc"] = _MI_WAITING_MENU_ABOUT_DESC; //slider84
$adminmenu[$i]["link"] = 'admin/about.php';
$adminmenu[$i]["icon"] = $pathIcon32.'/about.png';
2- /language/french/modinfo.php
<?php
// $Id: modinfo.php,v 1.3 2005/04/06 06:04:11 gij Exp $
// FILE :: modinfo.php
// AUTHOR :: Ryuji AMANO <info@joetsu.info>
// WEB :: Ryu's Planning <http://ryus.joetsu.info/>
//
// The name of this module
define('_MI_WAITING_NAME',"Contenus en attente");
// A brief description of this module
define('_MI_WAITING_DESC',"Affichage d'un bloc contenus en attente pour les modules en fonctionnement");
// Names of blocks for this module (Not all module has blocks)
define('_MI_WAITING_BNAME1',"En attente");
define('_MI_WAITING_MENU_HOME',"Accueil");
define('_MI_WAITING_MENU_HOME_DESC',"Page d'accueil");//slider84
define('_MI_WAITING_MENU_ABOUT',"À propos");
define('_MI_WAITING_MENU_ABOUT_DESC',"À propos de ce module");//slider84
define('_MI_WAITING_MENU_PLUGINS',"Plugins");
define('_MI_WAITING_MENU_PLUGINS_DESC',"Liste des plugins");//slider84
3- xoopsversion.php
<?php
// $Id: xoops_version.php,v 1.7 2005/04/23 10:07:12 gij Exp $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
// <http://www.xoops.org/> ... nbsp; //
// ------------------------------------------------------------------------ //
// 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. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
// Author: Kazumi Ono (AKA onokazu) //
// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
// Project: The XOOPS Project //
// ------------------------------------------------------------------------- //
$module_dirname = basename( dirname( __FILE__ ) ) ; //slider84
$modversion['name'] = _MI_WAITING_NAME;
$modversion['version'] = 0.97;
$modversion['description'] = _MI_WAITING_DESC;
$modversion['author'] = "Ryuji (http://ryus.co.jp/)";
$modversion['author_website_url'] = "http://ryus.co.jp";
$modversion['credits'] = "Ryus";
$modversion['help'] = 'page=help';
$modversion['license'] = 'GNU GPL 2.0';
$modversion['license_url'] = "www.gnu.org/licenses/gpl-2.0.html/";
$modversion['official'] = 0;
//hack slider84
//$modversion['image'] = "images/waiting_slogo.png";
//$modversion['dirname'] = "waiting";
$modversion["dirname"] = $module_dirname;
$modversion["image"] = "images/".$module_dirname."_slogo.png";
//end hack
$modversion['dirmoduleadmin'] = '/Frameworks/moduleclasses/moduleadmin';
$modversion['icons16'] = '../../Frameworks/moduleclasses/icons/16';
$modversion['icons32'] = '../../Frameworks/moduleclasses/icons/32';
//about
$modversion['release_date'] = '2013/04/25';
$modversion["module_website_url"] = "www.xoops.org/";
$modversion["module_website_name"] = "XOOPS";
$modversion["module_status"] = "Beta 1";
$modversion['min_php']='5.2';
$modversion['min_xoops']="2.5.5";
$modversion['min_admin']='1.1';
$modversion['min_db']= array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7');
// Admin things
$modversion['hasAdmin'] = 1;
$modversion['system_menu'] = 1;
$modversion['adminmenu'] = "admin/menu.php";
$modversion['adminindex'] = "admin/index.php";
// Templates
// Blocks
$modversion['blocks'][1]['file'] = "waiting_waiting.php";
$modversion['blocks'][1]['name'] = _MI_WAITING_BNAME1;
$modversion['blocks'][1]['description'] = "Shows contents waiting for approval";
$modversion['blocks'][1]['show_func'] = "b_waiting_waiting_show";
$modversion['blocks'][1]['edit_func'] = "b_waiting_waiting_edit";
$modversion['blocks'][1]['template'] = 'waiting_block_waiting.html';
$modversion['blocks'][1]['options'] = '1|5';
// On Update
if( ! empty( $_POST['fct'] ) && ! empty( $_POST['op'] ) && $_POST['fct'] == 'modulesadmin' && $_POST['op'] == 'update_ok' && $_POST['dirname'] == $modversion['dirname'] ) {
include dirname( __FILE__ ) . "/include/updateblock.inc.php" ;
}
?>
Fichiers modifiés joints
J'ai une petite idée d'évolution pour ce ce module... surprise !!!
Attacher un fichier:
waiting_097b_slider84.zip Taille: 4.06 KB; Hits: 177