public static function menus($dom_id = 'MenusContainer') { $modules = ModuleRegistry::modules(); $html = $js = array(); $i = count($modules); foreach ($modules as $module) { $model = $module::model(); if (isset($model->components->cards)) { if (in_array('menu', get_class_methods($model->components->cards))) { $i--; $card = ModuleCard::render($module::$registry_key, 'menu'); $html[] = CardKitHTML::menuCardHidingContainer($card->html, $i); $js[] = $card->js; } } } return DOMElementKitJS::addIntoDom($dom_id, implode('', $html), 'replace') . implode(' ', $js); }