Location: PHPKode > projects > QuickTicket > quickticket/quickticket/bin/qti_fn_html.php
<?php

// QuickTicket 1.9.0.3 build:20081001

function HtmlDtd()
{

echo QTI_HTML_DTD,'
<html xmlns="http://www.w3.org/1999/xhtml" dir="',QTI_HTML_DIR,'" xml:lang="',QTI_HTML_LANG,'">
';

}

// --------

function HtmlHead($strRoot='',$strSkin='',$arrCss=array(),$strHeaderAddScript='',$arrJava=array())
{

if ( empty($strSkin) ) $strSkin = $_SESSION[QT]['skin_dir'];
if ( !isset($arrJava['com']) ) $arrJava['com']=true;

echo '
<head>
<title>',$_SESSION[QT]['site_name'],'</title>
<meta http-equiv="content-type" content="text/html; charset=',QTI_HTML_CHAR,'"/>
<link rel="shortcut icon" href="',$strRoot,$strSkin,'/qti_icon.ico"/>
<link rel="stylesheet" type="text/css" href="',$strRoot,$strSkin,'/qti_main.css"/>';

foreach ($arrCss as $strCss)
{
echo '
<link rel="stylesheet" type="text/css" href="'.$strRoot,$strSkin.'/'.$strCss.'"/>';
}

if ( !empty($strHeaderAddScript) ) echo $strHeaderAddScript;

if ( isset($arrJava['com']) ) {
if ( $arrJava['com'] ) {
echo '
<script type="text/javascript">
<!--
';
include($strRoot.'bin/qti_j_common.js');
echo '
-->
</script>';
}}

if ( isset($arrJava['bbc']) && $_SESSION[QT]['bbc']!='0' ) {
if ( $arrJava['bbc'] ) {
echo '<script type="text/javascript">
<!--
';
include('bin/qti_j_bbc.js');
echo '
-->
</script>
';
}}

if ( isset($arrJava['img']) ) {
if ( $arrJava['img'] ) {
echo '<script type="text/javascript">
<!--
function changeimg(cimg,ref) { document.images[cimg].src = ref }
-->
</script>
';
}}

if ( isset($arrJava['iestyle']) ) {
if ( $arrJava['iestyle'] ) {
echo '
<!--[if IE]><style type="text/css">.p_post_code{width:500px}</style><![endif]-->
';
}}

echo '
</head>
';

}

// --------

function HtmlPageCtrl($intType=0,$strWidth='')
{

if ( empty($strWidth) ) $strWidth=$_SESSION[QT]['site_width'];
switch ($intType)
{
case 0: echo '
<!-- PAGE CONTROL -->
<div class="div_qti_page">
<table class="ta_qti_page" width="',$strWidth,'" cellspacing="0" cellpadding="0"><tr class="tr_qti_page"><td class="td_qti_page">
<!-- PAGE CONTROL -->
';
break;
case 1: echo '
<!-- END PAGE CONTROL -->
</td></tr></table>
</div>
<!-- END PAGE CONTROL -->
';
break;
}

}

// --------

function HtmlBanner($intType=0,$strSkin='',$strLogo='',$strLangMenu='')
{

if ( empty($strSkin) ) $strSkin=$_SESSION[QT]['skin_dir'];
if ( empty($strLogo) ) $strLogo='qti_logo.gif';

switch ($intType)
{
case 0: echo '
<!-- HEADER BANNER -->
<div class="div_banner"><div class="div_banner_in">
<table class="ta_hidden" cellspacing="0"><tr class="tr_hidden">
<td class="td_hidden" id="zone_banner_left"><img id="img_banner_logo" src="',$strSkin,'/',$strLogo,'" alt="',$_SESSION[QT]['site_name'],'" title="',$_SESSION[QT]['site_name'],'"/></td>
<td class="td_hidden" id="zone_banner_right">',$strLangMenu,'</td>
</tr></table></div></div>
<!-- END HEADER BANNER -->
';
break;
case 1: echo '
<!-- HEADER NOBANNER -->
<table class="ta_hidden" cellspacing="0"><tr style="vertical-align:top">
<td id="zone_nobanner_left">&nbsp;</td>
<td id="zone_nobanner_right">&nbsp;',$strLangMenu,'</td>
</tr></table>
<!-- END HEADER NOBANNER -->
';
break;
case 2: echo '
<!-- HEADER BANNER -->
<div class="div_banner">
<div class="div_banner_in">
<img src="',$strSkin,'/',$strLogo,'" width="175" height="50" style="border-width:0" alt="QuickTeam" title="QuickTeam"/>
</div>
</div>
<!-- END HEADER BANNER -->
';
break;
}

}

// --------

