Ejemplo n.º 1
0
}
if ($getMode !== 'csv') {
    $datatable = false;
    $hoverRows = false;
    if ($getShowMembers === 0) {
        $htmlSubHeadline .= ' - ' . $gL10n->get('LST_ACTIVE_MEMBERS');
    } elseif ($getShowMembers === 1) {
        $htmlSubHeadline .= ' - ' . $gL10n->get('LST_FORMER_MEMBERS');
    } elseif ($getShowMembers === 2) {
        $htmlSubHeadline .= ' - ' . $gL10n->get('LST_ACTIVE_FORMER_MEMBERS');
    }
    if ($getMode === 'print') {
        // create html page object without the custom theme files
        $page = new HtmlPage();
        $page->hideThemeHtml();
        $page->hideMenu();
        $page->setPrintMode();
        $page->setTitle($title);
        $page->setHeadline($headline);
        $page->addHtml('<h5>' . $htmlSubHeadline . '</h5>');
        $table = new HtmlTable('adm_lists_table', $page, $hoverRows, $datatable, $classTable);
    } elseif ($getMode === 'pdf') {
        require_once SERVER_PATH . '/adm_program/libs/tcpdf/tcpdf.php';
        $pdf = new TCPDF($orientation, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
        // set document information
        $pdf->SetCreator(PDF_CREATOR);
        $pdf->SetAuthor('Admidio');
        $pdf->SetTitle($headline);
        // remove default header/footer
        $pdf->setPrintHeader(true);
        $pdf->setPrintFooter(false);
Ejemplo n.º 2
0
 /**
  * Create a html page if necessary and show the message with the configured buttons.
  * @param string $content  The message text that should be shown. The content could have html.
  * @param string $headline Optional a headline for the message. Default will be SYS_NOTE.
  */
 public function show($content, $headline = '')
 {
     // noetig, da dies bei den includes benoetigt wird
     global $gDb, $gL10n, $page;
     $html = '';
     // first perform a rollback in database if there is an open transaction
     $gDb->rollback();
     // Ueberschrift setzen, falls diese vorher nicht explizit gesetzt wurde
     if ($headline === '') {
         $headline = $gL10n->get('SYS_NOTE');
     }
     // Variablen angeben
     if (!$this->inline) {
         // nur pruefen, wenn vorher nicht schon auf true gesetzt wurde
         $this->inline = headers_sent();
     }
     if (!$this->inline) {
         // create html page object
         $page = new HtmlPage($headline);
         $page->hideMenu();
         if (!$this->includeThemeBody) {
             // don't show custom html of the current theme
             $page->hideThemeHtml();
         }
         // forward to next page after x seconds
         if ($this->timer > 0) {
             $page->addJavascript('window.setTimeout("window.location.href=\'' . $this->forwardUrl . '\'", ' . $this->timer . ');');
         }
     } elseif (!$this->modalWindowMode) {
         header('Content-type: text/html; charset=utf-8');
         $html .= '<h1>' . $headline . '</h1>';
     }
     // create html for buttons
     $htmlButtons = '';
     if ($this->showButtons) {
         if ($this->forwardUrl !== '') {
             if ($this->showYesNoButtons) {
                 $htmlButtons .= '
                     <button id="admButtonYes" class="btn" type="button" onclick="self.location.href=\'' . $this->forwardUrl . '\'">
                         <img src="' . THEME_PATH . '/icons/ok.png" alt="' . $gL10n->get('SYS_YES') . '" />
                         &nbsp;&nbsp;' . $gL10n->get('SYS_YES') . '&nbsp;&nbsp;&nbsp;
                     </button>
                     <button id="admButtonNo" class="btn" type="button" onclick="history.back()">
                         <img src="' . THEME_PATH . '/icons/error.png" alt="' . $gL10n->get('SYS_NO') . '" />
                         &nbsp;' . $gL10n->get('SYS_NO') . '
                     </button>';
             } else {
                 // Wenn weitergeleitet wird, dann auch immer einen Weiter-Button anzeigen
                 $htmlButtons .= '
                     <a class="btn" href="' . $this->forwardUrl . '">' . $gL10n->get('SYS_NEXT') . '
                         <img src="' . THEME_PATH . '/icons/forward.png" alt="' . $gL10n->get('SYS_NEXT') . '"
                             title="' . $gL10n->get('SYS_NEXT') . '" />
                     </a>';
             }
         } else {
             // Wenn nicht weitergeleitet wird, dann immer einen Zurueck-Button anzeigen
             // bzw. ggf. einen Fenster-Schließen-Button
             if (!$this->modalWindowMode) {
                 $htmlButtons .= '
                     <a class="btn" href="javascript:history.back()">
                         <img src="' . THEME_PATH . '/icons/back.png" alt="' . $gL10n->get('SYS_BACK') . '"
                             title="' . $gL10n->get('SYS_BACK') . '" />' . $gL10n->get('SYS_BACK') . '</a>';
             }
         }
     }
     if ($this->modalWindowMode) {
         $html .= '
             <div class="modal-header">
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                     <span aria-hidden="true">&times;</span>
                 </button>
                 <h4 class="modal-title">' . $headline . '</h4>
             </div>
             <div class="modal-body">' . $content . '</div>
             <div class="modal-footer">' . $htmlButtons . '</div>';
     } else {
         $html .= '
             <div class="message">
                 <p class="lead">' . $content . '</p>
                 ' . $htmlButtons . '
             </div>';
     }
     if ($this->showTextOnly) {
         // show the pure message text without any html
         echo strip_tags($content);
     } elseif ($this->showHtmlTextOnly) {
         // show the pure message text with their html
         echo $content;
     } elseif ($this->inline) {
         // show the message in html but without the theme specific header and body
         echo $html;
     } else {
         // show a Admidio html page with complete theme header and body
         $page->addHtml($html);
         $page->show();
     }
     exit;
 }