350, 'h' => 220); private $_defaultPicture; function __construct($plugin, $mode, $renderer, $data){ parent::__construct($plugin, $mode, $renderer, $data); $this->_defaultPicture = $data['defaultPicture']; } function _print($tab, $type) { $this->renderer->doc .= '
'; foreach($tab as $item) { $picture = $this->_getFirstImage($item['id']); $url = wl($item['id']); // TODO: implement support for non-HTML mode // Note that, wrt indexing, it's not an issue to build a ourselves instead of using the api // because non xhtml mode (eg: "metadata" mode) isn't plugged on this xhtml specific code $optionalId = ''; if ($this->includeItemsInTOC) { $anchorId = $this->buildAnchorId($item); $optionalId = 'id="' . $anchorId . '"'; $this->renderer->toc_additem($anchorId, $item['nameToDisplay'], $this->renderer->getLastLevel() + 1); } $this->renderer->doc .= ''; $this->renderer->doc .= '
'; $this->renderer->doc .= ''.$item['nameToDisplay']; if ( $this->_displayModificationDate ){ $this->renderer->doc .= '' . date('d/m/Y', $item['mtime']); } $this->renderer->doc .= '
'; } $this->renderer->doc .= '
'; } private function _getFirstImage($pageId){ $meta = p_get_metadata($pageId); $picture = $meta['relation']['firstimage']; if ( $picture != "" ){ return ml($picture, self::$_dims, true); } else { if ( $this->_defaultPicture == '' ){ return "lib/tpl/dokuwiki/images/logo.png"; } else { return ml($this->_defaultPicture, self::$_dims, true); } } } }