From af294c1ecb8a0e7d4ca821275898c0a5cfbbd190 Mon Sep 17 00:00:00 2001 From: aragonc Date: Mon, 17 Aug 2015 11:57:14 -0500 Subject: [PATCH 1/8] fix menu block accordion responsive CT#7766 --- main/inc/lib/userportal.lib.php | 60 ++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index d08d11a014..36145e4bcf 100755 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -179,12 +179,12 @@ class IndexManager if ($show_menu) { $html .= ''; - $html = self::show_right_block(get_lang("Skills"), $content, 'skill_block'); + $html = self::show_right_block(get_lang("Skills"), $content, 'skill_block',null, 'skills', 'skillsCollapse'); return $html; } @@ -680,17 +680,30 @@ class IndexManager /** * @todo use the template system */ - function show_right_block($title, $content, $id = null, $params = null) { - if (!empty($id)) { - $params['id'] = $id; - } - $params['class'] = 'panel panel-default'; - $html = null; - if (!empty($title)) { - $html.= '
'.$title.'
'; - } - $html.= '
'.$content.'
'; - $html = Display::div($html, $params); + function show_right_block($title, $content, $id = null, $params = null, $idAccordion = null, $idCollpase = null) { + if (!empty($idAccordion)){ + $html = null; + $html .= '
'; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'.$content.'
'; + $html .= '
'; + + }else{ + if (!empty($id)) { + $params['id'] = $id; + } + $params['class'] = 'panel panel-default'; + $html = null; + if (!empty($title)) { + $html.= '
'.$title.'
'; + } + $html.= '
'.$content.'
'; + $html = Display::div($html, $params); + } return $html; } @@ -838,7 +851,13 @@ class IndexManager $profile_content .= '
  • '.Display::return_icon('edit-profile.png',get_lang('EditProfile'),null,ICON_SIZE_SMALL).get_lang('EditProfile').'
  • '; $profile_content .= ''; - $html = self::show_right_block(get_lang('Profile'), $profile_content, 'profile_block'); + $html = self::show_right_block(get_lang('Profile'), + $profile_content, + 'profile_block', + null, + 'profile', + 'profileCollapse' + ); return $html; } @@ -947,7 +966,10 @@ class IndexManager $html = self::show_right_block( get_lang('Courses'), $my_account_content, - 'course_block' + 'course_block', + null, + 'course', + 'courseCollapse' ); } return $html; From 9b21b39936f1f4463f00c2266352b1a0b5241562 Mon Sep 17 00:00:00 2001 From: aragonc Date: Mon, 17 Aug 2015 15:14:10 -0500 Subject: [PATCH 2/8] fix catalog course CT#7539 --- app/Resources/public/css/base.css | 5 + main/admin/configure_homepage.php | 6 +- main/inc/lib/userportal.lib.php | 2 +- .../default/auth/courses_categories.php | 244 +++++++++--------- 4 files changed, 133 insertions(+), 124 deletions(-) diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index 52ec17b7c7..e2777631a3 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -130,6 +130,11 @@ a.thumbnail:hover{ height: auto; width: 100%; } +#notice_block p, #notice-block p{ + color: #666; + font-size: 12px; + line-height: 20px; +} .carousel-indicators{ bottom: 0px !important; } diff --git a/main/admin/configure_homepage.php b/main/admin/configure_homepage.php index 65bb1aa10b..1f9d134df7 100755 --- a/main/admin/configure_homepage.php +++ b/main/admin/configure_homepage.php @@ -286,7 +286,7 @@ if (!empty($action)) { if (is_writable($homep.$noticef.'_'.$lang.$ext)) { $fp = fopen($homep.$noticef.'_'.$lang.$ext, 'w'); if ($errorMsg == '') { - fputs($fp, "$notice_title
    \n$notice_text"); + fputs($fp, "
    $notice_title

    \n$notice_text"); foreach ($_languages['name'] as $key => $value) { $lang_name = $_languages['folder'][$key]; @@ -294,7 +294,7 @@ if (!empty($action)) { if (file_exists($homep.$noticef.'_'.$lang_name.$ext)) { if (is_writable($homep.$noticef.'_'.$lang_name.$ext)) { $fp = fopen($homep.$noticef.'_'.$lang_name.$ext, 'w'); - fputs($fp, "$notice_title
    \n$notice_text"); + fputs($fp, "

    $notice_title

    \n$notice_text"); fclose($fp); } } @@ -321,7 +321,7 @@ if (!empty($action)) { } else { //File does not exist $fp = fopen($homep.$noticef.'_'.$lang.$ext, 'w'); - fputs($fp, "$notice_title
    \n$notice_text"); + fputs($fp, "

    $notice_title

    \n$notice_text"); fclose($fp); } Event::addEvent( diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index 36145e4bcf..de5ddf880e 100755 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -269,7 +269,7 @@ class IndexManager if (!empty($home_notice)) { $home_notice = api_to_system_encoding($home_notice, api_detect_encoding(strip_tags($home_notice))); - $home_notice = Display::div($home_notice, array('class' => 'homepage_notice')); + //$home_notice = Display::div($home_notice, array('class' => 'homepage_notice')); $html = self::show_right_block(get_lang('Notice'), $home_notice, 'notice_block', null, 'notices', 'noticesCollapse'); } return $html; diff --git a/main/template/default/auth/courses_categories.php b/main/template/default/auth/courses_categories.php index 8770161cec..facf8159b0 100755 --- a/main/template/default/auth/courses_categories.php +++ b/main/template/default/auth/courses_categories.php @@ -105,6 +105,118 @@ $code = isset($code) ? $code : null; }); + +

    + + + ".get_lang('SearchResultsFor')." ".Security::remove_XSS($_POST['search_term'])."
    "; + } + + $ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote'; + $user_id = api_get_user_id(); + + if (!empty($browse_courses_in_category)) { + foreach ($browse_courses_in_category as $course) { + $course_hidden = ($course['visibility'] == COURSE_VISIBILITY_HIDDEN); + + if ($course_hidden) { + continue; + } + + $user_registerd_in_course = CourseManager::is_user_subscribed_in_course($user_id, $course['code']); + $user_registerd_in_course_as_teacher = CourseManager::is_course_teacher($user_id, $course['code']); + $user_registerd_in_course_as_student = ($user_registerd_in_course && !$user_registerd_in_course_as_teacher); + $course_public = ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD); + $course_open = ($course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM); + $course_private = ($course['visibility'] == COURSE_VISIBILITY_REGISTERED); + $course_closed = ($course['visibility'] == COURSE_VISIBILITY_CLOSED); + $course_subscribe_allowed = ($course['subscribe'] == 1); + $course_unsubscribe_allowed = ($course['unsubscribe'] == 1); + $count_connections = $course['count_connections']; + $creation_date = substr($course['creation_date'],0,10); + + $icon_title = null; + + // display the course bloc + echo '
    '; + + // display thumbnail + display_thumbnail($course, $icon_title); + + // display course title and button bloc + echo '
    '; + display_title($course); + // display button line + echo '
    '; + // if user registered as student + if ($user_registerd_in_course_as_student) { + if (!$course_closed) { + display_goto_button($course); + display_description_button($course, $icon_title); + if ($course_unsubscribe_allowed) { + display_unregister_button($course, $stok, $search_term, $code); + } + display_already_registered_label('student'); + } + } elseif ($user_registerd_in_course_as_teacher) { + // if user registered as teacher + display_goto_button($course); + display_description_button($course, $icon_title); + if ($course_unsubscribe_allowed) { + display_unregister_button($course, $stok, $search_term, $code); + } + display_already_registered_label('teacher'); + } else { + // if user not registered in the course + if (!$course_closed) { + if (!$course_private) { + display_goto_button($course); + if ($course_subscribe_allowed) { + display_register_button($course, $stok, $code, $search_term); + } + } + display_description_button($course, $icon_title); + } + } + echo '
    '; // btn-toolbar + echo '
    '; // span4 + + // display counter + echo '
    '; + echo '
    '.get_lang('ConnectionsLastMonth').'
    '.$count_connections.'
    '; + echo '
    '; + + // end of course bloc + echo '
    '; // well_border row + } + } else { + if (!isset($_REQUEST['subscribe_user_with_password']) && + !isset($_REQUEST['subscribe_course']) + ) { + Display::display_warning_message(get_lang('ThereAreNoCoursesInThisCategory')); + } + } + } + echo $cataloguePagination; +?> +
    + +
    @@ -280,112 +392,6 @@ $code = isset($code) ? $code : null;

    - - ".get_lang('SearchResultsFor')." ".Security::remove_XSS($_POST['search_term'])."
    "; - } - - $ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote'; - $user_id = api_get_user_id(); - - if (!empty($browse_courses_in_category)) { - foreach ($browse_courses_in_category as $course) { - $course_hidden = ($course['visibility'] == COURSE_VISIBILITY_HIDDEN); - - if ($course_hidden) { - continue; - } - - $user_registerd_in_course = CourseManager::is_user_subscribed_in_course($user_id, $course['code']); - $user_registerd_in_course_as_teacher = CourseManager::is_course_teacher($user_id, $course['code']); - $user_registerd_in_course_as_student = ($user_registerd_in_course && !$user_registerd_in_course_as_teacher); - $course_public = ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD); - $course_open = ($course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM); - $course_private = ($course['visibility'] == COURSE_VISIBILITY_REGISTERED); - $course_closed = ($course['visibility'] == COURSE_VISIBILITY_CLOSED); - $course_subscribe_allowed = ($course['subscribe'] == 1); - $course_unsubscribe_allowed = ($course['unsubscribe'] == 1); - $count_connections = $course['count_connections']; - $creation_date = substr($course['creation_date'],0,10); - - $icon_title = null; - - // display the course bloc - echo '
    '; - - // display thumbnail - display_thumbnail($course, $icon_title); - - // display course title and button bloc - echo '
    '; - display_title($course); - // display button line - echo '
    '; - // if user registered as student - if ($user_registerd_in_course_as_student) { - if (!$course_closed) { - display_goto_button($course); - display_description_button($course, $icon_title); - if ($course_unsubscribe_allowed) { - display_unregister_button($course, $stok, $search_term, $code); - } - display_already_registered_label('student'); - } - } elseif ($user_registerd_in_course_as_teacher) { - // if user registered as teacher - display_goto_button($course); - display_description_button($course, $icon_title); - if ($course_unsubscribe_allowed) { - display_unregister_button($course, $stok, $search_term, $code); - } - display_already_registered_label('teacher'); - } else { - // if user not registered in the course - if (!$course_closed) { - if (!$course_private) { - display_goto_button($course); - if ($course_subscribe_allowed) { - display_register_button($course, $stok, $code, $search_term); - } - } - display_description_button($course, $icon_title); - } - } - echo '
    '; // btn-toolbar - echo '
    '; // span4 - - // display counter - echo '
    '; - echo '
    '.get_lang('ConnectionsLastMonth').'
    '.$count_connections.'
    '; - echo '
    '; - - // end of course bloc - echo '
    '; // well_border row - } - } else { - if (!isset($_REQUEST['subscribe_user_with_password']) && - !isset($_REQUEST['subscribe_course']) - ) { - Display::display_warning_message(get_lang('ThereAreNoCoursesInThisCategory')); - } - } ?> - -
    '; - echo '
    '; + + echo '
    '; if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') { echo ''; - echo ''.api_htmlentities($title).''; + echo ''.api_htmlentities($title).''; echo ''; } else { - echo ''.api_htmlentities($title).''; + echo ''.api_htmlentities($title).''; } echo '
    '; // thumbail - echo '
    '; // span2 + } /** @@ -432,12 +438,12 @@ function display_title($course) $teachers = CourseManager::get_teacher_list_from_course_code_to_string($course['code']); $rating = Display::return_rating_system('star_'.$course['real_id'], $ajax_url.'&course_id='.$course['real_id'], $course['point_info']); - $teachers = '
    '.$teachers.'
    '; - echo '
    '; - echo '

    '.cut($title, 60).'

    '; + $teachers = '
    '.$teachers.'
    '; + + echo '

    '.cut($title, 60).'

    '; echo $teachers; echo $rating; - echo '
    '; // categories-course-description + } /** @@ -496,6 +502,4 @@ function display_register_button($course, $stok, $code, $search_term) function display_unregister_button($course, $stok, $search_term, $code) { echo ' '.get_lang('Unsubscribe').''; -} - - +} \ No newline at end of file From d6fa3b2352f7331da9d2146a122d66dcde0605cf Mon Sep 17 00:00:00 2001 From: aragonc Date: Tue, 18 Aug 2015 19:35:49 -0500 Subject: [PATCH 3/8] fix install chamilo CT#7539 --- main/install/index.php | 6 +- main/install/install.lib.php | 273 +++++++++++++++++++---------------- 2 files changed, 150 insertions(+), 129 deletions(-) diff --git a/main/install/index.php b/main/install/index.php index 5030d92a3f..01c9f6761c 100755 --- a/main/install/index.php +++ b/main/install/index.php @@ -560,11 +560,11 @@ if (@$_POST['step2']) { //STEP 6 : LAST CHECK BEFORE INSTALL ?>
    -

    +

    -

    +
    -

    '.display_step_sequence().$msg.'

    '; +

    '.display_step_sequence().$msg.'

    '; if (!empty($installationProfile)) { echo '

    ('.$installationProfile.')

    '; } diff --git a/main/install/install.lib.php b/main/install/install.lib.php index 4b9cde2c35..7a6f9784ee 100755 --- a/main/install/install.lib.php +++ b/main/install/install.lib.php @@ -605,18 +605,20 @@ function display_language_selection_box($name = 'language_list', $default_langua } // Displaying the box. - echo "\t\t\n"; foreach ($language_list as $key => $value) { if ($key == $default_language) { $option_end = ' selected="selected">'; } else { $option_end = '>'; } - echo "\t\t\t