function strOpenBlock($strTitle, $strLinks, $attributes = null)
{
    //---------------------------------------------------------------------
    /* Typical usage:
          $this->load->helper ('js/div_hide_show');
          $displayData['js'] .= showHideDiv();
    
          $attributes = new stdClass;
          $attributes->lTableWidth      = 900;
          $attributes->lUnderscoreWidth = 300;
          $attributes->divID            = 'groupDiv';
          $attributes->divImageID       = 'groupDivImg';
          $attributes->bStartOpen       = true;
          $attributes->bAddTopBreak     = true;
    
          openBlock('My little section', $strMyLittleLinks, $attributes);
          echoT('<table width="100%">');
          ...
          echoT('</table>');
          $attributes->bCloseDiv = true;
          closeBlock($attributes);
    ---------------------------------------------------------------------*/
    global $gbBrowserFirefox;
    $strOut = '';
    if (is_null($attributes)) {
        $attributes = new stdClass();
        $attributes->lTableWidth = 800;
        $attributes->lUnderscoreWidth = 400;
        $attributes->divImageID = null;
        $attributes->divID = null;
        $attributes->bStartOpen = false;
        $attributes->lMarginLeft = 0;
        $attributes->lTitleFontSize = 12;
        $attributes->bAddTopBreak = true;
    } else {
        if (!isset($attributes->lTableWidth)) {
            $attributes->lTableWidth = 800;
        }
        if (!isset($attributes->lUnderscoreWidth)) {
            $attributes->lUnderscoreWidth = 400;
        }
        if (!isset($attributes->divID)) {
            $attributes->divID = null;
        }
        if (!isset($attributes->divImageID)) {
            $attributes->divImageID = null;
        }
        if (!isset($attributes->bStartOpen)) {
            $attributes->bStartOpen = false;
        }
        if (!isset($attributes->lMarginLeft)) {
            $attributes->lMarginLeft = 0;
        }
        if (!isset($attributes->lTitleFontSize)) {
            $attributes->lTitleFontSize = 12;
        }
        if (!isset($attributes->bAddTopBreak)) {
            $attributes->bAddTopBreak = true;
        }
    }
    // note - if interior table width is greater than container table, stuff starts
    // dancing as the block is opened/closed; set table width null to not user the
    // width specification.
    if (is_null($attributes->lTableWidth)) {
        $strTabWidth = '';
    } else {
        $strTabWidth = ' width="' . $attributes->lTableWidth . '" ';
    }
    if (is_null($attributes->divID)) {
        $strDivImageLink = '';
        $strDivStart = '';
    } else {
        $strDivImageLink = '
          <a id="' . $attributes->divImageID . '"
             href="javascript:toggleDivViaImage(\'' . $attributes->divID . '\', \'' . $attributes->divImageID . '\', \'Show\', \'Hide\');"
             title="' . ($attributes->bStartOpen ? 'Hide' : 'Show') . '"
          > <img src="' . base_url() . 'images/misc/' . ($attributes->bStartOpen ? 'minus' : 'plus') . '.gif" border="0"></a>';
        $strDivStart = "\n" . '<div id="' . $attributes->divID . '" style="display: ' . ($attributes->bStartOpen ? 'block' : 'none') . ';">' . "\n";
    }
    $strMarginSpan = '<span style="margin-left: ' . $attributes->lMarginLeft . 'pt;">';
    //                          font-size: 0px;">';   // font size needed for firefox
    $strOut .= ($attributes->bAddTopBreak ? '<br/>' : '') . "\n" . $strMarginSpan . $strDivImageLink . '&nbsp;' . '<span style="font-size: ' . $attributes->lTitleFontSize . 'pt; font-variant: small-caps;">' . $strTitle . '</span>&nbsp;&nbsp;&nbsp;' . "\n" . $strLinks . '
         <br/>
         </span>
         <span style="margin-left: ' . $attributes->lMarginLeft . 'pt; ' . ($gbBrowserFirefox ? 'font-size: 0px;' : '') . '">' . strImgTagBlackLine($attributes->lUnderscoreWidth, 2) . '
         </span>' . $strDivStart . '
     <table ' . $strTabWidth . '>
        <tr>
           <td width="20pt;">&nbsp;</td>
           <td style="text-align: left; vertical-align: top;">' . "\n";
    return $strOut;
    //         <img src="'.base_url().'images/layout/separatorBlack.jpg"
    //            width="'.$attributes->lUnderscoreWidth.'px" height="2px" alt="---"
    //            style="vertical-align:text-top;" />
}
Ejemplo n.º 2
0
 function strLabelRowOneCol($strNote, $lColSpanNote, $strTRExtra = '', $lUnderscoreWidth = 0)
 {
     //---------------------------------------------------------------
     // spans two columns
     //---------------------------------------------------------------
     if ($this->bValueEscapeHTML) {
         $strNote = htmlspecialchars($strNote);
     }
     if ($lUnderscoreWidth > 0) {
         $strUnderscore = '<br>' . strImgTagBlackLine($lUnderscoreWidth, 2);
     } else {
         $strUnderscore = '';
     }
     $strHold = '<tr ' . $strTRExtra . '>
           <td colspan="2" class="' . $this->strEntryClass . '" style="padding-bottom: 6px;' . $this->strStyleExtraValue . '">' . $strNote . $this->strExtraFieldText . $strUnderscore . '
           </td>
        </tr>';
     $this->strExtraFieldText = '';
     return $strHold;
 }
            <td style="vertical-align: top; text-align: right;">' . strFormattedTimeViaMinutes($de->lTimeIn, $b24Hr) . '
            </td>
            <td style="vertical-align: top; text-align: right;">' . strFormattedTimeViaMinutes($de->lTimeOut, $b24Hr) . '
            </td>
            <td style="vertical-align: top; text-align: center;">' . strDurationViaMinutes($de->lTimeOut - $de->lTimeIn) . '
            </td>
            <td style="vertical-align: top; width: 100pt;">' . htmlspecialchars($de->location) . '
            </td>
            <td style="vertical-align: top; width: 220pt;">' . nl2br(htmlspecialchars($de->notes)) . '
            </td>
         </tr>');
     }
     echoT('
         <tr>
            <td colspan="3" style="margin: 0px; height: 2px;border-spacing: 0px; padding: 0px;">&nbsp;</td>
            <td colspan="8" style="margin: 0px; height: 2px;border-spacing: 0px; padding: 0px;">' . strImgTagBlackLine(600, 2) . '</td>
         </tr>');
     echoT('
         <tr>
            <td colspan="3">&nbsp;</td>
            <td colspan="4"><b>Total:</td>
            <td style="text-align: center;"><b>' . strDurationViaMinutes($lDateTot) . '
            </td>
         </tr>
         <tr><td colspan="8">&nbsp;</td></tr>');
 } else {
     echoT('
         <tr>
            <td colspan="7"><i>No entries for this date.</i></td>
         </tr>
         <tr>