/**
  * @inheritdoc
  */
 protected function getDropDownList($id)
 {
     if (!isset($this->dropDownLists[$id])) {
         switch ($id) {
             case 'checkbox-drop-down-list':
                 $this->dropDownLists['checkbox-drop-down-list'] = Html::checkboxInputFilterDropDownList();
                 break;
             case 'supplier.name':
                 $this->dropDownLists['supplier.name'] = Html::findDropDownListData('kalibao\\common\\models\\supplier\\Supplier', ['id', 'name'], []);
                 break;
             default:
                 return [];
                 break;
         }
     }
     return $this->dropDownLists[$id];
 }
 /**
  * @inheritdoc
  */
 protected function getDropDownList($id)
 {
     if (!isset($this->dropDownLists[$id])) {
         switch ($id) {
             case 'language_group_i18n.title':
                 $this->dropDownLists['language_group_i18n.title'] = Html::findDropDownListData('kalibao\\common\\models\\languageGroup\\LanguageGroupI18n', ['language_group_id', 'title'], [['i18n_id' => Yii::$app->language]]);
                 break;
             case 'language_i18n.title':
                 $this->dropDownLists['language_i18n.title'] = Html::findDropDownListData('kalibao\\common\\models\\language\\LanguageI18n', ['language_id', 'title'], [['i18n_id' => Yii::$app->language]]);
                 break;
             case 'checkbox-drop-down-list':
                 $this->dropDownLists['checkbox-drop-down-list'] = Html::checkboxInputFilterDropDownList();
                 break;
             default:
                 return [];
                 break;
         }
     }
     return $this->dropDownLists[$id];
 }
Exemplo n.º 3
0
 /**
  * @inheritdoc
  */
 protected function getDropDownList($id)
 {
     if (!isset($this->dropDownLists[$id])) {
         switch ($id) {
             case 'mail_template.id':
                 $this->dropDownLists['mail_template.id'] = Html::findDropDownListData('kalibao\\common\\models\\mailTemplate\\MailTemplate', ['id', 'id'], []);
                 break;
             case 'mail_send_role_i18n.title':
                 $this->dropDownLists['mail_send_role_i18n.title'] = Html::findDropDownListData('kalibao\\common\\models\\mailSendRole\\MailSendRoleI18n', ['mail_send_role_id', 'title'], [['i18n_id' => Yii::$app->language]]);
                 break;
             default:
                 return [];
                 break;
         }
     }
     return $this->dropDownLists[$id];
 }
Exemplo n.º 4
0
 /**
  * @inheritdoc
  */
 protected function getImageDropDown($id)
 {
     if (!isset($this->imageDropDowns[$id])) {
         switch ($id) {
             case 'media.file':
                 $names = Html::findDropDownListData('kalibao\\common\\models\\media\\MediaI18n', ['media_id', 'title'], [['i18n_id' => Yii::$app->language]]);
                 $files = Html::findDropDownListData('kalibao\\common\\models\\media\\Media', ['id', 'file'], []);
                 $data = [];
                 foreach ($names as $k => $v) {
                     $data[] = ['text' => $v, 'value' => $k, 'selected' => false, 'imageSrc' => $this->uploadConfig['kalibao\\common\\models\\media\\Media']['file']['baseUrl'] . '/' . $files[$k]];
                 }
                 var_export($data);
                 $this->imageDropDowns['media.file'] = json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT);
                 break;
             default:
                 return [];
                 break;
         }
     }
     return $this->imageDropDowns[$id];
 }
Exemplo n.º 5
0
 /**
  * @inheritdoc
  */
 protected function getDropDownList($id)
 {
     if (!isset($this->dropDownLists[$id])) {
         switch ($id) {
             case 'checkbox-drop-down-list':
                 $this->dropDownLists['checkbox-drop-down-list'] = Html::checkboxInputFilterDropDownList();
                 break;
             case 'google_shopping_category.id':
                 $this->dropDownLists['google_shopping_category.id'] = Html::findDropDownListData('kalibao\\common\\models\\googleShoppingCategory\\GoogleShoppingCategory', ['id', 'id'], []);
                 break;
             case 'affiliation_category.id':
                 $this->dropDownLists['affiliation_category.id'] = Html::findDropDownListData('kalibao\\common\\models\\affiliationCategory\\AffiliationCategory', ['id', 'id'], []);
                 break;
             default:
                 return [];
                 break;
         }
     }
     return $this->dropDownLists[$id];
 }