Пожалуйста, помогите верно вывести меню на php

S
На сайте с 13.11.2012
Offline
72
512

Не могу вставить тег <H3> из Footer Top в <div class="footer-links"> из Child Menu

Сейчас так

<h3>Support</h3><div class="footer-links">

а надо

<div class="footer-links"><h3>Support</h3>

Код вывода динамического меню:

//----------------------------- Dynamic Footer Menu -----------------------------------------

//Footer Top
function build_footermenu($type) {
$menu = array();
$table= $this->ci->db->dbprefix('menu');
$query = $this->ci->db->query("select * from ".$table." where dyn_group_id = 1");
$html_out = "\t".''."\n";
switch ($type) {
case 0: // 0 = top menu
break;
case 1: // 1 = horizontal menu
$html_out .= "\t\t".'<ul class="footer_menu">'."\n";
break;
case 2: // 2 = sidebar menu
break;
case 3: // 3 = footer menu
$html_out .= "\t\t".'<ul>'."\n";
break;
default: // default = horizontal menu
$html_out .= "\t\t".'<ul class="footmenu">'."\n";
break;
}
foreach ($query->result() as $row){
$id = $row->id;
$title = $row->title;
$link_type = $row->link_type;
$page_id = $row->page_id;
$module_name = $row->module_name;
$url = $row->url;
$uri = $row->uri;
$dyn_group_id = $row->dyn_group_id;
$position = $row->position;
$target = $row->target;
$parent_id = $row->parent_id;
$is_parent = $row->is_parent;
$show_menu = $row->show_menu;
if ($show_menu && $parent_id == 0) {
if ($is_parent == TRUE) {
$html_out .= "\t\t\t".'<li class="span4">'.anchor($url.''.$this->class_parent, '<h3>'.$title.'</h3>', 'name="'.$title.'" id="'.$id.'" target="'.$target.'"');
} else {
$html_out .= "<h3>$title</h3>"; }
}
$html_out .= $this->get_footerchilds($id);
}
$html_out .= '</li>'."\n";
$html_out .= "\t\t".'</ul>' . "\n";
return $html_out;
}
//Footer Top

//Footer Bottom
function build_menu_bottom($type) {
$menu = array();
$table= $this->ci->db->dbprefix('menu');
$query = $this->ci->db->query("select * from ".$table." where dyn_group_id = 2");
$html_out = "\t".'<div id="footmenu">'."\n";
switch ($type) {
case 0: // 0 = top menu
break;
case 1: // 1 = horizontal menu
$html_out .= "\t\t".'<ul>'."\n";
break;
case 2: // 2 = sidebar menu
$html_out .= "\t\t".'<ul class="footmenu">'."\n";
break;
case 3: // 3 = footer menu
$html_out .= "\t\t".'<ul class="footmenu">'."\n";
break;
default: // default = horizontal menu
$html_out .= "\t\t".'<ul class="footmenu">'."\n";
break;
}
foreach ($query->result() as $row){
$id = $row->id;
$title = $row->title;
$link_type = $row->link_type;
$page_id = $row->page_id;
$module_name = $row->module_name;
$url = $row->url;
$uri = $row->uri;
$dyn_group_id = $row->dyn_group_id;
$position = $row->position;
$target = $row->target;
$parent_id = $row->parent_id;
$is_parent = $row->is_parent;
$show_menu = $row->show_menu;
if ($show_menu && $parent_id == 0) {
$menubg=$this->ci->auth->value('menubg');
$menuhoverbg=$this->ci->auth->value('menuhoverbg');
$menufont=$this->ci->auth->value('menufont');
$menuhoverfont=$this->ci->auth->value('menuhoverfont');
if ($is_parent == TRUE) {
$html_out .= "\t\t\t".'<li>'.anchor($url.''.$this->class_parent, '<span style="color:#'.$menufont.';">'.$title.'</span>', 'name="'.$title.'" id="'.$id.'" target="'.$target.'"');
} else {
$html_out .= "\t\t\t".'<li>'.anchor($url, '<span style="color:#'.$menufont.';">'.$title.'</span>', 'name="'.$title.'" id="'.$id.'" target="'.$target.'"');
}
}
$html_out .= $this->get_footerchilds($id);
}
$html_out .= '</li>'."\n";
$html_out .= "\t\t".'</ul>' . "\n";
$html_out .= "\t".'</div>' . "\n";
return $html_out;
}
//Footer Bottom
// Child Menu
function get_footerchilds($id) {
$has_subcats = FALSE;
$html_out = '';
$html_out .= "\n\t\t\t\t".'<div class="footer-links">'."\n";
$html_out .= "\t\t\t\t\t".'<ul>'."\n";
$table= $this->ci->db->dbprefix('menu');
$query = $this->ci->db->query("select * from ".$table." where parent_id = ".$id);
foreach ($query->result() as $row) {
$id = $row->id;
$title = $row->title;
$link_type = $row->link_type;
$page_id = $row->page_id;
$module_name = $row->module_name;
$url = $row->url;
$uri = $row->uri;
$dyn_group_id = $row->dyn_group_id;
$position = $row->position;
$target = $row->target;
$parent_id = $row->parent_id;
$is_parent = $row->is_parent;
$show_menu = $row->show_menu;
$has_subcats = TRUE;
if ($is_parent == TRUE) {
$html_out .= "\t\t\t\t\t\t".'<li>'.anchor($url.' '.$this->class_parent, '<span>'.$title.'</span>', 'name="'.$title.'" id="'.$id.'" target="'.$target.'"');
} else {
$html_out .= "\t\t\t\t\t\t".'<li>'.anchor($url, '<span>'.$title.'</span>', 'name="'.$title.'" id="'.$id.'" target="'.$target.'"');
}
$html_out .= $this->get_footerchilds($id);
}
$html_out .= '</li>' . "\n";
$html_out .= "\t\t\t\t\t".'</ul>' . "\n";
$html_out .= "\t\t\t\t".'</div>' . "\n";
return ($has_subcats) ? $html_out : FALSE;
}
// Child Menu
//----------------------------- Dynamic Footer Menu -----------------------------------------

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий