/** * Display an html table with retrieved medias * * @access private */ private function display_table() { Html::mm_table('o'); if (!empty($this->_medias)) { foreach ($this->_medias as $item) { switch ($this->_view_type) { case 'image': $fname = basename($item->_permalink); $dirname = dirname($item->_permalink) . '/'; $path = $dirname . '150-' . $fname; $links = Html::mm_image_links($dirname, $fname); break; case 'video': $path = 'images/thumb_video.png'; $links = Html::mm_video_link($item->_permalink); break; case 'alien': $path = 'images/thumb_alien.png'; $links = Html::mm_alien_link($item->_embed_code); break; } Html::mm_table_row($item->_id, $path, $item->_name, $item->_type, $this->_view_type, $item->_author, $item->_author_name, $item->_date, $links, $this->_view_type); } } else { if (VPost::search_button(false)) { echo '<tr><td colspan="4">No media found</td></tr>'; } else { echo '<tr><td colspan="7">There is no media yet.</td></tr>'; } } Html::mm_table('c'); }