From 8664c500034fd71c7ec9327a84cd2588acb7ff94 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 27 Feb 2012 11:56:14 +0100 Subject: [PATCH] Layout fixes --- main/inc/lib/course.lib.php | 4 +-- main/inc/lib/userportal.lib.php | 47 +++++++++++++-------------------- main/messages/new_message.php | 34 +++++++++--------------- 3 files changed, 34 insertions(+), 51 deletions(-) diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index 976ef67a48..d688ea6fa3 100644 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -2722,8 +2722,8 @@ class CourseManager { return $html; } - public function course_item_parent($main_content, $sub_content) { - return '
'.$main_content.$sub_content.'
'; + public function course_item_parent($main_content, $sub_content, $sub_sub_content = null) { + return '
'.$main_content.$sub_content.$sub_sub_content.'
'; } /** diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index 336d1ebc68..4376506795 100644 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -1030,14 +1030,6 @@ class IndexManager { define("CONFVAL_limitPreviewTo", SCRIPTVAL_NewEntriesOfTheDayOfLastLogin); - if (isset($_GET['history']) && intval($_GET['history']) == 1) { - echo Display::tag('h2', get_lang('HistoryTrainingSession')); - //if (empty($courses_tree[0]['sessions'])){ - if (empty($courses_tree)) { - echo get_lang('YouDoNotHaveAnySessionInItsHistory'); - } - } - /* PERSONAL COURSE LIST */ if (!isset ($maxValvas)) { @@ -1083,6 +1075,18 @@ class IndexManager { } } } + + + $html = ''; + + + if (isset($_GET['history']) && intval($_GET['history']) == 1) { + $html .= Display::tag('h2', get_lang('HistoryTrainingSession')); + //if (empty($courses_tree[0]['sessions'])){ + if (empty($courses_tree)) { + $html .= get_lang('YouDoNotHaveAnySessionInItsHistory'); + } + } foreach ($personal_course_list as $my_course) { $thisCourseSysCode = $my_course['k']; @@ -1170,7 +1174,7 @@ class IndexManager { } } // End while mycourse... - $html = ''; + if (is_array($courses_tree)) { foreach ($courses_tree as $key => $category) { @@ -1283,38 +1287,25 @@ class IndexManager { $params['title'] .= ''; if (api_is_platform_admin()) { - $params['title'] .= '
'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'),22).'
'; + $params['right_actions'] .= ''.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'),22).''; } - $html .= CourseManager::course_item_parent(CourseManager::course_item_html($params), $html_courses_session); - - //$html_sessions .= ''; - //$html_sessions .= $html_courses_session; - - //$html_sessions .= ''; + $html_sessions .= CourseManager::course_item_html($params).$html_courses_session; } } if ($count_courses_session > 0) { - $params = array(); - - //$html .= '
'; - //$html .= '
'; - + $params = array(); $params['icon'] = Display::return_icon('folder_blue.png', get_lang('SessionCategory'), array(), ICON_SIZE_LARGE); - - if (api_is_platform_admin()) { - $params['right_actions'] .= '
'.Display::return_icon('edit.png', get_lang('Edit'), array(),22).'
'; - } + if (api_is_platform_admin()) { + $params['right_actions'] .= ''.Display::return_icon('edit.png', get_lang('Edit'), array(),22).''; + } $params['title'] .= $category['details']['name']; if ($category['details']['date_end'] != '0000-00-00') { $params['title'] .= sprintf(get_lang('FromDateXToDateY'),$category['details']['date_start'], $category['details']['date_end']); } - //$html .= $html_sessions; - //$html .= '
'; - $html .= CourseManager::course_item_parent(CourseManager::course_item_html($params), $html_sessions); } } diff --git a/main/messages/new_message.php b/main/messages/new_message.php index 3ca5b4b7c6..11f912415b 100644 --- a/main/messages/new_message.php +++ b/main/messages/new_message.php @@ -109,8 +109,7 @@ function add_image_form() { filepaths.appendChild(elem1); id_elem1 = "filepath_"+counter_image; id_elem1 = "\'"+id_elem1+"\'"; - //document.getElementById("filepath_"+counter_image).innerHTML = " "; - document.getElementById("filepath_"+counter_image).innerHTML = " "; + document.getElementById("filepath_"+counter_image).innerHTML = " "; if (filepaths.childNodes.length == 6) { var link_attach = document.getElementById("link-more-attach"); if (link_attach) { @@ -179,32 +178,25 @@ function manage_form($default, $select_from_user_list = null, $sent_to = null) { if (!empty($sent_to)) { $form->addElement('html',$sent_to); } - if (empty($default['users'])) { - //the magic should be here - $pre_html = '
-
'.get_lang('SendMessageTo').'
-
'; - $post = '
'; - $multi_select = ''; - $form->addElement('html',$pre_html.$multi_select.$post ); - + if (empty($default['users'])) { + //fb select + $form->addElement('select', 'users', get_lang('SendMessageTo'), array(), array('id' => 'users')); } else { $form->addElement('hidden','hidden_user',$default['users'][0],array('id'=>'hidden_user')); } } } else { $group_info = GroupPortalManager::get_group_data($group_id); + $form->addElement('html','
'.get_lang('ToGroup').'
'.api_xml_http_response_encode($group_info['name']).'
'); $form->addElement('hidden','group_id',$group_id); $form->addElement('hidden','parent_id',$message_id); } - $form->add_textfield('title', get_lang('Subject'),true ,array('size' => 54)); + $form->add_textfield('title', get_lang('Subject'),true , array('size' => 54)); $form->add_html_editor('content', get_lang('Message'), false, false, array('ToolbarSet' => 'Messages', 'Width' => '95%', 'Height' => '250')); - //$form->addElement('textarea','content', get_lang('Message'), array('cols' => 75,'rows'=>8)); - + if (isset($_GET['re_id'])) { $message_reply_info = MessageManager::get_message_by_id($_GET['re_id']); $form->addElement('hidden','re_id', intval($_GET['re_id'])); @@ -215,13 +207,13 @@ function manage_form($default, $select_from_user_list = null, $sent_to = null) { $default['content'] = '
'.sprintf(get_lang('XWroteY'), api_get_person_name($user_reply_info['firstname'], $user_reply_info['lastname']), Security::filter_terms($message_reply_info['content'])); } if (empty($group_id)) { - $form->addElement('html','
'.get_lang('FilesAttachment').'
- + + + $form->addElement('advanced_settings',get_lang('FilesAttachment').'
- - -
'); - $form->addElement('html','
'.get_lang('AddOneMoreFile').' ('.sprintf(get_lang('MaximunFileSizeX'),format_file_size(api_get_setting('message_max_upload_filesize'))).')
'); + +
'); + $form->addElement('advanced_settings',''.get_lang('AddOneMoreFile').' ('.sprintf(get_lang('MaximunFileSizeX'),format_file_size(api_get_setting('message_max_upload_filesize'))).')'); } $form->addElement('style_submit_button','compose',api_xml_http_response_encode(get_lang('SendMessage')),'class="save"');