<?php
    $baseUrl = Yii::app()->baseUrl; 
    $cs = Yii::app()->clientScript;
    
    $cs->coreScriptPosition=CClientScript::POS_HEAD;
    $cs->scriptMap = array();
    
    $cs->registerCoreScript('jquery');
    $cs->registerCoreScript('jquery.ui');
    $cs->registerScriptFile($baseUrl.'/js/custom/general.js');
    
    $cs->registerCssFile($baseUrl.'/css/style.css');
?>

<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo Yii::app()->language; ?>" lang="<?php echo Yii::app()->language; ?>">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="<?php echo Yii::app()->language; ?>" />

        <!--[if IE 9]>
            <link rel="stylesheet" media="screen" href="<?php echo Yii::app()->baseUrl; ?>/css/ie9.css"/>
        <![endif]-->

        <!--[if IE 8]>
            <link rel="stylesheet" media="screen" href="<?php echo Yii::app()->baseUrl; ?>/css/ie8.css"/>
        <![endif]-->

        <!--[if IE 7]>
            <link rel="stylesheet" media="screen" href="<?php echo Yii::app()->baseUrl; ?>/css/ie7.css"/>
        <![endif]-->
        
	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body class="bodygrey">
    <div class="headerspace"></div>

<div class="header">
   
    <form id="search" action="" method="post">
    	<input type="text" name="keyword" /> <button class="searchbutton"></button>
    </form>
    
    <div class="topheader">
        <ul class="notebutton">
            <li class="note">
                <a href="pages/message.html" class="messagenotify">
                    <span class="wrap">
                        <span class="thicon msgicon"></span>
                        <span class="count">1</span>
                    </span>
                </a>
            </li>
            <li class="note">
            	<a href="pages/info.html" class="alertnotify">
                	<span class="wrap">
                    	<span class="thicon infoicon"></span>
                        <span class="count">5</span>
                    </span>
                </a>
            </li>
        </ul>
    </div><!-- topheader -->


    <!-- logo  -->
	<a href=""><img src="<?php echo Yii::app()->baseUrl; ?>/images/logo2.png" alt="Logo" /></a>
    
    <div class="tabmenu">        
		<?php $this->widget('zii.widgets.CMenu',array(
                        'activeCssClass'=>'current',
                        'linkLabelWrapper' => 'span',                        
			'items'=>array(
				array(
                                    'label'=>Yii::t('intranet', 'Tablero'),
                                    'url'=>array('/site/index'),
                                    'linkOptions'=>array('class'=>'dashboard'),
                                    'active' => ($this->getId() == 'tablero'),
                                ),
				array(
                                    'label'=>Yii::t('intranet', 'Candidatos'),
                                    'url'=>array('/candidato/index'),
                                    'linkOptions'=>array('class'=>'candidatos'),
                                    'active' => ($this->getId() == 'candidato'),
                                ),
				array(
                                    'label'=>Yii::t('intranet', 'Ofertas'), 
                                    'url'=>array('/site/index'),
                                    'linkOptions'=>array('class'=>'ofertas'),
                                    'active' => ($this->getId() == 'oferta'),
                                ),
				array(
                                    'label'=>Yii::t('intranet', 'Solicitudes de oferta'), 
                                    'url'=>array('/site/index'),
                                    'linkOptions'=>array('class'=>'solicitudes'),
                                    'active' => ($this->getId() == 'solicitud'),
                                ),
				array(
                                    'label'=>Yii::t('intranet', 'Sistema'), 
                                    'url'=>array('/sistema/index'),
                                    'linkOptions'=>array('class'=>'sistema'),
                                    'active' => ($this->getId() == 'sistema')
                                ),
			),
		)); ?>        
    </div><!-- tabmenu -->
    
    
    
    <div class="accountinfo">
    	<img src="<?php echo Yii::app()->baseUrl; ?>/images/avatar.png" alt="Avatar" />
        <div class="info">
        	<h3><?php echo Yii::app()->user->name; ?></h3>
            <small></small>
            <p>
            	<a href=""><?php echo Yii::t('intranet', 'Preferencias');?></a> 
                <?php echo CHtml::link('Salir', $this->createAbsoluteUrl('site/logout')); ?>
            </p>
        </div><!-- info -->
    </div><!-- accountinfo -->
</div><!-- header -->    

<div class="sidebar"></div>

<div class="maincontent">
    <?php if(isset($this->breadcrumbs)):?>
            <?php $this->widget('zii.widgets.CBreadcrumbs', array(
                'homeLink'=>CHtml::link(Yii::t('intranet', 'Tablero'), array('/site/index')),
                'links'=>$this->breadcrumbs,
                'separator'=>'',
            )); ?>
    <?php endif; ?>
    <div class="left">
        <?php if(isset($this->pageTitle)):?>
            <h1 class="pageTitle"><?php echo $this->pageTitle; ?></h1>
        <?php endif; ?>
    
        <?php $flashMessages = Yii::app()->user->getFlashes(); ?>
        <?php if (count($flashMessages) > 0) : ?>
                <div class="two_third last">
        <?php            
                foreach($flashMessages as $key => $message) {
                    switch($key) {
                        case 'error': $class = 'msgerror'; break;
                        case 'success': $class = 'msgsuccess'; break;
                        case 'notice': $class = 'msgalert'; break;
                        case 'info': $class = 'msginfo'; break;
                    }
        ?>
                    <div class="notification <?php echo $class; ?>">
                        <a class="close"></a>
                        <p><?php echo $message; ?></p>
                    </div>

        <?php } ?>
                </div>
                <br clear="all" />
        <?php endif; ?>
            
            
        <?php if(count($this->menu)>0): ?>
            <div class="operations">
        <?php
                $this->widget('zii.widgets.CMenu', array(
                    'items'=> (isset($this->menu['principal'])) ? $this->menu['principal'] : $this->menu,
                    'encodeLabel' => false,
                ));
        ?>
            </div>
        <?php endif; ?>    
            
        <?php echo $content; ?>
        
    </div>
</div><!--maincontent-->

<br />
<div class="footer footer_float">
    <div class="footerinner">
	<?php /*Copyright &copy; <?php echo date('Y'); ?> by My Company.<br/>*/ ?>
    </div><!-- footerinner -->
</div><!-- footer -->

</body>
</html>
