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


PHP FileManager::item_property_update_on_folder方法代码示例

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


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

示例1: api_item_property_update

     api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', $_user['user_id'], null, null, null, null, $current_session_id);
 }
 if (!is_file($filepath . 'css/frames.css')) {
     // Make a copy of the current css for the new document
     copy(api_get_path(SYS_CSS_PATH) . 'themes/' . api_get_setting('stylesheets') . '/frames.css', $filepath . 'css/frames.css');
     $doc_id = FileManager::add_document($_course, $dir . 'css/frames.css', 'file', filesize($filepath . 'css/frames.css'), 'frames.css');
     api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], null, null, null, null, $current_session_id);
     api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', $_user['user_id'], null, null, null, null, $current_session_id);
 }
 $file_size = filesize($filepath . $filename . '.' . $extension);
 $save_file_path = $dir . $filename . '.' . $extension;
 $document_id = FileManager::add_document($_course, $save_file_path, 'file', $file_size, $title, null, $readonly);
 if ($document_id) {
     api_item_property_update($_course, TOOL_DOCUMENT, $document_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id);
     // Update parent folders
     FileManager::item_property_update_on_folder($_course, $dir, $_user['user_id']);
     $new_comment = isset($_POST['comment']) ? trim($_POST['comment']) : '';
     $new_comment = Database::escape_string($new_comment);
     $new_title = isset($_POST['title']) ? trim($_POST['title']) : '';
     $new_title = htmlspecialchars($new_title);
     $new_title = Database::escape_string($new_title);
     if ($new_comment || $new_title) {
         $ct = '';
         if ($new_comment) {
             $ct .= ", comment='{$new_comment}'";
         }
         if ($new_title) {
             $ct .= ", title='{$new_title}'";
         }
         Database::query("UPDATE {$doc_table} SET" . substr($ct, 1) . " WHERE c_id = {$course_id} AND id = '{$document_id}'");
     }
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:create_document.php

示例2: api_get_setting

             if (!is_file($filepath . 'css/frames.css')) {
                 $platform_theme = api_get_setting('stylesheets');
                 if (file_exists(api_get_path(SYS_CSS_PATH) . 'themes/' . $platform_theme . '/frames.css')) {
                     copy(api_get_path(SYS_CSS_PATH) . 'themes/' . $platform_theme . '/frames.css', $filepath . 'css/frames.css');
                     $doc_id = FileManager::add_document($_course, $dir . 'css/frames.css', 'file', filesize($filepath . 'css/frames.css'), 'frames.css');
                     api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', api_get_user_id(), null, null, null, null, $current_session_id);
                     api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', api_get_user_id(), null, null, null, null, $current_session_id);
                 }
             }
             // "WHAT'S NEW" notification: update table item_property
             $document_id = DocumentManager::get_document_id($_course, $file);
             if ($document_id) {
                 FileManager::update_existing_document($_course, $document_id, $file_size, $read_only_flag);
                 api_item_property_update($_course, TOOL_DOCUMENT, $document_id, 'DocumentUpdated', api_get_user_id(), null, null, null, null, $current_session_id);
                 // Update parent folders
                 FileManager::item_property_update_on_folder($_course, $dir, api_get_user_id());
                 header('Location: document.php?id=' . $document_data['parent_id']);
                 exit;
             } else {
                 $msgError = get_lang('Impossible');
             }
         } else {
             $msgError = get_lang('Impossible');
         }
     } else {
         if ($document_id) {
             FileManager::update_existing_document($_course, $document_id, $file_size, $read_only_flag);
         }
     }
 } else {
     if ($document_id) {
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:edit_document.php

示例3: while

         $basename_chat = 'messages-' . $date_now . '_sid-' . $session_id;
     } else {
         $basename_chat = 'messages-' . $date_now;
     }
 }
 if ($reset && $isMaster) {
     $i = 1;
     while (file_exists($chat_path . $basename_chat . '-' . $i . '.log.html')) {
         $i++;
     }
     @rename($chat_path . $basename_chat . '.log.html', $chat_path . $basename_chat . '-' . $i . '.log.html');
     @fclose(fopen($chat_path . $basename_chat . '.log.html', 'w'));
     $doc_id = FileManager::add_document($_course, $basepath_chat . '/' . $basename_chat . '-' . $i . '.log.html', 'file', filesize($chat_path . $basename_chat . '-' . $i . '.log.html'), $basename_chat . '-' . $i . '.log.html');
     api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $group_id, null, null, null, $session_id);
     api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', $_user['user_id'], $group_id, null, null, null, $session_id);
     FileManager::item_property_update_on_folder($_course, $basepath_chat, $_user['user_id']);
     $doc_id = DocumentManager::get_document_id($_course, $basepath_chat . '/' . $basename_chat . '.log.html');
     FileManager::update_existing_document($_course, $doc_id, 0);
 }
 $remove = 0;
 $content = array();
 if (file_exists($chat_path . $basename_chat . '.log.html')) {
     $content = file($chat_path . $basename_chat . '.log.html');
     $nbr_lines = sizeof($content);
     $remove = $nbr_lines - 100;
 }
 if ($remove < 0) {
     $remove = 0;
 }
 array_splice($content, 0, $remove);
 require 'header_frame.inc.php';
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:chat_chat.php