function HtmlMsg($intType=0,$strWidth='',$strTitleId='',$strTitle='',$strBodyId='',$strBody='')
{

if ( empty($strWidth) ) $strWidth='350px';

switch ($intType)
{
case 0: echo '
<div class="div_msgbox" style="width:',$strWidth,'">
<div class="div_msgboxtitle"',(empty($strTitleId) ? '' : ' id="'.$strTitleId.'"'),'>',$strTitle,'</div>
<div class="div_msgboxbody"',(empty($strBodyId) ? '' : ' id="'.$strBodyId.'"'),'>',(empty($strBody) ? '' : $strBody),'
';
break;
case 1: echo '
</div>
</div>
';
break;
}

}

// --------

function HtmlTabs($arrTabs=array(0=>'Empty'),$strUrl='', $strCurrent='',$intMax=6,$bFirst=true,$bLast=true)
{

// tabx means the last tab (can be special due to popup)
// if defined, the class/style tab_on replaces the class/style tab (but you can cumulate the classes in the definition)
// if defined, the class/style tabx_on replaces the class/style tabx (but you can cumulate the styles in the definition)

// When strCurrent is defined, this tab will not be clickable

$iCurrent=1;
foreach (array_keys($arrTabs) as $strKey)
{
  if ($strKey==$strCurrent) break;
  $iCurrent++;
}

// check

if ( !is_array($arrTabs) ) die('HtmlTabs: Argument #1 must be an array');
if ( !empty($strUrl) ) { if ( !strstr($strUrl,'?') ) $strUrl .= '?'; }

// display

echo'
<!-- tab header begin -->
<table cellspacing="0" class="ta_tab">
<tr class="tr_tab">
';

if ( $bFirst ) echo '<td class="td_tab td_tab_begin">&nbsp;</td>'."\n";

$i=1;
foreach ($arrTabs as $strKey=>$strTab)
{
  $strTabDesc = '';
  // strTab can be an array (as generated by cSection->GetTabs) instead of just the name
  if ( is_array($strTab) )
  {
    if ( isset($strTab['tabdesc']) )
    {
      if ( !empty($strTab['tabdesc']) ) $strTabDesc = $strTab['tabdesc'];
    }
    if ( isset($strTab['tabname']) )
    {
      if ( !empty($strTab['tabname']) ) { $strTab=$strTab['tabname']; } else { $strTab=ObjTrans('tab',$strKey); }
    }
    else
    {
      $strTab=ObjTrans('tab',$strKey);
    }
  }

  if ( $i<$intMax )
  {
    echo '<td class="td_tab td_tab_a',($strCurrent==$strKey ? '_on' : ''),'">';
    if ( empty($strUrl) || $strCurrent==$strKey )
    {
    echo $strTab;
    }
    else
    {
    echo '<a class="a_tab" href="',$strUrl,'&amp;tt=',$strKey,'"',(empty($strTabDesc) ? '' : ' title="'.$strTabDesc.'"'),' onclick="return warningedited(bEdited,\'Data not yet saved. Quit without saving?\');">',$strTab,'</a>';
    }
    echo '</td>',"\n";
  }

  // last tab

  if ( $i>=$intMax )
  {
    if ( count($arrTabs)==$intMax )
    {
      echo '<td class="td_tab td_tab_a',($strCurrent==$strKey ? '_on' : ''),'">';
      if ( empty($strUrl) || $strCurrent==$strKey )
      {
      echo $strTab;
      }
      else
      {
      printf( '<a%s href="%s"%s onclick="return warningedited(bEdited,\'Data not yet saved. Quit without saving?\');">%s</a>', (isset($arrClass['a']) ? ' class="'.$arrClass['a'].'"' : ''), $strUrl.'&amp;tt='.$strKey, (empty($strTabDesc) ? '' : ' title="'.$strTabDesc.'"'), $strTab );
      }
      echo '</td>',"\n";
    }
    else
    {
      if ( $i==$intMax )
      {
        // form
        echo '<td class="td_tab td_tab_z',( $iCurrent>=$intMax ? '_on' : '' ),'">'; //printf( '<td%s%s>', $strClass, $strStyle );
        echo (empty($strUrl) ? '' : '<form method="post" action="'.$strUrl.'">'),'<select id="poptab" name="tt" class="small">';
      }
      echo '<option value="',$strKey,'"',($strCurrent==$strKey ? QSEL : ''),'>',$strTab,'</option>';
      if ( $i==count($arrTabs) ) echo '</select>',(empty($strUrl) ? '' : '<input class="small" type="submit" id="tabok" name="tabok" value="&raquo;" onclick="return warningedited(bEdited,\'Data not yet saved. Quit without saving?\');"/></form>'),'</td>',"\n";
    }
  }
  $i++;
}

if ( $bLast ) echo '<td class="td_tab td_tab_end">&nbsp;</td>'."\n";

echo '
</tr>
</table>
<!-- tab header end -->
';
}

?>
Return current item: QuickTicket