<?php
global $config;
if($config->edition != 'open' && $config->vision == 'rnd' && helper::hasFeature('devops'))
{
    $lang->navGroup->gitfox          = 'devops';
    $lang->navGroup->pullreq         = 'devops';
    $lang->navGroup->cluster         = 'devops';
    $lang->navGroup->publishtemplate = 'devops';
    $lang->navGroup->codescan        = 'devops';

    if(isset($lang->devops->homeMenu->apps)) $lang->devops->homeMenu->apps['subModule'] .= ',gitfox';

    $lang->devops->menu->pullreq = array('link' => "{$lang->pullreq->common}|pullreq|browse|repoID=%s", 'subModule' => 'pullreq');
    $lang->devops->menuOrder[38] = 'pullreq';

    $lang->scrum->menu->devops['subModule'] .= ',pullreq';
    $lang->scrum->menu->devops['subMenu']->pullreq = array('link' => "{$lang->pullreq->common}|pullreq|browse|repoID=0&mode=status&param=opened&objectID=%s", 'subModule' => 'pullreq');
    $lang->scrum->menu->devops['menuOrder'][23] = 'pullreq';

    $lang->waterfall->menu->devops['subModule'] .= ',pullreq';
    $lang->waterfall->menu->devops['subMenu']->pullreq = array('link' => "{$lang->pullreq->common}|pullreq|browse|repoID=0&mode=status&param=opened&objectID=%s", 'subModule' => 'pullreq');
    $lang->waterfall->menu->devops['menuOrder'][23] = 'pullreq';

    $lang->execution->menu->devops['subModule'] .= ',pullreq';
    $lang->execution->menu->devops['subMenu']->pullreq = array('link' => "{$lang->pullreq->common}|pullreq|browse|repoID=0&mode=status&param=opened&objectID=%s", 'subModule' => 'pullreq');
    $lang->execution->menu->devops['menuOrder'][23] = 'pullreq';

    $lang->project->noMultiple->scrum->menu->devops = $lang->scrum->menu->devops;

    //$lang->devops->homeMenu->deploy['subMenu']->cluster         = array('link' => "{$lang->devops->cluster}|cluster|browse|");
    $lang->devops->homeMenu->deploy['subMenu']->env = array('link' => "{$lang->devops->env}|env|browse|");

    $lang->devops->menu->code['exclude'] .= ',repo-setprrule,repo-setcmrule,repo-setsaferule,repo-setownerrule,repo-browsewebhooks,repo-browserule,repo-createwebhook,repo-editwebhook,repo-logwebhook,repo-createrule,repo-editrule';


    if($config->inQuickon)
    {
        $lang->devops->homeMenu->deploy['subMenu']->publishTemplate = array('link' => "{$lang->devops->publishTemplate}|publishtemplate|browse|");
        $lang->devops->homeMenu->deploy['menuOrder'][15] = 'publishTemplate';

        $lang->devops->homeMenu->codescan = array('link' => "{$lang->devops->codescan}|codescan|overview", 'subModule' => 'codescan');
        $lang->devops->menuOrder[49] = 'codescan';

        $lang->devops->homeMenu->codescan['subMenu'] = new stdclass();
        $lang->devops->homeMenu->codescan['subMenu']->overview     = array('link' => "{$lang->devops->overview}|codescan|overview");
        $lang->devops->homeMenu->codescan['subMenu']->scanTask     = array('link' => "{$lang->devops->scanTask}|codescan|task", 'alias' => 'taskview,tasklog,issue', 'exclude' => 'codescan-plan,codescan-planview,codescan-overview');
        $lang->devops->homeMenu->codescan['subMenu']->scanPlan     = array('link' => "{$lang->devops->scanPlan}|codescan|plan", 'alias' => 'planview,trigger,createplan,editplan,tips');
        $lang->devops->homeMenu->codescan['subMenu']->scanSolution = array('link' => "{$lang->devops->scanSolution}|codescan|solution", 'alias' => 'solutionview');
        $lang->devops->homeMenu->codescan['subMenu']->ruleset      = array('link' => "{$lang->ruleset->common}|codescan|ruleset", 'alias' => 'rulesetview');
        $lang->devops->homeMenu->codescan['subMenu']->scanRule     = array('link' => "{$lang->devops->scanRule}|codescan|browse", 'alias' => 'view');

        $lang->devops->homeMenu->codescan['menuOrder'][5]  = 'overview';
        $lang->devops->homeMenu->codescan['menuOrder'][10] = 'scanTask';
        $lang->devops->homeMenu->codescan['menuOrder'][15] = 'scanPlan';
        $lang->devops->homeMenu->codescan['menuOrder'][20] = 'scanSolution';
        $lang->devops->homeMenu->codescan['menuOrder'][25] = 'ruleset';
        $lang->devops->homeMenu->codescan['menuOrder'][30] = 'scanRule';

        $lang->devops->menu->repoCodeScan = array('link' => "{$lang->devops->codescan}|codescan|overview|repoID=%s", 'alias' => 'planview,createplan,editplan', 'subModule' => 'codescan');
        $lang->devops->menu->repoCodeScan['subMenu'] = new stdclass();
        $lang->devops->menu->repoCodeScan['subMenu']->overview = array('link' => "{$lang->devops->overview}|codescan|overview|repoID=%s");
        $lang->devops->menu->repoCodeScan['subMenu']->scanTask = array('link' => "{$lang->devops->scanTask}|codescan|task|repoID=%s", 'alias' => 'taskview,tasklog,issue,issueview', 'exclude' => 'codescan-plan,codescan-planview');
        $lang->devops->menu->repoCodeScan['subMenu']->scanPlan = array('link' => "{$lang->devops->scanPlan}|codescan|plan|repoID=%s", 'alias' => 'planview,createplan,editplan,trigger,tips');
        $lang->devops->menuOrder[46] = 'repoCodeScan';

        $lang->devops->menu->settings = array('link' => "{$lang->repoSettings->common}|repo|setcmrule|repoID=%s", 'alias' => 'setprrule,setsaferule,setownerrule,browsewebhooks,browserule,createwebhook,editwebhook,logwebhook,createrule,editrule');
        $lang->devops->menuOrder[70]  = 'settings';

        $lang->devops->menu->settings['subMenu'] = new stdclass();
        $lang->devops->menu->settings['subMenu']->commit   = array('link' => "{$lang->devops->submitFlow}|repo|setcmrule|repoID=%s", 'alias' => 'setprrule,setsaferule,setownerrule');
        $lang->devops->menu->settings['subMenu']->webhooks = array('link' => "Webhooks|repo|browsewebhooks|repoID=%s", 'alias' => 'createwebhook,editwebhook,logwebhook');
        $lang->devops->menu->settings['subMenu']->rule     = array('link' => "{$lang->devops->ruleSet}|repo|browserule|repoID=%s", 'alias' => 'createrule,editrule');

        $lang->devops->menu->review['subMenu'] = new stdclass();
        $lang->devops->menu->review['subMenu']->review   = array('link' => "{$lang->devops->reviewIssue}|repo|review|repoID=%s", 'subModule' => 'bug');
        $lang->devops->menu->review['subMenu']->codescan = array('link' => "{$lang->devops->scanIssue}|codescan|issue|repoID=%s", 'alias' => 'issueview', 'subModule' => 'bug', 'exclude' => 'bug-view');

        //$lang->devops->homeMenu->deploy['menuOrder'][30] = 'cluster';
        $lang->devops->homeMenu->deploy['menuOrder'][20] = 'env';

        //$lang->devops->homeMenu->deploy['link'] = "{$lang->deployment->common}|cluster|browse";
        $lang->devops->homeMenu->deploy['subModule'] .= ',cluster';
    }

    $lang->devops->homeMenu->system = array('link' => "{$lang->devops->system}|repo|browsesystem", 'subModule' => 'system', 'exclude' => 'system-dashboard,system-dblist,system-domainview,system-ossview');
    $lang->devops->menuOrder[53] = 'system';

    $lang->devops->homeMenu->configure['subModule'] .= ',gitfox';
    $lang->devops->homeMenu->configure['subMenu']->apps['subModule'] .= ',gitfox';
}
