<?php
// $Id: admin.config.html.php,v 1.32 2004/02/05 15:21:55 saka_car Exp $
/**
* Config admin HTML
* @package Mambo Open Source
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.32 $
**/

class HTML_config
{
	function showconfig( &$row, &$lists, $option) {
		global $mosConfig_absolute_path;
?>
<table cellpadding="4" cellspacing="0" border="0" width="100%">
  <tr>
    <td width="100%" class="sectionname"><img src="images/mos_gel.png" width="70" height="67" align="middle" />Global
      Configuration : <span class="componentheading">configuration.php is :
      <?php echo is_writable( '../configuration.php' ) ? '<b><font color="green">
Writeable</font></b>' : '<b><font color="red">Unwriteable</font></b>' ?>
</span></td>
  </tr>
</table>
<script language="javascript" src="js/dhtml.js"></script>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
  <tr>
    <td width="" class="tabpadding">&nbsp;</td>
    <td id="tab1" class="offtab" onClick="dhtml.cycleTab(this.id)">Site</td>
    <td id="tab2" class="offtab" onClick="dhtml.cycleTab(this.id)">Locale</td>
    <td id="tab3" class="offtab" onClick="dhtml.cycleTab(this.id)">Content</td>
    <td id="tab4" class="offtab" onClick="dhtml.cycleTab(this.id)">Database</td>
    <td id="tab5" class="offtab" onClick="dhtml.cycleTab(this.id)">Server</td>
    <td id="tab6" class="offtab" onClick="dhtml.cycleTab(this.id)">Metadata</td>
    <td width="90%" class="tabpadding">&nbsp;</td>
  </tr>
</table>
<script language="javascript" type="text/javascript">
	function submitbutton(pressbutton) {
		var form = document.adminForm;
			if (pressbutton == 'save') {
				//if (confirm ("Are you sure?")) {
					submitform( pressbutton );
				//}
			} else {
				document.location.href = 'index2.php';
			}
	}
</script>
<form action="index2.php" method="POST" name="adminForm">
  <div id="page1" class="pagetext">
    <table cellpadding="2" cellspacing="4" border="0" width="100%" class="adminform">
      <tr>
        <td width="185">Site Offline:</td>
        <td> <?php echo $lists['offline']; ?> </td>
      </tr>
      <tr>
        <td width="185" valign="top">Offline Message:</td>
        <td width="786" colspan="2"> <textarea class="inputbox" cols="60" rows="3" style="width:500; height:80" name="config_offline_message"><?php echo $row->config_offline_message; ?></textarea>
        </td>
      </tr>
      <tr>
        <td width="185" valign="top">System Error Message:</td>
        <td width="786" colspan="2"> <textarea class="inputbox" cols="60" rows="3" style="width:500; height:200" name="config_error_message"><?php echo $row->config_error_message; ?></textarea>
        </td>
      </tr>
      <tr>
        <td width="185">Site Name:</td>
        <td><input class="inputbox" type="text" name="config_sitename" size="50" value="<?php echo $row->config_sitename; ?>"></td>
      </tr>
      <tr>
        <td width="185">Show UnAuthorized Links:</td>
        <td> <?php echo $lists['auth']; ?> </td>
      </tr>
      <tr>
        <td width="185">Allow User Registration:</td>
        <td> <?php echo $lists['allowuserregistration']; ?> </td>
      </tr>
      <tr>
        <td width="185">Email New User Password:</td>
        <td> <?php echo $lists['emailpass']; ?> </td>
      </tr>
      <tr>
        <td width="185">Use Banner:</td>
        <td> <?php echo $lists['usebanner']; ?> </td>
      </tr>
      <tr>
        <td width="185">Debug Site:</td>
        <td> <?php echo $lists['debug']; ?> </td>
      </tr>
      <tr>
        <td width="185">WYSIWYG Editor:</td>
        <td><input class="inputbox" type="text" name="config_editor" size="15" value="<?php echo $row->config_editor; ?>"></td>
      </tr>
    </table>
  </div>
  <div id="page2" class="pagetext">
    <table cellpadding="2" cellspacing="4" border="0" width="100%" class="adminform">
      <tr>
        <td width="185">Language:</td>
        <td> <?php echo $lists['lang']; ?> </td>
      </tr>
      <tr>
        <td width="185">Time Offset:</td>
        <td><?php echo $lists['offset']; ?>&nbsp;Current date/time configured to display: <span class="error"><?php echo (strftime ("%A, %d %B %Y. %H:%M", time()+($row->config_offset*60*60))); ?></span></td>
      </tr>
      <tr>
        <td width="185">Country Locale:</td>
        <td><input class="inputbox" type="text" name="config_locale" size="15" value="<?php echo $row->config_locale; ?>"></td>
      </tr>
    </table>
  </div>
  <div id="page3" class="pagetext">
    <table cellpadding="2" cellspacing="4" border="0" width="100%" class="adminform">
      <tr>
        <td width="185">Search Engine Friendly URLs:</td>
        <td width="75"> <?php echo $lists['sef']; ?> </td>
        <td><span class="error">Apache only! Rename htaccess.txt to .htaccess before activating</span></td>
      </tr>
      <tr>
        <td width="185">Use Linked Titles:</td>
        <td width="75"> <?php echo $lists['link_titles']; ?> </td>
        <td><span class="error">Use hyperlinked titles</span></td>
      </tr>
      <tr>
        <td width="185">Allow Item Rating:</td>
        <td width="75"> <?php echo $lists['vote']; ?> </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="185">Hide Author Names:</td>
        <td width="75"> <?php echo $lists['hideauthor']; ?> </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="185">Hide Created Date and Time:</td>
        <td> <?php echo $lists['hidecreate']; ?> </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="185">Hide Modified Date and Time:</td>
        <td> <?php echo $lists['hidemodify']; ?> </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="185">Hide PDF Icon:</td>
        <td width="75"> <?php echo $lists['hidepdf']; ?> </td>
        <td>
<?php	if (!is_writable( "$mosConfig_absolute_path/media/" )) { ?>
			<span class="error">Option not available as /media directory not writable</span>
<?php	} ?>
		</td>
      </tr>
      <tr>
        <td width="185">Hide Print Icon:</td>
        <td width="75"> <?php echo $lists['hideprint']; ?> </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="185">Hide Email Icon:</td>
        <td width="75"> <?php echo $lists['hideemail']; ?> </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="185">Log Content Hits by Date:</td>
        <td> <?php echo $lists['log_items']; ?> </td>
		<td><span class="error">WARNING : Large amounts of data will be collected</span></td>
      </tr>
      <tr>
        <td width="185">Log Search Strings:</td>
        <td> <?php echo $lists['log_searches']; ?> </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="185">Table of Contents on multi-page items:</td>
        <td> <?php echo $lists['multipage_toc']; ?> </td>
        <td>&nbsp;</td>
      </tr>
    </table>
  </div>
  <div id="page4" class="pagetext">
    <table cellpadding="2" cellspacing="4" border="0" width="100%" class="adminform">
      <tr>
        <td width="185">Hostname:</td>
        <td width="786"><input class="inputbox" type="text" name="config_host" size="25" value="<?php echo $row->config_host; ?>"></td>
      </tr>
      <tr>
        <td width="185">MySQL Username:</td>
        <td><input class="inputbox" type="text" name="config_user" size="25" value="<?php echo $row->config_user; ?>"></td>
      </tr>
      <tr>
        <td width="185">MySQL Password:</td>
        <td><input class="inputbox" type="text" name="config_password" size="25" value="<?php echo $row->config_password; ?>"></td>
      </tr>
      <tr>
        <td width="185">MySQL Database:</td>
        <td><input class="inputbox" type="text" name="config_db" size="25" value="<?php echo $row->config_db; ?>"></td>
      </tr>
      <tr>
        <td width="185">MySQL Database Prefix:</td>
        <td><input class="inputbox" type="text" name="config_dbprefix" size="10" value="<?php echo $row->config_dbprefix; ?>">
          &nbsp;<span class="error">!! DO NOT CHANGE UNLESS YOU HAVE A DATABASE
          BUILT USING TABLES WITH THE PREFIX YOU ARE SETTING !!</span></td>
      </tr>
    </table>
  </div>
  <div id="page5" class="pagetext">
    <table cellpadding="2" cellspacing="4" border="0" width="100%" class="adminform">
      <tr>
        <td width="185">Absolute Path:</td>
        <td><strong><?php echo $row->config_path; ?></strong></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="185">Live Site:</td>
        <td><strong><?php echo $row->config_live_site; ?></strong></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="185">GZIP Page Compression:</td>
        <td width="75"> <?php echo $lists['gzip']; ?> </td>
        <td span class="error">Compress buffered output if supported</td>
      </tr>
      <tr>
        <td width="185">Login Session Lifetime:</td>
        <td><input class="inputbox" type="text" name="config_lifetime" size="10" value="<?php echo $row->config_lifetime; ?>">
          seconds</td>
        <td span class="error">Auto logout after this time of inactivity</td>
      </tr>
      <tr>
        <td width="185">Error Reporting:</td>
        <td> <?php echo $lists['error_reporting']; ?> </td>
        <td>&nbsp;</td>
      </tr>
    </table>
  </div>
  <div id="page6" class="pagetext">
    <table cellpadding="2" cellspacing="0" border="0" width="100%" class="adminform">
      <tr>
        <td width="185" valign="top">Meta Description:</td>
        <td width="786"> <textarea class="inputbox" cols="60" rows="3" name="config_metadesc"><?php echo $row->config_metadesc; ?></textarea>
        </td>
      </tr>
      <tr>
        <td width="185" valign="top">Meta Keywords:</td>
        <td width="786"> <textarea class="inputbox" cols="60" rows="3" name="config_metakeys"><?php echo $row->config_metakeys; ?></textarea>
        </td>
      </tr>
    </table>
  </div>
  <input type="hidden" name="option" value="<?php echo $option; ?>">
  <input type="hidden" name="config_path" value="<?php echo $row->config_path; ?>">
  <input type="hidden" name="config_live_site" value="<?php echo $row->config_live_site; ?>">
  <input type="hidden" name="task" value="">
</form>
<script language="javascript" type="text/javascript">
	dhtml.cycleTab('tab1');
</script>
<?php }
}
?>
