146 static $manifest = array();
148 if (!isset($manifest[$id]))
150 $manifest[$id] = array();
151 if (($block = self::getById($id)->fetch()))
153 $manifestLocal = unserialize($block[
'MANIFEST'], [
'allowed_classes' =>
false]);
154 if (!is_array($manifestLocal))
156 $manifestLocal = array();
159 isset($manifestLocal[
'block']) &&
160 is_array($manifestLocal[
'block'])
163 $blockDesc = $manifestLocal[
'block'];
165 $manifestLocal[
'block'] = array(
166 'name' => $block[
'NAME'],
167 'description' => $block[
'DESCRIPTION'],
168 'namespace' => $block[
'APP_CODE'],
169 'section' => explode(
',', $block[
'SECTIONS']),
170 'preview' => $block[
'PREVIEW'],
171 'restricted' =>
true,
172 'repo_id' => $block[
'ID'],
173 'xml_id' => $block[
'XML_ID'],
174 'app_code' => $block[
'APP_CODE']
176 if (isset($blockDesc[
'subtype']))
178 $manifestLocal[
'block'][
'subtype'] = $blockDesc[
'subtype'];
180 $manifest[$id] = $manifestLocal;
181 $manifest[$id][
'timestamp'] = $block[
'DATE_MODIFY']->getTimeStamp();
185 return $manifest[$id];
238 $isArray = is_array($id);
243 $id = array_fill_keys($id,
false);
253 'ID' => array_keys($id)
256 while ($row = $res->fetch())
258 if ($row[
'APP_CODE'])
260 $id[$row[
'ID']] = $row[
'APP_CODE'];
264 $apps = self::getAppByCode($id);
266 foreach ($id as &$code)
268 if ($code && isset($apps[$code]))
270 $code = $apps[$code];
282 return $isArray ? $id : array_pop($id);