<?php
/* @var $this Controller */
$cs = Yii::app()->clientScript;
$baseUrl = Yii::app()->baseUrl;
$templateBaseUrl = $baseUrl . '/css/admin/ace/assets';
$cs->registerCoreScript('jquery');
$cs->registerScriptFile($templateBaseUrl . '/js/ace-extra.min.js', 2);
$cs->registerScriptFile($templateBaseUrl . '/js/bootstrap.min.js', 2);
$cs->registerScriptFile($templateBaseUrl . '/js/typeahead-bs2.min.js', 2);
//page specific plugin scripts
//ace scripts
$cs->registerScriptFile($templateBaseUrl . '/js/ace-elements.min.js', 2);
$cs->registerScriptFile($templateBaseUrl . '/js/ace.min.js', 2);
?>
<!DOCTYPE html>
<html lang="<?php echo Yii::app()->language; ?>">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
        <meta name="viewport" content="width=device-width, initial-scale=1.0" >
        <!-- basic styles -->
        <link href="<?php echo $templateBaseUrl; ?>/css/bootstrap.min.css" rel="stylesheet" >
        <link href="<?php echo $templateBaseUrl; ?>/css/font-awesome.min.css" rel="stylesheet" >
        <!--[if IE 7]>
            <link href="<?php echo $templateBaseUrl; ?>/css/font-awesome-ie7.min.css" rel="stylesheet" >
        <![endif]-->
        <!-- page specific plugin styles -->

        <link rel="stylesheet" href="<?php echo $templateBaseUrl; ?>/css/jquery-ui-1.10.3.full.min.css" >
        <!-- fonts -->
        <!--<link rel="stylesheet" href="<?php // echo $templateBaseUrl;    ?>/css/ace-fonts.css" />-->
        <!-- ace styles -->
        <link rel="stylesheet" href="<?php echo $templateBaseUrl; ?>/css/ace.min.css" />
        <link rel="stylesheet" href="<?php echo $templateBaseUrl; ?>/css/ace-rtl.min.css" />
        <link rel="stylesheet" href="<?php echo $templateBaseUrl; ?>/css/ace-skins.min.css" />
        <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/new-styles.css" />
        <!--[if lte IE 8]>
          <link rel="stylesheet" href="<?php echo $templateBaseUrl; ?>/css/ace-ie.min.css" />
        <![endif]-->
        <link rel="stylesheet" href="<?php echo $baseUrl; ?>/css/admin/main.css" />
        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
        <script src="<?php echo $baseUrl; ?>/js/html5shiv.js"></script>
        <script src="<?php echo $baseUrl; ?>/js/respond.min.js"></script>
        <![endif]-->
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>
    </head>
    <body>
        <div id="page">
            <div class="navbar navbar-default" id="navbar">
                <div class="navbar-container" id="navbar-container">
                    <div class="navbar-header pull-left">
                        <a href="<?php echo Yii::app()->createUrl('/admin/default/index'); ?>" 
                           title="<?php echo CHtml::encode(Yii::app()->name); ?>"
                           class="navbar-brand">
                            <small>
                                <?php echo CHtml::image($baseUrl . '/images/admin/logo.png'); ?>
                                <?php echo CHtml::encode(Yii::app()->name); ?>
                            </small>
                        </a>
                    </div> 
                    <div class="navbar-header pull-right" role="navigation">
                        <ul class="nav ace-nav">
                            <li class="light-blue" id="loginMenu">
                                <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                                    <img class="nav-user-photo" src="<?php echo $baseUrl ?>/images/admin/avatar.png" alt="<?php echo CHtml::encode(Yii::app()->user->name); ?>" />
                                    <span class="user-info">
                                        <small><?php echo Yii::t('admin', 'Welcome,'); ?></small>
                                        <?php echo CHtml::encode(Yii::app()->user->name); ?>
                                    </span>
                                    <i class="icon-caret-down"></i> 
                                </a>
                                  <?php
                                if (Yii::app()->user->isGuest !== true) {
                                    $this->widget('zii.widgets.CMenu', array(
                                        'htmlOptions' => array('class' => 'user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close',),
                                        'encodeLabel' => false,
                                        'items' => array(
//                                            array('url' => Yii::app()->getModule('admin')->getModule('user')->profileUrl, 'label' => '<i class="icon-user"></i>' . Yii::app()->getModule('admin')->getModule('user')->t("Profile"), 'visible' => !Yii::app()->user->isGuest),
                                            array('label' => '<li class="divider"></li>'),
                                            array('url' => Yii::app()->getModule('admin')->getModule('user')->logoutUrl, 'label' => '<i class="icon-off"></i>' . Yii::app()->getModule('admin')->getModule('user')->t("Logout") . ' (' . Yii::app()->user->name . ')', 'visible' => !Yii::app()->user->isGuest),
                                    )));
                                }
                                ?>
                            </li>
                        </ul><!-- /.ace-nav -->
                    </div><!-- /.navbar-header -->
                </div><!-- /.container -->
            </div>
            <div class="main-container" id="main-container">
                <div class="main-container-inner">
                    <a class="menu-toggler" id="menu-toggler" href="index.html#">
                        <span class="menu-text"></span>
                    </a>
                    <div class="sidebar" id="sidebar">
                        <?php echo $this->renderPartial('admin.views.layouts._menu'); ?>
                    </div>
                    <div class="main-content">
                        <div class="breadcrumbs" id="breadcrumbs">
                            <?php if (isset($this->breadcrumbs)): ?>
                                <?php
                                $this->widget('zii.widgets.CBreadcrumbs', array(
                                    'id' => 'breadcrumb',
                                    'htmlOptions' => array('class' => 'breadcrumb'),
                                    'links' => $this->breadcrumbs,
                                    'tagName' => 'ul', // will change the container to ul
                                    'separator' => '',
                                    'activeLinkTemplate' => '<li><a href="{url}" title="{label}" >{label}</a></li>', // will generate the clickable breadcrumb links 
                                    'inactiveLinkTemplate' => '<li class="active">{label}</li>', // will generate the current page url : <li>News</li>
                                    'homeLink' => '<li><a href="' . Yii::app()->homeUrl . '">Home</a></li>', // will generate your homeurl item : <li><a href="/dr/dr/public_html/">Home</a></li>
                                    'homeLink' => '<li><i class="icon-home home-icon"></i>' . CHtml::link(Yii::t('admin', 'Home'), array('/admin/default/index')) . '</li>',
                                ));
                                ?><!-- breadcrumbs -->
                            <?php endif ?>
                            <!--    <div class="nav-search" id="nav-search">
                                    <form class="form-search">
                                        <span class="input-icon">
                                            <input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
                                            <i class="icon-search nav-search-icon"></i>
                                        </span>
                                    </form>
                                </div>-->
                        </div>
                        <div class="page-content">
                            <?php foreach (Yii::app()->user->getFlashes() as $key => $value): ?>
                                <div class="alert alert-block <?php echo $key; ?>">
                                    <button type="button" class="close" data-dismiss="alert">
                                        <i class="icon-remove"></i>
                                    </button>
                                    <i class="icon-ok green"></i>

                                    <?php echo $value; ?>
                                </div>
                            <?php endforeach; ?>
                            <?php echo $content; ?>
                        </div>
                        <div id="footer" >
                            <small>
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                Copyright &copy; <?php echo date('Y'); ?> by <a href="http://www.flexsolution.biz/" title="Flex Solutions">Flex Solutions</a>.
                                All Rights Reserved.
                            </small>
                        </div><!-- footer -->
                    </div>
                </div>
                <a href="index.html#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
                    <i class="icon-double-angle-up icon-only bigger-110"></i>
                </a>
            </div>
            <div class="clear"></div>
        </div><!-- page -->
    </body>
</html>