<?php /*

 Composr
 Copyright (c) Christopher Graham, 2004-2024

 See docs/LICENSE.md for full licensing information.


 NOTE TO PROGRAMMERS:
   Do not edit this file. If you need to make changes, save your changed file to the appropriate *_custom folder
   **** If you ignore this advice, then your website upgrades (e.g. for bug fixes) will likely kill your changes ****

*/

/**
 * @license    http://opensource.org/licenses/cpal_1.0 Common Public Attribution License
 * @copyright  Christopher Graham
 * @package    tickets
 */

/**
 * Hook class.
 */
class Hook_page_groupings_tickets
{
    /**
     * Run function for do_next_menu hooks. They find links to put on standard navigation menus of the system.
     *
     * @param  ?MEMBER $member_id Member ID to run as (null: current member)
     * @param  boolean $extensive_docs Whether to use extensive documentation tooltips, rather than short summaries
     * @return array List of tuple of links (page grouping, icon, do-next-style linking data), label, help (optional) and/or nulls
     */
    public function run(?int $member_id = null, bool $extensive_docs = false) : array
    {
        if (!addon_installed('tickets')) {
            return [];
        }

        return [
            ['setup', 'menu/site_meta/tickets', ['admin_tickets', ['type' => 'browse'], get_module_zone('admin_tickets')], do_lang_tempcode('tickets:SUPPORT_TICKETS'), 'tickets:DOC_TICKETS'],
            ['tools', 'menu/site_meta/tickets', ['admin_tickets', ['type' => 'email'], get_module_zone('admin_tickets')], do_lang_tempcode('tickets:ADD_TICKET_EMAIL'), 'tickets:DOC_TICKETS'],
            ['site_meta', 'menu/site_meta/tickets', ['tickets', [], get_module_zone('tickets')], do_lang_tempcode('tickets:SUPPORT_TICKETS')],
        ];
    }
}
