Пример #1
0
 protected function moduleYmaps($data)
 {
     /*$mpage_id = ModulesInPages::model()->getLink(40,'list3');
     		$data['debit_cards'] = ModuleList3::model()->getList($mpage_id,0,0,1);
     		$mpage_id = ModulesInPages::model()->getLink(41,'list3');
     		$data['credit_cards'] = ModuleList3::model()->getList($mpage_id,0,0,1);*/
     $pages = $data['pages'];
     $mpage_id = ModulesInPages::model()->getLink($data['doc_id_last'], 'ymaps');
     $data['list'] = ModuleYmapsCategories::model()->getList($mpage_id, 0, 0, 1, true);
     $this->render('ymaps', $data);
 }
Пример #2
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 = ModuleYmapsCategories::model()->getList($mpage_id);
if (count($data) > 0) {
    ?>
			<h3>Категории</h3>
			<ul class="type_1">
				<?php 
    foreach ($data as $item_id => $item) {
        ?>
					<li data-id="<?php 
        echo $item->id;
        ?>
" class="link ids">
						<?php 
        if ($role_id < 2) {
            ?>
							<div class="act_block">
Пример #3
0
 public function deleteItem($link_id, $category_id, $id)
 {
     $result = false;
     if (!is_null($id) && ModuleYmapsCategories::model()->existsItem($link_id, $category_id) && $this->existsItem($category_id, $id)) {
         if ($this->findByPk($id)->delete()) {
             $result = true;
         }
     }
     return $result;
 }
Пример #4
0
 /**
  * Деактивация модуля
  * @param integer $page_id ID страницы
  */
 public function actionDeactivation($page_id = 0)
 {
     $page_id = (int) $page_id;
     $result = false;
     // доступно для пользователей первой роли (например, «Реактиву»)
     $role_id = Users::model()->findByPk(Yii::app()->user->id)->role_id;
     if ($role_id < 2 && $page_id > 0 && Pages::model()->existsPage($page_id)) {
         $link_id = ModulesInPages::model()->getLink($page_id, $this->module->id);
         if ($link_id) {
             $result = ModuleYmapsCategories::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');
     }
 }