Adding option $app['full_width'] that makes the portal full width instead of a fixed width see BT#5881

skala
Julio Montoya 13 years ago
parent 5064ad19e7
commit 58ba691d2d
  1. 10
      main/course_home/activity.php
  2. 5
      main/css/base.css
  3. 3
      main/inc/global.inc.php
  4. 10
      main/inc/lib/course.lib.php
  5. 78
      main/inc/lib/course_home.lib.php
  6. 4
      main/inc/lib/introductionSection.inc.php
  7. 15
      main/template/default/layout/main_header.tpl
  8. 8
      main/template/default/layout/menu.tpl
  9. 8
      main/template/default/layout/topbar.tpl
  10. 4
      src/ChamiloLMS/Controller/IndexController.php

@ -114,6 +114,12 @@ if (api_is_allowed_to_edit(null, true) && !api_is_coach()) {
}
function return_block($title, $content) {
$html = '<div class="row"><div class="span12"><div class="page-header"><h3>'.$title.'</h3></div></div></div><div class="row">'.$content.'</div>';
global $app;
$rowDiv = '<div class="row">';
if ($app['full_width']) {
$rowDiv = '<div class="row-fluid">';
}
$html = $rowDiv.'<div class="span12">
<div class="page-header"><h3>'.$title.'</h3></div></div></div>'.$rowDiv.$content.'</div>';
return $html;
}
}

@ -5276,3 +5276,8 @@ i.size-32.icon-new-work {
#question_admin_form .media, #edit_question .media{
display:none;
}
.activity_content {
margin-left:120px;
}

@ -194,6 +194,9 @@ require_once __DIR__.'/../../src/ChamiloLMS/Resources/config/dev.php';
// Classic way of render pages or the Controller approach
$app['classic_layout'] = false;
$app['full_width'] = false;
$app['breadcrumb'] = array();
// The script is allowed? This setting is modified when calling api_is_not_allowed()

