Example #1
0
}
/* Resource Linker */
if (isset($_POST['add_resources']) and $_POST['add_resources'] == get_lang('Resources')) {
    $_SESSION['formelements'] = $_POST;
    $_SESSION['origin'] = $_SERVER['REQUEST_URI'];
    $_SESSION['breadcrumbs'] = $interbreadcrumb;
    header('Location: ../resourcelinker/resourcelinker.php');
}
/* Header */
if ($origin == 'learnpath') {
    Display::display_reduced_header();
} else {
    Display::display_header(null);
    //api_display_tool_title($nameTools);
}
/* Display forms / Feedback Messages */
handle_forum_and_forumcategories();
// Action links
echo '<div class="actions">';
echo '<span style="float:right;">' . search_link() . '</span>';
echo '<a href="viewforum.php?origin=' . $origin . '&forum=' . Security::remove_XSS($_GET['forum']) . '&amp;gidReq=' . Security::remove_XSS($_GET['gidReq']) . '">' . Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '</div>';
$values = show_add_post_form('newthread', '', isset($_SESSION['formelements']) ? $_SESSION['formelements'] : null);
if (!empty($values) && isset($values['SubmitPost'])) {
    // Add new thread in table forum_thread.
    store_thread($values);
}
/* FOOTER */
if ($origin != 'learnpath') {
    Display::display_footer();
}
Example #2
0
            var newInputFile = \$('<input>', {
                type: 'file',
                name: 'user_upload[]'
            });

            \$('[name="user_upload[]"]').parent().append(newInputFile);
        });
    });
    </script>
JS;
if ($origin == 'learnpath') {
    Display::display_reduced_header();
} else {
    Display::display_header(null);
}
handle_forum_and_forumcategories();
// Action links
echo '<div class="actions">';
echo '<span style="float:right;">' . search_link() . '</span>';
echo '<a href="viewforum.php?forum=' . Security::remove_XSS($_GET['forum']) . '&' . api_get_cidreq() . '">' . Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '</div>';
// Set forum attachment data into $_SESSION
getAttachedFiles($current_forum['forum_id'], 0, 0);
$values = show_add_post_form($current_forum, $forum_setting, 'newthread', '', isset($_SESSION['formelements']) ? $_SESSION['formelements'] : null);
if (!empty($values) && isset($values['SubmitPost'])) {
    // Add new thread in table forum_thread.
    store_thread($current_forum, $values);
}
if (isset($origin) && $origin != 'learnpath') {
    Display::display_footer();
}
Example #3
0
if ($origin != 'learnpath') {
    echo '<div class="actions">';
    echo '<span style="float:right;">' . search_link() . '</span>';
    echo '<a href="viewthread.php?' . api_get_cidreq() . '&forum=' . Security::remove_XSS($_GET['forum']) . '&gradebook=' . $gradebook . '&thread=' . Security::remove_XSS($_GET['thread']) . '&origin=' . $origin . '">' . Display::return_icon('back.png', get_lang('BackToThread'), '', ICON_SIZE_MEDIUM) . '</a>';
    echo '</div>';
} else {
    echo '<div style="height:15px">&nbsp;</div>';
}
/*New display forum div*/
echo '<div class="forum_title">';
echo '<h1><a href="viewforum.php?&origin=' . $origin . '&forum=' . $current_forum['forum_id'] . '" ' . class_visible_invisible($current_forum['visibility']) . '>' . prepare4display($current_forum['forum_title']) . '</a></h1>';
echo '<p class="forum_description">' . prepare4display($current_forum['forum_comment']) . '</p>';
echo '</div>';
/* End new display forum */
// The form for the reply
$my_action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : '';
$my_post = isset($_GET['post']) ? Security::remove_XSS($_GET['post']) : '';
$my_elements = isset($_SESSION['formelements']) ? $_SESSION['formelements'] : '';
$values = show_add_post_form($current_forum, $forum_setting, $my_action, $my_post, $my_elements);
if (!empty($values) and isset($_POST['SubmitPost'])) {
    $result = store_reply($current_forum, $values);
    //@todo split the show_add_post_form function
    $url = 'viewthread.php?forum=' . $current_thread['forum_id'] . '&gradebook=' . $gradebook . '&thread=' . intval($_GET['thread']) . '&gidReq=' . api_get_group_id() . '&origin=' . $origin . '&msg=' . $result['msg'] . '&type=' . $result['type'];
    echo '
    <script>
    window.location = "' . $url . '";
    </script>';
}
if (isset($origin) && $origin != 'learnpath') {
    Display::display_footer();
}
Example #4
0
} else {
    // The last element of the breadcrumb navigation is already set in interbreadcrumb, so give an empty string.
    Display::display_header('');
}
/* Action links */
if ($origin != 'learnpath') {
    echo '<div class="actions">';
    echo '<span style="float:right;">' . search_link() . '</span>';
    echo '<a href="viewthread.php?forum=' . Security::remove_XSS($_GET['forum']) . '&amp;gradebook=' . $gradebook . '&amp;thread=' . Security::remove_XSS($_GET['thread']) . '&amp;origin=' . $origin . '">' . Display::return_icon('back.png', get_lang('BackToThread'), '', ICON_SIZE_MEDIUM) . '</a>';
    echo '</div>';
} else {
    echo '<div style="height:15px">&nbsp;</div>';
}
// The form for the reply
$my_action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : '';
$my_post = isset($_GET['post']) ? Security::remove_XSS($_GET['post']) : '';
$my_elements = isset($_SESSION['formelements']) ? $_SESSION['formelements'] : '';
$values = show_add_post_form($my_action, $my_post, $my_elements);
// Note: This has to be cleaned first.
if (!empty($values) and isset($_POST['SubmitPost'])) {
    $result = store_reply($values);
    //@todo split the show_add_post_form function
    $url = 'viewthread.php?forum=' . $current_thread['forum_id'] . '&gradebook=' . $gradebook . '&thread=' . intval($_GET['thread']) . '&gidReq=' . api_get_group_id() . '&origin=' . $origin . '&msg=' . $result['msg'] . '&type=' . $result['type'];
    echo '
    <script>
    window.location = "' . $url . '";
    </script>';
}
if ($origin != 'learnpath') {
    Display::display_footer();
}