From: <txm...@us...> - 2012-02-07 15:08:24
|
Revision: 8895 http://xoops.svn.sourceforge.net/xoops/?rev=8895&view=rev Author: txmodxoops Date: 2012-02-07 15:08:09 +0000 (Tue, 07 Feb 2012) Log Message: ----------- Added Paths: ----------- XoopsModules/txmeteo/ XoopsModules/txmeteo/branches/ XoopsModules/txmeteo/release/ XoopsModules/txmeteo/release/txmeteo 1.0/ XoopsModules/txmeteo/release/txmeteo 1.0/admin/ XoopsModules/txmeteo/release/txmeteo 1.0/admin/about.php XoopsModules/txmeteo/release/txmeteo 1.0/admin/admin_header.php XoopsModules/txmeteo/release/txmeteo 1.0/admin/index.html XoopsModules/txmeteo/release/txmeteo 1.0/admin/index.php XoopsModules/txmeteo/release/txmeteo 1.0/admin/menu.php XoopsModules/txmeteo/release/txmeteo 1.0/admin/permissions.php XoopsModules/txmeteo/release/txmeteo 1.0/admin/topic.php XoopsModules/txmeteo/release/txmeteo 1.0/blocks/ XoopsModules/txmeteo/release/txmeteo 1.0/blocks/index.html XoopsModules/txmeteo/release/txmeteo 1.0/class/ XoopsModules/txmeteo/release/txmeteo 1.0/class/index.html XoopsModules/txmeteo/release/txmeteo 1.0/class/menu.php XoopsModules/txmeteo/release/txmeteo 1.0/class/object.php XoopsModules/txmeteo/release/txmeteo 1.0/class/topic.php XoopsModules/txmeteo/release/txmeteo 1.0/images/ XoopsModules/txmeteo/release/txmeteo 1.0/images/TDMLogo.png XoopsModules/txmeteo/release/txmeteo 1.0/images/deco/ XoopsModules/txmeteo/release/txmeteo 1.0/images/deco/about.png XoopsModules/txmeteo/release/txmeteo 1.0/images/deco/arrow.gif XoopsModules/txmeteo/release/txmeteo 1.0/images/deco/delete.gif XoopsModules/txmeteo/release/txmeteo 1.0/images/deco/edit.gif XoopsModules/txmeteo/release/txmeteo 1.0/images/deco/index.html XoopsModules/txmeteo/release/txmeteo 1.0/images/deco/index.png XoopsModules/txmeteo/release/txmeteo 1.0/images/deco/off.gif XoopsModules/txmeteo/release/txmeteo 1.0/images/deco/on.gif XoopsModules/txmeteo/release/txmeteo 1.0/images/deco/permissions.png XoopsModules/txmeteo/release/txmeteo 1.0/images/deco/pref.png XoopsModules/txmeteo/release/txmeteo 1.0/images/deco/topic.png XoopsModules/txmeteo/release/txmeteo 1.0/images/deco/update.png XoopsModules/txmeteo/release/txmeteo 1.0/images/index.html XoopsModules/txmeteo/release/txmeteo 1.0/images/menu/ XoopsModules/txmeteo/release/txmeteo 1.0/images/menu/bg.png XoopsModules/txmeteo/release/txmeteo 1.0/images/menu/index.html XoopsModules/txmeteo/release/txmeteo 1.0/images/menu/left_both.png XoopsModules/txmeteo/release/txmeteo 1.0/images/menu/right_both.png XoopsModules/txmeteo/release/txmeteo 1.0/include/ XoopsModules/txmeteo/release/txmeteo 1.0/include/functions.php XoopsModules/txmeteo/release/txmeteo 1.0/include/index.html XoopsModules/txmeteo/release/txmeteo 1.0/include/install.php XoopsModules/txmeteo/release/txmeteo 1.0/index.php XoopsModules/txmeteo/release/txmeteo 1.0/language/ XoopsModules/txmeteo/release/txmeteo 1.0/language/english/ XoopsModules/txmeteo/release/txmeteo 1.0/language/english/admin.php XoopsModules/txmeteo/release/txmeteo 1.0/language/english/blocks.php XoopsModules/txmeteo/release/txmeteo 1.0/language/english/index.html XoopsModules/txmeteo/release/txmeteo 1.0/language/english/main.php XoopsModules/txmeteo/release/txmeteo 1.0/language/english/modinfo.php XoopsModules/txmeteo/release/txmeteo 1.0/language/french/ XoopsModules/txmeteo/release/txmeteo 1.0/language/french/admin.php XoopsModules/txmeteo/release/txmeteo 1.0/language/french/blocks.php XoopsModules/txmeteo/release/txmeteo 1.0/language/french/index.html XoopsModules/txmeteo/release/txmeteo 1.0/language/french/main.php XoopsModules/txmeteo/release/txmeteo 1.0/language/french/modinfo.php XoopsModules/txmeteo/release/txmeteo 1.0/language/index.html XoopsModules/txmeteo/release/txmeteo 1.0/language/italian/ XoopsModules/txmeteo/release/txmeteo 1.0/language/italian/admin.php XoopsModules/txmeteo/release/txmeteo 1.0/language/italian/blocks.php XoopsModules/txmeteo/release/txmeteo 1.0/language/italian/index.html XoopsModules/txmeteo/release/txmeteo 1.0/language/italian/main.php XoopsModules/txmeteo/release/txmeteo 1.0/language/italian/modinfo.php XoopsModules/txmeteo/release/txmeteo 1.0/sql/ XoopsModules/txmeteo/release/txmeteo 1.0/sql/index.html XoopsModules/txmeteo/release/txmeteo 1.0/sql/mysql.sql XoopsModules/txmeteo/release/txmeteo 1.0/templates/ XoopsModules/txmeteo/release/txmeteo 1.0/templates/blocks/ XoopsModules/txmeteo/release/txmeteo 1.0/templates/blocks/index.html XoopsModules/txmeteo/release/txmeteo 1.0/templates/index.html XoopsModules/txmeteo/release/txmeteo 1.0/xoops_version.php XoopsModules/txmeteo/trunk/ Added: XoopsModules/txmeteo/release/txmeteo 1.0/admin/about.php =================================================================== --- XoopsModules/txmeteo/release/txmeteo 1.0/admin/about.php (rev 0) +++ XoopsModules/txmeteo/release/txmeteo 1.0/admin/about.php 2012-02-07 15:08:09 UTC (rev 8895) @@ -0,0 +1,118 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * txmeteo - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) timgno (http://txmod.webuda.com) + * + * 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. + * + * @copyright timgno (http://txmod.webuda.com) + * @license GPL + * @package txmeteo + * @author timgno (http://txmod.webuda.com) + * + * Version : 1.00: + * **************************************************************************** + */ + +include_once("admin_header.php"); + +xoops_cp_header(); + +if ( !is_readable(XOOPS_ROOT_PATH."/Frameworks/art/functions.admin.php")) { +txmeteo_adminmenu(3, _AM_TXMETEO_MANAGER_ABOUT); + +echo "<style> +.CPbigTitle{ + font-size: 20px; + color: #1E90FF; + background: no-repeat left top; + font-weight: bold; + height: 40px; + vertical-align: middle; + padding: 10px 0 0 50px; + border-bottom: 3px solid #1E90FF; +} +</style>"; +} else { +include_once XOOPS_ROOT_PATH."/Frameworks/art/functions.admin.php"; +loadModuleAdminMenu (3, _AM_TXMETEO_MANAGER_ABOUT); +} + +//menu +echo "<div class=\"CPbigTitle\" style=\"background-image: url(../images/deco/about.png); background-repeat: no-repeat; background-position: left; padding-left: 50px;\"><strong>"._AM_TXMETEO_MANAGER_ABOUT."</strong> +</div><br />"; + +$versioninfo =& $module_handler->get( $xoopsModule->getVar("mid") ); + +echo "<style type=\"text/css\"> + label,text { + display: block; + float: left; + margin-bottom: 2px; + } + label { + text-align: right; + width: 150px; + padding-right: 20px; + } + br { + clear: left; + } + </style> + + <fieldset> + <legend style=\"font-weight: bold; color: #900;\">".$xoopsModule->getVar("name")."</legend> + <div style=\"padding: 8px;\"> + <img src=\"".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/".$versioninfo->getInfo("image")."\" alt=\"\" hspace=\"10\" vspace=\"0\" /></a>\n + <div style=\"padding: 5px;\"><strong>".$versioninfo->getInfo("name")." version ".$versioninfo->getInfo("version")."</strong></div>\n + <label>"._AM_TXMETEO_ABOUT_RELEASEDATE.":</label><text>".$versioninfo->getInfo("release")."</text><br /> + <label>"._AM_TXMETEO_ABOUT_AUTHOR.":</label><text>".$versioninfo->getInfo("author")."</text><br /> + <label>"._AM_TXMETEO_ABOUT_CREDITS.":</label><text>".$versioninfo->getInfo("credits")."</text><br /> + <label>"._AM_TXMETEO_ABOUT_LICENSE.":</label><text><a href=\"".$versioninfo->getInfo("license_file")."\" target=\"_blank\" >".$versioninfo->getInfo("license")."</a></text>\n + </div> + </fieldset> +<br clear=\"all\"/> + + <fieldset> + <legend style=\"font-weight: bold; color: #900;\">"._AM_TXMETEO_ABOUT_MODULE_INFO."</legend> + <div style=\"padding: 8px;\"> + <label>"._AM_TXMETEO_ABOUT_MODULE_STATUS.":</label><text>".$versioninfo->getInfo("module_status")."</text><br /> + <label>"._AM_TXMETEO_ABOUT_WEBSITE.":</label><text><a href=\"".$versioninfo->getInfo("module_website_url")."\" target=\"_blank\">".$versioninfo->getInfo("module_website_name")."</a></text><br /> + </div> + </fieldset> +<br clear=\"all\" /> + + <fieldset> + <legend style=\"font-weight: bold; color: #900;\">"._AM_TXMETEO_ABOUT_AUTHOR_INFO."</legend> + <div style=\"padding: 8px;\"> + <label>"._AM_TXMETEO_ABOUT_AUTHOR_NAME.":</label><text>".$versioninfo->getInfo("author")."</text><br /> + <label>"._AM_TXMETEO_ABOUT_WEBSITE.":</label><text><a href=\"".$versioninfo->getInfo("author_website_url")."\" target=\"_blank\">".$versioninfo->getInfo("author_website_name")."</a></text><br /> + </div> + </fieldset> +<br clear=\"all\" />"; + +$file = XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/changelog.txt"; + +if ( is_readable( $file ) ){ +echo "<fieldset> + <legend style=\"font-weight: bold; color: #900;\">"._AM_TXMETEO_ABOUT_CHANGELOG."</legend> + <div style=\"padding: 8px;\"> + <div>".implode("<br />", file( $file ))."</div> + </div> + </fieldset> + <br clear=\"all\" />"; + +} +echo "<br /><br /> +<div align=\"center\"><a href=\"http://www.tdmxoops.net\" target=\"_blank\"><img src=\"http://www.tdmxoops.net/images/logo_modules.gif\" alt=\"TDM\" title=\"TDM\"></a></div> +"; +xoops_cp_footer(); +?> \ No newline at end of file Added: XoopsModules/txmeteo/release/txmeteo 1.0/admin/admin_header.php =================================================================== --- XoopsModules/txmeteo/release/txmeteo 1.0/admin/admin_header.php (rev 0) +++ XoopsModules/txmeteo/release/txmeteo 1.0/admin/admin_header.php 2012-02-07 15:08:09 UTC (rev 8895) @@ -0,0 +1,110 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * txmeteo - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) timgno (http://txmod.webuda.com) + * + * 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. + * + * @copyright timgno (http://txmod.webuda.com) + * @license GPL + * @package txmeteo + * @author timgno (http://txmod.webuda.com) + * + * Version : 1.00: + * **************************************************************************** + */ + +include "../../../include/cp_header.php"; + +include_once(XOOPS_ROOT_PATH."/class/xoopsmodule.php"); +include_once XOOPS_ROOT_PATH."/class/xoopstree.php"; +include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; +include_once XOOPS_ROOT_PATH."/class/tree.php"; +include_once XOOPS_ROOT_PATH."/class/xoopslists.php"; +include_once XOOPS_ROOT_PATH."/class/pagenav.php"; +include_once XOOPS_ROOT_PATH."/class/xoopstopic.php"; +include_once XOOPS_ROOT_PATH."/class/xoopsform/grouppermform.php"; +include_once("../include/functions.php"); + +$myts =& MyTextSanitizer::getInstance(); +include_once XOOPS_ROOT_PATH."/modules/txmeteo/class/topic.php"; + +if ( $xoopsUser ) { + $xoopsModule = XoopsModule::getByDirname("txmeteo"); + if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) { + redirect_header(XOOPS_URL."/",3,_NOPERM); + exit(); + } +} else { + redirect_header(XOOPS_URL."/",3,_NOPERM); + exit(); +} + +// Include language file +xoops_loadLanguage("admin", "system"); +xoops_loadLanguage("admin", $xoopsModule->getVar("dirname", "e")); +xoops_loadLanguage("modinfo", $xoopsModule->getVar("dirname", "e")); + +function txmeteo_adminmenu ($currentoption = 0, $breadcrumb = "") +{ + global $xoopsModule, $xoopsConfig; + + echo " + <style type=\"text/css\"> + #buttontop { float:left; width:100%; background: #e7e7e7; font-size:93%; line-height:normal; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; margin: 0; } + #buttonbar { float:left; width:100%; background: #e7e7e7 url(".XOOPS_URL."/modules/txmeteo/images/menu/bg.png) repeat-x left bottom; font-size:93%; line-height:normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 12px; } + #buttonbar ul { margin:0; margin-top: 15px; padding:10px 10px 0; list-style:none; } + #buttonbar li { display:inline; margin:0; padding:0; } + #buttonbar a { float:left; background:url(".XOOPS_URL."/modules/txmeteo/images/deco/left_both.png) no-repeat left top; margin:0; padding:0 0 0 9px; border-bottom:1px solid #000; text-decoration:none; } + #buttonbar a span { float:left; display:block; background:url(".XOOPS_URL."/modules/txmeteo/images/deco/right_both.png) no-repeat right top; padding:5px 15px 4px 6px; font-weight:bold; color:#765; } + #buttonbar a span {float:none;} + #buttonbar a:hover span { color:#333; } + #buttonbar #current a { background-position:0 -150px; border-width:0; } + #buttonbar #current a span { background-position:100% -150px; padding-bottom:5px; color:#333; } + #buttonbar a:hover { background-position:0% -150px; } + #buttonbar a:hover span { background-position:100% -150px; } + </style> + "; + + $tblColors = Array(); + $tblColors[0] = $tblColors[1] = $tblColors[2] = $tblColors[3] = $tblColors[4] = $tblColors[5] = $tblColors[6] = $tblColors[7] = $tblColors[8] = ""; + $tblColors[$currentoption] = "current"; + if (file_exists("".XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/".$xoopsConfig["language"]."/modinfo.php")) { + include_once("".XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/".$xoopsConfig["language"]."/modinfo.php"); + } else { + include_once("".XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/english/modinfo.php"); + } + + echo "<div id=\"buttontop\"> + <table style=\"width: 100%; padding: 0;\" cellspacing=\"0\"> + <tr> + <td style=\"font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;\"> + <a class=\"nobutton\" href=\"".XOOPS_URL."/modules/system/admin.php?fct=preferences&op=showmod&mod=".$myts->displayTarea($xoopsModule->getVar("mid"))."\">_AM_TXMETEO_GENERALSET</a> + | <a href=\"".XOOPS_URL."/modules/txmeteo/index.php\">_AM_TXMETEO_GOINDEX</a> + | <a href=\"".XOOPS_URL."/modules/txmeteo/admin/upgrade.php\">_AM_TXMETEO_UPGRADE</a> + </td> + <td style=\"font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;\"><b>".$myts->displayTarea($xoopsModule->name())."</b></td> + </tr> + </table> + </div> + + <div id=\"buttonbar\"> + <ul><li id=\"$tblColors[0]\"><a href=\"".XOOPS_URL."/modules/txmeteo/admin/index.php\"><span>_MI_TXMETEO_MANAGER_INDEX</span></a></li> + <li id=\"$tblColors[1]\"><a href=\"".XOOPS_URL."/modules/txmeteo/admin/topic.php\"><span>_MI_TXMETEO_MANAGER_TOPIC</span></a></li> + + <li id=\"$tblColors[2]\"><a href=\"".XOOPS_URL."/modules/txmeteo/admin/permissions.php\"><span>_MI_TXMETEO_MANAGER_PERMISSIONS</span></a></li> + <li id=\"$tblColors[3]\"><a href=\"".XOOPS_URL."/modules/txmeteo/admin/about.php\"><span>_MI_TXMETEO_MANAGER_ABOUT</span></a></li> + </ul></div>"; +} + +$topicHandler =& xoops_getModuleHandler("txmeteo_topic", "txmeteo"); + +?> \ No newline at end of file Added: XoopsModules/txmeteo/release/txmeteo 1.0/admin/index.html =================================================================== --- XoopsModules/txmeteo/release/txmeteo 1.0/admin/index.html (rev 0) +++ XoopsModules/txmeteo/release/txmeteo 1.0/admin/index.html 2012-02-07 15:08:09 UTC (rev 8895) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/txmeteo/release/txmeteo 1.0/admin/index.php =================================================================== --- XoopsModules/txmeteo/release/txmeteo 1.0/admin/index.php (rev 0) +++ XoopsModules/txmeteo/release/txmeteo 1.0/admin/index.php 2012-02-07 15:08:09 UTC (rev 8895) @@ -0,0 +1,78 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * txmeteo - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) timgno (http://txmod.webuda.com) + * + * 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. + * + * @copyright timgno (http://txmod.webuda.com) + * @license GPL + * @package txmeteo + * @author timgno (http://txmod.webuda.com) + * + * Version : 1.00: + * **************************************************************************** + */ + +include_once("admin_header.php"); + +xoops_cp_header(); + +global $xoopsModule; + +//Apelle du menu admin +if ( !is_readable(XOOPS_ROOT_PATH."/Frameworks/art/functions.admin.php")) { +txmeteo_adminmenu(0, _AM_TXMETEO_MANAGER_INDEX); +} else { +include_once XOOPS_ROOT_PATH."/Frameworks/art/functions.admin.php"; +loadModuleAdminMenu (0, _AM_TXMETEO_MANAGER_INDEX); +} + + //compte "total" + $count_topic = $topicHandler->getCount(); + //compte "attente" + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria("topic_online", 1)); + $topic_online = $topicHandler->getCount($criteria); + +include_once XOOPS_ROOT_PATH."/modules/txmeteo/class/menu.php"; + + $menu = new txmeteoMenu(); + $menu->addItem("topic", "topic.php", "../images/deco/topic.png", _AM_TXMETEO_MANAGER_TOPIC); + $menu->addItem("update", "../../system/admin.php?fct=modulesadmin&op=update&module=txmeteo", "../images/deco/update.png", _AM_TXMETEO_MANAGER_UPDATE); + $menu->addItem("permissions", "permissions.php", "../images/deco/permissions.png", _AM_TXMETEO_MANAGER_PERMISSIONS); + $menu->addItem("preference", "../../system/admin.php?fct=preferences&op=showmod&mod=".$xoopsModule->getVar("mid"). + "&&confcat_id=1", "../images/deco/pref.png", _AM_TXMETEO_MANAGER_PREFERENCES); + $menu->addItem("about", "about.php", "../images/deco/about.png", _AM_TXMETEO_MANAGER_ABOUT); + + echo $menu->getCSS(); + + +echo "<div class=\"CPbigTitle\" style=\"background-image: url(../images/deco/index.png); background-repeat: no-repeat; background-position: left; padding-left: 50px;\"><strong>"._AM_TXMETEO_MANAGER_INDEX."</strong></div><br /> + <table width=\"100%\" border=\"0\" cellspacing=\"10\" cellpadding=\"4\"> + <tr> + <td valign=\"top\">".$menu->render()."</td> + <td valign=\"top\" width=\"60%\">"; + + echo "<fieldset> + <legend class=\"CPmediumTitle\">"._AM_TXMETEO_MANAGER_TOPIC."</legend> + <br />"; + printf(_AM_TXMETEO_THEREARE_TOPIC, $count_topic); + echo "<br /><br />"; + printf(_AM_TXMETEO_THEREARE_TOPIC_ONLINE, $topic_online); + echo "<br /> + </fieldset><br /><br />"; + echo "</td></tr></table>"; +include_once("admin_footer.php"); + +xoops_cp_footer(); + +?> \ No newline at end of file Added: XoopsModules/txmeteo/release/txmeteo 1.0/admin/menu.php =================================================================== --- XoopsModules/txmeteo/release/txmeteo 1.0/admin/menu.php (rev 0) +++ XoopsModules/txmeteo/release/txmeteo 1.0/admin/menu.php 2012-02-07 15:08:09 UTC (rev 8895) @@ -0,0 +1,36 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * txmeteo - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) timgno (http://txmod.webuda.com) + * + * 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. + * + * @copyright timgno (http://txmod.webuda.com) + * @license GPL + * @package txmeteo + * @author timgno (http://txmod.webuda.com) + * + * Version : 1.00: + * **************************************************************************** + */ + +$adminmenu = array(); +$adminmenu[0]["title"] = _MI_TXMETEO_MANAGER_INDEX; +$adminmenu[0]["link"] = "admin/index.php"; +$adminmenu[1]["title"] = _MI_TXMETEO_MANAGER_TOPIC; +$adminmenu[1]["link"] = "admin/topic.php"; +$adminmenu[2]["title"] = _MI_TXMETEO_MANAGER_PERMISSIONS; +$adminmenu[2]["link"] = "admin/permissions.php"; + +$adminmenu[3]["title"] = _MI_TXMETEO_MANAGER_ABOUT; +$adminmenu[3]["link"] = "admin/about.php"; + +?> \ No newline at end of file Added: XoopsModules/txmeteo/release/txmeteo 1.0/admin/permissions.php =================================================================== --- XoopsModules/txmeteo/release/txmeteo 1.0/admin/permissions.php (rev 0) +++ XoopsModules/txmeteo/release/txmeteo 1.0/admin/permissions.php 2012-02-07 15:08:09 UTC (rev 8895) @@ -0,0 +1,97 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * txmeteo - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) timgno (http://txmod.webuda.com) + * + * 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. + * + * @copyright timgno (http://txmod.webuda.com) + * @license GPL + * @package txmeteo + * @author timgno (http://txmod.webuda.com) + * + * Version : 1.00: + * **************************************************************************** + */ + +include("admin_header.php"); + +if( !empty($_POST["submit"]) ) +{ + redirect_header( XOOPS_URL."/modules/".$xoopsModule->dirname()."/admin/permissions.php" , 1 , _MP_GPERMUPDATED ); +} + +xoops_cp_header(); + +global $xoopsDB; + +if ( !is_readable(XOOPS_ROOT_PATH . "/Frameworks/art/functions.admin.php")) { +txmeteo_adminmenu(2,_AM_TXMETEO_MANAGER_PERMISSIONS); +} else { +include_once XOOPS_ROOT_PATH."/Frameworks/art/functions.admin.php"; +loadModuleAdminMenu (2,_AM_TXMETEO_MANAGER_PERMISSIONS); +} + +//menu +echo "<div class=\"CPbigTitle\" style=\"background-image: url(../images/deco/permissions.png); background-repeat: no-repeat; background-position: left; padding-left: 50px;\"> + <strong>"._AM_TXMETEO_MANAGER_PERMISSIONS."</strong> + </div><br />"; + + $permtoset= isset($_POST["permtoset"]) ? intval($_POST["permtoset"]) : 1; + $selected=array("","",""); + $selected[$permtoset-1]=" selected"; + +echo " +<form method=\"post\" name=\"fselperm\" action=\"permissions.php\"> + <table border=0> + <tr> + <td> + <select name=\"permtoset\" onChange=\"javascript: document.fselperm.submit()\"> + <option value=\"1\"".$selected[0].">"._AM_TXMETEO_PERMISSIONS_ACCESS."</option> + <option value=\"2\"".$selected[1].">"._AM_TXMETEO_PERMISSIONS_SUBMIT."</option> + </select> + </td> + </tr> + </table> +</form>"; + +$module_id = $xoopsModule->getVar("mid"); + + switch($permtoset) + { + case 1: + $title_of_form = _AM_TXMETEO_PERMISSIONS_ACCESS; + $perm_name = "txmeteo_access"; + $perm_desc = ""; + break; + case 2: + $title_of_form = _AM_TXMETEO_PERMISSIONS_SUBMIT; + $perm_name = "txmeteo_submit"; + $perm_desc = ""; + break; + } + + $permform = new XoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc, "admin/permissions.php"); + $xt = new XoopsTopic( $xoopsDB -> prefix("txmeteo_topic") ); + $alltopics =& $xt->getTopicsList(); + + foreach ($alltopics as $topic_id => $topic) + { + $permform->addItem($topic_id, $topic["title"], $topic["pid"]); + } + echo $permform->render(); + echo "<br /><br /><br /><br />\n"; + unset ($permform); + +echo "<br /><br /> +<div align=\"center\"><a href=\"http://www.tdmxoops.net\" target=\"_blank\"><img src=\"http://www.tdmxoops.net/images/logo_modules.gif\" alt=\"TDM\" title=\"TDM\"></a></div> +"; +?> \ No newline at end of file Added: XoopsModules/txmeteo/release/txmeteo 1.0/admin/topic.php =================================================================== --- XoopsModules/txmeteo/release/txmeteo 1.0/admin/topic.php (rev 0) +++ XoopsModules/txmeteo/release/txmeteo 1.0/admin/topic.php 2012-02-07 15:08:09 UTC (rev 8895) @@ -0,0 +1,257 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * txmeteo - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) timgno (http://txmod.webuda.com) + * + * 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. + * + * @copyright timgno (http://txmod.webuda.com) + * @license GPL + * @package txmeteo + * @author timgno (http://txmod.webuda.com) + * + * Version : 1.00: + * **************************************************************************** + */ + +include_once("admin_header.php"); + +xoops_cp_header(); + +if (isset($_REQUEST["op"])) { + $op = $_REQUEST["op"]; +} else { + @$op = "show_list_topic"; +} + +//Menu admin +if ( !is_readable(XOOPS_ROOT_PATH . "/Frameworks/art/functions.admin.php") ) { +txmeteo_adminmenu(1, _AM_TXMETEO_MANAGER_TOPIC); +} else { +include_once XOOPS_ROOT_PATH."/Frameworks/art/functions.admin.php"; +loadModuleAdminMenu (1, _AM_TXMETEO_MANAGER_TOPIC); +} + +//Sous menu +echo "<div class=\"CPbigTitle\" style=\"background-image: url(../images/deco/topic.png); background-repeat: no-repeat; background-position: left; padding-left: 50px;\"> + <strong>"._AM_TXMETEO_MANAGER_TOPIC."</strong> + </div><br /><br>"; +switch ($op) +{ + case "save_topic": + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("topic.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if (isset($_REQUEST["topic_id"])) { + $obj =& $topicHandler->get($_REQUEST["topic_id"]); + } else { + $obj =& $topicHandler->create(); + } + + //Form topic_pid + $obj->setVar("topic_pid", $_REQUEST["topic_pid"]); + //Form topic_title + $obj->setVar("topic_title", $_REQUEST["topic_title"]); + //Form topic_desc + $obj->setVar("topic_desc", $_REQUEST["topic_desc"]); + //Form topic_img + include_once XOOPS_ROOT_PATH."/class/uploader.php"; + $uploaddir_topic_img = XOOPS_ROOT_PATH."/uploads/txmeteo/topic/topic_img/"; + $uploader_topic_img = new XoopsMediaUploader($uploaddir_topic_img, $xoopsModuleConfig["topic_img_mimetypes"], $xoopsModuleConfig["topic_img_size"], null, null); + + if ($uploader_topic_img->fetchMedia("topic_img")) { + $uploader_topic_img->setPrefix("topic_img_") ; + $uploader_topic_img->fetchMedia("topic_img"); + if (!$uploader_topic_img->upload()) { + $errors = $uploader_topic_img->getErrors(); + redirect_header("javascript:history.go(-1)",3, $errors); + } else { + $obj->setVar("topic_img", $uploader_topic_img->getSavedFileName()); + } + } else { + $obj->setVar("topic_img", $_REQUEST["topic_img"]); + } + //Form topic_weight + $obj->setVar("topic_weight", $_REQUEST["topic_weight"]); + //Form topic_color + $obj->setVar("topic_color", $_REQUEST["topic_color"]); + //Form topic_submitter + $obj->setVar("topic_submitter", $_REQUEST["topic_submitter"]); + //Form topic_date_created + $obj->setVar("topic_date_created", strtotime($_REQUEST["topic_date_created"])); + //Form topic_online + $verif_topic_online = ($_REQUEST["topic_online"] == 1) ? "1" : "0"; + $obj->setVar("topic_online", $verif_topic_online); + + + if ($topicHandler->insert($obj)) { + redirect_header("topic.php?op=show_list_topic", 2, _AM_TXMETEO_FORMOK); + } + //include_once("../include/forms.php"); + echo $obj->getHtmlErrors(); + $form =& $obj->getForm(); + break; + + case "edit_topic": + $obj = $topicHandler->get($_REQUEST["topic_id"]); + $form = $obj->getForm(); + break; + + case "delete_topic": + $obj =& $topicHandler->get($_REQUEST["topic_id"]); + if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("topic.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if ($topicHandler->delete($obj)) { + redirect_header("topic.php", 3, _AM_TXMETEO_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array("ok" => 1, "topic_id" => $_REQUEST["topic_id"], "op" => "delete_topic"), $_SERVER["REQUEST_URI"], sprintf(_AM_TXMETEO_FORMSUREDEL, $obj->getVar("topic"))); + } + break; + + case "update_online_topic": + + if (isset($_REQUEST["topic_id"])) { + $obj =& $topicHandler->get($_REQUEST["topic_id"]); + } + $obj->setVar("topic_online", $_REQUEST["topic_online"]); + + if ($topicHandler->insert($obj)) { + redirect_header("topic.php", 3, _AM_TXMETEO_FORMOK); + } + echo $obj->getHtmlErrors(); + + break; + + case "default": + default: + + $criteria = new CriteriaCompo(); + $criteria->setSort("topic_id"); + $criteria->setOrder("ASC"); + $numrows = $topicHandler->getCount(); + $topic_arr = $topicHandler->getall($criteria); + + //Fonction qui permet afficher les cat\xE9gories enfants + function txmeteo_display_children($topic_id = 0, $topic_arr, $prefix = "", $order = "", &$class) + { + $topicHandler =& xoops_getModuleHandler("txmeteo_topic", "txmeteo"); + $prefix = $prefix."<img src=\"".XOOPS_URL."/modules/txmeteo/images/deco/arrow.gif\">"; + foreach (array_keys($topic_arr) as $i) + { + $topic_id = $topic_arr[$i]->getVar("topic_id"); + $topic_img = $topic_arr[$i]->getVar("topic_img"); + $topic_title = $topic_arr[$i]->getVar("topic_title"); + $topic_weight = $topic_arr[$i]->getVar("topic_weight"); + echo "<tr class=\"".$class."\">"; + echo "<td align=\"left\">".$prefix." ".$topic_arr[$i]->getVar("topic_title")."</td>"; + echo "<td align=\"center\"><img src=\"".XOOPS_URL."/uploads/txmeteo/topic/topic_img/".$topic_arr[$i]->getVar("topic_img")."\" height=\"30px\" title=\"topic_img\" alt=\"topic_img\"></td>"; + echo "<td align=\"center\">".$topic_arr[$i]->getVar("topic_weight")."</td>"; + echo "<td align=\"center\"><span style=\"background-color:".$topic_arr[$i]->getVar("topic_color")."\"> </span> -> ".$topic_arr[$i]->getVar("topic_color")."</td>"; + + $online = $topic_arr[$i]->getVar("topic_online"); + + if( $online == 1 ) { + echo "<td align=\"center\"><a href=\"./topic.php?op=update_online_topic&topic_id=".$topic_arr[$i]->getVar("topic_id")."&topic_online=0\"><img src=\"./../images/deco/on.gif\" border=\"0\" alt=\""._AM_TXMETEO_ON."\" title=\""._AM_TXMETEO_ON."\"></a></td>"; + } else { + echo "<td align=\"center\"><a href=\"./topic.php?op=update_online_topic&topic_id=".$topic_arr[$i]->getVar("topic_id")."&topic_online=1\"><img src=\"./../images/deco/off.gif\" border=\"0\" alt=\""._AM_TXMETEO_OFF."\" title=\""._AM_TXMETEO_OFF."\"></a></td>"; + } + echo "<td align=\"center\" width=\"10%\"> + <a href=\"topic.php?op=edit_topic&topic_id=".$topic_arr[$i]->getVar("topic_id")."\"><img src=\"../images/deco/edit.gif\" alt=\""._AM_TXMETEO_EDIT."\" title=\""._AM_TXMETEO_EDIT."\"></a> + <a href=\"topic.php?op=delete_topic&topic_id=".$topic_arr[$i]->getVar("topic_id")."\"><img src=\"../images/deco/delete.gif\" alt=\""._AM_TXMETEO_DELETE."\" title=\""._AM_TXMETEO_DELETE."\"></a> + </td> + </tr>"; + $class = ($class == "even") ? "odd" : "even"; + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria("topic_pid", $topic_arr[$i]->getVar("topic_id"))); + $criteria->setSort("topic_title"); + $criteria->setOrder("ASC"); + $topic_pid = $topicHandler->getall($criteria); + $num_pid = $topicHandler->getCount(); + if ( $num_pid != 0 ) + { + txmeteo_display_children($topic_id, $topic_pid, $prefix, $order, $class); + } + } + } + + //Affichage du tableau + if ($numrows>0) + { + echo "<table width=\"100%\" cellspacing=\"1\" class=\"outer\"> + <tr> + <th align=\"center\">"._AM_TXMETEO_TOPIC_TITLE."</th> + <th align=\"center\">"._AM_TXMETEO_TOPIC_IMG."</th> + <th align=\"center\">"._AM_TXMETEO_TOPIC_WEIGHT."</th> + <th align=\"center\">"._AM_TXMETEO_TOPIC_COLOR."</th> + <th align=\"center\">"._AM_TXMETEO_TOPIC_ONLINE."</th> + + <th align=\"center\" width=\"10%\">"._AM_TXMETEO_FORMACTION."</th> + </tr>"; + $class = "odd"; + $prefix = "<img src=\"".XOOPS_URL."/modules/txmeteo/images/deco/arrow.gif\">"; + foreach (array_keys($topic_arr) as $i) + { + if ( $topic_arr[$i]->getVar("topic_pid") == 0 ) + { + $topic_id = $topic_arr[$i]->getVar("topic_id"); + $topic_img = $topic_arr[$i]->getVar("topic_img"); + $topic_title = $topic_arr[$i]->getVar("topic_title"); + $topic_weight = $topic_arr[$i]->getVar("topic_weight"); + echo "<tr class=\"".$class."\">"; + echo "<td align=\"left\">".$prefix." ".$topic_arr[$i]->getVar("topic_title")."</td>"; + echo "<td align=\"center\"><img src=\"".XOOPS_URL."/uploads/txmeteo/topic/topic_img/".$topic_arr[$i]->getVar("topic_img")."\" height=\"30px\" title=\"topic_img\" alt=\"topic_img\"></td>"; + echo "<td align=\"center\">".$topic_arr[$i]->getVar("topic_weight")."</td>"; + echo "<td align=\"center\"><span style=\"background-color:".$topic_arr[$i]->getVar("topic_color")."\"> </span> -> ".$topic_arr[$i]->getVar("topic_color")."</td>"; + + $online = $topic_arr[$i]->getVar("topic_online"); + + if( $online == 1 ) { + echo "<td align=\"center\"><a href=\"./topic.php?op=update_online_topic&topic_id=".$topic_arr[$i]->getVar("topic_id")."&topic_online=0\"><img src=\"./../images/deco/on.gif\" border=\"0\" alt=\""._AM_TXMETEO_ON."\" title=\""._AM_TXMETEO_ON."\"></a></td>"; + } else { + echo "<td align=\"center\"><a href=\"./topic.php?op=update_online_topic&topic_id=".$topic_arr[$i]->getVar("topic_id")."&topic_online=1\"><img src=\"./../images/deco/off.gif\" border=\"0\" alt=\""._AM_TXMETEO_OFF."\" title=\""._AM_TXMETEO_OFF."\"></a></td>"; + } + echo "<td align=\"center\" width=\"10%\"> + <a href=\"topic.php?op=edit_topic&topic_id=".$topic_arr[$i]->getVar("topic_id")."\"><img src=\"../images/deco/edit.gif\" alt=\""._AM_TXMETEO_EDIT."\" title=\""._AM_TXMETEO_EDIT."\"></a> + <a href=\"topic.php?op=delete_topic&topic_id=".$topic_arr[$i]->getVar("topic_id")."\"><img src=\"../images/deco/delete.gif\" alt=\""._AM_TXMETEO_DELETE."\" title=\""._AM_TXMETEO_DELETE."\"></a> + </td> + </tr>"; + $class = ($class == "even") ? "odd" : "even"; + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria("topic_pid", $topic_id)); + $criteria->setSort("topic_title"); + $criteria->setOrder("ASC"); + $topic_pid = $topicHandler->getall($criteria); + $num_pid = $topicHandler->getCount(); + + if ( $num_pid != 0) + { + txmeteo_display_children($topic_id, $topic_pid, $prefix, "topic_title", $class); + } + } + } + echo "</table><br><br>"; + } + + // Affichage du formulaire + $obj =& $topicHandler->create(); + $form = $obj->getForm(); +} +echo "<br /><br /> +<div align=\"center\"><a href=\"http://www.tdmxoops.net\" target=\"_blank\"><img src=\"http://www.tdmxoops.net/images/logo_modules.gif\" alt=\"TDM\" title=\"TDM\"></a></div> +"; +xoops_cp_footer(); + +?> \ No newline at end of file Added: XoopsModules/txmeteo/release/txmeteo 1.0/blocks/index.html =================================================================== --- XoopsModules/txmeteo/release/txmeteo 1.0/blocks/index.html (rev 0) +++ XoopsModules/txmeteo/release/txmeteo 1.0/blocks/index.html 2012-02-07 15:08:09 UTC (rev 8895) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/txmeteo/release/txmeteo 1.0/class/index.html =================================================================== --- XoopsModules/txmeteo/release/txmeteo 1.0/class/index.html (rev 0) +++ XoopsModules/txmeteo/release/txmeteo 1.0/class/index.html 2012-02-07 15:08:09 UTC (rev 8895) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/txmeteo/release/txmeteo 1.0/class/menu.php =================================================================== --- XoopsModules/txmeteo/release/txmeteo 1.0/class/menu.php (rev 0) +++ XoopsModules/txmeteo/release/txmeteo 1.0/class/menu.php 2012-02-07 15:08:09 UTC (rev 8895) @@ -0,0 +1,175 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * txmeteo - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) timgno (http://txmod.webuda.com) + * + * 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. + * + * @copyright timgno (http://txmod.webuda.com) + * @license GPL + * @package txmeteo + * @author timgno (http://txmod.webuda.com) + * + * Version : 1.00: + * **************************************************************************** + */ + +class txmeteoMenu +{ + public $Width = 100; + public $Height = 100; + public $BgColor = "transparent"; + public $OverBgColor = "#FFF6C1"; + public $BorderWidth = 1; + public $BorderColor = "#CCCCCC"; + public $OverBorderColor = "#FF9900"; + public $BorderStyle = "solid"; + public $OverBorderStyle = "solid"; + public $Font = "Tahoma, Arial, Helvetica"; + public $FontColor = "#666666"; + public $OverFontColor = "#1E90FF"; + public $FontDeco = "none"; + public $OverFontDeco = "none"; + public $FontSize = 11; + public $FontWeight = "bold"; + public $FontExtra = "Tahoma, Arial, Helvetica"; + public $FontExtraColor = "#A98952"; + public $OverFontExtraColor = "#0033FF"; + public $FontExtraDeco = "underline"; + public $OverFontExtraDeco = "underline"; + public $FontExtraSize = 9; + public $FontExtraWeight = "normal"; + public $TextAlign = "center"; + private $_items = array(); + + public function addItem($id, $link="", $icon="", $name="", $extra="", $alt=""){ + if (isset($this->_items[$id])) return false; + $rtn["link"] = $link; + $rtn["icon"] = $icon; + $rtn["name"] = $name; + $rtn["extra"] = $extra; + $rtn["alt"] = $alt; + $this->_items[$id] = $rtn; + return true; + } + + public function setLink($id, $link){ + if (isset($this->_items[$id])){ + $this->_items[$id]["link"] = $link; + return true; + } else { + return false; + } + } + + public function setIcon($id, $icon){ + if (isset($this->_items[$id])){ + $this->_items[$id]["icon"] = $icon; + return true; + } else { + return false; + } + } + + public function setName($id, $name){ + if (isset($this->_items[$id])){ + $this->_items[$id]["name"] = $name; + return true; + } else { + return false; + } + } + + public function setExtra($id, $extra){ + if (isset($this->_items[$id])){ + $this->_items[$id]["extra"] = $extra; + return true; + } else { + return false; + } + } + + public function setAlt($id, $alt){ + if (isset($this->_items[$id])){ + $this->_items[$id]["alt"] = $alt; + return true; + } else { + return false; + } + } + + public function getCSS($ws = true){ + if ($ws) $csscode = "<style type=\"text/css\">\n<!--"; + $csscode .= "div.rmmenuicon{ + margin: 3px; + font-family: $this->Font; + text-align: ".$this->TextAlign."; + } + div.rmmenuicon a { + display: block; float: left; + height: ".$this->Height."px !important; + height: ".$this->Height."px; + width: ".$this->Width."px !important; + width: ".$this->Width."px; + vertical-align: middle; + text-decoration : none; + border: ".$this->BorderWidth."px $this->BorderStyle $this->BorderColor; + padding: 2px 5px 1px 5px; + margin: 3px; + color: $this->FontColor; + } + div.rmmenuicon img { margin-top: 8px; margin-bottom: 8px; } + div.rmmenuicon a span { + font-size: ".$this->FontSize."px; + font-weight: $this->FontWeight; + display: block; + } + div.rmmenuicon a span.uno{ + font-size: ".$this->FontExtraSize."px; + font-weight: $this->FontExtraWeight; + text-decoration: $this->FontExtraDeco; + color: $this->FontExtraColor; + } + div.rmmenuicon a:hover{ + background-color: $this->OverBgColor; + border: ".$this->BorderWidth."px $this->BorderStyle $this->OverBorderColor; + color: $this->OverFontColor; + } + div.rmmenuicon a:hover span{ + text-decoration: $this->OverFontDeco; + } + div.rmmenuicon a:hover span.uno{ + text-decoration: $this->OverFontExtraDeco; + color: $this->OverFontExtraColor; + }"; + if ($ws) $csscode .= "\n-->\n</style>"; + return $csscode; + } + + public function render(){ + + $ret = "<div class=\"rmmenuicon\">"; + foreach ($this->_items as $k => $v){ + $ret .= "<a href=\"".$v["link"]."\" title=\"".($v["alt"]!="" ? $v["alt"] : $v["name"])."\">".($v["icon"]!="" ? "<img src=\"".$v["icon"]."\" alt=\"".$v["name"]."\" /> " : ""); + if ($v["name"] != "") $ret .= "<span>".$v["name"]."</span>"; + if ($v["extra"] != "") $ret .= "<span class=\"uno\">".$v["extra"]."</span>"; + if ($v["extra"] != "") $ret .= "<span class=\"uno\">".$v["extra"]."</span>"; + $ret .= "</a>"; + } + $ret .= "</div><div style=\"clear: both;\"></div>"; + return $ret; + } + + public function display(){ + echo $this->render(); + } +} +?> \ No newline at end of file Added: XoopsModules/txmeteo/release/txmeteo 1.0/class/object.php =================================================================== --- XoopsModules/txmeteo/release/txmeteo 1.0/class/object.php (rev 0) +++ XoopsModules/txmeteo/release/txmeteo 1.0/class/object.php 2012-02-07 15:08:09 UTC (rev 8895) @@ -0,0 +1,412 @@ +<?php +/** + * **************************************************************************** + * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS + * - Licence GPL Copyright (c) (http://www.tdmxoops.net) + * + * Cette licence, contient des limitations!!! + * + * 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. + * + * @license TDM GPL license + * @author TDM TEAM DEV MODULE + * + * **************************************************************************** + */ + +class XoopsPersistableObjectHandler extends XoopsObjectHandler{ + + /** + * Information about the class, the handler is managing + * + * @var string + */ + var $table; + var $keyName; + var $className; + var $identifierName; + + + /** + * Constructor - called from child classes + * @param object $db {@link XoopsDatabase} object + * @param string $tablename Name of database table + * @param string $classname Name of Class, this handler is managing + * @param string $keyname Name of the property, holding the key + * + * @return void + */ + function XoopsPersistableObjectHandler(&$db, $tablename, $classname, $keyname, $idenfierName = false) { + $this->XoopsObjectHandler($db); + $this->table = $db->prefix($tablename); + $this->keyName = $keyname; + $this->className = $classname; + if ($idenfierName != false) { + $this->identifierName = $idenfierName; + } + } + + /** + * create a new user + * + * @param bool $isNew Flag the new objects as "new"? + * + * @return object + */ + function &create($isNew = true) { + $obj =& new $this->className(); + if ($isNew === true) { + $obj->setNew(); + } + return $obj; + } + + /** + * retrieve an object + * + * @param mixed $id ID of the object - or array of ids for joint keys. Joint keys MUST be given in the same order as in the constructor + * @param bool $as_object whether to return an object or an array + * @return mixed reference to the object, FALSE if failed + */ + function &get($id, $as_object=true) { + if (is_array($this->keyName)) { + $criteria = new CriteriaCompo(); + for ($i = 0; $i < count($this->keyName); $i++) { + $criteria->add(new Criteria($this->keyName[$i], intval($id[$i]))); + } + } else { + $criteria = new Criteria($this->keyName, intval($id)); + } + $criteria->setLimit(1); + $obj_array = $this->getObjects($criteria, false, $as_object); + if (count($obj_array) != 1) { + $obj = $this->create(); + return $obj; + } + return $obj_array[0]; + } + + /** + * retrieve objects from the database + * + * @param object $criteria {@link CriteriaElement} conditions to be met + * @param bool $id_as_key use the ID as key for the array? + * @param bool $as_object return an array of objects? + * + * @return array + */ + function getObjects($criteria=null, $id_as_key=false, $as_object=true){ + $ret = array(); + $limit = $start = 0; + $sql = 'SELECT * FROM '.$this->table; + if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { + $sql .= ' '.$criteria->renderWhere(); + if ($criteria->getSort() != '') { + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); + } + $limit = $criteria->getLimit(); + $start = $criteria->getStart(); + } + $result = $this->db->query($sql, $limit, $start); + if (!$result) { + return $ret; + } + return $this->convertResultSet($result, $id_as_key, $as_object); + } + + /** + * Convert a database resultset to a returnable array + * + * @param object $result database resultset + * @param bool $id_as_key - should NOT be used with joint keys + * @param bool $as_object + * + * @return array + */ + function convertResultSet($result, $id_as_key = false, $as_object = true) { + $ret = array(); + while ($myrow = $this->db->fetchArray($result)) { + $obj =& $this->create(false); + $obj->assignVars($myrow); + if (!$id_as_key) { + if ($as_object) { + $ret[] =& $obj; + } else { + $row = array(); + $vars = $obj->getVars(); + foreach (array_keys($vars) as $i) { + $row[$i] = $obj->getVar($i); + } + $ret[] = $row; + } + } else { + if ($as_object) { + $ret[$myrow[$this->keyName]] =& $obj; + } else { + $row = array(); + $vars = $obj->getVars(); + foreach (array_keys($vars) as $i) { + $row[$i] = $obj->getVar($i); + } + $ret[$myrow[$this->keyName]] = $row; + } + } + unset($obj); + } + return $ret; + } + + /** + * Retrieve a list of objects as arrays - DON'T USE WITH JOINT KEYS + * + * @param object $criteria {@link CriteriaElement} conditions to be met + * @param int $limit Max number of objects to fetch + * @param int $start Which record to start at + * + * @return array + */ + function getList($criteria = null, $limit = 0, $start = 0) { + $ret = array(); + if ($criteria == null) { + $criteria = new CriteriaCompo(); + } + + if ($criteria->getSort() == '') { + $criteria->setSort($this->identifierName); + } + + $sql = 'SELECT '.$this->keyName; + if(!empty($this->identifierName)){ + $sql .= ', '.$this->identifierName; + } + $sql .= ' FROM '.$this->table; + if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { + $sql .= ' '.$criteria->renderWhere(); + if ($criteria->getSort() != '') { + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); + } + $limit = $criteria->getLimit(); + $start = $criteria->getStart(); + } + $result = $this->db->query($sql, $limit, $start); + if (!$result) { + return $ret; + } + $myts =& MyTextSanitizer::getInstance(); + while ($myrow = $this->db->fetchArray($result)) { + //identifiers should be textboxes, so sanitize them like that + $ret[$myrow[$this->keyName]] = empty($this->identifierName)?1:$myts->htmlSpecialChars($myrow[$this->identifierName]); + } + return $ret; + } + + /** + * count objects matching a condition + * + * @param object $criteria {@link CriteriaElement} to match + * @return int count of objects + */ + function getCount($criteria=null){ + $field = ""; + $groupby = false; + if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { + if ($criteria->groupby != "") { + $groupby = true; + $field = $criteria->groupby.", "; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used + } + } + $sql = 'SELECT '.$field.'COUNT(*) FROM '.$this->table; + if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { + $sql .= ' '.$criteria->renderWhere(); + if ($criteria->groupby != "") { + $sql .= $criteria->getGroupby(); + } + } + $result = $this->db->query($sql); + if (!$result) { + return 0; + } + if ($groupby == false) { + list($count) = $this->db->fetchRow($result); + return $count; + } else { + $ret = array(); + while (list($id, $count) = $this->db->fetchRow($result)) { + $ret[$id] = $count; + } + return $ret; + } + } + + /** + * delete an object from the database + * + * @param object $obj reference to the object to delete + * @param bool $force + * @return bool FALSE if failed. + */ + function delete(&$obj, $force = false){ + if (is_array($this->keyName)) { + $clause = array(); + for ($i = 0; $i < count($this->keyName); $i++) { + $clause[] = $this->keyName[$i]." = ".$obj->getVar($this->keyName[$i]); + } + $whereclause = implode(" AND ", $clause); + } else { + $whereclause = $this->keyName." = ".$obj->getVar($this->keyName); + } + $sql = "DELETE FROM ".$this->table." WHERE ".$whereclause; + if (false != $force) { + $result = $this->db->queryF($sql); + } else { + $result = $this->db->query($sql); + } + if (!$result) { + return false; + } + return true; + } + + /** + * insert a new object in the database + * + * @param object $obj reference to the object + * @param bool $force whether to force the query execution despite security settings + * @param bool $checkObject check if the object is dirty and clean the attributes + * @return bool FALSE if failed, TRUE if already present and unchanged or successful + */ + + function insert(&$obj, $force=false, $checkObject=true){ + if ($checkObject != false) { + if (!is_object($obj)) { + var_dump($obj); + return false; + } + /** + * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 + */ + if (!is_a($obj, $this->className)) { + $obj->setErrors(get_class($obj)." Differs from ".$this->className); + return false; + } + if (!$obj->isDirty()) { + $obj->setErrors("Not dirty"); //will usually not be outputted as errors are not displayed when the method returns true, but it can be helpful when troubleshooting code - Mith + return true; + } + } + if (!$obj->cleanVars()) { + return false; + } + + foreach ($obj->cleanVars as $k => $v) { + if ($obj->vars[$k]['data_type'] == XOBJ_DTYPE_INT) { + $cleanvars[$k] = intval($v); + } elseif ( is_array( $v ) ) { + $cleanvars[ $k ] = $this->db->quoteString( implode( ',', $v ) ); + } else { + $cleanvars[$k] = $this->db->quoteString($v); + } + } + if ($obj->isNew()) { + if (!is_array($this->keyName)) { + if ($cleanvars[$this->keyName] < 1) { + $cleanvars[$this->keyName] = $this->db->genId($this->table.'_'.$this->keyName.'_seq'); + } + } + $sql = "INSERT INTO ".$this->table." (".implode(',', array_keys($cleanvars)).") VALUES (".implode(',', array_values($cleanvars)) .")"; + } else { + $sql = "UPDATE ".$this->table." SET"; + foreach ($cleanvars as $key => $value) { + if ((!is_array($this->keyName) && $key == $this->keyName) || (is_array($this->keyName) && in_array($key, $this->keyName))) { + continue; + } + if (isset($notfirst) ) { + $sql .= ","; + } + $sql .= " ".$key." = ".$value; + $notfirst = true; + } + if (is_array($this->keyName)) { + $whereclause = ""; + for ($i = 0; $i < count($this->keyName); $i++) { + if ($i > 0) { + $whereclause .= " AND "; + } + $whereclause .= $this->keyName[$i]." = ".$obj->getVar($this->keyName[$i]); + } + } else { + $whereclause = $this->keyName." = ".$obj->getVar($this->keyName); + } + $sql .= " WHERE ".$whereclause; + } + if (false != $force) { + $result = $this->db->queryF($sql); + } else { + $result = $this->db->query($sql); + } + if (!$result) { + return false; + } + if ($obj->isNew() && !is_array($this->keyName)) { + $obj->assignVar($this->keyName, $this->db->getInsertId()); + } + return true; + } + + /** + * Change a value for objects with a certain criteria + * + * @param string $fieldname Name of the field + * @param string $fieldvalue Value to write + * @param object $criteria {@link CriteriaElement} + * @return bool + */ + function updateAll($fieldname, $fieldvalue, $criteria = null, $force = false){ + $set_clause = $fieldname . ' = '; + if ( is_numeric( $fieldvalue ) ) { + $set_clause .= $fieldvalue; + } elseif ( is_array( $fieldvalue ) ) { + $set_clause .= $this->db->quoteString( implode( ',', $fieldvalue ) ); + } else { + $set_clause .= $this->db->quoteString( $fieldvalue ); + } + $sql = 'UPDATE '.$this->table.' SET '.$set_clause; + if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { + $sql .= ' '.$criteria->renderWhere(); + } + if (false != $force) { + $result = $this->db->queryF($sql); + } else { + $result = $this->db->query($sql); + } + if (!$result) { + return false; + } + return true; + } + + /** + * delete all objects meeting the conditions + * + * @param object $criteria {@link CriteriaElement} with conditions to meet + * @return bool + */ + function deleteAll($criteria = null){ + if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { + $sql = 'DELETE FROM '.$this->table; + $sql .= ' '.$criteria->renderWhere(); + if (!$this->db->queryF($sql)) { + return false; + } + $rows = $this->db->getAffectedRows(); + return $rows > 0 ? $rows : true; + } + return false; + } +} +?> \ No newline at end of file Added: XoopsModules/txmeteo/release/txmeteo 1.0/class/topic.php =================================================================== --- XoopsModules/txmeteo/release/txmeteo 1.0/class/topic.php (rev 0) +++ XoopsModules/txmeteo/release/txmeteo 1.0/class/topic.php 2012-02-07 15:08:09 UTC (rev 8895) @@ -0,0 +1,128 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * txmeteo - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) timgno (http://txmod.webuda.com) + * + * 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. + * + * @copyright timgno (http://txmod.webuda.com) + * @license GPL + * @package txmeteo + * @author timgno (http://txmod.webuda.com) + * + * Version : 1.00: + * **************************************************************************** + */ + + + if (!defined("XOOPS_ROOT_PATH")) { + die("XOOPS root path not defined"); + } + + if (!class_exists("XoopsPersistableObjectHandler")) { + include_once XOOPS_ROOT_PATH."/class/xoopsobject.php"; + } + + class txmeteo_topic extends XoopsObject + { + //Constructor + function __construct() + { + $this->XoopsObject(); + $this->initVar("topic_id",XOBJ_DTYPE_INT,null,false,11); + $this->initVar("topic_pid",XOBJ_DTYPE_INT,null,false,5); + $this->initVar("topic_title",XOBJ_DTYPE_TXTBOX,null,false); + $this->initVar("topic_desc",XOBJ_DTYPE_TXTAREA, null, false); + $this->initVar("topic_img",XOBJ_DTYPE_TXTBOX,null,false); + $this->initVar("topic_weight",XOBJ_DTYPE_INT,null,false,5); + $this->initVar("topic_color",XOBJ_DTYPE_TXTBOX,null,false); + $this->initVar("topic_submitter",XOBJ_DTYPE_INT,null,false,10); + $this->initVar("topic_date_created",XOBJ_DTYPE_INT,null,false,10); + $this->initVar("topic_online",XOBJ_DTYPE_INT,null,... [truncated message content] |