'; echo ''.get_lang('More').'
'; echo '
'; echo '
- ';
if(api_is_allowed_to_edit() || api_is_platform_admin())
{
//TODO: config area and private stats
}
//Submenu Orphaned pages
echo '
- '.get_lang('OrphanedPages').' '; //Submenu Wanted pages echo '
- '.get_lang('WantedPages').' '; //Submenu Most visited pages echo '
- '.get_lang('MostVisitedPages').' '; //Submenu Most changed pages echo '
- '.get_lang('MostChangedPages').' '; //Submenu Most linked pages //echo '
- '.get_lang('MostLinkedPages').' ';//TODO //Submenu Dead end pages //echo '
- '.get_lang('DeadEndPages').' ';//TODO //Submenu Most new pages (not versions) //echo '
- '.get_lang('MostNewPages').' ';//TODO //Submenu Most long pages //echo '
- '.get_lang('MostLongPages').' ';//TODO //Submenu Protected pages //echo '
- '.get_lang('ProtectedPages').' ';//TODO //Submenu Hidden pages //echo '
- '.get_lang('HiddenPages').' ';//TODO //Submenu Most discuss pages //echo '
- '.get_lang('MostDiscussPages').' ';//TODO //Submenu Best scored pages //echo '
- '.get_lang('BestScoredPages').' ';//TODO //Submenu Pages with more progress //echo '
- '.get_lang('MProgressPages').' ';//TODO //Submenu Most active users echo '
- '.get_lang('MostActiveUsers').' '; //Submenu Most active users in discuss //echo '
- '.get_lang('MostDiscussUsers').' ';//TODO //Submenu Individual assignments //echo '
- '.get_lang('Assignments').' ';//TODO //Submenu Delayed assignments //echo '
- '.get_lang('DelayedAssignments').' ';//TODO //Submenu Random page //echo '
- '.get_lang('RandomPage').' ';//TODO echo '
'; echo ''.get_lang('MostActiveUsers').'
'; echo '
'; $sql='SELECT *, COUNT(*) AS NEDIT FROM '.$tbl_wiki.' WHERE '.$groupfilter.' GROUP BY user_id ORDER BY NEDIT DESC LIMIT 10'; //first ten users with more versions $allpages=api_sql_query($sql,__FILE__,__LINE__); echo '
- ';
while ($row=Database::fetch_array($allpages))
{
$userinfo=Database::get_user_info_from_id($row['user_id']);
echo '
- '.$userinfo['lastname'].', '.$userinfo['firstname'].' -> '.$row['NEDIT'].' '.get_lang('Contributions').' '; } echo '
'; echo ''.get_lang('UserContributions').': '.$userinfo['lastname'].', '.$userinfo['firstname'].'
'; echo '
'; if(api_is_allowed_to_edit() || api_is_platform_admin()) //only by professors if page is hidden { $sql='SELECT * FROM '.$tbl_wiki.' WHERE '.$groupfilter.' AND user_id="'.$_GET['user_id'].'" ORDER BY reflink,version ASC'; } else { $sql='SELECT * FROM '.$tbl_wiki.' WHERE '.$groupfilter.' AND user_id="'.$_GET['user_id'].'" AND visibility=1 ORDER BY reflink,version ASC'; } $allpages=api_sql_query($sql,__FILE__,__LINE__); echo '
- ';
while ($row=Database::fetch_array($allpages))
{
//fix assignment icon
if($row['assignment']==1)
{
$ShowAssignment='
- '.$day.' '.$MonthsLong[$month-1].' '.$year.' '.$hours.":".$minutes.":".$seconds.' ... '.$ShowAssignment.''.$row['title'].' ('.get_lang('Version').' '.$row['version'].') ... '.get_lang('Progress').': '.$row['progress'].'%'.$showcomment.' '; } echo '
';
}
elseif ($row['assignment']==2)
{
$ShowAssignment='
';
}
elseif ($row['assignment']==0)
{
$ShowAssignment='
';
}
//fix time
$year = substr($row['timestamp'], 0, 4);
$month = substr($row['timestamp'], 5, 2);
$day = substr($row['timestamp'], 8, 2);
$hours=substr($row['timestamp'], 11,2);
$minutes=substr($row['timestamp'], 14,2);
$seconds=substr($row['timestamp'], 17,2);
//fix comment
$comment=$row['comment'];
if (!empty($comment))
{
$showcomment= ' ... '.get_lang('Comments').': ';
}
else
{
$showcomment= ' ... '. get_lang('Comments').': ';
}
echo ''; echo ''.get_lang('MostChangesPages').'
'; echo '
'; if(api_is_allowed_to_edit() || api_is_platform_admin()) //only by professors if page is hidden { $sql='SELECT *, MAX(version) AS MAX FROM '.$tbl_wiki.' WHERE '.$groupfilter.' GROUP BY reflink ORDER BY MAX DESC, reflink LIMIT 10'; //first ten users } else { $sql='SELECT *, MAX(version) AS MAX FROM '.$tbl_wiki.' WHERE '.$groupfilter.' AND visibility=1 GROUP BY reflink ORDER BY MAX DESC, reflink LIMIT 10';//first ten users } $allpages=api_sql_query($sql,__FILE__,__LINE__); echo '
- ';
while ($row=Database::fetch_array($allpages))
{
//fix assignment icon
if($row['assignment']==1)
{
$ShowAssignment='
- '.$ShowAssignment.''.$row['title'].' '.get_lang('With').' '.$row['MAX'].' '.get_lang('Changes').' '; //TODO:check if hidden and assignment mode } echo '
';
}
elseif ($row['assignment']==2)
{
$ShowAssignment='
';
}
elseif ($row['assignment']==0)
{
$ShowAssignment='
';
}
echo ''; echo ''.get_lang('MostVisitedPages').'
'; echo '
'; if(api_is_allowed_to_edit() || api_is_platform_admin()) //only by professors if page is hidden { $sql='SELECT *, SUM(hits) AS tsum FROM '.$tbl_wiki.' WHERE '.$groupfilter.' GROUP BY reflink'; // warning GROUP BY reflink don't return the last version, always the first id } else { $sql='SELECT *, SUM(hits) AS tsum FROM '.$tbl_wiki.' WHERE '.$groupfilter.' AND visibility=1 GROUP BY reflink'; // warning GROUP BY reflink don't return the last version, always the first id } $allpages=api_sql_query($sql,__FILE__,__LINE__); //show table if (mysql_num_rows($allpages) > 0) { $row = array (); while ($obj = mysql_fetch_object($allpages)) { //get type assignment icon if($obj->assignment==1) { $ShowAssignment='
';
}
elseif ($obj->assignment==2)
{
$ShowAssignment='
';
}
elseif ($obj->assignment==0)
{
$ShowAssignment='
';
}
$row = array ();
$row[] =$ShowAssignment;
$row[] = ''.$obj->title.'';
$row[] = $obj->tsum;
$rows[] = $row;
}
$table = new SortableTableFromArrayConfig($rows,2,10,'MostVisitedPages_table','','','DESC');
$table->set_additional_parameters(array('cidReq' =>$_GET['cidReq'],'action'=>$_GET['action'],'group_id'=>Security::remove_XSS($_GET['group_id'])));
$table->set_header(0,get_lang('Type'), true, array ('style' => 'width:30px;'));
$table->set_header(1,get_lang('Title'), true);
$table->set_header(2,get_lang('Visits'), true);
$table->display();
}
}
/////////////////////// Wanted pages /////////////////////// Juan Carlos Raña Trabado
if ($_GET['action']=='wanted')
{
echo ''; echo ''.get_lang('WantedPages').'
'; echo '
'; $pages = array(); $refs = array(); $orphaned = array(); $sort_wanted=array(); //get name pages $sql='SELECT * FROM '.$tbl_wiki.' WHERE '.$groupfilter.' GROUP BY reflink ORDER BY reflink ASC'; $allpages=api_sql_query($sql,__FILE__,__LINE__); while ($row=Database::fetch_array($allpages)) { $pages[] = $row['reflink']; } //get name refs in last pages and make a unique list $sql='SELECT * FROM '.$tbl_wiki.' s1 WHERE '.$groupfilter.' AND id=(SELECT MAX(s2.id) FROM '.$tbl_wiki.' s2 WHERE s1.reflink = s2.reflink)'; $allpages=api_sql_query($sql,__FILE__,__LINE__); while ($row=Database::fetch_array($allpages)) { //$row['linksto']= str_replace("\n".$row["reflink"]."\n", "\n", $row["linksto"]); //remove self reference. TODO check $rf = explode(" ", trim($row["linksto"]));//wanted pages without /n only blank " " $refs = array_merge($refs, $rf); if ($n++ > 299) { $refs = array_unique($refs); $n=0; } // (clean-up only every 300th loop). Thanks to Erfurt Wiki } //sort linksto. Find linksto into reflink. If not found ->page is wanted natcasesort($refs); echo '
- ';
foreach($refs as $v)
{
if(!in_array($v, $pages))
{
if (trim($v)!=="")
{
echo '
- '.str_replace('_',' ',$v).' '; } } } echo '
'; echo ''.get_lang('OrphanedPages').'
'; echo '
'; $pages = array(); $refs = array(); $orphaned = array(); $sort_orphaned=array(); //get name pages $sql='SELECT * FROM '.$tbl_wiki.' WHERE '.$groupfilter.' GROUP BY reflink ORDER BY reflink ASC'; $allpages=api_sql_query($sql,__FILE__,__LINE__); while ($row=Database::fetch_array($allpages)) { $pages[] = $row['reflink']; } //get name refs in last pages and make a unique list $sql='SELECT * FROM '.$tbl_wiki.' s1 WHERE '.$groupfilter.' AND id=(SELECT MAX(s2.id) FROM '.$tbl_wiki.' s2 WHERE s1.reflink = s2.reflink)'; $allpages=api_sql_query($sql,__FILE__,__LINE__); while ($row=Database::fetch_array($allpages)) { //$row['linksto']= str_replace("\n".$row["reflink"]."\n", "\n", $row["linksto"]); //remove self reference. TODO check $rf = explode(" ", trim($row["linksto"])); //TODO: check fix replace explode("\n", trim($row["linksto"])) with explode(" ", trim($row["linksto"])) $refs = array_merge($refs, $rf); if ($n++ > 299) { $refs = array_unique($refs); $n=0; } // (clean-up only every 300th loop). Thanks to Erfurt Wiki } //search each name of list linksto into list reflink foreach($pages as $v) { if(!in_array($v, $refs)) { $orphaned[] = $v; } } //change reflink by title foreach($orphaned as $vshow) { if(api_is_allowed_to_edit() || api_is_platform_admin()) //only by professors if page is hidden { $sql='SELECT * FROM '.$tbl_wiki.' WHERE '.$groupfilter.' AND reflink="'.$vshow.'" GROUP BY reflink'; } else { $sql='SELECT * FROM '.$tbl_wiki.' WHERE '.$groupfilter.' AND reflink="'.$vshow.'" AND visibility=1 GROUP BY reflink'; } $allpages=api_sql_query($sql,__FILE__,__LINE__); echo '
- ';
while ($row=Database::fetch_array($allpages))
{
//$sort_orphaned[]=$row['title']; //TODO: check to delete this line
//fix assignment icon
if($row['assignment']==1)
{
$ShowAssignment='
- '.$ShowAssignment.''.$row['title'].' '; } echo '
';
}
elseif ($row['assignment']==2)
{
$ShowAssignment='
';
}
elseif ($row['assignment']==0)
{
$ShowAssignment='
';
}
echo ''; //TODO: link to page //TODO: check to delete this line //}//TODO: check to delete this line } /////////////////////// delete current page /////////////////////// Juan Carlos Raña Trabado if ($_GET['action']=='delete') { if(api_is_allowed_to_edit() || api_is_platform_admin()) { echo '
'; echo ''.get_lang('DeletePageHistory').''; echo '
'; $message = get_lang('ConfirmDeletePage').""."
"."".get_lang("No").""." | "."".get_lang("Yes").""."
"; if (!isset ($_GET['delete'])) { Display::display_warning_message($message,false); } if ($_GET['delete'] == 'yes') { $sql='DELETE FROM '.$tbl_wiki.' WHERE reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$groupfilter.' ORDER BY id DESC'; api_sql_query($sql,__FILE__,__LINE__); //// //here TODO: delete discussion and mailcue too /// check_emailcue(0, 'E'); Display::display_confirmation_message(get_lang('WikiPageDeleted')); } } else { Display::display_normal_message(get_lang("OnlyAdminDeletePageWiki")); } } /////////////////////// delete all wiki /////////////////////// Juan Carlos Raña Trabado if ($_GET['action']=='deletewiki') { echo ''; echo ''.get_lang('DeleteWiki').''; echo '
'; } /////////////////////// search pages /////////////////////// Juan Carlos Raña Trabado //// 1 Searchpages: input search if ($_GET['action']=='searchpages') { echo '
'; echo ''.$SearchPages.''; echo '
'; if (!$_POST['Skeyword']) { echo ''; } } //// 2 SearchPages: find and show pages if ($_GET['action']=='showsearchpages') { echo '
'; echo ''.$Search.': '.$_POST['Skeyword']; //TODO: post is lost when a table has some pages echo '
'; $_clean['group_id']=(int)$_SESSION['_gid']; if(api_is_allowed_to_edit() || api_is_platform_admin()) //only by professors if page is hidden { if($_POST['Scontent']=="1") { $sql="SELECT * FROM ".$tbl_wiki." s1 WHERE ".$groupfilter." AND title LIKE '%".$_POST['Skeyword']."%' OR content LIKE '%".$_POST['Skeyword']."%' AND id=(SELECT MAX(s2.id) FROM ".$tbl_wiki." s2 WHERE s1.reflink = s2.reflink)";// warning don't use group by reflink because don't return the last version } else { $sql="SELECT * FROM ".$tbl_wiki." s1 WHERE ".$groupfilter." AND title LIKE '%".$_POST['Skeyword']."%' AND id=(SELECT MAX(s2.id) FROM ".$tbl_wiki." s2 WHERE s1.reflink = s2.reflink)";// warning don't use group by reflink because don't return the last version } } else { if($_POST['Scontent']=="1") { $sql="SELECT * FROM ".$tbl_wiki." s1 WHERE ".$groupfilter." AND visibility=1 AND title LIKE '%".$_POST['Skeyword']."%' OR content LIKE '%".$_POST['Skeyword']."%' AND id=(SELECT MAX(s2.id) FROM ".$tbl_wiki." s2 WHERE s1.reflink = s2.reflink)";// warning don't use group by reflink because don't return the last version } else { $sql="SELECT * FROM ".$tbl_wiki." s1 WHERE ".$groupfilter." AND visibility=1 AND title LIKE '%".$_POST['Skeyword']."%' AND id=(SELECT MAX(s2.id) FROM ".$tbl_wiki." s2 WHERE s1.reflink = s2.reflink)";// warning don't use group by reflink because don't return the last version } } $result=api_sql_query($sql,__LINE__,__FILE__); //show table if (mysql_num_rows($result) > 0) { $row = array (); while ($obj = mysql_fetch_object($result)) { //get author $userinfo=Database::get_user_info_from_id($obj->user_id); //get time $year = substr($obj->timestamp, 0, 4); $month = substr($obj->timestamp, 5, 2); $day = substr($obj->timestamp, 8, 2); $hours = substr($obj->timestamp, 11,2); $minutes = substr($obj->timestamp, 14,2); $seconds = substr($obj->timestamp, 17,2); //get type assignment icon if($obj->assignment==1) { $ShowAssignment='
';
}
elseif ($obj->assignment==2)
{
$ShowAssignment='
';
}
elseif ($obj->assignment==0)
{
$ShowAssignment='
';
}
$row = array ();
$row[] =$ShowAssignment;
$row[] = ''.$obj->title.'';
$row[] = $obj->user_id <>0 ? ''.$userinfo['lastname'].', '.$userinfo['firstname'].'' : get_lang('Anonymous').' ('.$obj->user_ip.')';
$row[] = $day.' '.$MonthsLong[$month-1].' '.$year.' '.$hours.":".$minutes.":".$seconds;
$rows[] = $row;
}
$table = new SortableTableFromArrayConfig($rows,1,10,'SearchPages_table','','','ASC');
$table->set_additional_parameters(array('cidReq' =>$_GET['cidReq'],'action'=>$_GET['action'],'group_id'=>Security::remove_XSS($_GET['group_id'])));
$table->set_header(0,get_lang('Type'), true, array ('style' => 'width:30px;'));
$table->set_header(1,get_lang('Title'), true);
$table->set_header(2,get_lang('Author'), true);
$table->set_header(3,get_lang('Date'), true);
$table->display();
}
}
/////////////////////// What links here. Show pages that have linked this page /////////////////////// Juan Carlos Raña Trabado
if ($_GET['action']=='links')
{
echo ''; echo ''.$LinksPages.''; echo '
'; if (!$_GET['title']) { Display::display_normal_message(get_lang("MustSelectPage")); } else { $sql='SELECT * FROM '.$tbl_wiki.' WHERE reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$groupfilter.''; $result=api_sql_query($sql,__FILE__,__LINE__); //necessary for pages with compound name. TODO: check if necessay after have fixed wanted pages with _ $row=Database::fetch_array($result); echo $LinksPagesFrom.': '.$row['title'].''; if ($page==get_lang('DefaultTitle')) { $page='index'; } $sql="SELECT * FROM ".$tbl_wiki." WHERE ".$groupfilter." AND linksto LIKE '%".html_entity_decode(Database::escape_string(stripslashes(urldecode($page))))." %' GROUP BY reflink ORDER BY title ASC"; //add blank space after like '%" " %' to identify each word $result=api_sql_query($sql,__LINE__,__FILE__); //show result echo '
- ';
while ($row=Database::fetch_array($result))
{
$userinfo=Database::get_user_info_from_id($row['user_id']);
//Show page to students if not is hidden, but the author can see. Show page to all teachers if is hidden. Mode assignments: show pages to student only if student is the author
if($row['visibility']==1 || api_is_allowed_to_edit() || api_is_platform_admin() || ($row['assignment']==2 && $row['visibility']==0 && (api_get_user_id()==$row['user_id'])))
{
$year = substr($row['timestamp'], 0, 4);
$month = substr($row['timestamp'], 5, 2);
$day = substr($row['timestamp'], 8, 2);
$hours=substr($row['timestamp'], 11,2);
$minutes=substr($row['timestamp'], 14,2);
$seconds=substr($row['timestamp'], 17,2);
//Description assignments visible for all teachers
if($row['assignment']==1)
{
if(api_is_allowed_to_edit() || api_is_platform_admin())
{
$ShowAssignment='
- '; echo ''.$ShowAssignment.$row['title'].''; echo '...'.$userinfo['lastname'].', '.$userinfo['firstname']; echo '...'.$day.' '.$MonthsLong[$month-1].' '.$year.' '.$hours.":".$minutes.":".$seconds.' '; } } //Work on the assignments visible for each student if ($row['assignment']==2) { if ($row['user_id']==(int)api_get_user_id() || api_is_allowed_to_edit() || api_is_platform_admin()) { $ShowAssignment='
- '; echo ''.$ShowAssignment.$row['title'].''; echo '...'.$userinfo['lastname'].', '.$userinfo['firstname']; echo '...'.$day.' '.$MonthsLong[$month-1].' '.$year.' '.$hours.":".$minutes.":".$seconds.' '; } } //show wiki pages standard if ($row['assignment']==0) { $ShowAssignment='
- '; echo ''.$ShowAssignment.$row['title'].''; if ($row['user_id']<>0) { echo '...'.$userinfo['lastname'].', '.$userinfo['firstname']; } else { echo get_lang('Anonymous').' ('.$row[user_ip].')'; } echo '...'.$day.' '.$MonthsLong[$month-1].' '.$year.' '.$hours.":".$minutes.":".$seconds.' '; } } } echo '
';
echo '
';
echo '
';
echo ''; echo ''.get_lang('AddNew').''; echo '
'; display_new_wiki_form(); } else { Display::display_normal_message(get_lang('OnlyAddPagesGroupMembers')); } } else { echo '
'; echo ''.get_lang('AddNew').''; echo '
'; display_new_wiki_form(); } } } /////////////////////// show home page /////////////////////// if (!$_GET['action'] OR $_GET['action']=='show' AND !$_POST['SaveWikiNew']) { display_wiki_entry(); } /////////////////////// show current page /////////////////////// if ($_GET['action']=='showpage' AND !$_POST['SaveWikiNew']) { display_wiki_entry(); } /////////////////////// edit current page /////////////////////// if ($_GET['action']=='edit') { $_clean['group_id']=(int)$_SESSION['_gid']; $sql='SELECT * FROM '.$tbl_wiki.'WHERE reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$groupfilter.' ORDER BY id DESC'; $result=api_sql_query($sql,__LINE__,__FILE__); $row=Database::fetch_array($result); // we do not need a while loop since we are always displaying the last version //Only teachers and platform admin can edit the index page. Only teachers and platform admin can edit an assignment teacher if(($row['reflink']=='index' || $row['reflink']=='' || $row['assignment']==1) && (!api_is_allowed_to_edit())) { Display::display_normal_message(get_lang('OnlyEditPagesCourseManager')); } else { $PassEdit=false; //check if is a wiki group if($_clean['group_id']!==0) { //Only teacher, platform admin and group members can edit a wiki group if(api_is_allowed_to_edit() || api_is_platform_admin() || GroupManager :: is_user_in_group($_user['user_id'],$_SESSION['_gid'])) { $PassEdit=true; } else { Display::display_normal_message(get_lang('OnlyEditPagesGroupMembers')); } } else { $PassEdit=true; } // check if is a assignment if(stripslashes($row['assignment'])==1) { Display::display_normal_message(get_lang('EditAssignmentWarning')); $icon_assignment='
';
}
elseif(stripslashes($row['assignment'])==2)
{
$icon_assignment='
';
if((api_get_user_id()==$row['user_id'])==false)
{
if(api_is_allowed_to_edit() || api_is_platform_admin())
{
$PassEdit=true;
}
else
{
Display::display_warning_message(get_lang('LockByTeacher'));
$PassEdit=false;
}
}
else
{
$PassEdit=true;
}
}
if($PassEdit) //show editor if edit is allowed
{
if (check_protect_page() && (api_is_allowed_to_edit()==false || api_is_platform_admin()==false))
{
Display::display_normal_message(get_lang('PageLockedExtra'));
}
else
{
if ($row['content']=='' AND $row['title']=='' AND $page='index')
{
$content=sprintf(get_lang('DefaultContent'),api_get_path(WEB_IMG_PATH));
$title=get_lang('DefaultTitle');
}
else
{
$content=$row['content'];
$title=$row['title'];
}
echo '
';
}
elseif($KeyAssignment==2)
{
$icon_assignment='
';
}
//Second, show
//if the page is hidden and is a job only sees its author and professor
if($KeyVisibility==1 || api_is_allowed_to_edit() || api_is_platform_admin() || ($KeyAssignment==2 && $KeyVisibility==0 && (api_get_user_id()==$KeyUserId)))
{
// We show the complete history
if (!$_POST['HistoryDifferences'] && !$_POST['HistoryDifferences2'] )
{
$sql='SELECT * FROM '.$tbl_wiki.'WHERE reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$groupfilter.' ORDER BY id DESC';
$result=api_sql_query($sql,__LINE__,__FILE__);
$title=Security::remove_XSS($_GET['title']);
$group_id=Security::remove_XSS($_GET['group_id']);
echo ''; if($_POST['HistoryDifferences']) { echo '
'.get_lang('HomeWiki').'





'.get_lang('Page').'
'.get_lang('EditPage').'
'.get_lang('Discuss').'
'.get_lang('History').'
'.$LinksPages.'
'.get_lang('Delete').'
'.get_lang('NotNotifyChanges').'';
}
else
{
$notify_all= '
'.get_lang('NotifyChanges').'';
}
echo '
'.get_lang('ShowDiscuss').'';
}
}
else
{
if(api_is_allowed_to_edit() || api_is_platform_admin())
{
$visibility_disc= '
'.get_lang('HideDiscuss').'';
}
}
//check add messages lock.
if (check_addlock_discuss())
{
if(api_is_allowed_to_edit() || api_is_platform_admin())
{
$addlock_disc= '
'.get_lang('UnlockDiscuss').'';
}
else
{
$addlock_disc= '
'.get_lang('LockDiscuss').'';
}
}
//check add rating lock. Show/Hide list to rating for all student
if (check_ratinglock_discuss())
{
//Mode assignment: only the teacher can assign scoring
if(($row['assignment']==2 && $row['ratinglock_disc']==0 && (api_get_user_id()==$row['user_id']))==false)
{
$ratinglock_disc= '
'.get_lang('UnlockRatingDiscuss').'';
}
}
else
{
if(api_is_allowed_to_edit() || api_is_platform_admin())
{
$ratinglock_disc= '
'.get_lang('LockRatingDiscuss').'';
}
}
//check notify by email
if (check_notify_discuss($page))
{
$notify_disc= '
';
break;
case 1:
$imagerating='
';
break;
case 2:
$imagerating='
';
break;
case 3:
$imagerating='
';
break;
case 4:
$imagerating='
';
break;
case 5:
$imagerating='
';
break;
case 6:
$imagerating='
';
break;
case 7:
$imagerating='
';
break;
case 8:
$imagerating='
';
break;
case 9:
$imagerating='
';
break;
case 10:
$imagerating='
';
break;
}
echo '
'.get_lang('ShowAddOption').'';
}
}
else
{
if(api_is_allowed_to_edit() || api_is_platform_admin())
{
$protect_addnewpage= '
'.get_lang('HideAddOption').'';
}
}
//Button lock page
if (check_protect_page())
{
if(api_is_allowed_to_edit() || api_is_platform_admin())
{
$protect_page= '
';
echo '';
//export to zip
echo '