public function newJsonAction() { //TODO: need to add code to control the usergroup selection $userGroup = 0; $userGroupDAO = new RM_UserConfig(); $fields = $userGroupDAO->getFields($userGroup); foreach ($fields as $field) { $jsonFields[] = $field->view_preferences; } /* data returned to the dispatcher is returned as an array. * the element data represents the data * the element encoded represents if the data is already json encoded or not (true=encoded) */ return array("data" => "{fields : [" . implode(',', $jsonFields) . "]}", "encoded" => true); }
/** * @param int $groupID * @return Zend_Db_Table_Rowset */ protected function _getFieldsByGroup($groupID) { $configModel = new RM_UserConfig(); $fields = $configModel->getFields($groupID); return $fields; }