<?php
// $Id: index.php,v 1.3 2005/10/28 11:56:02 ohwada Exp $

// 2005-01-20 K.OHWADA
// use user_list.php

// 2004-12-05 K.OHWADA
// use link_list.php, category_list.php

// 2004-11-22 K.OHWADA
// use admin_header.php

// 2004-10-20 K.OHWADA
// link broken check
// add function highlight_number()

// 2004/08/18 K.OHWADA
// add menu Delete Category

// 2004/08/10 K.OHWADA
// use class weblinksCatlink, BaseLanguage
// enable to install this module two or more. 

// ------------------------------------------------------------------------- //
//                XOOPS - PHP Content Management System                      //
//                       <http://www.xoops.org/>                             //
// ------------------------------------------------------------------------- //

//================================================================
// admin index
// use class
// divid this file to some functions
// 2004/01/23 K.OHWADA
//================================================================

include 'admin_header.php';

$op = 'main';
if     ( isset($_POST['op']) ) $op = $_POST['op'];
elseif ( isset($_GET['op']) )  $op = $_GET['op']; 

switch ($op) 
{
case "listBrokenLinks":	//
	listBrokenLinks();
	break;

case "delBrokenLinks":
	delBrokenLinks();
	break;

case "ignoreBrokenLinks":
	ignoreBrokenLinks();
	break;

case "delVote":
	delVote();
	break;

case 'main':
default:
	main_menu();
	break;

}

exit();
// --- end of main ---


//---------------------------------------------------------
// function
//---------------------------------------------------------
function main_menu()
{
	global $tbl_link, $tbl_modify, $tbl_broken;

	$total_link = $tbl_link->getNumAll();
	$total_link = sprintf(_WLS_THEREARE, $total_link);

	$totalbrokenlinks = $tbl_broken->getNumAll();
	$totalbrokenlinks = highlight_number($totalbrokenlinks);
	
	$totalnewlinks = $tbl_modify->getNumNew();
	$totalnewlinks = highlight_number($totalnewlinks);

	$totalmodify = $tbl_modify->getNumMod();
	$totalmodify = highlight_number($totalmodify);

	$total_broken = $tbl_link->getNumBroken();
	$total_broken = highlight_number($total_broken);

	$total_nourl  = $tbl_link->getNumNoUrl();

	global $xoops_module_mid;
	$url_preferences = XOOPS_URL.'/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod='.$xoops_module_mid;

	global $lang;
	$happy_linux_url = $lang->get_happy_linux_url();

	xoops_cp_header();

	echo "<h4>"._WLS_WEBLINKSCONF."</h4>\n";
	echo "<table width='100%' border='0' cellspacing='1' class='outer'>";
	echo "<tr class='odd'><td>";
	echo " - <a href='".$url_preferences."'>"._WEBLINKS_ADMIN_MODULE_CONFIG_1."</a>";
	echo "<br /><br />\n";
	echo " - <a href='config.php'>"._WEBLINKS_ADMIN_MODULE_CONFIG_2."</a>";
	echo "<br /><br />\n";
	echo " - <a href='category_list.php'>"._WEBLINKS_ADMIN_CATEGORY_MANAGE."</a>";
	echo "<br /><br />\n";
	echo " - <a href='link_list.php'>"._WEBLINKS_ADMIN_LINK_MANAGE."</a>";
	echo "<br /><br />\n";
	echo " --- <a href='link_manage.php?op=addLink'>"._WEBLINKS_ADMIN_ADD_LINK."</a>";
	echo "<br /><br />\n";
	echo " --- <a href='link_list.php?sortid=2'>"._WEBLINKS_ADMIN_LINK_BROKEN." ($total_broken)</a>";
	echo "<br /><br />\n";
	echo " --- <a href='link_manage.php?op=listNewLinks'>"._WLS_LINKSWAITING." ($totalnewlinks)</a>";
	echo "<br /><br />\n";
	echo " --- <a href='link_manage.php?op=listModReq'>"._WLS_MODREQUESTS." ($totalmodify)</a>";
	echo "<br /><br />\n";
	echo " --- <a href='index.php?op=listBrokenLinks'>"._WLS_BROKENREPORTS." ($totalbrokenlinks)</a>";
	echo "<br /><br />\n";
	echo " - <a href='rss_manage.php'>"._WEBLINKS_ADMIN_RSS_MANAGE."</a>";
	echo "<br /><br />\n";
	echo " - <a href='user_list.php'>"._WEBLINKS_ADMIN_USER_MANAGE."</a>";
	echo "<br /><br />\n";
	echo " - <a href='other.php'>"._WEBLINKS_ADMIN_OTHERFUNC."</a>";
	echo "<br /><br />\n";
	echo "<div>".$total_link."</div>\n";
   	echo"</td></tr></table>\n";

	echo "<br />";
	echo "<div align='right'><a href='$happy_linux_url' target='_blank'><font size='-1'>Powered by Happy Linux</font></a></div>";
	echo "<div align='right'><font size='-1'>&copy; 2005 Kenichi OHWADA</font></div>";

	xoops_cp_footer();
}


?>
