本文整理汇总了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 */
示例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']);
示例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
}