';
-
+ $table = new SortableTableFromArrayConfig($rows,1,10,'MostActiveUsersA_table','','','DESC');
+ $table->set_additional_parameters(array('cidReq' =>Security::remove_XSS($_GET['cidReq']),'action'=>Security::remove_XSS($_GET['action']),'group_id'=>Security::remove_XSS($_GET['group_id'])));
+ $table->set_header(0,get_lang('Author'), true, array ('style' => 'width:30px;'));
+ $table->set_header(1,get_lang('Contributions'), true);
+ $table->display();
+ }
}
+
/////////////////////// User contributions /////////////////////// Juan Carlos Raña Trabado
if ($_GET['action']=='usercontrib')
{
- $userinfo=Database::get_user_info_from_id($_GET['user_id']);
+ $userinfo=Database::get_user_info_from_id(Security::remove_XSS($_GET['user_id']));
echo ' ';
- echo ''.get_lang('UserContributions').': '.$userinfo['lastname'].', '.$userinfo['firstname'].' ';
+ 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';
+ $sql='SELECT * FROM '.$tbl_wiki.' WHERE '.$groupfilter.' AND user_id="'.Security::remove_XSS($_GET['user_id']).'"';
}
else
{
- $sql='SELECT * FROM '.$tbl_wiki.' WHERE '.$groupfilter.' AND user_id="'.$_GET['user_id'].'" AND visibility=1 ORDER BY reflink,version ASC';
+ $sql='SELECT * FROM '.$tbl_wiki.' WHERE '.$groupfilter.' AND user_id="'.Security::remove_XSS($_GET['user_id']).'" AND visibility=1';
}
$allpages=api_sql_query($sql,__FILE__,__LINE__);
-
- echo '
';
-
+ $table->set_header(0,get_lang('Date'), true, array ('style' => 'width:175px;'));
+ $table->set_header(1,get_lang('Type'), true, array ('style' => 'width:30px;'));
+ $table->set_header(2,get_lang('Title'), true, array ('style' => 'width:200px;'));
+ $table->set_header(3,get_lang('Version'), true, array ('style' => 'width:30px;'));
+ $table->set_header(4,get_lang('Comment'), true, array ('style' => 'width:200px;'));
+ $table->set_header(5,get_lang('Progress'), true, array ('style' => 'width:30px;'));
+ $table->set_header(6,get_lang('Rating'), true, array ('style' => 'width:30px;'));
+ //if(api_is_allowed_to_edit() || api_is_platform_admin())
+ //{
+ //$table->set_header(7,get_lang('IP'), true, array ('style' => 'width:30px;'));
+ //}
+
+ $table->display();
+ }
}
/////////////////////// Most changed pages /////////////////////// Juan Carlos Raña Trabado
@@ -505,35 +551,50 @@ if ($_GET['action']=='mostchanged')
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
+ $sql='SELECT *, MAX(version) AS MAX FROM '.$tbl_wiki.' WHERE '.$groupfilter.' GROUP BY reflink';
}
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
+ $sql='SELECT *, MAX(version) AS MAX FROM '.$tbl_wiki.' WHERE '.$groupfilter.' AND visibility=1 GROUP BY reflink';
}
- $allpages=api_sql_query($sql,__FILE__,__LINE__);
- echo '
'; //TODO:check if hidden and assignment mode
- }
- echo '
';
+ $table = new SortableTableFromArrayConfig($rows,2,10,'MostChangedPages_table','','','DESC');
+ $table->set_additional_parameters(array('cidReq' =>Security::remove_XSS($_GET['cidReq']),'action'=>Security::remove_XSS($_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('Changes'), true);
+ $table->display();
+ }
+
}
/////////////////////// Most visited pages /////////////////////// Juan Carlos Raña Trabado
@@ -546,11 +607,11 @@ if ($_GET['action']=='mvisited')
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
+ $sql='SELECT *, SUM(hits) AS tsum FROM '.$tbl_wiki.' WHERE '.$groupfilter.' GROUP BY reflink';
}
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
+ $sql='SELECT *, SUM(hits) AS tsum FROM '.$tbl_wiki.' WHERE '.$groupfilter.' AND visibility=1 GROUP BY reflink';
}
$allpages=api_sql_query($sql,__FILE__,__LINE__);
@@ -583,7 +644,7 @@ if ($_GET['action']=='mvisited')
}
$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_additional_parameters(array('cidReq' =>Security::remove_XSS($_GET['cidReq']),'action'=>Security::remove_XSS($_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);
@@ -599,8 +660,7 @@ if ($_GET['action']=='wanted')
echo ''.get_lang('WantedPages').' ';
echo '';
$pages = array();
- $refs = array();
- $orphaned = array();
+ $refs = array();
$sort_wanted=array();
//get name pages
@@ -635,8 +695,8 @@ if ($_GET['action']=='wanted')
if(!in_array($v, $pages))
{
if (trim($v)!=="")
- {
- echo '
';
}
}
}
@@ -654,7 +714,6 @@ if ($_GET['action']=='orphaned')
$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';
@@ -670,7 +729,7 @@ if ($_GET['action']=='orphaned')
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"]))
+ $rf = explode(" ", trim($row["linksto"])); //fix replace explode("\n", trim($row["linksto"])) with explode(" ", trim($row["linksto"]))
$refs = array_merge($refs, $rf);
if ($n++ > 299)
@@ -706,8 +765,6 @@ if ($_GET['action']=='orphaned')
echo '
';
while ($row=Database::fetch_array($allpages))
{
- //$sort_orphaned[]=$row['title']; //TODO: check to delete this line
-
//fix assignment icon
if($row['assignment']==1)
{
@@ -727,13 +784,6 @@ if ($_GET['action']=='orphaned')
echo '
';
}
- //sort titles //TODO: check to delete this line
- //natcasesort($sort_orphaned);//TODO: check to delete this line
- //foreach($sort_orphaned as $vshow_so)//TODO: check to delete this line
- //{
- //echo $vshow_so.' '; //TODO: link to page //TODO: check to delete this line
- //}//TODO: check to delete this line
-
}
/////////////////////// delete current page /////////////////////// Juan Carlos Raña Trabado
@@ -745,7 +795,13 @@ if ($_GET['action']=='delete')
{
echo ' ';
echo ''.get_lang('DeletePageHistory').'';
- echo '';
+ echo '';
+
+ if($page=="index")
+ {
+ Display::display_warning_message(get_lang('WarningDeleteMainPage'),false);
+ }
+
$message = get_lang('ConfirmDeletePage').""."