|
From: <lor...@us...> - 2012-07-08 19:12:03
|
Revision: 9806
http://xoops.svn.sourceforge.net/xoops/?rev=9806&view=rev
Author: lord_venom
Date: 2012-07-08 19:11:57 +0000 (Sun, 08 Jul 2012)
Log Message:
-----------
test news categorie
Modified Paths:
--------------
XoopsModules/TDMPicture/trunk/TDMPicture/class/tree.php
XoopsModules/TDMPicture/trunk/TDMPicture/css/tdmpicture.css
XoopsModules/TDMPicture/trunk/TDMPicture/index.php
XoopsModules/TDMPicture/trunk/TDMPicture/viewcat.php
Added Paths:
-----------
XoopsModules/TDMPicture/trunk/TDMPicture/images/decos/downloads-bg.gif
Modified: XoopsModules/TDMPicture/trunk/TDMPicture/class/tree.php
===================================================================
--- XoopsModules/TDMPicture/trunk/TDMPicture/class/tree.php 2012-07-08 16:16:56 UTC (rev 9805)
+++ XoopsModules/TDMPicture/trunk/TDMPicture/class/tree.php 2012-07-08 19:11:57 UTC (rev 9806)
@@ -50,13 +50,14 @@
return $ret;
}
- function _makeCatBoxOptions( $item_handler, $fieldName, $selected, $key, &$ret, &$ret2, $prefix_orig, $prefix_curr = '', $chcount) {
+ function _makeCatBoxOptions( $item_handler, $fieldName, $selected, $key, &$ret, &$select, $prefix_orig, $prefix_curr = '', $chcount) {
Global $xoopsModule, $xoopsModuleConfig, $cat_display, $cat_cel, $groups, $start, $limit, $tris ;
$gperm_handler =& xoops_gethandler('groupperm');
$parent = "";
$GLOBALS['navbar'] .= "";
+
if ( $key > 0 && $gperm_handler->checkRight('tdmpicture_catview', $this->_tree[$key]['obj']->getVar('cat_id'), $groups, $xoopsModule->getVar('mid'))) {
$value = $this->_tree[$key]['obj']->getVar( $this->_myId );
@@ -89,73 +90,30 @@
<ul>'.$picture. '<a href ="'.$cat_link.'" title="'. $this->_tree[$key]['obj']->getVar('cat_title').'">' . $this->_tree[$key]['obj']->getVar( $fieldName ). '</a> ('.$count.')
<br style="clear: both;" /></ul></th></tr></table>';
- }
+ }
- if ($cat_display == "sub" || $cat_display == "subimg") {
- $cat_sub = true;
- } else {
- $cat_sub = false;
- }
-
- if ((!$prefix_curr && $cat_sub) || (!$cat_sub && $this->_tree[$key]['obj']->getVar('cat_pid') == $selected)) {
-
- $GLOBALS['souscat'] = true;
-
- switch ($cat_display) {
+ if ((!$prefix_curr) || ($this->_tree[$key]['obj']->getVar('cat_pid') == $selected)) {
-
- case "text":
- $ret .= '<td><ul><a href ="'.$cat_link.'" title="'. $this->_tree[$key]['obj']->getVar('cat_title').'">' . $this->_tree[$key]['obj']->getVar( $fieldName ). '</a> ('.$count.')';
- break;
+ $select = $this->makeSelBox('cat_pid', 'cat_title','-', 0, '-- '._MD_TDMPICTURE_CAT, $this->_tree[$key]['obj']->getVar('cat_id'), "OnChange='window.document.location=this.options[this.selectedIndex].value;'", 'tdmpicture_catview');
+ $ret .= '<li class="'.$GLOBALS['class'].'"><div>'.$picture. '<br/><span id="num"> ('.$count.')</span></div><div><h2><a href ="'.$cat_link.'" title="'. $this->_tree[$key]['obj']->getVar('cat_title').'">'. $this->_tree[$key]['obj']->getVar( $fieldName ). '</h2></a><pan id="text">'. $this->_tree[$key]['obj']->getVar('cat_text'). '</span></div><div id="form">'.$select.'</div></li>';
- case "textimg":
- $ret .= '<td><ul>'.$picture. '<br /><a href ="'.$cat_link.'" title="'. $this->_tree[$key]['obj']->getVar('cat_title').'">' . $this->_tree[$key]['obj']->getVar( $fieldName ). '</a> ('.$count.')';
- break;
-
- case "sub":
- $ret .= '<td><ul>  <a href ="'.$cat_link.'" title="'. $this->_tree[$key]['obj']->getVar('cat_title').'">'. $this->_tree[$key]['obj']->getVar( $fieldName ). '</a> ('.$count.')';
- break;
-
- case "subimg":
- $ret .= '<td><ul>'.$picture. '<a href ="'.$cat_link.'" title="'. $this->_tree[$key]['obj']->getVar('cat_title').'">' .$this->_tree[$key]['obj']->getVar( $fieldName ). '</a> ('.$count.')';
- break;
-
- case "img":
- $ret .= '<td><ul style="text-align:center;">'.$picture;
- break;
-
- }
-
- } else {
- if ($cat_sub) {
- $ret .= '<li> ('.$count.') ' . $prefix_curr . ' <a href ="'.$cat_link.'" title="'. $this->_tree[$key]['obj']->getVar('cat_title').'"> '.$this->_tree[$key]['obj']->getVar( $fieldName ). '</a></li>';
}
- }
//}
$prefix_curr .= $prefix_orig;
-
+
//}
}
if ( isset( $this->_tree[$key]['child'] ) && !empty( $this->_tree[$key]['child'] ) ) {
foreach ( $this->_tree[$key]['child'] as $childkey ) {
- $this->_makeCatBoxOptions( $item_handler, $fieldName, $selected, $childkey, $ret, $ret2, $prefix_orig, $prefix_curr , $chcount);
- if (!$prefix_curr) {
- $ret .= '<br style="clear:both;" /></ul></td>';
-
- if($chcount == $cat_cel) {
- $ret .= '</tr><tr>';
- $chcount = 1;
- } else {
- $chcount++;
- }
-
- }
- }
+ $GLOBALS['class'] = ($GLOBALS['class'] == "even") ? "odd" : "even";
+ $this->_makeCatBoxOptions( $item_handler, $fieldName, $selected, $childkey, $ret, $select, $prefix_orig, $prefix_curr , $chcount);
+
+ }
}
}
@@ -192,26 +150,16 @@
//makeCatBox($item_handler,name cat, )
function makeCatBox( $item_handler, $fieldName, $prefix = '-', $selected = '', $key = 0 ) {
Global $cat_display;
- if ($cat_display != "none") {
-
- $GLOBALS['souscat']=false;
- $GLOBALS['navbar'] = false;
-
- $ret1 = '<div style="text-align:right"><a href="javascript:;" onclick="javascript:masque(\'1\')" >+-</a></div>';
- $ret = '<table cellpadding="0" id="masque_1" class="outer tdmcat_'.$cat_display.'" cellspacing="0"><tr>';
+
+ $ret = '<div style="text-align:right"><a href="javascript:;" onclick="javascript:masque(\'1\')" >+-</a></div>';
+ $ret .= '<table cellpadding="0" id="masque_1" cellspacing="0"><tr><td><ul id="menu">';
$chcount = 1;
- $this->_makeCatBoxOptions( $item_handler, $fieldName, $selected, $key, $ret, $ret2, $prefix, '', $chcount );
- $ret .= '</tr></table><br />';
+ $GLOBALS['class'] = "odd";
+ $this->_makeCatBoxOptions( $item_handler, $fieldName, $selected, $key, $ret, $select, $prefix, '', $chcount );
+ $ret .= '<br style="clear: both;" /></ul></td></tr></table><br />';
- if (empty($GLOBALS['souscat'])) {
- $ret1 = false;
- $ret = false;
- }
+ return $ret;
-
- return $ret1 . $ret . $ret2;
- }
-
}
function makeSelBox( $name, $fieldName, $prefix = '-', $selected = '', $addEmptyOption = false, $key = 0, $extra = '', $perm = false ) {
Modified: XoopsModules/TDMPicture/trunk/TDMPicture/css/tdmpicture.css
===================================================================
--- XoopsModules/TDMPicture/trunk/TDMPicture/css/tdmpicture.css 2012-07-08 16:16:56 UTC (rev 9805)
+++ XoopsModules/TDMPicture/trunk/TDMPicture/css/tdmpicture.css 2012-07-08 19:11:57 UTC (rev 9806)
@@ -15,8 +15,70 @@
*
* ****************************************************************************
*/
+
+ ul#menu {
+ margin: 0;
+ padding-left: 1%;
+ padding-right:1%;
+ text-align: center;
+
+ }
+ ul#menu li {
+ list-style: none;
+ float:left;
+ width:47%;
+ height: 130px;
+ margin: 10px; padding: 0px;
+ -webkit-border-radius: 4px;
+ border-radius: 4px;
+ border: 2px solid white;
+ /* background: whiteSmoke url(../images/decos/downloads-bg.gif) repeat-x left top; */
+ -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
+ }
+ ul#menu img {
+ float:left;
+ padding-left:20px;
+ padding-right:20px;
+ padding-top:10px;
+ }
+
+ ul#menu h2{
+ left:0;
+ text-align:left;
+padding-top:10px;
+padding-bottom:5px;
+ }
+
+ ul#menu div{
+ float:left;
+ }
+ ul#menu #text {
+ font-size: 13px;
+color: #728DA9;
+text-shadow: 0 1px 0 white;
+line-height: 20px;
+}
+
+ ul#menu #num{
+ text-align: center;
+font-size: 11px;
+color: #25587C;
+text-shadow: 0 1px 0 white;
+ }
+
+ ul#menu #form{
+ float:right;
+ padding-top:100px;
+ padding-right:20px;
+ text-align: center;
+font-size: 11px;
+color: #25587C;
+text-shadow: 0 1px 0 white;
+
+ }
+
/* + -----------------------------------------------------
AFFICHAGE UNIQUE CATEGORIE
+ ----------------------------------------------------- */
Added: XoopsModules/TDMPicture/trunk/TDMPicture/images/decos/downloads-bg.gif
===================================================================
(Binary files differ)
Property changes on: XoopsModules/TDMPicture/trunk/TDMPicture/images/decos/downloads-bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: XoopsModules/TDMPicture/trunk/TDMPicture/index.php
===================================================================
--- XoopsModules/TDMPicture/trunk/TDMPicture/index.php 2012-07-08 16:16:56 UTC (rev 9805)
+++ XoopsModules/TDMPicture/trunk/TDMPicture/index.php 2012-07-08 19:11:57 UTC (rev 9806)
@@ -49,12 +49,14 @@
$xoopsTpl->assign('baseurl', $_SERVER['PHP_SELF']);
$xoopsTpl->assign('display', $xoopsModuleConfig['tdmpicture_display'] );
- switch($op) {
+ switch($op) {
+
+
case "list":
default:
-
-$xoopsTpl->assign('cat_id', true);
+
+ $xoopsTpl->assign('cat_id', true);
$xoopsTpl->assign('cat_view', true);
$xoopsTpl->assign('nav', "<a href='".XOOPS_URL. "/modules/".$xoopsModule->dirname()."'/>".$xoopsModule->name()."</a>");
// ************************************************************
@@ -81,7 +83,6 @@
$numcat = $cat_handler->getCount($criteria);
$xoopsTpl->assign('numcat', $numcat);
-
unset($criteria);
$xoopsTpl->assign('selectcat', tdmpicture_catselect($mytree, false));
Modified: XoopsModules/TDMPicture/trunk/TDMPicture/viewcat.php
===================================================================
--- XoopsModules/TDMPicture/trunk/TDMPicture/viewcat.php 2012-07-08 16:16:56 UTC (rev 9805)
+++ XoopsModules/TDMPicture/trunk/TDMPicture/viewcat.php 2012-07-08 19:11:57 UTC (rev 9806)
@@ -41,6 +41,8 @@
$ct = isset($_REQUEST['ct']) ? $_REQUEST['ct'] : false;
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
$tris = isset($_REQUEST['tris']) ? $_REQUEST['tris'] : 'file_indate';
+
+
//
//mode de visualisation
//$xoopsTpl->assign('view_mode', $view_mode = isset($_REQUEST['view_mode']) ? $_REQUEST['view_mode'] : 'block' );
@@ -61,6 +63,12 @@
redirect_header('index.php', 2, _MD_TDMPICTURE_NOPERM);
exit();
}
+ //perm
+ if (!$gperm_handler->checkRight('tdmpicture_catview', $ct, $groups, $xoopsModule->getVar('mid'))) {
+ redirect_header('index.php', 2, _NOPERM);
+ exit();
+ }
+
//return la categorie
$cat = $cat_handler->get($ct);
@@ -101,12 +109,9 @@
$meta_title = $meta_keywords = $meta_description = $GLOBALS['cat_title'];
$xoopsTpl->assign('nav_bar', $GLOBALS['navbar']);
-
-
-
// ************************************************************
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|