public function getAdditionalFields($data) { $this->setResponseType('json'); $result = new stdclass(); $result->status = 'OK'; try { $dashlet = new Dashlet(); $dashletFields = $dashlet->load($data->DAS_UID); if (!is_null($dashletFields)) { $result->additionalFields = PMDashlet::getAdditionalFields($dashletFields['DAS_CLASS']); } else { throw new Exception('Dashlet "' . $data->DAS_UID . '" does not exist.'); } } catch (Exception $error) { $result->status = 'ERROR'; $result->message = $error->getMessage(); } return $result; }
public function loadDashletInstance($dasInsUid) { try { $dashletInstance = $this->load($dasInsUid); //Load data from the serialized field $dashlet = new Dashlet(); $dashletFields = $dashlet->load($dashletInstance['DAS_UID']); if (is_null($dashletFields)) { $dashletFields = array(); } return array_merge($dashletFields, $dashletInstance); } catch (Exception $error) { throw $error; } }