From b8090c436540e3068d7c3228a0100f1c6972be4e Mon Sep 17 00:00:00 2001 From: aragonc Date: Fri, 26 Jun 2015 17:26:44 -0500 Subject: [PATCH] fix structure html php course-home --- main/course_home/course_home.php | 12 +--- main/inc/introductionSection.inc.php | 98 ++++++++++++++++------------ 2 files changed, 57 insertions(+), 53 deletions(-) diff --git a/main/course_home/course_home.php b/main/course_home/course_home.php index 1eba1c4760..9691d47b4a 100755 --- a/main/course_home/course_home.php +++ b/main/course_home/course_home.php @@ -286,17 +286,9 @@ if (api_get_setting('homepage_view') == 'activity' || require 'vertical_activity.php'; } -$editIconButton = ''; -if (api_is_allowed_to_edit()) { - $editIconButton = '
'.Display::url( - get_lang('CustomizeIcons'), - api_get_path(WEB_CODE_PATH).'course_info/tools.php?'.api_get_cidreq(), - ['class' => 'btn btn-default' ] - ); - $editIconButton .= '
'; -} -$content = '
'.$editIconButton.$content.'
'; + +$content = '
'.$content.'
'; $tpl = new Template(null); $tpl->assign('message', $show_message); $tpl->assign('content', $content); diff --git a/main/inc/introductionSection.inc.php b/main/inc/introductionSection.inc.php index 054d202357..5e76a065eb 100755 --- a/main/inc/introductionSection.inc.php +++ b/main/inc/introductionSection.inc.php @@ -275,62 +275,60 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) { $thematic_description_html.=''; } } - -$introduction_section .= '
'; -$introduction_section .= $thematic_description_html; -$introduction_section .= '
'; - -$introduction_section .= '
'; - -if ($intro_dispDefault) { - if (!empty($intro_content)) { - $introduction_section.='
'; - $introduction_section .= $intro_content; - $introduction_section.='
'; - } +$introduction_section .= '
'; +if (!empty($thematic_advance_info)) { + $introduction_section .= '
'; + $introduction_section .= $thematic_description_html; + $introduction_section .= '
'; +} +$editIconButton = ''; +if (api_is_allowed_to_edit()) { + $editIconButton = Display::url( + ' ', + api_get_path(WEB_CODE_PATH).'course_info/tools.php?'.api_get_cidreq(), + ['class' => 'btn btn-default', 'title' => get_lang('CustomizeIcons') ] + ); } -$introduction_section .= '
'; - if ($intro_dispCommand) { if (empty($intro_content)) { // Displays "Add intro" commands - $introduction_section .= '
'; + $toolbar = '
'; if (!empty ($GLOBALS['_cid'])) { - $introduction_section .= ""; - $introduction_section .= Display::return_icon('introduction_add.gif', get_lang('AddIntro')).' '; - $introduction_section .= ""; + $toolbar .= ''; + $toolbar .= ' '; + $toolbar .= ""; + $toolbar .= $editIconButton; } else { - $introduction_section .= "\n".get_lang('AddIntro').""; + $toolbar .= '"' . get_lang('AddIntro') . ''; + $toolbar .= $editIconButton; } - $introduction_section .= "
"; + $toolbar .= '
'; } else { // Displays "edit intro && delete intro" commands - $introduction_section .= '
'; + $toolbar .= '
'; if (!empty ($GLOBALS['_cid'])) { - $introduction_section .= - "". - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL). - ""; - $introduction_section .= - "". - Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL). - ""; + $toolbar .= + ' + '; + $toolbar .= $editIconButton; + $toolbar .= + ' '; + } else { - $introduction_section .= - "". - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL). - ""; - $introduction_section .= - "". - Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL). - ""; + $toolbar .= + ' + + "'; + $toolbar .= $editIconButton; + $toolbar .= + ' '; } - $introduction_section .= "
"; + $toolbar .= "
"; // Fix for chrome XSS filter for videos in iframes - BT#7930 $browser = api_get_navigator(); if (strpos($introduction_section, '