<?php 
if (!defined("IN_FUSION")) {die("Access Denied"); }
define("THEME_BULLET", "<img src='".THEME."images/bullet.gif' class='bullet' alt='&raquo;' border='0' />");

require_once INCLUDES."theme_functions_include.php";

function render_page($license=false) {
    global $settings, $locale, $main_style, $aidlink, $breadcrumb_titles, $breadcrumb_links;

    echo "<table cellpadding='0' cellspacing='0' id='panel-width' align='center'>\n<tr>\n";
    echo "<td class='side-border-left' valign='top'>\n";
    echo "<img src='".ADMIN."template/images/php-fusion-logo.png' style='margin: 0 0 10px 0; width: 210px;' />\n";
    echo LEFT."\n";
    echo "</td>\n<td valign='top'>\n";
    echo "<div class='top_center'>\n<div class='left_top'>\n<div class='right_top'></div>\n</div>\n</div>\n";
    echo "<div class='content'>\n";
    echo "<div class='breadCrumbHolder module'>\n";
    echo "<div id='breadCrumb0' class='breadCrumb module'>\n<ul>\n";
    echo "<li class='first'><a href='".BASEDIR.$settings['opening_page']."' class='tip_s' title='".$settings['sitename']."'></a></li>\n";
    
    if ((FUSION_SELF == "index.php") && !isset($_GET['pagenum'])) {
        echo "<li>".$locale['global_123']."</li>\n";
    } else {
        echo "<li><a href='".ADMIN."index.php".$aidlink."' class='tip_s' title='".$locale['global_123']."'>".$locale['global_123']."</a></li>\n";
    }
    
    if (FUSION_SELF != "index.php") {
        $result = dbquery("SELECT admin_page FROM ".DB_ADMIN." WHERE admin_link='".FUSION_SELF."'");
        if (dbrows($result)) {
            $page = dbresult($result,0);            
            /**************************************************************** 
             * FIX für die Seite "settings_main.php" 
             * aus komischen Gründen werden die Locales nicht erkannt (nur auf
             * dieser Seite!!!!)
             * 
             * folgende Locale werden nicht erkannt: "locales/German/admin/main.php"
             * 
             * Edit: scheint so als wären die Error Locales auch weg :O
             * 
             * Wenn jemand eine Lösung für das Problem hat, bitte melden bei:
             * conrad.patrick.1@googlemail.com
             ****************************************************************/
             
             $locale['ac04'] = "Einstellungen";             
             
             /*************************************************************** 
              * Fix ENDE 
              ***************************************************************/            
            echo "<li><a href='".ADMIN."index.php".$aidlink."&amp;pagenum=".$page."' class='tip_s' title='".$locale['ac0'.$page]."'>".$locale['ac0'.$page]."</a></li>\n";
        }
    }               
                        
    if ((isset($breadcrumb_titles) && $breadcrumb_titles != "") && (isset($breadcrumb_links) && $breadcrumb_links != "")) {
        $n = count($breadcrumb_titles)-1;
        for ($i = 0; $i <= $n; $i++) {
            if ($i <> $n) {
                echo "<li><a href='".$breadcrumb_links[$i]."' class='tip_s' title='".$breadcrumb_titles[$i]."'>".$breadcrumb_titles[$i]."</a></li>\n";
            } elseif ($i == $n) {
                echo "<li>".$breadcrumb_titles[$i]."</li>\n";
            }
        }
    }
    
    echo "</ul>\n</div>\n</div>\n";
    echo "<div>\n<div id='messageBox' style='display: none;'></div>\n</div>\n";
    echo "<div id='slideContent'>\n".U_CENTER.CONTENT.L_CENTER."\n</div>\n</div>\n";    
    echo "<div class='center_bottom'>\n";
    echo "<div class='left_bottom'>\n";
    echo "<div class='right_bottom'></div>\n";
    echo "</div>\n</div>\n</td>\n</tr>\n</table>\n";
    
    echo "<div id='tplContainer' style='display: none;'>";
    echo "<div id='tpl1' style='display: none;'>"; 
       
    echo "<li class='admin-height'>";
    echo "<a href=''>";
    echo "<div class='admin-icons'>";
    echo "<img alt='' class='icon' src=''>";
    echo "</div>";
    echo "<div class='admin-desc'>";
    echo "<h3></h3>";
    echo "<div class='admin-description'></div>";
    echo "</div>";
    echo "</a>";
    echo "</li>"; 
       
    echo "</div>";
    echo "<div id='tpl2' style='display: none;'>";
    
    echo "<li class='no-desc'>";
    echo "<a class='' href='' title=''>";
    echo "<img alt='' src=''>";
    echo "<div></div>";
    echo "</a>";
    echo "</li>";
    
    echo "</div>";
    echo "</div>";
            
    echo "<div class='footer' style='margin: 10px;' align='right'>".(!$license ? showcopyright() : "")."</div>\n";    
} 

function opentable($title) {
    $result = dbquery("SELECT admin_title FROM ".DB_ADMIN." WHERE admin_link='".FUSION_SELF."'");
    if (dbrows($result)) { $image = dbresult($result,0); }
    echo "<div class='capmain'>\n";
    echo "<div class='opentable_title'".(isset($image) ? " style='background:url(".get_image("ac_".$image).") no-repeat left'" : "").">\n<h2>".$title."</h2>\n</div>\n";
    echo "</div>\n";
    echo "<div class='admin-body'".(FUSION_SELF != "index.php" ? " style='width: 700px;'" : "").">\n";
}
   
function closetable() {
    echo "</div>\n";
} 

function openside($title, $collapse = false, $state = "on") {
    global $panel_collapse; $panel_collapse = $collapse;

    echo "<div class='top_center'>\n";
	echo "<div class='left_top'></div>\n";
	echo "</div>\n";
	echo "<div class='scapmain'>".$title."</div>\n";
	echo "<div class='center_bottom'>\n";
	echo "<div class='left_bottom'></div>\n";
	echo "</div>\n";
    echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
    echo "<td colspan='2' class='side-body'>\n";
    
    if ($collapse == true) { echo panelstate($state, $boxname); }
}

function closeside($collapse = false) {
	global $panel_collapse;
    
    if ($panel_collapse == true) { echo "</div>\n"; }
    echo "</td>\n</tr>\n</table>\n";
}           
?>