diff --git a/main/course_home/course_home.php b/main/course_home/course_home.php index b7a2065070..4342863e8c 100755 --- a/main/course_home/course_home.php +++ b/main/course_home/course_home.php @@ -210,10 +210,6 @@ Display::display_introduction_section(TOOL_COURSE_HOMEPAGE, array( the setting homepage_view is adjustable through the platform administration section */ -//@todo add vertical_activity to the api_get_setting('homepage_view') variable -//require 'vertical_activity.php'; - - if (api_get_setting('homepage_view') == 'activity') { require 'activity.php'; } elseif (api_get_setting('homepage_view') == '2column') { diff --git a/main/inc/lib/course_home.lib.php b/main/inc/lib/course_home.lib.php index 3b8521ee51..9a5999c815 100644 --- a/main/inc/lib/course_home.lib.php +++ b/main/inc/lib/course_home.lib.php @@ -574,17 +574,6 @@ class CourseHome { return $all_tools_list; } - public static function order_tool_list($a, $b) { - /* echo $name_a = ($a['name']); - echo '--'; - echo $name_b = ($b['name']); - echo '
'; - - if ($name_a == $name_b) { - return 0; - } - return ($name_a < $name_b) ? -1 : 1;*/ - } /** * Displays the tools of a certain category. * @param array List of tools as returned by get_tools_category() @@ -592,22 +581,23 @@ class CourseHome { */ public static function show_tools_category($all_tools_list, $theme = 'activity') { - //@todo order list - //var_dump($all_tools_list); - /* usort($all_tools_list, array( 'CourseHome' , 'order_tool_list' )); - $order_tool_list = array(); - foreach($all_tools_list as $new_tool) { - $order_tool_list []= $new_tool['name']; - } - natsort($order_tool_list); - foreach($order_tool_list as $key=>$new_tool) { - $all_tools_list[] + if ($theme == 'vertical_activity') { + //ordering by get_lang name + $order_tool_list = array(); + foreach($all_tools_list as $key=>$new_tool) { + $tool_name = self::translate_tool_name($new_tool); + $order_tool_list [$key]= $tool_name; + } + natsort($order_tool_list); + $my_temp_tool_array = array(); + foreach($order_tool_list as $key=>$new_tool) { + $my_temp_tool_array[] = $all_tools_list[$key]; + } + $all_tools_list = $my_temp_tool_array; } - var_dump($all_tools_list); - var_dump($order_tool_list); - //var_dump($all_tools_list); - */ + + global $_user; $web_code_path = api_get_path(WEB_CODE_PATH); $course_tool_table = Database::get_course_table(TABLE_TOOL_LIST); @@ -658,7 +648,6 @@ class CourseHome { $link['cmd'] = 'hide=yes'; $lnk[] = $link; } - if ($tool['visibility'] == '0' && $tool['admin'] != '1') { $link['name'] = Display::return_icon('invisible.gif', get_lang('Activate'), array('id' => 'linktool_'.$tool['id'])); $link['cmd'] = 'restore=yes'; diff --git a/main/install/db_main.sql b/main/install/db_main.sql index a247848a9a..fc5473be41 100644 --- a/main/install/db_main.sql +++ b/main/install/db_main.sql @@ -800,6 +800,7 @@ VALUES ('homepage_view','activity','HomepageViewActivity'), ('homepage_view','2column','HomepageView2column'), ('homepage_view','3column','HomepageView3column'), +('homepage_view','vertical_activity','HomepageViewVerticalActivity'), ('show_toolshortcuts','true','Yes'), ('show_toolshortcuts','false','No'), ('allow_group_categories','true','Yes'), diff --git a/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql b/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql index f52f3bc040..9e09341b1b 100755 --- a/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql +++ b/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql @@ -75,6 +75,8 @@ ALTER TABLE session_rel_user DROP PRIMARY KEY, ADD PRIMARY KEY (id_session, id_u INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('course_create_active_tools','course_progress','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'CourseProgress', 0); +INSERT INTO settings_options(variable,value,display_text) VALUES ('homepage_view','vertical_activity','HomepageViewVerticalActivity'); + -- xxSTATSxx CREATE TABLE track_e_item_property(id int NOT NULL auto_increment PRIMARY KEY, course_id int NOT NULL, item_property_id int NOT NULL, title varchar(255), content text, progress int NOT NULL default 0, lastedit_date datetime NOT NULL default '0000-00-00 00:00:00', lastedit_user_id int NOT NULL, session_id int NOT NULL default 0); ALTER TABLE track_e_item_property ADD INDEX (course_id, item_property_id, session_id);