Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Feb 2, 6:49 AM

in-portal

Index: trunk/kernel/include/debugger.php
===================================================================
--- trunk/kernel/include/debugger.php (revision 819)
+++ trunk/kernel/include/debugger.php (revision 820)
@@ -1,267 +1,268 @@
<?php
class Debugger
{
/**
* Debugger data for building report
*
* @var Array
*/
var $Data = Array();
function dumpVars()
{
$dumpVars = func_get_args();
foreach($dumpVars as $varValue)
{
$this->Data[] = Array('value' => $varValue, 'debug_type' => 'var_dump');
}
}
function prepareHTML($dataIndex)
{
$Data =& $this->Data[$dataIndex];
if($Data['debug_type'] == 'html') return $Data['html'];
switch($Data['debug_type'])
{
case 'error':
- $fileLink = $this->getFileLink($Data['file']);
+ $fileLink = $this->getFileLink($Data['file'],$Data['line']);
$ret = '<b class="debug_error">'.$this->getErrorNameByCode($Data['no']).'</b>: '.$Data['str'];
$ret .= ' in <b>'.$fileLink.'</b> on line <b>'.$Data['line'].'</b>';
return $ret;
break;
case 'var_dump':
$ret = highlight_string('<?php '.print_r($Data['value'], true).'?>', true);
$ret = preg_replace('/&lt;\?php (.*)\?&gt;/s','$1',$ret);
return $ret;
break;
case 'trace':
$trace =& $Data['trace'];
$i = 0; $traceCount = count($trace);
$ret = '';
while($i < $traceCount)
{
$traceRec =& $trace[$i];
$argsID = 'trace_args_'.$dataIndex.'_'.$i;
- $ret .= '<a href="javascript:toggleTraceArgs(\''.$argsID.'\');" title="Show/Hide Function Arguments"><b>Function</b></a>: '.$this->getFileLink($traceRec['file'],$traceRec['class'].$traceRec['type'].$traceRec['function']).'';
+ $ret .= '<a href="javascript:toggleTraceArgs(\''.$argsID.'\');" title="Show/Hide Function Arguments"><b>Function</b></a>: '.$this->getFileLink($traceRec['file'],$traceRec['line'],$traceRec['class'].$traceRec['type'].$traceRec['function']).'';
$ret .= ' in <b>'.basename($traceRec['file']).'</b> on line <b>'.$traceRec['line'].'</b><br>';
// ensure parameter value is not longer then 200 symbols
foreach ($traceRec['args'] as $argID => $argValue)
{
if( strlen($argValue) > 200 ) $traceRec['args'][$argID] = substr($argValue,0,50).' ...';
}
$args = highlight_string('<?php '.print_r($traceRec['args'], true).'?>', true);
$args = preg_replace('/&lt;\?php (.*)\?&gt;/s','$1',$args);
$ret .= '<div id="'.$argsID.'" style="display: none;">'.$args.'</div>';
$i++;
}
/*$ret = highlight_string('<?php '.print_r($trace, true).'?>', true);
$ret = preg_replace('/&lt;\?php (.*)\?&gt;/s','$1',$ret);*/
return $ret;
break;
default:
return 'incorrect debug data';
break;
}
}
- function getFileLink($file, $title = '')
+ function getFileLink($file, $lineno = 1, $title = '')
{
if(!$title) $title = $file;
- return '<a href="javascript:editFile(\''.$this->getLocalFile($file).'\');" title="'.$file.'">'.$title.'</a>';
+ return '<a href="javascript:editFile(\''.$this->getLocalFile($file).'\','.$lineno.');" title="'.$file.'">'.$title.'</a>';
}
function getLocalFile($remoteFile)
{
return str_replace(DOC_ROOT, WINDOWS_ROOT, $remoteFile);
}
function appendTrace()
{
$trace = debug_backtrace();
array_shift($trace);
$this->Data[] = Array('trace' => $trace, 'debug_type' => 'trace');
}
function appendHTML($html)
{
$this->Data[] = Array('html' => $html,'debug_type' => 'html');
}
function getErrorNameByCode($errorCode)
{
switch($errorCode)
{
case E_USER_ERROR:
return 'Fatal Error';
break;
case E_WARNING:
case E_USER_WARNING:
return 'Warning';
break;
case E_NOTICE:
case E_USER_NOTICE:
return 'Notice';
break;
default:
return '';
break;
}
}
/**
* Generates report
*
*/
function printReport()
{
$i = 0; $lineCount = count($this->Data);
?>
<div id="debug_layer" class="debug_layer_container" style="display: none;">
<div style="padding: 0px;">
<table width="100%" cellpadding="0" cellspacing="1" border="0" class="debug_layer_table">
<?php
while ($i < $lineCount)
{
echo '<tr class="debug_row_'.(($i % 2) ? 'odd' : 'even').'"><td class="debug_cell">'.$this->prepareHTML($i).'</td></tr>';
$i++;
}
?>
</table>
<div>
</div>
<script language="javascript">
function getEventKeyCode($e)
{
var $KeyCode = 0;
if($e.keyCode) $KeyCode = $e.keyCode;
else if($e.which) $KeyCode = $e.which;
return $KeyCode;
}
function keyProcessor($e)
{
if(!$e) $e = window.event;
var $KeyCode = getEventKeyCode($e);
if( $KeyCode == 113 && $e.ctrlKey || $KeyCode == 123 ) // F12 (for Maxthon) or Ctrl+F2 (for Other Browsers)
{
var $DebugLayer = document.getElementById('debug_layer');
if( typeof($DebugLayer) != 'undefined' )
{
resizeDebugLayer($e);
$DebugLayer.style.display = ($DebugLayer.style.display == 'none') ? 'block' : 'none';
}
$e.cancelBubble = true;
if($e.stopPropagation) $e.stopPropagation();
}
}
function prepareSizes($Prefix)
{
var $ret = '';
$ret = eval('document.body.'+$Prefix+'Top')+'; ';
$ret += eval('document.body.'+$Prefix+'Left')+'; ';
$ret += eval('document.body.'+$Prefix+'Height')+'; ';
$ret += eval('document.body.'+$Prefix+'Width')+'; ';
return $ret;
}
function resizeDebugLayer($e)
{
if(!$e) $e = window.event;
var $DebugLayer = document.getElementById('debug_layer');
var $TopMargin = 1;
if( typeof($DebugLayer) != 'undefined' )
{
$DebugLayer.style.top = parseInt(document.body.offsetTop + document.body.scrollTop) + $TopMargin;
$DebugLayer.style.height = document.body.clientHeight - $TopMargin - 5;
}
window.parent.status = 'OFFSET: '+prepareSizes('offset')+' | SCROLL: '+prepareSizes('scroll')+' | CLIENT: '+prepareSizes('client');
window.parent.status += 'DL Info: '+$DebugLayer.style.top;
return true;
}
function showProps($Obj, $Name)
{
var $ret = '';
for($Prop in $Obj)
{
$ret += $Name+'.'+$Prop+' = '+$Obj[$Prop]+"\n";
}
return $ret;
}
- function editFile($FileName)
+ function editFile($fileName,$lineNo)
{
- var $EditorPath = '<?php echo defined('WINDOWS_EDITOR') ? addslashes(WINDOWS_EDITOR) : '' ?>';
- if($EditorPath)
+ var $editorPath = '<?php echo defined('WINDOWS_EDITOR') ? addslashes(WINDOWS_EDITOR) : '' ?>';
+ if($editorPath)
{
var $obj = new ActiveXObject("LaunchinIE.Launch");
- //alert('lauching: ['+$EditorPath+' '+$FileName+']');
- $obj.LaunchApplication($EditorPath+' '+$FileName);
+ $editorPath = $editorPath.replace('%F',$fileName);
+ $editorPath = $editorPath.replace('%L',$lineNo);
+ $obj.LaunchApplication($editorPath);
}
else
{
alert('Editor path not defined!');
}
}
function toggleTraceArgs($ArgsLayerID)
{
var $ArgsLayer = document.getElementById($ArgsLayerID);
$ArgsLayer.style.display = ($ArgsLayer.style.display == 'none') ? 'block' : 'none';
}
document.onkeydown = keyProcessor;
window.onresize = resizeDebugLayer;
window.onscroll = resizeDebugLayer;
window.focus();
</script>
<?php
}
/**
* User-defined error handler
*
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
* @param array $errcontext
*/
function saveError($errno, $errstr, $errfile = '', $errline = '', $errcontext = '')
{
//echo '<b>error</b> ['.$errno.'] = ['.$errstr.']<br>';
$errorType = $this->getErrorNameByCode($errno);
if( substr($errorType,0,5) == 'Fatal')
{
$this->printReport();
exit;
}
if(!$errorType)
{
trigger_error('Unknown error type ['.$errno.']', E_USER_ERROR);
return false;
}
$this->Data[] = Array('no' => $errno, 'str' => $errstr, 'file' => $errfile, 'line' => $errline, 'context' => $errcontext, 'debug_type' => 'error');
}
}
$debugger = new Debugger();
set_error_handler( array(&$debugger,'saveError') );
register_shutdown_function( array(&$debugger,'printReport') );
?>
\ No newline at end of file
Property changes on: trunk/kernel/include/debugger.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/include/elements.php
===================================================================
--- trunk/admin/include/elements.php (revision 819)
+++ trunk/admin/include/elements.php (revision 820)
@@ -1,621 +1,620 @@
<?php
##############################################################
##In-portal :: Administration Interfaces :: Common Elements ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
## ##
## No portion of this code may be copied, reproduced or ##
## otherwise redistributed without proper written ##
## consent of Intechnic Corporation. Violation will ##
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law. ##
##############################################################
if(!defined('IS_INSTALL'))define('IS_INSTALL',0);
if(!IS_INSTALL)
{
if (!admin_login())
{
if(!headers_sent()) {
setcookie("sid"," ",time()-3600);
}
$objSession->Logout();
header("Location: ".$adminURL."/login.php");
die();
//require_once($pathtoroot."admin/login.php");
}
}
global $admin,$pathtoroot, $objConfig;
if(!strlen($admin))
{
$admin = $objConfig->Get("AdminDirectory");
if(!strlen($admin))
{
$admin = "admin";
}
}
require_once($pathtoroot.$admin."/include/sections.php");
$envar = "env=" . BuildEnv();
/* this function loads the javascript for each module's toolbar */
function load_module_javascript($sectionname, $skip_modules = Array() )
{
global $adminURL, $pathtoroot;
echo "<SCRIPT LANGUAGE=JavaScript1.2 src=\"".$adminURL."/browse/fw_menu.js\"></SCRIPT>\n";
echo "<SCRIPT LANGUAGE=JavaScript1.2 src=\"".$adminURL."/include/tabs.js\"></SCRIPT>\n";
echo "<script language=\"JavaScript1.2\" src=\"$adminURL/include/checkarray.js\"></script>\n";
global $objConfig, $ItemTabs;
$m = GetModuleArray("admin");
echo "<!-- ".count($m)."-->";
foreach($m as $key=>$value)
{
$path = $pathtoroot. $value."admin/include/toolbar/".$sectionname.".php";
if( !in_array($value, $skip_modules) && file_exists($path) )
{
echo "\n<!-- $path -->\n";
include_once($path);
}
else
echo "\n<!-- $path not found -->\n";
}
}
function load_module_styles()
{
global $objConfig, $ItemTabs,$rootURL,$pathtoroot;
$m = GetModuleArray("admin");
echo "<!-- module styles (".count($m).")-->";
foreach($m as $key=>$value)
{
$path = $pathtoroot.$value."admin/include/style.css";
if(file_exists($path))
{
$inc = $rootURL.$value."admin/include/style.css";
print "<link rel=\"stylesheet\" type=\"text/css\" href=\"$inc\">\n";
}
}
}
//***********************************
//Page Header
function int_header($toolbar=NULL,$NavBarText=NULL,$ExtraTitle=NULL,$onLoad=NULL, $ExtraHead=NULL,$skip_modules=Array(),$OtherSection = '')
{
global $pathtoroot;
global $pathtolocal;
global $section;
global $objSections;
global $rootURL;
global $localURL;
global $adminURL;
global $envar;
global $admin;
global $metatag;
$style_sheet_global = $adminURL."/include/style.css";
$style_sheet_local = $localURL."admin/include/style.css";
$ExtraTitle = htmlentities($ExtraTitle);
if (is_object($toolbar))
{
if(file_exists($pathtolocal."admin/include/toolbar.php"))
require_once ($pathtolocal."admin/include/toolbar.php");
//Aray of the preloaded elems
//$int_toolbar_preload = array();
print "<html><head><title>In-portal</title>\n";
if(strlen($metatag))
{
print $metatag."\n";
}
else
{
print "<meta http-equiv=\"content-type\" content=\"text/html;charset=iso-8859-1\">\n";
print "<meta http-equiv=\"Pragma\" content=\"no-cache\">\n";
}
print "<link rel=\"stylesheet\" type=\"text/css\" href=\"$style_sheet_global\">\n";
load_module_styles();
require_once($pathtoroot.$admin."/include/mainscript.php");
//require_once($pathtolocal."admin/include/script.js");
print $ExtraHead;
$sectionname = explode(":", $section);
$sectionname = $sectionname[sizeof($sectionname)-1];
load_module_javascript($sectionname, $skip_modules);
if(is_object($toolbar))
print $toolbar->GetInitScript();
print '</head><body topmargin="0" leftmargin="8" marginheight="8" marginwidth="8" bgcolor="#FFFFFF"';
//*** Preload toolbar images
if(strlen($onLoad))
{
print $onLoad;
}
else
print " ONLOAD=\"clear_list_checkboxes();\"";
//*** Preload toolbar images
if(is_object($toolbar))
{
if (strlen($toolbar->Get("CheckClass")))
{
print $toolbar->onLoadString().">";
}
else
print " >";
$menufunc = $toolbar->Get("load_menu_func");
if (strlen($menufunc))
{
print "<script language=\"JavaScript1.2\">$menufunc</script>";
}
}
else
print " >";
}
else
{
print "<html><head><title>In-Portal </title>";
print "<meta http-equiv=\"content-type\" content=\"text/html;charset=iso-8859-1\">";
print "<meta http-equiv=\"Pragma\" content=\"no-cache\">";
print "<link rel=\"stylesheet\" type=\"text/css\" href=\"$style_sheet_global\">";
load_module_styles();
require_once ($pathtoroot.$admin."/include/mainscript.php");
//require_once ($pathtolocal."admin/include/script.js");
$sectionname = explode(":", $section);
$sectionname = $sectionname[sizeof($sectionname)-1];
load_module_javascript($sectionname);
print "</head><body topmargin=\"0\" leftmargin=\"8\" marginheight=\"8\" marginwidth=\"8\" bgcolor=\"#FFFFFF\">";
}
if(strlen($section)>0)
{
$objSections->SetCurrentSection($section);
$sec = $objSections->GetCurrentSection();
if ($sec->Get("notitle") != 1) print $objSections->page_title();
print $objSections->page_tabs($envar);
if ($sec->Get("nonavbar") != 1) //Section Navigatior
print $objSections->section_header($envar,$NavBarText,$ExtraTitle,false,$OtherSection);
//Toolbar if appropriate
if ( isset($sections[$section]) && ($sections[$section]['toolbar']==1) || ( is_object($toolbar) ) )
print $toolbar->Build();
}
}//Page Header
// HELP Page Header
function int_help_header()
{
global $pathtoroot;
global $pathtolocal;
global $section;
global $objSections;
global $rootURL;
global $localURL;
global $adminURL;
global $envar;
global $admin;
global $metatag;
$style_sheet_global = $adminURL."/include/style.css";
$style_sheet_local = $localURL."admin/include/style.css";
// TOOLBAR:
print "<html><head><title>In-Portal - Help</title>";
print "<meta http-equiv=\"content-type\" content=\"text/html;charset=iso-8859-1\">";
print "<meta http-equiv=\"Pragma\" content=\"no-cache\">";
print "<link rel=\"stylesheet\" type=\"text/css\" href=\"$style_sheet_global\">";
load_module_styles();
require_once ($pathtoroot.$admin."/include/mainscript.php");
print "</head><body topmargin=\"0\" leftmargin=\"8\" marginheight=\"8\" marginwidth=\"8\" bgcolor=\"#FFFFFF\">";
if(strlen($section)>0)
{
$objSections->SetCurrentSection($section);
$sec = $objSections->GetCurrentSection();
if ($sec->Get("notitle") != 1) print $objSections->page_title();
if ($sec->Get("nonavbar") != 1) //Section Navigatior
print $objSections->section_header($envar,'','', true);
}
}// HELP Page Header
function int_SectionHeader($toolbar=NULL,$onLoad=NULL,$NavBarText=NULL,$ExtraTitle=NULL)
{
global $pathtoroot;
global $pathtolocal;
global $section, $sections;
global $objSections;
global $rootURL;
global $adminURL,$admin;
global $localURL;
global $envar;
global $b_topmargin;
if (!isset($b_topmargin))
$b_topmargin = 8;
$sectionname = explode(":", $section);
$sectionname = $sectionname[sizeof($sectionname)-1];
load_module_javascript($sectionname);
if(is_object($toolbar))
print $toolbar->GetInitScript();
print "</head><body topmargin=\"$b_topmargin\" leftmargin=\"8\" marginheight=\"$b_topmargin\" marginwidth=\"8\" bgcolor=\"#FFFFFF\"";
//*** Preload toolbar images
if(strlen($onLoad))
{
print $onLoad;
}
else
print " onload=\"if (clear_checkboxes) clear_checkboxes();\"";
print ">";
global $b_header_addon;
if (isset($b_header_addon)) echo $b_header_addon;
if(strlen($section)>0)
{
$objSections->SetCurrentSection($section);
$sec = $objSections->GetCurrentSection();
if ($sec->Get("notitle")!=1)
print $objSections->page_title();
print $objSections->page_tabs($envar);
//Section Navigatior
if ($sec->Get("nonavbar")!=1)
{
if (is_null($ExtraTitle))
$ExtraTitle = "";
print $objSections->section_header($envar,$NavBarText,$ExtraTitle);
}
//Toolbar if appropriate
if( isset($sections[$section]) )
if($sections[$section]['toolbar'] == 1 || (is_object($toolbar)) )
print $toolbar->Build();
}
}//Section Page Header
//***********************************
//SubSection Title
function int_subsection_title($caption, $ColSpan = 5)
{
int_table_color(1);
print <<<END
<!-- Subsection Title -->
<tr class="subsectiontitle">
<td colspan="$ColSpan">$caption</td>
</tr>
END;
}
function int_subsection_title_install($caption)
{
int_table_color(1);
print <<<END
<!-- Subsection Title -->
<tr class="subsectiontitle">
<td colspan="3">$caption</td>
</tr>
END;
}
function int_subsection_title_ret($caption)
{
int_table_color_ret(1);
$o = "<!-- Subsection Title --><tr class=\"subsectiontitle\"><td colspan=\"5\">$caption</td></tr>";
return $o;
}
//SubSection Title
//***********************************
//Table Alternating colors
function int_table_color($reset_color=0, $return_result = false)
{
static $colorset;
if($reset_color)
{ $colorset="table_color2";
return;
}
if ($colorset == "table_color1")
$colorset = "table_color2";
else
$colorset = "table_color1";
$ret = "class=\"".$colorset."\"";
if($return_result)
return $ret;
else
print $ret;
}//Table Alternating colors
//Table Alternating colors with return
function int_table_color_ret($reset_color=0)
{
static $colorset;
if($reset_color)
{ $colorset="table_color2";
return;
}
if ($colorset == "table_color1")
$colorset = "table_color2";
else
$colorset = "table_color1";
return "class=\"".$colorset."\"";
}//Table Alternating colors
//***********************************
//Hint
function int_hint($caption)
{
global $imagesURL;
print <<<END
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td>
<span class="hint"><img src="$imagesURL/smicon7.gif" width="14" height="14" align="absmiddle">$caption</span>
<td>
</tr>
</table>
END;
}//Hint
function int_hint_red($caption)
{
global $imagesURL;
print <<<END
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td>
<span class="hint_red">$caption</span>
<td>
</tr>
</table>
END;
}//Hint
//***********************************
//Navigation String
function int_nav($caption)
{
global $pathtoroot;
global $imagespath;
print <<<END
<table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="#f0f0f0">
<tr>
<td><b class="text"><span class="navbar"><a class="navbar" href="">$caption</a></span></b></td>
</tr>
</table>
END;
}//Navigation String
//***********************************
//Print Out Images
function int_img($img)
{
global $images;
global $pathtoroot;
global $imagesURL;
$src = $imagesURL."/".$images[$img]['file'];
$alt = $images[$img]['alt'];
$width = $images[$img]['width'];
$height = $images[$img]['height'];
$name = $img;
//Set ID if needed
if ($img == 'img:tool:view')
$id = "ID=\"viewbutton\"";
print "<img alt=\"$alt\" name=\"$name\" src=\"$src\" width=\"$width\" height=\"$height\" $id border=\"0\" align=\"absmiddle\">";
}//Print Out Images
//***********************************
//Page Footer
function int_footer()
{
- global $objSession;
-
- if($objSession->HasSystemPermission("DEBUG.INFO"))
- {
- //phpinfo();
- }
- print <<<END
+ global $objSession;
+ if($objSession->HasSystemPermission("DEBUG.INFO"))
+ {
+ //phpinfo();
+ }
+ print <<<END
</body>
</html>
END;
}//Page Footer
function HomeEnv()
{
global $m_var_list_update;
$m_var_list_update["cat"]=0;
return BuildEnv();
}
function UpEnv()
{
global $m_var_list_update,$objCatList;
$current = $objCatList->CurrentCat();
$parent = $current->Get("ParentId");
$m_var_list_update["cat"]=$parent;
return BuildEnv();
}
function ModuleInclude($file)
{
global $pathtoroot;
$m = GetModuleArray();
foreach($m as $key=>$value)
{
$path = $pathtoroot.$value.$file;
if(file_exists($path))
{
echo "<!-- $path -->";
@include_once($path);
}
}
}
function MultiEditButtons(&$ToolBar,$next,$prev,$Form,$StatusField, $url,$onClick, $ExtraVar="", $prev_phrase = 'Phrase Not Passed', $next_phrase = 'Phrase Not Passed')
{
global $adminURL;
$ToolBar->Add("divider");
if($prev>-1)
{
$MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');";
$MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');";
$var="env=".BuildEnv()."&en=$prev&lpn=".GetVar('lpn');
if (strlen($ExtraVar))
$var.= $ExtraVar;
if ($onClick != 'LangSubmitMove') {
$link = "javascript:edit_submit('$Form','$StatusField','$url',0,'$var');";
}
else {
$link = "javascript:$onClick('$url', '$prev')";
}
$ToolBar->Add("moveleft",$prev_phrase,$link,$MouseOver,$MouseOut,"","toolbar/tool_prev.gif");
}
else
{
$MouseOver="";
$MouseOut="";
//$onClick="";
$link="#";
$ToolBar->Add("moveleft",$prev_phrase,"#","","","","toolbar/tool_prev_f3.gif");
}
if($next>-1)
{
$MouseOver="swap('moveright','toolbar/tool_next_f2.gif');";
$MouseOut="swap('moveright', 'toolbar/tool_next.gif');";
$var="env=".BuildEnv()."&en=$next".( isset($_REQUEST['lpn']) ? '&lpn='.$_REQUEST['lpn'] : '');
if (strlen($ExtraVar))
$var.= $ExtraVar;
if ($onClick != 'LangSubmitMove') {
$link = "javascript:edit_submit('$Form','$StatusField','$url',0,'$var');";
}
else {
$link = "javascript:$onClick('$url', '$next')";
}
$ToolBar->Add("moveright",$next_phrase,$link,$MouseOver,$MouseOut,"","toolbar/tool_next.gif");
}
else
{
$ToolBar->Add("moveright",$next_phrase,"#","","","","toolbar/tool_next_f3.gif");
}
}
function InsertButtons(&$ToolBar, $Buttons = Array(), $params = Array() )
{
foreach($Buttons as $button)
switch($button)
{
case 'save':
$ToolBar->Add( "img_save", "la_Save", "#",
"swap('img_save','toolbar/tool_select_f2.gif');",
"swap('img_save', 'toolbar/tool_select.gif');",
"edit_submit('".$params['form']."','".$params['status_field']."','".$params['url']."',1,'&lpn=".$_REQUEST['lpn']."');","tool_select.gif");
break;
case 'cancel':
$ToolBar->Add( "img_cancel", "la_Cancel", "#",
"swap('img_cancel','toolbar/tool_cancel_f2.gif');",
"swap('img_cancel', 'toolbar/tool_cancel.gif');",
"edit_submit('".$params['form']."','".$params['status_field']."','".$params['url']."',2,'&lpn=".$_REQUEST['lpn']."');","tool_cancel.gif");
break;
case 'edit':
break;
case 'delete':
break;
}
}
function GetTitle($item_phrase, $tab_phrase, $id, $item_name = false)
{
//gets correct caption for editing windows with tabs
//echo "In: $item_phrase, $tab_phrase, $id";
$is_new = (isset($_REQUEST['new']) && ($_REQUEST['new'] == 1)) || $id <= 0 ? 1 : 0;
$text = $is_new ? 'la_Text_Adding' : 'la_Text_Editing';
$text = admin_language($text).' '.admin_language($item_phrase);
if($is_new == 0) {
if ($item_name == false) {
$text .= ' #'.$id;
}
else {
if ($item_name != '') {
$text .= " '".$item_name."'";
}
}
}
if ($tab_phrase != '') {
$text .= ' - '.admin_language($tab_phrase);
}
return $text;
}
function MarkFields($form_name)
{
// mark specified form fields as required
?> <script language="JavaScript">MarkAsRequired(document.getElementById("<?php echo $form_name; ?>"));</script> <?php
}
?>
Property changes on: trunk/admin/include/elements.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.13
\ No newline at end of property
+1.14
\ No newline at end of property

Event Timeline