Vergleich admin/inc/class_page.php - 1.6.3 - 1.6.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: class_page.php 5380 2011-02-21 12:04:43Z Tomm $

 * $Id$

 */

/*

 */

/*

Zeile 54Zeile 54
	 * @var string Any additional information to add between the <head> tags.
*/
public $extra_header = "";

	 * @var string Any additional information to add between the <head> tags.
*/
public $extra_header = "";

 

/**
* @var string Show a post verify error
*/
public $show_post_verify_error = '';


/**
* Output the page header.


/**
* Output the page header.

Zeile 119Zeile 124
		echo "<body>\n";
echo "<div id=\"container\">\n";
echo " <div id=\"logo\"><h1><span class=\"invisible\">{$lang->mybb_admin_cp}</span></h1></div>\n";

		echo "<body>\n";
echo "<div id=\"container\">\n";
echo " <div id=\"logo\"><h1><span class=\"invisible\">{$lang->mybb_admin_cp}</span></h1></div>\n";

		echo "	<div id=\"welcome\"><span class=\"logged_in_as\">{$lang->logged_in_as} <a href=\"index.php?module=user-users&amp;action=edit&amp;uid={$mybb->user['uid']}\" class=\"username\">{$mybb->user['username']}</a></span> | <a href=\"{$mybb->settings['bburl']}\" target=\"_blank\" class=\"forum\">{$lang->view_board}</a> | <a href=\"index.php?action=logout\" class=\"logout\">{$lang->logout}</a></div>\n";

		echo "	<div id=\"welcome\"><span class=\"logged_in_as\">{$lang->logged_in_as} <a href=\"index.php?module=user-users&amp;action=edit&amp;uid={$mybb->user['uid']}\" class=\"username\">{$mybb->user['username']}</a></span> | <a href=\"{$mybb->settings['bburl']}\" target=\"_blank\" class=\"forum\">{$lang->view_board}</a> | <a href=\"index.php?action=logout&amp;my_post_key={$mybb->post_code}\" class=\"logout\">{$lang->logout}</a></div>\n";

		echo $this->_build_menu();
echo " <div id=\"page\">\n";
echo " <div id=\"left_menu\">\n";

		echo $this->_build_menu();
echo " <div id=\"page\">\n";
echo " <div id=\"left_menu\">\n";

Zeile 131Zeile 136
		echo $this->_generate_breadcrumb();
echo " </div>\n";
echo " <div id=\"inner\">\n";

		echo $this->_generate_breadcrumb();
echo " </div>\n";
echo " <div id=\"inner\">\n";

		if($admin_session['data']['flash_message'])

			if(isset($admin_session['data']['flash_message']) && $admin_session['data']['flash_message'])

		{
$message = $admin_session['data']['flash_message']['message'];
$type = $admin_session['data']['flash_message']['type'];

		{
$message = $admin_session['data']['flash_message']['message'];
$type = $admin_session['data']['flash_message']['type'];

Zeile 143Zeile 148
		if($this->show_post_verify_error == true)
{
$this->output_error($lang->invalid_post_verify_key);

		if($this->show_post_verify_error == true)
{
$this->output_error($lang->invalid_post_verify_key);

		}

		}

	}

/**

	}

/**

Zeile 152Zeile 157
	function output_footer($quit=true)
{
global $mybb, $maintimer, $db, $lang, $plugins;

	function output_footer($quit=true)
{
global $mybb, $maintimer, $db, $lang, $plugins;

		

		

		$plugins->run_hooks("admin_page_output_footer");

		$plugins->run_hooks("admin_page_output_footer");

		
$memory_usage = $lang->na;
if(function_exists("memory_get_usage"))
{
$memory_usage = get_friendly_size(memory_get_peak_usage(true));
}


$memory_usage = get_friendly_size(get_memory_usage());





		
$totaltime = $maintimer->stop();
$querycount = $db->query_count;

		
$totaltime = $maintimer->stop();
$querycount = $db->query_count;

Zeile 196Zeile 197
	
/**
* Generate a breadcrumb trail.

	
/**
* Generate a breadcrumb trail.

	 */

	 */

	function _generate_breadcrumb()
{
if(!is_array($this->_breadcrumb_trail))

	function _generate_breadcrumb()
{
if(!is_array($this->_breadcrumb_trail))

		{

		{

			return false;
}
$trail = "";
foreach($this->_breadcrumb_trail as $key => $crumb)
{

			return false;
}
$trail = "";
foreach($this->_breadcrumb_trail as $key => $crumb)
{

			if($this->_breadcrumb_trail[$key+1])
{

			if(isset($this->_breadcrumb_trail[$key+1]))
{

				$trail .= "<a href=\"".$crumb['url']."\">".$crumb['name']."</a>";

				$trail .= "<a href=\"".$crumb['url']."\">".$crumb['name']."</a>";

				if($this->_breadcrumb_trail[$key+2])

				if(isset($this->_breadcrumb_trail[$key+2]))

				{
$trail .= " &raquo; ";
}

				{
$trail .= " &raquo; ";
}

Zeile 220Zeile 221
			}
}
return $trail;

			}
}
return $trail;

	}	

/**
* Output an introductory message.
*
* @param string The title of the introductory message.
* @param string The introductory message.
* @param string An additional class name to add to the message if there is one.
*/
function output_intro($title, $description, $class="")
{
echo " <div class=\"intro_description\">\n";
echo " <div class=\"{$class}\">\n";
echo " <h2>{$title}</h2>\n";
echo " <p>{$description}</p>\n";
echo "</div>\n";
echo "</div>\n";

 
	}

/**

	}

/**

Zeile 245Zeile 229
	 * @param string The message to output.
*/
function output_success($message)

	 * @param string The message to output.
*/
function output_success($message)

	{

	{

		echo "<div class=\"success\">{$message}</div>\n";
}


		echo "<div class=\"success\">{$message}</div>\n";
}


Zeile 266Zeile 250
	
/**
* Output an inline message.

	
/**
* Output an inline message.

	 *

	 *

	 * @param string The message to output.
*/
function output_inline_message($message)

	 * @param string The message to output.
*/
function output_inline_message($message)

Zeile 276Zeile 260
	
/**
* Output a single error message.

	
/**
* Output a single error message.

	 *

	 *

	 * @param string The message to output.
*/
function output_error($error)

	 * @param string The message to output.
*/
function output_error($error)

Zeile 298Zeile 282
		if(!is_array($errors))
{
$errors = array($errors);

		if(!is_array($errors))
{
$errors = array($errors);

		}

		}

		echo "<div class=\"error\">\n";
echo "<p><em>{$lang->encountered_errors}</em></p>\n";
echo "<ul>\n";

		echo "<div class=\"error\">\n";
echo "<p><em>{$lang->encountered_errors}</em></p>\n";
echo "<ul>\n";

Zeile 319Zeile 303
	 */
function show_login($message="", $class="success")
{

	 */
function show_login($message="", $class="success")
{

		global $lang, $cp_style;


		global $lang, $cp_style, $mybb;


		$copy_year = COPY_YEAR;

$login_container_width = "";
$login_label_width = "";

// If the language string for "Username" is too cramped then use this to define how much larger you want the gap to be (in px)

		$copy_year = COPY_YEAR;

$login_container_width = "";
$login_label_width = "";

// If the language string for "Username" is too cramped then use this to define how much larger you want the gap to be (in px)

		if($lang->login_field_width)

		if(isset($lang->login_field_width))

        {
$login_label_width = " style=\"width: ".(intval($lang->login_field_width)+100)."px;\"";
$login_container_width = " style=\"width: ".(410+(intval($lang->login_field_width)))."px;\"";
}

        {
$login_label_width = " style=\"width: ".(intval($lang->login_field_width)+100)."px;\"";
$login_container_width = " style=\"width: ".(410+(intval($lang->login_field_width)))."px;\"";
}


print <<<EOF


print <<<EOF

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head profile="http://gmpg.org/xfn/1">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head profile="http://gmpg.org/xfn/1">

Zeile 355Zeile 339
	<div id="header">
<div id="logo">
<h1><a href="../" title="{$lang->return_to_forum}"><span class="invisible">{$lang->mybb_acp}</span></a></h1>

	<div id="header">
<div id="logo">
<h1><a href="../" title="{$lang->return_to_forum}"><span class="invisible">{$lang->mybb_acp}</span></a></h1>





		</div>
</div>
<div id="content">

		</div>
</div>
<div id="content">

Zeile 370Zeile 354
		if($_SERVER['QUERY_STRING'])
{
$query_string = '?'.preg_replace('#adminsid=(.{32})#i', '', $_SERVER['QUERY_STRING']);

		if($_SERVER['QUERY_STRING'])
{
$query_string = '?'.preg_replace('#adminsid=(.{32})#i', '', $_SERVER['QUERY_STRING']);

 
			$query_string = preg_replace('#my_post_key=(.{32})#i', '', $query_string);

			$query_string = str_replace('action=logout', '', $query_string);
$query_string = preg_replace('#&+#', '&', $query_string);
$query_string = str_replace('?&', '?', $query_string);
$query_string = htmlspecialchars_uni($query_string);

			$query_string = str_replace('action=logout', '', $query_string);
$query_string = preg_replace('#&+#', '&', $query_string);
$query_string = str_replace('?&', '?', $query_string);
$query_string = htmlspecialchars_uni($query_string);

 
		}
switch($mybb->settings['username_method'])
{
case 0:
$lang_username = $lang->username;
break;
case 1:
$lang_username = $lang->username1;
break;
case 2:
$lang_username = $lang->username2;
break;
default:
$lang_username = $lang->username;
break;

		}

// TODO: Better Fix?

		}

// TODO: Better Fix?

Zeile 383Zeile 383
		<form method="post" action="{$_SERVER['PHP_SELF']}{$query_string}">
<div class="form_container">


		<form method="post" action="{$_SERVER['PHP_SELF']}{$query_string}">
<div class="form_container">


			<div class="label"{$login_label_width}><label for="username">{$lang->username}</label></div>

			<div class="label"{$login_label_width}><label for="username">{$lang_username}</label></div>


<div class="field"><input type="text" name="username" id="username" class="text_input initial_focus" /></div>



<div class="field"><input type="text" name="username" id="username" class="text_input initial_focus" /></div>


Zeile 417Zeile 417

$copy_year = COPY_YEAR;
$allowed_attempts = intval($mybb->settings['maxloginattempts']);


$copy_year = COPY_YEAR;
$allowed_attempts = intval($mybb->settings['maxloginattempts']);

		$lockedout_message = $lang->sprintf($lang->error_mybb_admin_lockedout_message, $allowed_attempts);

print <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

		$lockedout_message = $lang->sprintf($lang->error_mybb_admin_lockedout_message, $allowed_attempts);

print <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head profile="http://gmpg.org/xfn/1">
<title>{$lang->mybb_admin_cp} - {$lang->error_mybb_admin_lockedout}</title>

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head profile="http://gmpg.org/xfn/1">
<title>{$lang->mybb_admin_cp} - {$lang->error_mybb_admin_lockedout}</title>

Zeile 433Zeile 433
	<div id="header">
<div id="logo">
<h1><a href="../" title="{$lang->return_to_forum}"><span class="invisible">{$lang->mybb_acp}</span></a></h1>

	<div id="header">
<div id="logo">
<h1><a href="../" title="{$lang->return_to_forum}"><span class="invisible">{$lang->mybb_acp}</span></a></h1>





		</div>
</div>
<div id="content">

		</div>
</div>
<div id="content">

Zeile 450Zeile 450
	/**
* Generate the lockout unlock page
*

	/**
* Generate the lockout unlock page
*

 
	 * @param string The any message to output on the page if there is one.
* @param string The class name of the message (defaults to success)

	 */

	 */

	function show_lockout_unlock()

	function show_lockout_unlock($message="", $class="success")

	{
global $lang, $mybb, $cp_style;

$copy_year = COPY_YEAR;

	{
global $lang, $mybb, $cp_style;

$copy_year = COPY_YEAR;

 
		switch($mybb->settings['username_method'])
{
case 0:
$lang_username = $lang->username;
break;
case 1:
$lang_username = $lang->username1;
break;
case 2:
$lang_username = $lang->username2;
break;
default:
$lang_username = $lang->username;
break;
}

if($message)
{
$message = "<p id=\"message\" class=\"{$class}\"><span class=\"text\">{$message}</span></p>";
}


print <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


print <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Zeile 476Zeile 498
	</div>
<div id="content">
<h2>{$lang->lockout_unlock}</h2>

	</div>
<div id="content">
<h2>{$lang->lockout_unlock}</h2>

 
		{$message}

		<p>{$lang->enter_username_and_token}</p>
<form method="post" action="index.php">
<div class="form_container">


		<p>{$lang->enter_username_and_token}</p>
<form method="post" action="index.php">
<div class="form_container">


			<div class="label"{$login_label_width}><label for="username">{$lang->username}</label></div>

			<div class="label"{$login_label_width}><label for="username">{$lang_username}</label></div>


<div class="field"><input type="text" name="username" id="username" class="text_input initial_focus" /></div>



<div class="field"><input type="text" name="username" id="username" class="text_input initial_focus" /></div>


Zeile 538Zeile 561
		{
foreach($items as $menu_item)
{

		{
foreach($items as $menu_item)
{

				$menu_item['link'] = htmlspecialchars($menu_item['link']);

				$menu_item['link'] = htmlspecialchars_uni($menu_item['link']);

				if($menu_item['id'] == $this->active_module)
{
$sub_menu = $menu_item['submenu'];

				if($menu_item['id'] == $this->active_module)
{
$sub_menu = $menu_item['submenu'];

Zeile 593Zeile 616
		{
$alt_bg = "alt1";
return $alt_bg;

		{
$alt_bg = "alt1";
return $alt_bg;

		}
}


		}
}


	/**
* Output a Javascript based tab control on to the page.
*

	/**
* Output a Javascript based tab control on to the page.
*

Zeile 604Zeile 627
	 * @param string The ID to use for the tabs for if you run multiple instances of the tabbing control in one html page
*/
function output_tab_control($tabs=array(), $observe_onload=true, $id="tabs")

	 * @param string The ID to use for the tabs for if you run multiple instances of the tabbing control in one html page
*/
function output_tab_control($tabs=array(), $observe_onload=true, $id="tabs")

	{

	{

		global $plugins;

		global $plugins;

		$plugins->run_hooks_by_ref("admin_page_output_tab_control_start", $tabs);

		$tabs = $plugins->run_hooks("admin_page_output_tab_control_start", $tabs);

		echo "<script type=\"text/javascript\">\n";
if($observe_onload)
{

		echo "<script type=\"text/javascript\">\n";
if($observe_onload)
{

Zeile 630Zeile 653
			if($tab_count == $done)
{
$class .= " last";

			if($tab_count == $done)
{
$class .= " last";

			}

			}

			if($done == 1)
{
$class .= " first";

			if($done == 1)
{
$class .= " first";

Zeile 651Zeile 674
	function output_nav_tabs($tabs=array(), $active='')
{
global $plugins;

	function output_nav_tabs($tabs=array(), $active='')
{
global $plugins;

		$plugins->run_hooks_by_ref("admin_page_output_nav_tabs_start", $tabs);

		$tabs = $plugins->run_hooks("admin_page_output_nav_tabs_start", $tabs);

		echo "<div class=\"nav_tabs\">";
echo "\t<ul>\n";
foreach($tabs as $id => $tab)

		echo "<div class=\"nav_tabs\">";
echo "\t<ul>\n";
foreach($tabs as $id => $tab)

Zeile 661Zeile 684
			{
$class = ' active';
}

			{
$class = ' active';
}

			if($tab['align'] == "right")

			if(isset($tab['align']) == "right")

			{
$class .= " right";
}

			{
$class .= " right";
}

			if($tab['link_target'])
{


			$target = '';
if(isset($tab['link_target']))
{

				$target = " target=\"{$tab['link_target']}\"";

				$target = " target=\"{$tab['link_target']}\"";

 
			}
if(!isset($tab['link']))
{
$tab['link'] = '';

			}
echo "\t\t<li class=\"{$class}\"><a href=\"{$tab['link']}\"{$target}>{$tab['title']}</a></li>\n";
$target = '';

			}
echo "\t\t<li class=\"{$class}\"><a href=\"{$tab['link']}\"{$target}>{$tab['title']}</a></li>\n";
$target = '';

Zeile 769Zeile 797
	 */
function add_menu_items($items, $active)
{

	 */
function add_menu_items($items, $active)
{

 
		global $run_module;


		$this->_contents = "<ul class=\"menu\">";
foreach($items as $item)
{

		$this->_contents = "<ul class=\"menu\">";
foreach($items as $item)
{

 
			if(!check_admin_permissions(array("module" => $run_module, "action" => $item['id']), false))
{
continue;
}


			$class = "";
if($item['id'] == $active)
{
$class = "active";
}

			$class = "";
if($item['id'] == $active)
{
$class = "active";
}

			$item['link'] = htmlspecialchars($item['link']);

			$item['link'] = htmlspecialchars_uni($item['link']);

			$this->_contents .= "<li class=\"{$class}\"><a href=\"{$item['link']}\">{$item['title']}</a></li>\n";
}
$this->_contents .= "</ul>";

			$this->_contents .= "<li class=\"{$class}\"><a href=\"{$item['link']}\">{$item['title']}</a></li>\n";
}
$this->_contents .= "</ul>";