当前位置: 首页>>代码示例>>PHP>>正文


PHP DocumentManager::is_visible_by_id方法代码示例

本文整理汇总了PHP中DocumentManager::is_visible_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentManager::is_visible_by_id方法的具体用法?PHP DocumentManager::is_visible_by_id怎么用?PHP DocumentManager::is_visible_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DocumentManager的用法示例。


在下文中一共展示了DocumentManager::is_visible_by_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getFileAction

 /**
  * @param string $courseCode
  * @param string $fileName
  * @return \Symfony\Component\HttpFoundation\BinaryFileResponse
  */
 public function getFileAction($courseCode, $fileName)
 {
     $courseInfo = api_get_course_info($courseCode);
     $sessionId = $this->getRequest()->get('id_session');
     $docId = \DocumentManager::get_document_id($courseInfo, "/" . $fileName);
     $filePath = null;
     if ($docId) {
         $isVisible = \DocumentManager::is_visible_by_id($docId, $courseInfo, $sessionId, api_get_user_id());
         $documentData = \DocumentManager::get_document_data_by_id($docId, $courseCode);
         $filePath = $documentData['absolute_path'];
         event_download($filePath);
     }
     if (!api_is_allowed_to_edit() && !$isVisible) {
         $this->abort(500);
     }
     return $this->sendFile($filePath);
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:22,代码来源:CourseHomeController.php

示例2: array

    $actionsRight = $form->returnForm();
}
$table_footer = '';
$total_size = 0;
$sortable_data = array();
if (isset($documentAndFolders) && is_array($documentAndFolders)) {
    if ($groupId == 0 || GroupManager::user_has_access($userId, $groupId, GroupManager::GROUP_TOOL_DOCUMENTS)) {
        $count = 1;
        $countedPaths = array();
        $countedPaths = array();
        foreach ($documentAndFolders as $key => $document_data) {
            $row = array();
            $row['id'] = $document_data['id'];
            $row['type'] = $document_data['filetype'];
            // If the item is invisible, wrap it in a span with class invisible.
            $is_visible = DocumentManager::is_visible_by_id($document_data['id'], $courseInfo, $sessionId, api_get_user_id(), false);
            $invisibility_span_open = $is_visible == 0 ? '<span class="muted">' : '';
            $invisibility_span_close = $is_visible == 0 ? '</span>' : '';
            // Size (or total size of a directory)
            $size = $document_data['filetype'] == 'folder' ? get_total_folder_size($document_data['path'], $is_allowed_to_edit) : $document_data['size'];
            // Get the title or the basename depending on what we're using
            if ($document_data['title'] != '') {
                $document_name = $document_data['title'];
            } else {
                $document_name = basename($document_data['path']);
            }
            $row['name'] = $document_name;
            // Data for checkbox
            if (($is_allowed_to_edit || $group_member_with_upload_rights) && count($documentAndFolders) > 1) {
                $row[] = $document_data['id'];
            }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:document.php


注:本文中的DocumentManager::is_visible_by_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。