/** * Handle module install event "installer.module.installed". * Receives $modinfo as $args * * @param Zikula_Event $event * * @return void */ public static function moduleInstall(Zikula_Event $event) { $mod = $event['name']; // determine search capability if (ModUtil::apiFunc($mod, 'search', 'info')) { // get all search blocks $blocks = BlockUtil::getBlocksInfo(); foreach ($blocks as $block) { $block = $block->toArray(); if ($block['bkey'] != 'Search') { continue; } $content = BlockUtil::varsFromContent($block['content']); if (!isset($content['active'])) { $content['active'] = array(); } $content['active'][$mod] = 1; $block['content'] = BlockUtil::varsToContent($content); ModUtil::apiFunc('Blocks', 'admin', 'update', $block); } } }
function startEditing() { $blocksInfo = BlockUtil::getBlocksInfo(); $blockoptions = array(); // add first empty choice $blockoptions[] = array('text' => __('- Make a choice -'), 'value' => '0'); foreach ($blocksInfo as $block) { $blockoptions[] = array('text' => $block['bid'] . ' - ' . $block['title'] . ' (' . ($block['active']?__('Active'):__('InActive')) . ')', 'value' => $block['bid']); } $this->view->assign('blockoptions', $blockoptions); }
/** * Get list of menus with type supported to import */ private function _get_current_menus($bid) { $supported = array('Menu', 'Extmenu', 'Menutree'); $_menus = BlockUtil::getBlocksInfo(); $menus = array(); foreach ($_menus as $menu) { if (in_array($menu['bkey'],$supported) && $menu['bid'] != $bid) { $menus[$menu['bid']] = $menu['title']; } } return $menus; }
/** * get block information * * @deprecated * @see BlockUtil::getBlocksInfo() * * @param value the value to search for * @param assocKey the field in which we look for the value (optional) (default='bid') * @return array array of block information */ function pnBlocksGetInfo() { LogUtil::log(__f('Warning! Function %1$s is deprecated. Please use %2$s instead.', array(__FUNCTION__, 'BlockUtil::getBlocksInfo()')), E_USER_DEPRECATED); return BlockUtil::getBlocksInfo(); }