function ListNavigation($position_id, $actual_level = "", $parent_id = "", $level = 0)
{
    if (empty($actual_level)) {
        $LevelNumber = CheckPositionLevel($position_id);
        $actual_level = $LevelNumber;
        $mySQL = "SELECT nav_tab_id,nav_tab_name,parent_id FROM navigation_tab WHERE nav_position_id = '{$position_id}' AND parent_id = '0'";
    } else {
        $LevelNumber = $actual_level;
        $actual_level--;
        $level++;
        $mySQL = "SELECT nav_tab_id,CONCAT_WS('',REPEAT('-',{$level}),nav_tab_name) as nav_tab_name,parent_id FROM navigation_tab WHERE parent_id = '{$parent_id}'";
    }
    if (!$LevelNumber) {
        return;
    }
    $recSET = mysql_query($mySQL) or die(mysql_error("Mysql Error ( 83 )"));
    $output = "";
    while ($recROW = mysql_fetch_assoc($recSET)) {
        $id = $recROW['nav_tab_id'];
        $name = $recROW['nav_tab_name'];
        $output .= "<div class=\"alisting\"><a href=\"{$id}\">{$name}</a></div>";
        if ($actual_level) {
            $output .= ListNavigation($position_id, $actual_level, $id, $level);
        }
    }
    return $output;
}
Exemple #2
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
?>
 
 <div style="text-align:left;"><h2>- Navigation Links</h2></div>
 -Edit Order, Edit Page, Delete Pages, Add Pages<br />
 
<?php 
if (!defined("ADMIN_FILE")) {
    die("Access denied.");
}
include $basedir . 'navigation/functions.php';
if (isset($_GET['edit'])) {
    $block_id = $_GET['edit'];
    EditBlock($block_id);
    return;
}
if (isset($_GET['delete'])) {
    $block_id = $_GET['delete'];
    DeleteBlock($block_id);
    return;
}
if (isset($_GET['create'])) {
    NewBlock();
    return;
}
ListNavigation();