";
if (file_exists(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_header.php')) {
@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_header.php");
} else {
@include_once(e_LANGUAGEDIR."English/admin/lan_header.php");
}
if (file_exists(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_footer.php')) {
@include_once(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_footer.php');
} else {
@include_once(e_LANGUAGEDIR.'English/admin/lan_footer.php');
}
if (!defined('ADMIN_WIDTH')) {
define('ADMIN_WIDTH', 'width: 95%');
}
if (!defined('ADMIN_TRUE_ICON'))
{
define("ADMIN_TRUE_ICON", "");
define("ADMIN_TRUE_ICON_PATH", e_IMAGE."fileinspector/integrity_pass.png");
}
if (!defined('ADMIN_FALSE_ICON'))
{
define("ADMIN_FALSE_ICON", "");
define("ADMIN_FALSE_ICON_PATH", e_IMAGE."fileinspector/integrity_fail.png");
}
if (!defined('ADMIN_EDIT_ICON'))
{
define("ADMIN_EDIT_ICON", "");
define("ADMIN_EDIT_ICON_PATH", e_IMAGE."admin_images/edit_16.png");
}
if (!defined('ADMIN_DELETE_ICON'))
{
define("ADMIN_DELETE_ICON", "");
define("ADMIN_DELETE_ICON_PATH", e_IMAGE."admin_images/delete_16.png");
}
echo "
".SITENAME." : ".LAN_head_4."\n";
echo "
\n";
if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE && isset($pref['admincss']) && $pref['admincss'] && file_exists(THEME.$pref['admincss'])) {
$css_file = file_exists(THEME.'admin_'.$pref['admincss']) ? THEME_ABS.'admin_'.$pref['admincss'] : THEME_ABS.$pref['admincss'];
echo "\n";
} else if (isset($pref['themecss']) && $pref['themecss'] && file_exists(THEME.$pref['themecss'])) {
$css_file = file_exists(THEME.'admin_'.$pref['themecss']) ? THEME_ABS.'admin_'.$pref['themecss'] : THEME_ABS.$pref['themecss'];
echo "\n";
} else {
$css_file = file_exists(THEME.'admin_style.css') ? THEME_ABS.'admin_style.css' : THEME_ABS.'style.css';
echo "\n";
}
if (!isset($no_core_css) || !$no_core_css) {
echo "\n";
}
if (function_exists('theme_head')) {
echo theme_head();
}
if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE) {
echo "\n";
}
if (file_exists(THEME."theme.js")) {
echo "\n";
}
if (filesize(e_FILE.'user.js')) {
echo "\n";
}
if (function_exists("headerjs")) {
echo headerjs();
}
if (isset($htmlarea_js) && $htmlarea_js) {
echo $htmlarea_js;
}
if (strpos(e_SELF, 'fileinspector.php') === FALSE) {
echo "\n";
}
if (isset($eplug_js) && $eplug_js) {
echo "\n";
}
if (isset($eplug_css) && $eplug_css) {
echo "\n\n";
}
if(check_class($pref['post_html']) && $pref['wysiwyg'] && $e_wysiwyg == TRUE){
require_once(e_HANDLER."tiny_mce/wysiwyg.php");
echo wysiwyg($e_wysiwyg);
define("e_WYSIWYG",TRUE);
}else{
define("e_WYSIWYG",FALSE);
}
echo "
\n";
$ns = new e107table;
$e107_var = array();
if (!function_exists('show_admin_menu')) {
function show_admin_menu($title, $active_page, $e107_vars, $js = FALSE, $sub_link = FALSE, $sortlist = FALSE) {
global $ns, $BUTTON, $BUTTON_OVER, $BUTTONS_START, $BUTTONS_END, $SUB_BUTTON, $SUB_BUTTON_OVER, $SUB_BUTTONS_START, $SUB_BUTTONS_END;
$id_title = "yop_".str_replace(" ", "", $title);
if (!isset($BUTTONS_START)) {
$BUTTONS_START = "\n";
}
if (!isset($BUTTON)) {
$BUTTON = " |
\n";
}
if (!isset($BUTTON_OVER)) {
$BUTTON_OVER = " |
\n";
}
if (!isset($BUTTONS_END)) {
$BUTTONS_END = "
\n";
}
if (!isset($SUB_BUTTON)) {
$SUB_BUTTON = "{LINK_TEXT}
";
}
if (!isset($SUB_BUTTON_OVER)) {
$SUB_BUTTON_OVER = " « {LINK_TEXT} »
";
}
if (!isset($SUB_BUTTONS_START)) {
$SUB_BUTTONS_START = "";
}
if ($sortlist == TRUE) {
$temp = $e107_vars;
unset($e107_vars);
foreach (array_keys($temp) as $key) {
$func_list[] = $temp[$key]['text'];
}
usort($func_list, 'strcoll');
foreach ($func_list as $func_text) {
foreach (array_keys($temp) as $key) {
if ($temp[$key]['text'] == $func_text) {
$e107_vars[] = $temp[$key];
}
}
}
}
$search[0] = "/\{LINK_TEXT\}(.*?)/si";
$search[1] = "/\{LINK_URL\}(.*?)/si";
$search[2] = "/\{ONCLICK\}(.*?)/si";
$search[3] = "/\{SUB_HEAD\}(.*?)/si";
$search[4] = "/\{SUB_HEAD_ID\}(.*?)/si";
if ($sub_link) {
$replace[0] = '';
$replace[1] = '';
$replace[2] = '';
$replace[3] = $title;
$replace[4] = $id_title;
$text = preg_replace($search, $replace, $SUB_BUTTONS_START);
} else {
$text = $BUTTONS_START;
}
foreach (array_keys($e107_vars) as $act) {
if (!isset($e107_vars[$act]['perm']) || !$e107_vars[$act]['perm'] || getperms($e107_vars[$act]['perm'])) {
if ($active_page == $act || (str_replace("?", "", e_PAGE.e_QUERY) == str_replace("?", "", $act))) {
$BUTTON_TEMPLATE = $sub_link ? $SUB_BUTTON_OVER : $BUTTON_OVER;
} else {
$BUTTON_TEMPLATE = $sub_link ? $SUB_BUTTON : $BUTTON;
}
$replace[0] = str_replace(" ", " ", $e107_vars[$act]['text']);
$replace[1] = $e107_vars[$act]['link'];
if ($e107_vars[$act]['include']!='') {
$replace[2] = $e107_vars[$act]['include'];
} else {
$replace[2] = $js ? "onclick=\"showhideit('".$act."');\"" : "onclick=\"document.location='".$e107_vars[$act]['link']."'; disabled=true;\"";
}
$replace[3] = $title;
$replace[4] = $id_title;
$text .= preg_replace($search, $replace, $BUTTON_TEMPLATE);
}
}
$text .= $sub_link ? $SUB_BUTTONS_END : $BUTTONS_END;
if ($title == "" || $sub_link) {
return $text;
} else {
$ns -> tablerender($title, $text, array('id' => $id_title, 'style' => 'button_menu'));
}
}
}
if (file_exists(THEME.'admin_template.php')) {
require_once(THEME.'admin_template.php');
} else {
require_once(e_BASE.$THEMES_DIRECTORY.'templates/admin_template.php');
}
if (!function_exists("parse_admin")) {
function parse_admin($ADMINLAYOUT) {
global $tp;
$adtmp = explode("\n", $ADMINLAYOUT);
for ($a = 0; $a < count($adtmp); $a++) {
if (preg_match("/{.+?}/", $adtmp[$a])) {
echo $tp->parseTemplate($adtmp[$a]);
} else {
echo $adtmp[$a];
}
}
}
}
function admin_update($update, $type = 'update', $success = false, $failed = false) {
global $ns;
if (($type == 'update' && $update) || ($type == 'insert' && $update !== false)) {
$caption = LAN_UPDATE;
$text = "".($success ? $success : LAN_UPDATED)."";
} else if ($type == 'delete' && $update) {
$caption = LAN_DELETE;
$text = "".($success ? $success : LAN_DELETED)."";
} else if (!mysql_errno()) {
if ($type == 'update') {
$caption = LAN_UPDATED_FAILED;
$text = "".LAN_NO_CHANGE."
".LAN_TRY_AGAIN."";
} else if ($type == 'delete') {
$caption = LAN_DELETE;
$text = "".LAN_DELETED_FAILED.".
".LAN_TRY_AGAIN."";
}
} else {
$caption = LAN_UPDATED_FAILED;
$text = "".($failed ? $failed : LAN_UPDATED_FAILED." - ".LAN_TRY_AGAIN)."
".LAN_ERROR." ".mysql_errno().": ".mysql_error();
}
$ns -> tablerender($caption, "".$text."
");
return $update;
}
function admin_purge_related($table, $id)
{
global $ns, $tp;
$msg = "";
$tp->parseTemplate("");
// Delete any related comments
require_once(e_HANDLER."comment_class.php");
$_com = new comment;
$num = $_com->delete_comments($table, $id);
if($num)
{
$msg .= $num." ".ADLAN_114." ".LAN_DELETED."
";
}
// Delete any related ratings
require_once(e_HANDLER."rate_class.php");
$_rate = new rater;
$num = $_rate->delete_ratings($table, $id);
if($num)
{
$msg .= LAN_RATING." ".LAN_DELETED."
";
}
if($msg)
{
$ns->tablerender(LAN_DELETE, $msg);
}
}
if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE) {
parse_admin($ADMIN_HEADER);
}
?>