Exemplo n.º 1
0
 /**
  * Updates an existing ModulesModules model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     $model = $this->findModel($id);
     if (Yii::$app->request->isAjax) {
         Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
         return ActiveForm::validate($model);
     }
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         Yii::$app->cache->flush();
         if (Yii::$app->request->post('submit-type') == 'continue') {
             return $this->redirect(['update', 'id' => $model->module_id]);
         } else {
             return $this->redirect(['index']);
         }
     } else {
         return $this->render('update', ['model' => $model]);
     }
 }
Exemplo n.º 2
0
echo $form->field($model, 'language')->textInput(['maxlength' => true]);
?>
    <?php 
echo $form->field($model, 'country')->textInput(['maxlength' => true]);
?>
    <?php 
echo $form->field($model, 'url')->textInput(['maxlength' => true]);
?>
    <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
    <?php 
echo $form->field($model, 'name_ascii')->textInput(['maxlength' => true]);
?>
    <?php 
echo $form->field($model, 'status')->widget(\oakcms\bootstrapswitch\Switcher::className());
?>

    <?php 
ActiveForm::end();
?>

</div>
<script>
    function sendFormReload(elm) {
        $(elm).append($("<input type='hidden' name='submit-type' value='continue'>"));
        $(elm).submit();
        return false;
    }
</script>
Exemplo n.º 3
0
?>
    <?php 
echo isset($parent) ? $form->field($model, 'parent')->dropDownList(ArrayHelper::map(ContentCategory::find()->andFilterWhere(['<>', 'id', $model->id])->all(), 'id', 'title'), ['prompt' => '']) : '';
?>

    <?php 
if ($settings['categoryThumb']['value']) {
    ?>

    <?php 
}
?>

    <?php 
echo $form->field($model, 'meta_title')->textInput();
?>
    <?php 
echo $form->field($model, 'meta_keywords')->textInput();
?>
    <?php 
echo $form->field($model, 'meta_description')->textInput();
\app\modules\admin\widgets\ActiveForm::end();
?>
<script>
    function sendFormReload(elm) {
        $(elm).append($("<input type='hidden' name='submit-type' value='continue'>"));
        $(elm).submit();
        return false;
    }
</script>