예제 #1
0
파일: main.php 프로젝트: Aprende-php/SAFES
				<script src="<?php 
echo Yii::app()->theme->baseUrl . '/assets/js/html5shiv.js';
?>
"></script>
				<script src="<?php 
echo Yii::app()->theme->baseUrl . '/assets/js/respond.min.js';
?>
"></script>
		<![endif]-->
		<style type="text/css">body { padding-top: 70px; }</style>
	</head>
	<body>
	<div class="container">
	 <?php 
// Begin Navbar
$this->widget('bootstrap.widgets.BsNavbar', array('collapse' => true, 'brandLabel' => BsHtml::icon(BsHtml::GLYPHICON_FIRE) . ' SAFES', 'brandUrl' => Yii::app()->homeUrl, 'position' => BsHtml::NAVBAR_POSITION_FIXED_TOP, 'items' => array(array('class' => 'bootstrap.widgets.BsNav', 'type' => 'navbar', 'activateParents' => true, 'items' => array(array('visible' => TRUE, 'label' => 'Usuarios', 'url' => array('/Usuario/index'), 'icon' => BsHtml::GLYPHICON_COG, 'items' => array(BsHtml::dropDownHeader('Administración de Usuarios'), array('label' => 'Administrar Usuarios', 'url' => array('/usuario/admin'), 'visible' => TRUE), array('label' => 'Administrar Modulos', 'url' => array('/usuario/modulos'), 'visible' => TRUE), array('label' => 'Administrar Permisos', 'url' => array('/usuario/permisos'), 'visible' => TRUE), array('label' => 'Administrar Roles', 'url' => array('/usuario/role'), 'visible' => TRUE))))), array('class' => 'bootstrap.widgets.BsNav', 'type' => 'navbar', 'activateParents' => true, 'items' => array(array('visible' => TRUE, 'label' => 'Empresa', 'url' => array('/Usuario/index'), 'icon' => BsHtml::GLYPHICON_COG, 'items' => array(BsHtml::dropDownHeader('Administración de Empresas'), array('label' => 'Administrar Empresa', 'url' => array('/Empresa/admin'), 'visible' => TRUE), array('label' => 'Agregar Empresa', 'url' => array('/Empresa/create'), 'visible' => TRUE), BsHtml::menuDivider(), BsHtml::dropDownHeader('Administración de Usuarios'), array('label' => 'Administrar Usuarios', 'url' => array('/persona/admin'), 'visible' => TRUE), array('label' => 'Agregar Persona', 'url' => array('/persona/create'), 'visible' => TRUE))))), array('class' => 'bootstrap.widgets.BsNav', 'type' => 'navbar', 'activateParents' => true, 'items' => array(array('visible' => TRUE, 'label' => 'Proyectos', 'url' => array('/Usuario/index'), 'icon' => BsHtml::GLYPHICON_SAVED, 'items' => array(BsHtml::dropDownHeader('Proyectos'), array('label' => 'Agregar Tasa de accidentes', 'url' => array('/indicador/create'), 'visible' => TRUE), BsHtml::menuDivider(), BsHtml::dropDownHeader('Accidentes de trabajo'), array('label' => 'Agregar Accidente', 'url' => array('/accidente/ingresarForestal'), 'visible' => TRUE))))), array('class' => 'bootstrap.widgets.BsNav', 'type' => 'navbar', 'activateParents' => true, 'items' => array(array('label' => 'Informes', 'url' => array('/Usuario/index'), 'icon' => BsHtml::GLYPHICON_LIST_ALT, 'items' => array(array('label' => 'Seguridad por empresa', 'url' => array('/estadistica/seg_emp/'), 'visible' => TRUE), array('label' => 'Seguridad de empresas por area', 'url' => array('/estadistica/seg_emp_are/'), 'visible' => TRUE), array('label' => 'Seguridad planta con areas', 'url' => array('/estadistica/seg_plan_are/'), 'visible' => TRUE), array('label' => 'Seguridad de empresas con otras empresas', 'url' => array('/estadistica/seg_emp_emp/'), 'visible' => TRUE), array('label' => 'Accidentes mensuales por empresas', 'url' => array('/estadistica/acc_men_emp/'), 'visible' => TRUE), array('label' => 'Accidentes Anuales Area Bosque', 'url' => array('/estadistica/acc_anu_are_bosque/'), 'visible' => TRUE))))), array('class' => 'bootstrap.widgets.BsNav', 'type' => 'navbar', 'activateParents' => true, 'items' => array(array('label' => 'Bienvenido Ruben', 'url' => array('/site/index'), 'icon' => BsHtml::GLYPHICON_USER, 'items' => array(array('icon' => BsHtml::GLYPHICON_USER, 'label' => 'Cambiar Contraseña', 'url' => array('/usuario/changepassword'), 'visible' => !Yii::app()->user->isGuest), BsHtml::menuDivider(), array('icon' => BsHtml::GLYPHICON_LOG_OUT, 'label' => 'Cerrar Sesión', 'url' => array('/site/logout'), 'visible' => !Yii::app()->user->isGuest)))), 'htmlOptions' => array('pull' => BsHtml::NAVBAR_NAV_PULL_RIGHT)))));
// end nabvar
// breadcrumbs
$this->widget('bootstrap.widgets.BsBreadCrumb', array('links' => $this->breadcrumbs, 'tagName' => 'ul', 'activeLinkTemplate' => '<li><a href="{url}">{label}</a></li>', 'inactiveLinkTemplate' => '<li>{label}</li>', 'homeLink' => BsHtml::openTag('li') . BsHtml::icon(BsHtml::GLYPHICON_HOME) . BsHtml::closeTag('li')));
?>
		<!-- contenido -->
		<div class="jumbotron">
			<div class="row">
				<?php 