示例4: count

}
//missing images are submitted
if (isset($_POST['submit_image'])) {
    $number_of_uploaded_images = count($_FILES['img_file']['name']);
    //if images are uploaded
    if ($number_of_uploaded_images > 0) {
        //we could also create a function for this, I'm not sure...
        //create a directory for the missing files
        $img_directory = str_replace('.', '_', $_POST['related_file'] . "_files");
        $missing_files_dir = FileManager::create_unexisting_directory($_course, $_user['user_id'], api_get_session_id(), $to_group_id, $to_user_id, $base_work_dir, $img_directory);
        //put the uploaded files in the new directory and get the paths
        $paths_to_replace_in_file = FileManager::move_uploaded_file_collection_into_directory($_course, $_FILES['img_file'], $base_work_dir, $missing_files_dir, $_user['user_id'], $to_group_id, $to_user_id, $max_filled_space);
        //open the html file and replace the paths
        FileManager::replace_img_path_in_html_file($_POST['img_file_path'], $paths_to_replace_in_file, $base_work_dir . $_POST['related_file']);
        //update parent folders
        FileManager::item_property_update_on_folder($_course, $_POST['curdirpath'], $_user['user_id']);
    }
}
//they want to create a directory
if (isset($_POST['create_dir']) && $_POST['dirname'] != '') {
    $added_slash = $path == '/' ? '' : '/';
    $dir_name = $path . $added_slash . api_replace_dangerous_char($_POST['dirname']);
    $created_dir = FileManager::create_unexisting_directory($_course, $_user['user_id'], api_get_session_id(), $to_group_id, $to_user_id, $base_work_dir, $dir_name, $_POST['dirname']);
    if ($created_dir) {
        //Display::display_normal_message("<strong>".$created_dir."</strong> was created!");
        Display::display_normal_message(get_lang('DirCr'));
        $path = $created_dir;
    } else {
        display_error(get_lang('CannotCreateDir'));
    }
}
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:upload.document.php

示例5: updateSound

 /**
  * changes the exercise sound file
  *
  * @author - Olivier Brouckaert
  * @param - string $sound - exercise sound file
  * @param - string $delete - ask to delete the file
  */
 public function updateSound($sound, $delete)
 {
     global $audioPath, $documentPath;
     $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT);
     if ($sound['size'] && (strstr($sound['type'], 'audio') || strstr($sound['type'], 'video'))) {
         $this->sound = $sound['name'];
         if (@move_uploaded_file($sound['tmp_name'], $audioPath . '/' . $this->sound)) {
             $query = "SELECT 1 FROM {$TBL_DOCUMENT}  WHERE c_id = " . $this->course_id . " AND path='" . str_replace($documentPath, '', $audioPath) . '/' . $this->sound . "'";
             $result = Database::query($query);
             if (!Database::num_rows($result)) {
                 $id = FileManager::add_document($this->course, str_replace($documentPath, '', $audioPath) . '/' . $this->sound, 'file', $sound['size'], $sound['name']);
                 api_item_property_update($this->course, TOOL_DOCUMENT, $id, 'DocumentAdded', api_get_user_id());
                 FileManager::item_property_update_on_folder($this->course, str_replace($documentPath, '', $audioPath), api_get_user_id());
             }
         }
     } elseif ($delete && is_file($audioPath . '/' . $this->sound)) {
         $this->sound = '';
     }
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:26,代码来源:exercise.class.php


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