Esempio n. 1
0
    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();
    }
    if ($moduleConfig->show_filesize) {
        echo '<strong>' . JText::sprintf('JOOMDOC_MODULE_FILESIZE', JoomDOCFileSystem::getFileSize($access->absolutePath)) . '</strong>';
    }
    if ($moduleConfig->show_listfields) {
        echo '<table class="fields"><tbody>';
        foreach ($listFields as $field) {
            if ($value = JHtml::_('joomdoc.showfield', $field, $item->document)) {
                echo '<tr><th>' . $field->title . ':</th><td>' . $value . '</td></tr>';
            }
        }
        echo '</tbody></table>';
    }
    if ($moduleConfig->show_text && $access->docid && ($description = JString::trim($item->document->description))) {
        echo '<p>' . JoomDOCString::crop($description, $moduleConfig->crop_length) . '</p>';
    }
    echo '</li>';
}
Esempio n. 2
0
 /**
  * Create and init object. Set absolute path.
  * 
  * @param string $absolutePath file absolute path
  * @return void
  */
 public function __construct($absolutePath, $isSymLink = false)
 {
     $this->absolutePath = JPath::clean($absolutePath);
     $this->relativePath = JoomDOCFileSystem::getRelativePath($this->absolutePath);
     $this->isSymLink = $isSymLink;
     $this->name = parent::getName($this->absolutePath);
     $this->extension = parent::getExt($this->absolutePath);
     $this->size = JoomDOCFileSystem::getFileSize($this->absolutePath);
     $this->url = JoomDOCFileSystem::getURL($this->relativePath);
     $this->document = null;
     $this->hits = 0;
     $this->uploaded = filemtime($this->absolutePath);
     $this->mimetype = function_exists('mime_content_type') && is_readable($this->absolutePath) ? mime_content_type($this->absolutePath) : '';
 }
