diff --git a/main/css/base_chamilo.css b/main/css/base_chamilo.css index 0e6171879c..04ace75533 100644 --- a/main/css/base_chamilo.css +++ b/main/css/base_chamilo.css @@ -54,4 +54,8 @@ } div.admin_section { width: 44%; +} + +#Header2Right ul { + width:50%; } \ No newline at end of file diff --git a/main/inc/lib/link.lib.php b/main/inc/lib/link.lib.php index 6b67b7adf5..87a0666dbb 100755 --- a/main/inc/lib/link.lib.php +++ b/main/inc/lib/link.lib.php @@ -540,60 +540,61 @@ function showlinksofcategory($catid) { $sqlLinks = "SELECT * FROM " . $tbl_link . " link, " . $TABLE_ITEM_PROPERTY . " itemproperties WHERE itemproperties.tool='" . TOOL_LINK . "' AND link.id=itemproperties.ref AND link.category_id='" . $catid . "' AND (itemproperties.visibility='0' OR itemproperties.visibility='1') $condition_session ORDER BY link.display_order DESC"; $result = Database :: query($sqlLinks); $numberoflinks = Database :: num_rows($result); - - echo ''; - $i = 1; - while ($myrow = Database :: fetch_array($result)) { - - // Validacion when belongs to a session. - $session_img = api_get_session_image($myrow['session_id'], $_user['status']); - - $css_class = $i % 2 == 0 ? $css_class = 'row_odd' : $css_class = 'row_even'; - - $myrow[3] = text_filter($myrow[3]); - if ($myrow['visibility'] == '1') { - echo ''; - $i++; + if ($numberoflinks > 0) { + echo '
', get_lang('Link'), '', Security :: remove_XSS($myrow[2]), '', $session_img, '
', $myrow[3]; - } else { - if (api_is_allowed_to_edit(null, true)) { - echo '
\n", $session_img, '
', $myrow[3]; - } - } - - echo '
'; - if (api_is_allowed_to_edit(null, true)) { - if ($session_id == $myrow['session_id']) { - - echo '' . Display :: return_icon('edit.png', get_lang('Modify'), array (), 22) . ''; - // DISPLAY MOVE UP COMMAND only if it is not the top link. - if ($i != 1) { - echo '' . Display :: return_icon('up.png', get_lang('Up'), array (), 22) . '', "\n"; - } else { - echo Display :: return_icon('up.png', get_lang('Up'), array (), 22) . ''; - } - - // DISPLAY MOVE DOWN COMMAND only if it is not the bottom link. - if ($i < $numberoflinks) { - echo '' . Display :: return_icon('down.png', get_lang('Down'), array (), 22) . '', "\n"; - } else { - echo Display :: return_icon('down_na.png', get_lang('Down'), array (), 22) . '', "\n"; - } - - if ($myrow['visibility'] == '1') { - echo '' . Display :: return_icon('visible.png', get_lang('Hide'), array (), 22) . ''; - } - if ($myrow['visibility'] == '0') { - echo ' ' . Display :: return_icon('invisible.png', get_lang('Show'), array (), 22) . ''; - } - echo ' ' . Display :: return_icon('delete.png', get_lang('Delete'), array (), 22) . ''; - - } else { - echo get_lang('EditionNotAvailableFromSession'); - } - } - echo '
'; + $i = 1; + while ($myrow = Database :: fetch_array($result)) { + + // Validacion when belongs to a session. + $session_img = api_get_session_image($myrow['session_id'], $_user['status']); + + $css_class = $i % 2 == 0 ? $css_class = 'row_odd' : $css_class = 'row_even'; + + $myrow[3] = text_filter($myrow[3]); + if ($myrow['visibility'] == '1') { + echo ''; + $i++; + } + echo '
', get_lang('Link'), '', Security :: remove_XSS($myrow[2]), '', $session_img, '
', $myrow[3]; + } else { + if (api_is_allowed_to_edit(null, true)) { + echo '
\n", $session_img, '
', $myrow[3]; + } + } + + echo '
'; + if (api_is_allowed_to_edit(null, true)) { + if ($session_id == $myrow['session_id']) { + + echo '' . Display :: return_icon('edit.png', get_lang('Modify'), array (), 22) . ''; + // DISPLAY MOVE UP COMMAND only if it is not the top link. + if ($i != 1) { + echo '' . Display :: return_icon('up.png', get_lang('Up'), array (), 22) . '', "\n"; + } else { + echo Display :: return_icon('up.png', get_lang('Up'), array (), 22) . ''; + } + + // DISPLAY MOVE DOWN COMMAND only if it is not the bottom link. + if ($i < $numberoflinks) { + echo '' . Display :: return_icon('down.png', get_lang('Down'), array (), 22) . '', "\n"; + } else { + echo Display :: return_icon('down_na.png', get_lang('Down'), array (), 22) . '', "\n"; + } + + if ($myrow['visibility'] == '1') { + echo '' . Display :: return_icon('visible.png', get_lang('Hide'), array (), 22) . ''; + } + if ($myrow['visibility'] == '0') { + echo ' ' . Display :: return_icon('invisible.png', get_lang('Show'), array (), 22) . ''; + } + echo ' ' . Display :: return_icon('delete.png', get_lang('Delete'), array (), 22) . ''; + + } else { + echo get_lang('EditionNotAvailableFromSession'); + } + } + echo '
'; } - echo ''; } /** diff --git a/main/link/link.php b/main/link/link.php index 6ebfc3700c..5f5552f2e2 100755 --- a/main/link/link.php +++ b/main/link/link.php @@ -87,7 +87,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'editlink') { } // Database Table definitions -$tbl_link = Database::get_course_table(TABLE_LINK); +$tbl_link = Database::get_course_table(TABLE_LINK); $tbl_categories = Database::get_course_table(TABLE_LINK_CATEGORY); // Statistics @@ -415,12 +415,14 @@ if (empty($_GET['action']) || ($_GET['action'] != 'editlink' && $_GET['action'] $sqlcategories = "SELECT * FROM ".$tbl_categories." $condition_session ORDER BY display_order DESC"; $resultcategories = Database::query($sqlcategories); - echo ''; + // Displaying the links which have no category (thus category = 0 or NULL), if none present this will not be displayed $sqlLinks = "SELECT * FROM ".$tbl_link." WHERE category_id=0 OR category_id IS NULL"; $result = Database::query($sqlLinks); $numberofzerocategory = Database::num_rows($result); - if ($numberofzerocategory !== 0) { + echo '
'; + + if ($numberofzerocategory !== 0) { echo ''; echo '
'.get_lang('General').'
'; showlinksofcategory(0);