Пример #1
0
 /**
  * Create a custom dropdown
  *
  * This method allows the admin to create a custom dropdown to be used with
  * a module in conjunction with the form editor.
  */
 public function actionDropDownEditor()
 {
     $model = new Dropdowns();
     if (isset($_POST['Dropdowns'])) {
         $model->attributes = $_POST['Dropdowns'];
         $temp = array();
         if (isset($model->options)) {
             foreach ($model->options as $option) {
                 if ($option != "") {
                     $temp[$option] = $option;
                 }
             }
         }
         if (count($temp) > 0) {
             $model->options = json_encode($temp);
             if ($model->save()) {
             }
         }
         $this->redirect('manageDropDowns');
     }
 }