Replace twig block name needed in other templates

Fix forum preview UI

See #2768
pull/2837/head
Julio Montoya 7 years ago
parent 2ad64fa5ca
commit 3cd2b770cd
  1. 34
      main/forum/iframe_thread.php
  2. 13
      src/ThemeBundle/Resources/views/Layout/base-layout.html.twig

@ -25,9 +25,6 @@ require_once __DIR__.'/../inc/global.inc.php';
// A notice for unauthorized people.
api_protect_course_script(true);
$nameTools = get_lang('ToolForum');
Display::display_reduced_header();
/* Including necessary files */
require 'forumconfig.inc.php';
require_once 'forumfunction.inc.php';
@ -73,29 +70,30 @@ $sql = "SELECT * FROM $table_posts posts
ORDER BY posts.post_id ASC";
$result = Database::query($sql);
echo "<table width=\"100%\" height=\"100%\" cellspacing=\"5\" border=\"0\">";
$template = new Template('', false, false);
$content = "<table width=\"100%\" height=\"100%\" cellspacing=\"5\" border=\"0\">";
while ($row = Database::fetch_array($result)) {
echo "<tr>";
echo "<td rowspan=\"2\" class=\"forum_message_left\">";
$content .= "<tr>";
$content .= "<td rowspan=\"2\" class=\"forum_message_left\">";
$username = api_htmlentities(sprintf(get_lang('LoginX'), $row['username']), ENT_QUOTES);
if ($row['user_id'] == '0') {
$name = $row['poster_name'];
} else {
$name = api_get_person_name($row['firstname'], $row['lastname']);
}
echo Display::tag('span', $name, ['title' => $username]).'<br />';
echo api_convert_and_format_date($row['post_date']).'<br /><br />';
$content .= Display::tag('span', $name, ['title' => $username]).'<br />';
$content .= api_convert_and_format_date($row['post_date']).'<br /><br />';
echo "</td>";
echo "<td class=\"forum_message_post_title\">".Security::remove_XSS($row['post_title'])."</td>";
echo "</tr>";
$content .= "</td>";
$content .= "<td class=\"forum_message_post_title\">".Security::remove_XSS($row['post_title'])."</td>";
$content .= "</tr>";
echo "<tr>";
echo "<td class=\"forum_message_post_text\">".Security::remove_XSS($row['post_text'], STUDENT)."</td>";
echo "</tr>";
$content .= "<tr>";
$content .= "<td class=\"forum_message_post_text\">".Security::remove_XSS($row['post_text'], STUDENT)."</td>";
$content .= "</tr>";
}
echo "</table>";
$content .= "</table>";
?>
</body>
</html>
$template->assign('content', $content);
$template->display_no_layout_template();

@ -21,19 +21,19 @@
{{ sonata_seo_html_attributes() }}
data-in-course="{{ course ? 'true' : 'false' }}"
data-course-code="{{ course ? course.code : '' }}"
data-session-id="{{ session ? session.id : '' }}"
>
<noscript> {{ "NoJavascript" | trans }} </noscript>
<!-- PAGE -->
{% block chamilo_wrap %}
<!-- HEADER -->
<!-- HEADER -->
{% block page_header %}
{% include '@ChamiloTheme/Layout/header.html.twig' %}
{% endblock %}
<!-- END HEADER -->
<!-- END HEADER -->
<div class="app-body">
<div class="app-body">
<!-- SIDEBAR -->
{% block page_sidebar %}
{% include '@ChamiloTheme/Layout/sidebar.html.twig' %}
@ -47,16 +47,15 @@
<!-- END BREADCRUMB -->
<!-- CONTENT -->
{% block page_content %}
{% endblock %}
<!-- END CONTENT -->
</main>
</div>
</div>
{% endblock %}
<!-- END PAGE -->
<!-- FOOTER -->
{% block page_footer %}
{% block chamilo_footer %}
{% include '@ChamiloTheme/Layout/footer.html.twig' %}
{% endblock %}
<!-- END FOOTER -->

Loading…
Cancel
Save