Modul :: NavigationUniversell
du kannst die oberste ebene ohne weiteres weglassen. was kriegst du denn für eine fehlermeldung? respektive poste doch mal den modulcode. dann schaue ich mir das an.
aitsu.org :: schnell - flexibel - komfortabel :: Version 2.2.0 (since June 22, 2011) (jetzt mit dual license GPL/kommerziell)
Die Fehlermeldung ist:kummer hat geschrieben:du kannst die oberste ebene ohne weiteres weglassen. was kriegst du denn für eine fehlermeldung? respektive poste doch mal den modulcode. dann schaue ich mir das an.
Code: Alles auswählen
Fatal error: Call to a member function on a non-object in /kunden/102103_49214/rp-hosting/11037/5163/cms/front_content.php(1029) : eval()'d code on line 95
Code: Alles auswählen
<?php
$aQnavigation->between(2, '');
$aQnavigation->maskNormal(2, '<div><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->maskSelected(2, '<div><a target="_self" href="{link}">›{name1}</a></div>');
$aQnavigation->maskNormalSub(2, '<div><a target="_self" href="{link}">{name1}</a>{sub}</div>');
$aQnavigation->maskSelectedSub(2, '<div><a target="_self" href="{link}">›{name1}</a>{sub}</div>');
$aQnavigation->between(1, '');
$aQnavigation->maskNormal(1, '<div><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->maskNormalSub(1, '<div><a target="_self" href="{link}">{name1}</a></div>{sub}');
$aQnavigation->maskSelected(1, '<div><a target="_self" href="{link}">›{name1}</a></div>');
$aQnavigation->maskSelectedSub(1, '<div><a target="_self" href="{link}">›{name1}</a></div>{sub}');
$aQnavigation->setSub(1, $aQnavigation->showNavigation(2));
echo $aQnavigation->showNavigation(1);
?>
und hier möchtest du die erste ebene weglassen? oder ist das schon von dir bearbeitet? falls das die bearbeitete version ist, dann publiziere doch das funktionsfähige modul mal.
aitsu.org :: schnell - flexibel - komfortabel :: Version 2.2.0 (since June 22, 2011) (jetzt mit dual license GPL/kommerziell)
Habe die Version aus diesem Post. Die Erste Ebene die funkt ist:kummer hat geschrieben:und hier möchtest du die erste ebene weglassen? oder ist das schon von dir bearbeitet? falls das die bearbeitete version ist, dann publiziere doch das funktionsfähige modul mal.
Code: Alles auswählen
<?php
cInclude('classes', 'navi.class.php');
$cApiClient = new cApiClient($client);
$aQnavigation = new aQnavigation($cApiClient->getProperty('navigation', 'idcat_servicenavigation'));
$aQnavigation->between(0, '');
$aQnavigation->maskNormal(0, '<div><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->maskNormalSub(0, '<div><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->maskSelected(0, '<div><a target="_self" href="{link}">›{name1}</a></div>');
$aQnavigation->maskSelectedSub(0, '<div><a target="_self" href="{link}">›{name1}</a></div>');
echo $aQnavigation->showNavigation(0);
?>
Die 'navi.class.php' sieht so aus:
Code: Alles auswählen
<?php
/**
* class Contenido_Navigation
*
* Class for the dynamic Contenido
* backend navigation.
*
* @author Jan Lengowski <Jan.Lengowski@4fb.de>
* @copyright four for business AG <http://www.4fb.de>
*
*/
cInclude("classes", "class.lang.php");
class Contenido_Navigation {
/**
* @var debug
*/
var $debug = 0;
/**
* array storing all data
* @var array
*/
var $data = array();
/**
* Constructor
*/
function Contenido_Navigation() {
global $cfg, $belang;
if (!class_exists('XML_doc')) {
cInclude ("classes", 'class.xml.php');
}
$this->xml = new XML_Doc;
$this->plugxml = new XML_Doc;
# Load language file
if ($this->xml->load($cfg['path']['xml'] . $cfg['lang'][$belang]) == false)
{
if ($this->xml->load($cfg['path']['xml'] . 'lang_en_US.xml') == false)
{
die("Unable to load any XML language file");
}
}
}
function getName($location) {
global $cfg, $belang;
# Extract caption from the xml language file
# including plugins extended multilang version
# If a ";" is found entry is from a plugin ->
# explode location, first is xml file path,
# second is xpath location in xml file
if(strstr($location, ';')) {
$locs = explode(";", $location);
$file = trim($locs[0]);
$xpath = trim($locs[1]);
$filepath = explode('/',$file);
$counter = count($filepath)-1;
if ($filepath[$counter] == "") {
unset($filepath[$counter]);
$counter--;
}
if(strstr($filepath[$counter], '.xml')) {
$filename = $filepath[$counter];
unset($filepath[$counter]);
$counter--;
}
$filepath[($counter+1)] = "";
$filepath = implode("/",$filepath);
if ($this->plugxml->load($cfg["path"]["plugins"] . $filepath . $cfg['lang'][$belang]) == false)
{
if (!isset($filename)) { $filename = 'lang_en_US.xml'; }
if ($this->plugxml->load($cfg["path"]["plugins"] . $filepath . $filename) == false)
{
die("Unable to load $filepath XML language file");
}
}
$caption = $this->plugxml->valueOf( $xpath );
} else {
$caption = $this->xml->valueOf( $location );
}
return $caption;
}
function _buildHeaderData() {
global $cfg, $perm, $belang;
$db = new DB_Contenido;
$db2 = new DB_Contenido;
# Load main items
$sql = "SELECT idnavm, location FROM ".$cfg["tab"]["nav_main"]." ORDER BY idnavm";
$db->query($sql);
# Loop result and build array
while ( $db->next_record() ) {
/* Extract names from the XML document. */
$main = $this->getName($db->f("location"));
# Build data array
$this->data[$db->f('idnavm')] = array($main);
$sql = "SELECT
a.location AS location,
b.name AS area,
b.relevant
FROM
".$cfg["tab"]["nav_sub"]." AS a,
".$cfg["tab"]["area"]." AS b
WHERE
a.idnavm = '".$db->f('idnavm')."' AND
a.level = '0' AND
b.idarea = a.idarea AND
a.online = '1' AND
b.online = '1'
ORDER BY
a.idnavs";
$db2->query($sql);
while ( $db2->next_record() ) {
$area = $db2->f('area');
if ($perm->have_perm_area_action($area) || $db2->f('relevant') == 0){
/* Extract names from the XML document. */
$name = $this->getName($db2->f("location"));
$this->data[$db->f('idnavm')][] = array($name, $area);
}
} // end while
} // end while
# debugging information
if ($this->debug) {
echo '<pre>';
print_r($this->data);
echo '</pre>';
}
} # end function
#
# Method that builds the
# Contenido header document
#
function buildHeader($lang) {
global $cfg, $sess, $client, $changelang, $auth, $cfgClient;
$this->_buildHeaderData();
$main = new Template;
$sub = new Template;
$cnt = 0;
$t_sub = '';
$numSubMenus = 0;
$smallNavigation = getEffectiveSetting("backend", "small-navigation", "false");
$properties = new PropertyCollection;
$clientImage = $properties->getValue ("idclient", $client, "backend", "clientimage", false);
if ($smallNavigation !== "false")
{
$main->set('s', 'IESTYLE', 'header_ie_small.css');
$main->set('s', 'NSSTYLE', 'header_ns_small.css');
$main->set('s', 'OTHERSTYLE', 'header_ns_small.css');
$imgsize = "small";
$submenuIndent = 116;
$itemWidth = 16;
$clientWidth = 84;
} else {
$main->set('s', 'IESTYLE', 'header_ie.css');
$main->set('s', 'NSSTYLE', 'header_ns.css');
$main->set('s', 'OTHERSTYLE', 'header_ns.css');
$imgsize = "regular";
$submenuIndent = 172;
$itemWidth = 32;
$clientWidth = 130;
}
# Loop data/navigation array
$first = true;
foreach ($this->data as $id => $item)
{
# First image is different from
# the following ones
# reset subtemplate
$sub->reset();
$genSubMenu = false;
# loop the array
foreach ($item as $key => $value)
{
# check for an array -> submenu item
if (is_array($value))
{
$sub->set('s', 'SUBID', 'sub_'.$id);
$sub->set('d', 'SUBIMGID', 'img_'.$id.'_'.$sub->dyn_cnt);
if ($cfg['help'] == true)
{
$sub->set('d', 'CAPTION', '<a class="sub" target="content" href="'.$sess->url("frameset.php?area=$value[1]").'" onclick="document.getElementById(\'help\').setAttribute(\'data\',\''.$value[0].'\'); imgOn(\''.'img_'.$id.'_'.$sub->dyn_cnt.'\', this)">'.$value[0].'</a>');
} else {
$sub->set('d', 'CAPTION', '<a class="sub" target="content" href="'.$sess->url("frameset.php?area=$value[1]").'" onclick="imgOn(\''.'img_'.$id.'_'.$sub->dyn_cnt.'\', this)">'.$value[0].'</a>');
}
$sub->next();
$genSubMenu = true;
}
}
if ($genSubMenu == true)
{
if ($first == true)
{
$t_img = 'border_start_light.gif';
$first = false;
} else {
$t_img = 'border_light_light.gif';
}
# first entry in array is a main menu item
$main->set('d', 'IMAGE', $t_img);
$main->set('d', 'SIZE', $imgsize);
$main->set('d', 'MIMGID', 'mimg_'.$id);
$main->set('d', 'OPTIONS', 'style="background-color:#A9AEC2" id="'.$id.'"');
$main->set('d', 'CAPTION', '<a class="main" onclick="show(\'sub_'.$id.'\', this)" href="javascript://">'.$item[0].'</a>');
$main->next();
$numSubMenus ++;
} else {
# first entry in array is a main menu item
}
# generate a sub menu item.
$sub->set('s', 'LEFTPOS', $submenuIndent);
$t_sub .= $sub->generate($cfg['path']['templates'] . $cfg['templates']['submenu'], true);
$cnt ++;
}
$main->set('s', 'RIGHTBORDER', 'border_light_dark');
$main->set('s', 'SUBMENUS', $t_sub);
$main->set('s', 'MYCONTENIDO', '<a class="main" target="content" href="' .$sess->url("frameset.php?area=mycontenido&frame=4").'"><img src="'.$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"].'my_contenido.gif" border="0" alt="MyContenido" title="MyContenido"></a>');
$main->set('s', 'INFO', '<a class="main" target="content" href="' .$sess->url("frameset.php?area=info&frame=4").'"><img src="'.$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"].'info.gif" border="0" alt="Info" title="Info"></a>');
$main->set('s', 'LOGOUT', $sess->url("logout.php"));
if ($cfg['help'] == true)
{
$script = 'callHelp(document.getElementById(\'help\').getAttribute(\'data\'));';
$main->set('s', 'HELP', '<a id="help" class="main" onclick="'.$script.'" data="common"><img src="'.$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"].'hilfe.gif" border="0" alt="Hilfe" title="Hilfe"></a>');
} else {
$main->set('s', 'HELP', '');
}
$main->set('s', 'KILLPERMS', '<a class="main" target="header" href="' . $sess->url("header.php?killperms=1").'"><img src="'.$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"].'mycon.gif" border="0" alt="Reload Permission" title="Reload Permissions"></a>');
$main->set('s', 'CLIENTWIDTH', $clientWidth);
$tpl = new Template();
$classuser = new User();
$classclient = new Client();
$tpl->set('s', 'NAME', 'changelang');
$tpl->set('s', 'CLASS', 'text_medium');
$tpl->set('s', 'ID', 'cLanguageSelect');
$tpl->set('s', 'OPTIONS', 'onchange="changeContenidoLanguage(this.value)"');
$availableLanguages = new Languages;
if (getEffectiveSetting("system", "languageorder", "name") == "name")
{
$availableLanguages->select("", "", "name ASC");
} else {
$availableLanguages->select("", "", "idlang ASC");
}
$db = new DB_Contenido;
if ($availableLanguages->count() > 0)
{
while ($myLang = $availableLanguages->nextAccessible())
{
$key = $myLang->get("idlang");
$value = $myLang->get("name");
/* I want to get rid of such silly constructs
very soon :) */
$sql = "SELECT idclient FROM ".$cfg["tab"]["clients_lang"]." WHERE
idlang = '$key'";
$db->query($sql);
if ($db->next_record())
{
if ($db->f("idclient") == $client)
{
if ($key == $lang) {
$tpl->set('d', 'SELECTED', 'selected');
} else {
$tpl->set('d', 'SELECTED', '');
}
$tpl->set('d', 'VALUE', $key);
$tpl->set('d', 'CAPTION', $value.' ('.$key.')');
$tpl->next();
}
}
}
} else {
$tpl->set('d', 'VALUE', 0);
$tpl->set('d', 'CAPTION', '-- Sprache anlegen --');
$tpl->next();
}
$select = $tpl->generate($cfg['path']['templates'] . $cfg['templates']['generic_select'],true);
$main->set('s','ACTION', $sess->url("index.php"));
$main->set('s', 'LANG', $select);
$main->set('s', 'SIZE', $imgsize);
$main->set('s', 'WIDTH', $itemWidth);
if ($clientImage !== false && $clientImage != "")
{
$id = $classclient->getClientName($client).' ('.$client.')';
$hints = 'alt="'.$id.'" title="'.$id.'"';
$clientImage = '<img src="'.$cfgClient[$client]["path"]["htmlpath"].$clientImage.'" '.$hints.'>';
$main->set('s', 'CHOSENCLIENT', "<b>".i18n("Client").":</b> ".$clientImage);
} else {
$main->set('s', 'CHOSENCLIENT', "<b>".i18n("Client").":</b> ".$classclient->getClientName($client)." (".$client.")");
}
$main->set('s', 'CHOSENUSER', "<b>".i18n("User").":</b> ".$classuser->getRealname($auth->auth["uid"]));
$main->set('s', 'SID', $sess->id);
$main->set('s', 'MAINLOGINLINK', $sess->url("frameset.php?area=mycontenido&menuless=1"));
# generate header
$main->generate($cfg['path']['templates'] . $cfg['templates']['header']);
} # end function
} # end class
?>
da mischt du aber zwei dinge gewaltig. die...
hat nicht den geringsten zusammenhang mit dem code, der weiter unten im modul steht. deshalb kriegst du auch den fehler.
Code: Alles auswählen
cInclude('classes', 'navi.class.php');
aitsu.org :: schnell - flexibel - komfortabel :: Version 2.2.0 (since June 22, 2011) (jetzt mit dual license GPL/kommerziell)
die klasse hast du ja offenbar schon irgendwo vorliegen und hast es auch einmal eingebunden. sonst hätte es nämlich auch nicht funktioniert.
richtig sollte das so lauten:
richtig sollte das so lauten:
Code: Alles auswählen
cInclude('classes', 'atelierq.navigation.class.inc.php');
aitsu.org :: schnell - flexibel - komfortabel :: Version 2.2.0 (since June 22, 2011) (jetzt mit dual license GPL/kommerziell)
OK, aber der Fehler ist der gleiche. Habe jetzt folgendes geändert:
1. das Modul für die erste Ebene sieht so aus (wird aber nicht eingesetzt):
2. Die atelierq.navigation.class.inc.php in contenido/classes ist die Original von deiner HP
3. Die class.navigation.php ist die Original aus Contenido
4. zweite Ebene (die man ausschl. sehen soll) sieht so aus:
5. Der Fehler ist:
6. ich glaube ich stehe auf der Leitung!!!!
1. das Modul für die erste Ebene sieht so aus (wird aber nicht eingesetzt):
Code: Alles auswählen
<?php
cInclude('classes', 'atelierq.navigation.class.inc.php');
$cApiClient = new cApiClient($client);
$aQnavigation = new aQnavigation($cApiClient->getProperty('navigation', 'idcat_mainnavigation'));
$aQnavigation->between(3, '');
$aQnavigation->maskNormal(3, '<div class="navthirdoff"><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->maskSelected(3, '<div class="navthirdon"><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->maskSelectedSub(3, '<div class="navthirdon"><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->between(2, '');
$aQnavigation->maskNormal(2, '<div class="navsecondoff"><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->maskSelected(2, '<div class="navsecondon"><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->maskSelectedSub(2, '<div class="navsecondon"><a target="_self" href="{link}">{name1}</a></div>{sub}');
$aQnavigation->setSub(2, $aQnavigation->showNavigation(3));
$aQnavigation->between(1, '');
$aQnavigation->maskNormal(1, '<div class="navfirstoff"><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->maskSelected(1, '<div class="navfirstopen"><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->maskSelectedSub(1, '<div class="navfirstopen"><a target="_self" href="{link}">{name1}</a></div>{sub}');
$aQnavigation->setSub(1, $aQnavigation->showNavigation(2));
echo $aQnavigation->showNavigation(1);
?>
3. Die class.navigation.php ist die Original aus Contenido
4. zweite Ebene (die man ausschl. sehen soll) sieht so aus:
Code: Alles auswählen
<?php
$aQnavigation->between(2, '');
$aQnavigation->maskNormal(2, '<div><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->maskSelected(2, '<div><a target="_self" href="{link}">›{name1}</a></div>');
$aQnavigation->maskNormalSub(2, '<div><a target="_self" href="{link}">{name1}</a>{sub}</div>');
$aQnavigation->maskSelectedSub(2, '<div><a target="_self" href="{link}">›{name1}</a>{sub}</div>');
$aQnavigation->between(1, '');
$aQnavigation->maskNormal(1, '<div><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->maskNormalSub(1, '<div><a target="_self" href="{link}">{name1}</a></div>{sub}');
$aQnavigation->maskSelected(1, '<div><a target="_self" href="{link}">›{name1}</a></div>');
$aQnavigation->maskSelectedSub(1, '<div><a target="_self" href="{link}">›{name1}</a></div>{sub}');
$aQnavigation->setSub(1, $aQnavigation->showNavigation(2));
echo $aQnavigation->showNavigation(1);
?>
Code: Alles auswählen
Fatal error: Call to a member function on a non-object in /kunden/102103_49214/rp-hosting/11037/5163/cms/front_content.php(1029) : eval()'d code on line 95
das include musst du schon machen. ohne geht es einfach nicht.
aitsu.org :: schnell - flexibel - komfortabel :: Version 2.2.0 (since June 22, 2011) (jetzt mit dual license GPL/kommerziell)
OK, das macht Sinn, habe auch eine neue Fehlermeldung:
das Modul für die zweite Ebene sieht jetzt so aus:
Danke für Deine Geduld
Code: Alles auswählen
Fatal error: Call to a member function on a non-object in /kunden/102103_49214/rp-hosting/11037/5163/contenido/includes/include.con_editcontent.php(618) : eval()'d code on line 259
Code: Alles auswählen
<?php
cInclude('classes', 'atelierq.navigation.class.inc.php');
$aQnavigation->between(2, '');
$aQnavigation->maskNormal(2, '<div><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->maskSelected(2, '<div><a target="_self" href="{link}">›{name1}</a></div>');
$aQnavigation->maskNormalSub(2, '<div><a target="_self" href="{link}">{name1}</a>{sub}</div>');
$aQnavigation->maskSelectedSub(2, '<div><a target="_self" href="{link}">›{name1}</a>{sub}</div>');
$aQnavigation->between(1, '');
$aQnavigation->maskNormal(1, '<div><a target="_self" href="{link}">{name1}</a></div>');
$aQnavigation->maskNormalSub(1, '<div><a target="_self" href="{link}">{name1}</a></div>{sub}');
$aQnavigation->maskSelected(1, '<div><a target="_self" href="{link}">›{name1}</a></div>');
$aQnavigation->maskSelectedSub(1, '<div><a target="_self" href="{link}">›{name1}</a></div>{sub}');
$aQnavigation->setSub(1, $aQnavigation->showNavigation(2));
echo $aQnavigation->showNavigation(1);
?>
Ergänzung: nach dem leeren von con_code habe ich wieder:
Code: Alles auswählen
Fatal error: Call to a member function on a non-object in /kunden/102103_49214/rp-hosting/11037/5163/cms/front_content.php(1029) : eval()'d code on line 97
wenn du nun vor dem ersten aufruf der klasse (unmittelbar nach dem include) die klasse instantiierst, dann wird es voraussichtlich funktionieren:
anstelle der 1 gibst du die idcat der ersten ebene der hauptnavigation an.
Code: Alles auswählen
$aQnavigation = new aQnavigation(1);
aitsu.org :: schnell - flexibel - komfortabel :: Version 2.2.0 (since June 22, 2011) (jetzt mit dual license GPL/kommerziell)