Set the selected flag
public setSelected ( boolean $state = true ) : void | ||
$state | boolean | Selected state (default is true) |
리턴 | void |
/** * Add a menu item to the user ownerblock */ function markdown_wiki_owner_block_menu($hook, $type, $return, $params) { if (elgg_instanceof($params['entity'], 'user')) { $url = "wiki/owner/{$params['entity']->username}"; $item = new ElggMenuItem('markdown_wiki', elgg_echo('markdown_wiki'), $url); $return[] = $item; } else { if ($params['entity']->markdown_wiki_enable != "no") { if ($params['entity']->markdown_wiki_all_enabled == 'on') { $url = "/wiki/group/{$params['entity']->guid}/all"; } else { $url = "wiki/group/{$params['entity']->guid}/page/" . elgg_echo('markdown_wiki:home'); } $item = new ElggMenuItem('markdown_wiki', elgg_echo('markdown_wiki:group'), $url); if (elgg_in_context('wiki')) { $item->setSelected(); } $return[] = $item; } } return $return; }