<?php
// $Id: admin.languages.html.php,v 1.6 2003/12/09 21:17:36 rcastley Exp $
//
// Copyright (C) 2000-2003 Miro International Pty Ltd
// All rights reserved.  Mambo Open Source is Free Software
// released under the GNU/GPL License.
//
// This source file is part of the Mambo Open Source Content
// Management System.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//
// The "GNU General Public License" (GPL) is available at
// http://www.gnu.org/copyleft/gpl.html.

class HTML_languages {

	function showLanguages( $cur_lang, &$rows, &$pageNav, $option ) {
		global $my;
?>
	<form action="index2.php" method="post" name="adminForm">
	<table cellpadding="4" cellspacing="0" border="0" width="100%">
		<tr>
			<td width="100%"><span class="sectionname"><img src="images/mos_gel.png" width="70" height="67" align="middle" />Installed Languages</span></td>
			<td nowrap>Display #</td>
			<td> <?php echo $pageNav->writeLimitBox(); ?> </td>
		</tr>
	</table>
	<table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
		<tr>
			<th width="20">#</th>
			<!--<th width="20"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $rows ); ?>);" /></th> -->
			<th width="30">&nbsp;</th>
			<th width="25%" class="title">Language</th>
			<th width="5%">Published</th>
			<th width="10%">Version</th>
			<th width="10%">Date</th>
			<th width="20%">Author</th>
			<th width="25%">Author Email</th>
		</tr>
<?php
		$k = 0;
		for ($i=0, $n=count( $rows ); $i < $n; $i++) {
			$row = &$rows[$i];
?>
		<tr class="<?php echo "row$k"; ?>">
			<td width="20"><?php echo $i+$pageNav->limitstart+1;?></td>
			<td width="20">
			  <input type="radio" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $row->language; ?>" onClick="isChecked(this.checked);" />
			</td>
			<td width="25%">
			<a href="#edit" onclick="return listItemTask('cb<?php echo $i;?>','edit_source')"><?php echo $row->name;?></td>
			<td width="5%" align="center">
<?php		if ($row->published == 1) {	 ?>
				<img src="images/tick.png">
<?php		} else { ?>
				&nbsp;
<?php		} ?>
			</td>
			<td align=center><?php echo $row->version; ?></td>
			<td align=center><?php echo $row->creationdate; ?></td>
			<td align=center><?php echo $row->author; ?></td>
			<td align=center><?php echo $row->authoremail; ?></td>
		</tr>
<?php
		}
	?>
		<tr>
			<th align="center" colspan="9"> <?php echo $pageNav->writePagesLinks(); ?></th>
		</tr>
		<tr>
			<td align="center" colspan="9"> <?php echo $pageNav->writePagesCounter(); ?></td>
		</tr>
	</table>

	<input type="hidden" name="option" value="<?php echo $option;?>" />
	<input type="hidden" name="task" value="" />
	<input type="hidden" name="boxchecked" value="0" />
	</form>
<?php
	}

	function editLanguageSource( $language, &$content, $option ) {
?>
	<form action="index2.php" method="POST" name="adminForm">
	<table cellpadding="4" cellspacing="0" border="0" width="100%">
		<tr>
			<td class="sectionname" width="100%">Language Editor</td>
		</tr>
	</table>
	<table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminform">
		<tr>
			<th colspan="4">Path: language/<?php echo "$language.php"; ?></th>
		</tr>
		<tr>
			<td><textarea cols="110" rows="25" name="filecontent" class="inputbox"><?php echo $content; ?></textarea></td>
		</tr>
		<tr>
			<td class="error">Please Note:Language file must be Writable to Save Changes.</td>
		</tr>
	</table>

	<input type="hidden" name="language" value="<?php echo $language; ?>" />
	<input type="hidden" name="option" value="<?php echo $option;?>" />
	<input type="hidden" name="task" value="" />
	</form>
<?php
	}

}
?>
