/** * @param $rowField * @return array */ public static function setGoogleMap($rowField) { $template = DiverseFunction::parseTemplateName($rowField['mapTemplate']); $zoom = $rowField['mapZoom'] ? $rowField['mapZoom'] : 15; $scrollWheel = $rowField['mapScrollWheel'] ? 'true' : 'false'; $mapType = $rowField['mapType'] ? $rowField['mapType'] : 'ROADMAP'; $styles = $rowField['mapStyle'] ? $rowField['mapStyle'] : ''; $mapSettings = array('fieldID' => $rowField['fieldID'], 'title' => mb_convert_encoding($rowField['title'], 'UTF-8'), 'description' => mb_convert_encoding($rowField['description'], 'UTF-8'), 'template' => $template, 'mapScrollWheel' => $scrollWheel, 'mapZoom' => $zoom, 'mapType' => $mapType, 'mapStyle' => $styles, 'mapMarker' => $rowField['mapMarker'], 'mapInfoBox' => $rowField['mapInfoBox']); return $mapSettings; }
/** * @param $templateName * @return mixed */ public function parseTemplateName($templateName) { return DiverseFunction::parseTemplateName($templateName); }
/** * @param $field * @return array */ private function findWidgetAndSet($field) { // get widget $widget = array(); // widget if ($field['type'] == 'widget') { $tplName = $field['widgetTemplate']; $tpl = ''; if (!$tplName) { $tplNameType = explode('.', $field['widget_type'])[0]; $tplNameArr = $this->getTemplateGroup('fm_field_' . $tplNameType); $tpl = current($tplNameArr); $tpl = DiverseFunction::parseTemplateName($tpl); } $widget['fieldID'] = $field['fieldID']; $widget['widgetType'] = $field['widget_type']; $widget['widgetTemplate'] = $field['widgetTemplate'] ? $field['widgetTemplate'] : $tpl; } return $widget; }