pull/3016/head
Alex Aragón 6 years ago
commit 5b9f76ad81
  1. 3
      composer.json
  2. 2
      main/forum/download.php
  3. 10
      main/forum/viewthread.php
  4. 31
      main/inc/lib/glossary.lib.php
  5. 6
      main/inc/lib/link.lib.php

@ -41,6 +41,9 @@
"ext-xml": "*", "ext-xml": "*",
"ext-json": "*", "ext-json": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-libxml": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
"ext-bcmath": "*", "ext-bcmath": "*",
"twig/twig": "2.*", "twig/twig": "2.*",
"doctrine/orm": "~2.6", "doctrine/orm": "~2.6",

@ -82,7 +82,7 @@ if ($forum_thread_visibility == 1 && $forum_forum_visibility == 1) {
if ($result === false) { if ($result === false) {
api_not_allowed(true); api_not_allowed(true);
} }
} }
} }
api_not_allowed(); api_not_allowed();

@ -197,7 +197,7 @@ if (!api_is_allowed_to_edit(false, true) &&
$template = new Template('', false, false, true, true, false); $template = new Template('', false, false, true, true, false);
} else { } else {
$template = new Template(); $template = new Template();
} }
$actions = '<span style="float:right;">'.search_link().'</span>'; $actions = '<span style="float:right;">'.search_link().'</span>';
if ($origin != 'learnpath') { if ($origin != 'learnpath') {
@ -288,7 +288,7 @@ if (isset($_GET['action']) &&
isset($_GET['id_attach']) isset($_GET['id_attach'])
) { ) {
delete_attachment(0, $_GET['id_attach']); delete_attachment(0, $_GET['id_attach']);
} }
$origin = api_get_origin(); $origin = api_get_origin();
$sessionId = api_get_session_id(); $sessionId = api_get_session_id();
@ -320,7 +320,7 @@ foreach ($posts as $post) {
$username = ''; $username = '';
if (isset($post['username'])) { if (isset($post['username'])) {
$username = sprintf(get_lang('LoginX'), $post['username']); $username = sprintf(get_lang('LoginX'), $post['username']);
} }
$name = $post['complete_name']; $name = $post['complete_name'];
if (empty($posterId)) { if (empty($posterId)) {
@ -328,11 +328,11 @@ foreach ($posts as $post) {
} }
$post['user_data'] = ''; $post['user_data'] = '';
if ($origin != 'learnpath') { if ($origin != 'learnpath') {
if ($allowUserImageForum) { if ($allowUserImageForum) {
$post['user_data'] = '<div class="thumbnail">'. $post['user_data'] = '<div class="thumbnail">'.
display_user_image($posterId, $name, $origin).'</div>'; display_user_image($posterId, $name, $origin).'</div>';
} }
$post['user_data'] .= Display::tag( $post['user_data'] .= Display::tag(
'h4', 'h4',

@ -397,51 +397,50 @@ class GlossaryManager
// action links // action links
$actionsLeft = ''; $actionsLeft = '';
if (api_is_allowed_to_edit(null, true)) { if (api_is_allowed_to_edit(null, true)) {
$actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=addglossary&msg=add?' . api_get_cidreq() . '">' . $actionsLeft .= '<a href="index.php?'.api_get_cidreq().'&action=addglossary&msg=add?'.api_get_cidreq().'">'.
Display::return_icon('new_glossary_term.png', get_lang('TermAddNew'), '', ICON_SIZE_MEDIUM) . '</a>'; Display::return_icon('new_glossary_term.png', get_lang('TermAddNew'), '', ICON_SIZE_MEDIUM).'</a>';
} }
if (api_is_allowed_to_edit(null, true)) { if (api_is_allowed_to_edit(null, true)) {
$actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=import">' . $actionsLeft .= '<a href="index.php?'.api_get_cidreq().'&action=import">'.
Display::return_icon('import.png', get_lang('ImportGlossary'), '', ICON_SIZE_MEDIUM) . '</a>'; Display::return_icon('import.png', get_lang('ImportGlossary'), '', ICON_SIZE_MEDIUM).'</a>';
} }
if (!api_is_anonymous()) { if (!api_is_anonymous()) {
$actionsLeft .= '<a id="export-glossary" href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export" class="btn btn-link btn-export" data-toggle="modal" data-target="#modal-export">' . $actionsLeft .= '<a id="export-glossary" href="'.api_get_self().'?'.api_get_cidreq().'&action=export" class="btn btn-link btn-export" data-toggle="modal" data-target="#modal-export">'.
Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM) . '</a>'; Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>';
} }
if (!api_is_anonymous()) { if (!api_is_anonymous()) {
$actionsLeft .= Display::url( $actionsLeft .= Display::url(
Display::return_icon('export_to_documents.png', get_lang('ExportToDocArea'), [], ICON_SIZE_MEDIUM), Display::return_icon('export_to_documents.png', get_lang('ExportToDocArea'), [], ICON_SIZE_MEDIUM),
api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query(['action' => 'export_documents']) api_get_self().'?'.api_get_cidreq().'&'.http_build_query(['action' => 'export_documents'])
); );
} }
$orderList = isset($_GET['order']) ? Database::escape_string($_GET['order']) : ''; $orderList = isset($_GET['order']) ? Database::escape_string($_GET['order']) : '';
if(empty($orderList)){ if (empty($orderList)) {
$orderList = 'ASC'; $orderList = 'ASC';
} }
if (!api_is_anonymous()) { if (!api_is_anonymous()) {
if($orderList ==='ASC'){ if ($orderList === 'ASC') {
$actionsLeft .= Display::url( $actionsLeft .= Display::url(
Display::return_icon('falling.png', get_lang('Sort Descending'), [], ICON_SIZE_MEDIUM), Display::return_icon('falling.png', get_lang('Sort Descending'), [], ICON_SIZE_MEDIUM),
api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query(['order' => 'DESC']) api_get_self().'?'.api_get_cidreq().'&'.http_build_query(['order' => 'DESC'])
); );
} else { } else {
$actionsLeft .= Display::url( $actionsLeft .= Display::url(
Display::return_icon('upward.png', get_lang('Sort Ascending'), [], ICON_SIZE_MEDIUM), Display::return_icon('upward.png', get_lang('Sort Ascending'), [], ICON_SIZE_MEDIUM),
api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query(['order' => 'ASC']) api_get_self().'?'.api_get_cidreq().'&'.http_build_query(['order' => 'ASC'])
); );
} }
} }
/* BUILD SEARCH FORM */ /* BUILD SEARCH FORM */
$form = new FormValidator( $form = new FormValidator(
'search', 'search',
'get', 'get',
api_get_self() . '?' . api_get_cidreq(), api_get_self().'?'.api_get_cidreq(),
'', '',
[], [],
FormValidator::LAYOUT_INLINE FormValidator::LAYOUT_INLINE
@ -459,7 +458,7 @@ class GlossaryManager
$content = $toolbar; $content = $toolbar;
$list = self::getListGlossary(1000,0,$orderList); $list = self::getListGlossary(1000, 0, $orderList);
$tpl = new Template(null); $tpl = new Template(null);
$tpl->assign('data', $list); $tpl->assign('data', $list);
@ -523,7 +522,8 @@ class GlossaryManager
return $obj->total; return $obj->total;
} }
public static function getListGlossary($numberOfItems, $column, $direction){ public static function getListGlossary($numberOfItems, $column, $direction)
{
$_user = api_get_user_info(); $_user = api_get_user_info();
// Database table definition // Database table definition
@ -592,7 +592,6 @@ class GlossaryManager
} }
return $list; return $list;
} }
/** /**

@ -974,7 +974,6 @@ class Link extends Model
* @param int $session_id * @param int $session_id
* *
* @return array * @return array
*
*/ */
public static function showLinksPerCategory($catid, $courseId, $session_id) public static function showLinksPerCategory($catid, $courseId, $session_id)
{ {
@ -987,11 +986,9 @@ class Link extends Model
$listLink = []; $listLink = [];
if (!empty($links)) { if (!empty($links)) {
$i = 1; $i = 1;
$linksAdded = []; $linksAdded = [];
foreach ($links as $myrow) { foreach ($links as $myrow) {
$linkId = $myrow['id']; $linkId = $myrow['id'];
$linksAdded['id'] = $linkId; $linksAdded['id'] = $linkId;
$categoryId = $myrow['category_id']; $categoryId = $myrow['category_id'];
@ -1667,12 +1664,11 @@ class Link extends Model
} }
echo '</div>'; echo '</div>';
$counter = 0; $counter = 0;
$category = []; $category = [];
$listCategory = []; $listCategory = [];
$list['not_category'] = self::showLinksPerCategory(0, $course_id, $session_id);; $list['not_category'] = self::showLinksPerCategory(0, $course_id, $session_id);
foreach ($categories as $myrow) { foreach ($categories as $myrow) {
// Student don't see invisible categories. // Student don't see invisible categories.

Loading…
Cancel
Save