當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。