From: <txm...@us...> - 2012-01-31 19:37:15
|
Revision: 8855 http://xoops.svn.sourceforge.net/xoops/?rev=8855&view=rev Author: txmodxoops Date: 2012-01-31 19:37:06 +0000 (Tue, 31 Jan 2012) Log Message: ----------- Alpha 1 From zero created with TDMCreate module Added Paths: ----------- XoopsModules/mylinks/branches/timgno/mylinks/ XoopsModules/mylinks/branches/timgno/mylinks/admin/ XoopsModules/mylinks/branches/timgno/mylinks/admin/about.php XoopsModules/mylinks/branches/timgno/mylinks/admin/admin_footer.php XoopsModules/mylinks/branches/timgno/mylinks/admin/admin_header.php XoopsModules/mylinks/branches/timgno/mylinks/admin/broken.php XoopsModules/mylinks/branches/timgno/mylinks/admin/cat.php XoopsModules/mylinks/branches/timgno/mylinks/admin/index.html XoopsModules/mylinks/branches/timgno/mylinks/admin/index.php XoopsModules/mylinks/branches/timgno/mylinks/admin/links.php XoopsModules/mylinks/branches/timgno/mylinks/admin/menu.php XoopsModules/mylinks/branches/timgno/mylinks/admin/mod.php XoopsModules/mylinks/branches/timgno/mylinks/admin/permissions.php XoopsModules/mylinks/branches/timgno/mylinks/admin/text.php XoopsModules/mylinks/branches/timgno/mylinks/admin/votedata.php XoopsModules/mylinks/branches/timgno/mylinks/blocks/ XoopsModules/mylinks/branches/timgno/mylinks/blocks/blocks_broken.php XoopsModules/mylinks/branches/timgno/mylinks/blocks/blocks_cat.php XoopsModules/mylinks/branches/timgno/mylinks/blocks/blocks_links.php XoopsModules/mylinks/branches/timgno/mylinks/blocks/blocks_mod.php XoopsModules/mylinks/branches/timgno/mylinks/blocks/blocks_text.php XoopsModules/mylinks/branches/timgno/mylinks/blocks/blocks_votedata.php XoopsModules/mylinks/branches/timgno/mylinks/blocks/index.html XoopsModules/mylinks/branches/timgno/mylinks/broken.php XoopsModules/mylinks/branches/timgno/mylinks/cat.php XoopsModules/mylinks/branches/timgno/mylinks/class/ XoopsModules/mylinks/branches/timgno/mylinks/class/index.html XoopsModules/mylinks/branches/timgno/mylinks/class/mylinks_broken.php XoopsModules/mylinks/branches/timgno/mylinks/class/mylinks_cat.php XoopsModules/mylinks/branches/timgno/mylinks/class/mylinks_links.php XoopsModules/mylinks/branches/timgno/mylinks/class/mylinks_mod.php XoopsModules/mylinks/branches/timgno/mylinks/class/mylinks_text.php XoopsModules/mylinks/branches/timgno/mylinks/class/mylinks_votedata.php XoopsModules/mylinks/branches/timgno/mylinks/css/ XoopsModules/mylinks/branches/timgno/mylinks/css/admin.css XoopsModules/mylinks/branches/timgno/mylinks/css/index.html XoopsModules/mylinks/branches/timgno/mylinks/css/style.css XoopsModules/mylinks/branches/timgno/mylinks/docs/ XoopsModules/mylinks/branches/timgno/mylinks/docs/changelog.txt XoopsModules/mylinks/branches/timgno/mylinks/docs/credits.txt XoopsModules/mylinks/branches/timgno/mylinks/docs/index.html XoopsModules/mylinks/branches/timgno/mylinks/docs/install.txt XoopsModules/mylinks/branches/timgno/mylinks/docs/lang_diff.txt XoopsModules/mylinks/branches/timgno/mylinks/docs/licence.txt XoopsModules/mylinks/branches/timgno/mylinks/docs/readme.txt XoopsModules/mylinks/branches/timgno/mylinks/header.php XoopsModules/mylinks/branches/timgno/mylinks/images/ XoopsModules/mylinks/branches/timgno/mylinks/images/icons/ XoopsModules/mylinks/branches/timgno/mylinks/images/icons/index.html XoopsModules/mylinks/branches/timgno/mylinks/images/icons/off.png XoopsModules/mylinks/branches/timgno/mylinks/images/icons/on.png XoopsModules/mylinks/branches/timgno/mylinks/images/index.html XoopsModules/mylinks/branches/timgno/mylinks/images/menu/ XoopsModules/mylinks/branches/timgno/mylinks/images/menu/bg.png XoopsModules/mylinks/branches/timgno/mylinks/images/menu/index.html XoopsModules/mylinks/branches/timgno/mylinks/images/menu/left_both.png XoopsModules/mylinks/branches/timgno/mylinks/images/menu/right_both.png XoopsModules/mylinks/branches/timgno/mylinks/images/mylinks_slogo.png XoopsModules/mylinks/branches/timgno/mylinks/include/ XoopsModules/mylinks/branches/timgno/mylinks/include/configs.php XoopsModules/mylinks/branches/timgno/mylinks/include/functions.php XoopsModules/mylinks/branches/timgno/mylinks/include/index.html XoopsModules/mylinks/branches/timgno/mylinks/include/install.php XoopsModules/mylinks/branches/timgno/mylinks/index.php XoopsModules/mylinks/branches/timgno/mylinks/language/ XoopsModules/mylinks/branches/timgno/mylinks/language/index.html XoopsModules/mylinks/branches/timgno/mylinks/language/italian/ XoopsModules/mylinks/branches/timgno/mylinks/language/italian/admin.php XoopsModules/mylinks/branches/timgno/mylinks/language/italian/blocks.php XoopsModules/mylinks/branches/timgno/mylinks/language/italian/help/ XoopsModules/mylinks/branches/timgno/mylinks/language/italian/help/help.html XoopsModules/mylinks/branches/timgno/mylinks/language/italian/help/index.html XoopsModules/mylinks/branches/timgno/mylinks/language/italian/index.html XoopsModules/mylinks/branches/timgno/mylinks/language/italian/main.php XoopsModules/mylinks/branches/timgno/mylinks/language/italian/modinfo.php XoopsModules/mylinks/branches/timgno/mylinks/links.php XoopsModules/mylinks/branches/timgno/mylinks/mod.php XoopsModules/mylinks/branches/timgno/mylinks/sql/ XoopsModules/mylinks/branches/timgno/mylinks/sql/index.html XoopsModules/mylinks/branches/timgno/mylinks/sql/mysql.sql XoopsModules/mylinks/branches/timgno/mylinks/templates/ XoopsModules/mylinks/branches/timgno/mylinks/templates/admin/ XoopsModules/mylinks/branches/timgno/mylinks/templates/admin/index.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/ XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/index.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_broken_block_day.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_broken_block_random.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_broken_block_recent.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_cat_block_day.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_cat_block_random.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_cat_block_recent.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_links_block_day.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_links_block_random.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_links_block_recent.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_mod_block_day.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_mod_block_random.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_mod_block_recent.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_text_block_day.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_text_block_random.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_text_block_recent.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_votedata_block_day.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_votedata_block_random.html XoopsModules/mylinks/branches/timgno/mylinks/templates/blocks/mylinks_votedata_block_recent.html XoopsModules/mylinks/branches/timgno/mylinks/templates/index.html XoopsModules/mylinks/branches/timgno/mylinks/templates/mylinks_broken.html XoopsModules/mylinks/branches/timgno/mylinks/templates/mylinks_cat.html XoopsModules/mylinks/branches/timgno/mylinks/templates/mylinks_footer.html XoopsModules/mylinks/branches/timgno/mylinks/templates/mylinks_header.html XoopsModules/mylinks/branches/timgno/mylinks/templates/mylinks_index.html XoopsModules/mylinks/branches/timgno/mylinks/templates/mylinks_links.html XoopsModules/mylinks/branches/timgno/mylinks/templates/mylinks_mod.html XoopsModules/mylinks/branches/timgno/mylinks/templates/mylinks_text.html XoopsModules/mylinks/branches/timgno/mylinks/templates/mylinks_votedata.html XoopsModules/mylinks/branches/timgno/mylinks/text.php XoopsModules/mylinks/branches/timgno/mylinks/votedata.php XoopsModules/mylinks/branches/timgno/mylinks/xoops_version.php Added: XoopsModules/mylinks/branches/timgno/mylinks/admin/about.php =================================================================== --- XoopsModules/mylinks/branches/timgno/mylinks/admin/about.php (rev 0) +++ XoopsModules/mylinks/branches/timgno/mylinks/admin/about.php 2012-01-31 19:37:06 UTC (rev 8855) @@ -0,0 +1,43 @@ +<?php +/** + * **************************************************************************** + * - Original Copyright (TDM) + * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS + * - Licence GPL Copyright (c) (http://www.tdmxoops.net) + * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org) + * - Revision By TXMod Xoops (http://www.txmodxoops.org) + * **************************************************************************** + * MYLINKS - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * TXMod Xoops (http://www.txmodxoops.org) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting + * source code which is considered copyrighted (c) material of the + * original comment or credit authors. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops (http://www.txmodxoops.org) + * @license GPL see LICENSE + * @package mylinks + * @author TXMod Xoops (in...@tx...) + * + * Version : 3.02 Sat 2012/01/14 6:36:59 : Timgno Exp $ + * **************************************************************************** + */ + +include "admin_header.php"; +xoops_cp_header(); +$aboutAdmin = new ModuleAdmin(); +echo $aboutAdmin->addNavigation("about.php"); +echo $aboutAdmin->renderabout('6KJ7RW5DR3VTJ', false); +include "admin_footer.php"; \ No newline at end of file Added: XoopsModules/mylinks/branches/timgno/mylinks/admin/admin_footer.php =================================================================== --- XoopsModules/mylinks/branches/timgno/mylinks/admin/admin_footer.php (rev 0) +++ XoopsModules/mylinks/branches/timgno/mylinks/admin/admin_footer.php 2012-01-31 19:37:06 UTC (rev 8855) @@ -0,0 +1,41 @@ +<?php +/** + * **************************************************************************** + * - Original Copyright (TDM) + * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS + * - Licence GPL Copyright (c) (http://www.tdmxoops.net) + * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org) + * - Revision By TXMod Xoops (http://www.txmodxoops.org) + * **************************************************************************** + * MYLINKS - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * TXMod Xoops (http://www.txmodxoops.org) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting + * source code which is considered copyrighted (c) material of the + * original comment or credit authors. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops (http://www.txmodxoops.org) + * @license GPL see LICENSE + * @package mylinks + * @author TXMod Xoops (in...@tx...) + * + * Version : 3.02 Sat 2012/01/14 6:36:59 : Timgno Exp $ + * **************************************************************************** + */ + +global $pathImageAdmin; +echo "<div align=\"center\"><a href=\"http://www.xoops.org\" target=\"_blank\"><img src='" . $pathImageAdmin."/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a></div>"; +echo "<div class='center smallsmall italic pad5'><strong>" . $xoopsModule->getVar("name") . "</strong> "._AM_MYLINKS_MAINTAINEDBY." <a class='tooltip' rel='external' href='http://www.xoops.org/' title='Visit XOOPS Community'>XOOPS Community</a></div>"; + xoops_cp_footer(); Added: XoopsModules/mylinks/branches/timgno/mylinks/admin/admin_header.php =================================================================== --- XoopsModules/mylinks/branches/timgno/mylinks/admin/admin_header.php (rev 0) +++ XoopsModules/mylinks/branches/timgno/mylinks/admin/admin_header.php 2012-01-31 19:37:06 UTC (rev 8855) @@ -0,0 +1,98 @@ +<?php +/** + * **************************************************************************** + * - Original Copyright (TDM) + * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS + * - Licence GPL Copyright (c) (http://www.tdmxoops.net) + * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org) + * - Revision By TXMod Xoops (http://www.txmodxoops.org) + * **************************************************************************** + * MYLINKS - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * TXMod Xoops (http://www.txmodxoops.org) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting + * source code which is considered copyrighted (c) material of the + * original comment or credit authors. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops (http://www.txmodxoops.org) + * @license GPL see LICENSE + * @package mylinks + * @author TXMod Xoops (in...@tx...) + * + * Version : 3.02 Sat 2012/01/14 6:36:59 : Timgno Exp $ + * **************************************************************************** + */ + +include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; +include_once XOOPS_ROOT_PATH . '/include/cp_functions.php'; +include_once '../include/functions.php'; + +$pathDir = $GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin'); +$globlang = $GLOBALS['xoopsConfig']['language']; + +if ( file_exists($pathDir.'/language/'.$globlang.'/main.php')){ + include_once $pathDir.'/language/'.$globlang.'/main.php'; + }else{ + include_once $pathDir.'/language/english/main.php'; + } + +if ( file_exists($pathDir.'/moduleadmin.php')){ + include_once $pathDir.'/moduleadmin.php'; + //return true; + }else{ + xoops_cp_header(); + echo xoops_error(_AM_MYLINKS_MODULEADMIN_MISSING); + xoops_cp_footer(); + //return false; + } +$dirname = basename(dirname(dirname( __FILE__ ) )); +$module_handler =& xoops_gethandler('module'); +$xoopsModule = & $module_handler->getByDirname($dirname); +$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid')); +$pathImageIcon = XOOPS_URL .'/'. $moduleInfo->getInfo('icons16'); +$pathImageAdmin = XOOPS_URL .'/'. $moduleInfo->getInfo('icons32'); +$brokenHandler=& xoops_getModuleHandler('mylinks_broken', $dirname ); +$catHandler=& xoops_getModuleHandler('mylinks_cat', $dirname ); +$linksHandler=& xoops_getModuleHandler('mylinks_links', $dirname ); +$modHandler=& xoops_getModuleHandler('mylinks_mod', $dirname ); +$textHandler=& xoops_getModuleHandler('mylinks_text', $dirname ); +$votedataHandler=& xoops_getModuleHandler('mylinks_votedata', $dirname ); + +$myts =& MyTextSanitizer::getInstance(); + +if ($xoopsUser) { + $moduleperm_handler =& xoops_gethandler('groupperm'); + if (!$moduleperm_handler->checkRight('module_admin', $xoopsModule->getVar( 'mid' ), $xoopsUser->getGroups())) { + redirect_header(XOOPS_URL, 1, _NOPERM); + exit(); + } +} else { + redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM); + exit(); +} + +if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { + include_once(XOOPS_ROOT_PATH."/class/template.php"); + $xoopsTpl = new XoopsTpl(); +} +$xoopsTpl->assign('pathImageIcon', $pathImageIcon); +$xoopsTpl->assign('pathImageAdmin', $pathImageAdmin); + +$style_admin = "../css/admin.css"; + +//Load languages +xoops_loadLanguage('admin', $xoopsModule->getVar("dirname")); +xoops_loadLanguage('modinfo', $xoopsModule->getVar("dirname")); +xoops_loadLanguage('main', $xoopsModule->getVar("dirname")); Added: XoopsModules/mylinks/branches/timgno/mylinks/admin/broken.php =================================================================== --- XoopsModules/mylinks/branches/timgno/mylinks/admin/broken.php (rev 0) +++ XoopsModules/mylinks/branches/timgno/mylinks/admin/broken.php 2012-01-31 19:37:06 UTC (rev 8855) @@ -0,0 +1,164 @@ +<?php +/** + * **************************************************************************** + * - Original Copyright (TDM) + * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS + * - Licence GPL Copyright (c) (http://www.tdmxoops.net) + * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org) + * - Revision By TXMod Xoops (http://www.txmodxoops.org) + * **************************************************************************** + * MYLINKS - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * TXMod Xoops (http://www.txmodxoops.org) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting + * source code which is considered copyrighted (c) material of the + * original comment or credit authors. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops (http://www.txmodxoops.org) + * @license GPL see LICENSE + * @package mylinks + * @author TXMod Xoops (in...@tx...) + * + * Version : 3.02 Sat 2012/01/14 6:36:59 : Timgno Exp $ + * **************************************************************************** + */ + +include "admin_header.php"; +xoops_cp_header(); +global $pathImageIcon; + +//It retrieves the value of the argument in op URL$ +$op = mylinks_CleanVars($_REQUEST, 'op', 'list_broken', 'string'); +// counts the number of uncommitted gets +$criteria = new CriteriaCompo(); +$criteria->add(new Criteria('status', 0)); +$broken_waiting = $brokenHandler->getCount($criteria); +$status_menu = mylinks_CleanVars($_REQUEST, 'status_display', 1, 'int'); + +switch ($op) { +default: + case "list_broken": + $broken_admin = new ModuleAdmin(); + echo $broken_admin->addNavigation('broken.php'); + if ($status_menu == 1){ + $broken_admin->addItemButton(_AM_MYLINKS_BROKENNEW, 'broken.php?op=new_broken', 'add'); + }else{ + $broken_admin->addItemButton(_AM_MYLINKS_BROKEN_LIST, 'broken.php?op=list_broken', 'list'); + $broken_admin->addItemButton(_AM_MYLINKS_BROKENNEW, 'broken.php?op=new_broken', 'add'); + } + echo $broken_admin->renderButton(); + $criteria = new CriteriaCompo(); + $criteria->setSort("broken_reportid"); + $criteria->setOrder("ASC"); + $numrows = $brokenHandler->getCount(); + $broken_arr = $brokenHandler->getall($criteria); + + //Table view + if ($numrows>0) + { + echo "<table width=\"100%\" cellspacing=\"1\" class=\"outer\"> + <tr> + <th align=\"center\">"._AM_MYLINKS_BROKEN_LID."</th> + <th align=\"center\">"._AM_MYLINKS_BROKEN_SENDER."</th> + <th align=\"center\">"._AM_MYLINKS_BROKEN_IP."</th> + <th align=\"center\" width=\"10%\">"._AM_MYLINKS_FORMACTION."</th> + </tr>"; + $class = "odd"; + foreach (array_keys($broken_arr) as $i) + { + if ( $broken_arr[$i]->getVar("topic_pid") == 0) + { + echo "<tr class=\"".$class."\">"; + $class = ($class == "even") ? "odd" : "even";echo "<td align='center'>".$broken_arr[$i]->getVar("broken_lid")."</td>"; + echo "<td align='center'>".$broken_arr[$i]->getVar("broken_sender")."</td>"; + echo "<td align='center'>".$broken_arr[$i]->getVar("broken_ip")."</td>"; + + echo "<td align=\"center\" width=\"10%\"> + <a href=\"broken.php?op=edit_broken&broken_reportid=".$broken_arr[$i]->getVar("broken_reportid")."\"><img src=".$pathImageIcon."/edit.png alt=\""._EDIT."\" title=\""._EDIT."\"></a> + <a href=\"broken.php?op=delete_broken&broken_reportid=".$broken_arr[$i]->getVar("broken_reportid")."\"><img src=".$pathImageIcon."/delete.png alt=\""._DELETE."\" title=\""._DELETE."\"></a> + </td>"; + echo "</tr>"; + } + } + echo "</table><br><br>"; + } + + // Form display + //$obj =& $brokenHandler->create(); + //$form = $obj->getForm(); + //$form->display(); + break; + + case "new_broken": + $member_admin = new ModuleAdmin(); + echo $member_admin->addNavigation("broken.php"); + $member_admin->addItemButton(_AM_MYLINKS_BROKEN_LIST, 'broken.php?op=list_broken', 'list'); + echo $member_admin->renderButton(); + + $obj =& $brokenHandler->create(); + $form = $obj->getForm(); + $form->display(); + break; + + case "save_broken": + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("broken.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if (isset($_REQUEST["broken_reportid"])) { + $obj =& $brokenHandler->get($_REQUEST["broken_reportid"]); + } else { + $obj =& $brokenHandler->create(); + } + //Form broken_lid + $obj->setVar("broken_lid", $_REQUEST["broken_lid"]); + //Form broken_sender + $obj->setVar("broken_sender", $_REQUEST["broken_sender"]); + //Form broken_ip + $obj->setVar("broken_ip", $_REQUEST["broken_ip"]); + + + if ($brokenHandler->insert($obj)) { + redirect_header("broken.php?op=list_broken", 2, _AM_MYLINKS_FORMOK); + } + //include_once("../include/forms.php"); + echo $obj->getHtmlErrors(); + $form =& $obj->getForm(); + break; + + case "edit_broken": + $obj = $brokenHandler->get($_REQUEST["broken_reportid"]); + $form = $obj->getForm(); + $form->display(); + break; + + case "delete_broken": + $obj =& $brokenHandler->get($_REQUEST["broken_reportid"]); + if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("broken.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if ($brokenHandler->delete($obj)) { + redirect_header("broken.php", 3, _AM_MYLINKS_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array("ok" => 1, "broken_reportid" => $_REQUEST["broken_reportid"], "op" => "delete_broken"), $_SERVER["REQUEST_URI"], sprintf(_AM_MYLINKS_FORMSUREDEL, $obj->getVar("broken"))); + } + break; + +} +include "admin_footer.php"; +?> \ No newline at end of file Added: XoopsModules/mylinks/branches/timgno/mylinks/admin/cat.php =================================================================== --- XoopsModules/mylinks/branches/timgno/mylinks/admin/cat.php (rev 0) +++ XoopsModules/mylinks/branches/timgno/mylinks/admin/cat.php 2012-01-31 19:37:06 UTC (rev 8855) @@ -0,0 +1,182 @@ +<?php +/** + * **************************************************************************** + * - Original Copyright (TDM) + * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS + * - Licence GPL Copyright (c) (http://www.tdmxoops.net) + * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org) + * - Revision By TXMod Xoops (http://www.txmodxoops.org) + * **************************************************************************** + * MYLINKS - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * TXMod Xoops (http://www.txmodxoops.org) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting + * source code which is considered copyrighted (c) material of the + * original comment or credit authors. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops (http://www.txmodxoops.org) + * @license GPL see LICENSE + * @package mylinks + * @author TXMod Xoops (in...@tx...) + * + * Version : 3.02 Sat 2012/01/14 6:36:59 : Timgno Exp $ + * **************************************************************************** + */ + +include "admin_header.php"; +xoops_cp_header(); +global $pathImageIcon; + +//It retrieves the value of the argument in op URL$ +$op = mylinks_CleanVars($_REQUEST, 'op', 'list_cat', 'string'); +// counts the number of uncommitted gets +$criteria = new CriteriaCompo(); +$criteria->add(new Criteria('status', 0)); +$cat_waiting = $catHandler->getCount($criteria); +$status_menu = mylinks_CleanVars($_REQUEST, 'status_display', 1, 'int'); + +switch ($op) { +default: + case "list_cat": + $cat_admin = new ModuleAdmin(); + echo $cat_admin->addNavigation('cat.php'); + if ($status_menu == 1){ + $cat_admin->addItemButton(_AM_MYLINKS_CATNEW, 'cat.php?op=new_cat', 'add'); + }else{ + $cat_admin->addItemButton(_AM_MYLINKS_CAT_LIST, 'cat.php?op=list_cat', 'list'); + $cat_admin->addItemButton(_AM_MYLINKS_CATNEW, 'cat.php?op=new_cat', 'add'); + } + echo $cat_admin->renderButton(); + $criteria = new CriteriaCompo(); + $criteria->setSort("cat_id"); + $criteria->setOrder("ASC"); + $numrows = $catHandler->getCount(); + $cat_arr = $catHandler->getall($criteria); + + //Table view + if ($numrows>0) + { + echo "<table width=\"100%\" cellspacing=\"1\" class=\"outer\"> + <tr> + <th align=\"center\">"._AM_MYLINKS_CAT_PID."</th> + <th align=\"center\">"._AM_MYLINKS_CAT_TITLE."</th> + <th align=\"center\">"._AM_MYLINKS_CAT_IMGURL."</th> + <th align=\"center\" width=\"10%\">"._AM_MYLINKS_FORMACTION."</th> + </tr>"; + $class = "odd"; + foreach (array_keys($cat_arr) as $i) + { + if ( $cat_arr[$i]->getVar("topic_pid") == 0) + { + echo "<tr class=\"".$class."\">"; + $class = ($class == "even") ? "odd" : "even";echo "<td align='center'>".$cat_arr[$i]->getVar("cat_pid")."</td>"; + echo "<td align='center'>".$cat_arr[$i]->getVar("cat_title")."</td>"; + echo "<td align='center'><img src='".XOOPS_URL."/uploads/mylinks/cat/cat_imgurl/".$cat_arr[$i]->getVar("cat_imgurl")."' height='30px' title='cat_imgurl' alt='cat_imgurl'></td>"; + + echo "<td align=\"center\" width=\"10%\"> + <a href=\"cat.php?op=edit_cat&cat_id=".$cat_arr[$i]->getVar("cat_id")."\"><img src=".$pathImageIcon."/edit.png alt=\""._EDIT."\" title=\""._EDIT."\"></a> + <a href=\"cat.php?op=delete_cat&cat_id=".$cat_arr[$i]->getVar("cat_id")."\"><img src=".$pathImageIcon."/delete.png alt=\""._DELETE."\" title=\""._DELETE."\"></a> + </td>"; + echo "</tr>"; + } + } + echo "</table><br><br>"; + } + + // Form display + //$obj =& $catHandler->create(); + //$form = $obj->getForm(); + //$form->display(); + break; + + case "new_cat": + $member_admin = new ModuleAdmin(); + echo $member_admin->addNavigation("cat.php"); + $member_admin->addItemButton(_AM_MYLINKS_CAT_LIST, 'cat.php?op=list_cat', 'list'); + echo $member_admin->renderButton(); + + $obj =& $catHandler->create(); + $form = $obj->getForm(); + $form->display(); + break; + + case "save_cat": + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("cat.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if (isset($_REQUEST["cat_id"])) { + $obj =& $catHandler->get($_REQUEST["cat_id"]); + } else { + $obj =& $catHandler->create(); + } + //Form cat_pid + $obj->setVar("cat_pid", $_REQUEST["cat_pid"]); + //Form cat_title + $obj->setVar("cat_title", $_REQUEST["cat_title"]); + //Form cat_imgurl + include_once XOOPS_ROOT_PATH."/class/uploader.php"; + $uploaddir_cat_imgurl = XOOPS_ROOT_PATH."/uploads/mylinks/cat/cat_imgurl/"; + $uploader_cat_imgurl = new XoopsMediaUploader($uploaddir_cat_imgurl, + $GLOBALS["xoopsModuleConfig"]["cat_imgurl_mimetypes"], + $GLOBALS["xoopsModuleConfig"]["cat_imgurl_size"], + null, null); + + if ($uploader_cat_imgurl->fetchMedia("cat_imgurl")) { + $uploader_cat_imgurl->setPrefix("cat_imgurl_") ; + $uploader_cat_imgurl->fetchMedia("cat_imgurl"); + if (!$uploader_cat_imgurl->upload()) { + $errors = $uploader_cat_imgurl->getErrors(); + redirect_header("javascript:history.go(-1)",3, $errors); + } else { + $obj->setVar("cat_imgurl", $uploader_cat_imgurl->getSavedFileName()); + } + } else { + $obj->setVar("cat_imgurl", $_REQUEST["cat_imgurl"]); + } + + + if ($catHandler->insert($obj)) { + redirect_header("cat.php?op=list_cat", 2, _AM_MYLINKS_FORMOK); + } + //include_once("../include/forms.php"); + echo $obj->getHtmlErrors(); + $form =& $obj->getForm(); + break; + + case "edit_cat": + $obj = $catHandler->get($_REQUEST["cat_id"]); + $form = $obj->getForm(); + $form->display(); + break; + + case "delete_cat": + $obj =& $catHandler->get($_REQUEST["cat_id"]); + if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("cat.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if ($catHandler->delete($obj)) { + redirect_header("cat.php", 3, _AM_MYLINKS_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array("ok" => 1, "cat_id" => $_REQUEST["cat_id"], "op" => "delete_cat"), $_SERVER["REQUEST_URI"], sprintf(_AM_MYLINKS_FORMSUREDEL, $obj->getVar("cat"))); + } + break; + +} +include "admin_footer.php"; +?> \ No newline at end of file Added: XoopsModules/mylinks/branches/timgno/mylinks/admin/index.html =================================================================== --- XoopsModules/mylinks/branches/timgno/mylinks/admin/index.html (rev 0) +++ XoopsModules/mylinks/branches/timgno/mylinks/admin/index.html 2012-01-31 19:37:06 UTC (rev 8855) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/mylinks/branches/timgno/mylinks/admin/index.php =================================================================== --- XoopsModules/mylinks/branches/timgno/mylinks/admin/index.php (rev 0) +++ XoopsModules/mylinks/branches/timgno/mylinks/admin/index.php 2012-01-31 19:37:06 UTC (rev 8855) @@ -0,0 +1,68 @@ +<?php +/** + * **************************************************************************** + * - Original Copyright (TDM) + * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS + * - Licence GPL Copyright (c) (http://www.tdmxoops.net) + * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org) + * - Revision By TXMod Xoops (http://www.txmodxoops.org) + * **************************************************************************** + * MYLINKS - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * TXMod Xoops (http://www.txmodxoops.org) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting + * source code which is considered copyrighted (c) material of the + * original comment or credit authors. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops (http://www.txmodxoops.org) + * @license GPL see LICENSE + * @package mylinks + * @author TXMod Xoops (in...@tx...) + * + * Version : 3.02 Sat 2012/01/14 6:36:59 : Timgno Exp $ + * **************************************************************************** + */ + +include "admin_header.php"; +xoops_cp_header(); + $indexAdmin = new ModuleAdmin(); + //account "total" + $count_broken = $brokenHandler->getCount(); + //account "total" + $count_cat = $catHandler->getCount(); + //account "total" + $count_links = $linksHandler->getCount(); + //account "total" + $count_mod = $modHandler->getCount(); + //account "total" + $count_text = $textHandler->getCount(); + //account "total" + $count_votedata = $votedataHandler->getCount(); + $indexAdmin->addInfoBox(_AM_MYLINKS_BROKEN); + $indexAdmin->addInfoBoxLine(_AM_MYLINKS_BROKEN,_AM_MYLINKS_THEREARE_BROKEN, $count_broken) ; + $indexAdmin->addInfoBox(_AM_MYLINKS_CAT); + $indexAdmin->addInfoBoxLine(_AM_MYLINKS_CAT,_AM_MYLINKS_THEREARE_CAT, $count_cat) ; + $indexAdmin->addInfoBox(_AM_MYLINKS_LINKS); + $indexAdmin->addInfoBoxLine(_AM_MYLINKS_LINKS,_AM_MYLINKS_THEREARE_LINKS, $count_links) ; + $indexAdmin->addInfoBox(_AM_MYLINKS_MOD); + $indexAdmin->addInfoBoxLine(_AM_MYLINKS_MOD,_AM_MYLINKS_THEREARE_MOD, $count_mod) ; + $indexAdmin->addInfoBox(_AM_MYLINKS_TEXT); + $indexAdmin->addInfoBoxLine(_AM_MYLINKS_TEXT,_AM_MYLINKS_THEREARE_TEXT, $count_text) ; + $indexAdmin->addInfoBox(_AM_MYLINKS_VOTEDATA); + $indexAdmin->addInfoBoxLine(_AM_MYLINKS_VOTEDATA,_AM_MYLINKS_THEREARE_VOTEDATA, $count_votedata) ; + echo $indexAdmin->addNavigation("index.php"); + echo $indexAdmin->renderIndex(); +include "admin_footer.php"; +?> \ No newline at end of file Added: XoopsModules/mylinks/branches/timgno/mylinks/admin/links.php =================================================================== --- XoopsModules/mylinks/branches/timgno/mylinks/admin/links.php (rev 0) +++ XoopsModules/mylinks/branches/timgno/mylinks/admin/links.php 2012-01-31 19:37:06 UTC (rev 8855) @@ -0,0 +1,216 @@ +<?php +/** + * **************************************************************************** + * - Original Copyright (TDM) + * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS + * - Licence GPL Copyright (c) (http://www.tdmxoops.net) + * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org) + * - Revision By TXMod Xoops (http://www.txmodxoops.org) + * **************************************************************************** + * MYLINKS - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * TXMod Xoops (http://www.txmodxoops.org) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting + * source code which is considered copyrighted (c) material of the + * original comment or credit authors. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops (http://www.txmodxoops.org) + * @license GPL see LICENSE + * @package mylinks + * @author TXMod Xoops (in...@tx...) + * + * Version : 3.02 Sat 2012/01/14 6:36:59 : Timgno Exp $ + * **************************************************************************** + */ + +include "admin_header.php"; +xoops_cp_header(); +global $pathImageIcon; + +//It retrieves the value of the argument in op URL$ +$op = mylinks_CleanVars($_REQUEST, 'op', 'list_links', 'string'); +// counts the number of uncommitted gets +$criteria = new CriteriaCompo(); +$criteria->add(new Criteria('status', 0)); +$links_waiting = $linksHandler->getCount($criteria); +$status_menu = mylinks_CleanVars($_REQUEST, 'status_display', 1, 'int'); + +switch ($op) { +default: + case "list_links": + $links_admin = new ModuleAdmin(); + echo $links_admin->addNavigation('links.php'); + if ($status_menu == 1){ + $links_admin->addItemButton(_AM_MYLINKS_LINKSNEW, 'links.php?op=new_links', 'add'); + }else{ + $links_admin->addItemButton(_AM_MYLINKS_LINKS_LIST, 'links.php?op=list_links', 'list'); + $links_admin->addItemButton(_AM_MYLINKS_LINKSNEW, 'links.php?op=new_links', 'add'); + } + echo $links_admin->renderButton(); + $criteria = new CriteriaCompo(); + $criteria->setSort("links_lid"); + $criteria->setOrder("ASC"); + $numrows = $linksHandler->getCount(); + $links_arr = $linksHandler->getall($criteria); + + //Table view + if ($numrows>0) + { + echo "<table width=\"100%\" cellspacing=\"1\" class=\"outer\"> + <tr> + <th align=\"center\">"._AM_MYLINKS_LINKS_CID."</th> + <th align=\"center\">"._AM_MYLINKS_LINKS_TITLE."</th> + <th align=\"center\">"._AM_MYLINKS_LINKS_URL."</th> + <th align=\"center\">"._AM_MYLINKS_LINKS_LOGOURL."</th> + <th align=\"center\">"._AM_MYLINKS_LINKS_SUBMITTER."</th> + <th align=\"center\">"._AM_MYLINKS_LINKS_STATUS."</th> + <th align=\"center\">"._AM_MYLINKS_LINKS_DATE."</th> + <th align=\"center\">"._AM_MYLINKS_LINKS_HITS."</th> + <th align=\"center\">"._AM_MYLINKS_LINKS_RATING."</th> + <th align=\"center\">"._AM_MYLINKS_LINKS_VOTES."</th> + <th align=\"center\">"._AM_MYLINKS_LINKS_COMMENTS."</th> + <th align=\"center\" width=\"10%\">"._AM_MYLINKS_FORMACTION."</th> + </tr>"; + $class = "odd"; + foreach (array_keys($links_arr) as $i) + { + if ( $links_arr[$i]->getVar("topic_pid") == 0) + { + echo "<tr class=\"".$class."\">"; + $class = ($class == "even") ? "odd" : "even";echo "<td align='center'>".$links_arr[$i]->getVar("links_title")."</td>"; + echo "<td align='center'>".$links_arr[$i]->getVar("links_url")."</td>"; + echo "<td align='center'><img src='".XOOPS_URL."/uploads/mylinks/links/links_logourl/".$links_arr[$i]->getVar("links_logourl")."' height='30px' title='links_logourl' alt='links_logourl'></td>"; + echo "<td align='center'>".XoopsUser::getUnameFromId($links_arr[$i]->getVar("links_submitter"),"S")."</td>"; + + $verif_links_status = ( $links_arr[$i]->getVar("links_status") == 1 ) ? _YES : _NO; + echo "<td align='center'>".$verif_links_status."</td>"; + echo "<td align='center'>".formatTimeStamp($links_arr[$i]->getVar("links_date"),"S")."</td>"; + echo "<td align='center'>".$links_arr[$i]->getVar("links_hits")."</td>"; + echo "<td align='center'>".$links_arr[$i]->getVar("links_rating")."</td>"; + echo "<td align='center'>".$links_arr[$i]->getVar("links_votes")."</td>"; + echo "<td align='center'>".$links_arr[$i]->getVar("links_comments")."</td>"; + + echo "<td align=\"center\" width=\"10%\"> + <a href=\"links.php?op=edit_links&links_lid=".$links_arr[$i]->getVar("links_lid")."\"><img src=".$pathImageIcon."/edit.png alt=\""._EDIT."\" title=\""._EDIT."\"></a> + <a href=\"links.php?op=delete_links&links_lid=".$links_arr[$i]->getVar("links_lid")."\"><img src=".$pathImageIcon."/delete.png alt=\""._DELETE."\" title=\""._DELETE."\"></a> + </td>"; + echo "</tr>"; + } + } + echo "</table><br><br>"; + } + + // Form display + //$obj =& $linksHandler->create(); + //$form = $obj->getForm(); + //$form->display(); + break; + + case "new_links": + $member_admin = new ModuleAdmin(); + echo $member_admin->addNavigation("links.php"); + $member_admin->addItemButton(_AM_MYLINKS_LINKS_LIST, 'links.php?op=list_links', 'list'); + echo $member_admin->renderButton(); + + $obj =& $linksHandler->create(); + $form = $obj->getForm(); + $form->display(); + break; + + case "save_links": + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("links.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if (isset($_REQUEST["links_lid"])) { + $obj =& $linksHandler->get($_REQUEST["links_lid"]); + } else { + $obj =& $linksHandler->create(); + } + //Form links_cid + $obj->setVar("links_cid", $_REQUEST["links_cid"]); + //Form links_title + $obj->setVar("links_title", $_REQUEST["links_title"]); + //Form links_url + $obj->setVar("links_url", $_REQUEST["links_url"]); + //Form links_logourl + include_once XOOPS_ROOT_PATH."/class/uploader.php"; + $uploaddir_links_logourl = XOOPS_ROOT_PATH."/uploads/mylinks/links/links_logourl/"; + $uploader_links_logourl = new XoopsMediaUploader($uploaddir_links_logourl, + $GLOBALS["xoopsModuleConfig"]["links_logourl_mimetypes"], + $GLOBALS["xoopsModuleConfig"]["links_logourl_size"], + null, null); + + if ($uploader_links_logourl->fetchMedia("links_logourl")) { + $uploader_links_logourl->setPrefix("links_logourl_") ; + $uploader_links_logourl->fetchMedia("links_logourl"); + if (!$uploader_links_logourl->upload()) { + $errors = $uploader_links_logourl->getErrors(); + redirect_header("javascript:history.go(-1)",3, $errors); + } else { + $obj->setVar("links_logourl", $uploader_links_logourl->getSavedFileName()); + } + } else { + $obj->setVar("links_logourl", $_REQUEST["links_logourl"]); + } + //Form links_submitter + $obj->setVar("links_submitter", $_REQUEST["links_submitter"]); + //Form links_status + $verif_links_status = ($_REQUEST["links_status"] == 1) ? "1" : "0"; + $obj->setVar("links_status", $verif_links_status); + //Form links_date + $obj->setVar("links_date", mylinks_convertDate($_REQUEST["links_date"])); + //Form links_hits + $obj->setVar("links_hits", $_REQUEST["links_hits"]); + //Form links_rating + $obj->setVar("links_rating", $_REQUEST["links_rating"]); + //Form links_votes + $obj->setVar("links_votes", $_REQUEST["links_votes"]); + //Form links_comments + $obj->setVar("links_comments", $_REQUEST["links_comments"]); + + + if ($linksHandler->insert($obj)) { + redirect_header("links.php?op=list_links", 2, _AM_MYLINKS_FORMOK); + } + //include_once("../include/forms.php"); + echo $obj->getHtmlErrors(); + $form =& $obj->getForm(); + break; + + case "edit_links": + $obj = $linksHandler->get($_REQUEST["links_lid"]); + $form = $obj->getForm(); + $form->display(); + break; + + case "delete_links": + $obj =& $linksHandler->get($_REQUEST["links_lid"]); + if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("links.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if ($linksHandler->delete($obj)) { + redirect_header("links.php", 3, _AM_MYLINKS_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array("ok" => 1, "links_lid" => $_REQUEST["links_lid"], "op" => "delete_links"), $_SERVER["REQUEST_URI"], sprintf(_AM_MYLINKS_FORMSUREDEL, $obj->getVar("links"))); + } + break; + +} +include "admin_footer.php"; +?> \ No newline at end of file Added: XoopsModules/mylinks/branches/timgno/mylinks/admin/menu.php =================================================================== --- XoopsModules/mylinks/branches/timgno/mylinks/admin/menu.php (rev 0) +++ XoopsModules/mylinks/branches/timgno/mylinks/admin/menu.php 2012-01-31 19:37:06 UTC (rev 8855) @@ -0,0 +1,89 @@ +<?php +/** + * **************************************************************************** + * - Original Copyright (TDM) + * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS + * - Licence GPL Copyright (c) (http://www.tdmxoops.net) + * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org) + * - Revision By TXMod Xoops (http://www.txmodxoops.org) + * **************************************************************************** + * MYLINKS - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * TXMod Xoops (http://www.txmodxoops.org) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting + * source code which is considered copyrighted (c) material of the + * original comment or credit authors. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops (http://www.txmodxoops.org) + * @license GPL see LICENSE + * @package mylinks + * @author TXMod Xoops (in...@tx...) + * + * Version : 3.02 Sat 2012/01/14 6:36:59 : Timgno Exp $ + * **************************************************************************** + */ + + +$dirname = basename( dirname( dirname( __FILE__ ) ) ) ; + +$module_handler =& xoops_gethandler("module"); +$xoopsModule =& XoopsModule::getByDirname($dirname); +$moduleInfo =& $module_handler->get($xoopsModule->getVar("mid")); +$pathImageAdmin = $moduleInfo->getInfo("icons32"); + +$adminmenu = array(); + +$i = 1; +$adminmenu[$i]["title"] = _MI_MYLINKS_ADMENU1; +$adminmenu[$i]["link"] = "admin/index.php"; +//$adminmenu[$i]["desc"] = _MI_MYLINKS_ADMENU1_DESC; +$adminmenu[$i]["icon"] = "../../".$pathImageAdmin."/home.png"; +$i++; +$adminmenu[$i]["title"] = _MI_MYLINKS_ADMENU2; +$adminmenu[$i]["link"] = "admin/broken.php"; +//$adminmenu[$i]["desc"] = _MI_MYLINKS_ADMENU2_DESC +$adminmenu[$i]["icon"] = "../../".$pathImageAdmin."/brokenlink.png"; +$i++; +$adminmenu[$i]["title"] = _MI_MYLINKS_ADMENU3; +$adminmenu[$i]["link"] = "admin/cat.php"; +//$adminmenu[$i]["desc"] = _MI_MYLINKS_ADMENU3_DESC +$adminmenu[$i]["icon"] = "../../".$pathImageAdmin."/category.png"; +$i++; +$adminmenu[$i]["title"] = _MI_MYLINKS_ADMENU4; +$adminmenu[$i]["link"] = "admin/links.php"; +//$adminmenu[$i]["desc"] = _MI_MYLINKS_ADMENU4_DESC +$adminmenu[$i]["icon"] = "../../".$pathImageAdmin."/link.png"; +$i++; +$adminmenu[$i]["title"] = _MI_MYLINKS_ADMENU5; +$adminmenu[$i]["link"] = "admin/mod.php"; +//$adminmenu[$i]["desc"] = _MI_MYLINKS_ADMENU5_DESC +$adminmenu[$i]["icon"] = "../../".$pathImageAdmin."/modifiedlink.png"; +$i++; +$adminmenu[$i]["title"] = _MI_MYLINKS_ADMENU6; +$adminmenu[$i]["link"] = "admin/text.php"; +//$adminmenu[$i]["desc"] = _MI_MYLINKS_ADMENU6_DESC +$adminmenu[$i]["icon"] = "../../".$pathImageAdmin."/bookcase.png"; +$i++; +$adminmenu[$i]["title"] = _MI_MYLINKS_ADMENU7; +$adminmenu[$i]["link"] = "admin/votedata.php"; +//$adminmenu[$i]["desc"] = _MI_MYLINKS_ADMENU7_DESC +$adminmenu[$i]["icon"] = "../../".$pathImageAdmin."/stats.png"; +$i++; +$adminmenu[$i]["title"] = _MI_MYLINKS_ADMENU8; +$adminmenu[$i]["link"] = "admin/about.php"; +//$adminmenu[$i]["desc"] = _MI_MYLINKS_ADMENU8_DESC; +$adminmenu[$i]["icon"] = "../../".$pathImageAdmin."/about.png"; +unset( $i ); +?> \ No newline at end of file Added: XoopsModules/mylinks/branches/timgno/mylinks/admin/mod.php =================================================================== --- XoopsModules/mylinks/branches/timgno/mylinks/admin/mod.php (rev 0) +++ XoopsModules/mylinks/branches/timgno/mylinks/admin/mod.php 2012-01-31 19:37:06 UTC (rev 8855) @@ -0,0 +1,196 @@ +<?php +/** + * **************************************************************************** + * - Original Copyright (TDM) + * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS + * - Licence GPL Copyright (c) (http://www.tdmxoops.net) + * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org) + * - Revision By TXMod Xoops (http://www.txmodxoops.org) + * **************************************************************************** + * MYLINKS - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * TXMod Xoops (http://www.txmodxoops.org) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting + * source code which is considered copyrighted (c) material of the + * original comment or credit authors. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops (http://www.txmodxoops.org) + * @license GPL see LICENSE + * @package mylinks + * @author TXMod Xoops (in...@tx...) + * + * Version : 3.02 Sat 2012/01/14 6:36:59 : Timgno Exp $ + * **************************************************************************** + */ + +include "admin_header.php"; +xoops_cp_header(); +global $pathImageIcon; + +//It retrieves the value of the argument in op URL$ +$op = mylinks_CleanVars($_REQUEST, 'op', 'list_mod', 'string'); +// counts the number of uncommitted gets +$criteria = new CriteriaCompo(); +$criteria->add(new Criteria('status', 0)); +$mod_waiting = $modHandler->getCount($criteria); +$status_menu = mylinks_CleanVars($_REQUEST, 'status_display', 1, 'int'); + +switch ($op) { +default: + case "list_mod": + $mod_admin = new ModuleAdmin(); + echo $mod_admin->addNavigation('mod.php'); + if ($status_menu == 1){ + $mod_admin->addItemButton(_AM_MYLINKS_MODNEW, 'mod.php?op=new_mod', 'add'); + }else{ + $mod_admin->addItemButton(_AM_MYLINKS_MOD_LIST, 'mod.php?op=list_mod', 'list'); + $mod_admin->addItemButton(_AM_MYLINKS_MODNEW, 'mod.php?op=new_mod', 'add'); + } + echo $mod_admin->renderButton(); + $criteria = new CriteriaCompo(); + $criteria->setSort("mod_requestid"); + $criteria->setOrder("ASC"); + $numrows = $modHandler->getCount(); + $mod_arr = $modHandler->getall($criteria); + + //Table view + if ($numrows>0) + { + echo "<table width=\"100%\" cellspacing=\"1\" class=\"outer\"> + <tr> + <th align=\"center\">"._AM_MYLINKS_MOD_LID."</th> + <th align=\"center\">"._AM_MYLINKS_MOD_CID."</th> + <th align=\"center\">"._AM_MYLINKS_MOD_TITLE."</th> + <th align=\"center\">"._AM_MYLINKS_MOD_URL."</th> + <th align=\"center\">"._AM_MYLINKS_MOD_LOGOURL."</th> + <th align=\"center\">"._AM_MYLINKS_MOD_DESCRIPTION."</th> + <th align=\"center\">"._AM_MYLINKS_MOD_MODIFYSUBMITTER."</th> + <th align=\"center\" width=\"10%\">"._AM_MYLINKS_FORMACTION."</th> + </tr>"; + $class = "odd"; + foreach (array_keys($mod_arr) as $i) + { + if ( $mod_arr[$i]->getVar("topic_pid") == 0) + { + echo "<tr class=\"".$class."\">"; + $class = ($class == "even") ? "odd" : "even";echo "<td align='center'>".$mod_arr[$i]->getVar("mod_title")."</td>"; + echo "<td align='center'>".$mod_arr[$i]->getVar("mod_url")."</td>"; + echo "<td align='center'><img src='".XOOPS_URL."/uploads/mylinks/mod/mod_logourl/".$mod_arr[$i]->getVar("mod_logourl")."' height='30px' title='mod_logourl' alt='mod_logourl'></td>"; + echo "<td align='center'>".$mod_arr[$i]->getVar("mod_description")."</td>"; + echo "<td align='center'>".XoopsUser::getUnameFromId($mod_arr[$i]->getVar("mod_modifysubmitter"),"S")."</td>"; + + echo "<td align=\"center\" width=\"10%\"> + <a href=\"mod.php?op=edit_mod&mod_requestid=".$mod_arr[$i]->getVar("mod_requestid")."\"><img src=".$pathImageIcon."/edit.png alt=\""._EDIT."\" title=\""._EDIT."\"></a> + <a href=\"mod.php?op=delete_mod&mod_requestid=".$mod_arr[$i]->getVar("mod_requestid")."\"><img src=".$pathImageIcon."/delete.png alt=\""._DELETE."\" title=\""._DELETE."\"></a> + </td>"; + echo "</tr>"; + } + } + echo "</table><br><br>"; + } + + // Form display + //$obj =& $modHandler->create(); + //$form = $obj->getForm(); + //$form->display(); + break; + + case "new_mod": + $member_admin = new ModuleAdmin(); + echo $member_admin->addNavigation("mod.php"); + $member_admin->addItemButton(_AM_MYLINKS_MOD_LIST, 'mod.php?op=list_mod', 'list'); + echo $member_admin->renderButton(); + + $obj =& $modHandler->create(); + $form = $obj->getForm(); + $form->display(); + break; + + case "save_mod": + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("mod.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if (isset($_REQUEST["mod_requestid"])) { + $obj =& $modHandler->get($_REQUEST["mod_requestid"]); + } else { + $obj =& $modHandler->create(); + } + //Form mod_lid + $obj->setVar("mod_lid", $_REQUEST["mod_lid"]); + //Form mod_cid + $obj->setVar("mod_cid", $_REQUEST["mod_cid"]); + //Form mod_title + $obj->setVar("mod_title", $_REQUEST["mod_title"]); + //Form mod_url + $obj->setVar("mod_url", $_REQUEST["mod_url"]); + //Form mod_logourl + include_once XOOPS_ROOT_PATH."/class/uploader.php"; + $uploaddir_mod_logourl = XOOPS_ROOT_PATH."/uploads/mylinks/mod/mod_logourl/"; + $uploader_mod_logourl = new XoopsMediaUploader($uploaddir_mod_logourl, + $GLOBALS["xoopsModuleConfig"]["mod_logourl_mimetypes"], + $GLOBALS["xoopsModuleConfig"]["mod_logourl_size"], + null, null); + + if ($uploader_mod_logourl->fetchMedia("mod_logourl")) { + $uploader_mod_logourl->setPrefix("mod_logourl_") ; + $uploader_mod_logourl->fetchMedia("mod_logourl"); + if (!$uploader_mod_logourl->upload()) { + $errors = $uploader_mod_logourl->getErrors(); + redirect_header("javascript:history.go(-1)",3, $errors); + } else { + $obj->setVar("mod_logourl", $uploader_mod_logourl->getSavedFileName()); + } + } else { + $obj->setVar("mod_logourl", $_REQUEST["mod_logourl"]); + } + //Form mod_description + $obj->setVar("mod_description", $_REQUEST["mod_description"]); + //Form mod_modifysubmitter + $obj->setVar("mod_modifysubmitter", $_REQUEST["mod_modifysubmitter"]); + + + if ($modHandler->insert($obj)) { + redirect_header("mod.php?op=list_mod", 2, _AM_MYLINKS_FORMOK); + } + //include_once("../include/forms.php"); + echo $obj->getHtmlErrors(); + $form =& $obj->getForm(); + break; + + case "edit_mod": + $obj = $modHandler->get($_REQUEST["mod_requestid"]); + $form = $obj->getForm(); + $form->display(); + break; + + case "delete_mod": + $obj =& $modHandler->get($_REQUEST["mod_requestid"]); + if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("mod.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if ($modHandler->delete($obj)) { + redirect_header("mod.php", 3, _AM_MYLINKS_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array("ok" => 1, "mod_requestid" => $_REQUEST["mod_requestid"], "op" => "delete_mod"), $_SERVER["REQUEST_URI"], sprintf(_AM_MYLINKS_FORMSUREDEL, $obj->getVar("mod"))); + } + break; + +} +include "admin_footer.php"; +?> \ No newline at end of file Added: XoopsModules/mylinks/branches/timgno/mylinks/admin/permissions.php =================================================================== --- XoopsModules/mylinks/branches/timgno/mylinks/admin/permissions.php (rev 0) +++ XoopsModules/mylinks/branches/timgno/mylinks/admin/permissions.php 2012-01-31 19:37:06 UTC (rev 8855) @@ -0,0 +1,87 @@ +<?php +/** + * TDMArticle + * + * 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 Gregory Mage (Aka Mage) + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @author Gregory Mage (Aka Mage) + */ + +include 'admin_header.php'; +include_once XOOPS_ROOT_PATH . '/class/xoopstopic.php'; +include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; +include_once XOOPS_ROOT... [truncated message content] |