<tr class="table-color2">
	<td class="text"><strong>Default Theme:</strong></td>
	<td>
		<select name="theme">
			<?php
				$sql = 'SELECT Name
						FROM ' . TABLE_PREFIX . 'Modules';
				$modules = $this->Conn->GetCol($sql);

				$incommerce_only = count($modules) == 2 && in_array('In-Commerce', $modules);
				$default_theme = $incommerce_only ? 'onlinestore' : 'default';

				if ($default_theme == 'default') {
					if (file_exists(FULL_PATH . '/themes/default2007')) {
						$default_theme = 'default2007';
					}

					// default theme since 5.0.1
					if (file_exists(FULL_PATH . '/themes/simple')) {
						$default_theme = 'simple';
					}
				}

				$themes = $this->toolkit->getThemes();
				$default_theme = array_search($default_theme, $themes); // convert theme name to id

				$option_tpl = '<option value="%s"%s>%s</option>';

				foreach ($themes as $theme_id => $theme_name) {
				    $selected = $theme_id == $default_theme ? ' selected' : '';
					echo sprintf($option_tpl, $theme_id, $selected, $theme_name);
				}
			?>
		</select>
	</td>
</tr>