1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Converted all admin_xxxx shortcodes to using batch shortcode file

This commit is contained in:
mcfly 2009-01-09 01:12:18 +00:00
parent feed586bcb
commit 4c4b378bd0
25 changed files with 1131 additions and 949 deletions

View File

@ -1,157 +0,0 @@
/*
* e107 website system (c) 2001-2008 Steve Dunstan (e107.org)
* $Id: admin_alt_nav.sc,v 1.7 2008-12-10 22:39:43 e107steved Exp $
*/
if (ADMIN)
{
global $sql, $pref, $tp;
parse_str($parm);
require(e_ADMIN.'ad_links.php');
require_once(e_HANDLER.'admin_handler.php');
function adnav_cat($cat_title, $cat_link, $cat_img, $cat_id=FALSE) {
$cat_link = ($cat_link ? $cat_link : "javascript:void(0);");
$text = "<a class='menuButton' href='".$cat_link."' style='background-image: url(".$cat_img."); background-repeat: no-repeat; background-position: 3px 1px' ";
if ($cat_id) {
$text .= "onclick=\"return buttonClick(event, '".$cat_id."');\" onmouseover=\"buttonMouseover(event, '".$cat_id."');\"";
}
$text .= ">".$cat_title."</a>";
return $text;
}
function adnav_main($cat_title, $cat_link, $cat_img, $cat_id=FALSE, $cat_highlight='') {
$text = "<a class='menuItem ".$cat_highlight."' href='".$cat_link."' ";
if ($cat_id) {
$text .= "onclick=\"return false;\" onmouseover=\"menuItemMouseover(event, '".$cat_id."');\"";
}
$text .= "><span class='menuItemBuffer'>".$cat_img."</span><span class='menuItemText'>".$cat_title."</span>";
if ($cat_id) {
$text .= "<span class=\"menuItemArrow\">&#9654;</span>";
}
$text .= "</a>";
return $text;
}
if (file_exists(THEME.'nav_menu.js')) {
$text = "<script type='text/javascript' src='".THEME_ABS."nav_menu.js'></script>";
} else {
$text = "<script type='text/javascript' src='".e_FILE_ABS."nav_menu.js'></script>";
}
$text .= "<div style='width: 100%'><table border='0' cellspacing='0' cellpadding='0' style='width: 100%'>
<tr><td>
<div class='menuBar' style='width: 100%'>";
$text .= adnav_cat(ADLAN_151, e_ADMIN.'admin.php', E_16_NAV_MAIN);
for ($i = 1; $i < 5; $i++)
{
$ad_tmpi = 0;
$ad_links_array = asortbyindex($array_functions, 1);
$nav_main = adnav_cat($admin_cat['title'][$i], '', $admin_cat['img'][$i], $admin_cat['id'][$i]);
$ad_texti = "<div id='".$admin_cat['id'][$i]."' class='menu' onmouseover=\"menuMouseover(event)\">";
while(list($key, $nav_extract) = each($ad_links_array))
{
if($nav_extract[4]==$i)
{
if(getperms($nav_extract[3]))
{
$ad_texti .= adnav_main($nav_extract[1], $nav_extract[0], $nav_extract[5]);
$ad_tmpi = 1;
}
}
}
$ad_texti .= "</div>";
if ($ad_tmpi == 1)
{
$text .= $nav_main;
$text .= $ad_texti;
}
}
$render_plugins = FALSE;
include_once(e_HANDLER.'plugin_class.php');
$plug = new e107plugin;
if($sql -> db_Select("plugin", "*", "plugin_installflag=1 ORDER BY plugin_path"))
{
while($row = $sql -> db_Fetch())
{
if(getperms('P'.$row['plugin_id']))
{
if($plug->parse_plugin($row['plugin_path']))
{
$plug_vars = $plug->plug_vars;
loadLanFiles($row['plugin_path'], 'admin');
if($plug_vars['administration']['configFile'])
{
$plug_vars['@attributes']['name'] = $tp->toHTML($plug_vars['@attributes']['name'], FALSE, "defs");
$icon_src = (isset($plug_vars['plugin_php']) ? e_PLUGIN_ABS : e_PLUGIN_ABS.$row['plugin_path'].'/') .$plug_vars['administration']['iconSmall'];
$plugin_icon = $plug_vars['administration']['iconSmall'] ? "<img src='{$icon_src}' alt='".$plug_vars['administration']['caption']."' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />" : E_16_PLUGIN;
$plugin_array[ucfirst($plug_vars['@attributes']['name'])] = adnav_main($plug_vars['@attributes']['name'], e_PLUGIN.$row['plugin_path']."/".$plug_vars['administration']['configFile'], $plugin_icon);
}
$render_plugins = TRUE;
$active_plugs = TRUE;
}
}
}
ksort($plugin_array, SORT_STRING);
$plugs_text = '';
foreach ($plugin_array as $plugin_compile)
{
$plugs_text .= $plugin_compile;
}
}
if (getperms('Z'))
{
$pclass_extended = $active_plugs ? 'header' : '';
$plugin_text = adnav_main(ADLAN_98, e_ADMIN.'plugin.php', E_16_PLUGMANAGER, FALSE, $pclass_extended);
$render_plugins = TRUE;
}
if ($render_plugins) {
$text .= adnav_cat(ADLAN_CL_7, '', E_16_CAT_PLUG, 'plugMenu');
$text .= "<div id='plugMenu' class='menu' onmouseover=\"menuMouseover(event)\">";
$text .= $plugin_text.$plugs_text;
$text .= "</div>";
}
$text .= adnav_cat(ADLAN_CL_8, '', E_16_NAV_DOCS, 'docsMenu');
$text .= "<div id='docsMenu' class='menu' onmouseover=\"menuMouseover(event)\">";
if (!$handle=opendir(e_DOCS.e_LANGUAGE."/"))
{
$handle=opendir(e_DOCS."English/");
}
$i=1;
while ($file = readdir($handle))
{
if ($file != "." && $file != ".." && $file != "CVS")
{
$text .= adnav_main(str_replace("_", " ", $file), e_ADMIN."docs.php?".$i, E_16_DOCS);
$i++;
}
}
closedir($handle);
$text .= "</div>";
$text .= "</div>
</td>";
if ($exit != 'off')
{
$text .= "<td style='width: 160px; white-space: nowrap'>
<div class='menuBar' style='width: 100%'>";
$text .= adnav_cat(ADLAN_53, e_BASE.'index.php', E_16_NAV_LEAV);
$text .= adnav_cat(ADLAN_46, e_ADMIN.'admin.php?logout', E_16_NAV_LGOT);
$text .= "</div>
</td>";
}
$text .= "</tr>
</table>
</div>";
return $text;
}

