Esempio n. 1
0
 /**
  * @return bool
  */
 public function isVisible()
 {
     if (!parent::isVisible()) {
         return false;
     }
     if (!Validate::validate(new HasBehaviorsOr([TimestampBehavior::className(), TimestampPublishedBehavior::className(), BlameableBehavior::className()]), $this->controller->model)->isValid()) {
         return false;
     }
     return $this->checkAdvancedAccess();
 }
Esempio n. 2
0
 /**
  * @return array
  */
 public function behaviors()
 {
     return array_merge(parent::behaviors(), [TimestampPublishedBehavior::className() => TimestampPublishedBehavior::className(), HasStorageFile::className() => ['class' => HasStorageFile::className(), 'fields' => ['image_id', 'image_full_id']], HasStorageFileMulti::className() => ['class' => HasStorageFileMulti::className(), 'relations' => ['images', 'files']], HasRelatedProperties::className() => ['class' => HasRelatedProperties::className(), 'relatedElementPropertyClassName' => CmsContentElementProperty::className(), 'relatedPropertyClassName' => CmsContentProperty::className()], HasTrees::className() => ['class' => HasTrees::className(), 'elementTreesClassName' => CmsContentElementTree::className()], SeoPageName::className() => ['class' => SeoPageName::className(), 'generatedAttribute' => 'code']]);
 }
Esempio n. 3
0
    ?>
    <?php 
    echo $form->field($model, 'created_at')->widget(\kartik\datecontrol\DateControl::classname(), ['type' => \kartik\datecontrol\DateControl::FORMAT_DATETIME]);
}
?>

<?php 
if ($model->hasAttribute('updated_at')) {
    ?>
    <?php 
    echo $form->field($model, 'updated_at')->widget(\kartik\datecontrol\DateControl::classname(), ['type' => \kartik\datecontrol\DateControl::FORMAT_DATETIME]);
}
?>

<?php 
if (Validate::validate(new HasBehavior(\skeeks\cms\models\behaviors\TimestampPublishedBehavior::className()), $model)->isValid()) {
    ?>
    <?php 
    echo $form->field($model, 'published_at')->widget(\kartik\datecontrol\DateControl::classname(), ['type' => \kartik\datecontrol\DateControl::FORMAT_DATETIME]);
}
?>

<?php 
if ($model->hasAttribute('published_to')) {
    ?>
    <?php 
    echo $form->field($model, 'published_to')->widget(\kartik\datecontrol\DateControl::classname(), ['type' => \kartik\datecontrol\DateControl::FORMAT_DATETIME]);
}
?>

<?php 
 /**
  * @return array
  */
 public function behaviors()
 {
     return array_merge(parent::behaviors(), [TimestampPublishedBehavior::className() => TimestampPublishedBehavior::className(), Serialize::className() => ['class' => Serialize::className(), 'fields' => ['data_server', 'data_session', 'data_cookie', 'data_request']]]);
 }
Esempio n. 5
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return array_merge(parent::behaviors(), [TimestampPublishedBehavior::className() => TimestampPublishedBehavior::className()]);
 }