<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
defined('MAXIMUS') or Header("Location: ../../index.php");

if (defined('USER_ALLOW')) {
get_lang("Your_Account");

function menuimg($gfile) {
    $ThemeSel = get_theme();
    if (file_exists("themes/$ThemeSel/images/menu/$gfile")) {
	$menuimg = "themes/$ThemeSel/images/menu/$gfile";
    } else {
	$menuimg = "modules/Your_Account/images/$gfile";
    }
    return($menuimg);
}

function nav($main_up=0) {
     global $module_name, $admin, $ya_config, $thmcount, $tdwidth, $articlecomm, $cookie, $admin_file, $my_headlines;
if (is_file("modules/Your_Account/includes/functions.php")) {
     include_once("modules/Your_Account/includes/functions.php");}

    $handle=opendir('themes');
    while ($file = readdir($handle)) {
	if ( (!ereg("[.]",$file)) ) {
		$thmcount++;
	}
    }
    closedir($handle);
    echo "<table border=\"0\" width=\"100%\" align=\"center\"><tr><td width=\"10%\">"
	."<center>";
    if (ya_userisadmin($cookie[1])) {
   $menuimg = menuimg("delete.png");
   echo "<a href=\"".$admin_file.".php\"><img src=\"$menuimg\" border=\"0\" alt=\""._YA_ACCESADMIN."\" title=\""._YA_ACCESADMIN."\" /></a><br />"
       ."<a href=\"".$admin_file.".php\"><font class=\"content\">"._YA_ACCESADMIN."</font></a></center></td><td width=\"10%\"><center>";
	}
    $menuimg = menuimg("info.gif");
    echo "<a href=\"modules.php?name=Your_Account&amp;op=edituser\"><img src=\"$menuimg\" border=\"0\" alt=\""._CHANGEYOURINFO."\" title=\""._CHANGEYOURINFO."\" /></a><br />"
	."<a href=\"modules.php?name=Your_Account&amp;op=edituser\"><font class=\"content\">"._CHANGEYOURINFO."</font></a>"
	."</center></td>";
if ($my_headlines) {
    $menuimg = menuimg("home.gif");
    echo "<td width=\"10%\"><font class=\"content\">"
	."<center><a href=\"modules.php?name=Your_Account&amp;op=edithome\"><img src=\"$menuimg\" border=\"0\" alt=\""._CHANGEHOME."\" title=\""._CHANGEHOME."\" /></a><br />"
	."<a href=\"modules.php?name=Your_Account&amp;op=edithome\">"._CHANGEHOME."</a>"
	."</center></form></font></td>";
}
    if ($articlecomm == 1) {
	$menuimg = menuimg("comments.gif");
	echo "<td width=\"10%\"><font class=\"content\">"
	    ."<center><a href=\"modules.php?name=Your_Account&amp;op=editcomm\"><img src=\"$menuimg\" border=\"0\" alt=\""._CONFIGCOMMENTS."\" title=\""._CONFIGCOMMENTS."\" /></a><br />"
	    ."<a href=\"modules.php?name=Your_Account&amp;op=editcomm\">"._CONFIGCOMMENTS."</a>"
	    ."</center></form></font></td>";
    }

    if (is_active("WebMail")) {
	$menuimg = menuimg("mail.gif");
	echo "<td width=\"10%\"><font class=\"content\">"
	    ."<center><a href=\"modules.php?name=WebMail\"><img src=\"$menuimg\" border=\"0\" alt=\""._WEBMAIL."\" title=\""._WEBMAIL."\" /></a><br />"
	    ."<a href=\"modules.php?name=WebMail\">"._WEBMAIL."</a>"
	    ."</center></form></font></td>";
    }

    if (is_active("Private_Messages")) {
	$menuimg = menuimg("messages.gif");
	echo "<td width=\"10%\"><font class=\"content\">"
	    ."<center><a href=\"modules.php?name=Private_Messages\"><img src=\"$menuimg\" border=\"0\" alt=\""._PRIVATEMESSAGES."\" title=\""._PRIVATEMESSAGES."\" /></a><br />"
	    ."<a href=\"modules.php?name=Private_Messages\">"._MESSAGES."</a>"
	    ."</center></form></font></td>";
    }

    if (is_active("Journal")) {
	$menuimg = menuimg("journal.gif");
	echo "<td width=\"10%\"><font class=\"content\">"
	    ."<center><a href=\"modules.php?name=Journal&amp;file=edit\"><img src=\"$menuimg\" border=\"0\" alt=\""._JOURNAL."\" title=\""._JOURNAL."\" /></a><br />"
	    ."<a href=\"modules.php?name=Journal&amp;file=edit\">"._JOURNAL."</a>"
	    ."</center></form></font></td>";
    }


    if ($ya_config['allowusertheme']==1) {
	$menuimg = menuimg("themes.gif");
	echo "<td width=\"10%\"><font class=\"content\">"
	    ."<center><a href=\"modules.php?name=Your_Account&amp;op=chgtheme\"><img src=\"$menuimg\" border=\"0\" alt=\""._SELECTTHETHEME."\" title=\""._SELECTTHETHEME."\" /></a><br />"
	    ."<a href=\"modules.php?name=Your_Account&amp;op=chgtheme\">"._SELECTTHETHEME."</a>"
	    ."</center></form></font></td>";
    }

    $menuimg = menuimg("exit.gif");
    echo "<td width=\"10%\"><font class=\"content\">"
	."<center><a href=\"modules.php?name=Your_Account&amp;op=logout\"><img src=\"$menuimg\" border=\"0\" alt=\""._LOGOUTEXIT."\" title=\""._LOGOUTEXIT."\" /></a><br />"
	."<a href=\"modules.php?name=Your_Account&amp;op=logout\">"._LOGOUTEXIT."</a>"
	."</center></form></font>";

    echo "</td></tr></table>";
    if ($main_up != 1) {
	echo "<br /><center>[ <a href=\"modules.php?name=Your_Account\">"._RETURNACCOUNT."</a> ]</center>\n";
    }
}

}