From: <txm...@us...> - 2012-04-30 19:51:23
|
Revision: 9417 http://xoops.svn.sourceforge.net/xoops/?rev=9417&view=rev Author: txmodxoops Date: 2012-04-30 19:51:13 +0000 (Mon, 30 Apr 2012) Log Message: ----------- working version alpha 1 only for testing Added Paths: ----------- XoopsModules/xpdf/trunk/modules/xpdf/ XoopsModules/xpdf/trunk/modules/xpdf/admin/ XoopsModules/xpdf/trunk/modules/xpdf/admin/about.php XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_footer.php XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_header.php XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php XoopsModules/xpdf/trunk/modules/xpdf/admin/index.html XoopsModules/xpdf/trunk/modules/xpdf/admin/index.php XoopsModules/xpdf/trunk/modules/xpdf/admin/menu.php XoopsModules/xpdf/trunk/modules/xpdf/blocks/ XoopsModules/xpdf/trunk/modules/xpdf/blocks/blocks_doc.php XoopsModules/xpdf/trunk/modules/xpdf/blocks/index.html XoopsModules/xpdf/trunk/modules/xpdf/class/ XoopsModules/xpdf/trunk/modules/xpdf/class/index.html XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_cat.php XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php XoopsModules/xpdf/trunk/modules/xpdf/css/ XoopsModules/xpdf/trunk/modules/xpdf/css/index.html XoopsModules/xpdf/trunk/modules/xpdf/css/style.css XoopsModules/xpdf/trunk/modules/xpdf/docs/ XoopsModules/xpdf/trunk/modules/xpdf/docs/changelog.txt XoopsModules/xpdf/trunk/modules/xpdf/docs/credits.txt XoopsModules/xpdf/trunk/modules/xpdf/docs/index.html XoopsModules/xpdf/trunk/modules/xpdf/docs/install.txt XoopsModules/xpdf/trunk/modules/xpdf/docs/lang_diff.txt XoopsModules/xpdf/trunk/modules/xpdf/docs/licence.txt XoopsModules/xpdf/trunk/modules/xpdf/docs/readme.txt XoopsModules/xpdf/trunk/modules/xpdf/header.php XoopsModules/xpdf/trunk/modules/xpdf/images/ XoopsModules/xpdf/trunk/modules/xpdf/images/16/ XoopsModules/xpdf/trunk/modules/xpdf/images/16/display.png XoopsModules/xpdf/trunk/modules/xpdf/images/16/green_ball.png XoopsModules/xpdf/trunk/modules/xpdf/images/16/grey_ball.png XoopsModules/xpdf/trunk/modules/xpdf/images/16/index.html XoopsModules/xpdf/trunk/modules/xpdf/images/16/orange_ball.png XoopsModules/xpdf/trunk/modules/xpdf/images/16/red_ball.png XoopsModules/xpdf/trunk/modules/xpdf/images/22/ XoopsModules/xpdf/trunk/modules/xpdf/images/22/index.html XoopsModules/xpdf/trunk/modules/xpdf/images/22/view_pdf.png XoopsModules/xpdf/trunk/modules/xpdf/images/32/ XoopsModules/xpdf/trunk/modules/xpdf/images/32/dashboard.png XoopsModules/xpdf/trunk/modules/xpdf/images/32/index.html XoopsModules/xpdf/trunk/modules/xpdf/images/32/pdf_category.png XoopsModules/xpdf/trunk/modules/xpdf/images/32/pdf_document.png XoopsModules/xpdf/trunk/modules/xpdf/images/48/ XoopsModules/xpdf/trunk/modules/xpdf/images/48/down_pdf.png XoopsModules/xpdf/trunk/modules/xpdf/images/48/index.html XoopsModules/xpdf/trunk/modules/xpdf/images/blank.gif XoopsModules/xpdf/trunk/modules/xpdf/images/bookmarks/ XoopsModules/xpdf/trunk/modules/xpdf/images/bookmarks/index.html XoopsModules/xpdf/trunk/modules/xpdf/images/editicon.png XoopsModules/xpdf/trunk/modules/xpdf/images/icons/ XoopsModules/xpdf/trunk/modules/xpdf/images/icons/arrow.gif XoopsModules/xpdf/trunk/modules/xpdf/images/icons/bg.png XoopsModules/xpdf/trunk/modules/xpdf/images/icons/index.html XoopsModules/xpdf/trunk/modules/xpdf/images/icons/off.png XoopsModules/xpdf/trunk/modules/xpdf/images/icons/on.png XoopsModules/xpdf/trunk/modules/xpdf/images/icons/rss.gif XoopsModules/xpdf/trunk/modules/xpdf/images/index.html XoopsModules/xpdf/trunk/modules/xpdf/images/menu/ XoopsModules/xpdf/trunk/modules/xpdf/images/menu/bg.png XoopsModules/xpdf/trunk/modules/xpdf/images/menu/index.html XoopsModules/xpdf/trunk/modules/xpdf/images/menu/left_both.png XoopsModules/xpdf/trunk/modules/xpdf/images/menu/right_both.png XoopsModules/xpdf/trunk/modules/xpdf/images/rss.gif XoopsModules/xpdf/trunk/modules/xpdf/images/txmodxoops_logo.png XoopsModules/xpdf/trunk/modules/xpdf/images/xpdf_slogo.png XoopsModules/xpdf/trunk/modules/xpdf/include/ XoopsModules/xpdf/trunk/modules/xpdf/include/config.php XoopsModules/xpdf/trunk/modules/xpdf/include/functions.php XoopsModules/xpdf/trunk/modules/xpdf/include/index.html XoopsModules/xpdf/trunk/modules/xpdf/include/install.php XoopsModules/xpdf/trunk/modules/xpdf/include/search.inc.php XoopsModules/xpdf/trunk/modules/xpdf/index.php XoopsModules/xpdf/trunk/modules/xpdf/js/ XoopsModules/xpdf/trunk/modules/xpdf/js/index.html XoopsModules/xpdf/trunk/modules/xpdf/js/script.js XoopsModules/xpdf/trunk/modules/xpdf/language/ XoopsModules/xpdf/trunk/modules/xpdf/language/english/ XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/blank.gif XoopsModules/xpdf/trunk/modules/xpdf/language/english/blocks.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/help/ XoopsModules/xpdf/trunk/modules/xpdf/language/english/help/help.html XoopsModules/xpdf/trunk/modules/xpdf/language/english/help/index.html XoopsModules/xpdf/trunk/modules/xpdf/language/english/index.html XoopsModules/xpdf/trunk/modules/xpdf/language/english/main.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/modinfo.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/new.png XoopsModules/xpdf/trunk/modules/xpdf/language/english/popular.png XoopsModules/xpdf/trunk/modules/xpdf/language/english/updated.png XoopsModules/xpdf/trunk/modules/xpdf/language/index.html XoopsModules/xpdf/trunk/modules/xpdf/sql/ XoopsModules/xpdf/trunk/modules/xpdf/sql/index.html XoopsModules/xpdf/trunk/modules/xpdf/sql/mysql.sql XoopsModules/xpdf/trunk/modules/xpdf/templates/ XoopsModules/xpdf/trunk/modules/xpdf/templates/admin/ XoopsModules/xpdf/trunk/modules/xpdf/templates/admin/index.html XoopsModules/xpdf/trunk/modules/xpdf/templates/blocks/ XoopsModules/xpdf/trunk/modules/xpdf/templates/blocks/index.html XoopsModules/xpdf/trunk/modules/xpdf/templates/blocks/xpdf_cat_block_day.html XoopsModules/xpdf/trunk/modules/xpdf/templates/blocks/xpdf_cat_block_random.html XoopsModules/xpdf/trunk/modules/xpdf/templates/blocks/xpdf_cat_block_recent.html XoopsModules/xpdf/trunk/modules/xpdf/templates/blocks/xpdf_doc_block_day.html XoopsModules/xpdf/trunk/modules/xpdf/templates/blocks/xpdf_doc_block_random.html XoopsModules/xpdf/trunk/modules/xpdf/templates/blocks/xpdf_doc_block_recent.html XoopsModules/xpdf/trunk/modules/xpdf/templates/index.html XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_doclist.html XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_footer.html XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_header.html XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_index.html XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_viewcat.html XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_viewdoc.html XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php XoopsModules/xpdf/trunk/modules/xpdf/viewdoc.php XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php Added: XoopsModules/xpdf/trunk/modules/xpdf/admin/about.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/about.php (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/about.php 2012-04-30 19:51:13 UTC (rev 9417) @@ -0,0 +1,34 @@ +<?php +/** + * **************************************************************************** + * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org ) + * **************************************************************************** + * XPDF - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * 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. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops ( http://www.txmodxoops.org ) + * @license GNU GPL see License + * @package xpdf + * @author TXMod Xoops ( su...@tx... ) + * + * Version : 1.01 Mon 2012/04/30 15:11:55 : 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/xpdf/trunk/modules/xpdf/admin/admin_footer.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_footer.php (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_footer.php 2012-04-30 19:51:13 UTC (rev 9417) @@ -0,0 +1,35 @@ +<?php +/** + * **************************************************************************** + * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org ) + * **************************************************************************** + * XPDF - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * 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. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops ( http://www.txmodxoops.org ) + * @license GNU GPL see License + * @package xpdf + * @author TXMod Xoops ( su...@tx... ) + * + * Version : 1.01 Mon 2012/04/30 15:11:55 : 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 small italic pad5'> + <strong>" . $xoopsModule->getVar('name') . "</strong> "._AM_XPDF_MAINTAINEDBY." + <a href='http://www.txmodxoops.org/modules/newbb' title='Visit TXMod Xoops Community' class='tooltip' rel='external'>TXMod Xoops Community</a></div>"; +xoops_cp_footer(); Added: XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_header.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_header.php (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_header.php 2012-04-30 19:51:13 UTC (rev 9417) @@ -0,0 +1,88 @@ +<?php +/** + * **************************************************************************** + * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org ) + * **************************************************************************** + * XPDF - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * 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. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops ( http://www.txmodxoops.org ) + * @license GNU GPL see License + * @package xpdf + * @author TXMod Xoops ( su...@tx... ) + * + * Version : 1.01 Mon 2012/04/30 15:11:55 : timgno Exp $ + * **************************************************************************** + */ + +include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; +include_once XOOPS_ROOT_PATH . '/include/cp_functions.php'; +include_once XOOPS_ROOT_PATH . '/class/tree.php'; +include_once '../include/config.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_XPDF_NOFRAMEWORKS); + 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'); + +$catHandler=& xoops_getModuleHandler('xpdf_cat', $dirname); +$docHandler=& xoops_getModuleHandler('xpdf_doc', $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); +//xoops_cp_header(); + +//Load languages +xoops_loadLanguage('admin', $xoopsModule->getVar("dirname")); +xoops_loadLanguage('modinfo', $xoopsModule->getVar("dirname")); +xoops_loadLanguage('main', $xoopsModule->getVar("dirname")); Added: XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php 2012-04-30 19:51:13 UTC (rev 9417) @@ -0,0 +1,188 @@ +<?php +/** + * **************************************************************************** + * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org ) + * **************************************************************************** + * XPDF - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * 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. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops ( http://www.txmodxoops.org ) + * @license GNU GPL see License + * @package xpdf + * @author TXMod Xoops ( su...@tx... ) + * + * Version : 1.01 Mon 2012/04/30 15:11:55 : timgno Exp $ + * **************************************************************************** + */ + +include "admin_header.php"; +xoops_cp_header(); +global $pathImageIcon; +// We recovered the value of the argument op in the URL$ +$op = xpdf_CleanVars($_REQUEST, 'op', 'list', 'string'); + +$catAdmin = new ModuleAdmin(); +switch ($op) +{ + case "list": + default: + echo $catAdmin->addNavigation('categories.php'); + $catAdmin->addItemButton(_AM_XPDF_NEWCAT, 'categories.php?op=new_cat', 'add'); + echo $catAdmin->renderButton(); + $limit = $GLOBALS['xoopsModuleConfig']['adminperpage']; + $criteria = new CriteriaCompo(); + $criteria->setSort("cat_weight ASC, cat_title"); + $criteria->setOrder("ASC"); + $numrows = $catHandler->getCount(); + $start = xpdf_CleanVars ( $_REQUEST, 'start', 0, 'int' ); + $criteria->setStart($start); + $criteria->setLimit($limit); + $cat_arr = $catHandler->getall($criteria); + if ( $numrows > $limit ) { + include_once XOOPS_ROOT_PATH . "/class/pagenav.php"; + $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list'); + $pagenav = $pagenav->renderNav(4); + } else { + $pagenav = ''; + } + + // View Table + if ($numrows>0) + { + echo "<table class='outer width100' cellspacing='1'> + <tr> + <th class='center width2'>"._AM_XPDF_CAT_ID."</th> + <th class='center'>"._AM_XPDF_CAT_TITLE."</th> + <th class='center'>"._AM_XPDF_CAT_IMAGE."</th> + <th class='center'>"._AM_XPDF_CAT_DESCRIPTION."</th> + <th class='center'>"._AM_XPDF_CAT_WEIGHT."</th> + <th class='center width5'>"._AM_XPDF_FORMACTION."</th> + </tr>"; + + $class = "odd"; + foreach (array_keys($cat_arr) as $i) + { + echo "<tr class='".$class."'>"; + $class = ($class == "even") ? "odd" : "even"; + echo "<td class='center'>".$i."</td>"; + echo "<td class='center'>".$cat_arr[$i]->getVar("cat_title")."</td>"; + echo "<td class='center'><img src='".XOOPS_UPLOAD_URL."/xpdf/images/cat/".$cat_arr[$i]->getVar("cat_image")."' height='30px' title='cat_image' alt='cat_image'></td>"; + echo "<td class='center'>".$cat_arr[$i]->getVar("cat_description")."</td>"; + echo "<td class='center'>".$cat_arr[$i]->getVar("cat_weight")."</td>"; + + echo "<td class='center width5'> + <a href='categories.php?op=edit_cat&cat_id=".$i."'><img src=".$pathImageIcon."/edit.png alt='"._EDIT."' title='"._EDIT."'></a> + <a href='categories.php?op=delete_cat&cat_id=".$i."'><img src=".$pathImageIcon."/delete.png alt='"._DELETE."' title='"._DELETE."'></a> + </td>"; + echo "</tr>"; + } + echo "</table><br /><br />"; + echo "<br /><div class='center'>" . $pagenav . "</div><br />"; + } else { + echo "<table class='outer width100' cellspacing='1'> + <tr> + <th class='center width2'>"._AM_XPDF_CAT_ID."</th> + <th class='center'>"._AM_XPDF_CAT_TITLE."</th> + <th class='center'>"._AM_XPDF_CAT_IMAGE."</th> + <th class='center'>"._AM_XPDF_CAT_DESCRIPTION."</th> + <th class='center'>"._AM_XPDF_CAT_WEIGHT."</th> + <th class='center width5'>"._AM_XPDF_FORMACTION."</th> + </tr>"; + echo "</table><br /><br />"; + } + break; + + case "new_cat": + echo $catAdmin->addNavigation("categories.php"); + $catAdmin->addItemButton(_AM_XPDF_CATLIST, 'categories.php?op=list', 'list'); + echo $catAdmin->renderButton(); + + $obj =& $catHandler->create(); + $form = $obj->getForm(); + $form->display(); + break; + + case "save_cat": + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("categories.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_image + include_once XOOPS_ROOT_PATH."/class/uploader.php"; + $uploaddir = XOOPS_UPLOAD_PATH."/xpdf/images/cat/"; + $uploader = new XoopsMediaUploader($uploaddir, $GLOBALS['xoopsModuleConfig']['mimetypes'], + $GLOBALS['xoopsModuleConfig']['maxsize'], null, null); + if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { + $uploader->setPrefix("cat_image_") ; + $uploader->fetchMedia($_POST['xoops_upload_file'][0]); + if (!$uploader->upload()) { + $errors = $uploader->getErrors(); + redirect_header("javascript:history.go(-1)",3, $errors); + } else { + $obj->setVar("cat_image", $uploader->getSavedFileName()); + } + } else { + $obj->setVar("cat_image", $_REQUEST["cat_image"]); + } + //Form cat_description + $obj->setVar("cat_description", $_REQUEST["cat_description"]); + //Form cat_weight + $obj->setVar("cat_weight", $_REQUEST["cat_weight"]); + + if ($catHandler->insert($obj)) { + redirect_header("categories.php?op=list", 2, _AM_XPDF_FORMOK); + } + + echo $obj->getHtmlErrors(); + $form =& $obj->getForm(); + $form->display(); + break; + + case "edit_cat": + echo $catAdmin->addNavigation("categories.php"); + $catAdmin->addItemButton(_AM_XPDF_NEWCAT, 'categories.php?op=new_cat', 'add'); + $catAdmin->addItemButton(_AM_XPDF_CATLIST, 'categories.php?op=list', 'list'); + echo $catAdmin->renderButton(); + $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("categories.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if ($catHandler->delete($obj)) { + redirect_header("categories.php", 3, _AM_XPDF_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array("ok" => 1, "cat_id" => $_REQUEST["cat_id"], "op" => "delete_cat"), $_SERVER["REQUEST_URI"], sprintf(_AM_XPDF_FORMSUREDEL, $obj->getVar("cat_title"))); + } + break; +} +include "admin_footer.php"; +?> \ No newline at end of file Added: XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php 2012-04-30 19:51:13 UTC (rev 9417) @@ -0,0 +1,269 @@ +<?php +/** + * **************************************************************************** + * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org ) + * **************************************************************************** + * XPDF - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * 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. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops ( http://www.txmodxoops.org ) + * @license GNU GPL see License + * @package xpdf + * @author TXMod Xoops ( su...@tx... ) + * + * Version : 1.01 Mon 2012/04/30 15:11:55 : timgno Exp $ + * **************************************************************************** + */ +include "admin_header.php"; +xoops_cp_header(); +global $pathImageIcon; +// We recovered the value of the argument op in the URL$ +$op = xpdf_CleanVars($_REQUEST, 'op', 'list', 'string'); + +$docAdmin = new ModuleAdmin(); +switch ($op) +{ + case "list": + default: + echo $docAdmin->addNavigation('documents.php'); + $docAdmin->addItemButton(_AM_XPDF_NEWDOC, 'documents.php?op=new_doc', 'add'); + echo $docAdmin->renderButton(); + $limit = $GLOBALS['xoopsModuleConfig']['adminperpage']; + $cat_arr = $catHandler->getall(); + $numrowscat = count( $cat_arr ); + // Redirect if there aren't categories + if ( $numrowscat == 0 ) { + redirect_header('categories.php?op=new_cat', 2, _AM_XPDF_REDIRECT_NOCAT ); + } + $criteria = new CriteriaCompo(); + $criteria->setSort("doc_weight ASC, doc_title"); + $criteria->setOrder("ASC"); + $numrows = $docHandler->getCount(); + $start = xpdf_CleanVars ( $_REQUEST, 'start', 0, 'int' ); + $criteria->setStart($start); + $criteria->setLimit($limit); + $doc_arr = $docHandler->getall($criteria); + if ( $numrows > $limit ) { + include_once XOOPS_ROOT_PATH . "/class/pagenav.php"; + $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list'); + $pagenav = $pagenav->renderNav(4); + } else { + $pagenav = ''; + } + + // View Table + if ($numrows>0) + { + echo "<table class='outer width100' cellspacing='1'> + <tr> + <th class='center width2'>"._AM_XPDF_DOC_ID."</th> + <th class='center'>"._AM_XPDF_DOC_TITLE."</th> + <th class='center'>"._AM_XPDF_DOC_CID."</th> + <th class='center'>"._AM_XPDF_DOC_IMAGE."</th> + <th class='center'>"._AM_XPDF_DOC_SUBJECT."</th> + <th class='center'>"._AM_XPDF_DOC_SUBMITTER."</th> + <th class='center'>"._AM_XPDF_DOC_PUBLISHED."</th> + <th class='center'>"._AM_XPDF_DOC_STATUS."</th> + <th class='center'>"._AM_XPDF_DOC_WEIGHT."</th> + <th class='center'>"._AM_XPDF_DOC_ONLINE."</th> + <th class='center width5'>"._AM_XPDF_FORMACTION."</th> + </tr>"; + + $class = "odd"; + foreach (array_keys($doc_arr) as $i) + { + echo "<tr class='".$class."'>"; + $class = ($class == "even") ? "odd" : "even"; + echo "<td class='center'>".$i."</td>"; + echo "<td class='center'>".$doc_arr[$i]->getVar("doc_title")."</td>"; + $mytree = new XoopsObjectTree($cat_arr, 'cat_id', 'cat_pid'); + $category = xpdf_PathTree($mytree, $doc_arr[$i]->getVar('doc_cid'), $cat_arr, 'cat_title', $prefix = ' <img src="../images/icons/arrow.gif"> ' ); + echo "<td class='center'>".$category."</td>"; + echo "<td class='center'><img src='".XOOPS_UPLOAD_URL."/xpdf/images/doc/".$doc_arr[$i]->getVar("doc_image")."' height='30px' title='doc_image' alt='doc_image'></td>"; + echo "<td class='center'>".$doc_arr[$i]->getVar("doc_subject")."</td>"; + echo "<td class='center'>".XoopsUser::getUnameFromId($doc_arr[$i]->getVar("doc_submitter"),"S")."</td>"; + echo "<td class='center'>".formatTimeStamp($doc_arr[$i]->getVar("doc_published"),"S")."</td>"; + + if ( $doc_arr[$i]->getVar("doc_status") == 1 ) { + echo "<td class='center'><img src=".$pathImageIcon."/green_ball.png border='0' alt='"._AM_XPDF_DELETEPDF."' /></td>"; + } else { + echo "<td class='center'><img src=".$pathImageIcon."/red_ball.png border='0' alt='"._AM_XPDF_CREATEPDF."' /></td>"; + } + + echo "<td class='center'>".$doc_arr[$i]->getVar("doc_weight")."</td>"; + + if ( $doc_arr[$i]->getVar("doc_online") == 1 ) { + echo "<td class='center'><a href='./documents.php?op=update_online&doc_id=".$i."&doc_online=0'><img src=".$pathImageIcon."/on.png border='0' alt='"._ONLINE."' title='"._ONLINE."'></a></td>"; + } else { + echo "<td class='center'><a href='./documents.php?op=update_online&doc_id=".$i."&doc_online=1'><img src=".$pathImageIcon."/off.png border='0' alt='"._OFFLINE."' title='"._OFFLINE."'></a></td>"; + } + + echo "<td class='center width5'> + <a href='documents.php?op=edit_doc&doc_id=".$i."'><img src=".$pathImageIcon."/edit.png alt='"._EDIT."' title='"._EDIT."'></a> + <a href='documents.php?op=delete_doc&doc_id=".$i."'><img src=".$pathImageIcon."/delete.png alt='"._DELETE."' title='"._DELETE."'></a> + </td>"; + echo "</tr>"; + } + echo "</table><br /><br />"; + echo "<br /><div class='center'>" . $pagenav . "</div><br />"; + } else { + echo "<table class='outer width100' cellspacing='1'> + <tr> + <th class='center width2'>"._AM_XPDF_DOC_ID."</th> + <th class='center'>"._AM_XPDF_DOC_CID."</th> + <th class='center'>"._AM_XPDF_DOC_TITLE."</th> + <th class='center'>"._AM_XPDF_DOC_IMAGE."</th> + <th class='center'>"._AM_XPDF_DOC_SUBJECT."</th> + <th class='center'>"._AM_XPDF_DOC_SUBMITTER."</th> + <th class='center'>"._AM_XPDF_DOC_PUBLISHED."</th> + <th class='center'>"._AM_XPDF_DOC_STATUS."</th> + <th class='center'>"._AM_XPDF_DOC_WEIGHT."</th> + <th class='center'>"._AM_XPDF_DOC_ONLINE."</th> + <th class='center width5'>"._AM_XPDF_FORMACTION."</th> + </tr>"; + echo "</table><br /><br />"; + } + break; + + case "new_doc": + echo $docAdmin->addNavigation("documents.php"); + $docAdmin->addItemButton(_AM_XPDF_DOCLIST, 'documents.php?op=list', 'list'); + echo $docAdmin->renderButton(); + + $obj =& $docHandler->create(); + $form = $obj->getForm(); + $form->display(); + break; + + case "save_doc": + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("documents.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if (isset($_REQUEST["doc_id"])) { + $obj =& $docHandler->get($_REQUEST["doc_id"]); + } else { + $obj =& $docHandler->create(); + } + + //Form doc_cid + $obj->setVar("doc_cid", $_REQUEST["doc_cid"]); + //Form doc_filename + $obj->setVar("doc_filename", $_REQUEST["doc_filename"]); + //Form doc_title + $obj->setVar("doc_title", $_REQUEST["doc_title"]); + //Form doc_slogan + $obj->setVar("doc_slogan", $_REQUEST["doc_slogan"]); + //Form doc_pdftext + $obj->setVar("doc_pdftext", $_REQUEST["doc_pdftext"]); + //Form doc_image + include_once XOOPS_ROOT_PATH."/class/uploader.php"; + $uploaddir = XOOPS_UPLOAD_PATH."/xpdf/images/"; + $uploader = new XoopsMediaUploader($uploaddir, $GLOBALS['xoopsModuleConfig']['mimetypes'], + $GLOBALS['xoopsModuleConfig']['maxsize'], null, null); + if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { + $uploader->setPrefix("doc_image_") ; + $uploader->fetchMedia($_POST['xoops_upload_file'][0]); + if (!$uploader->upload()) { + $errors = $uploader->getErrors(); + redirect_header("javascript:history.go(-1)",3, $errors); + } else { + $obj->setVar("doc_image", $uploader->getSavedFileName()); + } + } else { + $obj->setVar("doc_image", $_REQUEST["doc_image"]); + } + //Form doc_subject + $obj->setVar("doc_subject", $_REQUEST["doc_subject"]); + //Form doc_fontname + $obj->setVar("doc_fontname", $_REQUEST["doc_fontname"]); + //Form doc_fontsize + $obj->setVar("doc_fontsize", $_REQUEST["doc_fontsize"]); + //Form doc_keywords + $obj->setVar("doc_keywords", $_REQUEST["doc_keywords"]); + //Form doc_submitter + $obj->setVar("doc_submitter", $_REQUEST["doc_submitter"]); + //Form doc_published + $obj->setVar("doc_published", xpdf_convertDate($_REQUEST["doc_published"])); + //Form doc_weight + $obj->setVar("doc_weight", $_REQUEST["doc_weight"]); + //Form doc_status + $verif_doc_status = ($_REQUEST["doc_status"] == 1) ? "1" : "0"; + $obj->setVar("doc_status", $verif_doc_status); + //Form doc_dohtml + $verif_doc_dohtml = ($_REQUEST["doc_dohtml"] == 1) ? "1" : "0"; + $obj->setVar("doc_dohtml", $verif_doc_dohtml); + //Form doc_smilies + $verif_doc_smilies = ($_REQUEST["doc_smilies"] == 1) ? "1" : "0"; + $obj->setVar("doc_smilies", $verif_doc_smilies); + //Form doc_doxcodes + $verif_doc_doxcodes = ($_REQUEST["doc_doxcodes"] == 1) ? "1" : "0"; + $obj->setVar("doc_doxcodes", $verif_doc_doxcodes); + //Form doc_doimages + $verif_doc_doimages = ($_REQUEST["doc_doimages"] == 1) ? "1" : "0"; + $obj->setVar("doc_doimages", $verif_doc_doimages); + //Form doc_dobreak + $verif_doc_dobreak = ($_REQUEST["doc_dobreak"] == 1) ? "1" : "0"; + $obj->setVar("doc_dobreak", $verif_doc_dobreak); + //Form doc_online + $verif_doc_online = ($_REQUEST["doc_online"] == 1) ? "1" : "0"; + $obj->setVar("doc_online", $verif_doc_online); + + if ($docHandler->insert($obj)) { + redirect_header("documents.php?op=list", 2, _AM_XPDF_FORMOK); + } + + echo $obj->getHtmlErrors(); + $form =& $obj->getForm(); + $form->display(); + break; + + case "edit_doc": + echo $docAdmin->addNavigation("documents.php"); + $docAdmin->addItemButton(_AM_XPDF_NEWDOC, 'documents.php?op=new_doc', 'add'); + $docAdmin->addItemButton(_AM_XPDF_DOCLIST, 'documents.php?op=list', 'list'); + echo $docAdmin->renderButton(); + $obj = $docHandler->get($_REQUEST["doc_id"]); + $form = $obj->getForm(); + $form->display(); + break; + + case "delete_doc": + $obj =& $docHandler->get($_REQUEST["doc_id"]); + if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("documents.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if ($docHandler->delete($obj)) { + redirect_header("documents.php", 3, _AM_XPDF_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array("ok" => 1, "doc_id" => $_REQUEST["doc_id"], "op" => "delete_doc"), $_SERVER["REQUEST_URI"], sprintf(_AM_XPDF_FORMSUREDEL, $obj->getVar("doc_title"))); + } + break; + + case "update_online": + if (isset($_REQUEST["doc_id"])) { + $obj =& $docHandler->get($_REQUEST["doc_id"]); + } + $obj->setVar("doc_online", $_REQUEST["doc_online"]); + if ($docHandler->insert($obj)) { + redirect_header("documents.php", 3, _AM_XPDF_FORMOK); + } + echo $obj->getHtmlErrors(); + break; +} +include "admin_footer.php"; +?> \ No newline at end of file Added: XoopsModules/xpdf/trunk/modules/xpdf/admin/index.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/index.html (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/index.html 2012-04-30 19:51:13 UTC (rev 9417) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/xpdf/trunk/modules/xpdf/admin/index.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/index.php (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/index.php 2012-04-30 19:51:13 UTC (rev 9417) @@ -0,0 +1,50 @@ +<?php +/** + * **************************************************************************** + * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org ) + * **************************************************************************** + * XPDF - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * 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. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops ( http://www.txmodxoops.org ) + * @license GNU GPL see License + * @package xpdf + * @author TXMod Xoops ( su...@tx... ) + * + * Version : 1.01 Mon 2012/04/30 15:11:55 : timgno Exp $ + * **************************************************************************** + */ +include "admin_header.php"; +xoops_cp_header(); + $indexAdmin = new ModuleAdmin(); + //count "total" + $count_cat = $catHandler->getCount(); + //count "total" + $count_doc = $docHandler->getCount(); + //count "online" + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria("doc_online", 1)); + $doc_online = $docHandler->getCount($criteria); + unset($criteria); + $r = '#FF0000'; // Red + $g = '#00AA00'; // Green + $indexAdmin->addInfoBox(_AM_XPDF_CAT); + $indexAdmin->addInfoBoxLine(_AM_XPDF_CAT,_AM_XPDF_THEREARE_CAT, $count_cat, ($count_cat == 0) ? $r : $g); + $indexAdmin->addInfoBox(_AM_XPDF_DOC); + $indexAdmin->addInfoBoxLine(_AM_XPDF_DOC,_AM_XPDF_THEREARE_DOC, $count_doc, ($count_doc == 0) ? $r : $g); + $indexAdmin->addInfoBoxLine(_AM_XPDF_DOC,_AM_XPDF_THEREARE_DOC_ONLINE, $doc_online, ($count_doc == 0) ? $r : $g); + echo $indexAdmin->addNavigation("index.php"); + echo $indexAdmin->renderIndex(); +include "admin_footer.php"; +?> \ No newline at end of file Added: XoopsModules/xpdf/trunk/modules/xpdf/admin/menu.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/menu.php (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/menu.php 2012-04-30 19:51:13 UTC (rev 9417) @@ -0,0 +1,45 @@ +<?php +/** + * **************************************************************************** + * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org ) + * **************************************************************************** + * XPDF - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * 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. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops ( http://www.txmodxoops.org ) + * @license GNU GPL see License + * @package xpdf + * @author TXMod Xoops ( su...@tx... ) + * + * Version : 1.01 Mon 2012/04/30 15:11:55 : 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_XPDF_ADMENU1; +$adminmenu[$i]["link"] = "admin/index.php"; +$adminmenu[$i]["icon"] = "images/32/dashboard.png"; $i++; +$adminmenu[$i]["title"] = _MI_XPDF_ADMENU2; +$adminmenu[$i]["link"] = "admin/categories.php"; +$adminmenu[$i]["icon"] = "images/32/pdf_category.png"; $i++; +$adminmenu[$i]["title"] = _MI_XPDF_ADMENU3; +$adminmenu[$i]["link"] = "admin/documents.php"; +$adminmenu[$i]["icon"] = "images/32/pdf_document.png"; $i++; +$adminmenu[$i]["title"] = _MI_XPDF_ADMENU4; +$adminmenu[$i]["link"] = "admin/about.php"; +$adminmenu[$i]["icon"] = "../../".$pathImageAdmin."/about.png"; unset( $i ); Added: XoopsModules/xpdf/trunk/modules/xpdf/blocks/blocks_doc.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/blocks/blocks_doc.php (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/blocks/blocks_doc.php 2012-04-30 19:51:13 UTC (rev 9417) @@ -0,0 +1,99 @@ +<?php +/** + * **************************************************************************** + * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org ) + * **************************************************************************** + * XPDF - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * 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. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops ( http://www.txmodxoops.org ) + * @license GNU GPL see License + * @package xpdf + * @author TXMod Xoops ( su...@tx... ) + * + * Version : 1.01 Mon 2012/04/30 15:11:55 : timgno Exp $ + * **************************************************************************** + */ + +include_once XOOPS_ROOT_PATH."/modules/xpdf/include/functions.php"; + +function b_xpdf_doc($options) { + include_once XOOPS_ROOT_PATH."/modules/xpdf/class/doc.php"; + $myts =& MyTextSanitizer::getInstance(); + + $doc = array(); + $type_block = $options[0]; + $nb_doc = $options[1]; + $lenght_title = $options[2]; + + $docHandler =& xoops_getModuleHandler("xpdf_doc", "xpdf"); + $criteria = new CriteriaCompo(); + array_shift($options); + array_shift($options); + array_shift($options); + + switch ($type_block) + { + // For the block: doc recents + case "recent": + $criteria->add(new Criteria("doc_online", 1)); + $criteria->setSort("doc_created"); + $criteria->setOrder("DESC"); + break; + // For the block: doc of today + case "day": + $criteria->add(new Criteria("doc_online", 1)); + $criteria->add(new Criteria("doc_created", strtotime(date("Y/m/d")), ">=")); + $criteria->add(new Criteria("doc_created", strtotime(date("Y/m/d"))+86400, "<=")); + $criteria->setSort("doc_created"); + $criteria->setOrder("ASC"); + break; + // For the block: doc random + case "random": + $criteria->add(new Criteria("doc_online", 1)); + $criteria->setSort("RAND()"); + break; + } + + $criteria->setLimit($nb_doc); + $doc_arr = $docHandler->getall($criteria); + foreach (array_keys($doc_arr) as $i) + { + $doc[$i]["doc_id"] = $doc_arr[$i]->getVar("doc_id"); + $doc[$i]["doc_cid"] = $doc_arr[$i]->getVar("doc_cid"); + $doc[$i]["doc_filename"] = $doc_arr[$i]->getVar("doc_filename"); + $doc[$i]["doc_submitter"] = $doc_arr[$i]->getVar("doc_submitter"); + $doc[$i]["doc_created"] = $doc_arr[$i]->getVar("doc_created"); + $doc[$i]["doc_online"] = $doc_arr[$i]->getVar("doc_online"); + } + return $doc; +} + +function b_xpdf_doc_edit($options) { + $form = ""._MB_XPDF_DOC_DISPLAY."\n"; + $form .= "<input type=\"hidden\" name=\"options[0]\" value=\"".$options[0]."\" />"; + $form .= "<input name=\"options[1]\" size=\"5\" maxlength=\"255\" value=\"".$options[1]."\" type=\"text\" /> <br />"; + $form .= ""._MB_XPDF_DOC_TITLELENGTH." : <input name=\"options[2]\" size=\"5\" maxlength=\"255\" value=\"".$options[2]."\" type=\"text\" /><br /><br />"; + array_shift($options); + array_shift($options); + array_shift($options); + $form .= ""._MB_XPDF_DOC_CATTODISPLAY."<br /><select name=\"options[]\" multiple=\"multiple\" size=\"5\">"; + $form .= "<option value=\"0\" " . (array_search(0, $options) === false ? "" : "selected=\"selected\"") . ">" ._MB_XPDF_DOC_ALLCAT . "</option>"; + foreach (array_keys($cat_arr) as $i) { + $form .= "<option value=\"" . $cat_arr[$i]->getVar("cat_id") . "\" " . (array_search($cat_arr[$i]->getVar("cat_id"), $options) === false ? "" : "selected=\"selected\"") . ">".$cat_arr[$i]->getVar("cat_title")."</option>"; + } + $form .= "</select>"; + return $form; +} +?> \ No newline at end of file Added: XoopsModules/xpdf/trunk/modules/xpdf/blocks/index.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/blocks/index.html (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/blocks/index.html 2012-04-30 19:51:13 UTC (rev 9417) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/xpdf/trunk/modules/xpdf/class/index.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/class/index.html (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/class/index.html 2012-04-30 19:51:13 UTC (rev 9417) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_cat.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_cat.php (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_cat.php 2012-04-30 19:51:13 UTC (rev 9417) @@ -0,0 +1,119 @@ +<?php +/** + * **************************************************************************** + * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org ) + * **************************************************************************** + * XPDF - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * 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. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops ( http://www.txmodxoops.org ) + * @license GNU GPL see License + * @package xpdf + * @author TXMod Xoops ( su...@tx... ) + * + * Version : 1.01 Mon 2012/04/30 15:11:55 : timgno Exp $ + * **************************************************************************** + */ + +if (!defined("XOOPS_ROOT_PATH")) { + die("XOOPS root path not defined"); +} + +class xpdf_cat extends XoopsObject +{ + //Constructor + function __construct() + { + $this->XoopsObject(); + $this->initVar("cat_id", XOBJ_DTYPE_INT, null, false, 8); + $this->initVar("cat_pid", XOBJ_DTYPE_INT, null, false, 5); + $this->initVar("cat_title", XOBJ_DTYPE_TXTBOX, null, false, 255); + $this->initVar("cat_image", XOBJ_DTYPE_TXTBOX, null, false, 100); + $this->initVar("cat_description", XOBJ_DTYPE_TXTAREA, null, false); + $this->initVar("cat_weight", XOBJ_DTYPE_INT, 0, false, 11); + } + + function xpdf_cat() + { + $this->__construct(); + } + + function getForm($action = false) + { + global $xoopsDB, $xoopsModuleConfig; + + if ($action === false) { + $action = $_SERVER["REQUEST_URI"]; + } + + $title = $this->isNew() ? sprintf(_AM_XPDF_CAT_ADD) : sprintf(_AM_XPDF_CAT_EDIT); + + include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php"); + $form = new XoopsThemeForm($title, "form_cat", $action, "post", true); + $form->setExtra('enctype="multipart/form-data"'); + + $form->addElement(new XoopsFormText(_AM_XPDF_CAT_TITLE, "cat_title", 50, 255, $this->getVar("cat_title")), true); + // Subcategories + include_once(XOOPS_ROOT_PATH."/class/tree.php"); + $catHandler =& xoops_getModuleHandler("xpdf_cat", XPDF_DIRNAME); + $criteria = new CriteriaCompo(); + $criteria->setSort('cat_id'); + $criteria->setOrder('ASC'); + $cat_arr = $catHandler->getall(); + $mytree = new XoopsObjectTree($cat_arr, "cat_id", "cat_pid"); + $form->addElement(new XoopsFormLabel(_AM_XPDF_CAT_PID, $mytree->makeSelBox("cat_pid", "cat_title","--", $this->getVar("cat_pid"),false))); + + $cat_image = $this->getVar("cat_image") ? $this->getVar("cat_image") : 'blank.gif'; + $uploadirectory = '/uploads/xpdf/images/cat'; + $imgtray = new XoopsFormElementTray(_AM_XPDF_CAT_IMAGE,'<br />'); + $imgpath = sprintf(_AM_XPDF_FORMIMAGE_PATH, ".".$uploadirectory."/"); + $imageselect = new XoopsFormSelect($imgpath, 'cat_image', $cat_image); + $image_array = XoopsLists :: getImgListAsArray( XOOPS_ROOT_PATH.$uploadirectory ); + foreach( $image_array as $image ) { + $imageselect->addOption("$image", $image); + } + $imageselect->setExtra( "onchange='showImgSelected(\"image1\", \"cat_image\", \"".$uploadirectory."\", \"\", \"".XOOPS_URL."\")'" ); + $imgtray->addElement($imageselect, false); + $imgtray->addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".$uploadirectory."/".$cat_image."' name='image1' id='image1' alt='' />" ) ); + $fileseltray = new XoopsFormElementTray('','<br />'); + $fileseltray->addElement(new XoopsFormFile(_AM_XPDF_FORMUPLOAD , "cat_image", $GLOBALS['xoopsModuleConfig']['maxsize']),false); + $fileseltray->addElement(new XoopsFormLabel(''), false); + $imgtray->addElement($fileseltray); + $form->addElement($imgtray); + + $editor_configs=array(); + $editor_configs["name"] = "cat_description"; + $editor_configs["value"] = $this->getVar("cat_description", "e"); + $editor_configs["rows"] = 10; + $editor_configs["cols"] = 80; + $editor_configs["width"] = "100%"; + $editor_configs["height"] = "400px"; + $editor_configs["editor"] = $GLOBALS["xoopsModuleConfig"]["xpdf_editor"]; + $form->addElement( new XoopsFormEditor(_AM_XPDF_CAT_DESCRIPTION, "cat_description", $editor_configs), false ); + + $form->addElement(new XoopsFormText(_AM_XPDF_CAT_WEIGHT, "cat_weight", 10, 25, $this->getVar("cat_weight")), true); + + $form->addElement(new XoopsFormHidden("op", "save_cat")); + $form->addElement(new XoopsFormButton("", "submit", _SUBMIT, "submit")); + return $form; + } +} +class xpdfxpdf_catHandler extends XoopsPersistableObjectHandler +{ + function __construct(&$db) + { + parent::__construct($db, "xpdf_cat", "xpdf_cat", "cat_id", "cat_pid"); + } +} +?> \ No newline at end of file Added: XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php 2012-04-30 19:51:13 UTC (rev 9417) @@ -0,0 +1,300 @@ +<?php +/** + * **************************************************************************** + * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org ) + * **************************************************************************** + * XPDF - MODULE FOR XOOPS + * Copyright (c) 2007 - 2012 + * 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. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + * @copyright TXMod Xoops ( http://www.txmodxoops.org ) + * @license GNU GPL see License + * @package xpdf + * @author TXMod Xoops ( su...@tx... ) + * + * Version : 1.01 Mon 2012/04/30 15:11:55 : timgno Exp $ + * **************************************************************************** + */ + +if (!defined("XOOPS_ROOT_PATH")) { + die("XOOPS root path not defined"); +} + +class xpdf_doc extends XoopsObject +{ + //Constructor + function __construct() + { + $this->XoopsObject(); + $this->initVar("doc_id", XOBJ_DTYPE_INT, null, false, 8); + $this->initVar("doc_cid", XOBJ_DTYPE_INT, null, false, 5); + $this->initVar("doc_filename", XOBJ_DTYPE_TXTBOX, null, false, 50); + $this->initVar("doc_title", XOBJ_DTYPE_TXTBOX, null, false, 255); + $this->initVar("doc_slogan", XOBJ_DTYPE_TXTAREA, null, false); + $this->initVar("doc_pdftext", XOBJ_DTYPE_TXTAREA, null, false); + $this->initVar("doc_image", XOBJ_DTYPE_TXTBOX, null, false, 100); + $this->initVar("doc_subject", XOBJ_DTYPE_TXTBOX, null, false, 100); + $this->initVar("doc_fontname", XOBJ_DTYPE_TXTBOX, null, false, 50); + $this->initVar("doc_fontsize", XOBJ_DTYPE_INT, null, false, 5); + $this->initVar("doc_keywords", XOBJ_DTYPE_TXTBOX, null, false, 255); + $this->initVar("doc_submitter", XOBJ_DTYPE_INT, null, false, 10); + $this->initVar("doc_published", XOBJ_DTYPE_INT, null, false, 10); + $this->initVar("doc_hits", XOBJ_DTYPE_INT, null, false, 11); + $this->initVar("doc_weight", XOBJ_DTYPE_INT, null, false, 11); + $this->initVar("doc_status", XOBJ_DTYPE_INT, null, false, 1); + $this->initVar("doc_online", XOBJ_DTYPE_INT, null, false, 1); + $this->initVar("doc_dohtml", XOBJ_DTYPE_INT, null, false, 1); + $this->initVar("doc_smilies", XOBJ_DTYPE_INT, null, false, 1); + $this->initVar("doc_doxcodes", XOBJ_DTYPE_INT, null, false, 1); + $this->initVar("doc_doimages", XOBJ_DTYPE_INT, null, false, 1); + $this->initVar("doc_dobreak", XOBJ_DTYPE_INT, null, false, 1); + } + + function xpdf_doc() + { + $this->__construct(); + } + + function getForm($action = false) + { + global $xoopsDB, $xoopsModuleConfig; + + if ($action === false) { + $action = $_SERVER["REQUEST_URI"]; + } + + $title = $this->isNew() ? sprintf(_AM_XPDF_DOC_ADD) : sprintf(_AM_XPDF_DOC_EDIT); + + include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php"); + $form = new XoopsThemeForm($title, "form_doc", $action, "post", true); + $form->setExtra('enctype="multipart/form-data"'); + + $form->addElement(new XoopsFormText(_AM_XPDF_DOC_FILENAME, "doc_filename", 50, 255, $this->getVar("doc_filename")), true); + $form->addElement(new XoopsFormText(_AM_XPDF_DOC_TITLE, "doc_title", 50, 255, $this->getVar("doc_title")), true); + + $catHandler =& xoops_getModuleHandler("xpdf_cat", XPDF_DIRNAME); + $criteria = new CriteriaCompo(); + $criteria->setSort('cat_weight ASC, cat_title'); + $criteria->setOrder('ASC'); + $cat_arr = $catHandler->getall($criteria); + $mytree = new XoopsObjectTree($cat_arr, "cat_id", "cat_pid"); + $form->addElement(new XoopsFormLabel(_AM_XPDF_DOC_CID, $mytree->makeSelBox("doc_cid", "cat_title","--", $this->getVar("doc_cid"),false))); + + $form->addElement(new XoopsFormText(_AM_XPDF_DOC_SUBJECT, "doc_subject", 50, 255, $this->getVar("doc_subject")), true); + // Font Name + $font_tray = new XoopsFormElementTray(_FONT, ' '); + $doc_fontname = $this->getVar('doc_fontname') ? $this->getVar('doc_fontname') : $GLOBALS['xoopsModuleConfig']['fontname']; + $fontnameselect = new XoopsFormSelect(_AM_XPDF_DOC_FONTNAME, 'doc_fontname', $doc_fontname); + $fonts_array = XoopsLists::getFontList(); + foreach( $fonts_array as $font ) { + $fontnameselect->addOption("$font", $font); + } + $font_tray->addElement($fontnameselect); + // Font Size + $doc_fontsize = $this->getVar('doc_fontsize') ? $this->getVar('doc_fontsize') : $GLOBALS['xoopsModuleConfig']['fontsize']; + $fontsizeselect = new XoopsFormSelect(_AM_XPDF_DOC_FONTSIZE, 'doc_fontsize', $doc_fontsize); + $fontsizeselect->addOptionArray($this->getFontSize()); + $font_tray->addElement($fontsizeselect); + $form->addElement($font_tray); + + $form->addElement(new XoopsFormTextArea(_AM_XPDF_DOC_SLOGAN, "doc_slogan", $this->getVar("doc_slogan"), 4, 47), true); + + $editor_configs=array(); + $editor_configs["name"] ="doc_pdftext"; + $editor_configs["value"] = $this->getVar("doc_pdftext", "e"); + $editor_configs["rows"] = 10; + $editor_configs["cols"] = 80; + $editor_configs["width"] = "100%"; + $editor_configs["height"] = "400px"; + $editor_configs["editor"] = $GLOBALS["xoopsModuleConfig"]["xpdf_editor"]; + $form->addElement( new XoopsFormEditor(_AM_XPDF_DOC_PDFTEXT, "doc_pdftext", $editor_configs), true ); + + $doc_image = $this->getVar("doc_image") ? $this->getVar("doc_image") : 'blank.gif'; + + $uploadirectory = '/uploads/xpdf/images/doc'; + $imgtray = new XoopsFormElementTray(_AM_XPDF_DOC_IMAGE,'<br />'); + $imgpath = sprintf(_AM_XPDF_FORMIMAGE_PATH, ".".$uploadirectory."/"); + $imageselect = new XoopsFormSelect($imgpath, 'doc_image', $doc_image); + $image_array = XoopsLists :: getImgListAsArray( XOOPS_ROOT_PATH.$uploadirectory ); + foreach( $image_array as $image ) { + $imageselect->addOption("$image", $image); + } + $imageselect->setExtra( "onchange='showImgSelected(\"image1\", \"doc_image\", \"".$uploadirectory."\", \"\", \"".XOOPS_URL."\")'" ); + $imgtray->addElement($imageselect, false); + $imgtray->addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".$uploadirectory."/".$doc_image."' name='image1' id='image1' alt='' />" ) ); + $fileseltray = new XoopsFormElementTray('','<br />'); + $fileseltray->addElement(new XoopsFormFile(_AM_XPDF_FORMUPLOAD , "doc_image", $GLOBALS['xoopsModuleConfig']['maxsize']),false); + $fileseltray->addElement(new XoopsFormLabel(''), false); + $imgtray->addElement($fileseltray); + $form->addElement($imgtray); + + $form->addElement(new XoopsFormText(_AM_XPDF_DOC_KEYWORDS, "doc_keywords", 50, 255, $this->getVar("doc_keywords")), true); + + $form->addElement(new XoopsFormSelectUser(_AM_XPDF_DOC_SUBMITTER, "doc_submitter", false, $this->getVar("doc_submitter"), 1, false), true); + $form->addElement(new XoopsFormText(_AM_XPDF_DOC_WEIGHT, "doc_weight", 10, 25, $this->getVar("doc_weight")), true); + + // Options + $options_tray = new XoopsFormElementTray(_AM_XPDF_DOC_OPTIONS,'<br />'); + $options_tray->setDescription(_AM_XPDF_DOC_OPTIONS_DESC); + + $doc_status = $this->isNew() ? 0 : $this->getVar("doc_status"); + $check_doc_status = new XoopsFormCheckBox(" ", "doc_status", $doc_status); + $check_doc_status->addOption(1, _AM_XPDF_DOC_STATUS); + $options_tray->addElement($check_doc_status); + + $options_tray->addElement(new XoopsFormTextDateSelect(_AM_XPDF_DOC_PUBLISHED, "doc_published", "", $this->getVar("doc_published"))); + + $doc_dohtml = $this->isNew() ? 0 : $this->getVar("doc_dohtml"); + $check_doc_dohtml = new XoopsFormCheckBox(" ", "doc_dohtml", $doc_dohtml); + $check_doc_dohtml->addOption(1, _AM_XPDF_DOC_DOHTML); + $options_tray->addElement($check_doc_dohtml); + + $doc_smilies = $this->isNew() ? 0 : $this->getVar("doc_smilies"); + $check_doc_smilies = new XoopsFormCheckBox(" ", "doc_smilies", $doc_smilies); + $check_doc_smilies->addOption(1, _AM_XPDF_DOC_SMILIES); + $options_tray->addElement($check_doc_smilies); + + $doc_doxcodes = $this->isNew() ? 0 : $this->getVar("doc_doxcodes"); + $check_doc_doxcodes = new XoopsFormCheckBox(" ", "doc_doxcodes", $doc_doxcodes); + $check_doc_doxcodes->addOption(1, _AM_XPDF_DOC_DOXCODES); + $options_tray->addElement($check_doc_doxcodes); + + $doc_doimages = ... [truncated message content] |