/** * Edits or adds a Procedure. * * @param bool|int $id * * @throws CHttpException */ public function actionEdit($id = false) { $admin = new Admin(OEModule\OphCiExamination\models\OphCiExamination_Attribute::model(), $this); $admin->setCustomSaveURL('/oeadmin/ExaminationElementAttributes/update'); if ($id) { $admin->setModelId($id); } $admin->setModelDisplayName('Element Attributes'); $admin->setEditFields(array('id' => 'label', 'name' => 'text', 'label' => 'text', 'attribute_elements' => array('widget' => 'DropDownList', 'options' => CHtml::listData(ElementType::model()->findAll(), 'id', 'name'), 'htmlOptions' => null, 'hidden' => false, 'layoutColumns' => null))); $admin->editModel(); }
/** * Init the edit admin page, because we have a custom save URL, so we need to use * Admin in more then 1 function. * * @param bool $id * * @return Admin */ protected function initAdmin($id = false) { $admin = new Admin(DrugSet::model(), $this); if ($id) { $admin->setModelId($id); } $element = Element_OphDrPrescription_Details::model(); $admin->setCustomSaveURL('/OphDrPrescription/DrugSetAdmin/SaveDrugSet'); $admin->setCustomCancelURL('/OphDrPrescription/DrugSetAdmin/DrugSets'); $admin->setEditFields(array('active' => 'checkbox', 'name' => 'text', 'subspecialty' => array('widget' => 'DropDownList', 'options' => CHtml::listData(Subspecialty::model()->findAll(), 'id', 'name'), 'htmlOptions' => null, 'hidden' => false, 'layoutColumns' => null), 'setItems' => array('widget' => 'CustomView', 'viewName' => '/default/form_Element_OphDrPrescription_Details', 'viewArguments' => array('element' => $element)))); return $admin; }