<?php
defined('BASEPATH') or exit('No direct script access allowed');

/*
/**
 * Admin URL
 */
define('ATADMIN_URL', 'at-admin');
/**
 * Admin URI
 * CUSTOM_ADMIN_URL is not yet tested well, don't define it
 */
define('ATADMIN_URI', DEFINED('CUSTOM_ATADMIN_URL') ? CUSTOM_ATADMIN_URL : ATADMIN_URL);

function atadmin_url($url = '')
{
    $atadminURI = get_atadmin_uri();

    if ($url == '' || $url == '/') {
        if ($url == '/') {
            $url = '';
        }

        return site_url($atadminURI) . '/';
    }

    return site_url($atadminURI . '/' . $url);
}

function get_atadmin_uri()
{
    return ATADMIN_URI;
}
