Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -1,17 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Admin Output Library
|
||||
* Last Updated: $LastChangedDate: 2009-10-23 21:23:07 -0400 (Fri, 23 Oct 2009) $
|
||||
* Last Updated: $LastChangedDate: 2010-10-11 20:21:22 -0400 (Mon, 11 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 5283 $
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6962 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -40,8 +42,6 @@ class adminOutput extends output
|
||||
* @var string
|
||||
*/
|
||||
public $html = '';
|
||||
public $html_help_title = '';
|
||||
public $html_help_msg = '';
|
||||
public $html_main = '';
|
||||
public $body_extra = '';
|
||||
public $cm_output = '';
|
||||
@@ -78,7 +78,7 @@ class adminOutput extends output
|
||||
* Global messages
|
||||
*
|
||||
* @access public
|
||||
* @access string
|
||||
* @var string
|
||||
*/
|
||||
public $global_message;
|
||||
public $global_error;
|
||||
@@ -115,6 +115,14 @@ class adminOutput extends output
|
||||
* @var string
|
||||
*/
|
||||
public $default_tab = '';
|
||||
|
||||
/**
|
||||
* Any extra HTML to stick in the sidebar
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $sidebar_extra = '';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -201,7 +209,7 @@ class adminOutput extends output
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->showError( "Не удалось загрузить шаблон: $template", 4100, true );
|
||||
$this->showError( sprintf( $this->lang->words['notemplatefiletoload'], $template ), 4100, true );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,14 +280,13 @@ class adminOutput extends output
|
||||
|
||||
if ( ipsRegistry::$current_module )
|
||||
{
|
||||
$this->html_title .= " > " . ipsRegistry::$modules_by_section [ ipsRegistry::$current_application ][ ipsRegistry::$current_module ]['sys_module_title'];
|
||||
$this->html_title .= " > " . ipsRegistry::$modules_by_section[ ipsRegistry::$current_application ][ ipsRegistry::$current_module ]['sys_module_title'];
|
||||
}
|
||||
}
|
||||
|
||||
$html = str_replace( '<%CONTENT%>' , $this->html , $this->global_template->global_main_popup_wrapper() );
|
||||
$html = str_replace( "<%TITLE%>" , $this->html_title , $html );
|
||||
$html = str_replace( "<%BODYEXTRA%>" , ' '.$this->body_extra , $html );
|
||||
$html = preg_replace( "#{txt\.(.+?)}#e", "IPSText::\$words['\\1']", $html );
|
||||
$html = str_replace( '<%CONTENT%>' , $this->html , $this->global_template->global_main_popup_wrapper() );
|
||||
$html = str_replace( "<%TITLE%>" , $this->html_title , $html );
|
||||
$html = str_replace( "<%BODYEXTRA%>", ' ' . $this->body_extra , $html );
|
||||
print $html;
|
||||
|
||||
exit();
|
||||
@@ -392,7 +399,7 @@ class adminOutput extends output
|
||||
{
|
||||
$this->_sendOutputSetUp( 'redirect' );
|
||||
|
||||
$this->html .= "<iframe src='$url' scrolling='auto' border='0' frameborder='0' width='100%' height='400'></iframe>";
|
||||
$this->html .= "<iframe src='{$url}' scrolling='auto' border='0' frameborder='0' width='100%' height='400'></iframe>";
|
||||
|
||||
$this->html_main .= $this->global_template->global_frame_wrapper();
|
||||
$this->sendOutput();
|
||||
@@ -434,9 +441,10 @@ class adminOutput extends output
|
||||
* @param integer Error code
|
||||
* @param boolean Log error message
|
||||
* @param string Extra log data
|
||||
* @param integer Header code to send (ignored for ACP)
|
||||
* @return void
|
||||
*/
|
||||
public function showError( $message, $code=0, $logError=FALSE, $logExtra='' )
|
||||
public function showError( $message, $code=0, $logError=FALSE, $logExtra='', $header=500 )
|
||||
{
|
||||
$this->_sendOutputSetUp( 'error' );
|
||||
|
||||
@@ -537,109 +545,51 @@ class adminOutput extends output
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Sticky tabs
|
||||
// Context sensitive stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->member->setProperty( 'global_sticky_tabs', is_array( $this->memberData['global_sticky_tabs'] ) ? $this->memberData['global_sticky_tabs'] : array() );
|
||||
|
||||
//-----------------------------------------
|
||||
// Keith's help mode (tm)
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->settings['acp_tutorial_mode'] )
|
||||
if( !$this->cm_output )
|
||||
{
|
||||
/* Is this a non IPS app? */
|
||||
if ( $this->request['app'] == 'subscriptions' OR ! strstr( IPSLib::getAppDir( $this->request['app'] ), '/other/' ) )
|
||||
{
|
||||
// Decided to use request instead of (e.g.) ipsRegistry::$current_application to make it easier for us to map.
|
||||
// We can change in the future if it's preferred
|
||||
$check_key = $this->request['app'] . '_' . $this->request['module'] . '_' . $this->request['section'] . '_' . $this->request['do'] . '_';
|
||||
|
||||
if ( $this->request['groupHelpKey'] )
|
||||
{
|
||||
$check_key .= $this->request['groupHelpKey'];
|
||||
}
|
||||
|
||||
$help .= $this->global_template->help_box( $check_key );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->settings['acp_tutorial_mode'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Start function proper
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $no_wrapper === FALSE )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Context sensitive stuff
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->cm_output )
|
||||
{
|
||||
$_file = IPS_APPLICATION_PATH . 'skin_cp/cp_skin_' . $clean_module . '_context_menu.php';
|
||||
$_class = 'cp_skin_' . $clean_module . '_context_menu';
|
||||
|
||||
if ( file_exists( $_file ) )
|
||||
{
|
||||
require $_file;
|
||||
|
||||
$context_menu = new $_class( $this->registry );
|
||||
|
||||
$cm_function_full = ipsRegistry::$request['do'] ? 'context_menu__' . $clean_module.'__'.ipsRegistry::$request['section'].'__'.ipsRegistry::$request['do'] : 'context_menu__' . $clean_module.'__'.ipsRegistry::$request['section'];
|
||||
$cm_function = 'context_menu__' . $clean_module.'__'.ipsRegistry::$request['section'];
|
||||
$cm_module = 'context_menu__' . $clean_module;
|
||||
|
||||
if ( method_exists( $_class, $cm_function_full ) )
|
||||
{
|
||||
$this->cm_output = $context_menu->__wrap( $context_menu->$cm_function_full() );
|
||||
}
|
||||
else if ( method_exists( $_class, $cm_function ) )
|
||||
{
|
||||
$this->cm_output = $context_menu->__wrap( $context_menu->$cm_function() );
|
||||
}
|
||||
else if ( method_exists( $_class, $cm_module ) )
|
||||
{
|
||||
$this->cm_output = $context_menu->__wrap( $context_menu->$cm_module() );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if( ipsRegistry::$request['section'] != 'dashboard' && ipsRegistry::$request['do'] != 'index' )
|
||||
{
|
||||
$this->cm_output = $this->global_template->no_context_menu();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->cm_output = $this->global_template->no_context_menu();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Global Context Menu Stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$_file = IPS_ROOT_PATH . "skin_cp/cp_skin_global_context_menu.php";
|
||||
$_file = IPSLib::getAppDir( IPS_APP_COMPONENT ) . '/skin_cp/cp_skin_' . $clean_module . '_context_menu.php';
|
||||
$_class = 'cp_skin_' . $clean_module . '_context_menu';
|
||||
|
||||
if ( file_exists( $_file ) )
|
||||
{
|
||||
require_once $_file;
|
||||
require $_file;
|
||||
|
||||
$global_context = new cp_skin_global_context_menu( $this->registry );
|
||||
$global_context_output = $global_context->get();
|
||||
$context_menu = new $_class( $this->registry );
|
||||
|
||||
$cm_function_full = ipsRegistry::$request['do'] ? 'context_menu__' . $clean_module.'__'.ipsRegistry::$request['section'].'__'.ipsRegistry::$request['do'] : 'context_menu__' . $clean_module.'__'.ipsRegistry::$request['section'];
|
||||
$cm_function = 'context_menu__' . $clean_module.'__'.ipsRegistry::$request['section'];
|
||||
$cm_module = 'context_menu__' . $clean_module;
|
||||
|
||||
if ( method_exists( $_class, $cm_function_full ) )
|
||||
{
|
||||
$this->cm_output = $context_menu->__wrap( $context_menu->$cm_function_full() );
|
||||
}
|
||||
else if ( method_exists( $_class, $cm_function ) )
|
||||
{
|
||||
$this->cm_output = $context_menu->__wrap( $context_menu->$cm_function() );
|
||||
}
|
||||
else if ( method_exists( $_class, $cm_module ) )
|
||||
{
|
||||
$this->cm_output = $context_menu->__wrap( $context_menu->$cm_module() );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ipsRegistry::$request['section'] != 'dashboard' && ipsRegistry::$request['do'] != 'index' )
|
||||
{
|
||||
$this->cm_output = $this->global_template->no_context_menu();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->cm_output = $this->global_template->no_context_menu();
|
||||
}
|
||||
}
|
||||
|
||||
$html = str_replace( '<%CONTENT%>', $this->html_main, $this->global_template->global_main_wrapper(IPS_DOC_CHAR_SET, $this->_css ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$html = str_replace( '<%CONTENT%>', $this->html_main, $this->global_template->global_main_wrapper_no_furniture(IPS_DOC_CHAR_SET, $this->_css ) );
|
||||
}
|
||||
$html = str_replace( '<%CONTENT%>', $this->html_main, $this->global_template->global_main_wrapper(IPS_DOC_CHAR_SET, $this->_css ) );
|
||||
|
||||
//------------------------------------------------
|
||||
// Message in a bottle?
|
||||
@@ -657,17 +607,6 @@ class adminOutput extends output
|
||||
$message .= ( $message ) ? '<br />' . $this->global_template->global_message() : $this->global_template->global_message();
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// Help?
|
||||
//------------------------------------------------
|
||||
|
||||
/*if ( isset( $this->html_help_title ) AND isset( $this->html_help_msg ) AND $this->html_help_title != '' )
|
||||
{
|
||||
$help = $this->global_template->information_box( $this->html_help_title, $this->html_help_msg ) . "<br >";
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Figure out title...
|
||||
//-----------------------------------------
|
||||
@@ -680,7 +619,7 @@ class adminOutput extends output
|
||||
|
||||
if ( ipsRegistry::$current_module )
|
||||
{
|
||||
$this->html_title .= " > " . ipsRegistry::$modules_by_section [ ipsRegistry::$current_application ][ ipsRegistry::$current_module ]['sys_module_title'];
|
||||
$this->html_title .= " > " . ipsRegistry::$modules_by_section[ ipsRegistry::$current_application ][ ipsRegistry::$current_module ]['sys_module_title'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -708,13 +647,12 @@ class adminOutput extends output
|
||||
$html = str_replace( "<%TITLE%>" , $this->html_title, $html );
|
||||
$html = str_replace( "<%SUBMENU%>" , $this->_buildSubMenu() , $html ); # Must be called first
|
||||
$html = str_replace( "<%MENU%>" , $this->_buildMenu() , $html );
|
||||
$html = str_replace( "<%SIDEBAR_EXTRA%>" , $this->sidebar_extra , $html );
|
||||
$html = str_replace( "<%CONTEXT_MENU%>" , $this->cm_output , $html );
|
||||
$html = str_replace( "<%GLOBAL_CONTEXT_MENU%>", $global_context_output , $html );
|
||||
$html = str_replace( "<%SECTIONCONTENT%>" , $this->html , $html );
|
||||
# This has to be called after the menu has been set so that query_string is set correctly
|
||||
|
||||
$html = str_replace( "<%MSG%>" , $message , $html );
|
||||
$html = str_replace( "<%HELP%>" , isset( $help ) ? $help : '', $html );
|
||||
|
||||
//-----------------------------------------
|
||||
// Fix up navigation
|
||||
@@ -845,12 +783,6 @@ class adminOutput extends output
|
||||
$html = str_replace( "<body", "<body ".$this->body_extra, $html );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Lang Replace
|
||||
//-----------------------------------------
|
||||
|
||||
$html = preg_replace( "#{txt\.(.+?)}#e", "\$this->lang->words['\\1']", $html );
|
||||
|
||||
//-----------------------------------------
|
||||
// Emoticons fix
|
||||
//-----------------------------------------
|
||||
@@ -895,7 +827,7 @@ class adminOutput extends output
|
||||
if ( is_array( IPSDebug::$memory_debug ) )
|
||||
{
|
||||
$memory .= "<br />\n<div align='center' style='margin-left:auto;margin-right:auto'><div class='tableborder' style='width:75%'>\n<div class='tableheaderalt'>MEMORY USAGE</div><div class='tablerow1' style='padding:6px'>\n";
|
||||
$memory .= "<table cellpadding='4' cellspacing='0' border='0' width='100%'>\n";
|
||||
$memory .= "<table width='100%'>\n";
|
||||
$_c = 0;
|
||||
|
||||
foreach( IPSDebug::$memory_debug as $usage )
|
||||
@@ -928,7 +860,7 @@ class adminOutput extends output
|
||||
$peak_used = $peak_end - IPS_MEMORY_START;
|
||||
|
||||
print $memory;
|
||||
print "Total Memory Used: " . IPSLib::sizeFormat( $_used ) . " (Peak:".IPSText::sizeFormat( $peak_used ).")";
|
||||
print "Total Memory Used: " . IPSLib::sizeFormat( $_used ) . " (Peak:" . IPSLib::sizeFormat( $peak_used ).")";
|
||||
}
|
||||
|
||||
$this->_IS_PRINTED = 1;
|
||||
@@ -979,7 +911,7 @@ class adminOutput extends output
|
||||
$app = ipsRegistry::$current_application;
|
||||
$link_array = array();
|
||||
|
||||
/* Fetch fke apps */
|
||||
/* Fetch fake apps */
|
||||
$fakeApps = $this->registry->output->fetchFakeApps();
|
||||
$inFakeApp = FALSE;
|
||||
$fakeApp = '';
|
||||
@@ -1041,23 +973,12 @@ class adminOutput extends output
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! $data['sys_module_parent'] )
|
||||
{
|
||||
$_tab_title = $data['sys_module_title'];
|
||||
$_tab_key = $data['sys_module_key'];
|
||||
$_tab_title = $data['sys_module_title'];
|
||||
$_tab_key = $data['sys_module_key'];
|
||||
|
||||
$tabs[ $app ]['items'][ $_tab_key ] = array( 'tab_title' => $_tab_title,
|
||||
'tab_key' => $_tab_key );
|
||||
$tabs[ $app ]['data'] = $data;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_tab_title = $data['sys_module_title'];
|
||||
$_tab_key = $data['sys_module_key'];
|
||||
|
||||
$children[ $app ][ $data['sys_module_parent'] ][ $_tab_key ] = array( 'tab_title' => $_tab_title,
|
||||
'tab_key' => $_tab_key );
|
||||
}
|
||||
$tabs[ $app ]['items'][ $_tab_key ] = array( 'tab_title' => $_tab_title,
|
||||
'tab_key' => $_tab_key );
|
||||
$tabs[ $app ]['data'] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1417,6 +1338,7 @@ class adminOutput extends output
|
||||
}
|
||||
}
|
||||
}
|
||||
//print_r($this->core_nav);
|
||||
//print_r($this->menu);
|
||||
if ( isset( $this->menu ) && count( $this->menu ) )
|
||||
{
|
||||
@@ -1666,14 +1588,15 @@ class adminOutput extends output
|
||||
*
|
||||
* @access public
|
||||
* @param string Field name
|
||||
* @param array Options. Multidimensional array in format of array( array( 'value', 'display' ), array( 'value', 'display' ) )
|
||||
* @param array Options. Multidimensional array in format of array( array( 'value', 'display' ), array( 'value', 'display', 'optgroup_key' ) )
|
||||
* @param string Default value
|
||||
* @param string HTML id attribute [defaults to $name]
|
||||
* @param string Javascript to add to list
|
||||
* @param string CSS class(es) to add to field
|
||||
* @param array Optgroups
|
||||
* @return string Form dropdown list
|
||||
*/
|
||||
public function formDropdown( $name, $list=array(), $default_val="", $id="", $js="", $css="" )
|
||||
public function formDropdown( $name, $list=array(), $default_val="", $id="", $js="", $css="", $optgroups=array() )
|
||||
{
|
||||
if ($js != "")
|
||||
{
|
||||
@@ -1689,16 +1612,101 @@ class adminOutput extends output
|
||||
|
||||
$html = "<select name='{$name}'" . $js . " id='{$id}' class='dropdown{$css}'>\n";
|
||||
|
||||
foreach ( $list as $v )
|
||||
//-----------------------------------------
|
||||
// Support for optgroups
|
||||
//-----------------------------------------
|
||||
|
||||
if( count($optgroups) )
|
||||
{
|
||||
$selected = "";
|
||||
|
||||
if ( ($default_val !== "") and ($v[0] == $default_val) )
|
||||
$_printed = 0;
|
||||
|
||||
foreach ( $list as $v )
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
if( $v[2] != '_root_' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$selected = "";
|
||||
|
||||
if ( ($default_val !== "") and ($v[0] == $default_val) )
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
}
|
||||
|
||||
$html .= "<option value='" . $v[0] . "'" . $selected . ">" . $v[1] . "</option>\n";
|
||||
|
||||
$_printed++;
|
||||
}
|
||||
|
||||
foreach( $optgroups as $_key => $value )
|
||||
{
|
||||
$html .= "<optgroup label='{$value}'>\n";
|
||||
|
||||
foreach ( $list as $v )
|
||||
{
|
||||
if( !$v[2] OR $v[2] != $_key )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$selected = "";
|
||||
|
||||
if ( ($default_val !== "") and ($v[0] == $default_val) )
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
}
|
||||
|
||||
$html .= "<option value='" . $v[0] . "'" . $selected . ">" . $v[1] . "</option>\n";
|
||||
|
||||
$_printed++;
|
||||
}
|
||||
|
||||
$html .= "</optgroup>\n";
|
||||
}
|
||||
|
||||
if( $_printed < count($list) )
|
||||
{
|
||||
$html .= "<optgroup label='{$this->lang->words['optgroup_other']}'>\n";
|
||||
|
||||
foreach ( $list as $v )
|
||||
{
|
||||
if( $v[2] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$selected = "";
|
||||
|
||||
if ( ($default_val !== "") and ($v[0] == $default_val) )
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
}
|
||||
|
||||
$html .= "<option value='" . $v[0] . "'" . $selected . ">" . $v[1] . "</option>\n";
|
||||
}
|
||||
|
||||
$html .= "</optgroup>\n";
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Normal
|
||||
//-----------------------------------------
|
||||
|
||||
else
|
||||
{
|
||||
foreach ( $list as $v )
|
||||
{
|
||||
$selected = "";
|
||||
|
||||
if ( ($default_val !== "") and ($v[0] == $default_val) )
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
}
|
||||
|
||||
$html .= "<option value='" . $v[0] . "'" . $selected . ">" . $v[1] . "</option>\n";
|
||||
}
|
||||
|
||||
$html .= "<option value='" . $v[0] . "'" . $selected . ">" . $v[1] . "</option>\n";
|
||||
}
|
||||
|
||||
$html .= "</select>\n\n";
|
||||
@@ -1734,13 +1742,13 @@ class adminOutput extends output
|
||||
}
|
||||
|
||||
$html = "<select name='{$name}" . "'" . $js . " id='{$id}' class='dropdown{$css}' multiple='multiple' size='{$size}'>\n";
|
||||
|
||||
|
||||
foreach ($list as $v)
|
||||
{
|
||||
$selected = "";
|
||||
|
||||
|
||||
if ( count($default) > 0 )
|
||||
{
|
||||
{
|
||||
if ( in_array( $v[0], $default ) )
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
@@ -1841,287 +1849,6 @@ class adminOutput extends output
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a table row
|
||||
*
|
||||
* @access public
|
||||
* @param array Cell data
|
||||
* @param string CSS clasname
|
||||
* @param string align value
|
||||
* @return string HTML
|
||||
* @deprecated
|
||||
*/
|
||||
public function add_td_row( $array, $css="", $align='middle' ) {
|
||||
|
||||
if (is_array($array))
|
||||
{
|
||||
$html = "<tr>\n";
|
||||
|
||||
$count = count($array);
|
||||
|
||||
$this->td_colspan = $count;
|
||||
|
||||
for ($i = 0; $i < $count ; $i++ )
|
||||
{
|
||||
$td_col = $i % 2 ? 'tablerow2' : 'tablerow1';
|
||||
|
||||
if ($css != "")
|
||||
{
|
||||
$td_col = $css;
|
||||
}
|
||||
|
||||
if (is_array($array[$i]))
|
||||
{
|
||||
$text = $array[$i][0];
|
||||
$colspan = $array[$i][1];
|
||||
$td_col = $array[$i][2] != "" ? $array[$i][2] : $td_col;
|
||||
|
||||
$html .= "<td class='$td_col' colspan='$colspan' valign='$align'>".$text."</td>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($this->td_header[$i][1]) AND $this->td_header[$i][1] != "")
|
||||
{
|
||||
$width = " width='{$this->td_header[$i][1]}' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$width = "";
|
||||
}
|
||||
|
||||
$html .= "<td class='$td_col' $width valign='$align'>".$array[$i]."</td>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$html .= "</tr>\n";
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a basic table row
|
||||
*
|
||||
* @access public
|
||||
* @param string Text
|
||||
* @param string Align value
|
||||
* @param string HTML id attribute
|
||||
* @param integer Colspan
|
||||
* @return string HTML
|
||||
* @deprecated
|
||||
*/
|
||||
public function add_td_basic($text="",$align="left",$id="tablerow1", $colspanint=0) {
|
||||
|
||||
$html = "";
|
||||
$colspan = "";
|
||||
|
||||
if ( $colspanint )
|
||||
{
|
||||
$this->td_colspan = $colspanint;
|
||||
}
|
||||
|
||||
if ($text != "")
|
||||
{
|
||||
if ($this->td_colspan > 0)
|
||||
{
|
||||
$colspan = " colspan='".$this->td_colspan."' ";
|
||||
}
|
||||
|
||||
|
||||
$html .= "<tr><td align='$align' class='$id'".$colspan.">$text</td></tr>\n";
|
||||
}
|
||||
|
||||
return $html;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* End a table
|
||||
*
|
||||
* @access public
|
||||
* @return string HTML
|
||||
* @deprecated
|
||||
*/
|
||||
public function end_table() {
|
||||
|
||||
$this->td_header = array(); // Reset TD headers
|
||||
|
||||
if ($this->has_title == 1)
|
||||
{
|
||||
$this->has_title = 0;
|
||||
|
||||
return "</table></div><br />\n\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "</table>\n\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Start a table
|
||||
*
|
||||
* @access public
|
||||
* @param string Title
|
||||
* @param string Description
|
||||
* @return string HTML
|
||||
* @deprecated
|
||||
*/
|
||||
public function start_table( $title="", $desc="") {
|
||||
|
||||
$html = "";
|
||||
|
||||
if ($title != "")
|
||||
{
|
||||
$this->has_title = 1;
|
||||
$html .= "<div class='tableborder'>
|
||||
<div class='tableheaderalt'>LEGACY -- FIX ME -- $title</div>\n";
|
||||
|
||||
if ( $desc != "" )
|
||||
{
|
||||
$html .= "<div class='tablesubheader'>$desc</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$html .= "\n<table width='100%' cellspacing='0' cellpadding='5' align='center' border='0'>";
|
||||
|
||||
|
||||
if (isset($this->td_header[0]))
|
||||
{
|
||||
// Auto remove two only headers..
|
||||
|
||||
$this->td_header[1][0] = ( isset($this->td_header[1][0]) AND $this->td_header[1][0] ) ? $this->td_header[1][0] : '';
|
||||
$this->td_header[1][1] = ( isset($this->td_header[1][1]) AND $this->td_header[1][1] ) ? $this->td_header[1][1] : '';
|
||||
|
||||
if ( $this->td_header[0][0] == ' ' && $this->td_header[1][0] == ' ' && ( ! isset( $this->td_header[2][0] ) ) )
|
||||
{
|
||||
$this->td_header[0][0] = '{none}';
|
||||
$this->td_header[1][0] = '{none}';
|
||||
}
|
||||
|
||||
$tds = "";
|
||||
|
||||
foreach ($this->td_header as $td)
|
||||
{
|
||||
if ($td[1] != "")
|
||||
{
|
||||
$width = " width='{$td[1]}' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$width = "";
|
||||
}
|
||||
|
||||
if ($td[0] != '{none}')
|
||||
{
|
||||
$tds .= "<td class='tablesubheader'".$width."align='center'>{$td[0]}</td>\n";
|
||||
}
|
||||
|
||||
$this->td_colspan++;
|
||||
}
|
||||
|
||||
if( $tds )
|
||||
{
|
||||
$html .= "<tr>\n{$tds}</tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
return $html;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Start a form tag
|
||||
*
|
||||
* @access public
|
||||
* @param array Hidden input field names => values
|
||||
* @param string Form name
|
||||
* @param string Javascript to add to form tag
|
||||
* @param string HTML id attribute
|
||||
* @return string HTML
|
||||
* @deprecated
|
||||
*/
|
||||
public function start_form($hiddens="", $name='theAdminForm', $js="", $id="")
|
||||
{
|
||||
if ( ! $id )
|
||||
{
|
||||
$id = $name;
|
||||
}
|
||||
|
||||
$form = "LEGACY -- FIX ME --<form action='" . $this->settings['base_url'] . "' method='post' name='$name' $js id='$id'>";
|
||||
|
||||
if (is_array($hiddens))
|
||||
{
|
||||
foreach ($hiddens as $v)
|
||||
{
|
||||
$form .= "\n<input type='hidden' name='{$v[0]}' value='{$v[1]}' />";
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Add in auth key
|
||||
//-----------------------------------------
|
||||
|
||||
$form .= "\n<input type='hidden' name='_admin_auth_key' value='".ipsRegistry::getClass('adminFunctions')->_admin_auth_key."' />";
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add hidden input fields to the form
|
||||
*
|
||||
* @access public
|
||||
* @param array Hidden input fields
|
||||
* @return string HTML
|
||||
* @deprecated
|
||||
*/
|
||||
public function form_hidden($hiddens="")
|
||||
{
|
||||
if (is_array($hiddens))
|
||||
{
|
||||
foreach ($hiddens as $v)
|
||||
{
|
||||
$form .= "\n<input type='hidden' name='{$v[0]}' value='{$v[1]}'>";
|
||||
}
|
||||
}
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* End form (expects to be inside a table)
|
||||
*
|
||||
* @access public
|
||||
* @param string Text
|
||||
* @param string Javascript
|
||||
* @param string Extra data to put in table cell
|
||||
* @return string HTML
|
||||
* @deprecated
|
||||
*/
|
||||
public function end_form($text = "", $js = "", $extra = "")
|
||||
{
|
||||
$html = "";
|
||||
$colspan = "";
|
||||
|
||||
if ($text != "")
|
||||
{
|
||||
if ($this->td_colspan > 0)
|
||||
{
|
||||
$colspan = " colspan='".$this->td_colspan."' ";
|
||||
}
|
||||
|
||||
$html .= "<tr><td align='center' class='tablesubheader'".$colspan."><input type='submit' value='$text'".$js." class='realbutton' accesskey='s'>{$extra}</td></tr>\n";
|
||||
}
|
||||
|
||||
$html .= "</form>";
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new menu. Array should be in the format: ( link, title, [image], [delete] )
|
||||
* The image param is optional.
|
||||
@@ -2151,6 +1878,10 @@ class adminOutput extends output
|
||||
{
|
||||
$links[] = "<li style='z-index: 10000;' class='icon {$img}'><a style='z-index: 10000;' href='#' onclick='return acp.confirmDelete(\"{$menu_item[0]}\");'>{$menu_item[1]}</a></li>";
|
||||
}
|
||||
else if( ! $menu_item[0] )
|
||||
{
|
||||
$links[] = "<li style='z-index: 10000;' class='icon {$img}'><i>{$menu_item[1]}</i></li>";
|
||||
}
|
||||
/* Normal Link */
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user