PDA

Zobacz pełną wersję : JDownloads Tree - gdzie w tym kodzie wstawić klasę CSS ??



Radek2212
13-03-2011, 18:40
Witajcie.

Autor odpisał mi, że aby zmienić wygląd tego modułu trzeba w poniższym kodzie wpisać nazwę swojej klasy. Pytanie tylko gdzie ?

Oto kod:

<?php
/**
* @version $Id: mod_jDMTree1.5.5
* @package DOCMan jDMTree Module for Joomla 1.5
* @copyright Copyright (C) 2008-2010 youthpole.com. All rights reserved.
* @author Josh Prakash
* @license GNU/GPL, see LICENSE.php
* This module is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* * Revisions
* Nov-01-2008 - Security implementation compatible to docman component
* May-13-2009 - SEO url compatability/icons invisible, fixes - jdmtree 1.5.2
* Jul-21-2009 - Category exclusion/inclusion by id options enhancement -jdmtree1.5.3
* Nov-03-2009 - Docman groups (user defined) handling upgrade - jdmtree 1.5.4
* Feb-26-2010 - Two additional parameter options - 1. Show/Hide View Category Link 2. Folder Link behavior selection - jdmtree 1.5.5
*
* Dec-20-2010 Adapted and modified for jDownloads by Arno Betz
* Version 1.0
*
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

require_once(JPATH_SITE.DS.'modules'.DS.'mod_jdown loads_tree' .DS.'jDtree'.DS.'jdownloadstree.php');

$lang = &JFactory::getLanguage();
$lang->load('com_jdownloads');

$user = & JFactory::getUser();
$db =& JFactory::getDBO();
$menu = &JSite::getMenu();
$acl = &JFactory::getACL();

$items = $menu->getItems('link', 'index.php?option=com_jdownloads&view=viewcategories');
$itemid ='';
if(isset($items[0])){
$itemid = $items[0]->id;
}
$home_url = JRoute::_('index.php?option=com_jdownloads&amp;view=vi ewcategories&amp;Itemid='.$itemid);
$home_link = '<a href="'.$home_url.'">'.JText::_('JLIST_FRONTEND_HOME_LINKTEXT').'</a>';

$lengthc = intval( $params->get( 'lengthc', 20 ) ); // Max length of category before truncation
$baseGif = "modules/mod_jdownloads_tree/jDtree/images/base.gif";
$nodeId = 0;
$counter = 0;
$catlink = "";
$curcat = 0;
$precat = -1;

// Category display decisions
$catid = trim( $params->get('catid') );
$catoption = intval( $params->get('catoption', 1 ) );

if ($catid) {
$catCondition = ' cat_id '.($catoption ? ' in ':' not in ') .' (' . $catid . ') AND ';
}

$access = '';
if ($user->aid == 0) $access = '01';
if ($user->aid == 1) $access = '11';
if ($user->aid == 2) $access = '22';
if ($user->usertype == 'Super Administrator' || $user->usertype == 'Administrator'){
$access = '99';
}

$groups_exists = false;
$prefix = $db->_table_prefix;
$tables = array( $prefix.'jdownloads_cats' );
$result = $db->getTableFields( $tables );
if ($result[$prefix.'jdownloads_cats']['cat_group_access']) $groups_exists = true;

// get cat access groups
if ($user->id){
$db->setQuery("SELECT id FROM #__jdownloads_groups WHERE FIND_IN_SET($user->id, groups_members)");
$in_groups = implode(',', $db->loadResultArray());
}
if (!$in_groups) $in_groups = 999999;


// Query to retrieve all categories that are published.
if ($groups_exists){
$queryc = "SELECT * FROM #__jdownloads_cats WHERE ".($catid ? $catCondition : '')." published = 1 AND (cat_access <= '$access' OR cat_group_access IN ($in_groups)) ORDER BY parent_id, ordering";
} else {
$queryc = "SELECT * FROM #__jdownloads_cats WHERE ".($catid ? $catCondition : '')." published = 1 AND cat_access <= '$access' ORDER BY parent_id, ordering";
}

$db->setQuery($queryc);
$rows = $db->loadObjectList();

$tree = new jdownloadstree(); // Creating new tree object

foreach ( $rows as $row ) { // let's append categories & sub categories to the tree
if(strlen($row->cat_title) > $lengthc){
$row->cat_title = substr($row->cat_title,0,($lengthc - 3));
$row->cat_title .= "...";
}

$catlink = JRoute::_('index.php?option=com_jdownloads&amp;view=vi ewcategory&amp;catid='. $row->cat_id .'&amp;Itemid='. $itemid.'');
$tree->addToArray($row->cat_id,$row->cat_title,$row->parent_id,$catlink,"");

if($row->cat_id > $nodeId){$nodeId=$row->cat_id;} // get max id
}
$nodeId++;

// draw the tree
$tree->writeJavascript();
$tree->drawTree($home_link);
$tree->applyStyle();
?>

Ktoś się orientuje ?

a_m
13-03-2011, 19:07
a o przyrostkach klas css modułów coś słyszałem?

Radek2212
13-03-2011, 20:39
No tak, elementarna wiedza z zakresu html/css potrzebna ale niestety jej nie posiadam. Próbuje po omacku dostosować wygląd tego modułu do mojej strony i jedyne co wiem, to to że gdzieś mam wstawić "-emulate-ul" albo coś takiego:

<style type="text/css">
/*
(c) jDMTree 1.5.5 for Joomla 1.5 - Docman Tree Module, Josh Prakash, http://www.youthpole.com - 2010
*/
.j7dctree li {
list-style-type:none;
background:none;
font-family: arial;
font-size:12px;
}

.j7dctree img {
padding-top:-1px;
vertical-align: middle;
}

.j7dctree div ul li a {
text-decoration:none;
}

.j7dctree {
margin-left:0px;
padding-left:0px;
}

.j7dctree ul {
margin-left:3px;
padding-left:0px;
display:none;
}

.j7dctree_link {
line-height:13px;
padding-left:1px;
}

.j7dctree_node{
text-decoration:none;
}

.jdmroothov {
text-decoration:none;
}
</style>

Niestety nie wiem gdzie co i jak :ASD

a_m
13-03-2011, 20:55
o przyrostkach klas modułów masz np. tutaj (http://wiki.joomla.pl/index.php/Stosowanie_przyrostk%C3%B3w_klas_w_Joomla%21_1.5) ( i o innych przyrostkach klas ); a tak na marginesie, to jak chcesz zmodyfikować wygląd modułu za pomocą css bez elementarnej wiedzy o css?
jak masz - podaj link do strony; jak nie masz - do szablonu, może ktoś życzliwy napisze jak wytrącić moduł z formatowania przez szablon

Radek2212
13-03-2011, 21:47
Dotychczas modyfikowałem wygląd modułów wpisując w jego opcjach to co mi kazał znajomy i działało ale teraz nie mam tego pola w opcjach modułu. No nic, trzeba będzie jeszcze raz poprosić o pomoc. Dzięki za pomoc.