<? $this->load->view( $this->aSystemVar['template_viewer_root'] . 'admin/_header') ?>
	<div class="bigCaption">Options</div>
	<div class="optionList">
	<?
		echo form_open('admin/option_list/' . $Option_list['Group'], array( 'id' => 'approve_option_form') );
		echo '<input type="hidden" name="changeoption" value="1" />';
		echo '<table cellpadding="0" cellspacing="1" class="contentList">';
		$i = 0;
		foreach( $Option_list['OptionList'] as $aOption )
		{
			switch ( $aOption['Type'] )
			{
				case 'text':
					$sValue = $this->config->item($aOption['Name']);
					$sCode = '<input type="text" name="' . $aOption['Name'] . '" value="' . $this->config->item($aOption['Name']) . '" class="text" />';
				break;
				case 'select':
					preg_match_all( '/\'(.+?)\'/', $aOption['Range'], $aValue );
					$sCode = '<select name="' . $aOption['Name'] . '">';
					foreach ( $aValue[1] as $sValue )
					{
						$sCode .= '<option value="' . $sValue . '" ' . ( $sValue == $aOption['Value'] ? 'selected="selected"' : '' ) . ' >' . $sValue . '</option>';
					}
					$sCode .= '</select>';
				break;
				case 'checkbox':
					$sChecked = ( '1' == $this->config->item($aOption['Name']) ? 'checked="checked"' : '' );
					$sCode = '<input type="checkbox" name="' . $aOption['Name'] . '" value="1" ' . $sChecked . ' />';
				break;
				case 'textarea':
					$sValue = $this->config->item($aOption['Name']);
					$sCode = '<textarea name="' . $aOption['Name'] . '" style="width:400px; font-size:11px; height:200px;">' . $sValue . '</textarea>';
				break;
				default:
					$sCode = '';
				break;
			}
			if( ($i%2) == 0 )
			{
				$sClassName = 'odd';
			}
			else
			{
				$sClassName = 'even';
			}
			echo '
				<tr class="' . $sClassName . '">
					<td class="f">
						' . $aOption['Description'] . '
					</td>
					<td>
						' . $sCode . '
					</td>
				</tr>
			';
			$i++;
		}
		echo '</table>';

		echo '<input type="submit" name="apply" value="apply" style="margin-top:10px;" />';

		echo form_close();
	?>
	</div>
<? $this->load->view( $this->aSystemVar['template_viewer_root'] . 'admin/_footer') ?>