echo $content;
?>
			</div>                    
		</div>
	</div>
	</body>
</html>
예제 #2
0
 public function getMenuList($level = 1, $duplicateFirst = false)
 {
     $returnarray = array('label' => $this->title, 'url' => $this->external_path ? $this->external_path_formatted : array('content/view', 'path' => $this->Content->path));
     if ($this->Content) {
         $Content = $this->Content;
         $today = new DateTime();
         $publish_on = new DateTime($Content->publish_on);
         $unpublish_on = new DateTime($Content->unpublish_on);
         if (!$Content->published || $publish_on > $today || $unpublish_on < $today) {
             $returnarray['htmlOptions']['class'] = 'unpublished';
         }
     }
     $subitems = array();
     if ($this->children) {
         //Duplicate first level link for bootstrap click to activate links
         if ($duplicateFirst && $level == 1) {
             $subitems[] = $returnarray;
             $subitems[] = BsHtml::menuDivider();
         }
         foreach ($this->children as $child) {
             $subitems[] = $child->getMenuList($level + 1);
         }
     }
     if ($subitems !== array()) {
         $returnarray['items'] = $subitems;
     }
     if ($subitems !== array() && $level == 1) {
         array_unshift($subitems, $returnarray);
     }
     return $returnarray;
 }
예제 #3
0
<?php

/* @var $this Controller */
$this->beginContent('//layouts/main');
$this->widget('bootstrap.widgets.BsNavbar', array('collapse' => true, 'position' => BsHtml::NAVBAR_POSITION_FIXED_TOP, 'brandLabel' => BsHtml::icon(BsHtml::GLYPHICON_HOME), 'brandUrl' => Yii::app()->homeUrl, 'items' => array(array('class' => 'bootstrap.widgets.BsNav', 'type' => 'navbar', 'activateParents' => true, 'items' => array(array('label' => __('Calendar'), 'url' => array('/calendar'), 'visible' => false), array('label' => __('Organizations'), 'url' => array('/organization')), array('label' => __('Periods'), 'url' => array('/period')), array('label' => __('Tasks'), 'url' => array('/task')), array('label' => __('Users'), 'url' => array('/user')), array('label' => __('Groups'), 'url' => array('/group')), array('label' => __('Reports'), 'url' => array('/reports')))), !Yii::app()->user->isGuest ? array('class' => 'bootstrap.widgets.BsNav', 'type' => 'navbar', 'activateParents' => true, 'items' => array(array('label' => 'Notifications', 'url' => array('notification'), 'icon' => 'glyphicons fa fa-bell'), array('label' => Yii::app()->user->name, 'url' => array('/site/user'), 'items' => array(array('label' => 'Preferences', 'url' => array('/site/user'), 'icon' => BsHtml::GLYPHICON_USER), BsHtml::menuDivider(), array('label' => 'Logout', 'icon' => BsHtml::GLYPHICON_LOG_OUT, 'url' => array('/site/logout'))))), 'htmlOptions' => array('pull' => BsHtml::NAVBAR_NAV_PULL_RIGHT)) : array('class' => 'bootstrap.widgets.BsNav', 'type' => 'navbar', 'activateParents' => true, 'items' => array(array('label' => 'Login', 'url' => array('/site/login'))), 'htmlOptions' => array('pull' => BsHtml::NAVBAR_NAV_PULL_RIGHT)))));
?>

    <div class="container" id="page">
        <?php 
if ($flashMessages = Yii::app()->user->getFlashes()) {
    ?>
            <?php 
    foreach ($flashMessages as $key => $message) {
        ?>
                <div class="alert alert-<?php 
        echo $key;
        ?>
 alert-dismissable">
                    <button class="close" type="button" data-dismiss="alert" aria-hidden="true">&times;</button>
                    <?php 
        echo $message;
        ?>
                </div>
            <?php 
    }
    ?>
        <?php 
}
?>

        <?php 
