PMA\libraries\navigation\NavigationTree::__construct PHP Метод

__construct() публичный Метод

Initialises the class
public __construct ( )
    public function __construct()
    {
        // Save the position at which we are in the database list
        if (isset($_REQUEST['pos'])) {
            $this->_pos = (int) $_REQUEST['pos'];
        }
        if (!isset($this->_pos)) {
            $this->_pos = $this->_getNavigationDbPos();
        }
        // Get the active node
        if (isset($_REQUEST['aPath'])) {
            $this->_aPath[0] = $this->_parsePath($_REQUEST['aPath']);
            $this->_pos2_name[0] = $_REQUEST['pos2_name'];
            $this->_pos2_value[0] = $_REQUEST['pos2_value'];
            if (isset($_REQUEST['pos3_name'])) {
                $this->_pos3_name[0] = $_REQUEST['pos3_name'];
                $this->_pos3_value[0] = $_REQUEST['pos3_value'];
            }
        } else {
            if (isset($_REQUEST['n0_aPath'])) {
                $count = 0;
                while (isset($_REQUEST['n' . $count . '_aPath'])) {
                    $this->_aPath[$count] = $this->_parsePath($_REQUEST['n' . $count . '_aPath']);
                    $index = 'n' . $count . '_pos2_';
                    $this->_pos2_name[$count] = $_REQUEST[$index . 'name'];
                    $this->_pos2_value[$count] = $_REQUEST[$index . 'value'];
                    $index = 'n' . $count . '_pos3_';
                    if (isset($_REQUEST[$index])) {
                        $this->_pos3_name[$count] = $_REQUEST[$index . 'name'];
                        $this->_pos3_value[$count] = $_REQUEST[$index . 'value'];
                    }
                    $count++;
                }
            }
        }
        if (isset($_REQUEST['vPath'])) {
            $this->_vPath[0] = $this->_parsePath($_REQUEST['vPath']);
        } else {
            if (isset($_REQUEST['n0_vPath'])) {
                $count = 0;
                while (isset($_REQUEST['n' . $count . '_vPath'])) {
                    $this->_vPath[$count] = $this->_parsePath($_REQUEST['n' . $count . '_vPath']);
                    $count++;
                }
            }
        }
        if (isset($_REQUEST['searchClause'])) {
            $this->_searchClause = $_REQUEST['searchClause'];
        }
        if (isset($_REQUEST['searchClause2'])) {
            $this->_searchClause2 = $_REQUEST['searchClause2'];
        }
        // Initialise the tree by creating a root node
        $node = NodeFactory::getInstance('NodeDatabaseContainer', 'root');
        $this->_tree = $node;
        if ($GLOBALS['cfg']['NavigationTreeEnableGrouping'] && $GLOBALS['cfg']['ShowDatabasesNavigationAsTree']) {
            $this->_tree->separator = $GLOBALS['cfg']['NavigationTreeDbSeparator'];
            $this->_tree->separator_depth = 10000;
        }
    }