Ejemplo n.º 1
0
 /**
  *
  * {@inheritDoc}
  * @see \yii\base\BootstrapInterface::bootstrap()
  */
 public function bootstrap($app)
 {
     $findProperty = Property::findOne(['class_name' => GroupAuthProperty::className()]);
     if ($findProperty) {
         Yii::$app->menu->on(Menu::MENU_ITEM_EVENT, [$this, 'hideElements'], CmsProperty::findAll(['admin_prop_id' => $findProperty->id]));
     }
 }
Ejemplo n.º 2
0
 public function actionGetProperties($navId)
 {
     $data = [];
     foreach (Property::find()->select(['admin_prop_id', 'value'])->where(['nav_id' => $navId])->asArray()->all() as $row) {
         $object = \luya\admin\models\Property::findOne($row['admin_prop_id']);
         $blockObject = $object->createObject($row['value']);
         $value = $blockObject->getAdminValue();
         $row['value'] = is_numeric($value) ? (int) $value : $value;
         $data[] = $row;
     }
     return $data;
 }