Minor - Format code.

1.9.x
Julio Montoya 11 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 * @todo this funcionality is really bad : jmontoya
* @return string html form * @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); $doc_table = Database::get_course_table(TABLE_DOCUMENT);
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
$folder_titles = array(); $folder_titles = array();
@ -29,7 +30,8 @@ function build_directory_selector($folders, $document_id, $group_dir = '', $chan
} }
$folder_sql = implode("','", $escaped_folders); $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); $res = Database::query($sql);
$folder_titles = array(); $folder_titles = array();
while ($obj = Database::fetch_object($res)) { while ($obj = Database::fetch_object($res)) {
@ -88,6 +90,7 @@ function build_directory_selector($folders, $document_id, $group_dir = '', $chan
} }
} }
$html = $form->toHtml(); $html = $form->toHtml();
return $html; return $html;
} }
@ -649,8 +652,8 @@ function build_edit_icons($document_data, $id, $is_template, $is_read_only = 0,
return $modify_icons; 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 = new FormValidator('move_to', 'post', api_get_self());
// Form title // Form title

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

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

Loading…
Cancel
Save