$dlist .= mediaItemLine($items[$i], $j, $query, true); } else { $flist .= mediaItemLine($items[$i], $j, $query, true); } } $table .= $dlist . $flist; $table .= '</table></div>'; echo sprintf($fmt_form_media, $table, ''); } else { $dgroup = ''; $fgroup = ''; for ($i = $pager->index_start, $j = 0; $i <= $pager->index_end; $i++, $j++) { if ($items[$i]->d) { $dgroup .= mediaItemLine($items[$i], $j, $query); } else { $fgroup .= mediaItemLine($items[$i], $j, $query); } } echo ($dgroup != '' ? '<div class="folders-group">' . $dgroup . '</div>' : '') . sprintf($fmt_form_media, $fgroup, ''); } echo $pager->getLinks(); } if (!isset($pager)) { echo '<p class="clear"></p>'; } echo '</div>'; $core_media_archivable = $core->auth->check('media_admin', $core->blog->id) && !(count($items) == 0 || count($items) == 1 && $items[0]->parent); if (!$query && ($core_media_writable || $core_media_archivable)) { echo '<div class="vertical-separator">' . '<h3 class="out-of-screen-if-js">' . sprintf(__('In %s:'), $d == '' ? '“' . __('Media manager') . '”' : '“' . $d . '”') . '</h3>'; } if (!$query && ($core_media_writable || $core_media_archivable)) {
if ($popup) { echo '<p><strong>' . sprintf(__('Choose a file to insert by clicking on %s.'), '<img src="' . OKT_PUBLIC_URL . '/img/ico/plus.png" alt="' . __('Attach this file') . '" />') . '</strong></p>'; } $items = array_values(array_merge($dir['dirs'], $dir['files'])); $num_items = count($items); if ($num_items == 0) { echo '<p><strong>' . __('No file.') . '</strong></p>'; } else { $pager = new adminPager($page, $num_items, $nb_per_page, 10); echo '<form action="module.php" method="get">' . '<p><label>' . __('Sort files:') . ' ' . form::select('file_sort', $sort_combo, $file_sort) . '</label>' . form::hidden(array('m'), 'media_manager') . form::hidden(array('popup'), $popup) . '<input type="submit" value="' . __('ok') . '" /></p>' . '</form>'; echo '<div class="media-list">'; if ($pager->getNbPages() > 1) { echo '<ul class="pagination">' . $pager->getLinks() . '</ul>'; } for ($i = $pager->index_start, $j = 0; $i <= $pager->index_end; $i++, $j++) { echo mediaItemLine($items[$i], $j); } echo '<div class="clearer"></div>'; if ($pager->getNbPages() > 1) { echo '<ul class="pagination">' . $pager->getLinks() . '</ul>'; } echo '</div>'; } if ($core_media_writable) { echo '<div class="two-cols">'; echo '<div class="col"><h3 id="add-file">' . __('Add files') . '</h3>' . '<form id="media-upload" action="' . html::escapeURL($page_url) . '" method="post" enctype="multipart/form-data">' . '<div>' . form::hidden(array('MAX_FILE_SIZE'), OKT_MAX_UPLOAD_SIZE) . adminPage::formtoken() . '</div>' . '<fieldset id="add-file-f">' . '<p class="field"><label for="upfile">' . __('Choose a file:') . '</label>' . '<input type="file" name="upfile" id="upfile" size="20" /></p>' . '<p class="note">' . sprintf(__('c_c_maximum_file_size_%s'), util::l10nFileSize(OKT_MAX_UPLOAD_SIZE)) . '</p>' . '<p class="field"><label for="upfiletitle">' . __('Title:') . '</label>' . form::text('upfiletitle', 35, 255) . '</p>' . '<p class="field"><label>' . form::checkbox(array('upfilepriv'), 1) . ' ' . __('Private') . '</label></p>' . '<p><input type="submit" value="' . __('c_c_action_send') . '" />' . form::hidden(array('d'), $d) . '</p>' . '</fieldset>' . '</form>' . '<p class="note">' . __('Please take care to publish media that you own and that are not protected by copyright.') . '</p>' . '</div>'; echo '<div class="col"><h3 id="new-dir">' . __('New directory') . '</h3>' . '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset id="new-dir-f">' . adminPage::formtoken() . '<p class="field"><label for="newdir">' . __('Directory Name:') . '</label>' . form::text('newdir', 35, 255) . '</p>' . '<p><input type="submit" value="' . __('c_c_action_save') . '" />' . form::hidden(array('d'), html::escapeHTML($d)) . '</p>' . '</fieldset>' . '</form></div>'; echo '</div>'; } # Get zip directory if ($okt->checkPerm('media_admin')) {