Bugfix für nicht sichbaren Content

This commit is contained in:
Andreas Österreicher
2011-09-05 08:48:23 +00:00
parent b7017f9f52
commit 6e5ca0640b
2 changed files with 47 additions and 40 deletions
+42 -40
View File
@@ -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 '
<tr>
<td class="tdwidth10" nowrap>&nbsp;</td>
<td class="tdwrap">';
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 '
<table class="menue" id="Content'.$content->content_id.'" style="display: '.($content->menu_open?'visible':'none').'">';
$content->getChilds($content->content_id);
foreach($content->result as $row)
if($content->hasChilds($content->content_id))
{
drawEntry($row, $sprache);
}
echo '
</table>
</td>
</tr>';
}
else
{
echo '
<tr>
<td class="tdwidth10" nowrap>&nbsp;</td>
<td class="tdwrap">';
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 '
<tr>
<td class="tdwidth10" nowrap>&nbsp;</td>
<td class="tdwrap">';
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 '
</td>
</tr>';
echo '
<table class="menue" id="Content'.$content->content_id.'" style="display: '.($content->menu_open?'visible':'none').'">';
$content->getChilds($content->content_id);
foreach($content->result as $row)
{
drawEntry($row, $sprache);
}
echo '
</table>
</td>
</tr>';
}
else
{
echo '
<tr>
<td class="tdwidth10" nowrap>&nbsp;</td>
<td class="tdwrap">';
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 '
</td>
</tr>';
}
}
}
+5
View File
@@ -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))