Esempio n. 3
0
        echo '<a class="download" href="' . JRoute::_(JoomDOCRoute::download($this->access->relativePath, $this->access->alias)) . '" title="">';
    }
}
//display document title only if published for current user.
echo ($this->access->docid and $this->root->document->published == JOOMDOC_STATE_PUBLISHED) ? $this->root->document->title : $this->root->getFileName();
if ($this->access->canDownload) {
    echo '</a>';
}
echo '</h1>';
if ($this->access->canViewFileInfo && ($this->access->docid && $this->access->canShowFileDates || !$this->access->isFolder && $this->access->canShowFileInfo || $this->access->isFavorite)) {
    echo '<div class="info">';
    if ($this->access->canDisplayFavorite) {
        echo '<span class="favorite">' . JText::_('JOOMDOC_FAVORITE') . '</span>';
    }
    if ($config->showFilesize && !$this->access->isFolder) {
        echo '<span class="filesize">' . JText::sprintf('JOOMDOC_FILESIZE', JoomDOCFileSystem::getFileSize($this->root->getAbsolutePath())) . '</span>';
    }
    if ($this->access->docid) {
        if ($config->showCreated && !is_null($this->root->document->created)) {
            echo '<span class="created">' . JText::sprintf('JOOMDOC_CREATED', JHtml::date($this->root->document->created, JText::_('JOOMDOC_UPLOADED_DATE_J16'))) . '</span>';
        }
        if ($config->showModified && JoomDOCHelper::canViewModified($this->root->document->created, $this->root->document->modified)) {
            echo '<span class="modified">' . JText::sprintf('JOOMDOC_MODIFIED', JHtml::date($this->root->document->modified, JText::_('JOOMDOC_UPLOADED_DATE_J16'))) . '</span>';
        }
    }
    if ($config->showHits && !$this->access->isFolder) {
        echo '<span class="hits">' . JText::sprintf('JOOMDOC_HITS_INFO', JoomDOCHelper::number($this->root->document->hits)) . '</span>';
    }
    echo '<div class="clr"></div>';
    echo '</div>';
}
Esempio n. 4
0
        //echo $i.' | '.$item->id.' | '.$item->version.' | '.$this->maxVersion;
        echo '<td>' . JHtml::_('grid.id', ++$i, $item->id, $item->version == $this->maxVersion) . '</td>';
    }
    echo '<td>' . $item->version . '</td>';
    if ($showDownload) {
        echo '<td>';
        if ($item->state == JOOMDOC_STATE_PUBLISHED) {
            echo '<a href="' . JRoute::_(JoomDOCRoute::download($item->path, null, $item->version)) . '" title="" target="_blank">';
            echo $download;
            echo '</a>';
        } elseif ($item->state == JOOMDOC_STATE_TRASHED) {
            echo $trashed;
        }
        echo '</td>';
    }
    echo '<td nowrap="nowrap">' . JoomDOCFileSystem::getFileSize(JoomDOCFileSystem::getFullPath($item->path)) . '</td>';
    echo '<td nowrap="nowrap">' . JoomDOCHelper::uploaded($item->upload, false) . '</td>';
    echo '<td nowrap="nowrap">' . $item->name . '</td>';
    echo '<td class="center" nowrap="nowrap">' . JoomDOCHelper::number($item->hits) . '</td>';
    echo '</tr>';
}
echo '</tbody>';
echo '<tfoot>';
echo '<tr>';
$pagination = new JPagination($this->filter->total, $this->filter->offset, $this->filter->limit);
echo '<td colspan="20">' . $pagination->getListFooter() . '</td>';
echo '</tr>';
echo '</tfoot>';
echo '</table>';
echo JHtml::_('form.token');
echo '<input type="hidden" name="task" value="" />';
Esempio n. 5
0
 echo ($access->docid and $item->document->published == JOOMDOC_STATE_PUBLISHED) ? $item->document->title : $item->getFileName();
 if ($access->canOpenFile || $access->canOpenFolder) {
     echo '</a>';
 }
 if ($this->access->canCopyMove) {
     echo '<input type="checkbox" name="paths[]" id="cbb' . $i . '" value="' . $this->escape($access->relativePath) . '" class="blind" />';
     echo '<input type="checkbox" name="cid[]" id="cb' . $i . '" value="' . $access->docid . '" onclick="Joomla.isChecked(this.checked);JoomDOC.check(this,' . $i . ')" class="pull-right" />';
 }
 echo '</h2>';
 if ($access->canViewFileInfo && ($access->docid && $this->access->canShowFileDates || !$access->isFolder && $this->access->canShowFileInfo || $access->isFavorite)) {
     echo '<div class="info">';
     if ($access->isFavorite) {
         echo '<span class="favorite">' . JText::_('JOOMDOC_FAVORITE') . '</span>';
     }
     if ($config->showFilesize && !$access->isFolder) {
         echo '<span class="filesize">' . JText::sprintf('JOOMDOC_FILESIZE', JoomDOCFileSystem::getFileSize($access->absolutePath)) . '</span>';
     }
     if ($access->docid) {
         if ($config->showCreated) {
             echo '<span class="created">' . JText::sprintf('JOOMDOC_CREATED', JHtml::date($item->document->created, JText::_('JOOMDOC_UPLOADED_DATE_J16'))) . '</span>';
         }
         if ($config->showModified && JoomDOCHelper::canViewModified($item->document->created, $item->document->modified)) {
             echo '<span class="modified">' . JText::sprintf('JOOMDOC_MODIFIED', JHtml::date($item->document->modified, JText::_('JOOMDOC_UPLOADED_DATE_J16'))) . '</span>';
         }
     }
     if ($config->showHits && !$access->isFolder) {
         echo '<span class="hits">' . JText::sprintf('JOOMDOC_HITS_INFO', JoomDOCHelper::number($item->hits)) . '</span>';
     }
     foreach ($this->listfields as $field) {
         if ($value = JHtml::_('joomdoc.showfield', $field, $item->document)) {
             echo '<span class="field">' . $field->title . ': ' . $value . '</span>';