本文整理汇总了PHP中Menu::addToGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP Menu::addToGroup方法的具体用法?PHP Menu::addToGroup怎么用?PHP Menu::addToGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu::addToGroup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: invoicing_handle_on_build_menu
/**
* Add options to main menu
*
* @param Menu $menu
* @param User $user
* @return null
*/
function invoicing_handle_on_build_menu(&$menu, &$user)
{
$company = $user->getCompany();
if ($user->getSystemPermission('can_manage_invoices')) {
$menu->addToGroup(array(new MenuItem('invoicing', lang('Invoices'), assemble_url('invoices'), get_image_url('menu-icon.gif', INVOICING_MODULE), Invoices::countOverdue())), 'main');
} else {
if ($user->isCompanyManager($company)) {
$menu->addToGroup(array(new MenuItem('invoicing', lang('Invoices'), assemble_url('people_company_invoices', array('company_id' => $user->getCompanyId())), get_image_url('menu-icon.gif', INVOICING_MODULE), Invoices::countByCompany($user->getCompany(), array(INVOICE_STATUS_ISSUED)))), 'main');
}
}
// if
}
示例2: incoming_mail_handle_on_build_menu
/**
* Build menu
*
* @param Menu $menu
* @param User $user
* @return array
*/
function incoming_mail_handle_on_build_menu(&$menu, &$user)
{
if (($user->isAdministrator() || $user->getSystemPermission('can_use_incoming_mail_frontend')) && ($count_pending = IncomingMails::countPending()) > 0) {
$menu->addToGroup(array(new MenuItem('incoming_mail', lang('Inbox'), assemble_url('incoming_mail'), get_image_url('icon_menu.gif', INCOMING_MAIL_MODULE), $count_pending)), 'main');
}
// if
}
示例3: timetracking_handle_on_build_menu
/**
* Add options to main menu
*
* @param Menu $menu
* @param User $user
* @return null
*/
function timetracking_handle_on_build_menu(&$menu, &$user)
{
if ($user->isAdministrator() || $user->getSystemPermission('use_time_reports')) {
$menu->addToGroup(array(new MenuItem('time', lang('Time'), 'https://www.healingcrystals.com/admin/timeSheets.php', get_image_url('navigation/time.gif'))), 'main');
}
// if
}
示例4: documents_handle_on_build_menu
/**
* Build menu
*
* @param Menu $menu
* @param User $user
* @return array
*/
function documents_handle_on_build_menu(&$menu, &$user)
{
if ($user->isAdministrator() || $user->getSystemPermission('can_use_documents')) {
$menu->addToGroup(array(new MenuItem('documents', lang('Docs'), assemble_url('documents'), get_image_url('icon.gif', DOCUMENTS_MODULE))), 'main');
}
// if
}
示例5: status_handle_on_build_menu
/**
* Build menu
*
* @param Menu $menu
* @param User $user
* @return array
*/
function status_handle_on_build_menu(&$menu, &$user)
{
if ($user->isAdministrator() || $user->getSystemPermission('can_use_status_updates')) {
$last_visit = UserConfigOptions::getValue('status_update_last_visited', $user);
$menu->addToGroup(array(new MenuItem('status', lang('Status'), assemble_url('status_updates'), get_image_url('icon_menu.gif', STATUS_MODULE), StatusUpdates::countNewMessagesForUser($user, $last_visit))), 'main');
}
// if
}