📄 display.php
字号:
foreach($var_value['options'] as $name_of_var => $value_of_var)
{
$row .= "<option value='{$value_of_var}'" . ($var_value['selected'] == $name_of_var ? "selected" : "")
. ">{$name_of_var}</option>\n";
}
$row .= "</select></td>\n";
break;
}
// close row
$row .= "</tr>\n";
// close table
$row .= "</table>\n</td>\n</tr>";
return $row;
}
/* ------------------------------------------------------------------ */
// Construct Output of particular format
/* ------------------------------------------------------------------ */
function constructOutput($output, $indent=0)
{
return "<div style='margin-left:{$indent}; font-family: verdana, sans-serif; font-size: 10pt;'>" . $output . "</div>";
}
/* ------------------------------------------------------------------ */
// Construct start of form
/* ------------------------------------------------------------------ */
function constructStartForm($page, $name="adminpanelForm", $method="POST", $url=null, $preSubmitAction=null)
{
if (!empty($preSubmitAction))
$preSubmitAction = " onSubmit='" . $preSubmitAction . "'";
if (empty($url))
$url = basename($_SERVER['PHP_SELF']);
return "<form name='{$name}' action='{$url}' method='{$method}'{$preSubmitAction}>\n"
. "<input type='hidden' name='page' value='{$page}'>\n";
}
/* ------------------------------------------------------------------ */
// Construct end of form with buttons
/* ------------------------------------------------------------------ */
function constructEndForm($submitButton = "Submit", $resetButton = "")
{
if (!empty($submitButton))
$subBut = "<input type='submit' value='{$submitButton}'>\n";
if (!empty($resetButton))
$resBut = "<input type='reset' value='{$resetButton}'>\n";
return "{$subBut} {$resBut}</form>\n";
}
/* ------------------------------------------------------------------ */
// Displays page in one easy function so you don't have to call each
// function individually. Adds menu if not present.
/* ------------------------------------------------------------------ */
function displayPage($content, $title = NULL, $menu = NULL, $header_extra = "", $footer_extra = "")
{
// If menu, assign.
if (!empty($menu))
$this->MENU = $menu;
// if title, assign to obj
if (!empty($title))
$this->defaults['title_text'] = $title ;
// Continue to construct page.
$this->show_Header($header_extra);
$this->show_Content($content);
$this->show_Footer($footer_extra);
}
}
/* ------------------------------------------------------------------ */
// EP-Dev Whois Admin Menu Class
// Contains all menu construction and display related functions
/* ------------------------------------------------------------------ */
class EP_Dev_Whois_Admin_Menu_Bar
{
/* ------------------------------------------------------------------ */
// Our constructor loads up default stuff.
/* ------------------------------------------------------------------ */
function EP_Dev_Whois_Admin_Menu_Bar()
{
// nada
}
/* ------------------------------------------------------------------ */
// Add Item to Menu
/* ------------------------------------------------------------------ */
function add($text, $url = "", $menu_id = 1)
{
// Add on text part to MenuData
$this->MenuData[$menu_id]['item'][count($this->MenuData[$menu_id]['item'])] = $text;
// Add on url part to MenuData
$this->MenuData[$menu_id]['url'][count($this->MenuData[$menu_id]['url'])] = $url;
}
/* ------------------------------------------------------------------ */
// Remove item from menu
/* ------------------------------------------------------------------ */
function remove($key = false, $text = false, $url = false, $menu_id = 1)
{
// Check if searching by text
if ($text)
{
$key = array_search($text, $this->MenuData[$menu_id]['item']);
}
// Check if searching by url
if ($url)
{
$key = array_search($url, $this->MenuData[$menu_id]['url']);
}
// remove key
if ($key !== false)
{
unset($this->MenuData[$menu_id]['item'][$key]);
unset($this->MenuData[$menu_id]['url'][$key]);
}
}
/* ------------------------------------------------------------------ */
// Remove all menus
/* ------------------------------------------------------------------ */
function remove_all()
{
// Remove all menus
unset($this->MenuData);
}
/* ------------------------------------------------------------------ */
// Display Menu
/* ------------------------------------------------------------------ */
function show($menu_id = 0)
{
if ($this->available())
{
// Do a loop to display either all ids (if menu_id = 0), or one id ($menu_id).
for ($i = ($menu_id ? $menu_id : 1); $i < ($menu_id ? ($menu_id + 1) : (count($this->MenuData)+1)); $i++)
{
?>
<div style="width: 150px;"><img src="images/body-menu-top.png"></div>
<div style="background: #EDEDED url('images/body-menu-mid-bg.png') repeat-y; text-align: left; width: 150px;"><div style="margin-left: 5px;"><?
// Cycle through all entries for this menu.
for ($j=0; $j < count($this->MenuData[$i]['item']); $j++)
{
// If a url for item exists, then make item a link
if (!empty($this->MenuData[$i]['url'][$j]))
{
echo "- <a href=\"".$this->MenuData[$i]['url'][$j]."\">".$this->MenuData[$i]['item'][$j]."</a>";
}
// Else make it a Menu Header / Category
else
{
echo $this->MenuData[$i]['item'][$j];
}
echo "<br>";
}
?></div></div>
<div style="width: 150px;"><img src="images/body-menu-bottom.png"></div><br>
<?
}
}
}
/* ------------------------------------------------------------------ */
// Create blank menu
/* ------------------------------------------------------------------ */
function blank($title = "Login")
{
// Remove all other menus
$this->remove_all();
// Make custom menu
//$this->add($title, "");
}
/* ------------------------------------------------------------------ */
// Check if any menu available
/* ------------------------------------------------------------------ */
function available()
{
return (!empty($this->MenuData));
}
}
/* ------------------------------------------------------------------ */
// EP-Dev Whois Admin Error Handle Class
// Contains all error output related functions.
/* ------------------------------------------------------------------ */
class EP_Dev_Whois_Admin_Error_Handle
{
/* ------------------------------------------------------------------ */
// Stop with $code
// Dies with error ouput
/* ------------------------------------------------------------------ */
function stop($code)
{
$this->kill($this->go($code));
}
/* ------------------------------------------------------------------ */
// Go $code
// Returns textual error based on $code
/* ------------------------------------------------------------------ */
function go($code, $extra = NULL)
{
switch ($code)
{
case "mysql_connect_error" :
$return = "Error connecting to mysql database with username and password specified.";
break;
case "mysql_db_error" :
$return = "Error connecting to specified database name.";
break;
case "invalid_number" :
$return = "ERROR: Invalid number specified for " . $extra;
break;
case "invalid_bool" :
$return = "ERROR: Invalid value specified for " . $extra;
break;
case "bad_permissions" :
$return = "ERROR: Could not open or write to file the new settings. Check file permissions section of trouble shooting.";
break;
case "bad_login" :
$return = "Please enter correct username and password!";
break;
case "panel_disabled" :
$return = "The administration panel has been disabled from within the configuration file.";
break;
case "nameserver_exists" :
$return = "The nameserver specified already exists! Please use the edit nameservers page to modify it.";
break;
case "bad_nameserver" :
$return = "You did not specify an address for this nameserver.";
break;
default : $return = "An unknown error occurred!";
}
return $return;
}
/* ------------------------------------------------------------------ */
// Kill with $error
// dies with textual $error
/* ------------------------------------------------------------------ */
function kill($error)
{
// new display obj
$display = new EP_Dev_Whois_Admin_Display("ERROR");
// display page
$display->displayPage($error, "ERROR -- " . $error);
die();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -