MeinBlog::lang('CATEGORY_HEADER_CATEGORIES'); ?> </h2> <?php if (!empty($category_status_list)) { echo "<table>\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th>Category Name</th>\n\t\t\t\t\t\t\t\t<th>Open Level</th>\n\t\t\t\t\t\t\t\t<th>File Count</th>\n\t\t\t\t\t\t\t\t<th>Recent Files</th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t"; foreach ($category_status_list as $category_status_item) { echo "<tr><!-- category_id=" . $category_status_item['category_id'] . " -->"; echo "<td>" . $category_status_item['category_name'] . "</td>"; echo "<td>" . $category_status_item['open_level'] . "</td>"; echo "<td>" . $category_status_item['file_count'] . "</td>"; echo "<td>"; $file_ids = explode(',', $category_status_item['file_ids']); for ($i = 0; $i < min(3, count($file_ids)); $i++) { $sample_file_id = $file_ids[$i]; $sample_file_header = $fileAgent->getFileHeader($sample_file_id); echo "<span style='margin: 0px 5px;'><a href='FileView.php?file_id=" . $sample_file_header['file_id'] . "'>" . $sample_file_header['title'] . "</a></span>"; } echo "</td>"; echo "</tr>"; } echo "</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t\t"; } else { echo "<p>No category exists now.</p>"; } ?> </div> <?php if ($isAdmin && !empty($category_status_list)) { ?> <div>
//Failed $message = "Failed to save new file."; } } else { //update $done = $fileAgent->update($file_id, $user_id, $title, $abstract, $category, $content); if ($done) { header("location: FileView.php?file_id=" . $file_id); } else { //Failed $message = "Failed to update file."; } } } } elseif (!empty($file_id)) { $header = $fileAgent->getFileHeader($file_id); $title = $header['title']; $abstract = $header['abstract']; $category = $header['category_id']; $content = $contentAgent->getFileContent($file_id); } $category_list = $categoryAgent->getCategoryList(); } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>MeinBlog</title> <script src="js/jquery.min.js"></script> <script src="js/marked.js"></script>