From: <txm...@us...> - 2012-04-22 19:11:14
|
Revision: 9374 http://xoops.svn.sourceforge.net/xoops/?rev=9374&view=rev Author: txmodxoops Date: 2012-04-22 19:11:05 +0000 (Sun, 22 Apr 2012) Log Message: ----------- Updated trunk Modified Paths: -------------- XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_header.php XoopsModules/xpdf/trunk/modules/xpdf/admin/broken.php XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php XoopsModules/xpdf/trunk/modules/xpdf/admin/filesname.php XoopsModules/xpdf/trunk/modules/xpdf/admin/index.php XoopsModules/xpdf/trunk/modules/xpdf/admin/modified.php XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_broken.php XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_cat.php XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php XoopsModules/xpdf/trunk/modules/xpdf/css/style.css XoopsModules/xpdf/trunk/modules/xpdf/header.php XoopsModules/xpdf/trunk/modules/xpdf/include/configs.php XoopsModules/xpdf/trunk/modules/xpdf/include/functions.php XoopsModules/xpdf/trunk/modules/xpdf/index.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/main.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/modinfo.php XoopsModules/xpdf/trunk/modules/xpdf/language/italian/admin.php XoopsModules/xpdf/trunk/modules/xpdf/language/italian/main.php XoopsModules/xpdf/trunk/modules/xpdf/language/italian/modinfo.php XoopsModules/xpdf/trunk/modules/xpdf/list.tag.php XoopsModules/xpdf/trunk/modules/xpdf/makepdf.php XoopsModules/xpdf/trunk/modules/xpdf/rss.php XoopsModules/xpdf/trunk/modules/xpdf/singledoc.php XoopsModules/xpdf/trunk/modules/xpdf/sql/mysql.sql 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_rss.html XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_singledoc.html XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_viewcat.html XoopsModules/xpdf/trunk/modules/xpdf/view.tag.php XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php Added Paths: ----------- XoopsModules/xpdf/trunk/modules/xpdf/js/ XoopsModules/xpdf/trunk/modules/xpdf/js/index.html XoopsModules/xpdf/trunk/modules/xpdf/js/js.init.js Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_header.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_header.php 2012-04-22 19:07:20 UTC (rev 9373) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_header.php 2012-04-22 19:11:05 UTC (rev 9374) @@ -24,7 +24,7 @@ */ include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; include_once XOOPS_ROOT_PATH . '/include/cp_functions.php'; -include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; +include_once '../include/configs.php'; include_once '../include/functions.php'; $pathDir = $GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin'); @@ -44,8 +44,8 @@ $catHandler=& xoops_getModuleHandler('xpdf_cat', $dirname); $docsHandler=& xoops_getModuleHandler('xpdf_doc', $dirname); -//$brokHandler=& xoops_getModuleHandler('xpdf_broken', $dirname); -//$modHandler=& xoops_getModuleHandler('xpdf_mod', $dirname); +$brokHandler=& xoops_getModuleHandler('xpdf_broken', $dirname); +$modHandler=& xoops_getModuleHandler('xpdf_mod', $dirname); $purHandler=& xoops_getModuleHandler('xpdf_purchase', $dirname); $vlimHandler=& xoops_getModuleHandler('xpdf_viewlimit', $dirname); Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/broken.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/broken.php 2012-04-22 19:07:20 UTC (rev 9373) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/broken.php 2012-04-22 19:11:05 UTC (rev 9374) @@ -29,7 +29,7 @@ //Options switch ($op) { - // Vue liste + // View list case "list": //Affichage de la partie haute de l'administration de Xoops echo $brokenAdmin->addNavigation('broken.php'); @@ -49,25 +49,22 @@ $start = 0; } $criteria->setSort('reportid'); - $criteria->setOrder('ASC'); - //pour faire une jointure de table - //$docsbroken_Handler->table_link = $docHandler->db->prefix("xpdf_doc"); // Nom de la table en jointure - //$docsbroken_Handler->field_link = "doc_id"; // champ de la table en jointure - //$docsbroken_Handler->field_object = "doc_id"; // champ de la table courante - $docsbroken_arr = $docsHandler->getByLink($criteria); - $numrows = $docsHandler->getCount($criteria); + $criteria->setOrder('ASC'); + $docsbroken_arr = $brokHandler->getAll($criteria); + $numrows = $brokHandler->getCount($criteria); if ( $numrows > $limit ) { + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list&limit=' . $limit); $pagenav = $pagenav->renderNav(4); } else { $pagenav = ''; } - //Affichage du tableau des téléchargements brisés + //Table view of broken files if ($numrows > 0) { echo '<table width="100%" cellspacing="1" class="outer">'; echo '<tr>'; - echo '<th align="center" width="10%">'._AM_XPDF_FORMFILE.'</th>'; - echo '<th align="center">' . _AM_XPDF_FORMTITLE . '</th>'; + echo '<th align="center" width="10%">'._AM_XPDF_BROKEN_FILE.'</th>'; + echo '<th align="center">' . _AM_XPDF_BROKEN_TITLE . '</th>'; echo '<th align="center" width="20%">' . _AM_XPDF_BROKEN_SENDER . '</th>'; echo '<th align="center" width="15%">'._AM_XPDF_FORMACTION.'</th>'; echo '</tr>'; @@ -82,25 +79,33 @@ $docs_poster_ip = $docsbroken_arr[$i]->getVar('ip'); echo '<tr class="'.$class.'">'; echo '<td align="center">'; - echo '<a href="../visit.php?cid=' . $docs_cid . '&lid=' . $doc_id . '" target="_blank"><img src="../images/icon/download.png" alt="Download ' . $docs_title . '" title="Download ' . $docs_title . '"></a>'; + echo '<a href="../visit.php?cid=' . $docs_cid . '&lid=' . $doc_id . '" target="_blank"><img src="../images/icon/download.png" alt="Document ' . $docs_title . '" title="Document ' . $docs_title . '"></a>'; echo '</td>'; echo '<td align="center">' . $docs_title . '</td>'; echo '<td align="center"><b>' . $docs_poster . '</b> (' . $docs_poster_ip . ')</td>'; echo '<td align="center" width="15%">'; echo '<a href="documents.php?op=view_docs&doc_id=' . $doc_id . '"><img src="../images/icon/view_mini.png" alt="' . _AM_XPDF_FORMDISPLAY . '" title="' . _AM_XPDF_FORMDISPLAY . '"></a> '; echo '<a href="documents.php?op=edit_docs&doc_id=' . $doc_id . '"><img src="../images/icon/edit.png" alt="' . _AM_XPDF_FORMEDIT . '" title="' . _AM_XPDF_FORMEDIT . '"></a> '; - echo '<a href="broken.php?op=del_brokendocs&broken_id=' . $docs_reportid . '"><img src="../images/icon/ignore_mini.png" alt="' . _AM_XPDF_FORMIGNORE . '" title="' . _AM_XPDF_FORMIGNORE . '"></a>'; + echo '<a href="broken.php?op=del_brokendoc&broken_id=' . $docs_reportid . '"><img src="../images/icon/ignore_mini.png" alt="' . _AM_XPDF_FORMIGNORE . '" title="' . _AM_XPDF_FORMIGNORE . '"></a>'; echo '</td>'; } echo '</table><br />'; echo '<br /><div align=right>' . $pagenav . '</div><br />'; }else{ - echo '<div class="errorMsg center">' . _AM_XPDF_ERROR_NOBROKENDOCUMENTS . '</div><br />'; + echo '<table width="100%" cellspacing="1" class="outer">'; + echo '<tr>'; + echo '<th align="center" width="10%">'._AM_XPDF_BROKEN_FILE.'</th>'; + echo '<th align="center">' . _AM_XPDF_BROKEN_TITLE . '</th>'; + echo '<th align="center" width="20%">' . _AM_XPDF_BROKEN_SENDER . '</th>'; + echo '<th align="center" width="15%">'._AM_XPDF_FORMACTION.'</th>'; + echo '</tr>'; + echo '<tr><td class="errorMsg center" colspan="4">' . _AM_XPDF_ERROR_NOBROKENDOCUMENTS . '</td></tr>'; + echo '</table><br />'; } break; // permet de suprimmer le rapport de téléchargment brisé - case "del_brokendocs": + case "del_brokendoc": $obj =& $docsbroken_Handler->get($_REQUEST['broken_id']); if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) { if (!$GLOBALS['xoopsSecurity']->check()) { @@ -114,7 +119,7 @@ $brokenAdmin->addItemButton(_MI_XPDF_ADMENU4, 'broken.php', 'list'); echo $brokenAdmin->renderButton(); - xoops_confirm(array('ok' => 1, 'broken_id' => $_REQUEST['broken_id'], 'op' => 'del_brokendocs'), $_SERVER['REQUEST_URI'], _AM_XPDF_BROKEN_SURDEL . '<br>'); + xoops_confirm(array('ok' => 1, 'broken_id' => $_REQUEST['broken_id'], 'op' => 'del_brokendoc'), $_SERVER['REQUEST_URI'], _AM_XPDF_BROKEN_SURDEL . '<br />'); } break; } Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php 2012-04-22 19:07:20 UTC (rev 9373) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php 2012-04-22 19:11:05 UTC (rev 9374) @@ -26,75 +26,93 @@ xoops_cp_header(); global $pathImageIcon; // CleanVars -$op = xpdf_CleanVars($_REQUEST, 'op', 'list_cat', 'string'); +$op = xpdf_CleanVars($_REQUEST, 'op', 'list', 'string'); $catAdmin = new ModuleAdmin(); switch ($op) { - case "list_cat": + case "list": default: - echo $catAdmin->addNavigation('categories.php'); - $catAdmin->addItemButton(_AM_XPDF_NEWCAT, 'categories.php?op=new_cat', 'add'); - echo $catAdmin->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 class='center'>"._ID."</th> - <th class='center'>"._TITLE."</th> - <th class='center'>"._IMAGE."</th> - <th class='center'>"._DESCRIPTION."</th> - <th class='center'>"._WEIGHT."</th> - <th class='center'>"._FORMACTION."</th> - </tr>"; - - $class = "odd"; - - foreach (array_keys($cat_arr) as $i) - { - echo "<tr class='".$class."'>"; - $class = ($class == "even") ? "odd" : "even"; - - $cat =& $catHandler->get($cat_arr[$i]->getVar("cat_pid")); - $cat_cat = $cat->getVar("cat_pid"); - $cat_img = $cat_arr[$i]->getVar("cat_image"); - $cat_img_name = substr($cat_img, 0, strpos($cat_img, '.')); - echo "<td class='center'>".$cat_arr[$i]->getVar("cat_id")."</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_img."' height='30px' title='".$cat_img_name."' alt='".$cat_img_name."'></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 align='center' width='10%'> - <a href='categories.php?op=edit_cat&cat_id=".$cat_arr[$i]->getVar("cat_id")."'><img src=".$pathImageIcon."/edit.png alt='"._EDIT."' title='"._EDIT."'></a> - <a href='categories.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>"; - } else { - echo "<table width='100%' cellspacing='1' class='outer'> - <tr> - <th class='center'>"._ID."</th> - <th class='center'>"._TITLE."</th> - <th class='center'>"._IMAGE."</th> - <th class='center'>"._DESCRIPTION."</th> - <th class='center'>"._WEIGHT."</th> - <th class='center'>"._FORMACTION."</th> - </tr>"; - echo "</table><br><br>"; - } + echo $catAdmin->addNavigation('categories.php'); + $catAdmin->addItemButton(_AM_XPDF_NEWCAT, 'categories.php?op=new_cat', 'add'); + echo $catAdmin->renderButton(); + $criteria = new CriteriaCompo(); + $criteria->setSort("cat_id"); + $criteria->setOrder("ASC"); + $numrows = $catHandler->getCount($criteria); + if (isset($_REQUEST['limit'])) { + $criteria->setLimit($_REQUEST['limit']); + $limit = $_REQUEST['limit']; + } else { + $criteria->setLimit($GLOBALS['xoopsModuleConfig']['adminperpage']); + $limit = $GLOBALS['xoopsModuleConfig']['adminperpage']; + } + if (isset($_REQUEST['start'])) { + $criteria->setStart($_REQUEST['start']); + $start = $_REQUEST['start']; + } else { + $criteria->setStart(0); + $start = 0; + } + $cat_arr = $catHandler->getall($criteria); + if ( $numrows > $limit ) { + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; + $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=liste&limit=' . $limit); + $pagenav = $pagenav->renderNav(4); + } else { + $pagenav = ''; + } + $cat_arr = $catHandler->getall($criteria); + //Table View + if ($numrows>0) + { + echo "<table width='100%' cellspacing='1' class='outer'> + <tr> + <th class='center'>"._ID."</th> + <th class='center'>"._TITLE."</th> + <th class='center'>"._IMAGE."</th> + <th class='center'>"._DESCRIPTION."</th> + <th class='center'>"._WEIGHT."</th> + <th class='center'>"._FORMACTION."</th> + </tr>"; + $class = "odd"; + foreach (array_keys($cat_arr) as $i) + { + echo "<tr class='".$class."'>"; + $class = ($class == "even") ? "odd" : "even"; + $cat =& $catHandler->get($cat_arr[$i]->getVar("cat_pid")); + $cat_cat = $cat->getVar("cat_pid"); + $cat_img = $cat_arr[$i]->getVar("cat_image"); + $cat_img_name = substr($cat_img, 0, strpos($cat_img, '.')); + echo "<td class='center'>".$cat_arr[$i]->getVar("cat_id")."</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_img."' height='30px' title='".$cat_img_name."' alt='".$cat_img_name."'></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 align='center' width='10%'> + <a href='categories.php?op=edit_cat&cat_id=".$cat_arr[$i]->getVar("cat_id")."'><img src=".$pathImageIcon."/edit.png alt='"._EDIT."' title='"._EDIT."'></a> + <a href='categories.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>"; + } else { + echo "<table width='100%' cellspacing='1' class='outer'> + <tr> + <th class='center'>"._ID."</th> + <th class='center'>"._TITLE."</th> + <th class='center'>"._IMAGE."</th> + <th class='center'>"._DESCRIPTION."</th> + <th class='center'>"._WEIGHT."</th> + <th class='center'>"._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_cat', 'list'); + $catAdmin->addItemButton(_AM_XPDF_CATLIST, 'categories.php?op=list', 'list'); echo $catAdmin->renderButton(); $obj =& $catHandler->create(); @@ -111,16 +129,14 @@ } 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 + global $xoopsModuleConfig; + //Form setCat + $catArray1 = array("cat_pid" => $_REQUEST["cat_pid"], "cat_title" => $_REQUEST["cat_title"]); + $obj->setVars($catArray1); + //Form cat_image $GLOBALS["xoopsModuleConfig"]["maxsize"] include_once XOOPS_ROOT_PATH."/class/uploader.php"; $uploaddir = XOOPS_UPLOAD_PATH."/xpdf/images/cat/"; - $uploader = new XoopsMediaUploader($uploaddir, $GLOBALS["xoopsModuleConfig"]["mimetypes"], - $GLOBALS["xoopsModuleConfig"]["size"], null, null); + $uploader = new XoopsMediaUploader($uploaddir, $GLOBALS["xoopsModuleConfig"]["mimetypes"], 104857600, null, null); if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { $uploader->setPrefix("cat_image_") ; $uploader->fetchMedia($_POST['xoops_upload_file'][0]); @@ -133,23 +149,12 @@ } 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"]); - //Form cat_dohtml - $obj->setVar("cat_dohtml", $_REQUEST["cat_dohtml"]); - //Form cat_dosmiley - $obj->setVar("cat_dosmiley", $_REQUEST["cat_dosmiley"]); - //Form cat_doxcodes - $obj->setVar("cat_doxcodes", $_REQUEST["cat_doxcodes"]); - //Form cat_doimages - $obj->setVar("cat_doimages", $_REQUEST["cat_doimages"]); - //Form cat_dobreak - $obj->setVar("cat_dobreak", $_REQUEST["cat_dobreak"]); - + //Form setCat + $catArray2 = array("cat_description" => $_REQUEST["cat_description"], "cat_weight" => $_REQUEST["cat_weight"], "cat_dohtml" => $_REQUEST["cat_dohtml"], "cat_dosmiley" => $_REQUEST["cat_dosmiley"], "cat_doxcodes" => $_REQUEST["cat_doxcodes"], "cat_doimages" => $_REQUEST["cat_doimages"], "cat_dobreak" => $_REQUEST["cat_dobreak"]); + $obj->setVars($catArray2); + if ($catHandler->insert($obj)) { - redirect_header("categories.php?op=list_cat", 2, _AM_XPDF_FORMOK); + redirect_header("categories.php?op=list", 2, _AM_XPDF_FORMOK); } echo $obj->getHtmlErrors(); @@ -160,7 +165,7 @@ 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_cat', 'list'); + $catAdmin->addItemButton(_AM_XPDF_CATLIST, 'categories.php?op=list', 'list'); echo $catAdmin->renderButton(); $obj = $catHandler->get($_REQUEST["cat_id"]); $form = $obj->getForm(); Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php 2012-04-22 19:07:20 UTC (rev 9373) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php 2012-04-22 19:11:05 UTC (rev 9374) @@ -25,21 +25,25 @@ include "admin_header.php"; xoops_cp_header(); global $pathImageIcon; -$op = xpdf_CleanVars($_REQUEST, 'op', 'list_doc', 'string'); -$status_menu = xpdf_CleanVars($_REQUEST, 'doc_status', 1, 'int'); +$op = xpdf_CleanVars($_REQUEST, 'op', 'list', 'string'); $docAdmin = new ModuleAdmin(); switch ($op) { - case "list_doc": + case "list": default: echo $docAdmin->addNavigation('documents.php'); - if ($status_menu == 1){ - $docAdmin->addItemButton(_AM_XPDF_NEWDOC, 'documents.php?op=new_doc', 'add'); - }else{ - $docAdmin->addItemButton(_AM_XPDF_DOCLIST, 'documents.php?op=list_doc', 'list'); - $docAdmin->addItemButton(_AM_XPDF_NEWDOC, 'documents.php?op=new_doc', 'add'); - } + $docAdmin->addItemButton(_AM_XPDF_NEWDOC, 'documents.php?op=new_doc', 'add'); echo $docAdmin->renderButton(); + + // Number of documents per page + $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_id ASC, doc_title"); $criteria->setOrder("ASC"); @@ -85,10 +89,10 @@ { echo "<table cellspacing='1' class='outer width100'> <tr> - <th class='center'>"._ID."</th> - <th class='center'>"._CATEGORY."</th> + <th class='center'>"._ID."</th> <th class='center'>"._TITLE."</th> - <th class='center'>"._SUBJECT."</th> + <th class='center'>"._CATEGORY."</th> + <th class='center'>"._SUBJECT."</th> <th class='center'>"._SUBMITTER."</th> <th class='center'>"._CREATED."</th> <th class='center'>"._PUBLISHED."</th> @@ -103,38 +107,43 @@ { echo "<tr class='".$class."'>"; $class = ($class == "even") ? "odd" : "even"; - - echo "<td class='center'>".$doc_arr[$i]->getVar("doc_id")."</td>"; - $cat =& $catHandler->get($doc_arr[$i]->getVar("doc_cid")); - $doc_cat = $cat->getVar("cat_id"); - echo "<td class='center'>".$doc_cat."</td>"; + $doc_id = $doc_arr[$i]->getVar("doc_id"); + echo "<td class='center'>".$doc_id."</td>"; + include_once(XOOPS_ROOT_PATH."/class/tree.php"); + $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"> ' ); + /* $key = $doc_arr[$i]->getVar('doc_cid'); + if (array_key_exists($key, $cat_arr)){ + $category = $cat_arr[$key]->getVar('cat_title'); + } */ echo "<td class='center'>".$doc_arr[$i]->getVar("doc_title")."</td>"; - echo "<td class='center'>".$doc_arr[$i]->getVar("doc_subject")."</td>"; + echo "<td class='center'>".$category."</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_created"),"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'><a href='./documents.php?op=delete_pdf_documento&doc_id='".$doc_arr[$i]->getVar("doc_id")."&doc_status=0' title='"._AM_XPDF_DELETEPDF."'><img src=".$pathImageIcon."/green_ball.png border='0' alt='"._AM_XPDF_DELETEPDF."' /></a></td>"; + echo "<td class='center'><a href='./documents.php?op=delete_pdf_file&doc_id='".$doc_id."&doc_status=0' title='"._AM_XPDF_DELETEPDF."'><img src=".$pathImageIcon."/green_ball.png border='0' alt='"._AM_XPDF_DELETEPDF."' /></a></td>"; } else { - echo "<td class='center'><a href='./documents.php?op=create_pdf_documento&doc_id='".$doc_arr[$i]->getVar("doc_id")."&doc_status=1' title='"._AM_XPDF_CREATEPDF."'><img src=".$pathImageIcon."/red_ball.png border='0' alt='"._AM_XPDF_CREATEPDF."' /></a></td>"; + echo "<td class='center'><a href='./documents.php?op=create_pdf_file&doc_id='".$doc_id."&doc_status=1' title='"._AM_XPDF_CREATEPDF."'><img src=".$pathImageIcon."/red_ball.png border='0' alt='"._AM_XPDF_CREATEPDF."' /></a></td>"; } if ( $doc_arr[$i]->getVar("doc_waiting") == 1 ) { - echo "<td class='center'><a href='./documents.php?op=approve_doc&doc_id='".$doc_arr[$i]->getVar("doc_id")."&doc_waiting=0' title='"._AM_XPDF_CREATEPDF."'><img src=".$pathImageIcon."/orange_ball.png border='0' alt='' /></a></td>"; + echo "<td class='center'><a href='./documents.php?op=approve_doc&doc_id='".$doc_id."&doc_waiting=0' title='"._AM_XPDF_CREATEPDF."'><img src=".$pathImageIcon."/orange_ball.png border='0' alt='' /></a></td>"; } else { echo "<td class='center'><img src=".$pathImageIcon."/grey_ball.png border='0' alt='' /></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&doc_id=".$doc_arr[$i]->getVar("doc_id")."&doc_online=0'><img src=".$pathImageIcon."/on.png border='0' alt='"._ONLINE."' title='"._ONLINE."'></a></td>"; + echo "<td class='center'><a href='./documents.php?op=update_online&doc_id=".$doc_id."&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&doc_id=".$doc_arr[$i]->getVar("doc_id")."&doc_online=1'><img src=".$pathImageIcon."/off.png border='0' alt='"._OFFLINE."' title='"._OFFLINE."'></a></td>"; + echo "<td class='center'><a href='./documents.php?op=update_online&doc_id=".$doc_id."&doc_online=1'><img src=".$pathImageIcon."/off.png border='0' alt='"._OFFLINE."' title='"._OFFLINE."'></a></td>"; } - echo "<td class='center width10'> - <a href='documents.php?op=edit_doc&doc_id=".$doc_arr[$i]->getVar("doc_id")."'><img src=".$pathImageIcon."/edit.png alt='"._EDIT."' title='"._EDIT."'></a> - <a href='documents.php?op=delete_doc&doc_id=".$doc_arr[$i]->getVar("doc_id")."'><img src=".$pathImageIcon."/delete.png alt='"._DELETE."' title='"._DELETE."'></a> + echo "<td class='center width8'> + <a href='documents.php?op=edit_doc&doc_id=".$doc_id."'><img src=".$pathImageIcon."/edit.png alt='"._EDIT."' title='"._EDIT."'></a> + <a href='documents.php?op=delete_doc&doc_id=".$doc_id."'><img src=".$pathImageIcon."/delete.png alt='"._DELETE."' title='"._DELETE."'></a> </td>"; echo "</tr>"; } @@ -154,18 +163,20 @@ <th class='center'>"._WEIGHT."</th> <th class='center'>"._ONLINE."</th> <th class='center'>"._FORMACTION."</th> - </tr>"; - echo "</table><br><br>"; + </tr> + <tr><td class='errorMsg center' colspan='12'>" . _AM_XPDF_ERROR_NODOCUMENTS . "</td></tr>"; + echo "</table><br />"; } break; case "new_doc": echo $docAdmin->addNavigation("documents.php"); - $docAdmin->addItemButton(_AM_XPDF_DOCLIST, 'documents.php?op=list_doc', 'list'); + $docAdmin->addItemButton(_AM_XPDF_DOCLIST, 'documents.php?op=list', 'list'); + $docAdmin->addItemButton(_AM_XPDF_FILESLIST, 'filesname.php?op=list', 'list'); echo $docAdmin->renderButton(); $obj =& $docsHandler->create(); - $form = $obj->getForm(); + $form = $obj->getForm($given, false); $form->display(); break; @@ -178,24 +189,18 @@ $obj =& $docsHandler->get($doc_id); } else { $obj =& $docsHandler->create(); - } - //Form doc_cid - $obj->setVar("doc_cid", $_REQUEST["doc_cid"]); - //Form doc_documentoname - $obj->setVar("doc_filename", strtolower($_REQUEST["doc_filename"])); - //Form doc_title - $obj->setVar("doc_title", $_REQUEST["doc_title"]); - //Form doc_description - $obj->setVar("doc_slogan", $_REQUEST["doc_slogan"]); - //Form doc_description - $obj->setVar("doc_description", $_REQUEST["doc_description"]); + } + + $docArray1 = array("doc_cid" => $_POST["doc_cid"], "doc_filename" => strtolower($_POST["doc_filename"]), "doc_title" => $_POST["doc_title"], "doc_slogan" => $_POST["doc_slogan"], "doc_description" => $_POST["doc_description"]); + //Form docs_vars + $obj->setVars($docArray1); //Form doc_image include_once XOOPS_ROOT_PATH."/class/uploader.php"; $uploaddir = XOOPS_UPLOAD_PATH."/xpdf/images/doc/"; $uploader = new XoopsMediaUploader($uploaddir, "gif|jpeg|pjpeg|png", 104857600, null, null); - if ($uploader->fetchMedia($_POST['xoops_upload_documento'][0])) { + if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { $uploader->setPrefix("doc_image_"); - $uploader->fetchMedia($_POST['xoops_upload_documento'][0]); + $uploader->fetchMedia($_POST['xoops_upload_file'][0]); if (!$uploader->upload()) { $errors = $uploader->getErrors(); redirect_header("javascript:history.go(-1)",3, $errors); @@ -203,71 +208,37 @@ $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_description - $obj->setVar("doc_keywords", $_REQUEST["doc_keywords"]); - //Form doc_submitter - $obj->setVar("doc_submitter", $_REQUEST["doc_submitter"]); - //Form doc_created - $obj->setVar("doc_created", xpdf_convertDate($_REQUEST["doc_created"])); - //Form doc_created - $obj->setVar("doc_published", xpdf_convertDate($_REQUEST["doc_published"])); - //Form doc_paypal - $obj->setVar("doc_view", $_REQUEST["doc_view"]); - //Form doc_weight - $obj->setVar("doc_comments", $_REQUEST["doc_comments"]); - //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_waiting - $verif_doc_waiting = ($_REQUEST["doc_waiting"] == 1) ? "1" : "0"; - $obj->setVar("doc_waiting", $verif_doc_waiting); - //Form doc_online - $verif_doc_online = ($_REQUEST["doc_online"] == 1) ? "1" : "0"; - $obj->setVar("doc_online", $verif_doc_online); - //Form doc_online - $verif_doc_dohtml = ($_REQUEST["doc_dohtml"] == 1) ? "1" : "0"; - $obj->setVar("doc_dohtml", $verif_doc_dohtml); - //Form doc_online - $verif_doc_dosmiley = ($_REQUEST["doc_dosmiley"] == 1) ? "1" : "0"; - $obj->setVar("doc_dosmiley", $verif_doc_dosmiley); - //Form doc_online - $verif_doc_doxcodes = ($_REQUEST["doc_doxcodes"] == 1) ? "1" : "0"; - $obj->setVar("doc_doxcodes", $verif_doc_doxcodes); - //Form doc_online - $verif_doc_doimages = ($_REQUEST["doc_doimages"] == 1) ? "1" : "0"; - $obj->setVar("doc_doimages", $verif_doc_doimages); - //Form doc_online - $verif_doc_dobreak = ($_REQUEST["doc_dobreak"] == 1) ? "1" : "0"; - $obj->setVar("doc_dobreak", $verif_doc_dobreak); - //Form doc_paypal - $obj->setVar("doc_paypal", $_REQUEST["doc_paypal"]); - //Form doc_price - $obj->setVar("doc_price", $_REQUEST["doc_price"]); - //Form doc_currency - $obj->setVar("doc_currency", $_REQUEST["doc_currency"]); - //Form doc_catalogue_number - $obj->setVar("doc_catalogue_number", $_REQUEST["doc_catalogue_number"]); + $obj->setVar("doc_image", $_POST["doc_image"]); + } + $check_doc_status = ($_REQUEST["doc_status"] == 1) ? "1" : "0"; + $check_doc_waiting = ($_REQUEST["doc_waiting"] == 1) ? "1" : "0"; + $check_doc_online = ($_REQUEST["doc_online"] == 1) ? "1" : "0"; + $check_doc_dohtml = ($_REQUEST["doc_dohtml"] == 1) ? "1" : "0"; + $check_doc_dosmiley = ($_REQUEST["doc_dosmiley"] == 1) ? "1" : "0"; + $check_doc_doxcodes = ($_REQUEST["doc_doxcodes"] == 1) ? "1" : "0"; + $check_doc_doimages = ($_REQUEST["doc_doimages"] == 1) ? "1" : "0"; + $check_doc_dobreak = ($_REQUEST["doc_dobreak"] == 1) ? "1" : "0"; + + $docArray2 = array("doc_subject" => $_POST["doc_subject"], "doc_fontname" => strtolower($_POST["doc_fontname"]), "doc_fontsize" => $_POST["doc_fontsize"], "doc_keywords" => $_POST["doc_keywords"], "doc_submitter" => $_POST["doc_submitter"], "doc_created" => xpdf_convertDate($_POST["doc_created"]), "doc_published" => xpdf_convertDate($_POST["doc_published"]), "doc_view" => $_POST["doc_view"], "doc_comments" => $_POST["doc_comments"], "doc_weight" => $_POST["doc_weight"], "doc_status" => $check_doc_status, "doc_waiting" => $check_doc_waiting, "doc_online" => $check_doc_online, "doc_dohtml" => $check_doc_dohtml, "doc_dosmiley" => $check_doc_dosmiley, "doc_doxcodes" => $check_doc_doxcodes, "doc_doimages" => $check_doc_doimages, "doc_dobreak" => $check_doc_dobreak, "doc_paypal" => $_POST["doc_paypal"], "doc_price" => $_POST["doc_price"], "doc_currency" => $_POST["doc_currency"], "doc_catalogue_number" => $_POST["doc_catalogue_number"]); + //Form docs_vars + $obj->setVars($docArray2); + + // Temporary registration tags + if (($GLOBALS['xoopsModuleConfig']['usetag'] == 1) and (is_dir('../../tag'))){ + $given['TAG'] = $_POST['tag']; + } + if ($docsHandler->insert($obj)) { - redirect_header("documents.php?op=list_doc", 2, _AM_XPDF_FORMOK); + redirect_header("documents.php?op=list", 2, _AM_XPDF_FORMOK); } echo $obj->getHtmlErrors(); - $form =& $obj->getForm(); + $form =& $obj->getForm($given, true); $form->display(); break; - case "create_pdf_doc": + case "create_pdf_file": if (isset($_REQUEST["doc_id"])) { $obj =& $docHandler->get($_REQUEST["doc_id"]); } @@ -278,9 +249,9 @@ echo $obj->getHtmlErrors(); //include_once XOOPS_URL.'/Frameworks/tcpdf/tcpdf.php'; require_once XOOPS_ROOT_PATH.'/Frameworks/tcpdf/tcpdf.php'; - $documentoname = XOOPS_ROOT_PATH.'/Frameworks/tcpdf/config/lang/'._LANGCODE.'.php'; - if(documento_exists($documentoname)) { - require_once $documentoname; + $filename = XOOPS_ROOT_PATH.'/Frameworks/tcpdf/config/lang/'._LANGCODE.'.php'; + if(file_exists($filename)) { + require_once $filename; } else { require_once XOOPS_ROOT_PATH.'/Frameworks/tcpdf/config/lang/en.php'; } @@ -358,37 +329,41 @@ $pdf->AddPage(); $pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $content, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); // Pdf Filename - $pdf_documento = XOOPS_UPLOAD_PATH."/xpdf/doc/".strtolower($pdf_data['filename']).".pdf"; + $pdf_filename = XOOPS_UPLOAD_PATH."/xpdf/files/".strtolower($pdf_data['filename']).".pdf"; // Output - $pdf->Output($pdf_documento, 'F'); + $pdf->Output($pdf_filename, 'F'); break; - - case "delete_pdf_doc": + // Delete pdf file + case "delete_pdf_file": if (isset($_REQUEST["doc_id"])) { - $obj =& $docHandler->get($_REQUEST["doc_id"]); + $obj =& $docsHandler->get($_REQUEST["doc_id"]); } $obj->setVar("doc_status", $_REQUEST["doc_status"]); - $documentoname = XOOPS_UPLOAD_PATH."/xpdf/doc/".strtolower($obj->getVar("doc_documentoname")).".pdf"; - if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) { - if (!$GLOBALS['xoopsSecurity']->check()) { - redirect_header('documents.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); - if(is_documento($documentoname)){ - chmod($documentoname, 0777); - unlink($documentoname); - } - } + $filename = XOOPS_UPLOAD_PATH."/xpdf/files/".strtolower($obj->getVar("doc_filename")).".pdf"; + if(is_dir($filename)){ + if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) { + if (!$GLOBALS['xoopsSecurity']->check()) { + redirect_header('documents.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + chmod($filename, 0777); + unlink($filename); + } + } else { + xoops_confirm(array('ok' => 1, 'doc_id' => $_REQUEST['doc_id'], 'op' => 'delete_pdf'), $_SERVER['REQUEST_URI'], sprintf(_AM_XPDF_FORMSUREDEL, $obj->getVar('doc_filename'))); + } } else { - xoops_confirm(array('ok' => 1, 'doc_id' => $_REQUEST['doc_id'], 'op' => 'delete_pdf_doc'), $_SERVER['REQUEST_URI'], sprintf(_AM_XPDF_FORMSUREDEL, $obj->getVar('doc_filename'))); + redirect_header('documents.php', 3, _AM_XPDF_THISFILENOTEXIST); } 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_doc', 'list'); + $docAdmin->addItemButton(_AM_XPDF_DOCLIST, 'documents.php?op=list', 'list'); + $docAdmin->addItemButton(_AM_XPDF_FILESLIST, 'filesname.php?op=list', 'list'); echo $docAdmin->renderButton(); - $obj = $docsHandler->get($_REQUEST["doc_id"]); - $form = $obj->getForm(); + $doc_id = xpdf_CleanVars($_REQUEST, 'doc_id', 0, 'int'); + $obj = $docsHandler->get($doc_id); + $form = $obj->getForm($given, false); $form->display(); break; @@ -418,7 +393,8 @@ 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_doc": + + case "update_online": if (isset($_REQUEST["doc_id"])) { $obj =& $docsHandler->get($_REQUEST["doc_id"]); } Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/filesname.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/filesname.php 2012-04-22 19:07:20 UTC (rev 9373) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/filesname.php 2012-04-22 19:11:05 UTC (rev 9374) @@ -31,9 +31,19 @@ { // Vue liste case "list": - //Affichage de la partie haute de l'administration de Xoops - echo $filesnameAdmin->addNavigation('filesname.php'); + //Display the upper of the administration of filesname table + echo $filesnameAdmin->addNavigation('filesname.php'); + $filesnameAdmin->addItemButton(_AM_XPDF_NEWCAT, 'categories.php?op=new_cat', 'add'); + $filesnameAdmin->addItemButton(_AM_XPDF_CATLIST, 'categories.php?op=list', 'list'); + $filesnameAdmin->addItemButton(_AM_XPDF_NEWDOC, 'documents.php?op=new_doc', 'add'); + $filesnameAdmin->addItemButton(_AM_XPDF_DOCLIST, 'documents.php?op=list', 'list'); + echo $filesnameAdmin->renderButton(); + $doc_id = xpdf_CleanVars($_REQUEST, 'doc_id', 0, 'int'); $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('doc_id', $doc_id)); + $criteria->setSort('doc_id'); + $criteria->setOrder('ASC'); + $numrows = $docsHandler->getCount($criteria); if (isset($_REQUEST['limit'])) { $criteria->setLimit($_REQUEST['limit']); $limit = $_REQUEST['limit']; @@ -47,12 +57,10 @@ } else { $criteria->setStart(0); $start = 0; - } - $criteria->setSort('doc_id'); - $criteria->setOrder('ASC'); - $docsfilesname_arr = $docsHandler->getByLink($criteria); - $numrows = $docsHandler->getCount($criteria); + } + $docs_arr = $docsHandler->getAll($criteria); if ( $numrows > $limit ) { + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list&limit=' . $limit); $pagenav = $pagenav->renderNav(4); } else { @@ -62,52 +70,64 @@ if ($numrows > 0) { echo '<table width="100%" cellspacing="1" class="outer">'; echo '<tr>'; - echo '<th align="center" width="10%">' . _AM_XPDF_FILESNAME_ID . '</th>'; + echo '<th align="center" width="10%">' . _EDIT . '</th>'; echo '<th align="center">'._AM_XPDF_FILESNAME_TITLE.'</th>'; echo '<th align="center" width="20%">' . _AM_XPDF_FILESNAME_STATUS . '</th>'; echo '<th align="center" width="15%">'._AM_XPDF_FORMACTION.'</th>'; echo '</tr>'; $class = 'odd'; - foreach (array_keys($docsfilesname_arr) as $i) { + foreach (array_keys($docs_arr) as $i) { $class = ($class == 'even') ? 'odd' : 'even'; - $doc_id = $docsfilesname_arr[$i]->getVar('lid'); - $docs_title = $docsfilesname_arr[$i]->getVar('title'); - $docs_cid = $docsfilesname_arr[$i]->getVar('cid'); + $doc_id = $docs_arr[$i]->getVar('doc_id'); + $doc_cid = $docs_arr[$i]->getVar('doc_cid'); + $doc_title = $docs_arr[$i]->getVar('doc_title'); + $doc_status = $docs_arr[$i]->getVar('doc_status'); echo '<tr class="'.$class.'">'; echo '<td align="center">'; - echo '<a href="../visit.php?cid=' . $docs_cid . '&lid=' . $doc_id . '" target="_blank"><img src="../images/icon/download.png" alt="Download ' . $docs_title . '" title="Download ' . $docs_title . '"></a>'; + echo '<a href="../documents.php?op=edit_doc&doc_id=' . $doc_cid . '"><img src="'.$pathImageIcon.'/edit.png" alt="' . _EDIT . '" title="' . _EDIT . '" /></a>'; echo '</td>'; - echo '<td align="center">' . $docs_title . '</td>'; + echo '<td align="center">' . $doc_title . '</td>'; + echo '<td align="center">' . $doc_status . '</td>'; echo '<td align="center" width="15%">'; - echo '<a href="documents.php?op=view_docs&doc_id=' . $doc_id . '"><img src="../images/icon/view_mini.png" alt="' . _AM_XPDF_FORMDISPLAY . '" title="' . _AM_XPDF_FORMDISPLAY . '"></a> '; - echo '<a href="documents.php?op=edit_docs&doc_id=' . $doc_id . '"><img src="../images/icon/edit.png" alt="' . _AM_XPDF_FORMEDIT . '" title="' . _AM_XPDF_FORMEDIT . '"></a> '; - echo '<a href="filesname.php?op=del_filesname&doc_id=' . $docs_reportid . '"><img src="../images/icon/ignore_mini.png" alt="' . _AM_XPDF_FORMIGNORE . '" title="' . _AM_XPDF_FORMIGNORE . '"></a>'; + echo '<a href="documents.php?op=view_docs&doc_id=' . $doc_id . '"><img src="../images/16/display.png" alt="' . _AM_XPDF_FORMDISPLAY . '" title="' . _AM_XPDF_FORMDISPLAY . '"></a> '; + echo '<a href="'. XPDF_MODULE_URL .'/makepdf.php?cid='.$doc_cid.'&did=' . $doc_id . '"><img src="'.$pathImageIcon.'/pdf.png" alt="Document ' . $doc_title . '" title="Document ' . $doc_title . '" /></a> '; + echo '<a href="filesname.php?op=del_filename&doc_id=' . $doc_id . '"><img src="'.$pathImageIcon.'/delete.png" alt="' . _AM_XPDF_FORMIGNORE . '" title="' . _AM_XPDF_FORMIGNORE . '"></a>'; echo '</td>'; } echo '</table><br />'; echo '<br /><div align=right>' . $pagenav . '</div><br />'; }else{ - echo '<div class="errorMsg center">' . _AM_XPDF_ERROR_NOFILENAME . '</div><br />'; + echo '<table width="100%" cellspacing="1" class="outer">'; + echo '<tr>'; + echo '<th align="center" width="10%">' . _EDIT . '</th>'; + echo '<th align="center">'._AM_XPDF_FILESNAME_TITLE.'</th>'; + echo '<th align="center" width="20%">' . _AM_XPDF_FILESNAME_STATUS . '</th>'; + echo '<th align="center" width="15%">'._AM_XPDF_FORMACTION.'</th>'; + echo '</tr>'; + echo '<tr><td class="errorMsg center" colspan="4">' . _AM_XPDF_ERROR_NOFILENAME . '</td></tr>'; + echo '</table><br />'; } + break; - // permet de suprimmer le rapport de téléchargment brisé + // To delete a specific file case "del_filename": - $obj =& $docsfilesname_Handler->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 ($docsfilesname_Handler->delete($obj)) { - redirect_header('filesname.php', 1, _AM_XPDF_REDIRECT_DELOK); - } - echo $objvotedata->getHtmlErrors(); - } else { + $obj =& $docsHandler->get($_REQUEST['doc_id']); + $obj->setVar("doc_status", $_REQUEST["doc_status"]); + $filename = XOOPS_UPLOAD_PATH."/xpdf/files/".strtolower($obj->getVar("doc_filename")).".pdf"; + if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) { + if (!$GLOBALS['xoopsSecurity']->check()) { + redirect_header('filesname.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + if(is_file($filename)){ + chmod($filename, 0777); + unlink($filename); + } + } + } else { $filesnameAdmin->addItemButton(_MI_XPDF_ADMENU4, 'filesname.php', 'list'); - echo $filesnameAdmin->renderButton(); - - xoops_confirm(array('ok' => 1, 'doc_id' => $_REQUEST['doc_id'], 'op' => 'del_filename'), $_SERVER['REQUEST_URI'], _AM_XPDF_BROKEN_SURDEL . '<br />'); + echo $filesnameAdmin->renderButton(); + xoops_confirm(array('ok' => 1, 'doc_id' => $_REQUEST['doc_id'], 'op' => 'del_filename'), $_SERVER['REQUEST_URI'], _AM_XPDF_BROKEN_SURDEL . $obj->getVar('doc_filename')); } break; } Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/index.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/index.php 2012-04-22 19:07:20 UTC (rev 9373) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/index.php 2012-04-22 19:11:05 UTC (rev 9374) @@ -27,26 +27,61 @@ $indexAdmin = new ModuleAdmin(); //count "total cat" - $count_cat = $catHandler->getCount(); - //count "total doc" - $count_doc = $docsHandler->getCount(); - //count "online" $criteria = new CriteriaCompo(); + $count_cat = $catHandler->getCount($criteria); + unset($criteria); + //count "total doc" + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria("doc_waiting", 0, '=')); + $criteria->add(new Criteria("doc_status", 0, '!=')); + $count_doc = $docsHandler->getCount($criteria); + unset($criteria); + //count "status" + $criteria = new CriteriaCompo(); $criteria->add(new Criteria("doc_status", 1)); $doc_status = $docsHandler->getCount($criteria); + unset($criteria); //count "waiting" + $criteria = new CriteriaCompo(); $criteria->add(new Criteria("doc_waiting", 1)); $doc_waiting = $docsHandler->getCount($criteria); - //count "online" + unset($criteria); + //count "online" + $criteria = new CriteriaCompo(); $criteria->add(new Criteria("doc_online", 1)); $doc_online = $docsHandler->getCount($criteria); + unset($criteria); + // count "total broken" + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria("doc_waiting", 0, '=')); + $criteria->add(new Criteria("doc_status", 0, '!=')); + $count_broken = $brokHandler->getCount($criteria); + unset($criteria); + // count "total modified" + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria("doc_waiting", 0, '=')); + $criteria->add(new Criteria("doc_status", 0, '!=')); + $count_modified = $modHandler->getCount($criteria); + unset($criteria); + // Colors + $r = '#FF0000'; $g = '#00AA00'; + $count_cat_color = ($count_cat == 0) ? $r : $g; + $count_doc_color = ($count_doc == 0) ? $r : $g; + $doc_status_color = ($doc_status == 0) ? $r : $g; + $doc_waiting_color = ($doc_waiting == 0) ? $g : $r; + $doc_online_color = ($doc_online == 0) ? $r : $g; + $count_broken_color = ($count_broken == 0) ? $g : $r; + $count_modified_color = ($count_modified == 0) ? $g : $r; + // InfoBox stats $indexAdmin->addInfoBox(_AM_XPDF_STATISTICS); - $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS,_AM_XPDF_THEREARE_CAT, $count_cat); - $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS,_AM_XPDF_THEREARE_DOC, $count_doc); - $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS,_AM_XPDF_THEREARE_DOC_STATUS, $doc_status); - $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS,_AM_XPDF_THEREARE_DOC_WAITING, $doc_waiting); - $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS,_AM_XPDF_THEREARE_DOC_ONLINE, $doc_online); + $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS, _AM_XPDF_THEREARE_CAT, $count_cat, $count_cat_color); + $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS,_AM_XPDF_THEREARE_DOC, $count_doc, $count_doc_color); + $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS,_AM_XPDF_THEREARE_DOC_STATUS, $doc_status, $doc_status_color); + $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS,_AM_XPDF_THEREARE_DOC_WAITING, $doc_waiting, $doc_waiting_color); + $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS,_AM_XPDF_THEREARE_DOC_ONLINE, $doc_online, $doc_online_color); + $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS,_AM_XPDF_THEREARE_DOC_BROKEN, $count_broken, $count_broken_color); + $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS,_AM_XPDF_THEREARE_DOC_MODIFIED, $count_modified, $count_modified_color); // Render Index echo $indexAdmin->addNavigation("index.php"); echo $indexAdmin->renderIndex(); Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/modified.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/modified.php 2012-04-22 19:07:20 UTC (rev 9373) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/modified.php 2012-04-22 19:11:05 UTC (rev 9374) @@ -34,6 +34,9 @@ case "list": echo $modifiedAdmin->addNavigation('modified.php'); $criteria = new CriteriaCompo(); + $criteria->setSort('requestid'); + $criteria->setOrder('ASC'); + $numrows = $docsHandler->getCount($criteria); if (isset($_REQUEST['limit'])) { $criteria->setLimit($_REQUEST['limit']); $limit = $_REQUEST['limit']; @@ -47,23 +50,22 @@ } else { $criteria->setStart(0); $start = 0; - } - $criteria->setSort('requestid'); - $criteria->setOrder('ASC'); - $docsmod_arr = $docsHandler->getall($criteria); - $numrows = $docsHandler->getCount($criteria); + } + $docsmod_arr = $docsHandler->getall($criteria); if ( $numrows > $limit ) { + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=liste&limit=' . $limit); $pagenav = $pagenav->renderNav(4); } else { $pagenav = ''; } - //Affichage du tableau des téléchargements modifiés + //Display of the table with loading modified if ($numrows > 0) { echo '<table width="100%" cellspacing="1" class="outer">'; echo '<tr>'; - echo '<th align="center">' . _AM_XPDF_FORMTITLE . '</th>'; - echo '<th align="center" width="20%">' . _AM_XPDF_BROKEN_SENDER . '</th>'; + echo '<th align="center" width="15%">' . _AM_XPDF_MODIFIED_ID . '</th>'; + echo '<th align="center" width="20%">' . _AM_XPDF_MODIFIED_TITLE . '</th>'; + echo '<th align="center" width="20%">' . _AM_XPDF_MODIFIED_SENDER . '</th>'; echo '<th align="center" width="15%">'._AM_XPDF_FORMACTION.'</th>'; echo '</tr>'; $class = 'odd'; @@ -72,7 +74,7 @@ $docs_lid = $docsmod_arr[$i]->getVar('lid'); $docs_requestid = $docsmod_arr[$i]->getVar('requestid'); $docs =& $docsHandler->get($docsmod_arr[$i]->getVar('lid')); - // pour savoir si le fichier est nouveau + // If the document is new $docs_url = $docs->getVar('url'); $moddocs_url = $docsmod_arr[$i]->getVar('url'); $new_document = ($docs_url == $moddocs_url ? false : true); @@ -80,56 +82,55 @@ echo '<td align="center">' . $docs->getVar('title') . '</td>'; echo '<td align="center"><b>' . XoopsUser::getUnameFromId($docsmod_arr[$i]->getVar('modifysubmitter')) . '</b></td>'; echo '<td align="center" width="15%">'; - echo '<a href="modified.php?op=view_docs&docs_lid=' . $docs_lid . '&mod_id=' . $docs_requestid . '"><img src="../images/icon/view_mini.png" alt="' . _AM_XPDF_FORMDISPLAY . '" title="' . _AM_XPDF_FORMDISPLAY . '"></a> '; - echo '<a href="modified.php?op=del_moddocs&mod_id=' . $docs_requestid . '&new_document=' . $new_document . '"><img src="../images/icon/ignore_mini.png" alt="' . _AM_XPDF_FORMIGNORE . '" title="' . _AM_XPDF_FORMIGNORE . '"></a>'; + echo '<a href="modified.php?op=view_docs&docs_lid=' . $docs_lid . '&mod_id=' . $docs_requestid . '"><img src="../images/icons/view_mini.png" alt="' . _AM_XPDF_FORMDISPLAY . '" title="' . _AM_XPDF_FORMDISPLAY . '"></a> '; + echo '<a href="modified.php?op=del_moddocs&mod_id=' . $docs_requestid . '&new_document=' . $new_document . '"><img src="../images/icons/ignore_mini.png" alt="' . _AM_XPDF_FORMIGNORE . '" title="' . _AM_XPDF_FORMIGNORE . '"></a>'; echo '</td>'; } echo '</table><br />'; echo '<br /><div align=right>' . $pagenav . '</div><br />'; - }else{ - echo '<div class="errorMsg center">' . _AM_XPDF_ERROR_NOBMODDOCUMENTS . '</div><br />'; + } else { + echo '<table width="100%" cellspacing="1" class="outer">'; + echo '<tr>'; + echo '<th align="center" width="15%">' . _AM_XPDF_MODIFIED_ID . '</th>'; + echo '<th align="center" width="20%">' . _AM_XPDF_MODIFIED_TITLE . '</th>'; + echo '<th align="center" width="20%">' . _AM_XPDF_MODIFIED_SENDER . '</th>'; + echo '<th align="center" width="15%">'._AM_XPDF_FORMACTION.'</th>'; + echo '</tr>'; + echo '<tr><td class="errorMsg center" colspan="4">' . _AM_XPDF_ERROR_NOBMODDOCUMENTS . '</td></tr>'; + echo '</table><br />'; } break; - // Affiche la comparaison de fichier + // Displays the document comparison case "view_docs": echo $modifiedAdmin->addNavigation('modified.php'); $modifiedAdmin->addItemButton(_MI_XPDF_ADMENU5, 'modified.php', 'list'); echo $modifiedAdmin->renderButton(); - //information du téléchargement + //information of loading $view_docs = $docsHandler->get($_REQUEST['doc_id']); //information du téléchargement modifié $view_moddocs = $docsmod_Handler->get($_REQUEST['mod_id']); // original - $docs_title = $view_docs->getVar('title'); - $docs_url = $view_docs->getVar('url'); - //catégorie - $view_categorie = $docscat_Handler->get($view_docs->getVar('cid')); - $docs_categorie = $view_categorie->getVar('cat_title'); - $docs_homepage = $view_docs->getVar('homepage'); - $docs_version = $view_docs->getVar('version'); - $docs_size = $view_docs->getVar('size'); - $docs_platform = $view_docs->getVar('platform'); - $docs_description = $view_docs->getVar('description'); - $docs_logourl = $view_docs->getVar('logourl'); - // modifié - $moddocs_title = $view_moddocs->getVar('title'); - $moddocs_url = $view_moddocs->getVar('url'); - //catégorie - $view_categorie = $docscat_Handler->get($view_moddocs->getVar('cid')); - $moddocs_categorie = $view_categorie->getVar('cat_title'); - $moddocs_homepage = $view_moddocs->getVar('homepage'); - $moddocs_version = $view_moddocs->getVar('version'); - $moddocs_size = $view_moddocs->getVar('size'); - $moddocs_platform = $view_moddocs->getVar('platform'); - $moddocs_description = $view_moddocs->getVar('description'); - $moddocs_logourl = $view_moddocs->getVar('logourl'); + $docs_title = $view_docs->getVar('doc_title'); + $docs_url = $view_docs->getVar('doc_image'); + //category + $view_categorie = $catHandler->get($view_docs->getVar('doc_cid')); + $docs_categorie = $view_categorie->getVar('cat_title'); + $docs_description = $view_docs->getVar('doc_description'); + // modified + $moddocs_title = $view_moddocs->getVar('doc_title'); + $moddocs_url = $view_moddocs->getVar('doc_image'); + //category + $view_categorie = $catHandler->get($view_moddocs->getVar('mod_cid')); + $moddocs_categorie = $view_categorie->getVar('cat_title'); + $moddocs_description = $view_moddocs->getVar('mod_description'); + $moddocs_logourl = $view_moddocs->getVar('mod_image'); echo "<style type=\"text/css\">\n"; echo ".style_dif {color: #FF0000; font-weight: bold;}\n"; echo ".style_ide {color: #009966; font-weight: bold;}\n"; echo "</style>\n"; - //originale + // original echo '<table width="100%" border="0" cellspacing="1" class="outer"><tr class="odd"><td>'; echo '<table border="1" cellpadding="5" cellspacing="0" align="center"><tr><td>'; echo '<h4>' . _AM_XPDF_MODIFIED_ORIGINAL . '</h4>'; @@ -145,46 +146,7 @@ $criteria->setOrder('ASC'); $criteria->add(new Criteria('status', 1)); $docs_field = $docsfield_Handler->getall($criteria); - foreach (array_keys($docs_field) as $i) { - if ($docs_field[$i]->getVar('status_def') == 1){ - if ($docs_field[$i]->getVar('fid') == 1){ - //page d'accueil - echo '<tr><td valign="top" width="40%"><small><span class="' . ($docs_homepage == $moddocs_homepage ? 'style_ide' : 'style_dif') . '">' . _AM_XPDF_FORMHOMEPAGE . '</span>: <a href="' . $docs_homepage . '">' . $docs_homepage . '</a></small></td></tr>'; - } - if ($docs_field[$i]->getVar('fid') == 2){ - //version - echo '<tr><td valign="top" width="40%"><small><span class="' . ($docs_version == $moddocs_version ? 'style_ide' : 'style_dif') . '">' . _AM_XPDF_FORMVERSION . '</span>: ' . $docs_version . '</small></td></tr>'; - } - if ($docs_field[$i]->getVar('fid') == 3){ - //taille du fichier - echo '<tr><td valign="top" width="40%"><small><span class="' . ($docs_size == $moddocs_size ? 'style_ide' : 'style_dif') . '">' . _AM_XPDF_FORMSIZE . '</span>: ' . $docs_size . '</small></td></tr>'; - } - if ($docs_field[$i]->getVar('fid') == 4){ - //plateforme - echo '<tr><td valign="top" width="40%"><small><span class="' . ($docs_platform == $moddocs_platform ? 'style_ide' : 'style_dif') . '">' . _AM_XPDF_FORMPLATFORM . '</span>: ' . $docs_platform . '</small></td></tr>'; - } - }else{ - //original - $contenu = ''; - $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('lid', $_REQUEST['docs_lid'])); - $criteria->add(new Criteria('fid', $docs_field[$i]->getVar('fid'))); - $docsfielddata = $docsfielddata_Handler->getall($criteria); - foreach (array_keys($docsfielddata) as $j) { - $contenu = $docsfielddata[$j]->getVar('data'); - } - //proposé - $mod_contenu = ''; - $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('lid', $_REQUEST['mod_id'])); - $criteria->add(new Criteria('fid', $docs_field[$i]->getVar('fid'))); - $docsfieldmoddata = $docsfieldmoddata_Handler->getall($criteria); - foreach (array_keys($docsfieldmoddata) as $j) { - $mod_contenu = $docsfieldmoddata[$j]->getVar('moddata'); - } - echo '<tr><td valign="top" width="40%"><small><span class="' . ($contenu == $mod_contenu ? 'style_ide' : 'style_dif') . '">' . $docs_field[$i]->getVar('title') . '</span>: ' . $contenu . '</small></td></tr>'; - } - } + ... [truncated message content] |
From: <txm...@us...> - 2012-05-01 14:06:39
|
Revision: 9418 http://xoops.svn.sourceforge.net/xoops/?rev=9418&view=rev Author: txmodxoops Date: 2012-05-01 14:06:30 +0000 (Tue, 01 May 2012) Log Message: ----------- working version alpha 1 only for testing Updated categories.php Rss files Viewcat.php Modified Paths: -------------- XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_cat.php XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php XoopsModules/xpdf/trunk/modules/xpdf/include/functions.php XoopsModules/xpdf/trunk/modules/xpdf/include/install.php XoopsModules/xpdf/trunk/modules/xpdf/index.php XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_doclist.html XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_header.html XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_index.html XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php Added Paths: ----------- XoopsModules/xpdf/trunk/modules/xpdf/rss.php XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_rss.html Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php 2012-04-30 19:51:13 UTC (rev 9417) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php 2012-05-01 14:06:30 UTC (rev 9418) @@ -28,7 +28,7 @@ include "admin_header.php"; xoops_cp_header(); -global $pathImageIcon; +global $pathImageIcon, $xoopsModuleConfig; // We recovered the value of the argument op in the URL$ $op = xpdf_CleanVars($_REQUEST, 'op', 'list', 'string'); @@ -77,7 +77,7 @@ $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'><img src='".XPDF_UPLOAD_CAT_URL."/".$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>"; @@ -127,11 +127,10 @@ $obj->setVar("cat_pid", $_REQUEST["cat_pid"]); //Form cat_title $obj->setVar("cat_title", $_REQUEST["cat_title"]); - //Form cat_image + //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); + $uploaddir = XPDF_UPLOAD_CAT_PATH."/"; + $uploader = new XoopsMediaUploader($uploaddir, $GLOBALS['xoopsModuleConfig']['mimetypes'], 104857600, null, null); if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { $uploader->setPrefix("cat_image_") ; $uploader->fetchMedia($_POST['xoops_upload_file'][0]); Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php 2012-04-30 19:51:13 UTC (rev 9417) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php 2012-05-01 14:06:30 UTC (rev 9418) @@ -96,9 +96,9 @@ 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>"; + echo "<td class='center'><img src='../images/16/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'><img src='../images/16/red_ball.png' border='0' alt='"._AM_XPDF_CREATEPDF."' /></td>"; } echo "<td class='center'>".$doc_arr[$i]->getVar("doc_weight")."</td>"; Modified: XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_cat.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_cat.php 2012-04-30 19:51:13 UTC (rev 9417) +++ XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_cat.php 2012-05-01 14:06:30 UTC (rev 9418) @@ -62,18 +62,18 @@ include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php"); $form = new XoopsThemeForm($title, "form_cat", $action, "post", true); $form->setExtra('enctype="multipart/form-data"'); - + // Title $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->setSort('cat_weight ASC, cat_title'); $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))); - + $form->addElement(new XoopsFormLabel(_AM_XPDF_CAT_PID, $mytree->makeSelBox("cat_pid", "cat_title","--", $this->getVar("cat_pid"),true))); + // Image $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 />'); @@ -91,7 +91,7 @@ $fileseltray->addElement(new XoopsFormLabel(''), false); $imgtray->addElement($fileseltray); $form->addElement($imgtray); - + // Description $editor_configs=array(); $editor_configs["name"] = "cat_description"; $editor_configs["value"] = $this->getVar("cat_description", "e"); @@ -101,7 +101,7 @@ $editor_configs["height"] = "400px"; $editor_configs["editor"] = $GLOBALS["xoopsModuleConfig"]["xpdf_editor"]; $form->addElement( new XoopsFormEditor(_AM_XPDF_CAT_DESCRIPTION, "cat_description", $editor_configs), false ); - + // Weight $form->addElement(new XoopsFormText(_AM_XPDF_CAT_WEIGHT, "cat_weight", 10, 25, $this->getVar("cat_weight")), true); $form->addElement(new XoopsFormHidden("op", "save_cat")); Modified: XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php 2012-04-30 19:51:13 UTC (rev 9417) +++ XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php 2012-05-01 14:06:30 UTC (rev 9418) @@ -50,7 +50,7 @@ $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_weight", XOBJ_DTYPE_INT, 0, 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); Modified: XoopsModules/xpdf/trunk/modules/xpdf/include/functions.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/include/functions.php 2012-04-30 19:51:13 UTC (rev 9417) +++ XoopsModules/xpdf/trunk/modules/xpdf/include/functions.php 2012-05-01 14:06:30 UTC (rev 9418) @@ -222,4 +222,51 @@ $Path .= $first_category; return $Path; } + +function xpdf_PathTreeUrl($mytree, $key, $category_array, $title, $prefix = '', $link = false, $order = 'ASC', $lasturl = false) +{ + global $xoopsModule; + $category_parent = $mytree->getAllParent($key); + if ($order == 'ASC'){ + $category_parent = array_reverse($category_parent); + if ($link == true) { + $Path = '<a href="index.php">' . $xoopsModule->name() . '</a>' . $prefix; + }else{ + $Path = $xoopsModule->name() . $prefix; + } + }else{ + if (array_key_exists($key, $category_array)){ + $first_category = $category_array[$key]->getVar($title); + }else{ + $first_category = ''; + } + $Path = $first_category . $prefix; + } + foreach (array_keys($category_parent) as $j) { + if ($link == true) { + $Path .= '<a href="viewcat.php?cid=' . $category_parent[$j]->getVar('cat_cid') . '">' . $category_parent[$j]->getVar($title) . '</a>' . $prefix; + }else{ + $Path .= $category_parent[$j]->getVar($title) . $prefix; + } + } + if ($order == 'ASC'){ + if (array_key_exists($key, $category_array)){ + if ($lasturl == true){ + $first_category = '<a href="viewcat.php?cid=' . $category_array[$key]->getVar('cat_cid') . '">' . $category_array[$key]->getVar($title) . '</a>'; + }else{ + $first_category = $category_array[$key]->getVar($title); + } + }else{ + $first_category = ''; + } + $Path .= $first_category; + }else{ + if ($link == true) { + $Path .= '<a href="index.php">' . $xoopsModule->name() . '</a>'; + }else{ + $Path .= $xoopsModule->name(); + } + } + return $Path; +} ?> \ No newline at end of file Modified: XoopsModules/xpdf/trunk/modules/xpdf/include/install.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/include/install.php 2012-04-30 19:51:13 UTC (rev 9417) +++ XoopsModules/xpdf/trunk/modules/xpdf/include/install.php 2012-05-01 14:06:30 UTC (rev 9418) @@ -24,25 +24,15 @@ * * Version : 1.01 Mon 2012/04/30 15:11:55 : timgno Exp $ * **************************************************************************** - */ - + */ $indexFile = XOOPS_UPLOAD_PATH."/index.html"; $blankFile = XOOPS_UPLOAD_PATH."/blank.gif"; - //Creation of folder "uploads" for the module to the site root $module_uploads = XOOPS_ROOT_PATH."/uploads/xpdf"; if(!is_dir($module_uploads)) mkdir($module_uploads, 0777); chmod($module_uploads, 0777); -copy($indexFile, XOOPS_ROOT_PATH."/uploads/xpdf/index.html"); - -//Creation of the file cat in uploads directory -$module_uploads = XOOPS_ROOT_PATH."/uploads/xpdf/cat"; -if(!is_dir($module_uploads)) - mkdir($module_uploads, 0777); - chmod($module_uploads, 0777); -copy($indexFile, XOOPS_ROOT_PATH."/uploads/xpdf/cat/index.html"); - +copy($indexFile, XOOPS_ROOT_PATH."/uploads/xpdf/index.html"); //Creation of the folder cat_image in uploads directory for images $module_uploads = XOOPS_ROOT_PATH."/uploads/xpdf/images"; if(!is_dir($module_uploads)) @@ -50,20 +40,23 @@ chmod($module_uploads, 0777); copy($indexFile, XOOPS_ROOT_PATH."/uploads/xpdf/images/index.html"); copy($blankFile, XOOPS_ROOT_PATH."/uploads/xpdf/images/blank.gif"); - +//Creation of the file cat in uploads directory +$module_uploads = XOOPS_ROOT_PATH."/uploads/xpdf/images/cat"; +if(!is_dir($module_uploads)) + mkdir($module_uploads, 0777); + chmod($module_uploads, 0777); +copy($indexFile, XOOPS_ROOT_PATH."/uploads/xpdf/images/cat/index.html"); +copy($blankFile, XOOPS_ROOT_PATH."/uploads/xpdf/images/cat/blank.gif"); //Creation of the file doc in uploads directory -$module_uploads = XOOPS_ROOT_PATH."/uploads/xpdf/doc"; +$module_uploads = XOOPS_ROOT_PATH."/uploads/xpdf/images/doc"; if(!is_dir($module_uploads)) mkdir($module_uploads, 0777); chmod($module_uploads, 0777); -copy($indexFile, XOOPS_ROOT_PATH."/uploads/xpdf/doc/index.html"); - +copy($indexFile, XOOPS_ROOT_PATH."/uploads/xpdf/images/doc/index.html"); +copy($blankFile, XOOPS_ROOT_PATH."/uploads/xpdf/images/doc/blank.gif"); //Creation of the folder doc_image in uploads directory for images -$module_uploads = XOOPS_ROOT_PATH."/uploads/xpdf/images"; +$module_uploads = XOOPS_ROOT_PATH."/uploads/xpdf/files"; if(!is_dir($module_uploads)) mkdir($module_uploads, 0777); chmod($module_uploads, 0777); -copy($indexFile, XOOPS_ROOT_PATH."/uploads/xpdf/images/index.html"); -copy($blankFile, XOOPS_ROOT_PATH."/uploads/xpdf/images/blank.gif"); - -?> \ No newline at end of file +copy($indexFile, XOOPS_ROOT_PATH."/uploads/xpdf/files/index.html"); \ No newline at end of file Modified: XoopsModules/xpdf/trunk/modules/xpdf/index.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/index.php 2012-04-30 19:51:13 UTC (rev 9417) +++ XoopsModules/xpdf/trunk/modules/xpdf/index.php 2012-05-01 14:06:30 UTC (rev 9418) @@ -31,13 +31,14 @@ $xoTheme->addStylesheet( $style, null ); $xoTheme->addScript( $script, null ); +//$cid = xpdf_CleanVars($_REQUEST, 'cat_id', 0, 'int'); // For permissions $categories = xpdf_MygetItemIds('xpdf_view', XPDF_DIRNAME); // Documents table $criteria = new CriteriaCompo(); $criteria->add(new Criteria('doc_status', 0, '!=')); -//$criteria->add(new Criteria('doc_cid', '(' . implode(',', $categories) . ')','IN')); +$criteria->add(new Criteria('doc_cid', $_REQUEST['doc_cid'])); $docArray = $docHandler->getall($criteria); $docCount = $docHandler->getCount($criteria); $xoopsTpl->assign('lang_thereare', sprintf(_MA_XPDF_INDEX_THEREARE, $docCount)); @@ -46,7 +47,7 @@ $criteria = new CriteriaCompo(); $criteria->setSort('cat_weight ASC, cat_title'); $criteria->setOrder('ASC'); -$criteria->add(new Criteria('cat_id', '(' . implode(',', $categories) . ')','IN')); +$criteria->add(new Criteria('cat_id', $_REQUEST['cat_id'])); $catArray = $catHandler->getall($criteria); $totalcategories = $catHandler->getCount($criteria); $mytree = new XoopsObjectTree($catArray, 'cat_id', 'cat_pid'); @@ -96,7 +97,7 @@ } $criteria = new CriteriaCompo(); $criteria->add(new Criteria('doc_status', 0, '!=')); - //$criteria->add(new Criteria('doc_cid', '(' . implode(',', $categories) . ')','IN')); + $criteria->add(new Criteria('doc_cid', $_REQUEST['doc_cid'])); $criteria->setLimit($GLOBALS['xoopsModuleConfig']['newdocuments']); $criteria->setSort('doc_published DESC, doc_title'); $criteria->setOrder('DESC'); @@ -120,7 +121,7 @@ $new = xpdf_NewOrUpdate($docArray[$i]->getVar('doc_published'), $docArray[$i]->getVar('doc_status')); $pop = xpdf_Popular($docArray[$i]->getVar('doc_hits')); - // Set if the person is an admin. + // Set if the user is an admin. if (is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) { $adminlink = '<a href="' . XPDF_URL . '/admin/documents.php?op=edit_doc&doc_id=' . $docArray[$i]->getVar('doc_id') . '" title="' . _EDIT . '"><img src="images/editicon.png" border="0" alt="' . _EDIT . '" /></a>'; } else { @@ -136,7 +137,7 @@ $did = $docArray[$i]->getVar('doc_id'); $cid = $docArray[$i]->getVar('doc_cid'); $title = $docArray[$i]->getVar('doc_title'); - $pdfdoc = "<a href='" . XPDF_URL . "/viewdoc.php?cid=".$cid."&did=".$did."' title='"._MA_XPDF_VIEWPDF."' target='_blank'>"; + $pdfdoc = "<a href='" . XPDF_URL . "/viewdoc.php?did=".$did."' title='"._MA_XPDF_IMG_VIEWPDF."' target='_blank'>"; $pdfdoc .= "<img src='" . XPDF_URL . "/images/22/view_pdf.png' width='22px' height='22px' border='0' alt='".$title."'/></a>"; // Render Display $xoopsTpl->append('file', array('did' => $did, 'cid' => $cid, 'title' => $title, 'new' => $new, 'pop' => $pop, 'image' => $doc_image, 'updated' => $datetime, 'slogan' => $slogan_short, 'adminlink' => $adminlink, 'submitter' => $submitter, 'online' => $online, 'count' => $count, 'pdfdoc' => $pdfdoc)); Added: XoopsModules/xpdf/trunk/modules/xpdf/rss.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/rss.php (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/rss.php 2012-05-01 14:06:30 UTC (rev 9418) @@ -0,0 +1,102 @@ +<?php +/** + * **************************************************************************** + * - A project for the Xoops CMS - (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. + * + * @copyright TXMod Xoops (http://www.txmodxoops.org) + * @license GPL see LICENSE + * @package xpdf + * @author TXMod Xoops (in...@tx...) + * + * Version : 1.01 Sun 2012/02/05 1:04:25 : Timgno Exp $ + * **************************************************************************** + */ +include_once dirname(__FILE__) . '/header.php'; +$cid = isset($_GET['doc_cid']) ? intval($_GET['doc_cid']) : 0; +include_once XOOPS_ROOT_PATH.'/class/template.php'; +$items_count = $GLOBALS['xoopsModuleConfig']['rssperpage']; + +if (function_exists('mb_http_output')) { + mb_http_output('pass'); +} +//header ('Content-Type:text/xml; charset=UTF-8'); +$GLOBALS['xoopsModuleConfig']["utf8"] = false; + +$tpl = new XoopsTpl(); +$tpl->xoops_setCaching(2); //1 = Cache global, 2 = Cache individual (for template) +$tpl->xoops_setCacheTime($GLOBALS['xoopsModuleConfig']['timecacherss']*60); // Time of cache on seconds +$cats = xpdf_MygetItemIds('xpdf_view', XPDF_DIRNAME); +$criteria = new CriteriaCompo(); +$criteria->add(new Criteria('doc_status', 0, '!=')); +$criteria->add(new Criteria('doc_cid', '(' . implode(',', $cats) . ')','IN')); +if ($cid != 0){ + $criteria->add(new Criteria('doc_cid', $cid)); + $cat = $docscat_Handler->get($cid); + $title = $GLOBALS['xoopsConfig']['sitename'] . ' - ' . $GLOBALS['xoopsModule']->getVar('name') . ' - ' . $cat->getVar('cat_title'); +}else{ + $title = $GLOBALS['xoopsConfig']['sitename'] . ' - ' . $GLOBALS['xoopsModule']->getVar('name'); +} +$docHandler =& xoops_getModuleHandler("xpdf_doc", XPDF_DIRNAME); +$criteria->setLimit($GLOBALS['xoopsModuleConfig']['rssperpage']); +$criteria->setSort('doc_published'); +$criteria->setOrder('DESC'); +$docs_arr = $docHandler->getall($criteria); + +if (!$tpl->is_cached('db:xpdf_rss.html', $cid)) { + $tpl->assign('channel_title', htmlspecialchars($title, ENT_QUOTES)); + $tpl->assign('channel_link', XOOPS_URL.'/'); + $tpl->assign('channel_desc', htmlspecialchars($GLOBALS['xoopsConfig']['slogan'], ENT_QUOTES)); + $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss')); + $tpl->assign('channel_webmaster', $GLOBALS['xoopsConfig']['adminmail']); + $tpl->assign('channel_editor', $GLOBALS['xoopsConfig']['adminmail']); + $tpl->assign('channel_category', 'Event'); + $tpl->assign('channel_generator', 'XOOPS - ' . htmlspecialchars($GLOBALS['xoopsModule']->getVar('name'), ENT_QUOTES)); + $tpl->assign('channel_language', _LANGCODE); + if ( _LANGCODE == 'fr' ) { + $tpl->assign('docs', 'http://www.scriptol.fr/rss/RSS-2.0.html'); + } else { + $tpl->assign('docs', 'http://cyber.law.harvard.edu/rss/rss.html'); + } + $tpl->assign('image_url', XOOPS_URL . $GLOBALS['xoopsModuleConfig']['logorss']); + $dimention = getimagesize(XOOPS_ROOT_PATH . $GLOBALS['xoopsModuleConfig']['logorss']); + if (empty($dimention[0])) { + $width = 88; + } else { + $width = ($dimention[0] > 144) ? 144 : $dimention[0]; + } + if (empty($dimention[1])) { + $height = 31; + } else { + $height = ($dimention[1] > 400) ? 400 : $dimention[1]; + } + $tpl->assign('image_width', $width); + $tpl->assign('image_height', $height); + foreach (array_keys($docs_arr) as $i) { + $slogan = $docs_arr[$i]->getVar('doc_slogan'); + // To view only the short description + if (strpos($slogan,'[pagebreak]') == false){ + $slogan_short = $slogan; + }else{ + $slogan_short = substr($slogan,0,strpos($slogan,'[pagebreak]')); + } + $tpl->append('items', array('title' => htmlspecialchars($docs_arr[$i]->getVar('doc_title'), ENT_QUOTES), + 'link' => XOOPS_URL . '/modules/xpdf/singledoc.php?cid=' . $docs_arr[$i]->getVar('doc_cid') . '&did=' . $docs_arr[$i]->getVar('doc_id'), + 'guid' => XOOPS_URL . '/modules/xpdf/singledoc.php?cid=' . $docs_arr[$i]->getVar('doc_cid') . '&did=' . $docs_arr[$i]->getVar('doc_id'), + 'pubdate' => formatTimestamp($docs_arr[$i]->getVar('doc_published'), 'rss'), + 'description' => htmlspecialchars($slogan_short, ENT_QUOTES))); + } +} +header("Content-Type:text/xml; charset=" . _CHARSET); +$tpl->display('db:xpdf_rss.html', $cid); +?> \ No newline at end of file Modified: XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_doclist.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_doclist.html 2012-04-30 19:51:13 UTC (rev 9417) +++ XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_doclist.html 2012-05-01 14:06:30 UTC (rev 9418) @@ -23,11 +23,14 @@ <span class="x-itemPermaLink"><{$doc.slogan}> </span> </div> </div> - <div class="xpdf-itemViewImg"> - <a href="<{$xpdf_url}>/viewdoc.php?did=<{$doc.did}>" title="<{$smarty.const._MA_XPDF_IMG_VIEWPDF}>" rel="directory"><img src="<{$xpdf_url}>/images/22/view_pdf.png" border="0" alt="<{$smarty.const._MA_XPDF_IMG_VIEWPDF}>" /></a> + <div class=""> + </div> <div class="clear"></div> <div class="xpdf-itemBottom"><span><{$doc.adminlink}></span> - <span class="bold"><{$smarty.const._MA_XPDF_INDEX_SUBMITTER}></span>:<span class="itemPoster"><{$doc.submitter}></span> - <span class="bold"><{$smarty.const._MA_XPDF_INDEX_SUBMITDATE}></span>:<span class="itemPostDate"><{$doc.updated}></span></div> + <span class="bold"><{$smarty.const._MA_XPDF_INDEX_SUBMITTER}></span>:<span class="itemPoster"><{$doc.submitter}></span> - <span class="bold"><{$smarty.const._MA_XPDF_INDEX_SUBMITDATE}></span>:<span class="itemPostDate"><{$doc.updated}></span> + <span class="floatright"><{$doc.pdfdoc}></span> + <div class="clear"></div> + </div> </div> <{/if}> \ No newline at end of file Modified: XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_header.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_header.html 2012-04-30 19:51:13 UTC (rev 9417) +++ XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_header.html 2012-05-01 14:06:30 UTC (rev 9418) @@ -1,6 +1,6 @@ -<div class="box-header"> +<div class="xpdf-header"> <span class="left"><b>Title</b>: <{$smarty.const._MA_XPDF_TITLE}></span><br /> - <span class="left">Description: <{$smarty.const._MA_XPDF_DESC}></span> + <span class="left"><b>Description</b>: <{$smarty.const._MA_XPDF_DESC}></span> </div> <br /> <{if $adv != ''}> Modified: XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_index.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_index.html 2012-04-30 19:51:13 UTC (rev 9417) +++ XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_index.html 2012-05-01 14:06:30 UTC (rev 9418) @@ -36,7 +36,7 @@ <!-- End Show categories information --> <!-- RSS logo --> <div class="xpdf-rss right"> - <a title="<{$smarty.const._MA_XPDF_RSS}>" href="<{$xpdf_url}>/rss.php?cid=<{$cid}>"><img src="<{$xpdf_url}>/images/rss.gif" alt="<{$smarty.const._MA_XPDF_RSS}>" /></a> + <a title="<{$smarty.const._MA_XPDF_RSS}>" href="<{$xpdf_url}>/rss.php?cid=0" rel="external"><img src="<{$xpdf_url}>/images/rss.gif" alt="<{$smarty.const._MA_XPDF_RSS}>" /></a> </div> <!-- End Summary informations --> <div class="xpdf-thereare"><{$lang_thereare}></div> Added: XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_rss.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_rss.html (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_rss.html 2012-05-01 14:06:30 UTC (rev 9418) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="<{$smarty.const._CHARSET}>"?> +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title><{$channel_title}></title> + <link><{$channel_link}></link> + <description><{$channel_desc}></description> + <lastBuildDate><{$channel_lastbuild}></lastBuildDate> + <docs><{$docs}></docs> + <generator><{$channel_generator}></generator> + <category><{$channel_category}></category> + <managingEditor><{$channel_editor}></managingEditor> + <webMaster><{$channel_webmaster}></webMaster> + <language><{$channel_language}></language> + <atom:link href="<{$xoops_url}><{$smarty.server.REQUEST_URI}>" rel="self" type="application/rss+xml" /> + <{if $image_url != ""}> + <image> + <title><{$channel_title}></title> + <url><{$image_url}></url> + <link><{$channel_link}></link> + <width><{$image_width}></width> + <height><{$image_height}></height> + </image> + <{/if}> + <{foreach item=item from=$items}> + <item> + <title><{$item.title}></title> + <link><{$item.link}></link> + <description><{$item.description}></description> + <pubDate><{$item.pubdate}></pubDate> + <guid><{$item.guid}></guid> + </item> + <{/foreach}> + </channel> +</rss> \ No newline at end of file Modified: XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php 2012-04-30 19:51:13 UTC (rev 9417) +++ XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php 2012-05-01 14:06:30 UTC (rev 9418) @@ -1,126 +1,216 @@ <?php /** + * **************************************************************************** + * - A project for the Xoops CMS - (http://www.xoops.org) * **************************************************************************** - * - 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 ) + * 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. + * 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. * - * 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... ) + * @copyright TXMod Xoops (http://www.txmodxoops.org) + * @license GPL see LICENSE + * @package xpdf + * @author TXMod Xoops (in...@tx...) * - * Version : 1.01 Mon 2012/04/30 15:11:55 : timgno Exp $ + * Version : 1.01 Sun 2012/02/05 1:04:25 : Timgno Exp $ * **************************************************************************** */ +include_once dirname(__FILE__) . '/header.php'; +global $xoopsModuleConfig; -include_once "header.php"; -$xoopsOption['template_main'] = 'xpdf_cat.html'; +$catHandler =& xoops_getModuleHandler('xpdf_cat', XPDF_DIRNAME); +$docHandler =& xoops_getModuleHandler('xpdf_doc', XPDF_DIRNAME); +$xoopsOption['template_main'] = 'xpdf_viewcat.html'; include_once XOOPS_ROOT_PATH."/header.php"; -$xoTheme->addStylesheet($style); -$xoTheme->addScript($script); -$xoopsTpl->assign('xpdf_url', XPDF_URL); -$op = xpdf_CleanVars($_REQUEST, 'op', 'list', 'string'); +$xoTheme->addStylesheet( $style, null ); +$xoTheme->addScript( $js, null ); -switch ($op) -{ - case "save_cat": - if ( !$GLOBALS["xoopsSecurity"]->check() ) { - redirect_header("cat.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); +$cid = xpdf_CleanVars($_REQUEST, 'cid', 0, 'int'); +// For permissions +$categories = xpdf_MygetItemIds('xpdf_view', XPDF_DIRNAME); + +// Redirection if the category does not exist +$criteria = new CriteriaCompo(new Criteria('cat_id', intval($cid))); +/*if ($catHandler->getCount($criteria) == 0 || $cid == 0){ + redirect_header('index.php', 3, _MA_XPDF_CAT_NOTEXISTENT); + exit(); +} +// For permissions (if not in law, redirection) +if(!in_array(intval($cid), $categories)) { + redirect_header('index.php', 2, _NOPERM); + exit(); +}*/ + +// Category Table +$criteria = new CriteriaCompo(); +$criteria->setSort('cat_weight ASC, cat_title'); +$criteria->setOrder('ASC'); +$criteria->add(new Criteria('cat_id', $_REQUEST['cat_id'])); +$cat_arr = $catHandler->getall($criteria); +$mytree = new XoopsObjectTree($cat_arr, 'cat_id', 'cat_pid'); + +// Doocument table +$criteria = new CriteriaCompo(); +$criteria->add(new Criteria('doc_status', 0, '!=')); +$criteria->add(new Criteria('doc_cid', $_REQUEST['doc_cid'])); +$doc_arr = $docHandler->getall($criteria); +$xoopsTpl->assign('lang_thereare', sprintf(_MA_XPDF_INDEX_THEREARE, count($doc_arr))); + +// Navigation +$nav_category = xpdf_PathTreeUrl($mytree, $cid, $cat_arr, 'cat_title', $prefix = ' <img src="images/icons/arrow.gif" alt="arrow" /> ', true, 'ASC'); +$xoopsTpl->assign('category_path', $nav_category); + +// Info category +$xoopsTpl->assign('cid', $cid); +$cat_info = $catHandler->get($cid); +$xoopsTpl->assign('cat_description', $cat_info->getVar('cat_description')); + +// Category View +$xoopsTpl->assign('nb_colcat', $GLOBALS['xoopsModuleConfig']['nb_colcat']); +$count = 1; +$keywords = ''; +foreach (array_keys($cat_arr) as $i) { + if ($cat_arr[$i]->getVar('cat_pid') == $cid) + { + $cat_id = $cat_arr[$i]->getVar('cat_id'); + $totaldocuments = xpdf_NumbersOfEntries($mytree, $categories, $doc_arr, $cat_id); + $subcategories_arr = $mytree->getFirstChild($cat_id); + $chcount = 0; + $subcategories = ''; + // For keywords + $keywords .= $cat_arr[$i]->getVar('cat_title') . ','; + foreach (array_keys($subcategories_arr) as $j) { + if ($chcount >= $GLOBALS['xoopsModuleConfig']['nb_subcat']) { + $subcategories .= '<li>[<a href="'. XPDF_URL .'/viewcat.php?cid=' . $cat_id . '">+</a>]</li>'; + break; + } + $subcategories .= '<li><a href="'. XPDF_URL .'/viewcat.php?cid=' . $subcategories_arr[$j]->getVar('cat_id') . '">' . $subcategories_arr[$j]->getVar('cat_title') . '</a></li>'; + $keywords .= $cat_arr[$i]->getVar('cat_title') . ','; + $chcount++; } - if (isset($_REQUEST["cat_id"])) { - $obj =& $catHandler->get($_REQUEST["cat_id"]); - } else { - $obj =& $catHandler->create(); + $xoopsTpl->append('subcategories', array('image' => $cat_arr[$i]->getVar('cat_image'), 'cid' => $cat_id, 'title' => $cat_arr[$i]->getVar('cat_title'), 'description' => $cat_arr[$i]->getVar('cat_description'), 'infercategories' => $subcategories, 'totaldocuments' => $totaldocuments, 'count' => $count)); + $count++; + } +} + +// display des t\xE9l\xE9chargements +if ($GLOBALS['xoopsModuleConfig']['userperpage'] > 0){ + $xoopsTpl->assign('nb_coldoc', $GLOBALS['xoopsModuleConfig']['nb_coldoc']); + //Utilisation d'une copie d'\xE9cran avec la largeur selon les pr\xE9f\xE9rences + if ($GLOBALS['xoopsModuleConfig']['usedocshots'] == 1) { + $xoopsTpl->assign('shotwidth', $GLOBALS['xoopsModuleConfig']['shotwidth']); + $xoopsTpl->assign('show_screenshot', true); + $xoopsTpl->assign('img_float' , $GLOBALS['xoopsModuleConfig']['img_float']); + } + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('doc_status', 0, '!=')); + $criteria->add(new Criteria('doc_cid', $_REQUEST['doc_cid'])); + $criteria->add(new Criteria('doc_cid', intval($_REQUEST['cid']))); + $numrows = $docHandler->getCount($criteria); + $xoopsTpl->assign('lang_thereare', sprintf(_MA_XPDF_CAT_THEREARE, $numrows)); + + // Pour un display sur plusieurs pages + if (isset($_REQUEST['limit'])) { + $criteria->setLimit($_REQUEST['limit']); + $limit = $_REQUEST['limit']; + } else { + $criteria->setLimit($GLOBALS['xoopsModuleConfig']['userperpage']); + $limit = $GLOBALS['xoopsModuleConfig']['userperpage']; + } + if (isset($_REQUEST['start'])) { + $criteria->setStart($_REQUEST['start']); + $start = $_REQUEST['start']; + //$url = XOOPS_URL.'/'.$GLOBALS['xoopsModuleConfig']['baseurl'].'/start'.$start.'/cat,'.$cid.$GLOBALS['xoopsModuleConfig']['endofurl']; + } else { + $criteria->setStart(0); + $start = 0; + //$url = XOOPS_URL.'/'.$GLOBALS['xoopsModuleConfig']['baseurl'].'/cat,'.$cid.$GLOBALS['xoopsModuleConfig']['endofurl']; + } + if (isset($_REQUEST['sort'])) { + $criteria->setSort($_REQUEST['sort']); + $sort = $_REQUEST['sort']; + }else{ + $criteria->setSort('doc_published'); + $sort = 'date'; + } + if (isset($_REQUEST['order'])) { + $criteria->setOrder($_REQUEST['order']); + $order = $_REQUEST['order']; + }else{ + $criteria->setOrder('DESC'); + $order = 'DESC'; + } + //$url = XOOPS_URL.'/'.$GLOBALS['xoopsModuleConfig']['baseurl'].'/cat,'.$cid.'/start,'.$start.$GLOBALS['xoopsModuleConfig']['endofurl']; + $doc_arr = $docHandler->getall($criteria); + if ( $numrows > $limit ) { + include_once XOOPS_ROOT_PATH . "/class/pagenav.php"; + $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'limit=' . $limit . '&cid=' . intval($cid) . '&sort=' . $sort . '&order=' . $order); + $pagenav = $pagenav->renderNav(4); + + } else { + $pagenav = ''; + // + } + $xoopsTpl->assign('pagenav', $pagenav); + + $summary = ''; + $cpt = 0; + $categories = xpdf_MygetItemIds('xpdf_download', XPDF_DIRNAME); + $item = xpdf_MygetItemIds('xpdf_download_item', XPDF_DIRNAME); + foreach (array_keys($doc_arr) as $i) { + if ($doc_arr[$i]->getVar('doc_image') == 'blank.gif'){ + $doc_image = ''; + }else{ + $doc_image = XPDF_UPLOAD_DOC_PATH ."/". $doc_arr[$i]->getVar('doc_image'); } - - //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/"; - $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"]); - //Form cat_submitter - $obj->setVar("cat_submitter", $_REQUEST["cat_submitter"]); - //Form cat_created - $obj->setVar("cat_created", xpdf_convertDate($_REQUEST["cat_created"])); - //Form cat_online - $verif_cat_online = ($_REQUEST["cat_online"] == 1) ? "1" : "0"; - $obj->setVar("cat_online", $verif_cat_online); - - - if ($catHandler->insert($obj)) { - redirect_header("cat.php?op=list", 2, _MA_XPDF_FORMOK); + $datetime = formatTimestamp($doc_arr[$i]->getVar('doc_published'),'s'); + $submitter = XoopsUser::getUnameFromId($doc_arr[$i]->getVar('doc_submitter')); + $description = $doc_arr[$i]->getVar('doc_slogan'); + //to view only the short description + if (strpos($description,'[pagebreak]')==false){ + $slogan = $description; + }else{ + $slogan = substr($description,0,strpos($description,'[pagebreak]')); } + // pour les vignettes "new" et "mis \xE0 jour" + $new = xpdf_NewOrUpdate($doc_arr[$i]->getVar('doc_published'), $doc_arr[$i]->getVar('doc_status')); + $pop = xpdf_Popular($doc_arr[$i]->getVar('doc_hits')); - echo $obj->getHtmlErrors(); - $form =& $obj->getForm(); - break; - - case "list": - default: - $criteria = new CriteriaCompo(); - $criteria->setSort("cat_id ASC, cat_pid"); - $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 class='center'>"._MA_XPDF_CAT_PID."</th> - <th class='center'>"._MA_XPDF_CAT_TITLE."</th> - <th class='center'>"._MA_XPDF_CAT_IMAGE."</th> - <th class='center'>"._MA_XPDF_CAT_DESCRIPTION."</th> - <th class='center'>"._MA_XPDF_CAT_WEIGHT."</th> - <th class='center'>"._MA_XPDF_CAT_SUBMITTER."</th> - <th class='center'>"._MA_XPDF_CAT_CREATED."</th> - <th class='center'>"._MA_XPDF_CAT_ONLINE."</th> - - </tr>"; - - $class = "odd"; - echo "</table><br /><br />"; - } - break; + // Set if the user is an admin. + if (is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) { + $adminlink = '<a href="' . XPDF_URL . '/admin/documents.php?op=edit_doc&did=' . $doc_arr[$i]->getVar('doc_id') . '" title="' . _EDIT . '"><img src="images/editicon.png" border="0" alt="' . _EDIT . '" /></a>'; + } else { + $adminlink = ''; + } + // utilisation du sommaire + $cpt++; + $xoopsTpl->append('file', array('id' => $doc_arr[$i]->getVar('doc_id'),'cid' => $doc_arr[$i]->getVar('doc_cid'), 'title' => $doc_arr[$i]->getVar('doc_title'), 'new' => $new, 'pop' => $pop, 'image' => $doc_image, 'updated' => $datetime, 'slogan' => $slogan, + 'adminlink' => $adminlink, 'submitter' => $submitter, 'count' => $cpt)); + //For keywords + $keywords .= $doc_arr[$i]->getVar('title') . ','; + } } -if($xoopsModuleConfig['social_active']== 1) { - $xoopsTpl->assign('social_active', $xoopsModuleConfig['social_active']); - $xoopsTpl->assign('social_code', $xoopsModuleConfig['social_code']); -} -include_once XOOPS_ROOT_PATH."/footer.php"; +$pagetitle = xpdf_PathTreeUrl($mytree, $cid, $cat_arr, 'cat_title', $prefix = ' - ', false, 'DESC'); +$xoopsTpl->assign('xoops_pagetitle', $pagetitle); +//description +$xoTheme->addMeta( 'meta', 'description', strip_tags($cat_arr[$cid]->getVar('cat_description'))); +//keywords +$keywords = substr($keywords,0,-1); +$xoTheme->addMeta( 'meta', 'keywords', $keywords); + +$xoopsTpl->assign('xpdf_url', XPDF_URL); + +if($GLOBALS['xoopsModuleConfig']['show_social']== 1){ +$social = $GLOBALS['xoopsModuleConfig']['code_social']; +$xoopsTpl->assign('social', $social); } + +include_once XOOPS_ROOT_PATH."/footer.php"; ?> \ No newline at end of file Modified: XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php 2012-04-30 19:51:13 UTC (rev 9417) +++ XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php 2012-05-01 14:06:30 UTC (rev 9418) @@ -97,6 +97,9 @@ $modversion['templates'][$i]['file'] = "xpdf_doclist.html"; $modversion['templates'][$i]['description'] = "Xpdf doclist page"; $i++; +$modversion['templates'][$i]['file'] = "xpdf_rss.html"; +$modversion['templates'][$i]['description'] = "Xpdf rss page"; +$i++; $modversion['templates'][$i]['file'] = "xpdf_viewcat.html"; $modversion['templates'][$i]['description'] = "Xpdf cat page"; $i++; @@ -131,7 +134,7 @@ $modversion['config'][$i]['description'] = "_MI_XPDF_MAXSIZE_DESC"; $modversion['config'][$i]['formtype'] = "textbox"; $modversion['config'][$i]['valuetype'] = "int"; -$modversion['config'][$i]['default'] = "10485760"; +$modversion['config'][$i]['default'] = "104857600"; $i++; //Uploads : mimetypes cat_image $modversion['config'][$i]['name'] = "mimetypes"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <txm...@us...> - 2012-05-01 17:36:59
|
Revision: 9420 http://xoops.svn.sourceforge.net/xoops/?rev=9420&view=rev Author: txmodxoops Date: 2012-05-01 17:36:52 +0000 (Tue, 01 May 2012) Log Message: ----------- Testing Updated categories permissions Added admin/permissions.php Modified Paths: -------------- XoopsModules/xpdf/trunk/modules/xpdf/admin/menu.php XoopsModules/xpdf/trunk/modules/xpdf/css/style.css XoopsModules/xpdf/trunk/modules/xpdf/include/functions.php XoopsModules/xpdf/trunk/modules/xpdf/index.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/main.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/modinfo.php XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_doclist.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/viewcat.php Added Paths: ----------- XoopsModules/xpdf/trunk/modules/xpdf/admin/permissions.php Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/menu.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/menu.php 2012-05-01 17:21:31 UTC (rev 9419) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/menu.php 2012-05-01 17:36:52 UTC (rev 9420) @@ -41,5 +41,8 @@ $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/permissions.php"; +$adminmenu[$i]["icon"] = "../../".$pathImageAdmin."/permissions.png"; $i++; +$adminmenu[$i]["title"] = _MI_XPDF_ADMENU5; $adminmenu[$i]["link"] = "admin/about.php"; $adminmenu[$i]["icon"] = "../../".$pathImageAdmin."/about.png"; unset( $i ); Added: XoopsModules/xpdf/trunk/modules/xpdf/admin/permissions.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/permissions.php (rev 0) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/permissions.php 2012-05-01 17:36:52 UTC (rev 9420) @@ -0,0 +1,93 @@ +<?php +/** + * **************************************************************************** + * - A project for the Xoops CMS - (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. + * + * @copyright TXMod Xoops (http://www.txmodxoops.org) + * @license GPL see LICENSE + * @package xpdf + * @author TXMod Xoops (in...@tx...) + * + * Version : 1.01 Sun 2012/02/05 1:04:25 : Timgno Exp $ + * **************************************************************************** + */ +include 'admin_header.php'; +include_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php'; +if( !empty($_POST["submit"]) ) { + redirect_header( XOOPS_URL."/modules/".$xoopsModule->dirname()."/admin/permissions.php" , 1 , _MP_GPERMUPDATED ); +} +xoops_cp_header(); +$permAdmin = new ModuleAdmin(); +echo $permAdmin->addNavigation("permissions.php"); + +$permtoset= isset($_POST["permtoset"]) ? intval($_POST["permtoset"]) : 1; +$selected=array("","","",""); +$selected[$permtoset-1]=" selected"; + +echo " +<form method='post' name='fselperm' action='permissions.php'> + <table border=0> + <tr> + <td> + <select name='permtoset' onChange='javascript: document.fselperm.submit()'> + <option value='1'".$selected[0].">"._AM_XPDF_APPROVEFORM."</option> + <option value='2'".$selected[1].">"._AM_XPDF_SUBMITFORM."</option> + <option value='3'".$selected[2].">"._AM_XPDF_VIEWFORM."</option> + </select> + </td> + </tr> + </table> +</form>"; + +$module_id = $xoopsModule->getVar("mid"); + +switch($permtoset) +{ + case 1: + $titleForm = _AM_XPDF_APPROVEFORM; + $perm_name = "xpdf_approve"; + $perm_desc = _AM_XPDF_APPROVEFORM_DESC; + break; + case 2: + $titleForm = _AM_XPDF_SUBMITFORM; + $perm_name = "xpdf_submit"; + $perm_desc = _AM_XPDF_SUBMITFORM_DESC; + break; + case 3: + $titleForm = _AM_XPDF_VIEWFORM; + $perm_name = "xpdf_view"; + $perm_desc = _AM_XPDF_VIEWFORM_DESC; + break; +} + +$permform = new XoopsGroupPermForm($titleForm, $module_id, $perm_name, $perm_desc, "admin/permissions.php"); +if ($permtoset == 5){ + foreach( $global_perms_array as $perm_id => $perm_name ) { + $permform->addItem($perm_id , $perm_name) ; + } +} else { + $criteria = new CriteriaCompo(); + $criteria->setSort('cat_title'); + $criteria->setOrder('ASC'); + $cat_arr = $catHandler->getall($criteria); + foreach (array_keys($cat_arr) as $i) { + $permform->addItem($cat_arr[$i]->getVar('cat_id'), $cat_arr[$i]->getVar('cat_title')); + } +} +echo $permform->render(); +echo "<br /><br /><br /><br />\n"; +unset ($permform); + +include("admin_footer.php"); +?> \ No newline at end of file Modified: XoopsModules/xpdf/trunk/modules/xpdf/css/style.css =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/css/style.css 2012-05-01 17:21:31 UTC (rev 9419) +++ XoopsModules/xpdf/trunk/modules/xpdf/css/style.css 2012-05-01 17:36:52 UTC (rev 9420) @@ -17,14 +17,6 @@ height: 50px; } -.xpdf-adv { - text-align: center; - padding: 2px; - border-right: 1px solid #aaa; - border-bottom: 1px solid #aaa; - border-left: 1px solid #aaa; -} - .xpdf-body { margin: 0; } @@ -112,6 +104,14 @@ border: 1px solid #ccc; } +.xpdf-itemAdv { + text-align: center; + padding: 2px; + border-right: 1px solid #aaa; + border-bottom: 1px solid #aaa; + border-left: 1px solid #aaa; +} + .xpdf-itemTop { margin: 2px; padding: 2px; Modified: XoopsModules/xpdf/trunk/modules/xpdf/include/functions.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/include/functions.php 2012-05-01 17:21:31 UTC (rev 9419) +++ XoopsModules/xpdf/trunk/modules/xpdf/include/functions.php 2012-05-01 17:36:52 UTC (rev 9420) @@ -62,11 +62,11 @@ if(in_array($cid, $categories)) { $child = $mytree->getAllChild($cid); foreach (array_keys($entries) as $i) { - if ($entries[$i]->getVar('cid') == $cid){ + if ($entries[$i]->getVar('doc_cid') == $cid){ $count++; } foreach (array_keys($child) as $j) { - if ($entries[$i]->getVar('cid') == $j){ + if ($entries[$i]->getVar('doc_cid') == $j){ $count++; } } Modified: XoopsModules/xpdf/trunk/modules/xpdf/index.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/index.php 2012-05-01 17:21:31 UTC (rev 9419) +++ XoopsModules/xpdf/trunk/modules/xpdf/index.php 2012-05-01 17:36:52 UTC (rev 9420) @@ -31,14 +31,13 @@ $xoTheme->addStylesheet( $style, null ); $xoTheme->addScript( $script, null ); -//$cid = xpdf_CleanVars($_REQUEST, 'cat_id', 0, 'int'); // For permissions $categories = xpdf_MygetItemIds('xpdf_view', XPDF_DIRNAME); // Documents table $criteria = new CriteriaCompo(); $criteria->add(new Criteria('doc_status', 0, '!=')); -$criteria->add(new Criteria('doc_cid', $_REQUEST['doc_cid'])); +$criteria->add(new Criteria('doc_cid', '(' . implode(',', $categories) . ')','IN')); $docArray = $docHandler->getall($criteria); $docCount = $docHandler->getCount($criteria); $xoopsTpl->assign('lang_thereare', sprintf(_MA_XPDF_INDEX_THEREARE, $docCount)); @@ -47,7 +46,7 @@ $criteria = new CriteriaCompo(); $criteria->setSort('cat_weight ASC, cat_title'); $criteria->setOrder('ASC'); -$criteria->add(new Criteria('cat_id', $_REQUEST['cat_id'])); +$criteria->add(new Criteria('cat_id', '(' . implode(',', $categories) . ')','IN')); $catArray = $catHandler->getall($criteria); $totalcategories = $catHandler->getCount($criteria); $mytree = new XoopsObjectTree($catArray, 'cat_id', 'cat_pid'); @@ -97,7 +96,7 @@ } $criteria = new CriteriaCompo(); $criteria->add(new Criteria('doc_status', 0, '!=')); - $criteria->add(new Criteria('doc_cid', $_REQUEST['doc_cid'])); + $criteria->add(new Criteria('doc_cid', '(' . implode(',', $categories) . ')','IN')); $criteria->setLimit($GLOBALS['xoopsModuleConfig']['newdocuments']); $criteria->setSort('doc_published DESC, doc_title'); $criteria->setOrder('DESC'); @@ -126,7 +125,21 @@ $adminlink = '<a href="' . XPDF_URL . '/admin/documents.php?op=edit_doc&doc_id=' . $docArray[$i]->getVar('doc_id') . '" title="' . _EDIT . '"><img src="images/editicon.png" border="0" alt="' . _EDIT . '" /></a>'; } else { $adminlink = ''; - } + } + // Permission to view + if (xoops_getModuleOption('xpdf_view', XPDF_DIRNAME)) { + if (!in_array($docArray[$i]->getVar('doc_cid'), $categories)) { + $perm_view = true; + }else{ + $perm_view = false; + } + }else{ + if (!in_array($docArray[$i]->getVar('doc_id'), $item)) { + $perm_view = true; + }else{ + $perm_view = false; + } + } $doc_dohtml = $docArray[$i]->getVar('doc_dohtml'); $doc_dosmiley = $docArray[$i]->getVar('doc_dosmiley'); $doc_doxcodes = $docArray[$i]->getVar('doc_doxcodes'); @@ -140,9 +153,9 @@ $pdfdoc = "<a href='" . XPDF_URL . "/viewdoc.php?did=".$did."' title='"._MA_XPDF_IMG_VIEWPDF."' target='_blank'>"; $pdfdoc .= "<img src='" . XPDF_URL . "/images/22/view_pdf.png' width='22px' height='22px' border='0' alt='".$title."'/></a>"; // Render Display - $xoopsTpl->append('file', array('did' => $did, 'cid' => $cid, 'title' => $title, 'new' => $new, 'pop' => $pop, 'image' => $doc_image, 'updated' => $datetime, 'slogan' => $slogan_short, 'adminlink' => $adminlink, 'submitter' => $submitter, 'online' => $online, 'count' => $count, 'pdfdoc' => $pdfdoc)); + $xoopsTpl->append('file', array('did' => $did, 'cid' => $cid, 'title' => $title, 'new' => $new, 'pop' => $pop, 'image' => $doc_image, 'updated' => $datetime, 'slogan' => $slogan_short, 'adminlink' => $adminlink, 'submitter' => $submitter, 'perm_view' => $perm_view, 'online' => $online, 'count' => $count, 'pdfdoc' => $pdfdoc)); // For keywords - //$keywords .= $docArray[$i]->getVar('title') . ',';$keywords. + //$keywords .= $docArray[$i]->getVar('title') . ',';$keywords.perm_view $count++; } } Modified: XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php 2012-05-01 17:21:31 UTC (rev 9419) +++ XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php 2012-05-01 17:36:52 UTC (rev 9420) @@ -105,6 +105,13 @@ define("_AM_XPDF_DOC_BLOCK_RANDOM","Documents random"); define("_AM_XPDF_DOC_BLOCK_RECENT","Documents recents"); +define('_AM_XPDF_APPROVEFORM',"Permissions to approve"); +define('_AM_XPDF_APPROVEFORM_DESC',"Permissions to approve the document sented"); +define('_AM_XPDF_SUBMITFORM',"Permissions to submit"); +define('_AM_XPDF_SUBMITFORM_DESC',"Permission to submit a document"); +define('_AM_XPDF_VIEWFORM',"Permission to view"); +define('_AM_XPDF_VIEWFORM_DESC',"Permission to view a document"); + //Error NoFrameworks define("_AM_XPDF_NOFRAMEWORKS","Error: You don't use the Frameworks \"admin module\". Please install this Frameworks"); define("_AM_XPDF_MAINTAINEDBY", "is maintained by the"); Modified: XoopsModules/xpdf/trunk/modules/xpdf/language/english/main.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/language/english/main.php 2012-05-01 17:21:31 UTC (rev 9419) +++ XoopsModules/xpdf/trunk/modules/xpdf/language/english/main.php 2012-05-01 17:36:52 UTC (rev 9420) @@ -51,7 +51,7 @@ // viewcat.php: define("_MA_XPDF_CAT_CURSORTBY","Files currently sorted by : %s"); -define("_MA_XPDF_CAT_LIST","List"); +define("_MA_XPDF_CAT_LIST","Listed in this category"); define("_MA_XPDF_CAT_NONEXISTENT","This category does not exist"); define("_MA_XPDF_CAT_THEREARE","There are <b>%s</b> document(s) in this category"); Modified: XoopsModules/xpdf/trunk/modules/xpdf/language/english/modinfo.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/language/english/modinfo.php 2012-05-01 17:21:31 UTC (rev 9419) +++ XoopsModules/xpdf/trunk/modules/xpdf/language/english/modinfo.php 2012-05-01 17:36:52 UTC (rev 9420) @@ -34,7 +34,9 @@ define("_MI_XPDF_ADMENU1","Dashboard"); define("_MI_XPDF_ADMENU2","Categories"); define("_MI_XPDF_ADMENU3","Documents"); -define("_MI_XPDF_ADMENU4","About"); +define("_MI_XPDF_ADMENU4","Permissions"); +define("_MI_XPDF_ADMENU5","About"); + define("_MI_XPDF_MAXSIZE","Mime max size"); define("_MI_XPDF_MIMETYPES","Mime Types"); //Config Modified: XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_doclist.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_doclist.html 2012-05-01 17:21:31 UTC (rev 9419) +++ XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_doclist.html 2012-05-01 17:36:52 UTC (rev 9420) @@ -29,7 +29,9 @@ <div class="clear"></div> <div class="xpdf-itemBottom"><span><{$doc.adminlink}></span> <span class="bold"><{$smarty.const._MA_XPDF_INDEX_SUBMITTER}></span>:<span class="itemPoster"><{$doc.submitter}></span> - <span class="bold"><{$smarty.const._MA_XPDF_INDEX_SUBMITDATE}></span>:<span class="itemPostDate"><{$doc.updated}></span> + <{if $doc.perm_view == true}> <span class="floatright"><{$doc.pdfdoc}></span> + <{/if}> <div class="clear"></div> </div> </div> Modified: XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_header.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_header.html 2012-05-01 17:21:31 UTC (rev 9419) +++ XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_header.html 2012-05-01 17:36:52 UTC (rev 9420) @@ -2,7 +2,6 @@ <span class="left"><b>Title</b>: <{$smarty.const._MA_XPDF_TITLE}></span><br /> <span class="left"><b>Description</b>: <{$smarty.const._MA_XPDF_DESC}></span> </div> -<br /> <{if $adv != ''}> -<div class="center"><{$adv}></div><br /> +<br /><div class="xpdf-itemAdv center"><{$adv}></div><br /> <{/if}> Modified: XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_index.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_index.html 2012-05-01 17:21:31 UTC (rev 9419) +++ XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_index.html 2012-05-01 17:36:52 UTC (rev 9420) @@ -47,7 +47,7 @@ <tr> <!-- Start new link loop --> <{section name=i loop=$file}> - <td class="col_width<{$nb_dowcol}> top center"> + <td class="col_width<{$nb_coldoc}> top center"> <{include file="db:xpdf_doclist.html" doc=$file[i]}> </td> <{if $file[i].count is div by $nb_coldoc}> Modified: XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_viewcat.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_viewcat.html 2012-05-01 17:21:31 UTC (rev 9419) +++ XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_viewcat.html 2012-05-01 17:36:52 UTC (rev 9420) @@ -43,23 +43,22 @@ <!-- End Show categories information --> <!-- RSS logo --> - <div class="xpdf-rss"> + <div class="xpdf-rss right"> <a title="<{$smarty.const._MA_XPDF_RSS}>" href="<{$xpdf_url}>/rss.php?cid=<{$cid}>"><img src="<{$xpdf_url}>/images/rss.gif" alt="<{$smarty.const._MA_XPDF_RSS}>" /></a> </div> <div class="xpdf-thereare"><{$lang_thereare}></div> <{if $file != ""}> <!-- Start Show new files in Category page --> - <div class="xpdf-linetitle"><{$smarty.const._MA_XPDF_CAT_LIST}></div> + <div class="xpdf-latest"><{$smarty.const._MA_XPDF_CAT_LIST}></div> <table> <tr> <!-- Start new link loop --> <{section name=i loop=$file}> <td class="col_width<{$nb_coldoc}> top center"> - <{include file="db:xpdf_doc.html" doc=$file[i]}> + <{include file="db:xpdf_doclist.html" doc=$file[i]}> </td> <{if $file[i].count is div by $nb_coldoc}> - </tr> - <tr> + </tr><tr> <{/if}> <{/section}> <!-- End new link loop --> @@ -72,6 +71,6 @@ <{/if}> <!-- End Show new files in Category page --> - <{/if}> + <{/if}> </div> <{include file="db:xpdf_footer.html"}> \ No newline at end of file Modified: XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php 2012-05-01 17:21:31 UTC (rev 9419) +++ XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php 2012-05-01 17:36:52 UTC (rev 9420) @@ -30,7 +30,7 @@ $xoopsOption['template_main'] = 'xpdf_viewcat.html'; include_once XOOPS_ROOT_PATH."/header.php"; $xoTheme->addStylesheet( $style, null ); -$xoTheme->addScript( $js, null ); +$xoTheme->addScript( $script, null ); $cid = xpdf_CleanVars($_REQUEST, 'cid', 0, 'int'); // For permissions @@ -38,7 +38,7 @@ // Redirection if the category does not exist $criteria = new CriteriaCompo(new Criteria('cat_id', intval($cid))); -/*if ($catHandler->getCount($criteria) == 0 || $cid == 0){ +if ($catHandler->getCount($criteria) == 0 || $cid == 0){ redirect_header('index.php', 3, _MA_XPDF_CAT_NOTEXISTENT); exit(); } @@ -46,20 +46,20 @@ if(!in_array(intval($cid), $categories)) { redirect_header('index.php', 2, _NOPERM); exit(); -}*/ +}/**/ // Category Table $criteria = new CriteriaCompo(); $criteria->setSort('cat_weight ASC, cat_title'); $criteria->setOrder('ASC'); -$criteria->add(new Criteria('cat_id', $_REQUEST['cat_id'])); +$criteria->add(new Criteria('cat_id', '(' . implode(',', $categories) . ')','IN')); $cat_arr = $catHandler->getall($criteria); $mytree = new XoopsObjectTree($cat_arr, 'cat_id', 'cat_pid'); // Doocument table $criteria = new CriteriaCompo(); $criteria->add(new Criteria('doc_status', 0, '!=')); -$criteria->add(new Criteria('doc_cid', $_REQUEST['doc_cid'])); +$criteria->add(new Criteria('doc_cid', '(' . implode(',', $categories) . ')','IN')); $doc_arr = $docHandler->getall($criteria); $xoopsTpl->assign('lang_thereare', sprintf(_MA_XPDF_INDEX_THEREARE, count($doc_arr))); @@ -111,7 +111,7 @@ } $criteria = new CriteriaCompo(); $criteria->add(new Criteria('doc_status', 0, '!=')); - $criteria->add(new Criteria('doc_cid', $_REQUEST['doc_cid'])); + $criteria->add(new Criteria('doc_cid', '(' . implode(',', $categories) . ')','IN')); $criteria->add(new Criteria('doc_cid', intval($_REQUEST['cid']))); $numrows = $docHandler->getCount($criteria); $xoopsTpl->assign('lang_thereare', sprintf(_MA_XPDF_CAT_THEREARE, $numrows)); @@ -162,8 +162,8 @@ $summary = ''; $cpt = 0; - $categories = xpdf_MygetItemIds('xpdf_download', XPDF_DIRNAME); - $item = xpdf_MygetItemIds('xpdf_download_item', XPDF_DIRNAME); + $categories = xpdf_MygetItemIds('xpdf_view', XPDF_DIRNAME); + $item = xpdf_MygetItemIds('xpdf_doc_item', XPDF_DIRNAME); foreach (array_keys($doc_arr) as $i) { if ($doc_arr[$i]->getVar('doc_image') == 'blank.gif'){ $doc_image = ''; @@ -188,11 +188,36 @@ $adminlink = '<a href="' . XPDF_URL . '/admin/documents.php?op=edit_doc&did=' . $doc_arr[$i]->getVar('doc_id') . '" title="' . _EDIT . '"><img src="images/editicon.png" border="0" alt="' . _EDIT . '" /></a>'; } else { $adminlink = ''; - } + } + // Permission to view + if (xoops_getModuleOption('xpdf_view', XPDF_DIRNAME)) { + if (!in_array($doc_arr[$i]->getVar('doc_cid'), $categories)) { + $perm_view = true; + }else{ + $perm_view = false; + } + }else{ + if (!in_array($doc_arr[$i]->getVar('doc_id'), $item)) { + $perm_view = true; + }else{ + $perm_view = false; + } + } // utilisation du sommaire - $cpt++; - $xoopsTpl->append('file', array('id' => $doc_arr[$i]->getVar('doc_id'),'cid' => $doc_arr[$i]->getVar('doc_cid'), 'title' => $doc_arr[$i]->getVar('doc_title'), 'new' => $new, 'pop' => $pop, 'image' => $doc_image, 'updated' => $datetime, 'slogan' => $slogan, - 'adminlink' => $adminlink, 'submitter' => $submitter, 'count' => $cpt)); + $cpt++; + $doc_dohtml = $doc_arr[$i]->getVar('doc_dohtml'); + $doc_dosmiley = $doc_arr[$i]->getVar('doc_dosmiley'); + $doc_doxcodes = $doc_arr[$i]->getVar('doc_doxcodes'); + $doc_doimages = $doc_arr[$i]->getVar('doc_doimages'); + $doc_dobreak = $doc_arr[$i]->getVar('doc_dobreak'); + $slogan_short = $myts->displayTarea($slogan_short, $doc_dohtml, $doc_dosmiley, $doc_doxcodes, $doc_doimages, $doc_dobreak); + $online = $doc_arr[$i]->getVar('doc_online'); + $did = $doc_arr[$i]->getVar('doc_id'); + $cid = $doc_arr[$i]->getVar('doc_cid'); + $title = $doc_arr[$i]->getVar('doc_title'); + $pdfdoc = "<a href='" . XPDF_URL . "/viewdoc.php?did=".$did."' title='"._MA_XPDF_IMG_VIEWPDF."' target='_blank'>"; + $pdfdoc .= "<img src='" . XPDF_URL . "/images/22/view_pdf.png' width='22px' height='22px' border='0' alt='".$title."'/></a>"; + $xoopsTpl->append('file', array('did' => $did, 'cid' => $cid, 'title' => $title, 'new' => $new, 'pop' => $pop, 'image' => $doc_image, 'updated' => $datetime, 'slogan' => $slogan_short, 'adminlink' => $adminlink, 'submitter' => $submitter, 'perm_view' => $perm_view, 'online' => $online, 'count' => $cpt, 'pdfdoc' => $pdfdoc)); //For keywords $keywords .= $doc_arr[$i]->getVar('title') . ','; } @@ -209,7 +234,7 @@ $xoopsTpl->assign('xpdf_url', XPDF_URL); if($GLOBALS['xoopsModuleConfig']['show_social']== 1){ -$social = $GLOBALS['xoopsModuleConfig']['code_social']; +$social = $GLOBALS['xoopsModuleConfig']['social_code']; $xoopsTpl->assign('social', $social); } include_once XOOPS_ROOT_PATH."/footer.php"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <txm...@us...> - 2012-05-01 23:12:25
|
Revision: 9423 http://xoops.svn.sourceforge.net/xoops/?rev=9423&view=rev Author: txmodxoops Date: 2012-05-01 23:12:18 +0000 (Tue, 01 May 2012) Log Message: ----------- Fixed bug editors Fixed bug globals variables Modified Paths: -------------- 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.php XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php XoopsModules/xpdf/trunk/modules/xpdf/rss.php XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_viewcat.html XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/about.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/about.php 2012-05-01 18:10:53 UTC (rev 9422) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/about.php 2012-05-01 23:12:18 UTC (rev 9423) @@ -30,5 +30,5 @@ xoops_cp_header(); $aboutAdmin = new ModuleAdmin(); echo $aboutAdmin->addNavigation("about.php"); -echo $aboutAdmin->renderabout('6KJ7RW5DR3VTJ', false); +echo $aboutAdmin->renderabout('25J998Y3QEDZW', false); include "admin_footer.php"; \ No newline at end of file Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_footer.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_footer.php 2012-05-01 18:10:53 UTC (rev 9422) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_footer.php 2012-05-01 23:12:18 UTC (rev 9423) @@ -29,7 +29,7 @@ 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>"; +echo "<div class='center pad5'> + <span class='bold'>" . $xoopsModule->getVar('name') . "</span><span class='small italic'> "._AM_XPDF_MAINTAINEDBY." + <a href='http://www.txmodxoops.org/modules/newbb' title='Visit TXMod Xoops Community' class='tooltip' rel='external'>TXMod Xoops Community</a></span></div>"; xoops_cp_footer(); Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_header.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_header.php 2012-05-01 18:10:53 UTC (rev 9422) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/admin_header.php 2012-05-01 23:12:18 UTC (rev 9423) @@ -27,7 +27,7 @@ */ include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; -include_once XOOPS_ROOT_PATH . '/include/cp_functions.php'; +include_once XOOPS_ROOT_PATH . '/include/cp_header.php'; include_once XOOPS_ROOT_PATH . '/class/tree.php'; include_once '../include/config.php'; include_once '../include/functions.php'; Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php 2012-05-01 18:10:53 UTC (rev 9422) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php 2012-05-01 23:12:18 UTC (rev 9423) @@ -25,10 +25,9 @@ * Version : 1.01 Mon 2012/04/30 15:11:55 : timgno Exp $ * **************************************************************************** */ - include "admin_header.php"; xoops_cp_header(); -global $pathImageIcon, $xoopsModuleConfig; +global $pathImageIcon; // We recovered the value of the argument op in the URL$ $op = xpdf_CleanVars($_REQUEST, 'op', 'list', 'string'); @@ -42,8 +41,8 @@ echo $catAdmin->renderButton(); $limit = $GLOBALS['xoopsModuleConfig']['adminperpage']; $criteria = new CriteriaCompo(); - $criteria->setSort("cat_weight ASC, cat_title"); - $criteria->setOrder("ASC"); + $criteria->setSort("cat_weight DESC, cat_title"); + $criteria->setOrder("DESC"); $numrows = $catHandler->getCount(); $start = xpdf_CleanVars ( $_REQUEST, 'start', 0, 'int' ); $criteria->setStart($start); @@ -110,7 +109,7 @@ $obj =& $catHandler->create(); $form = $obj->getForm(); - $form->display(); + echo $form->display(); break; case "save_cat": @@ -129,8 +128,8 @@ $obj->setVar("cat_title", $_REQUEST["cat_title"]); //Form cat_image include_once XOOPS_ROOT_PATH."/class/uploader.php"; - $uploaddir = XPDF_UPLOAD_CAT_PATH."/"; - $uploader = new XoopsMediaUploader($uploaddir, $GLOBALS['xoopsModuleConfig']['mimetypes'], 104857600, null, null); + $uploader = new XoopsMediaUploader(XPDF_UPLOAD_CAT_PATH."/", $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]); @@ -154,7 +153,7 @@ echo $obj->getHtmlErrors(); $form =& $obj->getForm(); - $form->display(); + echo $form->display(); break; case "edit_cat": @@ -164,7 +163,7 @@ echo $catAdmin->renderButton(); $obj = $catHandler->get($_REQUEST["cat_id"]); $form = $obj->getForm(); - $form->display(); + echo $form->display(); break; case "delete_cat": Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php 2012-05-01 18:10:53 UTC (rev 9422) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php 2012-05-01 23:12:18 UTC (rev 9423) @@ -143,7 +143,7 @@ $obj =& $docHandler->create(); $form = $obj->getForm(); - $form->display(); + echo $form->display(); break; case "save_doc": @@ -168,9 +168,8 @@ $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); + $uploader = new XoopsMediaUploader(XPDF_UPLOAD_DOC_PATH."/", $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]); @@ -225,7 +224,7 @@ echo $obj->getHtmlErrors(); $form =& $obj->getForm(); - $form->display(); + echo $form->display(); break; case "edit_doc": @@ -235,7 +234,7 @@ echo $docAdmin->renderButton(); $obj = $docHandler->get($_REQUEST["doc_id"]); $form = $obj->getForm(); - $form->display(); + echo $form->display(); break; case "delete_doc": Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/index.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/index.php 2012-05-01 18:10:53 UTC (rev 9422) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/index.php 2012-05-01 23:12:18 UTC (rev 9423) @@ -39,11 +39,10 @@ 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); + $indexAdmin->addInfoBox(_AM_XPDF_STATISTICS); + $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS,_AM_XPDF_THEREARE_CAT, $count_cat, ($count_cat == 0) ? $r : $g); + $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS,_AM_XPDF_THEREARE_DOC, $count_doc, ($count_doc == 0) ? $r : $g); + $indexAdmin->addInfoBoxLine(_AM_XPDF_STATISTICS,_AM_XPDF_THEREARE_DOC_ONLINE, $doc_online, ($count_doc == 0) ? $r : $g); echo $indexAdmin->addNavigation("index.php"); echo $indexAdmin->renderIndex(); include "admin_footer.php"; Modified: XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php 2012-05-01 18:10:53 UTC (rev 9422) +++ XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php 2012-05-01 23:12:18 UTC (rev 9423) @@ -66,9 +66,7 @@ } function getForm($action = false) - { - global $xoopsDB, $xoopsModuleConfig; - + { if ($action === false) { $action = $_SERVER["REQUEST_URI"]; } @@ -228,11 +226,11 @@ $pdf_data['doimages'] = $pdfdoc->getVar('doc_doimages'); $pdf_data['dobreak'] = $pdfdoc->getVar('doc_dobreak'); - define ('PDF_CREATOR', $pdf_data['creator']); - define ('PDF_AUTHOR', $pdf_data['author']); - define ('PDF_HEADER_TITLE', $pdf_data['title']); - define ('PDF_HEADER_STRING', $pdf_data['subject']); - define ('PDF_HEADER_LOGO', 'logo.gif'); + define ('XPDF_CREATOR', $pdf_data['creator']); + define ('XPDF_AUTHOR', $pdf_data['author']); + define ('XPDF_HEADER_TITLE', $pdf_data['title']); + define ('XPDF_HEADER_STRING', $pdf_data['subject']); + define ('XPDF_HEADER_LOGO', 'logo.gif'); define ('K_PATH_IMAGES', XOOPS_ROOT_PATH.'/images/'); $myts =& MyTextSanitizer::getInstance(); @@ -258,7 +256,7 @@ $pdf->SetKeywords($doc_keywords); // set default header data - $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); + $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, XPDF_HEADER_TITLE, XPDF_HEADER_STRING); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP + 10, PDF_MARGIN_RIGHT); Modified: XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php 2012-05-01 18:10:53 UTC (rev 9422) +++ XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php 2012-05-01 23:12:18 UTC (rev 9423) @@ -27,18 +27,16 @@ */ //Index -define("_AM_XPDF_CAT","Categories Statistics"); +define("_AM_XPDF_STATISTICS","Statistics xPdf"); define("_AM_XPDF_THEREARE_CAT","There are <span class='bold'>%s</span> Categories in the Database"); -define("_AM_XPDF_DOC","Documents Statistics"); define("_AM_XPDF_THEREARE_DOC","There are <span class='bold'>%s</span> Documents in the Database"); define("_AM_XPDF_THEREARE_DOC_ONLINE","There are <span class='bold'>%s</span> Documents online"); //Buttons -define("_AM_XPDF_NEWCAT","Add New Categories"); +define("_AM_XPDF_NEWCAT","Add New Category"); define("_AM_XPDF_CATLIST","List Categories"); //Buttons -define("_AM_XPDF_NEWDOC","Add New Documents"); +define("_AM_XPDF_NEWDOC","Add New Document"); define("_AM_XPDF_DOCLIST","List Documents"); - //General define("_AM_XPDF_FORMOK","Registered successfull"); define("_AM_XPDF_FORMDELOK","Deleted successfull"); @@ -50,9 +48,9 @@ define("_AM_XPDF_OFF","Offline"); define("_AM_XPDF_ON","Online"); -define("_AM_XPDF_CAT_ADD","Add a Categories"); -define("_AM_XPDF_CAT_EDIT","Edit a Categories"); -define("_AM_XPDF_CAT_DELETE","Delete a Categories"); +define("_AM_XPDF_CAT_ADD","Add a Category"); +define("_AM_XPDF_CAT_EDIT","Edit Category"); +define("_AM_XPDF_CAT_DELETE","Delete Category"); define("_AM_XPDF_CAT_ID","Id"); define("_AM_XPDF_CAT_PID","Main Category"); define("_AM_XPDF_CAT_TITLE","Category Title"); @@ -60,10 +58,9 @@ define("_AM_XPDF_CAT_DESCRIPTION","Description"); define("_AM_XPDF_CAT_WEIGHT","Weight"); - -define("_AM_XPDF_DOC_ADD","Add a Documents"); -define("_AM_XPDF_DOC_EDIT","Edit a Documents"); -define("_AM_XPDF_DOC_DELETE","Delete a Documents"); +define("_AM_XPDF_DOC_ADD","Add a Document"); +define("_AM_XPDF_DOC_EDIT","Edit Document"); +define("_AM_XPDF_DOC_DELETE","Delete Document"); define("_AM_XPDF_DOC_ID","Id"); define("_AM_XPDF_DOC_CID","Category"); define("_AM_XPDF_DOC_FILENAME","Filename"); @@ -72,8 +69,8 @@ define("_AM_XPDF_DOC_PDFTEXT","Pdf Content"); define("_AM_XPDF_DOC_IMAGE","Image"); define("_AM_XPDF_DOC_SUBJECT","Subject"); -define("_AM_XPDF_DOC_FONTNAME","Fontname"); -define("_AM_XPDF_DOC_FONTSIZE","Fontsize"); +define("_AM_XPDF_DOC_FONTNAME","Name: "); +define("_AM_XPDF_DOC_FONTSIZE","Size: "); define("_AM_XPDF_DOC_KEYWORDS","Keywords"); define("_AM_XPDF_DOC_SUBMITTER","Submitter"); define("_AM_XPDF_DOC_CREATED","Created"); @@ -113,6 +110,6 @@ define('_AM_XPDF_VIEWFORM_DESC',"Permission to view a document"); //Error NoFrameworks -define("_AM_XPDF_NOFRAMEWORKS","Error: You don't use the Frameworks \"admin module\". Please install this Frameworks"); +define("_AM_XPDF_NOFRAMEWORKS","Error: You don't use the Frameworks 'Admin Module'. Please install this Frameworks"); define("_AM_XPDF_MAINTAINEDBY", "is maintained by the"); ?> \ No newline at end of file Modified: XoopsModules/xpdf/trunk/modules/xpdf/rss.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/rss.php 2012-05-01 18:10:53 UTC (rev 9422) +++ XoopsModules/xpdf/trunk/modules/xpdf/rss.php 2012-05-01 23:12:18 UTC (rev 9423) @@ -23,10 +23,10 @@ * **************************************************************************** */ include_once dirname(__FILE__) . '/header.php'; -$cid = isset($_GET['doc_cid']) ? intval($_GET['doc_cid']) : 0; +$did = xpdf_CleanVars($_REQUEST, 'doc_id', 0, 'int'); +$cid = xpdf_CleanVars($_REQUEST, 'doc_cid', 0, 'int'); include_once XOOPS_ROOT_PATH.'/class/template.php'; -$items_count = $GLOBALS['xoopsModuleConfig']['rssperpage']; - +$catHandler =& xoops_getModuleHandler('xpdf_cat', XPDF_DIRNAME); if (function_exists('mb_http_output')) { mb_http_output('pass'); } @@ -42,7 +42,7 @@ $criteria->add(new Criteria('doc_cid', '(' . implode(',', $cats) . ')','IN')); if ($cid != 0){ $criteria->add(new Criteria('doc_cid', $cid)); - $cat = $docscat_Handler->get($cid); + $cat = $catHandler->get($cid); $title = $GLOBALS['xoopsConfig']['sitename'] . ' - ' . $GLOBALS['xoopsModule']->getVar('name') . ' - ' . $cat->getVar('cat_title'); }else{ $title = $GLOBALS['xoopsConfig']['sitename'] . ' - ' . $GLOBALS['xoopsModule']->getVar('name'); @@ -88,11 +88,13 @@ if (strpos($slogan,'[pagebreak]') == false){ $slogan_short = $slogan; }else{ - $slogan_short = substr($slogan,0,strpos($slogan,'[pagebreak]')); + $slogan_short = substr($slogan, 0, strpos($slogan,'[pagebreak]')); } + $doc_id = $docs_arr[$i]->getVar('doc_id'); + $doc_cid = $docs_arr[$i]->getVar('doc_cid'); $tpl->append('items', array('title' => htmlspecialchars($docs_arr[$i]->getVar('doc_title'), ENT_QUOTES), - 'link' => XOOPS_URL . '/modules/xpdf/singledoc.php?cid=' . $docs_arr[$i]->getVar('doc_cid') . '&did=' . $docs_arr[$i]->getVar('doc_id'), - 'guid' => XOOPS_URL . '/modules/xpdf/singledoc.php?cid=' . $docs_arr[$i]->getVar('doc_cid') . '&did=' . $docs_arr[$i]->getVar('doc_id'), + 'link' => XOOPS_URL . '/modules/xpdf/viewdoc.php?doc_cid=' . $doc_cid . '&doc_id=' . $doc_id, + 'guid' => XOOPS_URL . '/modules/xpdf/viewdoc.php?doc_cid=' . $doc_cid . '&doc_id=' . $doc_id, 'pubdate' => formatTimestamp($docs_arr[$i]->getVar('doc_published'), 'rss'), 'description' => htmlspecialchars($slogan_short, ENT_QUOTES))); } Modified: XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_viewcat.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_viewcat.html 2012-05-01 18:10:53 UTC (rev 9422) +++ XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_viewcat.html 2012-05-01 23:12:18 UTC (rev 9423) @@ -44,7 +44,7 @@ <!-- RSS logo --> <div class="xpdf-rss right"> - <a title="<{$smarty.const._MA_XPDF_RSS}>" href="<{$xpdf_url}>/rss.php?cid=<{$cid}>"><img src="<{$xpdf_url}>/images/rss.gif" alt="<{$smarty.const._MA_XPDF_RSS}>" /></a> + <a title="<{$smarty.const._MA_XPDF_RSS}>" href="<{$xpdf_url}>/rss.php?cid=<{$cid}>" rel="external"><img src="<{$xpdf_url}>/images/rss.gif" alt="<{$smarty.const._MA_XPDF_RSS}>" /></a> </div> <div class="xpdf-thereare"><{$lang_thereare}></div> <{if $file != ""}> Modified: XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php 2012-05-01 18:10:53 UTC (rev 9422) +++ XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php 2012-05-01 23:12:18 UTC (rev 9423) @@ -172,12 +172,12 @@ } $datetime = formatTimestamp($doc_arr[$i]->getVar('doc_published'),'s'); $submitter = XoopsUser::getUnameFromId($doc_arr[$i]->getVar('doc_submitter')); - $description = $doc_arr[$i]->getVar('doc_slogan'); + $slogan = $doc_arr[$i]->getVar('doc_slogan'); //to view only the short description - if (strpos($description,'[pagebreak]')==false){ - $slogan = $description; + if (strpos($slogan,'[pagebreak]')==false){ + $slogan_short = $slogan; }else{ - $slogan = substr($description,0,strpos($description,'[pagebreak]')); + $slogan_short = substr($slogan,0,strpos($slogan,'[pagebreak]')); } // pour les vignettes "new" et "mis \xE0 jour" $new = xpdf_NewOrUpdate($doc_arr[$i]->getVar('doc_published'), $doc_arr[$i]->getVar('doc_status')); @@ -185,7 +185,7 @@ // Set if the user is an admin. if (is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) { - $adminlink = '<a href="' . XPDF_URL . '/admin/documents.php?op=edit_doc&did=' . $doc_arr[$i]->getVar('doc_id') . '" title="' . _EDIT . '"><img src="images/editicon.png" border="0" alt="' . _EDIT . '" /></a>'; + $adminlink = '<a href="' . XPDF_URL . '/admin/documents.php?op=edit_doc&doc_id=' . $doc_arr[$i]->getVar('doc_id') . '" title="' . _EDIT . '"><img src="images/editicon.png" border="0" alt="' . _EDIT . '" /></a>'; } else { $adminlink = ''; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <txm...@us...> - 2012-05-02 21:29:39
|
Revision: 9426 http://xoops.svn.sourceforge.net/xoops/?rev=9426&view=rev Author: txmodxoops Date: 2012-05-02 21:29:32 +0000 (Wed, 02 May 2012) Log Message: ----------- Fixed small bugs Modified Paths: -------------- XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_cat.php XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php XoopsModules/xpdf/trunk/modules/xpdf/css/style.css XoopsModules/xpdf/trunk/modules/xpdf/index.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/modinfo.php 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_viewcat.html XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php 2012-05-02 15:28:19 UTC (rev 9425) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php 2012-05-02 21:29:32 UTC (rev 9426) @@ -104,9 +104,9 @@ 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>"; + 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='"._AM_XPDF_ONLINE."' title='"._AM_XPDF_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'><a href='./documents.php?op=update_online&doc_id=".$i."&doc_online=1'><img src=".$pathImageIcon."/off.png border='0' alt='"._AM_XPDF_OFFLINE."' title='"._AM_XPDF_OFFLINE."'></a></td>"; } echo "<td class='center width5'> Modified: XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_cat.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_cat.php 2012-05-02 15:28:19 UTC (rev 9425) +++ XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_cat.php 2012-05-02 21:29:32 UTC (rev 9426) @@ -99,7 +99,7 @@ $editor_configs["cols"] = 80; $editor_configs["width"] = "100%"; $editor_configs["height"] = "400px"; - $editor_configs["editor"] = $GLOBALS["xoopsModuleConfig"]["xpdf_editor"]; + $editor_configs["editor"] = $GLOBALS["xoopsModuleConfig"]["xpdf_editor_cat"]; $form->addElement( new XoopsFormEditor(_AM_XPDF_CAT_DESCRIPTION, "cat_description", $editor_configs), false ); // Weight $form->addElement(new XoopsFormText(_AM_XPDF_CAT_WEIGHT, "cat_weight", 10, 25, $this->getVar("cat_weight")), true); Modified: XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php 2012-05-02 15:28:19 UTC (rev 9425) +++ XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php 2012-05-02 21:29:32 UTC (rev 9426) @@ -114,7 +114,7 @@ $editor_configs["cols"] = 80; $editor_configs["width"] = "100%"; $editor_configs["height"] = "400px"; - $editor_configs["editor"] = $GLOBALS["xoopsModuleConfig"]["xpdf_editor"]; + $editor_configs["editor"] = $GLOBALS["xoopsModuleConfig"]["xpdf_editor_doc"]; $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'; @@ -198,14 +198,15 @@ } function getPdf($dest = 'I') - { - include_once XOOPS_ROOT_PATH.'/Frameworks/tcpdf/tcpdf.php'; + { + include_once XOOPS_ROOT_PATH.'/Frameworks/tcpdf/tcpdf.php'; $filename = XOOPS_ROOT_PATH.'/Frameworks/tcpdf/config/lang/'._LANGCODE.'.php'; if(file_exists($filename)) { include_once $filename; } else { - include_once XOOPS_ROOT_PATH.'/Frameworks/tcpdf/config/lang/en.php'; + include_once XOOPS_ROOT_PATH.'/Frameworks/tcpdf/config/lang/eng.php'; } + $pdfdocHandler =& xoops_getModuleHandler("xpdf_doc", XPDF_DIRNAME); $pdfdoc = $pdfdocHandler->get($this->getVar('doc_id')); @@ -231,7 +232,7 @@ define ('XPDF_HEADER_TITLE', $pdf_data['title']); define ('XPDF_HEADER_STRING', $pdf_data['subject']); define ('XPDF_HEADER_LOGO', 'logo.gif'); - define ('K_PATH_IMAGES', XOOPS_ROOT_PATH.'/images/'); + define ('XK_PATH_IMAGES', XOOPS_ROOT_PATH.'/images/'); $myts =& MyTextSanitizer::getInstance(); $content = ''; Modified: XoopsModules/xpdf/trunk/modules/xpdf/css/style.css =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/css/style.css 2012-05-02 15:28:19 UTC (rev 9425) +++ XoopsModules/xpdf/trunk/modules/xpdf/css/style.css 2012-05-02 21:29:32 UTC (rev 9426) @@ -22,7 +22,7 @@ } .xpdf-categories { - height: 50px; + height: auto; background-color: #eee; border-right: 1px solid #aaa; border-bottom: 1px solid #aaa; Modified: XoopsModules/xpdf/trunk/modules/xpdf/index.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/index.php 2012-05-02 15:28:19 UTC (rev 9425) +++ XoopsModules/xpdf/trunk/modules/xpdf/index.php 2012-05-02 21:29:32 UTC (rev 9426) @@ -61,7 +61,7 @@ $count = 1; $keywords = ''; foreach (array_keys($catArray) as $i) { - if ($catArray[$i]->getVar('cat_pid') == 0){ + if ($catArray[$i]->getVar('cat_pid') == 0) { $totaldocuments = xpdf_NumbersOfEntries($mytree, $categories, $docArray, $catArray[$i]->getVar('cat_id')); $subcats_arr = $mytree->getFirstChild($catArray[$i]->getVar('cat_id')); $chcount = 0; @@ -78,7 +78,7 @@ $chcount++; } - $image = XPDF_UPLOAD_CAT_PATH ."/". $catArray[$i]->getVar('cat_image'); + $image = XPDF_UPLOAD_CAT_URL ."/". $catArray[$i]->getVar('cat_image'); $cat_description = $myts->displayTarea($catArray[$i]->getVar('cat_description'), 0); $xoopsTpl->append('categories', array('image' => $image, 'cid' => $catArray[$i]->getVar('cat_id'), 'title' => $catArray[$i]->getVar('cat_title'), 'description' => $cat_description, 'subcategories' => $subcategories, 'totaldocuments' => $totaldocuments, 'count' => $count)); $count++; @@ -166,6 +166,7 @@ $xoTheme->addMeta('meta', 'keywords', strip_tags($GLOBALS['xoopsModuleConfig']['keywords'])); $xoopsTpl->assign('nb_coldoc', $GLOBALS['xoopsModuleConfig']['nb_coldoc']); +$xoopsTpl->assign('adv', $GLOBALS['xoopsModuleConfig']['advertise']); if($GLOBALS['xoopsModuleConfig']['social_active'] == 1) { $social = $GLOBALS['xoopsModuleConfig']['social_code']; $act_social = $GLOBALS['xoopsModuleConfig']['social_active']; Modified: XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php 2012-05-02 15:28:19 UTC (rev 9425) +++ XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php 2012-05-02 21:29:32 UTC (rev 9426) @@ -45,8 +45,10 @@ define("_AM_XPDF_FORMUPLOAD","Upload"); define("_AM_XPDF_FORMIMAGE_PATH","File presents in %s"); define("_AM_XPDF_FORMACTION","Action"); -define("_AM_XPDF_OFF","Offline"); -define("_AM_XPDF_ON","Online"); +define("_AM_XPDF_OFFLINE","Offline"); +define("_AM_XPDF_ONLINE","Online"); +define("_AM_XPDF_CREATEPDF","Create PDF"); +define("_AM_XPDF_DELETEPDF","Delete PDF"); define("_AM_XPDF_CAT_ADD","Add a Category"); define("_AM_XPDF_CAT_EDIT","Edit Category"); Modified: XoopsModules/xpdf/trunk/modules/xpdf/language/english/modinfo.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/language/english/modinfo.php 2012-05-02 15:28:19 UTC (rev 9425) +++ XoopsModules/xpdf/trunk/modules/xpdf/language/english/modinfo.php 2012-05-02 21:29:32 UTC (rev 9426) @@ -69,7 +69,10 @@ define('_MI_XPDF_IMGFLOAT_RIGHT', "Float image to Right"); define('_MI_XPDF_NEWDOCS', "New Documents"); define('_MI_XPDF_NEWDOCS_DESC', "New Documents in index page"); -define("_MI_XPDF_EDITOR","Editor"); +define("_MI_XPDF_EDITOR_CAT","Categories Editor"); +define("_MI_XPDF_EDITOR_CAT_DESC","Choose an editor for categories"); +define("_MI_XPDF_EDITOR_DOC","Documents Editor"); +define("_MI_XPDF_EDITOR_DOC_DESC","Choose an editor for documents"); define("_MI_XPDF_KEYWORDS","Keywords"); define("_MI_XPDF_KEYWORDS_DESC","Insert here the keywords (separate by comma)"); define("_MI_XPDF_ADVERTISE","Code of advertise"); Modified: XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_footer.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_footer.html 2012-05-02 15:28:19 UTC (rev 9425) +++ XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_footer.html 2012-05-02 21:29:32 UTC (rev 9426) @@ -1,4 +1,4 @@ -<{if $adv != ''}> +<{if $adv != '' && !$xoops_isadmin}> <div class="center"><{$adv}></div> <{/if}> <{if $social_active != 0}> Modified: XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_header.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_header.html 2012-05-02 15:28:19 UTC (rev 9425) +++ XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_header.html 2012-05-02 21:29:32 UTC (rev 9426) @@ -2,6 +2,6 @@ <span class="left"><b>Title</b>: <{$smarty.const._MA_XPDF_TITLE}></span><br /> <span class="left"><b>Description</b>: <{$smarty.const._MA_XPDF_DESC}></span> </div> -<{if $adv != ''}> -<br /><div class="xpdf-itemAdv center"><{$adv}></div><br /> +<{if $adv != '' && !$xoops_isadmin}> +<div class="xpdf-itemAdv"><{$adv}></div> <{/if}> Modified: XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_viewcat.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_viewcat.html 2012-05-02 15:28:19 UTC (rev 9425) +++ XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_viewcat.html 2012-05-02 21:29:32 UTC (rev 9426) @@ -17,12 +17,12 @@ <div class="floatleft title"> <h2><a title="<{$category.title}>" href="<{$xpdf_url}>/viewcat.php?cid=<{$category.cid}>"><{$category.title}></a></h2> </div> - <div class="floatright total xo-pagact"><a title="<{$category.title}>" href="<{$xpdf_url}>/viewcat.php?cid=<{$category.id}>"><{$category.totaldocuments}></a></div> - <div class="endline"></div> + <div class="marg2 pad2 xo-pagact"> <{$category.totaldocuments}></div> + <div class="clear"></div> </div> <div class="xpdf-body justify"> <{if $category.image != ""}> - <a class="marg1 pad1" title="<{$category.title}>" href="<{$xpdf_url}>/viewcat.php?cid=<{$category.id}>"><img class="<{$img_float}>" src="<{$category.image}>" alt="<{$category.title}>" /></a> + <a class="marg1 pad1" title="<{$category.title}>" href="<{$xpdf_url}>/viewcat.php?cid=<{$category.cid}>"><img class="<{$img_float}>" src="<{$category.image}>" alt="<{$category.title}>" /></a> <{/if}> <{$category.description}> <div class="clear"></div> Modified: XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php 2012-05-02 15:28:19 UTC (rev 9425) +++ XoopsModules/xpdf/trunk/modules/xpdf/viewcat.php 2012-05-02 21:29:32 UTC (rev 9426) @@ -64,7 +64,7 @@ $xoopsTpl->assign('lang_thereare', sprintf(_MA_XPDF_INDEX_THEREARE, count($doc_arr))); // Navigation -$nav_category = xpdf_PathTreeUrl($mytree, $cid, $cat_arr, 'cat_title', $prefix = ' <img src="images/icons/arrow.gif" alt="arrow" /> ', true, 'ASC'); +$nav_category = xpdf_PathTreeUrl($mytree, $cid, $cat_arr, 'cat_title', $prefix = '<img src="images/icons/arrow.gif" alt="arrow" /> ', true, 'ASC'); $xoopsTpl->assign('category_path', $nav_category); // Info category @@ -84,8 +84,9 @@ $subcategories_arr = $mytree->getFirstChild($cat_id); $chcount = 0; $subcategories = ''; + $cat_title = $cat_arr[$i]->getVar('cat_title'); // For keywords - $keywords .= $cat_arr[$i]->getVar('cat_title') . ','; + $keywords .= $cat_title . ','; foreach (array_keys($subcategories_arr) as $j) { if ($chcount >= $GLOBALS['xoopsModuleConfig']['nb_subcat']) { $subcategories .= '<li>[<a href="'. XPDF_URL .'/viewcat.php?cid=' . $cat_id . '">+</a>]</li>'; @@ -93,9 +94,10 @@ } $subcategories .= '<li><a href="'. XPDF_URL .'/viewcat.php?cid=' . $subcategories_arr[$j]->getVar('cat_id') . '">' . $subcategories_arr[$j]->getVar('cat_title') . '</a></li>'; $keywords .= $cat_arr[$i]->getVar('cat_title') . ','; + $image = XPDF_UPLOAD_CAT_PATH ."/". $cat_arr[$i]->getVar('cat_image'); $chcount++; } - $xoopsTpl->append('subcategories', array('image' => $cat_arr[$i]->getVar('cat_image'), 'cid' => $cat_id, 'title' => $cat_arr[$i]->getVar('cat_title'), 'description' => $cat_arr[$i]->getVar('cat_description'), 'infercategories' => $subcategories, 'totaldocuments' => $totaldocuments, 'count' => $count)); + $xoopsTpl->append('subcategories', array('image' => $image, 'cid' => $cat_id, 'title' => $cat_title, 'description' => $cat_arr[$i]->getVar('cat_description'), 'subsubcategories' => $subcategories, 'totaldocuments' => $totaldocuments, 'count' => $count)); $count++; } } @@ -165,21 +167,22 @@ $categories = xpdf_MygetItemIds('xpdf_view', XPDF_DIRNAME); $item = xpdf_MygetItemIds('xpdf_doc_item', XPDF_DIRNAME); foreach (array_keys($doc_arr) as $i) { - if ($doc_arr[$i]->getVar('doc_image') == 'blank.gif'){ - $doc_image = ''; + $doc_image = XPDF_UPLOAD_DOC_URL ."/". $doc_arr[$i]->getVar('doc_image'); + if ($doc_image == 'blank.gif'){ + $image = ''; }else{ - $doc_image = XPDF_UPLOAD_DOC_PATH ."/". $doc_arr[$i]->getVar('doc_image'); + $image = $doc_image; } $datetime = formatTimestamp($doc_arr[$i]->getVar('doc_published'),'s'); $submitter = XoopsUser::getUnameFromId($doc_arr[$i]->getVar('doc_submitter')); $slogan = $doc_arr[$i]->getVar('doc_slogan'); - //to view only the short description + // To view only the short description if (strpos($slogan,'[pagebreak]')==false){ $slogan_short = $slogan; }else{ - $slogan_short = substr($slogan,0,strpos($slogan,'[pagebreak]')); + $slogan_short = substr($slogan, 0, strpos($slogan,'[pagebreak]')); } - // pour les vignettes "new" et "mis \xE0 jour" + // Images for "new" and "updated" $new = xpdf_NewOrUpdate($doc_arr[$i]->getVar('doc_published'), $doc_arr[$i]->getVar('doc_status')); $pop = xpdf_Popular($doc_arr[$i]->getVar('doc_hits')); @@ -217,7 +220,7 @@ $title = $doc_arr[$i]->getVar('doc_title'); $pdfdoc = "<a href='" . XPDF_URL . "/viewdoc.php?did=".$did."' title='"._MA_XPDF_IMG_VIEWPDF."' target='_blank'>"; $pdfdoc .= "<img src='" . XPDF_URL . "/images/22/view_pdf.png' width='22px' height='22px' border='0' alt='".$title."'/></a>"; - $xoopsTpl->append('file', array('did' => $did, 'cid' => $cid, 'title' => $title, 'new' => $new, 'pop' => $pop, 'image' => $doc_image, 'updated' => $datetime, 'slogan' => $slogan_short, 'adminlink' => $adminlink, 'submitter' => $submitter, 'perm_view' => $perm_view, 'online' => $online, 'count' => $cpt, 'pdfdoc' => $pdfdoc)); + $xoopsTpl->append('file', array('did' => $did, 'cid' => $cid, 'title' => $title, 'new' => $new, 'pop' => $pop, 'image' => $image, 'updated' => $datetime, 'slogan' => $slogan_short, 'adminlink' => $adminlink, 'submitter' => $submitter, 'perm_view' => $perm_view, 'online' => $online, 'count' => $cpt, 'pdfdoc' => $pdfdoc)); //For keywords $keywords .= $doc_arr[$i]->getVar('title') . ','; } @@ -232,10 +235,13 @@ $xoTheme->addMeta( 'meta', 'keywords', $keywords); $xoopsTpl->assign('xpdf_url', XPDF_URL); +$xoopsTpl->assign('adv', $GLOBALS['xoopsModuleConfig']['advertise']); -if($GLOBALS['xoopsModuleConfig']['show_social']== 1){ -$social = $GLOBALS['xoopsModuleConfig']['social_code']; -$xoopsTpl->assign('social', $social); } +if($GLOBALS['xoopsModuleConfig']['social_active'] == 1) { +$social = $GLOBALS['xoopsModuleConfig']['social_code']; +$act_social = $GLOBALS['xoopsModuleConfig']['social_active']; +$xoopsTpl->assign('social_active', $act_social); +$xoopsTpl->assign('social_code', $social); } include_once XOOPS_ROOT_PATH."/footer.php"; ?> \ No newline at end of file Modified: XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php 2012-05-02 15:28:19 UTC (rev 9425) +++ XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php 2012-05-02 21:29:32 UTC (rev 9426) @@ -112,15 +112,24 @@ // Config $i = 1; -$modversion['config'][$i]['name'] = "xpdf_editor"; -$modversion['config'][$i]['title'] = "_MI_XPDF_EDITOR"; -$modversion['config'][$i]['description'] = "_MI_XPDF_EDITOR_DESC"; +$modversion['config'][$i]['name'] = "xpdf_editor_cat"; +$modversion['config'][$i]['title'] = "_MI_XPDF_EDITOR_CAT"; +$modversion['config'][$i]['description'] = "_MI_XPDF_EDITOR_CAT_DESC"; $modversion['config'][$i]['formtype'] = "select"; $modversion['config'][$i]['valuetype'] = "text"; $modversion['config'][$i]['default'] = "dhtmltextarea"; $modversion['config'][$i]['options'] = XoopsLists::getEditorList(); $modversion['config'][$i]['category'] = "global"; $i++; +$modversion['config'][$i]['name'] = "xpdf_editor_doc"; +$modversion['config'][$i]['title'] = "_MI_XPDF_EDITOR_DOC"; +$modversion['config'][$i]['description'] = "_MI_XPDF_EDITOR_DOC_DESC"; +$modversion['config'][$i]['formtype'] = "select"; +$modversion['config'][$i]['valuetype'] = "text"; +$modversion['config'][$i]['default'] = "tinymce"; +$modversion['config'][$i]['options'] = XoopsLists::getEditorList(); +$modversion['config'][$i]['category'] = "global"; +$i++; $modversion['config'][$i]['name'] = "keywords"; $modversion['config'][$i]['title'] = "_MI_XPDF_KEYWORDS"; $modversion['config'][$i]['description'] = "_MI_XPDF_KEYWORDS_DESC"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <txm...@us...> - 2012-05-04 17:09:52
|
Revision: 9434 http://xoops.svn.sourceforge.net/xoops/?rev=9434&view=rev Author: txmodxoops Date: 2012-05-04 17:09:44 +0000 (Fri, 04 May 2012) Log Message: ----------- Updated Fixed small bugs Possibilities to create pdf files in uploads/xpdf/files directory Test Modified Paths: -------------- XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php XoopsModules/xpdf/trunk/modules/xpdf/css/style.css XoopsModules/xpdf/trunk/modules/xpdf/include/functions.php XoopsModules/xpdf/trunk/modules/xpdf/index.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/main.php XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_index.html XoopsModules/xpdf/trunk/modules/xpdf/viewdoc.php XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php Added Paths: ----------- XoopsModules/xpdf/trunk/modules/xpdf/images/16/create_pdf.png Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php 2012-05-03 17:42:04 UTC (rev 9433) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php 2012-05-04 17:09:44 UTC (rev 9434) @@ -41,8 +41,8 @@ echo $catAdmin->renderButton(); $limit = $GLOBALS['xoopsModuleConfig']['adminperpage']; $criteria = new CriteriaCompo(); - $criteria->setSort("cat_weight DESC, cat_title"); - $criteria->setOrder("DESC"); + $criteria->setSort("cat_id ASC, cat_title"); + $criteria->setOrder("ASC"); $numrows = $catHandler->getCount(); $start = xpdf_CleanVars ( $_REQUEST, 'start', 0, 'int' ); $criteria->setStart($start); @@ -117,15 +117,15 @@ redirect_header("categories.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); } if (isset($_REQUEST["cat_id"])) { - $obj =& $catHandler->get($_REQUEST["cat_id"]); + $obj =& $catHandler->get($_GET["cat_id"]); } else { $obj =& $catHandler->create(); } //Form cat_pid - $obj->setVar("cat_pid", $_REQUEST["cat_pid"]); + $obj->setVar("cat_pid", $_POST["cat_pid"]); //Form cat_title - $obj->setVar("cat_title", $_REQUEST["cat_title"]); + $obj->setVar("cat_title", $_POST["cat_title"]); //Form cat_image include_once XOOPS_ROOT_PATH."/class/uploader.php"; $uploader = new XoopsMediaUploader(XPDF_UPLOAD_CAT_PATH."/", $GLOBALS['xoopsModuleConfig']['mimetypes'], @@ -140,12 +140,12 @@ $obj->setVar("cat_image", $uploader->getSavedFileName()); } } else { - $obj->setVar("cat_image", $_REQUEST["cat_image"]); + $obj->setVar("cat_image", $_POST["cat_image"]); } //Form cat_description - $obj->setVar("cat_description", $_REQUEST["cat_description"]); + $obj->setVar("cat_description", $_POST["cat_description"]); //Form cat_weight - $obj->setVar("cat_weight", $_REQUEST["cat_weight"]); + $obj->setVar("cat_weight", $_POST["cat_weight"]); if ($catHandler->insert($obj)) { redirect_header("categories.php?op=list", 2, _AM_XPDF_FORMOK); @@ -161,13 +161,13 @@ $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"]); + $obj = $catHandler->get($_GET["cat_id"]); $form = $obj->getForm(); echo $form->display(); break; case "delete_cat": - $obj =& $catHandler->get($_REQUEST["cat_id"]); + $obj =& $catHandler->get($_GET["cat_id"]); if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { if ( !$GLOBALS["xoopsSecurity"]->check() ) { redirect_header("categories.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php 2012-05-03 17:42:04 UTC (rev 9433) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php 2012-05-04 17:09:44 UTC (rev 9434) @@ -47,7 +47,7 @@ redirect_header('categories.php?op=new_cat', 2, _AM_XPDF_REDIRECT_NOCAT ); } $criteria = new CriteriaCompo(); - $criteria->setSort("doc_weight ASC, doc_title"); + $criteria->setSort("doc_id ASC, doc_title"); $criteria->setOrder("ASC"); $numrows = $docHandler->getCount(); $start = xpdf_CleanVars ( $_REQUEST, 'start', 0, 'int' ); @@ -77,7 +77,7 @@ <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> + <th class='center width8'>"._AM_XPDF_FORMACTION."</th> </tr>"; $class = "odd"; @@ -104,14 +104,15 @@ 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='"._AM_XPDF_ONLINE."' title='"._AM_XPDF_ONLINE."'></a></td>"; + 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='"._AM_XPDF_ONLINE."' title='"._AM_XPDF_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='"._AM_XPDF_OFFLINE."' title='"._AM_XPDF_OFFLINE."'></a></td>"; + 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='"._AM_XPDF_OFFLINE."' title='"._AM_XPDF_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> + echo "<td class='center width8'> + <a href='documents.php?op=create_pdf_file&doc_id=".$i."'><img src='../images/16/create_pdf.png' alt='"._AM_XPDF_CREATEPDF."' title='"._AM_XPDF_CREATEPDF."'></a> + <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>"; } @@ -151,21 +152,21 @@ redirect_header("documents.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); } if (isset($_REQUEST["doc_id"])) { - $obj =& $docHandler->get($_REQUEST["doc_id"]); + $obj =& $docHandler->get($_GET["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"]); + $obj->setVar("doc_cid", $_POST["doc_cid"]); + //Form doc_filename + $obj->setVar("doc_filename", $_POST["doc_filename"]); //Form doc_title - $obj->setVar("doc_title", $_REQUEST["doc_title"]); + $obj->setVar("doc_title", $_POST["doc_title"]); //Form doc_slogan - $obj->setVar("doc_slogan", $_REQUEST["doc_slogan"]); + $obj->setVar("doc_slogan", $_POST["doc_slogan"]); //Form doc_pdftext - $obj->setVar("doc_pdftext", $_REQUEST["doc_pdftext"]); + $obj->setVar("doc_pdftext", $_POST["doc_pdftext"]); //Form doc_image include_once XOOPS_ROOT_PATH."/class/uploader.php"; $uploader = new XoopsMediaUploader(XPDF_UPLOAD_DOC_PATH."/", $GLOBALS['xoopsModuleConfig']['mimetypes'], @@ -180,22 +181,22 @@ $obj->setVar("doc_image", $uploader->getSavedFileName()); } } else { - $obj->setVar("doc_image", $_REQUEST["doc_image"]); + $obj->setVar("doc_image", $_POST["doc_image"]); } //Form doc_subject - $obj->setVar("doc_subject", $_REQUEST["doc_subject"]); + $obj->setVar("doc_subject", $_POST["doc_subject"]); //Form doc_fontname - $obj->setVar("doc_fontname", $_REQUEST["doc_fontname"]); + $obj->setVar("doc_fontname", $_POST["doc_fontname"]); //Form doc_fontsize - $obj->setVar("doc_fontsize", $_REQUEST["doc_fontsize"]); + $obj->setVar("doc_fontsize", $_POST["doc_fontsize"]); //Form doc_keywords - $obj->setVar("doc_keywords", $_REQUEST["doc_keywords"]); + $obj->setVar("doc_keywords", $_POST["doc_keywords"]); //Form doc_submitter - $obj->setVar("doc_submitter", $_REQUEST["doc_submitter"]); + $obj->setVar("doc_submitter", $_POST["doc_submitter"]); //Form doc_published - $obj->setVar("doc_published", xpdf_convertDate($_REQUEST["doc_published"])); + $obj->setVar("doc_published", xpdf_convertDate($_POST["doc_published"])); //Form doc_weight - $obj->setVar("doc_weight", $_REQUEST["doc_weight"]); + $obj->setVar("doc_weight", $_POST["doc_weight"]); //Form doc_status $verif_doc_status = ($_REQUEST["doc_status"] == 1) ? "1" : "0"; $obj->setVar("doc_status", $verif_doc_status); @@ -232,13 +233,13 @@ $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"]); + $obj = $docHandler->get($_GET["doc_id"]); $form = $obj->getForm(); echo $form->display(); break; case "delete_doc": - $obj =& $docHandler->get($_REQUEST["doc_id"]); + $obj =& $docHandler->get($_GET["doc_id"]); if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { if ( !$GLOBALS["xoopsSecurity"]->check() ) { redirect_header("documents.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); @@ -253,11 +254,23 @@ } break; + case "create_pdf_file": + if (isset($_GET["doc_id"])) { + $obj =& $docHandler->get($_GET["doc_id"]); + } + //$obj->setVar("doc_pdfcreated", $_POST["doc_pdfcreated"]); + echo $obj->getPdf('F'); + if ($docHandler->insert($obj)) { + redirect_header("documents.php", 3, _AM_XPDF_PDFFILECREATED); + } + echo $obj->getHtmlErrors(); + break; + case "update_online": - if (isset($_REQUEST["doc_id"])) { - $obj =& $docHandler->get($_REQUEST["doc_id"]); + if (isset($_GET["doc_id"])) { + $obj =& $docHandler->get($_GET["doc_id"]); } - $obj->setVar("doc_online", $_REQUEST["doc_online"]); + $obj->setVar("doc_online", $_POST["doc_online"]); if ($docHandler->insert($obj)) { redirect_header("documents.php", 3, _AM_XPDF_FORMOK); } Modified: XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php 2012-05-03 17:42:04 UTC (rev 9433) +++ XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php 2012-05-04 17:09:44 UTC (rev 9434) @@ -64,6 +64,35 @@ { $this->__construct(); } + + /** + * gets list of fonts folder from Frameworks/tcpdf/fonts directory + */ + function getFontList() + { + return self::getFontListAsArray(XOOPS_ROOT_PATH . '/Frameworks/tcpdf/fonts/'); + } + + /** + * gets list of font file names in a directory + * @author TXMod Xoops <in...@tx...> + */ + function getFontListAsArray($dirname, $prefix = '') + { + $fontlist = array(); + if ($handle = opendir($dirname)) { + while (false !== ($font = readdir($handle))) { + if (preg_match('/(\.php)$/i', $font)) { + $font = $prefix . $font; + $fontlist[$font] = substr($font, 0, strpos($font, '.')); + } + } + closedir($handle); + asort($fontlist); + reset($fontlist); + } + return $fontlist; + } function getForm($action = false) { @@ -77,7 +106,7 @@ $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_FILENAME, "doc_filename", 50, 50, $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); @@ -93,7 +122,7 @@ $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(); + $fonts_array = self::getFontList(); foreach( $fonts_array as $font ) { $fontnameselect->addOption("$font", $font); } Modified: XoopsModules/xpdf/trunk/modules/xpdf/css/style.css =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/css/style.css 2012-05-03 17:42:04 UTC (rev 9433) +++ XoopsModules/xpdf/trunk/modules/xpdf/css/style.css 2012-05-04 17:09:44 UTC (rev 9434) @@ -27,6 +27,7 @@ border-right: 1px solid #aaa; border-bottom: 1px solid #aaa; border-left: 1px solid #aaa; + vertical-align: top; } .xpdf-categoryPath { @@ -38,7 +39,7 @@ border-right: 1px solid #aaa; border-bottom: 1px solid #aaa; border-left: 1px solid #aaa; - vertical-align: middle; + vertical-align: top; } .xpdf-documents { @@ -69,8 +70,10 @@ border: 1px dotted #eee; } -.xpdf-subtitle { - font-size: 12px; +.xpdf-subCat { + font-size: 11px; + margin: 0 0 0 40px; + vertical-align: top; } .xpdf-image { @@ -121,9 +124,14 @@ .xpdf-itemTitle { font-size: 14px; - margin: 0 2px 0 2px; + margin: 0; padding: 2px; - border: 1px solid #ccc; + border-top: 1px; + border-right: 1px; + border-bottom: 0px; + border-left: 1px; + border-style: solid; + border-color: #000; } .xpdf-itemBody { @@ -132,8 +140,13 @@ } div.xpdf-itemImage { - float: left; - border: 1px solid #eee; + float: left; + border-top: 1px; + border-right: 1px; + border-bottom: 1px; + border-left: 0px; + border-style: solid; + border-color: #000; padding: 2px; } @@ -151,8 +164,13 @@ div.xpdf-itemText { float: right; - border: 1px solid #eee; - width: 74%; + border-top: 1px; + border-right: 0px; + border-bottom: 1px; + border-left: 1px; + border-style: solid; + border-color: #000; + width: 78%; /*margin: 0 0 0 148px;*/ padding: 5px; } Added: XoopsModules/xpdf/trunk/modules/xpdf/images/16/create_pdf.png =================================================================== (Binary files differ) Property changes on: XoopsModules/xpdf/trunk/modules/xpdf/images/16/create_pdf.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: XoopsModules/xpdf/trunk/modules/xpdf/include/functions.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/include/functions.php 2012-05-03 17:42:04 UTC (rev 9433) +++ XoopsModules/xpdf/trunk/modules/xpdf/include/functions.php 2012-05-04 17:09:44 UTC (rev 9434) @@ -122,20 +122,21 @@ $img_path = XPDF_PATH . "/language/" . $language . "/"; $img_url = XPDF_URL . "/language/" . $language . "/"; $en_path = XPDF_URL . '/language/english'; + $img_shotwidth = $GLOBALS['xoopsModuleConfig']['shotwidth']; switch($status) { case 1: if ( is_readable( $img_path . 'new.png') ){ - $new = ' <img src="' . $img_url . 'new.png" alt="' . _MA_XPDF_INDEX_NEWTHISWEEK . '" title="' . _MA_XPDF_INDEX_NEWTHISWEEK . '"/>'; + $new = ' <img src="' . $img_url . 'new.png" width="'.$img_shotwidth.'" alt="' . _MA_XPDF_INDEX_NEWTHISWEEK . '" title="' . _MA_XPDF_INDEX_NEWTHISWEEK . '"/>'; }else{ - $new = ' <img src="' . $en_path . '/new.png" alt="' . _MA_XPDF_INDEX_NEWTHISWEEK . '" title="' . _MA_XPDF_INDEX_NEWTHISWEEK . '"/>'; + $new = ' <img src="' . $en_path . '/new.png" width="'.$img_shotwidth.'" alt="' . _MA_XPDF_INDEX_NEWTHISWEEK . '" title="' . _MA_XPDF_INDEX_NEWTHISWEEK . '"/>'; } break; case 2: if ( is_readable( $img_path . 'updated.png') ){ - $new = ' <img src="' . $img_url . 'updated.png" alt="' . _MA_XPDF_INDEX_UPTHISWEEK . '" title="' . _MA_XPDF_INDEX_UPTHISWEEK . '"/>'; + $new = ' <img src="' . $img_url . 'updated.png" width="'.$img_shotwidth.'" alt="' . _MA_XPDF_INDEX_UPTHISWEEK . '" title="' . _MA_XPDF_INDEX_UPTHISWEEK . '"/>'; }else{ - $new = ' <img src="' . $en_path . '/updated.png" alt="' . _MA_XPDF_INDEX_UPTHISWEEK . '" title="' . _MA_XPDF_INDEX_UPTHISWEEK . '"/>'; + $new = ' <img src="' . $en_path . '/updated.png" width="'.$img_shotwidth.'" alt="' . _MA_XPDF_INDEX_UPTHISWEEK . '" title="' . _MA_XPDF_INDEX_UPTHISWEEK . '"/>'; } break; } @@ -158,10 +159,11 @@ } $img_path = XPDF_PATH . "/language/" . $language . "/"; $img_url = XPDF_URL . "/language/" . $language . "/"; + $img_shotwidth = $GLOBALS['xoopsModuleConfig']['shotwidth']; if ( is_readable( $img_path . 'popular.png') ){ - $pop = ' <img src="' . $img_url . 'popular.png" alt="' . _MA_XPDF_INDEX_POPULAR . '" title="' . _MA_XPDF_INDEX_POPULAR . '"/>'; + $pop = ' <img src="' . $img_url . 'popular.png" width="'.$img_shotwidth.'" alt="' . _MA_XPDF_INDEX_POPULAR . '" title="' . _MA_XPDF_INDEX_POPULAR . '"/>'; }else{ - $pop = ' <img src ="' . XPDF_URL . '/language/english/popular.png" alt="' . _MA_XPDF_INDEX_POPULAR . '" title="' . _MA_XPDF_INDEX_POPULAR . '"/>'; + $pop = ' <img src ="' . XPDF_URL . '/language/english/popular.png" width="'.$img_shotwidth.'" alt="' . _MA_XPDF_INDEX_POPULAR . '" title="' . _MA_XPDF_INDEX_POPULAR . '"/>'; } } return $pop; @@ -244,7 +246,7 @@ } foreach (array_keys($category_parent) as $j) { if ($link == true) { - $Path .= '<a href="viewcat.php?cid=' . $category_parent[$j]->getVar('cat_cid') . '">' . $category_parent[$j]->getVar($title) . '</a>' . $prefix; + $Path .= '<a href="viewcat.php?cid=' . $category_parent[$j]->getVar('cat_id') . '">' . $category_parent[$j]->getVar($title) . '</a>' . $prefix; }else{ $Path .= $category_parent[$j]->getVar($title) . $prefix; } @@ -252,7 +254,7 @@ if ($order == 'ASC'){ if (array_key_exists($key, $category_array)){ if ($lasturl == true){ - $first_category = '<a href="viewcat.php?cid=' . $category_array[$key]->getVar('cat_cid') . '">' . $category_array[$key]->getVar($title) . '</a>'; + $first_category = '<a href="viewcat.php?cid=' . $category_array[$key]->getVar('cat_id') . '">' . $category_array[$key]->getVar($title) . '</a>'; }else{ $first_category = $category_array[$key]->getVar($title); } Modified: XoopsModules/xpdf/trunk/modules/xpdf/index.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/index.php 2012-05-03 17:42:04 UTC (rev 9433) +++ XoopsModules/xpdf/trunk/modules/xpdf/index.php 2012-05-04 17:09:44 UTC (rev 9434) @@ -69,13 +69,13 @@ //For keywords //$keywords .= $catArray[$i]->getVar('cat_title') . ','; foreach (array_keys($subcats_arr) as $j) { - if ($chcount >= $GLOBALS['xoopsModuleConfig']['nb_subscat']){ + if ($chcount >= $GLOBALS['xoopsModuleConfig']['nb_subcat']){ $subcats .= '<li>[<a href="'. XPDF_URL .'/viewcat.php?cid=' . $catArray[$i]->getVar('cat_id') . '">+</a>]</li>'; break; } - $subcategories .= '<li><a href="'. XPDF_URL .'/viewcat.php?cid=' . $subcats_arr[$j]->getVar('cat_id') . '">' . $subcats_arr[$j]->getVar('cat_title') . '</a></li>'; - $keywords .= $catArray[$i]->getVar('cat_title') . ','; - + $subcattitle = $subcats_arr[$j]->getVar('cat_title'); + $subcategories .= '<li><a href="'. XPDF_URL .'/viewcat.php?cid=' . $subcats_arr[$j]->getVar('cat_id') . '" title="' . $subcattitle . '">' . $subcattitle . '</a></li>'; + $keywords .= $catArray[$i]->getVar('cat_title') . ','; $chcount++; } $image = XPDF_UPLOAD_CAT_URL ."/". $catArray[$i]->getVar('cat_image'); Modified: XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php 2012-05-03 17:42:04 UTC (rev 9433) +++ XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php 2012-05-04 17:09:44 UTC (rev 9434) @@ -47,8 +47,10 @@ define("_AM_XPDF_FORMACTION","Action"); define("_AM_XPDF_OFFLINE","Offline"); define("_AM_XPDF_ONLINE","Online"); -define("_AM_XPDF_CREATEPDF","Create PDF"); -define("_AM_XPDF_DELETEPDF","Delete PDF"); +define("_AM_XPDF_CREATEPDF","Create PDF File"); +define("_AM_XPDF_PDFFILECREATED","PDF File Created Succesfully"); +define("_AM_XPDF_DELETEPDF","Delete PDF File"); +define("_AM_XPDF_PDFFILEDELETED","PDF File Deleted Succesfully"); define("_AM_XPDF_CAT_ADD","Add a Category"); define("_AM_XPDF_CAT_EDIT","Edit Category"); Modified: XoopsModules/xpdf/trunk/modules/xpdf/language/english/main.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/language/english/main.php 2012-05-03 17:42:04 UTC (rev 9433) +++ XoopsModules/xpdf/trunk/modules/xpdf/language/english/main.php 2012-05-04 17:09:44 UTC (rev 9434) @@ -31,7 +31,6 @@ define("_MA_XPDF_CAT","Category"); define("_MA_XPDF_DOC","Document"); define("_MA_XPDF_RSS","Subscribe to this feed"); - // index.php define("_MA_XPDF_NODOC", "No documents in our database"); define("_MA_XPDF_INDEX_LATESTLIST", "Last on the list"); @@ -43,12 +42,11 @@ define("_MA_XPDF_INDEX_POPULAR","Popular"); define("_MA_XPDF_INDEX_NEWTHISWEEK","New this week"); define("_MA_XPDF_INDEX_UPTHISWEEK","Last this week"); - +define("_MA_XPDF_INDEX_SCAT","Subcategories"); // Item define("_MA_XPDF_MOREDETAILS","More details"); define("_MA_XPDF_INDEX_SUBMITTER","Submitter"); define("_MA_XPDF_INDEX_SUBMITDATE","Submit date"); - // viewcat.php: define("_MA_XPDF_CAT_CURSORTBY","Files currently sorted by : %s"); define("_MA_XPDF_CAT_LIST","Listed in this category"); Modified: XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_index.html =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_index.html 2012-05-03 17:42:04 UTC (rev 9433) +++ XoopsModules/xpdf/trunk/modules/xpdf/templates/xpdf_index.html 2012-05-04 17:09:44 UTC (rev 9434) @@ -21,7 +21,7 @@ <div class="clear"></div> </div> <{if $category.subcategories != ""}> - <div class="xpdf-subtitle"><{$smarty.const._MA_XPDF_INDEX_SCAT}><ul><{$category.subcategories}></ul></div> + <div class="xpdf-subCat"><{$smarty.const._MA_XPDF_INDEX_SCAT}><ul><{$category.subcategories}></ul></div> <{/if}> </div> </td> Modified: XoopsModules/xpdf/trunk/modules/xpdf/viewdoc.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/viewdoc.php 2012-05-03 17:42:04 UTC (rev 9433) +++ XoopsModules/xpdf/trunk/modules/xpdf/viewdoc.php 2012-05-04 17:09:44 UTC (rev 9434) @@ -32,9 +32,27 @@ xoops_loadLanguage('main', XPDF_DIRNAME); // Verifications on the document $did = xpdf_CleanVars( $_REQUEST, 'did', 0, 'int' ); - $view_pdf = $docHandler->get($did); $doc_id = $view_pdf->getVar('doc_id'); +$url = ''; +$sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix( "xpdf_doc" ).' SET doc_hits=doc_hits+1 WHERE doc_id='.$doc_id; +$result = $GLOBALS['xoopsDB'] -> queryF( $sql ); + +list( $url ) = $GLOBALS['xoopsDB']->fetchRow( $result ); +$url = htmlSpecialChars( preg_replace( '/javascript:/si' , 'java script:', $url ), ENT_QUOTES ); + +if ( !empty( $url ) ) +{ + header( "Cache-Control: no-store, no-cache, must-revalidate" ); + header( "Cache-Control: post-check=0, pre-check=0", false ); + // HTTP/1.0 + header( "Pragma: no-cache" ); + // Date in the past + header( "Expires: Mon, 26 Jul 2097 05:00:00 GMT" ); + // always modified + header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . " GMT" ); + header( "Refresh: 0; url=$url" ); +} echo $view_pdf->getPdf(); ?> \ No newline at end of file Modified: XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php 2012-05-03 17:42:04 UTC (rev 9433) +++ XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php 2012-05-04 17:09:44 UTC (rev 9434) @@ -233,7 +233,7 @@ $modversion['config'][$i]['description'] = "_MI_XPDF_SHOTWIDTH_DESC"; $modversion['config'][$i]['formtype'] = "textbox"; $modversion['config'][$i]['valuetype'] = "int"; -$modversion['config'][$i]['default'] = 128; +$modversion['config'][$i]['default'] = 100; $i++; $modversion['config'][$i]['name'] = "img_float"; $modversion['config'][$i]['title'] = "_MI_XPDF_IMGFLOAT"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <txm...@us...> - 2012-05-06 09:57:33
|
Revision: 9440 http://xoops.svn.sourceforge.net/xoops/?rev=9440&view=rev Author: txmodxoops Date: 2012-05-06 09:57:26 +0000 (Sun, 06 May 2012) Log Message: ----------- Added managed errors when we send equal categories or documents Pleace! reinstall again! Modified Paths: -------------- XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php XoopsModules/xpdf/trunk/modules/xpdf/sql/mysql.sql XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php 2012-05-06 09:12:55 UTC (rev 9439) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/categories.php 2012-05-06 09:57:26 UTC (rev 9440) @@ -151,7 +151,10 @@ redirect_header("categories.php?op=list", 2, _AM_XPDF_FORMOK); } - echo $obj->getHtmlErrors(); + if (!$catHandler->insert($obj)) { + $errors = $obj->getHtmlErrors(); + redirect_header("categories.php?op=list", 5, $errors.'<br />'._AM_XPDF_ERRORS); + } $form =& $obj->getForm(); echo $form->display(); break; Modified: XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php 2012-05-06 09:12:55 UTC (rev 9439) +++ XoopsModules/xpdf/trunk/modules/xpdf/admin/documents.php 2012-05-06 09:57:26 UTC (rev 9440) @@ -219,11 +219,15 @@ $verif_doc_online = ($_REQUEST["doc_online"] == 1) ? "1" : "0"; $obj->setVar("doc_online", $verif_doc_online); - if ($docHandler->insert($obj)) { + if ($docHandler->insert($obj)) { redirect_header("documents.php?op=list", 2, _AM_XPDF_FORMOK); } - echo $obj->getHtmlErrors(); + if (!$docHandler->insert($obj)) { + $errors = $obj->getHtmlErrors(); + redirect_header("documents.php?op=list", 5, $errors.'<br />'._AM_XPDF_ERRORS); + } + $form =& $obj->getForm(); echo $form->display(); break; Modified: XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php 2012-05-06 09:12:55 UTC (rev 9439) +++ XoopsModules/xpdf/trunk/modules/xpdf/class/xpdf_doc.php 2012-05-06 09:57:26 UTC (rev 9440) @@ -54,7 +54,7 @@ $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_dosmilies", 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); @@ -75,7 +75,6 @@ /** * gets list of font file names in a directory - * @author TXMod Xoops <in...@tx...> */ function getFontListAsArray($dirname, $prefix = '') { Modified: XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php 2012-05-06 09:12:55 UTC (rev 9439) +++ XoopsModules/xpdf/trunk/modules/xpdf/language/english/admin.php 2012-05-06 09:57:26 UTC (rev 9440) @@ -28,9 +28,9 @@ //Index define("_AM_XPDF_STATISTICS","Statistics xPdf"); -define("_AM_XPDF_THEREARE_CAT","There are <span class='bold'>%s</span> Categories in the Database"); -define("_AM_XPDF_THEREARE_DOC","There are <span class='bold'>%s</span> Documents in the Database"); -define("_AM_XPDF_THEREARE_DOC_ONLINE","There are <span class='bold'>%s</span> Documents online"); +define("_AM_XPDF_THEREARE_CAT","- <span class='bold'>%s</span>: Total Categories"); +define("_AM_XPDF_THEREARE_DOC","- <span class='bold'>%s</span>: Total Documents"); +define("_AM_XPDF_THEREARE_DOC_ONLINE","- <span class='bold'>%s</span>: Total Documents Online"); //Buttons define("_AM_XPDF_NEWCAT","Add New Category"); define("_AM_XPDF_CATLIST","List Categories"); @@ -51,6 +51,8 @@ define("_AM_XPDF_PDFFILECREATED","PDF File Created Succesfully"); define("_AM_XPDF_DELETEPDF","Delete PDF File"); define("_AM_XPDF_PDFFILEDELETED","PDF File Deleted Succesfully"); +// Errors +define("_AM_XPDF_ERRORS","You entered a name that exists in this field, you must define a different."); define("_AM_XPDF_CAT_ADD","Add a Category"); define("_AM_XPDF_CAT_EDIT","Edit Category"); Modified: XoopsModules/xpdf/trunk/modules/xpdf/sql/mysql.sql =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/sql/mysql.sql 2012-05-06 09:12:55 UTC (rev 9439) +++ XoopsModules/xpdf/trunk/modules/xpdf/sql/mysql.sql 2012-05-06 09:57:26 UTC (rev 9440) @@ -6,12 +6,13 @@ CREATE TABLE `xpdf_cat` ( `cat_id` int (8) unsigned NOT NULL auto_increment, `cat_pid` int (5) unsigned NOT NULL default '0', -`cat_title` varchar (255) NOT NULL default '', -`cat_image` varchar (100) NOT NULL default 'blank.gif', -`cat_description` text NOT NULL , +`cat_title` varchar (255) NOT NULL default '', +`cat_image` varchar (100) NOT NULL default 'blank.gif', +`cat_description` tinytext NOT NULL, `cat_weight` int (11) unsigned NOT NULL default '0', PRIMARY KEY (`cat_id`), -KEY `cat_pid` (`cat_pid`) +KEY `cat_pid` (`cat_pid`), +KEY `cat_title` (`cat_title(40)`) ) ENGINE=MyISAM; # # Table structure for table `xpdf_doc` 23 @@ -20,15 +21,15 @@ CREATE TABLE `xpdf_doc` ( `doc_id` int (8) unsigned NOT NULL auto_increment, `doc_cid` int (5) unsigned NOT NULL default '0', -`doc_filename` varchar (50) NOT NULL default ' ', -`doc_title` varchar (255) NOT NULL default ' ', -`doc_slogan` text NOT NULL , -`doc_pdftext` text NOT NULL , +`doc_filename` varchar (50) NOT NULL default '', +`doc_title` varchar (255) NOT NULL default '', +`doc_slogan` text NOT NULL, +`doc_pdftext` text NOT NULL, `doc_image` varchar (100) NOT NULL default 'blank.gif', -`doc_subject` varchar (100) NOT NULL default ' ', -`doc_fontname` varchar (50) NOT NULL default ' ', +`doc_subject` varchar (100) NOT NULL default '', +`doc_fontname` varchar (50) NOT NULL default '', `doc_fontsize` int (5) unsigned NOT NULL default '0', -`doc_keywords` varchar (255) NOT NULL default ' ', +`doc_keywords` varchar (255) NOT NULL default '', `doc_submitter` int (10) unsigned NOT NULL default '0', `doc_published` int (10) unsigned NOT NULL default '0', `doc_hits` int(11) unsigned NOT NULL default '0', @@ -36,10 +37,13 @@ `doc_status` tinyint (1) unsigned NOT NULL default '0', `doc_online` tinyint (1) unsigned NOT NULL default '0', `doc_dohtml` tinyint (1) unsigned NOT NULL default '0', -`doc_smilies` tinyint (1) unsigned NOT NULL default '0', +`doc_dosmilies` tinyint (1) unsigned NOT NULL default '0', `doc_doxcodes` tinyint (1) unsigned NOT NULL default '0', `doc_doimages` tinyint (1) unsigned NOT NULL default '0', `doc_dobreak` tinyint (1) unsigned NOT NULL default '0', PRIMARY KEY (`doc_id`), -KEY `doc_cid` (`doc_cid`) +KEY `doc_cid` (`doc_cid`), +KEY `doc_filename` (`doc_filename(40)`), +KEY `doc_title` (`doc_title(40)`), +KEY `doc_keywords` (`doc_keywords`) ) ENGINE=MyISAM; \ No newline at end of file Modified: XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php =================================================================== --- XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php 2012-05-06 09:12:55 UTC (rev 9439) +++ XoopsModules/xpdf/trunk/modules/xpdf/xoops_version.php 2012-05-06 09:57:26 UTC (rev 9440) @@ -243,18 +243,21 @@ $modversion['config'][$i]['default'] = "left"; $modversion['config'][$i]['options'] = array(_MI_XPDF_IMGFLOAT_LEFT => 'left', _MI_XPDF_IMGFLOAT_RIGHT => 'right'); $i++; +include_once(XOOPS_ROOT_PATH.'/modules/xpdf/class/xpdf_doc.php'); $modversion['config'][$i]['name'] = "fontname"; $modversion['config'][$i]['title'] = "_MI_XPDF_FONTNAME"; $modversion['config'][$i]['description'] = "_MI_XPDF_FONTNAME_DESC"; -$modversion['config'][$i]['formtype'] = "textbox"; +$modversion['config'][$i]['formtype'] = "select"; $modversion['config'][$i]['valuetype'] = "text"; +$modversion['config'][$i]['options'] = xpdf_doc::getFontList(); $modversion['config'][$i]['default'] = 'helvetica'; $i++; $modversion['config'][$i]['name'] = "fontsize"; $modversion['config'][$i]['title'] = "_MI_XPDF_FONTSIZE"; $modversion['config'][$i]['description'] = "_MI_XPDF_FONTSIZE_DESC"; -$modversion['config'][$i]['formtype'] = "textbox"; -$modversion['config'][$i]['valuetype'] = "text"; +$modversion['config'][$i]['formtype'] = "select"; +$modversion['config'][$i]['valuetype'] = "int"; +$modversion['config'][$i]['options'] = xpdf_doc::getFontSize(); $modversion['config'][$i]['default'] = '10'; $i++; $modversion['config'][$i]['name'] = "advertise"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |