Ejemplo n.º 1
0
 public function deactivation($page_id = null)
 {
     $result = false;
     // доступно дл¤ пользователей первой роли (например, Ђ–еактивуї)
     $role_id = Users::model()->findByPk(Yii::app()->user->id)->role_id;
     if ($role_id < 2 && !is_null($page_id) && Pages::model()->existsPage($page_id)) {
         $link_id = ModulesInPages::model()->getLink($page_id, $this->id);
         if ($link_id) {
             $result = ModuleFields::model()->deactivation($link_id, $this->id);
         }
     }
     return $result;
 }
Ejemplo n.º 2
0
 public function actionDeactivation($page_id = null)
 {
     $result = false;
     // доступно для пользователей первой роли (например, «Реактиву»)
     $role_id = Users::model()->findByPk(Yii::app()->user->id)->role_id;
     if ($role_id < 2 && !is_null($page_id) && Pages::model()->existsPage($page_id)) {
         $link_id = ModulesInPages::model()->getLink($page_id, $this->module->id);
         if ($link_id) {
             $result = ModuleFields::model()->deactivation($link_id, $this->module->id);
         }
     }
     if ($result) {
         $this->redirect(Yii::app()->baseUrl . '?r=pages/update&id=' . $page_id . '&/#!/tab_fourth');
     } else {
         $this->redirect(Yii::app()->request->baseUrl . '/admin.php');
     }
 }
Ejemplo n.º 3
0
 public function actionError()
 {
     header("HTTP/1.1 404 Not Found");
     $pages = new Pages();
     $data = [];
     // $pages->getTreePages(NULL,&$data['tree']);
     $data['tree'] = $pages->getTreePages2(true);
     $data['title'] = 'Страница не найдена';
     $data['pages'] = $pages;
     $data['additional_main_data'] = ModuleFields::model()->getValueListByPageId(1);
     // $this->redirect('/');
     $this->render('404', $data);
 }
Ejemplo n.º 4
0
    if (Yii::app()->user->hasFlash($this->module->id . '_add_message')) {
        echo Yii::app()->user->getFlash($this->module->id . '_add_message');
    }
    ?>
		<?php 
    $this->endWidget();
    ?>
		</div>
	</div>
	<?php 
}
?>
	<div class="catalog">
		<?php 
$mpage_id = ModulesInPages::model()->getLink($page_id, $this->module->id);
$data = ModuleFields::model()->getList($mpage_id);
if (count($data) > 0) {
    ?>
			<form method="POST" action="/admin.php?r=pages/update&id=<?php 
    echo $page_id;
    ?>
&/#!/tab_<?php 
    echo $this->module->id;
    ?>
">
				<ul class="<?php 
    echo count($data) > 1 && $role_id < 2 ? 'sortable' : '';
    ?>
 type_2">
				<?php 
    foreach ($data as $item_id => $item) {
Ejemplo n.º 5
0
			<?php 
$aside_fixed_class = 'aside-fixed';
include 'inc/aside.php';
?>
			<?php 
$cards_code = array(40 => 'debit', 41 => 'credit', 110 => 'storage', 111 => 'pension', 112 => 'salary');
$debit_doc_id = 40;
$credit_doc_id = 41;
$storage_doc_id = 110;
$pension_doc_id = 111;
$salary_doc_id = 112;
$fields_data_1 = ModuleFields::model()->getValueListByPageId($debit_doc_id);
$fields_data_2 = ModuleFields::model()->getValueListByPageId($credit_doc_id);
$fields_data_3 = ModuleFields::model()->getValueListByPageId($storage_doc_id);
$fields_data_4 = ModuleFields::model()->getValueListByPageId($pension_doc_id);
$fields_data_5 = ModuleFields::model()->getValueListByPageId($salary_doc_id);
$criteria = new CDbCriteria();
$criteria->order = 'sort ASC';
$criteria->condition = 'active > 0 AND id IN (40,41,110,111,112)';
$cards_list = Pages::model()->findAll($criteria);
foreach ($cards_list as $v) {
    $cards_data[$v->id] = array('page' => $v->getAttributes(), 'nav' => '<li><a href="#' . $cards_code[$v->id] . 'cards" class="onPage" data-cardtype="doc_' . $v->id . '">' . $v->name . '</a></li>');
}
?>
			<div class="page-content fixed-aside">
				<div class="pad-content">
					<?php 
echo $pages->set_url($content);
?>
					<nav class="section-navigator js-navigator">
						<ul>