function __DSGetInitData() { $map = new \Bitrix\MobileApp\Designer\ConfigMap(); $params = $map->getParamsByGroups(); $groups = array_keys($params); $tmpLangs = array_change_key_case($map->getLangMessages(), CASE_LOWER); $langs = array(); foreach ($tmpLangs as $k => $v) { $langs[str_replace("_", "/", $k)] = $v; } $result = \Bitrix\Mobileapp\Designer\AppTable::getList(array("select" => array("CODE", "FOLDER", "DESCRIPTION", "SHORT_NAME", "NAME", "CONFIG.PLATFORM", "CONFIG.PARAMS"))); $fetchedApps = $result->fetchAll(); $apps = array(); $count = count($fetchedApps); for ($i = 0; $i < $count; $i++) { $apps[] = array("code" => $fetchedApps[$i]["CODE"], "name" => $fetchedApps[$i]["NAME"], "folder" => $fetchedApps[$i]["FOLDER"], "desc" => $fetchedApps[$i]["DESCRIPTION"], "params" => $fetchedApps[$i]["MOBILEAPP_DESIGNER_APP_CONFIG_PARAMS"], "platform" => $fetchedApps[$i]["MOBILEAPP_DESIGNER_APP_CONFIG_PLATFORM"]); } $dbres = \CSiteTemplate::GetList(); $templates = array(); while ($t = $dbres->Fetch()) { $templates[] = $t; } $data = array("map" => array("groups" => $groups, "groupedParams" => $params, "params" => $map->getDescriptionConfig(), "lang" => $tmpLangs), "apps" => $apps, "templates" => $templates); return $data; }
/** * Return files of the application * @param $appCode - application code * @return array */ public static function getAppFiles($appCode) { $result = AppTable::getById($appCode); $appData = $result->fetchAll(); $files = array(); if (count($appData) > 0) { //TODO fix, use module_id in the filter $result = \CFile::GetList(array("ID" => "desc"), array("@ID" => implode(",", $appData[0]["FILES"]))); while ($file = $result->Fetch()) { $image = \CFile::ResizeImageGet($file["ID"], array("width" => self::PREVIEW_IMAGE_SIZE, "height" => self::PREVIEW_IMAGE_SIZE), BX_RESIZE_IMAGE_EXACT, false, false, true); $files["file_" . $file["ID"]] = array("id" => $file["ID"], "src" => \CFile::GetFileSRC($file), "preview" => $image["src"]); } } return $files; }
public static function getSupportedPlatforms() { $platforms = AppTable::getSupportedPlatforms(); $platforms[] = "global"; return $platforms; }