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

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

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

@ -5377,8 +5377,8 @@ function getAllAttachment($postId)
/**
* Delete the all the attachments from the DB and the file according to the post's id or attach id(optional).
*
* @param int $post_id
* @param int $id_attach
* @param int $post_id
* @param int $id_attach
*
* @return int
*

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

@ -397,51 +397,50 @@ class GlossaryManager
// action links
$actionsLeft = '';
if (api_is_allowed_to_edit(null, true)) {
$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>';
$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>';
}
if (api_is_allowed_to_edit(null, true)) {
$actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=import">' .
Display::return_icon('import.png', get_lang('ImportGlossary'), '', ICON_SIZE_MEDIUM) . '</a>';
$actionsLeft .= '<a href="index.php?'.api_get_cidreq().'&action=import">'.
Display::return_icon('import.png', get_lang('ImportGlossary'), '', ICON_SIZE_MEDIUM).'</a>';
}
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">' .
Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM) . '</a>';
$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>';
}
if (!api_is_anonymous()) {
$actionsLeft .= Display::url(
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']) : '';
if(empty($orderList)){
if (empty($orderList)) {
$orderList = 'ASC';
}
if (!api_is_anonymous()) {
if($orderList ==='ASC'){
if ($orderList === 'ASC') {
$actionsLeft .= Display::url(
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 {
$actionsLeft .= Display::url(
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 */
$form = new FormValidator(
'search',
'get',
api_get_self() . '?' . api_get_cidreq(),
api_get_self().'?'.api_get_cidreq(),
'',
[],
FormValidator::LAYOUT_INLINE
@ -459,7 +458,7 @@ class GlossaryManager
$content = $toolbar;
$list = self::getListGlossary(1000,0,$orderList);
$list = self::getListGlossary(1000, 0, $orderList);
$tpl = new Template(null);
$tpl->assign('data', $list);
@ -523,7 +522,8 @@ class GlossaryManager
return $obj->total;
}
public static function getListGlossary($numberOfItems, $column, $direction){
public static function getListGlossary($numberOfItems, $column, $direction)
{
$_user = api_get_user_info();
// Database table definition
@ -592,7 +592,6 @@ class GlossaryManager
}
return $list;
}
/**

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

Loading…
Cancel
Save