@ -2519,6 +2519,12 @@ class CourseManager
* @todo use Twig
*/
public static function course_item_html($params, $is_sub_content = false) {
global $app;
if ($app['full_width']) {
$rowDiv = '<div class="row-fluid">';
} else {
$rowDiv = '<div class="row">';
}
$html = '';
$class = "well course-box";
if ($is_sub_content) {
@ -2528,9 +2534,9 @@ class CourseManager
$class .= " session-item";
}
$html .= '<div class="'.$class.'">';
$html .= '<div class="row">';
$html .= $rowDiv;
$html .= '<div class="span7">';
$html .= ' <div class="row">';
$html .= $rowDiv;
$html .= '<div class="span1 course-box-thumbnail-box">';
if (!empty($params['link'])) {
$html .= '<a class="thumbnail" href="'.$params['link'].'">';

@ -576,6 +576,7 @@ class CourseHome {
* @return void
*/
public static function show_tools_category($all_tools_list, $rows = false) {
$rowDiv = '<div class="row-fluid">';
$theme = api_get_setting('homepage_view');
if ($theme == 'vertical_activity') {
//ordering by get_lang name
@ -698,30 +699,32 @@ class CourseHome {
//$tool['link'] = htmlspecialchars($tool['link']) ;
//@todo this visio stuff should be removed
if (strpos($tool['name'],'visio_') !== false) {
$tool_link_params = array('id' => 'tooldesc_'.$tool["id"],
'href' => '"javascript: void(0);"',
'class' => $class,
'onclick' => 'javascript: window.open(\'' . $tool['link'] . '\',\'window_visio'.$_SESSION['_cid'].'\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')',
'target' => $tool['target']);
$tool_link_params = array(
'id' => 'tooldesc_'.$tool["id"],
'href' => '"javascript: void(0);"',
'class' => $class,
'onclick' => 'javascript: window.open(\'' . $tool['link'] . '\',\'window_visio'.$_SESSION['_cid'].'\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')',
'target' => $tool['target']);
} elseif (strpos($tool['name'], 'chat') !== false && api_get_course_setting('allow_open_chat_window')) {
$tool_link_params = array('id' => 'tooldesc_'.$tool["id"],
'class' => $class,
'href' => 'javascript: void(0);',
'onclick' => 'javascript: window.open(\'' . $tool['link'] . '\',\'window_chat'.$_SESSION['_cid'].'\',config=\'height=\'+380+\', width=\'+625+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')',
'target' => $tool['target']);
$tool_link_params = array(
'id' => 'tooldesc_'.$tool["id"],
'class' => $class,
'href' => 'javascript: void(0);',
'onclick' => 'javascript: window.open(\'' . $tool['link'] . '\',\'window_chat'.$_SESSION['_cid'].'\',config=\'height=\'+380+\', width=\'+625+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')',
'target' => $tool['target']);
} else {
if (count(explode('type=classroom',$tool['link'])) == 2 || count(explode('type=conference', $tool['link'])) == 2) {
$tool_link_params = array('id' => 'tooldesc_'.$tool["id"],
'href' => $tool['link'],
'class' => $class,
'target' => '_blank');
$tool_link_params = array(
'id' => 'tooldesc_'.$tool["id"],
'href' => $tool['link'],
'class' => $class,
'target' => '_blank');
} else {
$tool_link_params = array('id' => 'tooldesc_'.$tool["id"],
'href' => $tool['link'],
'class' => $class,
'target' => $tool['target']);
$tool_link_params = array(
'id' => 'tooldesc_'.$tool["id"],
'href' => $tool['link'],
'class' => $class,
'target' => $tool['target']);
}
}
@ -761,12 +764,18 @@ class CourseHome {
$i = 0;
$html = '';
$counter = 0;
if (!empty($items)) {
foreach ($items as $item) {
switch ($theme) {
case 'activity_big':
$data = '';
if ($counter == 0) {
$html .= $rowDiv;
}
$html .= '<div class="span4 course-tool">';
$image = (substr($item['tool']['image'], 0, strpos($item['tool']['image'], '.'))).'.png';
@ -795,14 +804,33 @@ class CourseHome {
$html .= Display::div($data, array('class'=>'big_icon')); //box-image reflection
$html .= Display::div('<h4>'.$item['visibility'].$item['extra'].$item['link'].'</h4>', array('class'=>'content'));
$html .= '</div>';
if ($counter == 2) {
$html .= '</div>';
$counter = -1;
}
$counter++;
break;
case 'activity':
$html .= '<div class="offset2 span4 course-tool">';
$html .= $item['extra'];
$html .= $item['visibility'];
$html .= $item['icon'];
$html .= $item['link'];
if ($counter == 0) {
$html .= $rowDiv;
}
$html .= '<div class="span6 course-tool">';
$content = $item['extra'];
$content .= $item['visibility'];
$content .= $item['icon'];
$content .= $item['link'];
$html .= Display::div($content, array('class'=>'activity_content'));
$html .= '</div>';
if ($counter == 1) {
$html .= '</div>';
$counter = -1;
}
$counter++;
break;
case 'vertical_activity':
if ($i == 0) {

@ -217,14 +217,14 @@ $introduction_section .= '<div class="row"><div class="span12">';
$introduction_section .= $thematic_description_html;
$introduction_section .= '</div>';
$introduction_section .= '<div class="span12">';
//$introduction_section .= '<div class="span12">';
if ($intro_dispDefault) {
$intro_content = $intro_content;
if (!empty($intro_content)) {
$introduction_section .= $intro_content;
}
}
$introduction_section .= '</div>';
//$introduction_section .= '</div>';
if ($intro_dispCommand) {
if (empty($intro_content)) {

@ -42,7 +42,11 @@
{# topbar #}
{% include app.template_style ~ "/layout/topbar.tpl" %}
<div id="main" class="container">
{% if app.full_width == 1 %}
<div id="main" class="container-fluid">
{% else %}
<div id="main" class="container">
{% endif %}
<header>
<div class="row">
<div id="header_left" class="span4">
@ -97,7 +101,12 @@
{{ breadcrumb }}
</header>
<div id="top_main_content" class="row">
{% if app.full_width == 1 %}
<div id="top_main_content" class="row-fluid">
{% else %}
<div id="top_main_content" class="row">
{% endif %}
{# course navigation links/shortcuts need to be activated by the admin #}
{% include app.template_style ~ "/layout/course_navigation.tpl" %}
{% endif %}
{% endif %}

@ -2,7 +2,11 @@
<div class="navbar subnav">
<div class="navbar-inner">
<div class="container">
{% if app.full_width == 1 %}
<div id="main" class="container-fluid">
{% else %}
<div id="main" class="container">
{% endif %}
<a data-toggle="collapse" data-target=".nav-collapse" class="btn btn-navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
@ -47,4 +51,4 @@
</div>
</div>
</div>
{% endif %}
{% endif %}

@ -2,7 +2,11 @@
{% if show_toolbar == 1 %}
<div id="topbar" class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
{% if app.full_width == 1 %}
<div id="main" class="container-fluid">
{% else %}
<div id="main" class="container">
{% endif %}
<a class="brand" href="{{ _p.web }}">
{{ "siteName" | get_setting }}
</a>
@ -85,4 +89,4 @@
</div><!-- /navbar-inner -->
</div><!-- /topbar -->
<div id="topbar_push"></div>
{% endif %}
{% endif %}

@ -280,9 +280,9 @@ class IndexController extends CommonController
'text',
'login',
get_lang('UserName'),
array('class' => 'span2 autocapitalize_off', 'autofocus' => 'autofocus')
array('class' => 'autocapitalize_off', 'autofocus' => 'autofocus')
);
$form->addElement('password', 'password', get_lang('Pass'), array('class' => 'span2'));
$form->addElement('password', 'password', get_lang('Pass'), array('class' => ''));
$form->addElement('style_submit_button', 'submitAuth', get_lang('LoginEnter'), array('class' => 'btn'));
$html = $form->return_form();
if (api_get_setting('openid_authentication') == 'true') {

Loading…
Cancel
Save