<?php
///////////////////////////////////////////////////////////////////////////////
// Portfolio tool — sample configuration
//
// Copy or rename this file to config.php to activate.
// Variables are prefixed with the tool name to avoid conflicts.
//
// Set 'disable' => true on any entry to exclude it from the filter bar.
// If all entries are disabled the filter bar reverts to the built-in defaults
// (Registrar and Nameserver).
///////////////////////////////////////////////////////////////////////////////

// Default search filter mode in domain portfolio data table
//
// bw = begins with
// cn = Contains
// ew = Ends With
// eq = Equals
//
$PORTFOLIO_DEFAULT_SEARCH_FILTER_MODE = 'bw';

// Domains of Interest — auto-query name for the 'All Domains' button.
//
// When set, clicking 'All Domains' will show only the domains returned by
// the named auto-query instead of the full portfolio.
// The value must match an existing auto-query name exactly (case-insensitive).
// Leave empty or omit to show all domains normally.
$PORTFOLIO_DOMAINS_OF_INTEREST = '';

// Nameserver display limit for the portfolio table.
//
// 0 = show all nameservers, which preserves the current behavior.
// N = show only the first N nameservers and indicate how many more exist.
//
// This only affects the compact "Nameservers" table column display.
// It does not change filtering, sorting, API data, or the individual ns1-ns8 fields.
$PORTFOLIO_NAMESERVER_DISPLAY_LIMIT = 0;


// Category layout for the portfolio tool.
//
// top  = show category buttons above the table, which preserves current behavior.
// left = show category buttons in a left-side pane to give the table more height.
//
// This is a deployment/admin setting only. Users do not change this in the UI.
$PORTFOLIO_CATEGORY_LAYOUT = 'top';

// Sticky columns — keep the first four columns (#, checkbox, !, refresh, Domain)
// fixed on the left while scrolling horizontally.
//
// true  = columns are sticky (default).
// false = normal scrolling, all columns scroll together.
$PORTFOLIO_STICKY_COLUMNS = true;

// Set to false to hide the filter bar entirely.
// If this variable is missing, the filter bar is shown.
$portfolio_filters_enabled = true;


$portfolio_filters = [

    // -------------------------------------------------------------------------
    // Text filters — substring match against one or more varchar columns
    // -------------------------------------------------------------------------

    [
        'label'   => 'Registrar',
        'group'   => 'Registrar',
        'columns' => ['d.registrar'],
        'disable' => false,
    ],

    [
        'label'   => 'Nameserver',
        'group'   => 'Nameserver',
        'columns' => ['d.ns1','d.ns2','d.ns3','d.ns4','d.ns5','d.ns6','d.ns7','d.ns8'],
        'disable' => false,
    ],

    [
        'label'   => 'Owner',
        'group'   => 'Ownership',
        'columns' => ['d.owner'],
        'disable' => true,
    ],

    [
        'label'   => 'Organization',
        'group'   => 'Ownership',
        'columns' => ['d.organization'],
        'disable' => true,
    ],

    [
        'label'   => 'Notes A',
        'group'   => 'Notes',
        'columns' => ['d.notes_a'],
        'disable' => true,
    ],

    [
        'label'   => 'Notes B',
        'group'   => 'Notes',
        'columns' => ['d.notes_b'],
        'disable' => true,
    ],

    // -------------------------------------------------------------------------
    // Integer filters — min/max range inputs
    // -------------------------------------------------------------------------

    [
        'label'   => 'Days To Expiry',
        'group'   => 'Expiry Range',
        'type'    => 'int',
        'columns' => ['d.days_to_expiry'],
        'disable' => true,
    ],

    [
        'label'   => 'Ping Time',
        'group'   => 'Performance',
        'type'    => 'int',
        'columns' => ['d.pingtime'],
        'disable' => true,
    ],

    [
        'label'   => 'Page Size',
        'group'   => 'Performance',
        'type'    => 'int',
        'columns' => ['d.home_page_size'],
        'disable' => true,
    ],

    // -------------------------------------------------------------------------
    // Float filters — min/max range inputs with decimal step.
    // Example for custom numeric columns with decimal values:
    //
    // [
    //     'label'   => 'Price',
    //     'group'   => 'Pricing',
    //     'type'    => 'float',
    //     'columns' => ['d.price'],
    //     'disable' => true,
    // ],
    // -------------------------------------------------------------------------

    // -------------------------------------------------------------------------
    // Boolean filters — Yes / No dropdown
    // -------------------------------------------------------------------------

    [
        'label'   => 'Edited',
        'group'   => 'Status',
        'type'    => 'boolean',
        'columns' => ['d.edited'],
        'disable' => true,
    ],

    [
        'label'   => 'Write Protect',
        'group'   => 'Status',
        'type'    => 'boolean',
        'columns' => ['d.write_protect'],
        'disable' => true,
    ],

    [
        'label'   => 'Disable Alerts',
        'group'   => 'Status',
        'type'    => 'boolean',
        'columns' => ['d.disable_alerts'],
        'disable' => true,
    ],

];

// -------------------------------------------------------------------------
// Inline editable fields for the portfolio table.
//
// Allows double-clicking a cell to edit its value directly in the table.
// Missing, empty, or all-disabled configuration disables inline editing.
//
// 'field' must be a plain domain column name without the 'd.' prefix.
//   - Only alphanumeric characters and underscores are allowed.
//   - Core fields (id, domain, tld etc.) are blocked automatically.
// 'label' is shown in error messages. Defaults to field name if omitted.
// 'type'  currently only supports 'text'.
// 'disable' => true excludes the entry. Missing or false means enabled.
// -------------------------------------------------------------------------
$PORTFOLIO_EDITABLE_FIELDS = [
    [
        'field'   => 'owner',
        'label'   => 'Owner',
        'type'    => 'text',
        'disable' => true,
    ],
    [
        'field'   => 'organization',
        'label'   => 'Organization',
        'type'    => 'text',
        'disable' => true,
    ],
    [
        'field'   => 'notes_a',
        'label'   => 'Notes A',
        'type'    => 'text',
        'disable' => true,
    ],
    [
        'field'   => 'notes_b',
        'label'   => 'Notes B',
        'type'    => 'text',
        'disable' => true,
    ],
    [
        'field'   => 'notes_c',
        'label'   => 'Notes C',
        'type'    => 'text',
        'disable' => true,
    ],
    [
        'field'   => 'notes_d',
        'label'   => 'Notes D',
        'type'    => 'text',
        'disable' => true,
    ],
];