示例#1
0
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;
echo '<div id="joomdocModule" ' . ($moduleConfig->moduleclass_sfx ? 'class="' . htmlspecialchars($moduleConfig->moduleclass_sfx, ENT_QUOTES) . '"' : '') . '><ul>';
$root->initIteration();
while ($root->hasNext()) {
    $item = $root->getNext();
    $access = new JoomDOCAccessHelper($item);
    if ($access->docid && $item->document->published == JOOMDOC_STATE_UNPUBLISHED) {
        // Document is unpublished
        continue;
    }
    $class = '';
    if ($moduleConfig->show_icons) {
        // File mime type icon.
        $class = JoomDOCHelper::getFileIconClass($access->isFile ? $access->relativePath : 'folder', null, 16);
    }
    echo '<li' . ($class ? ' class="icon ' . $class . '"' : '') . '>';
    if ($moduleConfig->link_type == 'detail') {
        $url = JoomDOCRoute::viewDocuments($access->relativePath, $access->alias);
    } elseif ($moduleConfig->link_type == 'download' && $access->canDownload) {
        // download link is displayed only if file can be download in ACL setting
        $url = JoomDOCRoute::download($access->relativePath, $access->alias);
    } else {
        $url = null;
    }
    if ($url) {
        echo '<a href="' . JRoute::_($url) . '" title="">' . ($access->docid ? $item->document->title : $item->getFileName()) . '</a>';
    } else {
        // Name is displayed as document title or file path.
        echo $access->docid ? $item->document->title : $item->getFileName();
示例#2
0
 $access->isFile ? $files[] = $access->name : ($folders[] = $access->name);
 echo '<tr class="row' . $i % 2 . '">';
 echo '<td class="center">';
 if ($access->docid && $access->isChecked) {
     echo JHtml::_('jgrid.checkedout', $i, $item->document->editor, $item->document->checked_out_time, 'documents.', JoomDOCAccessDocument::manage($item->document->checked_out) && JoomDOCAccess::manage());
 }
 if (!$access->isTrashed) {
     echo '<input type="checkbox" name="paths[]" id="cbb' . $i . '" value="' . $this->escape($access->relativePath) . '" class="blind" />';
 }
 if (!$access->isChecked && !$access->isLocked && !$access->isTrashed) {
     echo '<input type="checkbox" name="cid[]" id="cb' . $i . '" value="' . $access->docid . '" onclick="Joomla.isChecked(this.checked);JoomDOC.check(this,' . $i . ')" />';
 }
 echo '</td>';
 echo '<td class="filepath">';
 $name = $access->isTrashed ? JText::sprintf('JOOMDOC_TRASHED_ITEM', $access->name) : $access->name;
 $class = JoomDOCHelper::getFileIconClass($access->isFile ? $access->relativePath : 'folder', $config->iconThemeBackend, 16);
 if ($access->isFolder) {
     $size = $access->isFolder ? '-' : $item->getFileSize();
     $update = isset($item->upload) ? JoomDOCHelper::uploaded($item->upload, false) : '';
     $of = JText::_('JOOMDOC_DOCUMENTS_OPEN_FOLDER');
     if ($access->canEnterFolder && !$access->isTrashed) {
         echo '<a class="hasTip folder ' . $class . '" href="' . JRoute::_(JoomDOCRoute::viewDocuments($access->relativePath)) . '" title="' . $this->getTooltip($access->relativePath, $of . '<br />' . $update . '/' . $size) . '">' . $access->name . '</a>';
     } else {
         echo '<a class="folder noLink ' . $class . '" href="javascript:void(0)" title="">' . $name . '</a>';
     }
 } else {
     if ($access->canDownload && !$access->isTrashed) {
         $size = $access->isFolder ? '-' : $item->getFileSize();
         $update = isset($item->upload) ? JoomDOCHelper::uploaded($item->upload, false) : '';
         $of = JText::_('JOOMDOC_DOWNLOAD_FILE');
         echo '<a href="' . JRoute::_(JoomDOCRoute::download($access->relativePath)) . '" class="hasTip file ' . $class . '" title="' . $this->getTooltip($access->relativePath, $of . '<br />' . $update . '/' . $size) . '">' . $access->name . '</a>';