本文整理匯總了PHP中Documents::FindByFiletype方法的典型用法代碼示例。如果您正苦於以下問題:PHP Documents::FindByFiletype方法的具體用法?PHP Documents::FindByFiletype怎麽用?PHP Documents::FindByFiletype使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Documents
的用法示例。
在下文中一共展示了Documents::FindByFiletype方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: display_page_content
function display_page_content()
{
if (!requestIdParam()) {
$documents = Documents::FindAll("DESC");
} else {
$documents = Documents::FindByFiletype(requestIdParam());
}
?>
<div id="edit-header" class="documentnav">
<div class="nav-left column">
<h1>Choose a Document to Edit</h1>
</div>
<div class="nav-right column">
<a href="<?php
echo get_link("admin/add_document");
?>
" class="hcd_button">Add a New Document</a>
</div>
<div class="clearleft"></div>
</div>
<p class="announce">Documents are defined as downloadable files or forms. PDFs, DOCs, and the like are acceptable. You may use this feature to make high resolution images downloadable as well. If the image is too large to upload, and you get an error, you may want to compress the image with StuffIt (.sit), WinZip (.zip), or ZipIt (.zip).</p>
<?php
if (count($documents) > 0) {
?>
<div id="table-header" class="documents">
<strong class="item-link">Document Name</strong>
<span class="item-filename">Filename</span>
<span class="item-viewlink">View file in new window</span>
</div>
<?php
//$filetypes = Documents::FindUniqueFiletypes();
if (isset($filetypes) && count($filetypes) > 1) {
echo "<ul class=\"menu tabs\">\n\t\t<li>Show Only: </li>\n";
foreach ($filetypes as $type) {
echo "\t\t<li><a href=\"" . get_link("admin/list_documents/" . $type->file_type) . "\">{$type->file_type}</a></li>\n";
}
echo "\t\t<li><a class=\"hcd_button\" href=\"" . get_link("admin/list_documents/") . "\">Show All</a></li>\n\t</ul>\n ";
}
?>
<ul id="listitems" class="managelist">
<?php
foreach ($documents as $document) {
echo "\t\t<li>\n\t\t\t<span class=\"item-link\"><a href=\"" . get_link("/admin/edit_document/{$document->id}") . "\">{$document->name} <small>EDIT</small></a></span>\n\t\t\t<span class=\"item-filename\">{$document->filename}</span>\n\t\t\t<span class=\"item-viewlink\"><a href=\"" . $document->getPublicUrl() . "\" target=\"_blank\">View file</a></span>\n\t\t</li>\n";
}
?>
</ul>
<?php
} else {
echo "\t\t<h3 class=\"empty-list\">There are no documents to edit. <a class=\"short\" href=\"" . get_link("admin/add_document") . "\">Add one if you like</a>.</h3>";
}
}