View File

@ -1,5 +0,0 @@
if (ADMIN) {
return "<div style='text-align: center'>
<input class='button' type='button' onclick=\"javascript: window.open('".e_ADMIN."credits.php', 'myWindow', 'status = 1, height = 400, width = 300, resizable = 0')\" value='".LAN_CREDITS."' />
</div>";
}

View File

@ -1,24 +0,0 @@
if(ADMIN){
global $ns;
$i=1;
if (!$handle=opendir(e_DOCS.e_LANGUAGE."/")) {
$handle=opendir(e_DOCS."English/");
}
while ($file = readdir($handle)){
if($file != "." && $file != ".." && $file != "CVS"){
$helplist[$i] = $file;
$i++;
}
}
closedir($handle);
unset($e107_var);
foreach ($helplist as $key => $value) {
$e107_var['x'.$key]['text'] = str_replace("_", " ", $value);
$e107_var['x'.$key]['link'] = e_ADMIN."docs.php?".$key;
}
$text = show_admin_menu(FOOTLAN_14, $act, $e107_var, FALSE, TRUE, TRUE);
return $ns -> tablerender(FOOTLAN_14,$text, array('id' => 'admin_docs', 'style' => 'button_menu'), TRUE);
}

View File

@ -1,36 +0,0 @@
if (!ADMIN) return '';
$helpfile = '';
global $ns, $pref; // Used by the help renderer
if(strpos(e_SELF, e_ADMIN_ABS) !== FALSE)
{
if (is_readable(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/".e_PAGE))
{
$helpfile = e_LANGUAGEDIR.e_LANGUAGE."/admin/help/".e_PAGE;
}
elseif (is_readable(e_LANGUAGEDIR."English/admin/help/".e_PAGE))
{
$helpfile = e_LANGUAGEDIR."English/admin/help/".e_PAGE;
}
}
else
{
$plugpath = getcwd()."/help.php"; // deprecated file. For backwards compat. only.
$eplugpath = getcwd()."/e_help.php";
if(is_readable($eplugpath))
{
$helpfile = $eplugpath;
}
elseif(is_readable($plugpath))
{
$helpfile = $plugpath;
}
}
if (!$helpfile) return '';
ob_start();
include_once($helpfile);
$help_text = ob_get_contents();
ob_end_clean();
return $help_text;

View File

@ -1,39 +0,0 @@
/*
* e107 website system (c) 2001-2008 Steve Dunstan (e107.org)
* $Id: admin_icon.sc,v 1.2 2008-08-25 13:34:45 e107steved Exp $
*/
if (ADMIN)
{
global $e_sub_cat, $e_icon_array, $PLUGINS_DIRECTORY;
if (strstr(e_SELF, $PLUGINS_DIRECTORY))
{
if (is_readable('plugin.xml'))
{
require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass;
$xml->filter = array('folder' => FALSE, 'administration' => FALSE); // Just need one variable
$readFile = $xml->loadXMLfile('plugin.xml', true, true);
$eplug_icon = $readFile['folder'].'/'.$readFile['administration']['icon'];
$eplug_folder = $readFile['folder'];
}
elseif (is_readable('plugin.php'))
{
include('plugin.php');
}
else
{
$icon = E_32_CAT_PLUG;
return $icon;
}
$icon = ($eplug_icon && file_exists(e_PLUGIN.$eplug_icon)) ? "<img src='".e_PLUGIN.$eplug_icon."' alt='' style='border:0px; width: 32px; height: 32px' />" : E_32_CAT_PLUG;
}
else
{
$icon = $e_icon_array[$e_sub_cat];
}
return $icon;
}
else
{
return E_32_LOGOUT;
}

View File

@ -1,135 +0,0 @@
/*
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: admin_lang.sc,v 1.5 2008-12-17 17:27:07 secretr Exp $
*
* Admin Language Shortcode
*
*/
if (!ADMIN || !$pref['multilanguage']) return '';
global $e107, $sql, $pref;
include_lan(e_PLUGIN."user_menu/languages/English.php");
$params = array();
parse_str($parm, $params);
$lanlist = explode(",",e_LANLIST);
sort($lanlist);
$text = '';
foreach($lanlist as $langval)
{
if (getperms($langval))
{
$lanperms[] = $langval;
}
}
require_once(e_HANDLER."language_class.php");
$slng = new language;
if(!getperms($sql->mySQLlanguage) && $lanperms)
{
$sql->mySQLlanguage = ($lanperms[0] != $pref['sitelanguage']) ? $lanperms[0] : "";
if ($pref['user_tracking'] == "session")
{
$_SESSION['e107language_'.$pref['cookie_name']] = $lanperms[0];
if($pref['multilanguage_subdomain']){
header("Location:".$slng->subdomainUrl($lanperms[0]));
}
}
else
{
setcookie('e107language_'.$pref['cookie_name'], $lanperms[0], time() + 86400);
$_COOKIE['e107language_'.$pref['cookie_name']]= $lanperms[0];
}
}
foreach($GLOBALS['mySQLtablelist'] as $tabs)
{
$clang = strtolower($sql->mySQLlanguage);
if(strpos($tabs,"lan_".$clang) && $clang !="")
{
$aff[] = str_replace(MPREFIX."lan_".$clang."_","",$tabs);
}
}
$text .= "<div><img src='".e_IMAGE_ABS."admin_images/language_16.png' alt='' />&nbsp;";
if(isset($aff))
{
$text .= $sql->mySQLlanguage;
$text .= " (".$slng->convert($sql->mySQLlanguage).")
: <span class='button' style='cursor: pointer;' onclick='expandit(\"lan_tables\");'><a style='text-decoration:none' title='' href=\"javascript:void(0);\" >&nbsp;&nbsp;".count($aff)." ".UTHEME_MENU_L3."&nbsp;&nbsp;</a></span><br />
<span style='display:none' id='lan_tables'>
";
$text .= implode("<br />",$aff);
$text .= "</span>";
}
elseif($sql->mySQLlanguage && ($sql->mySQLlanguage != $pref['sitelanguage']))
{
$text .= $sql->mySQLlanguage;
$text .= " (".$slng->convert($sql->mySQLlanguage)."): ".LAN_INACTIVE;
}
else
{
$text .= $pref['sitelanguage'];
}
$text .= "<br /><br /></div>";
$select = '';
if(isset($pref['multilanguage_subdomain']) && $pref['multilanguage_subdomain'])
{
$select .= "
<select class='tbox' name='lang_select' id='sitelanguage' onchange=\"location.href=this.options[selectedIndex].value\">";
foreach($lanperms as $lng)
{
$selected = ($lng == $sql->mySQLlanguage || ($lng == $pref['sitelanguage'] && !$sql->mySQLlanguage)) ? " selected='selected'" : "";
$urlval = $slng->subdomainUrl($lng);
$select .= "<option value='".$urlval."'{$selected}>$lng</option>\n";
}
$select .= "</select>";
}
elseif(isset($params['nobutton']))
{
$select .= "
<form method='post' action='".e_SELF.(e_QUERY ? "?".e_QUERY : "")."'>
<div>
<select name='sitelanguage' id='sitelanguage' class='tbox' onchange=\"location.href=this.options[selectedIndex].value\">";
foreach($lanperms as $lng)
{
$langval = e_SELF.'?['.$slng->convert($lng).']'.e_QUERY;
$selected = ($lng == $sql->mySQLlanguage || ($lng == $pref['sitelanguage'] && !$sql->mySQLlanguage)) ? " selected='selected'" : "";
$select .= "<option value='".$langval."'{$selected}>$lng</option>\n";
}
$select .= "</select>
</div>
</form>
";
}
else
{
$select .= "
<form method='post' action='".e_SELF.(e_QUERY ? "?".e_QUERY : "")."'>
<div>
<select name='sitelanguage' id='sitelanguage' class='tbox'>";
foreach($lanperms as $lng)
{
$langval = ($lng == $pref['sitelanguage'] && $lng == 'English') ? "" : $lng;
$selected = ($lng == $sql->mySQLlanguage || ($lng == $pref['sitelanguage'] && !$sql->mySQLlanguage)) ? " selected='selected'" : "";
$select .= "<option value='".$langval."'{$selected}>$lng</option>\n";
}
$select .= "</select> ".(!isset($params['nobutton']) ? "<button class='update' type='submit' name='setlanguage' value='".UTHEME_MENU_L1."'><span>".UTHEME_MENU_L1."</span></button>" : '')."
</div>
</form>
";
}
if(isset($params['nomenu'])) return $select;
if($select) $text .= "<div class='center'>{$select}</div>";
return $e107->ns->tablerender(UTHEME_MENU_L2, $text, '', TRUE);

View File

@ -1,44 +0,0 @@
if (ADMIN) {
if (!function_exists('admin_latest')) {
function admin_latest() {
global $sql, $ns, $pref;
$active_uploads = $sql -> db_Count("upload", "(*)", "WHERE upload_active = '0' ");
$submitted_news = $sql -> db_Count("submitnews", "(*)", "WHERE submitnews_auth = '0' ");
$text = "<div style='padding-bottom: 2px;'>".E_16_NEWS.($submitted_news ? " <a href='".e_ADMIN."newspost.php?sn'>".ADLAN_LAT_2.": $submitted_news</a>" : " ".ADLAN_LAT_2.": 0")."</div>";
$text .= "<div style='padding-bottom: 2px;'>".E_16_UPLOADS.($active_uploads ? " <a href='".e_ADMIN."upload.php'>".ADLAN_LAT_7.": $active_uploads</a>" : " ".ADLAN_LAT_7.": ".$active_uploads)."</div>";
foreach($pref['e_latest_list'] as $val)
{
if (is_readable(e_PLUGIN.$val."/e_latest.php"))
{
include_once(e_PLUGIN.$val."/e_latest.php");
}
}
$messageTypes = array("Broken Download", "Dev Team Message");
$queryString = "";
foreach($messageTypes as $types) {
$queryString .= " gen_type='$types' OR";
}
$queryString = substr($queryString, 0, -3);
if($amount = $sql -> db_Select("generic", "*", $queryString)) {
$text .= "<br /><b><a href='".e_ADMIN."message.php'>".ADLAN_LAT_8." [".$amount."]</a></b>";
}
return $ns -> tablerender(ADLAN_LAT_1, $text, '', TRUE);
}
}
if ($parm == 'request') {
if (function_exists('latest_request')) {
if (latest_request()) {
return admin_latest();
}
}
} else {
return admin_latest();
}
}

View File

@ -1,41 +0,0 @@
if (getperms('0'))
{
if (!function_exists('admin_log')) {
function admin_log() {
global $sql, $ns;
$text = E_16_ADMINLOG." <a style='cursor: pointer' onclick=\"expandit('adminlog')\">".ADLAN_116."</a>\n";
if (e_QUERY == "logall") {
$text .= "<div id='adminlog'>";
$cnt = $sql -> db_Select("dblog", "*", "ORDER BY `dblog_datestamp` DESC", "no_where");
} else {
$text .= "<div style='display: none;' id='adminlog'>";
$cnt = $sql -> db_Select("dblog", "*", "ORDER BY `dblog_datestamp` DESC LIMIT 0,10", "no_where");
}
$text .= ($cnt) ? "<ul>" : "";
$gen = new convert;
while ($row = $sql -> db_Fetch()) {
$datestamp = $gen->convert_date($row['dblog_datestamp'], 'short');
$text .= "<li>{$datestamp} - {$row['dblog_title']}</li>";
}
$text .= ($cnt ? "</ul>" : "");
$text .= "[ <a href='".e_ADMIN."admin_log.php?adminlog'>".ADLAN_117."</a> ]";
$text .= "<br />[ <a href='".e_ADMIN."admin_log.php?config'>".ADLAN_118."</a> ]";
// $text .= "<br />[ <a href='".e_ADMIN."admin_log.php?purge' onclick=\"return jsconfirm('".LAN_CONFIRMDEL."')\">".ADLAN_118."</a> ]\n";
$text .= "</div>";
return $ns -> tablerender(ADLAN_135, $text, '', TRUE);
}
}
if ($parm == 'request') {
if (function_exists('log_request')) {
if (log_request()) {
return admin_log();
}
}
} else {
return admin_log();
}
}

View File

@ -1,10 +0,0 @@
if (ADMIN) {
$str = str_replace(".", "", ADMINPERMS);
if (ADMINPERMS == "0") {
return "<b>".ADLAN_48.":</b> ".ADMINNAME." (".ADLAN_49.") ".( defined('e_DBLANGUAGE') ? "<b>".LAN_head_5."</b> ".e_DBLANGUAGE : "" ) ;
} else {
return "<b>".ADLAN_48.":</b> ".ADMINNAME." ".( defined('e_DBLANGUAGE') ? "<b>".LAN_head_5."</b> ".e_DBLANGUAGE : "" ) ;
}
} else {
return ADLAN_51." ...";
}

View File

@ -1,33 +0,0 @@
parse_str($parm);
if (isset($file) && $file && is_readable($file))
{
$logo = $file;
$path = $file;
}
else if (is_readable(THEME."images/e_adminlogo.png"))
{
$logo = THEME_ABS."images/e_adminlogo.png";
$path = THEME."images/e_adminlogo.png";
}
else
{
$logo = e_IMAGE."adminlogo.png";
$path = $logo;
}
$dimensions = getimagesize($path);
$image = "<img class='logo admin_logo' src='".$logo."' style='width: ".$dimensions[0]."px; height: ".$dimensions[1]."px' alt='".ADLAN_153."' />\n";
if (isset($link) && $link) {
if ($link == 'index') {
$image = "<a href='".e_ADMIN."index.php'>".$image."</a>";
}
else
{
$image = "<a href='".$link."'>".$image."</a>";
}
}
return $image;

View File

@ -1,28 +0,0 @@
if (ADMIN) {
global $ns, $pref;
ob_start();
//Show upper_right menu if the function exists
$tmp = explode(".",e_PAGE);
$adminmenu_func = $tmp[0]."_adminmenu";
if(function_exists($adminmenu_func)){
if (!$parm) {
call_user_func($adminmenu_func,$adminmenu_parms);
} else {
ob_end_clean();
return 'pre';
}
}
$plugindir = (str_replace("/","",str_replace("..","",e_PLUGIN))."/");
$plugpath = e_PLUGIN.str_replace(basename(e_SELF),"",str_replace($plugindir,"",strstr(e_SELF,$plugindir)))."admin_menu.php";
if(file_exists($plugpath)){
if (!$parm) {
@require_once($plugpath);
} else {
ob_end_clean();
return 'pre';
}
}
$ret = ob_get_contents();
ob_end_clean();
return $ret;
}

View File

@ -1,15 +0,0 @@
if (ADMIN) {
global $ns;
ob_start();
if(!FILE_UPLOADS){
echo message_handler("ADMIN_MESSAGE", LAN_head_2, __LINE__, __FILE__);
}
/*
if(OPEN_BASEDIR){
echo message_handler("ADMIN_MESSAGE", LAN_head_3, __LINE__, __FILE__);
}
*/
$message_text = ob_get_contents();
ob_end_clean();
return $message_text;
}

View File

@ -1,94 +0,0 @@
/*
* e107 website system (c) 2001-2008 Steve Dunstan (e107.org)
* $Id: admin_nav.sc,v 1.8 2008-12-19 14:01:07 secretr Exp $
*/
if (ADMIN)
{
global $ns, $pref, $array_functions, $tp;
$e107_var = array();
if (strstr(e_SELF, "/admin.php"))
{
$active_page = 'x';
}
else
{
$active_page = time();
}
$e107_var['x']['text'] = ADLAN_52;
$e107_var['x']['link'] = e_ADMIN.'admin.php';
$e107_var['y']['text'] = ADLAN_53;
$e107_var['y']['link'] = e_BASE."index.php";
//$text .= show_admin_menu("",$active_page,$e107_var);
$e107_var['afuncs']['text'] = ADLAN_93;
$e107_var['afuncs']['link'] = '';
/* SUBLINKS */
$tmp = array();
foreach ($array_functions as $links_key => $links_value)
{
$tmp[$links_key]['text'] = $links_value[1];
$tmp[$links_key]['link'] = $links_value[0];
}
$e107_var['afuncs']['sub'] = $tmp;
/* SUBLINKS END */
// Plugin links menu
require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass; // We're going to have some plugins with plugin.xml files, surely? So create XML object now
$xml->filter = array('@attributes' => FALSE, 'administration' => FALSE); // .. and they're all going to need the same filter
$nav_sql = new db;
if ($nav_sql -> db_Select("plugin", "*", "plugin_installflag=1"))
{
$tmp = array();
$e107_var['plugm']['text'] = ADLAN_95;
$e107_var['plugm']['link'] = '';
/* SUBLINKS */
//Link Plugin Manager
$tmp['plugm']['text'] = "<strong>".ADLAN_98."</strong>";
$tmp['plugm']['link'] = e_ADMIN."plugin.php";
$tmp['plugm']['perm'] = "P";
while($rowplug = $nav_sql -> db_Fetch())
{
$plugin_id = $rowplug['plugin_id'];
$plugin_path = $rowplug['plugin_path'];
if (is_readable(e_PLUGIN.$plugin_path."/plugin.xml"))
{
$readFile = $xml->loadXMLfile(e_PLUGIN.$plugin_path.'/plugin.xml', true, true);
loadLanFiles($plugin_path, 'admin');
$eplug_caption = $tp->toHTML($readFile['@attributes']['name'],FALSE,"defs, emotes_off");
$eplug_conffile = $readFile['administration']['configFile'];
}
elseif (is_readable(e_PLUGIN.$plugin_path."/plugin.php"))
{
include(e_PLUGIN.$plugin_path."/plugin.php");
}
// Links Plugins
if ($eplug_conffile)
{
$tmp['plug_'.$plugin_id]['text'] = $eplug_caption;
$tmp['plug_'.$plugin_id]['link'] = e_PLUGIN.$plugin_path."/".$eplug_conffile;
$tmp['plug_'.$plugin_id]['perm'] = "P".$plugin_id;
}
unset($eplug_conffile, $eplug_name, $eplug_caption);
}
$e107_var['plugm']['sub'] = $tmp;
$e107_var['plugm']['sort'] = true;
/* SUBLINKS END */
//$text .= show_admin_menu(ADLAN_95, time(), $e107_var, FALSE, TRUE, TRUE);
unset($tmp);
}
$e107_var['lout']['text']=ADLAN_46;
$e107_var['lout']['link']=e_ADMIN."admin.php?logout";
$text = e_admin_menu('', '', $e107_var);
return $ns -> tablerender(LAN_head_1, $text, array('id' => 'admin_nav', 'style' => 'button_menu'), TRUE);
}

View File

@ -1,52 +0,0 @@
/*
* e107 website system (c) 2001-2008 Steve Dunstan (e107.org)
* $Id: admin_plugins.sc,v 1.3 2008-08-25 13:34:45 e107steved Exp $
*/
if (ADMIN)
{
global $e107_plug, $ns, $pref;
if ($pref['admin_alerts_ok'] == 1)
{
ob_start();
$text = "";
$i = 0;
if (strstr(e_SELF, "/admin.php")) {
global $sql;
if ($sql -> db_Select("plugin", "*", "plugin_installflag=1")) {
while($rowplug = $sql -> db_Fetch()){
extract($rowplug);
$e107_plug[$rowplug[1]] = $rowplug[3];
}
}
}
if (is_array($e107_plug)) {
foreach(array_keys($e107_plug) as $xplug){
if (file_exists(e_PLUGIN.$e107_plug[$xplug]."/admin_info.php")) {
if ($pref['admin_alerts_uniquemenu'] == 1) {
$text .= "<b>".$xplug."</b><br />";
} else {
$text = "";
}
require_once(e_PLUGIN.$e107_plug[$xplug]."/admin_info.php");
$text .= "<br />";
if ($pref['admin_alerts_uniquemenu'] != 1) {
$caption = $xplug;
$ns -> tablerender($caption, $text);
} else {
$text .= "<br />";
}
$i++;
}
}
}
$caption = LAN_head_6;
if ($i>0 && $pref['admin_alerts_uniquemenu'] == 1) {
$ns -> tablerender($caption, $text);
}
$plug_text = ob_get_contents();
ob_end_clean();
return $plug_text;
}
}

View File

@ -1,39 +0,0 @@
if(ADMIN && getperms("0"))
{
global $sql,$pst,$ns,$tp,$e_wysiwyg,$pref;
if(isset($pst) && $pst->form && $pst->page){
$thispage = urlencode(e_SELF."?".e_QUERY);
if(is_array($pst->page)){
for ($i=0; $i<count($pst->page); $i++) {
if (strpos($thispage, urlencode($pst->page[$i])) !== FALSE){
$query = urlencode($pst->page[$i]);
$theform = $pst->form[$i];
$pid = $i;
}
}
}else{
$query = urlencode($pst->page);
$theform = $pst->form;
$pid = 0;
}
$existing = is_array($pst->id) ? $pst->id[$pid] : $pst->id;
$trigger = ($e_wysiwyg && $pref['wysiwyg']) ? "tinyMCE.triggerSave();" : "";
if (strpos($thispage, $query) !== FALSE) {
$pst_text = "
<form method='post' action='".e_SELF."?clr_preset' id='e_preset' >
<div style='text-align:center'>";
if(!$sql->db_Count("preset", "(*)", " WHERE preset_name='".$tp -> toDB($existing, true)."' ")){
$pst_text .= "<input type='button' class='button' name='save_preset' value='".LAN_SAVE."' onclick=\"$trigger savepreset('".$theform."',$pid)\" />";
}else{
$pst_text .= "<input type='button' class='button' name='save_preset' value='".LAN_UPDATE."' onclick=\"$trigger savepreset('".$theform."',$pid)\" />";
$pst_text .= "<input type='hidden' name='del_id' value='$pid' />
<input type='submit' class='button' name='delete_preset' value='".LAN_DELETE."' onclick=\"return jsconfirm('".$tp->toJS(LAN_PRESET_CONFIRMDEL." [".$existing."]")."')\" />";
}
$pst_text .= "</div></form>";
return $ns -> tablerender(LAN_PRESET, $pst_text, '', TRUE);
}
}
}

View File

@ -1,7 +0,0 @@
if (ADMIN && ADMINPERMS == "0") {
global $ns;
if ($pref['adminpwordchange'] && ((ADMINPWCHANGE+2592000) < time())) {
$text = "<div style='mediumtext; text-align:center'>".ADLAN_102." <a href='".e_ADMIN."updateadmin.php'>".ADLAN_103."</a></div>";
return $ns -> tablerender(ADLAN_104, $text, '', TRUE);
}
}

View File

@ -1,8 +0,0 @@
if (ADMIN) {
if ($pref['multilanguage']) {
global $sql;
$ret = " <b>".ADLAN_132.":</b> ";
$ret .= ($sql->mySQLlanguage) ? $sql->mySQLlanguage : ADLAN_133;
return $ret;
}
}

View File

@ -1,65 +0,0 @@
if (ADMIN) {
global $sql, $ns, $pref, $themename, $themeversion, $themeauthor, $themedate, $themeinfo, $mySQLdefaultdb;
if (!isset($pref['install_date'])) {
$sql -> db_Select("core", "*", "e107_name='e107' ");
$row = $sql -> db_Fetch();
$coreinfo = unserialize($row['e107_value']);
$pref['install_date'] = $coreinfo['e107_datestamp'];
save_prefs();
$sql -> db_Delete("core", "e107_name='e107'");
}
if (file_exists(e_ADMIN."ver.php"))
{
include(e_ADMIN."ver.php");
}
$obj = new convert;
$install_date = $obj->convert_date($pref['install_date'], "long");
$text = "<b>".FOOTLAN_1."</b>
<br />".
SITENAME."
<br /><br />
<b>".FOOTLAN_2."</b>
<br />
<a href=\"mailto:".SITEADMINEMAIL."\">".SITEADMIN."</a>
<br />
<br />
<b>e107</b>
<br />
".FOOTLAN_3." ".$e107info['e107_version']."
<br /><br />
<b>".FOOTLAN_18."</b>
<br />".$pref['sitetheme']."<br /><br />
<b>".FOOTLAN_5."</b>
<br />
".$themename." v".$themeversion." ".($themeauthor ? FOOTLAN_6.' '.$themeauthor : '')." ".($themedate ? "(".$themedate.")" : "");
$text .= $themeinfo ? "<br />".FOOTLAN_7.": ".$themeinfo : "";
$text .= "<br /><br />
<b>".FOOTLAN_8."</b>
<br />
".$install_date."
<br /><br />
<b>".FOOTLAN_9."</b>
<br />".
preg_replace("/PHP.*/i", "", $_SERVER['SERVER_SOFTWARE'])."<br />(".FOOTLAN_10.": ".$_SERVER['SERVER_NAME'].")
<br /><br />
<b>".FOOTLAN_11."</b>
<br />
".phpversion()."
<br /><br />
<b>".FOOTLAN_12."</b>
<br />
".mysql_get_server_info().
"<br />
".FOOTLAN_16.": ".$mySQLdefaultdb."
<br /><br />
<b>".FOOTLAN_17."</b>
<br />".CHARSET;
return $ns -> tablerender(FOOTLAN_13, $text, '', TRUE);
}

View File

@ -1,45 +0,0 @@
if (getperms('0') || getperms('4'))
{
if (!function_exists('admin_status')) {
function admin_status() {
global $sql, $ns, $pref, $imode;
$members = $sql -> db_Count("user");
$unverified = $sql -> db_Count("user", "(*)", "WHERE user_ban=2");
$banned = $sql -> db_Count("user", "(*)", "WHERE user_ban=1");
$comments = $sql -> db_Count("comments");
$unver = ($unverified ? " <a href='".e_ADMIN."users.php?unverified'>".ADLAN_111."</a>" : ADLAN_111);
$text = "<div style='padding-bottom: 2px;'>".E_16_USER." ".ADLAN_110.": ".$members."</div>";
$text .= "<div style='padding-bottom: 2px;'>".E_16_USER." {$unver}: ".$unverified."</div>";
$text .= "<div style='padding-bottom: 2px;'>".E_16_BANLIST." ".ADLAN_112.": ".$banned."</div>";
$text .= "<div style='padding-bottom: 2px;'>".E_16_COMMENT." ".ADLAN_114.": ".$comments."</div>";
foreach($pref['e_status_list'] as $val)
{
if (is_readable(e_PLUGIN.$val."/e_status.php"))
{
include_once(e_PLUGIN.$val."/e_status.php");
}
}
if($flo = $sql -> db_Count("generic", "(*)", "WHERE gen_type='failed_login'"))
{
$text .= "<img src='".e_IMAGE."packs/".$imode."/admin_images/failedlogin_16.png' alt='' style='vertical-align: middle;' /> <a href='".e_ADMIN."fla.php'>".ADLAN_146.": $flo</a>";
}
return $ns -> tablerender(ADLAN_134, $text, '', TRUE);
}
}
if ($parm == 'request') {
if (function_exists('status_request')) {
if (status_request()) {
return admin_status();
}
}
} else {
return admin_status();
}
}

View File

@ -1,59 +0,0 @@
// $Id: admin_update.sc,v 1.7 2008-03-16 16:09:07 asperon Exp $
if (!ADMIN) return "";
global $e107cache,$ns, $pref;
if (!varset($pref['check_updates'], FALSE)) return "";
if (is_readable(e_ADMIN."ver.php"))
{
include(e_ADMIN."ver.php");
}
$feed = "http://sourceforge.net/export/rss2_projfiles.php?group_id=63748&rss_limit=5";
$e107cache->CachePageMD5 = md5($e107info['e107_version']);
if($cacheData = $e107cache->retrieve("updatecheck",3600, TRUE))
{
return $ns -> tablerender(LAN_NEWVERSION, $cacheData);
}
// Don't check for updates if running locally (comment out the next line to allow check - but
// remember it can cause delays/errors if its not possible to access the Internet
if ((strpos(e_SELF,'localhost') !== FALSE) || (strpos(e_SELF,'127.0.0.1') !== FALSE)) return '';
require_once(e_HANDLER."xml_class.php");
$xml = new xmlClass;
require_once(e_HANDLER."magpie_rss.php");
$ftext = "";
if($rawData = $xml -> getRemoteFile($feed))
{
$rss = new MagpieRSS( $rawData );
list($cur_version,$tag) = explode(" ",$e107info['e107_version']);
$c = 0;
foreach($rss->items as $val)
{
$search = array((strstr($val['title'],"(")),"e107","released"," v");
$version = trim(str_replace($search,"",$val['title']));
if(version_compare($version,$cur_version)==1)
{
$ftext = "<a rel='external' href='".$val['link']."' >e107 v".$version."</a><br />\n";
break;
}
$c++;
}
}
else
{ // Error getting data
$ftext = ADLAN_154;
}
$e107cache->set("updatecheck", $ftext, TRUE);
if($ftext)
{
return $ns -> tablerender(LAN_NEWVERSION, $ftext);
}

View File

@ -1,4 +0,0 @@
if (isset($_COOKIE['userlan']) && $_COOKIE['userlan']) {
return " <b>Language:</b> ".$_COOKIE['userlan'];
}

View File

@ -0,0 +1,35 @@
<?php
/*
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: admin_shortcodes.php,v 1.1 2009-01-09 01:12:17 mcfly_e107 Exp $
*
* Admin shortcode batch - registration
*/
if (!defined('e107_INIT')) { exit; }
$codes = array(
'admin_alt_nav',
'admin_credits',
'admin_docs',
'admin_help',
'admin_icon',
'admin_lang',
'admin_latest',
'admin_log',
'admin_logged',
'admin_logo',
'admin_menu',
'admin_msg',
'admin_nav',
'admin_plugins',
'admin_preset',
'admin_pword',
'admin_sel_lan',
'admin_siteinfo',
'admin_status',
'admin_update',
'admin_userlan',
);
register_shortcode('admin_shortcodes', $codes, e_FILE.'shortcode/batch/admin_shortcodes_class.php');
?>

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,11 @@
<?php <?php
/* /*
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt) * Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: siteinfo_shortcodes.php,v 1.1 2009-01-08 21:47:44 mcfly_e107 Exp $ * $Id: siteinfo_shortcodes.php,v 1.2 2009-01-09 01:12:17 mcfly_e107 Exp $
* *
* News shortcode batch * Siteinfo shortcode batch
*/ */
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
//include_once(e_HANDLER.'shortcode_handler.php');
$codes = array('sitebutton', 'sitedisclaimer', 'sitename', 'sitedescription', 'sitetag'); $codes = array('sitebutton', 'sitedisclaimer', 'sitename', 'sitedescription', 'sitetag');
register_shortcode('siteinfo_shortcodes', $codes); register_shortcode('siteinfo_shortcodes', $codes);

View File

@ -12,8 +12,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/shortcode_handler.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/shortcode_handler.php,v $
| $Revision: 1.18 $ | $Revision: 1.19 $
| $Date: 2009-01-08 21:47:44 $ | $Date: 2009-01-09 01:12:18 $
| $Author: mcfly_e107 $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@ -97,12 +97,11 @@ class e_shortcode
} }
} }
} }
} }
function loadCoreShortcodes() function loadCoreShortcodes()
{ {
$coreBatchList = array('siteinfo_shortcodes.php'); $coreBatchList = array('siteinfo_shortcodes.php', 'admin_shortcodes.php');
foreach($coreBatchList as $cb) foreach($coreBatchList as $cb)
{ {
include_once(e_FILE.'shortcode/batch/'.$cb); include_once(e_FILE.'shortcode/batch/'.$cb);
@ -201,7 +200,7 @@ class e_shortcode
{ {
if(!class_exists($_class) && $this->registered_codes[$code]['path']) if(!class_exists($_class) && $this->registered_codes[$code]['path'])
{ {
include_once($this->registered_codes[$code]['path'].$_class.'.php'); include_once($this->registered_codes[$code]['path']);
} }
$this->scClasses[$_class] = new $_class; $this->scClasses[$_class] = new $_class;
} }
@ -261,7 +260,7 @@ class e_shortcode
if (!isset($scCode)) if (!isset($scCode))
{ {
if(E107_DBG_BBSC) trigger_error('shortcode not found:{'.$code.'}', E_USER_ERROR); if(E107_DBG_BBSC) { trigger_error('shortcode not found:{'.$code.'}', E_USER_ERROR); }
return $matches[0]; return $matches[0];
} }