/**
* Edits or adds medications
*
* @param bool|int $id
* @throws CHttpException
*/
public function actionEdit($id = false)
{
$admin = new Admin(MedicationDrug::model(), $this);
if ($id) {
$admin->setModelId($id);
}
$admin->setEditFields(array('name' => 'text', 'aliases' => 'text', 'external_source' => array('widget' => 'DropDownList', 'options' => CHtml::listData(MedicationDrug::model()->findAll(new CDbCriteria(array('group' => 'external_source'))), 'external_source', 'external_source'), 'htmlOptions' => null, 'hidden' => false, 'layoutColumns' => null), 'external_code' => 'text'));
$admin->editModel();
}