<?php

$moduleName = PlatformConnector::$moduleName;
$siteUrl = rtrim(PlatformConnector::getSiteUrl(), '/') . '/';

$baseUrl = "index.php?module={$moduleName}";
$baseWithActionUrl = "{$baseUrl}&view={$moduleName}Ajax&file=controller&a=";

return  array(
    'moduleName' => $moduleName,
    // Javascript Link Template should be formatted like ES6 string templates
    'jsLinkTemplate' => 'index.php?module=${this.module}&view=Detail&record=${this.entityId}',
    'url' => array(
        'index' => "index.php?module={$moduleName}&view=List",
        'base' => "index.php?module={$moduleName}&view=index",
        'withoutAction' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=",

        // Report builder
        'reportBuilder' => "index.php?module={$moduleName}&view=ReportBuilder",

        // Settings
        'settings' => "index.php?module={$moduleName}&view=Settings",
        'saveSettingsUrl' => "{$baseWithActionUrl}saveSettings",

        // License
        'getLicenseData' => "{$baseWithActionUrl}getLicenseData",
        'getLicenseUserList' => "{$baseWithActionUrl}getLicenseUserList",

        // Permissions
        'getPermissions' => "{$baseWithActionUrl}getPermissions",

        // Templates
        'getTemplates' => "{$baseWithActionUrl}getTemplates",
        'downloadTemplate' => "{$baseWithActionUrl}downloadTemplate&templateId=",
        'saveTemplate' => "{$baseWithActionUrl}saveTemplate",
        'uploadTemplateLink' => "index.php?module={$moduleName}&view=Settings&currentTab=4&reportId=",
        'deleteTemplate' => "{$baseWithActionUrl}deleteTemplate",

        // Processes
        "getProcesses" => "{$baseWithActionUrl}getProcesses",
        "deleteProcess" => "{$baseWithActionUrl}deleteProcess",
        "clearProcessCache" => "{$baseWithActionUrl}clearProcessCache",
        "runProcess" => "{$baseWithActionUrl}runProcess",
        "saveProcess" => "{$baseWithActionUrl}saveProcess",

        // Scheduler
        "getScheduledReports" => "{$baseWithActionUrl}getScheduledReports",
        'runSchedulerDebug' => "{$baseWithActionUrl}run_scheduler",
        'forceSendReport' => "{$baseWithActionUrl}force_send_report",
        'getScheduledItemUserList' => "{$baseWithActionUrl}getScheduledItemUserList",
        'updateScheduledNextTime' => "{$baseWithActionUrl}updateScheduledNextTime",
        'updateScheduledMultipleNextTime' => "{$baseWithActionUrl}updateScheduledMultipleNextTime",
        'updateScheduledMultipleStatus' => "{$baseWithActionUrl}updateScheduledMultipleStatus",

        // Logs
        "clearLogs" => "{$baseWithActionUrl}clearLogs",
        "fetchLogs" => "{$baseWithActionUrl}getLogs",

        // Reports and dashboards
        'delete' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=Delete&record=",
        'deleteDashboard' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=deleteDashboard&dashboardId=",
        

        'report' => "{$siteUrl}index.php?module={$moduleName}&view=Report&record=",
        'reportFull' => "{$siteUrl}index.php?module={$moduleName}&view=Report&record=",
        'loadReport' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=loadReport&record=",
        'saveReport' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=saveReport&record=",

        'loadPicklists' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=loadPicklists",
        'loadRoles' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=getAllowedRoleList",
        'loadUsers' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=getAllowedUserList",

        // Export
        'makeXLS' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=makeXLS&record=",
        'makePDF' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=makePDF&record=",

        'toggleReport' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=Toggle&key=report&record=",
        'toggleCategory' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=Toggle&key=category&record=",
        'toggleDashboard' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=Toggle&key=report&record=",

        // Actions
        'addToDashboard' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=addToDashboard",
        'loadCampaigns' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=loadCampaigns",
        'addToCampaign' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=addToCampaign",
        

        'saveToDashboard' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=addToDashboard",
        'list' => "index.php?module={$moduleName}&view=List",
        'dashboard' => "index.php?module={$moduleName}&view=Dashboard&dashboardId=",
        'dashboardFull' => "index.php?module={$moduleName}&view=Dashboard&dashboardId=",
        'openDashboard' => "index.php?module={$moduleName}&view=Dashboard&dashboardId=",
        'saveCategoryUrl' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=saveCategory",
        'massScheduleUrl' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=massSchedule",
        'exportReportsUrl' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=exportReports",
        'importReportsUrl' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=importReports",
        'toggleVisible' => "index.php?module={$moduleName}&view=List#toggleVisible",
        'checkFontsAjax' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=downloadFontCheck",
        'downloadFontCheckUrl' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=downloadFontCheck",
        'downloadFontUrl' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=downloadFont",


        // Dashboard URL's
        'saveDashboardUrl' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=saveDashboard",
        'fetchDashboardWidgetsUrl' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=getDashboardWidgets&dashboardId=",
        'fetchWidgetDataUrl' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=getWidgetData&reportId=",
        'fetchMapDataUrl' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=loadMapData",
        'fetchReportListUrl' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=getReportList",
        'fetchReportTree' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=getReportTree",
        'savePermissionsUrl' => "index.php?module={$moduleName}&view={$moduleName}Ajax&file=controller&a=savePermissions",
    ),
    'dateMySqlFormat' => array(
        "microsecond" => "MICROSECOND",
        "second" => "SECOND",
        "minute" => "MINUTE",
        "hour" => "HOUR",
        "day" => "DAY",
        "week" => "WEEK",
        "month" => "MONTH",
        "quarter" => "QUARTER",
        "year" => "YEAR"
    ),
    'customSqlBlacklist' => array(
        /**
         * Added whitespace after blacklisted SQL keywords
         * (for example "m0_Accounts_datecreated" will not be affected by blacklisted "create")
         */
        'select', 'insert ', 'update ', 'delete ', 'file', 'create ', 'alter', 'index', 'drop', 'temporary', 'show ', 'view ', 'routine', 'execute', 'trigger', 'grant', 'super', 'process', 'reload', 'shutdown', 'databases', 'lock', 'tables', 'references', 'replication', '--', 'join '
    )

);
