<?php
/**
* @package css2switch
* @author Dominik Gorczyca - mediahof
* 
* --------------------------------------------------------------------------------
* All rights reserved.  css2switch Component for Joomla! 1.5
*
**/
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<div id="submenu-box">
<div class="t">
	<div class="t">
		<div class="t"></div>
	</div>
</div>
<div class="clr"></div>
<div class="m">
<div class="submenu-box">
<div class="submenu-pad">
	<ul id="submenu" class="configuration">
		<li><a id="c2s_set" class="active"><?php echo JText::_( 'C2S_TAB_CONFIG' ); ?></a></li>
		<li><a id="c2s_info"><?php echo JText::_( 'C2S_TAB_INFO' ); ?></a></li>
	</ul>
	<div class="clr"></div>
</div>
</div>
</div>
<div class="clr"></div>
<div class="b">
	<div class="b">
		<div class="b"></div>
	</div>
</div>
</div> <!-- id="submenu-box -->
<div class="clr"></div>
<div id="element-box">
<div class="t">
	<div class="t">
		<div class="t"></div>
	</div>
</div>
<div class="clr"></div>
<div class="m">
	<div id="config-document">
		<div id="page-c2s_set" style="font-size:12px;">
			<form action="index2.php" method="post" name="adminForm">
				<input type="hidden" name="task" value="save" /> 
				<input type="hidden" name="option" value="<?php echo $option; ?>" /> 
				<table id="c2stable" class="adminlist">
				<thead>
					<tr>
						<td style="width:80px;"><?php echo JText::_( 'C2S_MENU_TYPE' ); ?></td>
						<td style="width:300px;"><?php echo JText::_( 'C2S_MENU_POINT' ); ?></td>
						<td style="width:150px;"><?php echo JText::_( 'C2S_CSS_FILE' ); ?></td>
						<td style="width:20px;"><?php echo JText::_( 'C2S_APPLY_CHILDMENU' ); ?></td>
					</tr>
				</thead>
				<tbody>
				<?php
				for ($mItems = 0; $mItems < count($css_ids); $mItems++)
				{
					if (!isset($mtyp) || $mtyp != $c2s->sortArray[$mItems]['typ'])
					{
						?>
						<tr class="row<?php echo $farbe; ?>">
						<td class="c2smenutype"><strong><?php echo $c2s->menuTypArray[$c2s->sortArray[$mItems]['typ']]; ?></strong></td>
						<td class="c2smenutype"><?php echo JText::_( 'C2S_CSS_DEFAULT_FILENAME' ); ?></td>
						<td class="c2smenutype">
							<select name="tmpl_<?php echo $c2s->sortArray[$mItems]['typ']; ?>">
		 					<?php 
		 						foreach ($c2s->stdCSSdat as $mTypCSS)
		 						{
		 							if ($mTypCSS->menutype == $c2s->sortArray[$mItems]['typ'])
		 							{
					 					foreach ($c2s->stdCSSFile as $klucz)
					 					{
				 							?>
				 							<option value="<?php echo $klucz; ?>"<?php echo $mTypCSS->default_templ == $klucz ? ' selected="selected"' : ''?>><?php echo $klucz; ?></option>
				 							<?php
										}
		 							}
								}
							?>
							</select>
						</td>
						<td class="c2smenutype">&nbsp;</td>
						</tr>
						<?php
						$mtyp = $c2s->sortArray[$mItems]['typ'];
					}
					if ($c2s->sortArray[$mItems]['css'] != '')
					{
						$cssDatei = $c2s->sortArray[$mItems]['css'];
					}
					?>
					<tr class="row<?php echo $farbe; ?>">
					<td><?php echo $c2s->menuTypArray[$c2s->sortArray[$mItems]['typ']];?></td>
					<?php 
					$color = '#'.$c2s->publishColor[ intval($c2s->sortArray[$mItems]['published']) ];
					if (isset($c2s->sortArray[$mItems]['parentname']))
					{
						?>
						<td style="color:<?php echo $color;?>;"><?php echo $c2s->sortArray[$mItems]['parentname'];?> - <?php echo str_replace($c2s->sortArray[$mItems]['parentname'].' - ', '', $c2s->sortArray[$mItems]['name']);?></td>
						<?php
					}
					else
					{
						?>
						<td style="color:<?php echo $color;?>;"><?php echo $c2s->sortArray[$mItems]['name'];?></td>
						<?php
					}
					?>
					<td class="c2ssel">
					<select name="css<?php echo $c2s->sortArray[$mItems]['id'];?>">
					<?php
				    for ($il = 0; $il < count($c2s->CSS); $il++)
					{
						?>
						<option value="<?php echo $c2s->CSS[$il];?>" <?php echo ((isset($cssDatei) && $cssDatei == $c2s->CSS[$il]) ? 'selected="selected"' : '');?>><?php echo $c2s->CSS[$il];?></option>
						<?php
					}
					?>
					<option value="" <?php echo ( (!isset($cssDatei) || $cssDatei == '' ) ? 'selected="selected"' : '');?>><?php echo JText::_( 'C2S_NONE_CSS_FILE' );?></option>
					</select>
					</td>
					<?php
					if (isset($c2s->sortArray[$mItems]['parentname']) && $c2s->sortArray[$mItems]['parentname'] != '')
					{
						?>
						<td class="c2ssel"><input type="hidden" name="sel<?php echo $c2s->sortArray[$mItems]['id'];?>" value="<?php echo $c2s->sortArray[$mItems]['parentid'];?>" /></td>
						<?php
					}
					else
					{
						if ( $c2s->testParentId($c2s->sortArray[$mItems]['id']) == '0' )
						{
							?>
							<td class="c2ssel"><input type="checkbox" checked="checked" name="sel<?php echo $c2s->sortArray[$mItems]['id'];?>" value="0" /></td>
							<?php
						}
						else
						{
							?>
							<td class="c2ssel"><input type="checkbox" name="sel<?php echo $c2s->sortArray[$mItems]['id'];?>" value="0" /></td>
							<?php
						}
					}
					?>
					</tr>
					<?php
					$cssDatei = '';
					$farbe = 1 - $farbe;
			  	}
				?>
				</tbody>
				</table>
			</form>
		</div>
		<div id="page-c2s_info" style="font-size:12px;">
			<span style="text-align:center;display:block;width:100%;font-weight:600;background-color:#f1f3f5;"><?php echo JText::_( 'C2S_DESCRIPTION_TITLE' );?></span>
			<span><?php echo JText::_( 'C2S_DESCRIPTION' );?></span>
			<span style="text-align:center;display:block;width:100%;font-weight:600;background-color:#f1f3f5;"><?php echo JText::_( 'C2S_CSS_FILES_TITLE' );?></span>
			<span><?php echo JText::_( 'C2S_CSS_FILES' );?></span>
			<span style="text-align:center;display:block;width:100%;font-weight:600;background-color:#f1f3f5;"><?php echo JText::_( 'C2S_CONFIGURE_TITLE' );?></span>
			<span>
			<?php 
				echo JText::_( 'C2S_CONFIGURE' );
				echo '<br /><a href="http://www.mediahof.de/images/stories/products/downloads/?joomla=1.5&ver=1.4&typ=components&name=css2switch&lang='.$lang->_lang.'" target="_blank">'.JText::_( 'C2S_UPGRADE' ).'</a>';
			?>
			</span>
			<span style="text-align:center;display:block;width:100%;font-weight:600;background-color:#f1f3f5;"><?php echo JText::_( 'C2S_DEINSTALL_TITLE' );?></span>
			<span><?php echo JText::_( 'C2S_DEINSTALL' );?></span>
			<span style="text-align:center;display:block;width:100%;font-weight:600;background-color:#f1f3f5;"><?php echo JText::_( 'C2S_LICENSE_TITLE' );?></span>
			<span><?php echo JText::_( 'C2S_LICENSE' );?>
				<?php echo JText::_( 'C2S_MONTH' ); ?> 2008<br />
				mediahof<br />Venture Park Blomenburg<br />24238 Selent - S-H, <?php echo JText::_( 'C2S_COUNTRY' ); ?><br /><a href="http://www.mediahof.de" target="_blank" title="mediahof | Werkstatt für medien, Kommunikationsgestaltung & IT">www.mediahof.de</a><br />
				<?php echo JText::_( 'C2S_AUTHOR' ); ?>: Dominik Gorczyca<br /><?php echo JText::_( 'C2S_COAUTHOR' ); ?>: John Zatkos
			</span>
		</div>
	</div>
</div>
<div class="clr"></div>
 <div class="b">
	<div class="b">
		<div class="b"></div>
	</div>
</div>
</div><!-- id="element-box" -->
<script type="text/javascript" src="<?php echo JURI::root();?>media/system/js/switcher.js"></script>
<br /><a href="http://www.mediahof.de" target="_blank"><img style="border:0px;" src="components/com_css2switch/img/logo_mediahof.gif" alt="mediahof | Werkstatt für Medien, Kommunikationsgestaltung & IT" /></a></p>

