Minor - Format code.

1.9.x
Julio Montoya 10 years ago
parent 5c5dfe00ce
commit 6020794342
  1. 11
      main/document/document.inc.php
  2. 5
      main/document/document.php
  3. 1
      main/document/upload.php

@ -17,7 +17,8 @@
* @todo this funcionality is really bad : jmontoya
* @return string html form
*/
function build_directory_selector($folders, $document_id, $group_dir = '', $change_renderer = false) {
function build_directory_selector($folders, $document_id, $group_dir = '', $change_renderer = false)
{
$doc_table = Database::get_course_table(TABLE_DOCUMENT);
$course_id = api_get_course_int_id();
$folder_titles = array();
@ -29,7 +30,8 @@ function build_directory_selector($folders, $document_id, $group_dir = '', $chan
}
$folder_sql = implode("','", $escaped_folders);
$sql = "SELECT * FROM $doc_table WHERE filetype = 'folder' AND c_id = $course_id AND path IN ('" . $folder_sql . "')";
$sql = "SELECT * FROM $doc_table
WHERE filetype = 'folder' AND c_id = $course_id AND path IN ('" . $folder_sql . "')";
$res = Database::query($sql);
$folder_titles = array();
while ($obj = Database::fetch_object($res)) {
@ -88,6 +90,7 @@ function build_directory_selector($folders, $document_id, $group_dir = '', $chan
}
}
$html = $form->toHtml();
return $html;
}
@ -649,8 +652,8 @@ function build_edit_icons($document_data, $id, $is_template, $is_read_only = 0,
return $modify_icons;
}
function build_move_to_selector($folders, $curdirpath, $move_file, $group_dir = '') {
function build_move_to_selector($folders, $curdirpath, $move_file, $group_dir = '')
{
$form = new FormValidator('move_to', 'post', api_get_self());
// Form title

@ -809,8 +809,6 @@ $(document).ready( function() {
});
</script>';
// Lib for event log, stats & tracking & record of the access
event_access_tool(TOOL_DOCUMENT);
@ -858,7 +856,7 @@ if ($is_allowed_to_edit ||
$is_allowed_to_edit || $group_member_with_upload_rights
);
//filter if is my shared folder. TODO: move this code to build_move_to_selector function
// filter if is my shared folder. TODO: move this code to build_move_to_selector function
if (is_my_shared_folder(api_get_user_id(), $curdirpath, $session_id) && !$is_allowed_to_edit) {
//only main user shared folder
$main_user_shared_folder_main = '/shared_folder/sf_user_'.api_get_user_id();
@ -870,6 +868,7 @@ if ($is_allowed_to_edit ||
$user_shared_folders[] = $fold;
}
}
$moveForm .= '<legend>'.get_lang('Move').'</legend>';
$moveForm .= build_move_to_selector(
$user_shared_folders,

@ -107,7 +107,6 @@ $courseDir = $_course['path'].'/document';
$sys_course_path = api_get_path(SYS_COURSE_PATH);
$base_work_dir = $sys_course_path.$courseDir;
$sessionId = api_get_session_id();
$selectcat = isset($_GET['selectcat']) ? Security::remove_XSS($_GET['selectcat']) : null;
$document_data = DocumentManager::get_document_data_by_id($_REQUEST['id'], api_get_course_id(), true, $sessionId);

Loading…
Cancel
Save