Drh can see wiki see #7064

1.9.x
Julio Montoya 11 years ago
parent 0a64437eed
commit e316005a56
  1. 8
      main/wiki/index.php
  2. 24
      main/wiki/wiki.inc.php

@ -6,9 +6,7 @@
* *
* @package chamilo.wiki * @package chamilo.wiki
*/ */
/**
* Code
*/
use \ChamiloSession as Session; use \ChamiloSession as Session;
// name of the language file that needs to be included // name of the language file that needs to be included
@ -86,7 +84,9 @@ if ($groupId) {
if ($group_properties['wiki_state'] == 0) { if ($group_properties['wiki_state'] == 0) {
api_not_allowed(); api_not_allowed();
} elseif ($group_properties['wiki_state']==2) { } elseif ($group_properties['wiki_state']==2) {
if (!api_is_allowed_to_edit(false,true) and !GroupManager :: is_user_in_group(api_get_user_id(), api_get_group_id())) { if (!api_is_allowed_to_edit(false,true) and
!GroupManager :: is_user_in_group(api_get_user_id(), api_get_group_id())
) {
api_not_allowed(); api_not_allowed();
} }
} }

@ -4314,14 +4314,15 @@ class Wiki
// menu home // menu home
echo '<ul class="dropdown-menu">'; echo '<ul class="dropdown-menu">';
echo '<li><a href="index.php?action=showpage&title=index&cidReq='.$_course['id'].'&session_id='.$session_id.'&group_id='.$groupId.'">'.get_lang('Home').'</a></li>'; echo '<li><a href="index.php?action=showpage&title=index&cidReq='.$_course['id'].'&session_id='.$session_id.'&group_id='.$groupId.'">'.get_lang('Home').'</a></li>';
if (api_is_allowed_to_session_edit(false,true)) { if (api_is_allowed_to_session_edit(false, true) && api_is_allowed_to_edit()) {
//menu add page // menu add page
echo '<li><a href="index.php?cidReq='.$_course['id'].'&action=addnew&session_id='.$session_id.'&group_id='.$groupId.'"'.self::is_active_navigation_tab('addnew').'>'.get_lang('AddNew').'</a>'; echo '<li><a href="index.php?cidReq=' . $_course['id'] . '&action=addnew&session_id=' . $session_id . '&group_id=' . $groupId . '"' . self::is_active_navigation_tab('addnew').'>' . get_lang('AddNew') . '</a>';
} }
$lock_unlock_addnew = null; $lock_unlock_addnew = null;
$protect_addnewpage = null; $protect_addnewpage = null;
if (api_is_allowed_to_edit(false,true) || api_is_platform_admin()) { if (api_is_allowed_to_edit(false, true) || api_is_platform_admin()) {
// page action: enable or disable the adding of new pages // page action: enable or disable the adding of new pages
if (self::check_addnewpagelock()==0) { if (self::check_addnewpagelock()==0) {
$protect_addnewpage = Display::return_icon('off.png', get_lang('AddOptionProtected')); $protect_addnewpage = Display::return_icon('off.png', get_lang('AddOptionProtected'));
@ -4340,7 +4341,7 @@ class Wiki
// menu recent changes // menu recent changes
echo '<li><a href="index.php?cidReq='.$_course['id'].'&action=recentchanges&session_id='.$session_id.'&group_id='.$groupId.'"'.self::is_active_navigation_tab('recentchanges').'>'.get_lang('RecentChanges').'</a></li>'; echo '<li><a href="index.php?cidReq='.$_course['id'].'&action=recentchanges&session_id='.$session_id.'&group_id='.$groupId.'"'.self::is_active_navigation_tab('recentchanges').'>'.get_lang('RecentChanges').'</a></li>';
// menu delete all wiki // menu delete all wiki
if (api_is_allowed_to_edit(false,true) || api_is_platform_admin()) { if (api_is_allowed_to_edit(false, true) || api_is_platform_admin()) {
echo '<li><a href="index.php?action=deletewiki&amp;title='.api_htmlentities(urlencode($page)).'"'.self::is_active_navigation_tab('deletewiki').'>'.get_lang('DeleteWiki').'</a></li>'; echo '<li><a href="index.php?action=deletewiki&amp;title='.api_htmlentities(urlencode($page)).'"'.self::is_active_navigation_tab('deletewiki').'>'.get_lang('DeleteWiki').'</a></li>';
} }
///menu more ///menu more
@ -4352,11 +4353,16 @@ class Wiki
echo '<a href="index.php?cidReq='.$_course['id'].'&action=showpage&amp;title='.api_htmlentities(urlencode($page)).'&session_id='.$session_id.'&group_id='.$groupId.'"'.self::is_active_navigation_tab('showpage').'>'. echo '<a href="index.php?cidReq='.$_course['id'].'&action=showpage&amp;title='.api_htmlentities(urlencode($page)).'&session_id='.$session_id.'&group_id='.$groupId.'"'.self::is_active_navigation_tab('showpage').'>'.
Display::return_icon('page.png',get_lang('ShowThisPage'),'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('page.png',get_lang('ShowThisPage'),'',ICON_SIZE_MEDIUM).'</a>';
if (api_is_allowed_to_session_edit(false,true) ) { if (api_is_allowed_to_session_edit(false, true) && api_is_allowed_to_edit()) {
//menu edit page // menu edit page
echo '<a href="index.php?cidReq='.$_course['id'].'&action=edit&amp;title='.api_htmlentities(urlencode($page)).'&session_id='.$session_id.'&group_id='.$groupId.'"'.self::is_active_navigation_tab('edit').'>'.
Display::return_icon('edit.png',get_lang('EditThisPage'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="index.php?cidReq=' . $_course['id'] . '&action=edit&amp;title=' . api_htmlentities(urlencode($page)) . '&session_id=' . $session_id . '&group_id=' . $groupId . '"' . self::is_active_navigation_tab('edit') . '>' .
Display::return_icon(
'edit.png',
get_lang('EditThisPage'),
'',
ICON_SIZE_MEDIUM
) . '</a>';
//menu discuss page //menu discuss page
echo '<a href="index.php?action=discuss&amp;title='.api_htmlentities(urlencode($page)).'"'.self::is_active_navigation_tab('discuss').'>'. echo '<a href="index.php?action=discuss&amp;title='.api_htmlentities(urlencode($page)).'"'.self::is_active_navigation_tab('discuss').'>'.
Display::return_icon('discuss.png',get_lang('DiscussThisPage'),'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('discuss.png',get_lang('DiscussThisPage'),'',ICON_SIZE_MEDIUM).'</a>';

Loading…
Cancel
Save