diff --git a/main/document/document.php b/main/document/document.php index eecfe9896f..59f23fcace 100644 --- a/main/document/document.php +++ b/main/document/document.php @@ -1,4 +1,4 @@ - '); //print_r($docs_and_folders); @@ -655,14 +662,15 @@ if($docs_and_folders) //admins get an edit column if ($is_allowed_to_edit || $group_member_with_upload_rights) { + $is_template = (isset($id['is_template'])?$id['is_template']:false); // if readonly, check if it the owner of the file ? if ($id['insert_user_id'] == $_user['user_id'] || api_is_platform_admin()) { - $edit_icons = build_edit_icons($curdirpath,$id['filetype'],$id['path'],$id['visibility'],$key, $id['is_template'],0); + $edit_icons = build_edit_icons($curdirpath,$id['filetype'],$id['path'],$id['visibility'],$key, $is_template,0); } else { - $edit_icons = build_edit_icons($curdirpath,$id['filetype'],$id['path'],$id['visibility'],$key, $id['is_template'],$id['readonly']); + $edit_icons = build_edit_icons($curdirpath,$id['filetype'],$id['path'],$id['visibility'],$key, $is_template,$id['readonly']); } $row[] = $edit_icons; } @@ -723,6 +731,7 @@ if(isset($_SESSION['_gid'])) { $query_vars['gidReq'] = $_SESSION['_gid']; } +$query_vars['cidReq'] = api_get_course_id(); $table->set_additional_parameters($query_vars); $column = 0; @@ -755,8 +764,10 @@ if (count($docs_and_folders)>1) } $table->display(); -echo $table_footer; - +if(!empty($table_footer)) +{ + echo $table_footer; +} /* ============================================================================== diff --git a/main/document/document_slideshow.inc.php b/main/document/document_slideshow.inc.php index bcf636efd0..3394458722 100644 --- a/main/document/document_slideshow.inc.php +++ b/main/document/document_slideshow.inc.php @@ -1,4 +1,4 @@ - 0 ) } } -$tablename_column = $_GET['tablename_column']; +$tablename_column = (isset($_GET['tablename_column'])?$_GET['tablename_column']:0); if($tablename_column==0){ $tablename_column=1; } else{ $tablename_column= intval($tablename_column)-1; } -$tablename_direction = $_GET['tablename_direction']; +$tablename_direction = (isset($_GET['tablename_direction'])?$_GET['tablename_direction']:'ASC'); $image_files_only = sort_files($array_to_search); $_SESSION["image_files_only"] = $image_files_only; @@ -161,4 +161,4 @@ function sort_table($a, $b) -?> \ No newline at end of file +?> diff --git a/main/inc/lib/sortabletable.class.php b/main/inc/lib/sortabletable.class.php index 590ffa9616..a78b6985dd 100644 --- a/main/inc/lib/sortabletable.class.php +++ b/main/inc/lib/sortabletable.class.php @@ -234,7 +234,7 @@ class SortableTable extends HTML_Table } /*]]>*/ '; - $params = $this->get_sortable_table_param_string.'&'.$this->get_additional_url_paramstring(); + $params = $this->get_sortable_table_param_string().'&'.$this->get_additional_url_paramstring(); $html .= '