當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DocumentManager::check_readonly方法代碼示例

本文整理匯總了PHP中DocumentManager::check_readonly方法的典型用法代碼示例。如果您正苦於以下問題:PHP DocumentManager::check_readonly方法的具體用法?PHP DocumentManager::check_readonly怎麽用?PHP DocumentManager::check_readonly使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DocumentManager的用法示例。


在下文中一共展示了DocumentManager::check_readonly方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: intval

    if (isset($_GET['set_invisible']) && !empty($_GET['set_invisible']) || isset($_GET['set_visible']) && !empty($_GET['set_visible'])) {
        // Make visible or invisible?
        if (isset($_GET['set_visible'])) {
            $update_id = intval($_GET['set_visible']);
            $visibility_command = 'visible';
        } else {
            $update_id = intval($_GET['set_invisible']);
            $visibility_command = 'invisible';
        }
        if (!$is_allowed_to_edit) {
            if (api_is_coach()) {
                if (!DocumentManager::is_visible_by_id($update_id, $courseInfo, $sessionId, api_get_user_id())) {
                    api_not_allowed(true);
                }
            }
            if (DocumentManager::check_readonly($courseInfo, api_get_user_id(), '', $update_id)) {
                api_not_allowed(true);
            }
        }
        // Update item_property to change visibility
        if (api_item_property_update($courseInfo, TOOL_DOCUMENT, $update_id, $visibility_command, api_get_user_id(), null, null, null, null, $sessionId)) {
            Display::addFlash(Display::return_message(get_lang('VisibilityChanged'), 'confirmation'));
        } else {
            Display::addFlash(Display::return_message(get_lang('ViModProb'), 'error'));
        }
        header('Location: ' . $currentUrl);
        exit;
    }
}
$templateForm = null;
/* 	TEMPLATE ACTION */
開發者ID:omaoibrahim,項目名稱:chamilo-lms,代碼行數:31,代碼來源:document.php

示例2: array

    $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
} else {
    foreach ($document_data['parents'] as $document_sub_data) {
        if ($document_data['title'] == $document_sub_data['title']) {
            continue;
        }
        $interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
    }
}
if (!$is_allowed_to_edit) {
    api_not_allowed(true);
}
Event::event_access_tool(TOOL_DOCUMENT);
//TODO:check the below code and his functionality
if (!api_is_allowed_to_edit()) {
    if (DocumentManager::check_readonly($course_info, $user_id, $file)) {
        api_not_allowed();
    }
}
/* MAIN TOOL CODE */
/*	Code to change the comment	*/
if (isset($_POST['comment'])) {
    // Fixing the path if it is wrong
    $comment = trim(Database::escape_string($_POST['comment']));
    $title = trim(Database::escape_string($_POST['title']));
    //Just in case see BT#3525
    if (empty($title)) {
        $title = $documen_data['title'];
    }
    if (empty($title)) {
        $title = FileManager::get_document_title($_POST['filename']);
開發者ID:ragebat,項目名稱:chamilo-lms,代碼行數:31,代碼來源:edit_document.php

示例3: substr

     if (!empty($_course['path'])) {
         //find path
         $mainPath = '../../../../../../../courses/' . $_course['path'] . '/document/';
         //get Chamilo
         $fullPath = $doc;
         //get Ajaxfilemanager
         $chamiloPath = substr($fullPath, strlen($mainPath) - strlen($fullPath) - 1);
         //find base_work_dir
         $course_dir = $_course['path'] . "/document";
         //get Chamilo
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
         //get Chamilo
         $base_work_dir = $sys_course_path . $course_dir;
         // sample c:/xampp/htdocs/chamilo2009beta/courses/JUAN2009/document
         //delete file
         if (!$is_allowed_to_edit && DocumentManager::check_readonly($_course, api_get_user_id(), $chamiloPath)) {
             $error = get_lang('CantDeleteReadonlyFiles');
             //From Chamilo to Ajaxfilemanager
         } else {
             $deleted = DocumentManager::delete_document($_course, $chamiloPath, $base_work_dir);
             //deleted by Chamilo
             //$file->delete($doc); // disabled deleted by ajaxfilemanager
         }
     } else {
         $file->delete($doc);
         //deleted by ajaxfilemanager
         event_system(LOG_USER_PERSONAL_DOC_DELETED, 'document_path', $doc);
         event_system(LOG_MY_FOLDER_DELETE, LOG_MY_FOLDER_PATH, $doc);
     }
     //////end bridge to Chamilo
 }
開發者ID:annickvdp,項目名稱:Chamilo1.9.10,代碼行數:31,代碼來源:ajax_delete_file.php


注:本文中的DocumentManager::check_readonly方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。