<?php

define('RENDER_MODE', 'catalyz');
ob_start();

use_helper('Catalyz');
$layout = LayoutManager::instance()->getCatalyzTemplate($node->getCurrentLayoutNameForAction());
$properties['layout_family'] = $layout[0];
$properties['layout_name'] = $layout[1];
$properties['ContentTree'] = $ContentTree;
$properties['node'] = $node;
$properties['page'] = $node->getPage();
$properties['culture'] = sfConfig::get('app_catalyz_language');

use_helper('Form');

use_stylesheet('catalyz/smoothness/jquery-ui-1.7.custom.css');
use_javascript('catalyz/jquery-1.3.2.min.js');
use_javascript('catalyz/jquery-ui-1.7.custom.min.js');

use_stylesheet('catalyz/catalyz.css');
if (sfConfig::get('app_catalyz_customize_css')) {
    use_stylesheet('catalyz-content.css');
}


$loginTemplate = sfConfig::get('app_login_template');

if ($loginTemplate) {
    include_partial($loginTemplate, $properties);
} else { ?>
<div id="catalyz-content">
                <center>
				<a href="<?php echo sfConfig::get('app_catalyz_url_home'); ?>" target="_blank"><?php echo image_tag(sfConfig::get('app_catalyz_logo_big', '/images/catalyz/logo450.png'), array('border' => 0)); ?></a>

				<div style="width: 420px; text-align: left;">
					<?php include_partial('catalyz/flash'); ?>
				</div>
				 <fieldset class="ui-corner-all" style="width: 400px"><legend><?php echo __('Login', null, 'catalyz'); ?></legend>

				<?php

    echo form_tag('catalyz/login', array('class' => 'login'));
    echo input_hidden_tag('node', $node->getId());

    ?>

						<table border="0" cellpadding="2" cellspacing="0">
						<tr>
							<td align="right"><label><?php echo __('Username:', null, 'catalyz'); ?></label></td>
							<td><input name="username" type="text" /></td>
						</tr>
						<tr>
							<td align="right"><label><?php echo __('Password:', null, 'catalyz'); ?></label></td>
							<td><input name="password" type="password" /></td>
						</tr>
						<tr>
							<td></td>
							<td>
								<input name="remember_password" id="remember_password" type="checkbox" value="1" />
							<label for="remember_password"><?php echo __('Remember me', null, 'catalyz'); ?></label>
							</td>
						</tr>
						<tr>
							<td></td>
							<td>
								<?php echo submit_tag(__('Login >>', null, 'catalyz'), array('name' => 'Login')); ?>
							</td>
						</tr>
						</table>



                  </form>
				</fieldset>
				</center>
								</div>

<?php }
$content = ob_get_contents();

ob_end_clean();

embed_with_layout($content, $layout, $properties);

?>