From 6e5ca0640b365e6dbdd146fdc678b45cba7b79c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 5 Sep 2011 08:48:23 +0000 Subject: [PATCH] =?UTF-8?q?Bugfix=20f=C3=BCr=20nicht=20sichbaren=20Content?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cms/menu.inc.php | 82 ++++++++++++++++++++------------------- include/content.class.php | 5 +++ 2 files changed, 47 insertions(+), 40 deletions(-) diff --git a/cms/menu.inc.php b/cms/menu.inc.php index d112d874b..4464ecf29 100755 --- a/cms/menu.inc.php +++ b/cms/menu.inc.php @@ -68,49 +68,51 @@ function drawEntry($item, $sprache) return; } $content = new content(); - $content->getContent($item->child_content_id, $sprache, null, true, true); - if($content->hasChilds($content->content_id)) + if($content->getContent($item->child_content_id, $sprache, null, true, true)) { - echo ' - -   - '; - if($content->template_kurzbz=='include') - IncludeMenuAddon($content); - elseif($content->template_kurzbz=='redirect') - Redirect($content, $content->content_id); - else - DrawLink(APP_ROOT.'cms/content.php?content_id='.$content->content_id,'content',$content->titel, $content->content_id); - - echo ' - '; - - $content->getChilds($content->content_id); - foreach($content->result as $row) + if($content->hasChilds($content->content_id)) { - drawEntry($row, $sprache); - } - echo ' - - - '; - } - else - { - echo ' - -   - '; - if($content->template_kurzbz=='include') - IncludeMenuAddon($content); - elseif($content->template_kurzbz=='redirect') - Redirect($content); - else - DrawLink(APP_ROOT.'cms/content.php?content_id='.$content->content_id,'content',$content->titel); + echo ' + +   + '; + if($content->template_kurzbz=='include') + IncludeMenuAddon($content); + elseif($content->template_kurzbz=='redirect') + Redirect($content, $content->content_id); + else + DrawLink(APP_ROOT.'cms/content.php?content_id='.$content->content_id,'content',$content->titel, $content->content_id); - echo ' - - '; + echo ' + '; + + $content->getChilds($content->content_id); + foreach($content->result as $row) + { + drawEntry($row, $sprache); + } + echo ' + + + '; + } + else + { + echo ' + +   + '; + if($content->template_kurzbz=='include') + IncludeMenuAddon($content); + elseif($content->template_kurzbz=='redirect') + Redirect($content); + else + DrawLink(APP_ROOT.'cms/content.php?content_id='.$content->content_id,'content',$content->titel); + + echo ' + + '; + } } } diff --git a/include/content.class.php b/include/content.class.php index dd36d4e87..2ff4a6456 100644 --- a/include/content.class.php +++ b/include/content.class.php @@ -496,6 +496,11 @@ class content extends basis_db */ public function hasChilds($content_id) { + if($content_id=='' || !is_numeric($content_id)) + { + $this->errormsg = 'ContentID ungueltig'; + return false; + } $qry = "SELECT count(*) as anzahl FROM campus.tbl_contentchild WHERE content_id='".addslashes($content_id)."'"; if($result = $this->db_query($qry))