Example #1
0
function tree_sidebar($modul, $t_data, $parents = NULL, $i = 1, $id_parent = NULL)
{
    global $id_tree;
    foreach ($t_data as $t_key => $t_value) {
        $url = "?modul=" . $modul . "&id_tree=" . $t_value['id'];
        if ($t_value['id_parent'] == $id_parent) {
            $i = 1;
        }
        if (isset($t_value['children'])) {
            print "<li class='has-dropdown level-" . $i . " ";
            if ($id_tree == $t_value['id']) {
                print 'current';
            }
            print "'><a href='" . $url . "' title='" . $t_value['title'] . "'>";
            for ($y = 2; $y <= $i; $y++) {
                print "<span class='spacer'></span>";
            }
            print "<i class='icon-tree'></i><span class='toggle ";
            if (isset($parents)) {
                if (in_array($t_value['id'], $parents)) {
                    print 'active';
                }
            }
            print "'>" . $t_value['title'] . "</span></a>";
            print "<ul class='dropdown ";
            if (isset($parents)) {
                if (in_array($t_value['id'], $parents)) {
                    print 'active';
                }
            }
            print "'>";
            tree_sidebar($modul, $t_value['children'], $parents, $i + 1, $t_value['id_parent']);
            print "</ul><!-- /.dropdown -->";
            print "</li><!-- /.has-dropdown -->";
        } else {
            print "<li class='level-" . $i . " ";
            if ($id_tree == $t_value['id']) {
                print 'current';
            }
            print "'><a href='" . $url . "' title='" . $t_value['title'] . "'>";
            for ($y = 2; $y <= $i; $y++) {
                print "<span class='spacer'></span>";
            }
            print "<i class='icon-tree'></i>" . $t_value['title'] . "</a></li>";
        }
    }
}
Example #2
0
     if ($id_parent) {
         $arr_tmp = create_tree('content_tree');
         if ($arr_tmp) {
             print "\n\t\t\t\t\t\t<li class='has-dropdown'>\n\t\t\t\t\t\t\t<a href='?modul=content'>\n\t\t\t\t\t\t\t\t<i class='icon-content'></i><span class='toggle ";
             if ($next_modul == 'content') {
                 print 'active';
             }
             print "'>" . v('CMT_MODUL_CONTENT') . "</span>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t<ul class='dropdown sub-tree ";
             if ($next_modul == 'content') {
                 print 'active';
             }
             print "'>";
             if (isset($id_tree)) {
                 tree_sidebar('content', $arr_tmp, tree_get_parents('content_tree', $id_tree));
             } else {
                 tree_sidebar('content', $arr_tmp, tree_get_parents('content_tree', NULL));
             }
             print "\n\t\t\t\t\t\t\t</ul><!-- /.dropdown -->\n\t\t\t\t\t\t</li><!-- /.has-dropdown -->";
         } else {
             print "\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href='?modul=content'>\n\t\t\t\t\t\t\t<i class='icon-content'></i><span>" . v('CMT_MODUL_CONTENT') . "</span>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li><!-- /.has-dropdown -->";
         }
     }
 } elseif ($arr_sb['modul'] == 'update') {
     $sql = "SELECT * FROM " . $_SESSION['TABLE_PREFIX'] . "cmt_settings WHERE title = 'update_core' AND c_active = '1' ";
     $result = db_mysql_query($sql, $conn);
     if (db_mysql_num_rows($result)) {
         print "\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href='?modul=update'>\n\t\t\t\t\t\t\t<i class='icon-update'></i><span>" . v('CMT_MODUL_UPDATE') . "</span>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>";
     }
 } else {
     if ($arr_sb['modul_string']) {
         $modul_string = $arr_sb['modul'] . "_" . $arr_sb['modul_string'];