PMA\libraries\Footer::getSelfUrl PHP Method

getSelfUrl() public method

Returns the url of the current page
public getSelfUrl ( ) : string
return string
    public function getSelfUrl()
    {
        $db = !empty($GLOBALS['db']) ? $GLOBALS['db'] : '';
        $table = !empty($GLOBALS['table']) ? $GLOBALS['table'] : '';
        $target = !empty($_REQUEST['target']) ? $_REQUEST['target'] : '';
        $params = array('db' => $db, 'table' => $table, 'server' => $GLOBALS['server'], 'target' => $target);
        // needed for server privileges tabs
        if (isset($_REQUEST['viewing_mode']) && in_array($_REQUEST['viewing_mode'], array('server', 'db', 'table'))) {
            $params['viewing_mode'] = $_REQUEST['viewing_mode'];
        }
        /*
         * @todo    coming from server_privileges.php, here $db is not set,
         *          add the following condition below when that is fixed
         *          && $_REQUEST['checkprivsdb'] == $db
         */
        if (isset($_REQUEST['checkprivsdb'])) {
            $params['checkprivsdb'] = $_REQUEST['checkprivsdb'];
        }
        /*
         * @todo    coming from server_privileges.php, here $table is not set,
         *          add the following condition below when that is fixed
         *          && $_REQUEST['checkprivstable'] == $table
         */
        if (isset($_REQUEST['checkprivstable'])) {
            $params['checkprivstable'] = $_REQUEST['checkprivstable'];
        }
        if (isset($_REQUEST['single_table']) && in_array($_REQUEST['single_table'], array(true, false))) {
            $params['single_table'] = $_REQUEST['single_table'];
        }
        return basename(PMA_getenv('SCRIPT_NAME')) . URL::getCommonRaw($params);
    }