/** * getFilesOutput * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function getFilesOutput($rowset, $strFieldName, $strViewType) { $this->core->logger->debug('cms->views->helpers->PageHelper->getFilesOutput()'); $this->objViewHelper = new ViewHelper(); $strOutput = ''; foreach ($rowset as $row) { if ($strViewType != '' && $strViewType == $this->core->sysConfig->viewtypes->thumb) { if ($row->isImage) { if ($row->xDim < $row->yDim) { $strMediaSize = 'height="100"'; } else { $strMediaSize = 'width="100"'; } $strOutput .= '<div style="position: relative;" class="mediaitem" fileid="' . $row->id . '" id="' . $strFieldName . '_mediaitem_' . $row->id . '"> <table> <tbody> <tr> <td> <img src="' . sprintf($this->core->sysConfig->media->paths->thumb, $row->path) . $row->filename . '?v=' . $row->version . '" id="Img' . $row->id . '" ' . $strMediaSize . '/> </td> </tr> </tbody> </table> <div class="itemremovethumb" id="' . $strFieldName . '_remove' . $row->id . '" onclick="myForm.removeItem(\'' . $strFieldName . '\', \'' . $strFieldName . '_mediaitem_' . $row->id . '\', ' . $row->id . '); return false;"></div> </div>'; } } else { if ($row->isImage) { $strOutput .= '<div class="fileitem" fileid="' . $row->id . '" id="' . $strFieldName . '_fileitem_' . $row->id . '"> <div class="olfileleft"></div> <div class="itemremovelist" id="' . $strFieldName . '_remove' . $row->id . '" onclick="myForm.removeItem(\'' . $strFieldName . '\', \'' . $strFieldName . '_fileitem_' . $row->id . '\', ' . $row->id . '); return false;"></div> <div class="olfileitemicon"><img width="32" height="32" src="' . sprintf($this->core->sysConfig->media->paths->icon32, $row->path) . $row->filename . '?v=' . $row->version . '" id="File' . $row->id . '" alt="' . htmlentities($row->description, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '"/></div> <div class="olfileitemtitle">' . htmlentities($row->title == '' && (isset($row->alternativTitle) || isset($row->fallbackTitle)) ? isset($row->alternativTitle) && $row->alternativTitle != '' ? $row->alternativTitle : $row->fallbackTitle : $row->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</div> <div class="clear"></div> </div>'; } else { $strOutput .= '<div class="fileitem" fileid="' . $row->id . '" id="' . $strFieldName . '_fileitem_' . $row->id . '"> <div class="olfileleft"></div> <div class="itemremovelist" id="' . $strFieldName . '_remove' . $row->id . '" onclick="myForm.removeItem(\'' . $strFieldName . '\', \'' . $strFieldName . '_fileitem_' . $row->id . '\', ' . $row->id . '); return false;"></div> <div class="olfileitemicon"><img width="32" height="32" src="' . $this->objViewHelper->getDocIcon($row->extension, 32) . '" id="File' . $row->id . '" alt="' . htmlentities($row->description, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '"/></div> <div class="olfileitemtitle">' . htmlentities($row->title == '' && (isset($row->alternativTitle) || isset($row->fallbackTitle)) ? isset($row->alternativTitle) && $row->alternativTitle != '' ? $row->alternativTitle : $row->fallbackTitle : $row->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</div> <div class="clear"></div> </div>'; } } } return $strOutput . '<div id="divClear_' . $strFieldName . '" class="clear"></div>'; }
/** * getListView * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function getListView($rowset, $arrFileIds) { $this->core->logger->debug('cms->views->helpers->OverlayHelper->getListView()'); $this->objViewHelper = new ViewHelper(); /** * create header of list output */ $strOutputTop = ' <div> <div class="olfiletopleft"></div> <div class="olfiletopitemicon"></div> <div class="olfiletopitemtitle bold">Titel</div> <div class="olfiletopright"></div> <div class="clear"></div> </div>'; /** * output of list rows (elements) */ $strOutput = ''; $blnIsImageView = false; if (count($rowset) > 0) { $strOutput .= ' <div class="olfileitemcontainer">'; foreach ($rowset as $row) { $strHidden = ''; if (array_search($row->id, $arrFileIds) !== false) { $strHidden = ' style="display:none;"'; } if ($row->isImage) { $blnIsImageView = true; if ($row->xDim < $row->yDim) { $strMediaSize = 'height="32"'; } else { $strMediaSize = 'width="32"'; } $strOutput .= ' <div class="olfileitem" id="olFileItem' . $row->id . '" onclick="myOverlay.addItemToThumbArea(\'olFileItem' . $row->id . '\', ' . $row->id . '); return false;"' . $strHidden . '> <div class="olfileleft"></div> <div style="display:none;" id="Remove' . $row->id . '" class="itemremovelist"></div> <div class="olfileitemicon"><img ' . $strMediaSize . ' id="File' . $row->id . '" src="' . sprintf($this->core->sysConfig->media->paths->icon32, $row->path) . $row->filename . '?v=' . $row->version . '" alt="' . $row->description . '"/></div> <div class="olfileitemtitle">' . htmlentities($row->title == '' && (isset($row->alternativTitle) || isset($row->fallbackTitle)) ? isset($row->alternativTitle) && $row->alternativTitle != '' ? $row->alternativTitle : $row->fallbackTitle : $row->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</div> <div class="olfileright"></div> <div class="clear"></div> </div>'; } else { $strOutput .= ' <div class="olfileitem" id="olFileItem' . $row->id . '" onclick="myOverlay.addFileItemToListArea(\'olFileItem' . $row->id . '\', ' . $row->id . '); return false;"' . $strHidden . '> <div class="olfileleft"></div> <div style="display:none;" id="Remove' . $row->id . '" class="itemremovelist"></div> <div class="olfileitemicon"><img width="32" height="32" id="File' . $row->id . '" src="' . $this->objViewHelper->getDocIcon($row->extension, 32) . '" alt="' . $row->description . '"/></div> <div class="olfileitemtitle">' . htmlentities($row->title == '' && (isset($row->alternativTitle) || isset($row->fallbackTitle)) ? isset($row->alternativTitle) && $row->alternativTitle != '' ? $row->alternativTitle : $row->fallbackTitle : $row->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</div> <div class="olfileright"></div> <div class="clear"></div> </div>'; } } $strOutput .= ' <div class="clear"></div> </div>'; } /** * list footer */ $strOutputBottom = ' <div> <div class="olfilebottomleft"></div> <div class="olfilebottomcenter"></div> <div class="olfilebottomright"></div> <div class="clear"></div> </div>'; /** * return html output */ if ($strOutput != '') { if ($blnIsImageView) { return $strOutput . '<div class="clear"></div>'; } else { return $strOutputTop . $strOutput . $strOutputBottom . '<div class="clear"></div>'; } } }
/** * getListView * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function getListView($rowset, $arrFileIds) { $this->core->logger->debug('cms->views->helpers->OverlayHelper->getListView()'); $this->objViewHelper = new ViewHelper(); /** * create header of list output */ $strOutputTop = ' <div> <div class="oldoctopleft"></div> <div class="oldoctopitemicon"></div> <div class="oldoctopitemtitle bold">Titel</div> <div class="oldoctopright"></div> <div class="clear"></div> </div> <div class="oldocitemcontainer">'; /** * output of list rows (elements) */ $strOutput = ''; foreach ($rowset as $row) { $strHidden = ''; if (array_search($row->id, $arrFileIds) !== false) { $strHidden = ' style="display:none;"'; } if ($row->isImage) { $strOutput .= ' <div class="oldocitem" id="olDocItem' . $row->id . '" onclick="myOverlay.addItemToListArea(\'olDocItem' . $row->id . '\', ' . $row->id . '); return false;"' . $strHidden . '> <div class="oldocleft"></div> <div style="display:none;" id="Remove' . $row->id . '" class="itemremovelist"></div> <div class="oldocitemicon"><img width="32" height="32" id="Doc' . $row->id . '" src="' . $this->core->sysConfig->media->paths->icon32 . $row->filename . '" alt="' . $row->description . '" width="16" height="16"/></div> <div class="oldocitemtitle">' . $row->title . '</div> <div class="oldocright"></div> <div class="clear"></div> </div>'; } else { $strOutput .= ' <div class="oldocitem" id="olDocItem' . $row->id . '" onclick="myOverlay.addItemToListArea(\'olDocItem' . $row->id . '\', ' . $row->id . '); return false;"' . $strHidden . '> <div class="oldocleft"></div> <div style="display:none;" id="Remove' . $row->id . '" class="itemremovelist"></div> <div class="oldocitemicon"><img width="32" height="32" id="Doc' . $row->id . '" src="' . $this->objViewHelper->getDocIcon($row->extension, 32) . '" alt="' . $row->description . '"/></div> <div class="oldocitemtitle">' . $row->title . '</div> <div class="oldocright"></div> <div class="clear"></div> </div>'; } } /** * list footer */ $strOutputBottom = ' <div class="clear"></div> </div> <div> <div class="oldocbottomleft"></div> <div class="oldocbottomcenter"></div> <div class="oldocbottomright"></div> <div class="clear"></div> </div>'; /** * return html output */ if ($strOutput != '') { return $strOutputTop . $strOutput . $strOutputBottom . '<div class="clear"></div>'; } }