/**
 *  Zeigt eine Tabellarische Übersicht der Bilder an
 *  Hier werden die Zeilenanzahl und die Bilder-Pro Zeile
 *  wie sie im Objekt definiert wurden als Konfiguration verwendet
 *  ($this->PICS_PER_LINE   und    $this->MAXIMUM_LINES)
 */
 function getPicturelist()
 {
     if (count($this->PICS) <= 0) {
         return;
     }
     $picCounter = 0;
     $lineCounter = 1;
     $reachedFirstPicture = false;
     $picWidth = round(($this->WIDTH - 50) / $this->PICS_PER_LINE - $this->PICS_PER_LINE * 4);
     if ($picWidth < 0 || $picWidth > $this->WIDTH) {
         $picWidth = 150;
     }
     $picnr = ($this->CURRENT_PAGE - 1) * $this->MAXIMUM_LINES * $this->PICS_PER_LINE;
     $pCnt = $this->MAXIMUM_LINES * $this->PICS_PER_LINE;
     $hiddenPath = new HiddenField("Current_BB_Path", substr($this->PATH, strlen($_SERVER['DOCUMENT_ROOT'])));
     $form = new Form($this->PARENT_PAGE, "haupt");
     $form->add($hiddenPath);
     $table = new Table($this->getPictureTableColnamesArray());
     $table->setAlign($this->getAlign());
     $table->setBorder(0);
     $row = $table->createRow();
     for ($i = $picnr; $i < $picnr + $pCnt && $i < count($this->PICS); $i++) {
         $pic = $this->PICS[$i];
         if (is_file($pic) && $lineCounter <= $this->MAXIMUM_LINES) {
             $img = new Image(substr($pic, strlen($_SERVER['DOCUMENT_ROOT']) . dirname($_SERVER['SCRIPT_NAME'])), -1, -1, $picWidth, 0, 0);
             $img->setToolTip(getCommentDialogForImage($img->getSource()));
             $img->setCommentsActive(true);
             checkForInsertBBComment();
             $img->setBorder(0);
             $linkStartPos = strlen($_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']));
             if (strlen(dirname($_SERVER['SCRIPT_NAME'])) <= 1) {
                 $linkStartPos = $linkStartPos - 1;
             }
             if ($this->LINKPREFIX != "" && substr($this->LINKPREFIX, strlen($this->LINKPREFIX) - 1, 1) != "&") {
                 $this->LINKPREFIX = $this->LINKPREFIX . "&";
             }
             $lnk = new Link($this->PARENT_PAGE . "?" . $this->LINKPREFIX . "showPic=" . $i . "&Current_BB_Path=" . substr($this->PATH, strlen($_SERVER['DOCUMENT_ROOT'])), $img, false);
             $lnkDirect = new Link(substr($this->PICS[$i], $linkStartPos), $img, false, $this->CURRENT_PICTURE, "newPic");
             if ($this->IMAGEDIRECTLINK) {
                 $row->setAttribute($picCounter, $lnkDirect);
             } else {
                 $row->setAttribute($picCounter, $lnk);
             }
             // Neue Zeile starten
             if ($picCounter + 1 >= $this->PICS_PER_LINE) {
                 $picCounter = -1;
                 $table->addRow($row);
                 $lineCounter++;
                 if ($lineCounter <= $this->MAXIMUM_LINES) {
                     $row = $table->createRow();
                 }
             }
             $picCounter++;
         }
     }
     if ($picCounter != 0) {
         $table->addRow($row);
     }
     $form->add($table);
     return $form;
 }
Beispiel #2
0
 /**
  * erzeugt ein IMG-Objekt der Grafik (Orginal wird angezeigt. Keine generierung)
  * 
  * @param $p relative Pfadangabe  
  */
 function generatePicture($p)
 {
     if ($this->COMMENTS_ACTIVE) {
         checkForInsertBBComment();
         $this->setToolTip(getCommentDialogForImage($this->getSource()) . getCommentsListForImage($this->getSource()));
     }
     $imgSrc = $this->getImgSrc($p);
     echo $imgSrc;
 }