From: <txm...@us...> - 2012-02-15 12:58:02
|
Revision: 8990 http://xoops.svn.sourceforge.net/xoops/?rev=8990&view=rev Author: txmodxoops Date: 2012-02-15 12:57:49 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Module imprint v1.01 Added Paths: ----------- XoopsModules/imprint/ XoopsModules/imprint/branches/ XoopsModules/imprint/releases/ XoopsModules/imprint/releases/1.01/ XoopsModules/imprint/releases/1.01/imprint/ XoopsModules/imprint/releases/1.01/imprint/admin/ XoopsModules/imprint/releases/1.01/imprint/admin/about.php XoopsModules/imprint/releases/1.01/imprint/admin/header.php XoopsModules/imprint/releases/1.01/imprint/admin/imp.php XoopsModules/imprint/releases/1.01/imprint/admin/index.html XoopsModules/imprint/releases/1.01/imprint/admin/index.php XoopsModules/imprint/releases/1.01/imprint/admin/menu.php XoopsModules/imprint/releases/1.01/imprint/blocks/ XoopsModules/imprint/releases/1.01/imprint/blocks/index.html XoopsModules/imprint/releases/1.01/imprint/changelog.txt XoopsModules/imprint/releases/1.01/imprint/class/ XoopsModules/imprint/releases/1.01/imprint/class/imp.php XoopsModules/imprint/releases/1.01/imprint/class/index.html XoopsModules/imprint/releases/1.01/imprint/class/menu.php XoopsModules/imprint/releases/1.01/imprint/class/object.php XoopsModules/imprint/releases/1.01/imprint/header.php XoopsModules/imprint/releases/1.01/imprint/images/ XoopsModules/imprint/releases/1.01/imprint/images/deco/ XoopsModules/imprint/releases/1.01/imprint/images/deco/about.png XoopsModules/imprint/releases/1.01/imprint/images/deco/arrow.gif XoopsModules/imprint/releases/1.01/imprint/images/deco/delete.gif XoopsModules/imprint/releases/1.01/imprint/images/deco/edit.gif XoopsModules/imprint/releases/1.01/imprint/images/deco/imp_search.png XoopsModules/imprint/releases/1.01/imprint/images/deco/index.html XoopsModules/imprint/releases/1.01/imprint/images/deco/index.png XoopsModules/imprint/releases/1.01/imprint/images/deco/off.gif XoopsModules/imprint/releases/1.01/imprint/images/deco/on.gif XoopsModules/imprint/releases/1.01/imprint/images/deco/permissions.png XoopsModules/imprint/releases/1.01/imprint/images/deco/pref.png XoopsModules/imprint/releases/1.01/imprint/images/deco/topic.png XoopsModules/imprint/releases/1.01/imprint/images/deco/update.png XoopsModules/imprint/releases/1.01/imprint/images/imprint_slogo.png XoopsModules/imprint/releases/1.01/imprint/images/index.html XoopsModules/imprint/releases/1.01/imprint/images/menu/ XoopsModules/imprint/releases/1.01/imprint/images/menu/bg.png XoopsModules/imprint/releases/1.01/imprint/images/menu/index.html XoopsModules/imprint/releases/1.01/imprint/images/menu/left_both.png XoopsModules/imprint/releases/1.01/imprint/images/menu/right_both.png XoopsModules/imprint/releases/1.01/imprint/images/society_logo.png XoopsModules/imprint/releases/1.01/imprint/images/txmod_logo.png XoopsModules/imprint/releases/1.01/imprint/include/ XoopsModules/imprint/releases/1.01/imprint/include/configs.php XoopsModules/imprint/releases/1.01/imprint/include/functions.php XoopsModules/imprint/releases/1.01/imprint/include/index.html XoopsModules/imprint/releases/1.01/imprint/include/install.php XoopsModules/imprint/releases/1.01/imprint/include/search.inc.php XoopsModules/imprint/releases/1.01/imprint/include/style.css XoopsModules/imprint/releases/1.01/imprint/index.php XoopsModules/imprint/releases/1.01/imprint/language/ XoopsModules/imprint/releases/1.01/imprint/language/index.html XoopsModules/imprint/releases/1.01/imprint/language/italian/ XoopsModules/imprint/releases/1.01/imprint/language/italian/admin.php XoopsModules/imprint/releases/1.01/imprint/language/italian/blocks.php XoopsModules/imprint/releases/1.01/imprint/language/italian/index.html XoopsModules/imprint/releases/1.01/imprint/language/italian/main.php XoopsModules/imprint/releases/1.01/imprint/language/italian/modinfo.php XoopsModules/imprint/releases/1.01/imprint/readme.txt XoopsModules/imprint/releases/1.01/imprint/sql/ XoopsModules/imprint/releases/1.01/imprint/sql/index.html XoopsModules/imprint/releases/1.01/imprint/sql/mysql.sql XoopsModules/imprint/releases/1.01/imprint/templates/ XoopsModules/imprint/releases/1.01/imprint/templates/blocks/ XoopsModules/imprint/releases/1.01/imprint/templates/blocks/index.html XoopsModules/imprint/releases/1.01/imprint/templates/imprint_footer.html XoopsModules/imprint/releases/1.01/imprint/templates/imprint_header.html XoopsModules/imprint/releases/1.01/imprint/templates/imprint_index.html XoopsModules/imprint/releases/1.01/imprint/templates/index.html XoopsModules/imprint/releases/1.01/imprint/xoops_version.php XoopsModules/imprint/trunk/ Added: XoopsModules/imprint/releases/1.01/imprint/admin/about.php =================================================================== --- XoopsModules/imprint/releases/1.01/imprint/admin/about.php (rev 0) +++ XoopsModules/imprint/releases/1.01/imprint/admin/about.php 2012-02-15 12:57:49 UTC (rev 8990) @@ -0,0 +1,110 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * imprint - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) TXMod Xoops (http://www.txmodxoops.org) + * + * 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 TXMod Xoops (http://www.txmodxoops.org) + * @license GNU GPL + * @package imprint + * @author TXMod Xoops (http://www.txmodxoops.org) + * + * Version : 1.00: + * **************************************************************************** + */ + +include_once("./header.php"); + +xoops_cp_header(); + +if ( !is_readable(XOOPS_ROOT_PATH."/Frameworks/art/functions.admin.php")) { +imprint_adminmenu(2, _AM_IMPRINT_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 (2, _AM_IMPRINT_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; height: 48px;\"><strong>"._AM_IMPRINT_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_IMPRINT_ABOUT_RELEASEDATE.":</label><text>".$versioninfo->getInfo("release")."</text><br /> + <label>"._AM_IMPRINT_ABOUT_AUTHOR.":</label><text>".$versioninfo->getInfo("author")."</text><br /> + <label>"._AM_IMPRINT_ABOUT_CREDITS.":</label><text>".$versioninfo->getInfo("credits")."</text><br /> + <label>"._AM_IMPRINT_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_IMPRINT_ABOUT_MODULE_INFO."</legend> + <div style=\"padding: 8px;\"> + <label>"._AM_IMPRINT_ABOUT_MODULE_STATUS.":</label><text>".$versioninfo->getInfo("module_status")."</text><br /> + <label>"._AM_IMPRINT_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_IMPRINT_ABOUT_AUTHOR_INFO."</legend> + <div style=\"padding: 8px;\"> + <label>"._AM_IMPRINT_ABOUT_AUTHOR_NAME.":</label><text>".$versioninfo->getInfo("author")."</text><br /> + <label>"._AM_IMPRINT_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_IMPRINT_ABOUT_CHANGELOG."</legend> + <div style=\"padding: 8px;\"><div>".implode("<br />", file( $file ))."</div></div> + </fieldset> + <br clear=\"all\" />"; +} +xoops_cp_footer(); +?> \ No newline at end of file Added: XoopsModules/imprint/releases/1.01/imprint/admin/header.php =================================================================== --- XoopsModules/imprint/releases/1.01/imprint/admin/header.php (rev 0) +++ XoopsModules/imprint/releases/1.01/imprint/admin/header.php 2012-02-15 12:57:49 UTC (rev 8990) @@ -0,0 +1,110 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * imprint - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) TXMod Xoops (http://www.txmodxoops.org) + * + * 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 TXMod Xoops (http://www.txmodxoops.org) + * @license GNU GPL + * @package imprint + * @author TXMod Xoops (http://www.txmodxoops.org) + * + * 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/imprint/class/imp.php"; + +if ( $xoopsUser ) { + $xoopsModule = XoopsModule::getByDirname("imprint"); + 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 imprint_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/imprint/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/imprint/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/imprint/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_IMPRINT_GENERALSET</a> + | <a href=\"".XOOPS_URL."/modules/imprint/index.php\">_AM_IMPRINT_GOINDEX</a> + | <a href=\"".XOOPS_URL."/modules/imprint/admin/upgrade.php\">_AM_IMPRINT_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/imprint/admin/index.php\"><span>_MI_IMPRINT_MANAGER_INDEX</span></a></li> + <li id=\"$tblColors[1]\"><a href=\"".XOOPS_URL."/modules/imprint/admin/imp.php\"><span>_MI_IMPRINT_MANAGER_IMP</span></a></li>"; + + /* <li id=\"$tblColors[2]\"><a href=\"".XOOPS_URL."/modules/imprint/admin/permissions.php\"><span>_MI_IMPRINT_MANAGER_PERMISSIONS</span></a></li> */ + echo "<li id=\"$tblColors[3]\"><a href=\"".XOOPS_URL."/modules/imprint/admin/about.php\"><span>_MI_IMPRINT_MANAGER_ABOUT</span></a></li> + </ul></div>"; +} + +$impHandler =& xoops_getModuleHandler("imprint_imp", "imprint"); + +?> \ No newline at end of file Added: XoopsModules/imprint/releases/1.01/imprint/admin/imp.php =================================================================== --- XoopsModules/imprint/releases/1.01/imprint/admin/imp.php (rev 0) +++ XoopsModules/imprint/releases/1.01/imprint/admin/imp.php 2012-02-15 12:57:49 UTC (rev 8990) @@ -0,0 +1,222 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * imprint - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) TXMod Xoops (http://www.txmodxoops.org) + * + * 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 TXMod Xoops (http://www.txmodxoops.org) + * @license GNU GPL + * @package imprint + * @author TXMod Xoops (http://www.txmodxoops.org) + * + * Version : 1.00: + * **************************************************************************** + */ + +include_once("./header.php"); + +xoops_cp_header(); + +if (isset($_REQUEST["op"])) { + $op = $_REQUEST["op"]; +} else { + @$op = "show_list_imp"; +} + +//Menu admin +if ( !is_readable(XOOPS_ROOT_PATH . "/Frameworks/art/functions.admin.php") ) { +imprint_adminmenu(1, _AM_IMPRINT_MANAGER_IMP); +} else { +include_once XOOPS_ROOT_PATH."/Frameworks/art/functions.admin.php"; +loadModuleAdminMenu (1, _AM_IMPRINT_MANAGER_IMP); +} + +//Sous menu +echo "<div class=\"CPbigTitle\" style=\"background-image: url(../images/deco/topic.png); background-repeat: no-repeat; background-position: left; padding-left: 50px; height: 48px;\"> + <strong>"._AM_IMPRINT_MANAGER_IMP."</strong> + </div><br /><br>"; +switch ($op) +{ + case "save_imp": + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("imp.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if (isset($_REQUEST["imp_id"])) { + $obj =& $impHandler->get($_REQUEST["imp_id"]); + } else { + $obj =& $impHandler->create(); + } + + //Form imp_title + $obj->setVar("imp_title", $_REQUEST["imp_title"]); + //Form imp_name + $obj->setVar("imp_name", $_REQUEST["imp_name"]); + //Form imp_address + $obj->setVar("imp_address", $_REQUEST["imp_address"]); + //Form imp_postalcode + $obj->setVar("imp_postalcode", $_REQUEST["imp_postalcode"]); + //Form imp_city + $obj->setVar("imp_city", $_REQUEST["imp_city"]); + //Form imp_phone + $obj->setVar("imp_phone", $_REQUEST["imp_phone"]); + //Form imp_fax + $obj->setVar("imp_fax", $_REQUEST["imp_fax"]); + //Form imp_email + $obj->setVar("imp_email", $_REQUEST["imp_email"]); + //Form imp_image + include_once XOOPS_ROOT_PATH."/class/uploader.php"; + $uploaddir_imp_image = XOOPS_ROOT_PATH."/uploads/imprint/imp/imp_image/"; + $uploader_imp_image = new XoopsMediaUploader($uploaddir_imp_image, $xoopsModuleConfig["imp_image_mimetypes"], $xoopsModuleConfig["imp_image_size"], null, null); + + if ($uploader_imp_image->fetchMedia("imp_image")) { + $uploader_imp_image->setPrefix("imp_image_") ; + $uploader_imp_image->fetchMedia("imp_image"); + if (!$uploader_imp_image->upload()) { + $errors = $uploader_imp_image->getErrors(); + redirect_header("javascript:history.go(-1)",3, $errors); + } else { + $obj->setVar("imp_image", $uploader_imp_image->getSavedFileName()); + } + } else { + $obj->setVar("imp_image", $_REQUEST["imp_image"]); + } + //Form imp_title_desclaimer + $obj->setVar("imp_title_desclaimer", $_REQUEST["imp_title_desclaimer"]); + //Form imp_disclaimer + $obj->setVar("imp_disclaimer", $_REQUEST["imp_disclaimer"]); + //Form imp_submitter + $obj->setVar("imp_submitter", $_REQUEST["imp_submitter"]); + //Form imp_date_created + $obj->setVar("imp_date_created", strtotime($_REQUEST["imp_date_created"])); + //Form imp_online + $verif_imp_online = ($_REQUEST["imp_online"] == 1) ? "1" : "0"; + $obj->setVar("imp_online", $verif_imp_online); + + + if ($impHandler->insert($obj)) { + redirect_header("imp.php?op=show_list_imp", 2, _AM_IMPRINT_FORMOK); + } + //include_once("../include/forms.php"); + echo $obj->getHtmlErrors(); + $form =& $obj->getForm(); + break; + + case "edit_imp": + $obj = $impHandler->get($_REQUEST["imp_id"]); + $form = $obj->getForm(); + break; + case "delete_imp": + $obj =& $impHandler->get($_REQUEST["imp_id"]); + if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { + if ( !$GLOBALS["xoopsSecurity"]->check() ) { redirect_header("imp.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if ($impHandler->delete($obj)) { redirect_header("imp.php", 3, _AM_IMPRINT_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array("ok" => 1, "imp_id" => $_REQUEST["imp_id"], "op" => "delete_imp"), $_SERVER["REQUEST_URI"], sprintf(_AM_IMPRINT_FORMSUREDEL, $obj->getVar("imp"))); + } + break; + + case "update_online_imp": + + if (isset($_REQUEST["imp_id"])) { + $obj =& $impHandler->get($_REQUEST["imp_id"]); + } + $obj->setVar("imp_online", $_REQUEST["imp_online"]); + + if ($impHandler->insert($obj)) { + redirect_header("imp.php", 3, _AM_IMPRINT_FORMOK); + } + echo $obj->getHtmlErrors(); + + break; + + case "default": + default: + + $criteria = new CriteriaCompo(); + $criteria->setSort("imp_id"); + $criteria->setOrder("ASC"); + $numrows = $impHandler->getCount(); + $imp_arr = $impHandler->getall($criteria); + + //Affichage du tableau + if ($numrows>0) + { + echo "<table width=\"100%\" cellspacing=\"1\" class=\"outer\"> + <tr> + <th align=\"center\">"._AM_IMPRINT_IMP_TITLE."</th> + <th align=\"center\">"._AM_IMPRINT_IMP_NAME."</th> + <th align=\"center\">"._AM_IMPRINT_IMP_ADDRESS."</th> + <th align=\"center\">"._AM_IMPRINT_IMP_POSTALCODE."</th> + <th align=\"center\">"._AM_IMPRINT_IMP_CITY."</th> + <th align=\"center\">"._AM_IMPRINT_IMP_PHONE."</th> + <th align=\"center\">"._AM_IMPRINT_IMP_FAX."</th> + <th align=\"center\">"._AM_IMPRINT_IMP_EMAIL."</th> + <th align=\"center\">"._AM_IMPRINT_IMP_IMAGE."</th> + <th align=\"center\">"._AM_IMPRINT_IMP_TITLE_DESCLAIMER."</th> + <th align=\"center\">"._AM_IMPRINT_IMP_DISCLAIMER."</th> + <th align=\"center\">"._AM_IMPRINT_IMP_SUBMITTER."</th> + <th align=\"center\">"._AM_IMPRINT_IMP_DATE_CREATED."</th> + <th align=\"center\">"._AM_IMPRINT_IMP_ONLINE."</th> + + <th align=\"center\" width=\"10%\">"._AM_IMPRINT_FORMACTION."</th> + </tr>"; + + $class = "odd"; + + foreach (array_keys($imp_arr) as $i) + { + if ( $imp_arr[$i]->getVar("topic_pid") == 0) + { + echo "<tr class=\"".$class."\">"; + $class = ($class == "even") ? "odd" : "even"; + echo "<td align=\"center\">".$imp_arr[$i]->getVar("imp_title")."</td>"; + echo "<td align=\"center\">".$imp_arr[$i]->getVar("imp_name")."</td>"; + echo "<td align=\"center\">".$imp_arr[$i]->getVar("imp_address")."</td>"; + echo "<td align=\"center\">".$imp_arr[$i]->getVar("imp_postalcode")."</td>"; + echo "<td align=\"center\">".$imp_arr[$i]->getVar("imp_city")."</td>"; + echo "<td align=\"center\">".$imp_arr[$i]->getVar("imp_phone")."</td>"; + echo "<td align=\"center\">".$imp_arr[$i]->getVar("imp_fax")."</td>"; + echo "<td align=\"center\">".$imp_arr[$i]->getVar("imp_email")."</td>"; + echo "<td align=\"center\"><img src=\"".XOOPS_URL."/uploads/imprint/imp/imp_image/".$imp_arr[$i]->getVar("imp_image")."\" height=\"30px\" title=\"imp_image\" alt=\"imp_image\"></td>"; + echo "<td align=\"center\">".$imp_arr[$i]->getVar("imp_title_desclaimer")."</td>"; + echo "<td align=\"center\">".$imp_arr[$i]->getVar("imp_disclaimer")."</td>"; + echo "<td align=\"center\">".XoopsUser::getUnameFromId($imp_arr[$i]->getVar("imp_submitter"),"S")."</td>"; + echo "<td align=\"center\">".formatTimeStamp($imp_arr[$i]->getVar("imp_date_created"),"S")."</td>"; + + $online = $imp_arr[$i]->getVar("imp_online"); + + if( $online == 1 ) { + echo "<td align=\"center\"><a href=\"./imp.php?op=update_online_imp&imp_id=".$imp_arr[$i]->getVar("imp_id")."&imp_online=0\"><img src=\"./../images/deco/on.gif\" border=\"0\" alt=\""._AM_IMPRINT_ON."\" title=\""._AM_IMPRINT_ON."\"></a></td>"; + } else { + echo "<td align=\"center\"><a href=\"./imp.php?op=update_online_imp&imp_id=".$imp_arr[$i]->getVar("imp_id")."&imp_online=1\"><img src=\"./../images/deco/off.gif\" border=\"0\" alt=\""._AM_IMPRINT_OFF."\" title=\""._AM_IMPRINT_OFF."\"></a></td>"; + } + echo "<td align=\"center\" width=\"10%\"> + <a href=\"imp.php?op=edit_imp&imp_id=".$imp_arr[$i]->getVar("imp_id")."\"><img src=\"../images/deco/edit.gif\" alt=\""._AM_IMPRINT_EDIT."\" title=\""._AM_IMPRINT_EDIT."\"></a> + <a href=\"imp.php?op=delete_imp&imp_id=".$imp_arr[$i]->getVar("imp_id")."\"><img src=\"../images/deco/delete.gif\" alt=\""._AM_IMPRINT_DELETE."\" title=\""._AM_IMPRINT_DELETE."\"></a> + </td>"; + echo "</tr>"; + } + } + echo "</table><br><br>"; + } + + // Affichage du formulaire + $obj =& $impHandler->create(); + $form = $obj->getForm(); +} +xoops_cp_footer(); + +?> \ No newline at end of file Added: XoopsModules/imprint/releases/1.01/imprint/admin/index.html =================================================================== --- XoopsModules/imprint/releases/1.01/imprint/admin/index.html (rev 0) +++ XoopsModules/imprint/releases/1.01/imprint/admin/index.html 2012-02-15 12:57:49 UTC (rev 8990) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/imprint/releases/1.01/imprint/admin/index.php =================================================================== --- XoopsModules/imprint/releases/1.01/imprint/admin/index.php (rev 0) +++ XoopsModules/imprint/releases/1.01/imprint/admin/index.php 2012-02-15 12:57:49 UTC (rev 8990) @@ -0,0 +1,74 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * imprint - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) TXMod Xoops (http://www.txmodxoops.org) + * + * 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 TXMod Xoops (http://www.txmodxoops.org) + * @license GNU GPL + * @package imprint + * @author TXMod Xoops (http://www.txmodxoops.org) + * + * Version : 1.00: + * **************************************************************************** + */ + +include_once("./header.php"); + +xoops_cp_header(); + +global $xoopsModule; + +//Apelle du menu admin +if ( !is_readable(XOOPS_ROOT_PATH."/Frameworks/art/functions.admin.php")) { +imprint_adminmenu(0, _AM_IMPRINT_MANAGER_INDEX); +} else { +include_once XOOPS_ROOT_PATH."/Frameworks/art/functions.admin.php"; +loadModuleAdminMenu (0, _AM_IMPRINT_MANAGER_INDEX); +} + //compte "total" + $count_imp = $impHandler->getCount(); + //compte "attente" + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria("imp_online", 1)); + $imp_online = $impHandler->getCount($criteria); + +include_once XOOPS_ROOT_PATH."/modules/imprint/class/menu.php"; + + $menu = new imprintMenu(); + $menu->addItem("imp", "imp.php", "../images/deco/topic.png", _AM_IMPRINT_MANAGER_IMP); + $menu->addItem("update", "../../system/admin.php?fct=modulesadmin&op=update&module=imprint", "../images/deco/update.png", _AM_IMPRINT_MANAGER_UPDATE); + /*$menu->addItem("permissions", "permissions.php", "../images/deco/permissions.png", _AM_IMPRINT_MANAGER_PERMISSIONS); */ + $menu->addItem("preference", "../../system/admin.php?fct=preferences&op=showmod&mod=".$xoopsModule->getVar("mid"). + "&&confcat_id=1", "../images/deco/pref.png", _AM_IMPRINT_MANAGER_PREFERENCES); + $menu->addItem("about", "about.php", "../images/deco/about.png", _AM_IMPRINT_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; height: 48px;\"><strong>"._AM_IMPRINT_MANAGER_INDEX."</strong></div><br /> + <table width=\"100%\" border=\"0\" cellspacing=\"10\" cellpadding=\"4\"> + <tr> + <td valign=\"top\" width=\"auto\">".$menu->render()."</td> + <td valign=\"top\" width=\"auto\">"; + + echo "<fieldset> + <legend class=\"CPmediumTitle\">"._AM_IMPRINT_MANAGER_IMP."</legend> + <br />"; + printf(_AM_IMPRINT_THEREARE_IMP, $count_imp); + echo "<br /><br />"; + printf(_AM_IMPRINT_THEREARE_IMP_ONLINE, $imp_online); + echo "<br /></fieldset><br /><br />"; +echo "</td></tr></table>"; +xoops_cp_footer(); + +?> \ No newline at end of file Added: XoopsModules/imprint/releases/1.01/imprint/admin/menu.php =================================================================== --- XoopsModules/imprint/releases/1.01/imprint/admin/menu.php (rev 0) +++ XoopsModules/imprint/releases/1.01/imprint/admin/menu.php 2012-02-15 12:57:49 UTC (rev 8990) @@ -0,0 +1,35 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * imprint - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) TXMod Xoops (http://www.txmodxoops.org) + * + * 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 TXMod Xoops (http://www.txmodxoops.org) + * @license GNU GPL + * @package imprint + * @author TXMod Xoops (http://www.txmodxoops.org) + * + * Version : 1.00: + * **************************************************************************** + */ + +$adminmenu = array(); +$adminmenu[0]["title"] = _MI_IMPRINT_MANAGER_INDEX; +$adminmenu[0]["link"] = "admin/index.php"; +$adminmenu[1]["title"] = _MI_IMPRINT_MANAGER_IMP; +$adminmenu[1]["link"] = "admin/imp.php"; +//$adminmenu[2]["title"] = _MI_IMPRINT_MANAGER_PERMISSIONS; +//$adminmenu[2]["link"] = "admin/permissions.php"; +$adminmenu[2]["title"] = _MI_IMPRINT_MANAGER_ABOUT; +$adminmenu[2]["link"] = "admin/about.php"; + +?> \ No newline at end of file Added: XoopsModules/imprint/releases/1.01/imprint/blocks/index.html =================================================================== --- XoopsModules/imprint/releases/1.01/imprint/blocks/index.html (rev 0) +++ XoopsModules/imprint/releases/1.01/imprint/blocks/index.html 2012-02-15 12:57:49 UTC (rev 8990) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/imprint/releases/1.01/imprint/changelog.txt =================================================================== --- XoopsModules/imprint/releases/1.01/imprint/changelog.txt (rev 0) +++ XoopsModules/imprint/releases/1.01/imprint/changelog.txt 2012-02-15 12:57:49 UTC (rev 8990) @@ -0,0 +1,11 @@ +Imprint Versione 1.01 +- Base mode +- Database mode with multiple pages + +Italiano +-------- +Questo modulo può essere modificato come vuoi, aggiungendo oppure sottraendo delle voci dal file xoops_version.php. Può essere utilizzato in vari modi anche con l'utilizzo delle tabelle del database che troverete allegato. In versione normale non fa uso di database, ma lo può fare. + +English +------- +This module can be modified as you wish, adding or subtracting items from the file xoops_version.php. It can be used in various ways including the use of database tables that you will find attached. In the normal version does not use databases, but will do so. \ No newline at end of file Added: XoopsModules/imprint/releases/1.01/imprint/class/imp.php =================================================================== --- XoopsModules/imprint/releases/1.01/imprint/class/imp.php (rev 0) +++ XoopsModules/imprint/releases/1.01/imprint/class/imp.php 2012-02-15 12:57:49 UTC (rev 8990) @@ -0,0 +1,135 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * imprint - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) TXMod Xoops (http://www.txmodxoops.org) + * + * 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 TXMod Xoops (http://www.txmodxoops.org) + * @license GNU GPL + * @package imprint + * @author TXMod Xoops (http://www.txmodxoops.org) + * + * Version : 1.00: + * **************************************************************************** + */ + + +if (!defined("XOOPS_ROOT_PATH")) { +die("XOOPS root path not defined"); +} + +if (!class_exists("XoopsPersistableObjectHandler")) { +include_once XOOPS_ROOT_PATH."/modules/imprint/class/object.php"; +} + +class imprint_imp extends XoopsObject +{ +//Constructor +function __construct() +{ +$this->XoopsObject(); +$this->initVar("imp_id",XOBJ_DTYPE_INT,null,false,8); +$this->initVar("imp_title",XOBJ_DTYPE_TXTBOX,null,false); +$this->initVar("imp_name",XOBJ_DTYPE_TXTBOX,null,false); +$this->initVar("imp_address",XOBJ_DTYPE_TXTBOX,null,false); +$this->initVar("imp_postalcode",XOBJ_DTYPE_TXTBOX,null,false); +$this->initVar("imp_city",XOBJ_DTYPE_TXTBOX,null,false); +$this->initVar("imp_phone",XOBJ_DTYPE_TXTBOX,null,false); +$this->initVar("imp_fax",XOBJ_DTYPE_TXTBOX,null,false); +$this->initVar("imp_email",XOBJ_DTYPE_TXTBOX,null,false); +$this->initVar("imp_image",XOBJ_DTYPE_TXTBOX,null,false); +$this->initVar("imp_title_desclaimer",XOBJ_DTYPE_TXTBOX,null,false); +$this->initVar("imp_disclaimer",XOBJ_DTYPE_TXTAREA,null,false); +$this->initVar("imp_submitter",XOBJ_DTYPE_INT,null,false,10); +$this->initVar("imp_date_created",XOBJ_DTYPE_INT,null,false,10); +$this->initVar("imp_online",XOBJ_DTYPE_INT,null,false,1); + +// Pour autoriser le html +$this->initVar("dohtml", XOBJ_DTYPE_INT, 1, false); + +} + +function imprint_imp() +{ +$this->__construct(); +} + +function getForm($action = false) +{ +global $xoopsDB, $xoopsModuleConfig; + +if ($action === false) { +$action = $_SERVER["REQUEST_URI"]; +} + +$title = $this->isNew() ? sprintf(_AM_IMPRINT_IMP_ADD) : sprintf(_AM_IMPRINT_IMP_EDIT); + +include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php"); + +$form = new XoopsThemeForm($title, "form", $action, "post", true); +$form->setExtra('enctype="multipart/form-data"'); + +$form->addElement(new XoopsFormText(_AM_IMPRINT_IMP_TITLE, "imp_title", 50, 255, $this->getVar("imp_title")), true); +$form->addElement(new XoopsFormText(_AM_IMPRINT_IMP_NAME, "imp_name", 50, 255, $this->getVar("imp_name")), true); +$form->addElement(new XoopsFormText(_AM_IMPRINT_IMP_ADDRESS, "imp_address", 50, 255, $this->getVar("imp_address")), true); +$form->addElement(new XoopsFormText(_AM_IMPRINT_IMP_POSTALCODE, "imp_postalcode", 50, 255, $this->getVar("imp_postalcode")), true); +$form->addElement(new XoopsFormText(_AM_IMPRINT_IMP_CITY, "imp_city", 50, 255, $this->getVar("imp_city")), true); +$form->addElement(new XoopsFormText(_AM_IMPRINT_IMP_PHONE, "imp_phone", 50, 255, $this->getVar("imp_phone")), true); +$form->addElement(new XoopsFormText(_AM_IMPRINT_IMP_FAX, "imp_fax", 50, 255, $this->getVar("imp_fax")), true); +$form->addElement(new XoopsFormText(_AM_IMPRINT_IMP_EMAIL, "imp_email", 50, 255, $this->getVar("imp_email")), true); + +$imp_image = $this->getVar("imp_image") ? $this->getVar("imp_image") : 'blank.gif'; + +$uploadirectory_imp_image = '/uploads/imprint/imp/imp_image'; +$imgtray_imp_image = new XoopsFormElementTray(_AM_IMPRINT_IMP_IMAGE,'<br />'); +$imgpath_imp_image = sprintf(_AM_IMPRINT_FORMIMAGE_PATH, $uploadirectory_imp_image); +$imageselect_imp_image = new XoopsFormSelect($imgpath_imp_image, 'imp_image', $imp_image); +$image_array_imp_image = XoopsLists :: getImgListAsArray( XOOPS_ROOT_PATH.$uploadirectory_imp_image ); +foreach( $image_array_imp_image as $image_imp_image ) { +$imageselect_imp_image->addOption("$image_imp_image", $image_imp_image); +} +$imageselect_imp_image->setExtra( "onchange='showImgSelected(\"image_imp_image\", \"imp_image\", \"".$uploadirectory_imp_image."\", \"\", \"".XOOPS_URL."\")'" ); +$imgtray_imp_image->addElement($imageselect_imp_image, false); +$imgtray_imp_image->addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".$uploadirectory_imp_image."/".$imp_image."' name='image_imp_image' id='image_imp_image' alt='' />" ) ); + +$fileseltray_imp_image = new XoopsFormElementTray('','<br />'); +$fileseltray_imp_image->addElement(new XoopsFormFile(_AM_IMPRINT_FORMUPLOAD , "imp_image", $xoopsModuleConfig["imp_image_size"]),false); +$fileseltray_imp_image->addElement(new XoopsFormLabel(''), false); +$imgtray_imp_image->addElement($fileseltray_imp_image); +$form->addElement($imgtray_imp_image); + +$form->addElement(new XoopsFormText(_AM_IMPRINT_IMP_TITLE_DESCLAIMER, "imp_title_desclaimer", 50, 255, $this->getVar("imp_title_desclaimer")), true); +$form->addElement(new XoopsFormTextArea(_AM_IMPRINT_IMP_DISCLAIMER, "imp_disclaimer", $this->getVar("imp_disclaimer"), 4, 47), true); +$form->addElement(new XoopsFormSelectUser(_AM_IMPRINT_IMP_SUBMITTER, "imp_submitter", false, $this->getVar("imp_submitter"), 1, false), true); +$form->addElement(new XoopsFormTextDateSelect(_AM_IMPRINT_IMP_DATE_CREATED, "imp_date_created", "", $this->getVar("imp_date_created"))); + $imp_online = $this->isNew() ? 1 : $this->getVar("imp_online"); +$check_imp_online = new XoopsFormCheckBox(_AM_IMPRINT_IMP_ONLINE, "imp_online", $imp_online); +$check_imp_online->addOption(1, " "); +$form->addElement($check_imp_online); + +$form->addElement(new XoopsFormHidden("op", "save_imp")); +$form->addElement(new XoopsFormButton("", "submit", _SUBMIT, "submit")); +$form->display(); +return $form; +} +} +class imprintimprint_impHandler extends XoopsPersistableObjectHandler +{ + +function __construct(&$db) +{ +parent::__construct($db, "imprint_imp", "imprint_imp", "imp_id", "imp_title"); +} + +} + +?> \ No newline at end of file Added: XoopsModules/imprint/releases/1.01/imprint/class/index.html =================================================================== --- XoopsModules/imprint/releases/1.01/imprint/class/index.html (rev 0) +++ XoopsModules/imprint/releases/1.01/imprint/class/index.html 2012-02-15 12:57:49 UTC (rev 8990) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/imprint/releases/1.01/imprint/class/menu.php =================================================================== --- XoopsModules/imprint/releases/1.01/imprint/class/menu.php (rev 0) +++ XoopsModules/imprint/releases/1.01/imprint/class/menu.php 2012-02-15 12:57:49 UTC (rev 8990) @@ -0,0 +1,176 @@ +<?php +/** + * **************************************************************************** + * Module g\xE9n\xE9r\xE9 par TDMCreate de la TDM "http://www.tdmxoops.net" + * **************************************************************************** + * imprint - MODULE FOR XOOPS AND IMPRESS CMS + * Copyright (c) TXMod Xoops (http://www.txmodxoops.org) + * + * 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 TXMod Xoops (http://www.txmodxoops.org) + * @license GNU GPL + * @package imprint + * @author TXMod Xoops (http://www.txmodxoops.org) + * + * Version : 1.00: + * **************************************************************************** + */ + +class imprintMenu +{ + 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/imprint/releases/1.01/imprint/class/object.php =================================================================== --- XoopsModules/imprint/releases/1.01/imprint/class/object.php (rev 0) +++ XoopsModules/imprint/releases/1.01/imprint/class/object.php 2012-02-15 12:57:49 UTC (rev 8990) @@ -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/imprint/releases/1.01/imprint/header.php =================================================================== --- XoopsModules/imprint/releases/1.01/imprint/header.php (rev 0) +++ XoopsModules/imprint/releases/1.01/imprint/header.php 2012-02-15 12:57:49 UTC (rev 8990) @@ -0,0 +1,37 @@ +<?php +/** + * ************************************... [truncated message content] |