예제 #4
0
echo CHtml::encode($this->pageTitle);
?>
</title>
</head>
<body>
<div class="container">
<?php 
$this->Widget('ext.toastr.ToastrWidget', array('options' => array("positionClass" => "toast-top-left")));
if (!Yii::app()->user->isGuest) {
    if (Yii::app()->user->name == "admins") {
        $ocultar = null;
    } else {
        $ocultar = "display:none";
    }
} else {
    $ocultar = "display:none";
}
$this->widget('bootstrap.widgets.BsNavbar', array('collapse' => true, 'brandLabel' => BsHtml::icon(BsHtml::GLYPHICON_FIRE) . BsHtml::bold(' WorkShop') . BsHtml::small(' Qualitatcorp'), 'brandUrl' => Yii::app()->homeUrl, 'items' => array(array('class' => 'bootstrap.widgets.BsNav', 'type' => 'navbar', 'activateParents' => true, 'items' => array(array('label' => 'Usuario', 'visible' => in_array(Yii::app()->user->name, array('admins')), 'items' => array(BsHtml::menuHeader(BsHtml::italics('Usuarios', $htmlOptions = array('style' => 'text-decoration: underline;'))), array('label' => 'Administar Usuarios', 'url' => array('usuario/admin')), array('label' => 'Crear Usuario', 'url' => array('usuario/create')), array('label' => 'Registros de ingreso', 'url' => array('usuario/records')))), array('label' => 'Empresa', 'visible' => in_array(Yii::app()->user->name, array('admins')), 'items' => array(BsHtml::menuHeader(BsHtml::italics('Empresa', $htmlOptions = array('style' => 'text-decoration: underline;'))), array('label' => 'Administrar Empresas', 'url' => array('empresa/admin')), array('label' => 'Crear Empresa', 'url' => array('empresa/create')), BsHtml::menuDivider(), BsHtml::menuHeader(BsHtml::italics('Área Operativa', $htmlOptions = array('style' => 'text-decoration: underline;'))), array('label' => 'Administrar área Operativa', 'url' => array('empresa/areaoperativa')), array('label' => 'Crear área operativa', 'url' => array('empresa/createAO')), BsHtml::menuDivider(), BsHtml::menuHeader(BsHtml::italics('Tipo de Empresa', $htmlOptions = array('style' => 'text-decoration: underline;'))), array('label' => 'Tipo Empresa', 'url' => array('empresa/tipoempresa')), array('label' => 'Crear Empresa', 'url' => array('empresa/createTE')))), array('label' => 'Teléfono', 'visible' => in_array(Yii::app()->user->name, array('admins')), 'items' => array(BsHtml::menuHeader(BsHtml::italics('Teléfono', $htmlOptions = array('style' => 'text-decoration: underline;'))), array('label' => 'Administrar Teléfonos', 'url' => array('telefono/admin')), array('label' => 'Crear Teléfono', 'url' => array('telefono/create')), BsHtml::menuDivider(), BsHtml::menuHeader(BsHtml::italics('Licencias de uso', $htmlOptions = array('style' => 'text-decoration: underline;'))), array('label' => 'Administrar Licencias', 'url' => array('telefono/licencia')), array('label' => 'Recargar licencia', 'url' => array('telefono/createLI')), array('label' => 'Listado Recargas', 'url' => array('telefono/recargas')))), array('label' => 'Pregunta', 'visible' => in_array(Yii::app()->user->name, array('admins')), 'items' => array(BsHtml::menuHeader(BsHtml::italics('Preguntas', $htmlOptions = array('style' => 'font-size:110%;text-decoration: underline;'))), array('label' => 'Administrar Preguntas', 'url' => array('pregunta/admin')), array('label' => 'Registrar Preguntas', 'url' => array('pregunta/create')), BsHtml::menuDivider(), BsHtml::menuHeader(BsHtml::italics('Tipo de Preguntas', $htmlOptions = array('style' => 'font-size:110%;text-decoration: underline;'))), array('label' => 'Administrar Tipos de Preguntas', 'url' => array('//tipopregunta/admin')), array('label' => 'Registrar Tipo de Pregunta', 'url' => array('//tipopregunta/create')))), array('label' => 'Evaluaciones', 'items' => array(BsHtml::menuHeader(BsHtml::italics('Evaluaciones', $htmlOptions = array('style' => 'font-size:110%;text-decoration: underline;'))), array('label' => 'Administrar Evaluaciones', 'url' => array('evaluacion/admin')), BsHtml::menuDivider($htmlOptions = array('style' => $ocultar)), BsHtml::menuHeader(BsHtml::italics('Tipo de Evaluaciones', $htmlOptions = array('style' => 'font-size:110%;text-decoration: underline;' . $ocultar))), array('label' => 'Administrar tipo Evaluaciones', 'url' => array('tipoevaluacion/admin'), 'visible' => in_array(Yii::app()->user->name, array('admins'))), array('label' => 'Registrar tipo Evaluación', 'url' => array('tipoevaluacion/create'), 'visible' => in_array(Yii::app()->user->name, array('admins'))))))), array('class' => 'bootstrap.widgets.BsNav', 'type' => 'navbar', 'activateParents' => true, 'items' => array(array('label' => 'Cerrar Sesion', 'pull' => BsHtml::NAVBAR_NAV_PULL_RIGHT, 'url' => array('/Usuario/logout'), 'visible' => !Yii::app()->user->isGuest)), 'htmlOptions' => array('pull' => BsHtml::NAVBAR_NAV_PULL_RIGHT)))));
?>
		 <?php 
// breadcrumbs
$this->widget('bootstrap.widgets.BsBreadCrumb', array('links' => $this->breadcrumbs, 'tagName' => 'ul', 'activeLinkTemplate' => '<li><a href="{url}">{label}</a></li>', 'inactiveLinkTemplate' => '<li>{label}</li>', 'homeLink' => BsHtml::openTag('li') . BsHtml::icon(BsHtml::GLYPHICON_HOME) . BsHtml::closeTag('li')));
?>
<div class="content">
	<?php 
echo $content;
?>
</div>
</div>
</body>
</html>