Skip to content

Commit

Permalink
Renamed a_path to aPath and v_path to vPath
Browse files Browse the repository at this point in the history
  • Loading branch information
roccivic committed Oct 30, 2012
1 parent af4a42a commit 9aa3ac6
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 59 deletions.
9 changes: 4 additions & 5 deletions js/navigation.js
Expand Up @@ -70,8 +70,8 @@ $(function() {
}

var params = {
a_path: $(this).find('span.a_path').text(),
v_path: $(this).find('span.v_path').text(),
aPath: $(this).find('span.aPath').text(),
vPath: $(this).find('span.vPath').text(),
pos: $(this).find('span.pos').text(),
pos2_name: $(this).find('span.pos2_name').text(),
pos2_value: $(this).find('span.pos2_value').text(),
Expand Down Expand Up @@ -228,9 +228,8 @@ function PMA_reloadNavigation() {
if ($(this).find('img').is('.ic_b_minus')
&& $(this).closest('li').find('div.list_container .ic_b_minus').length == 0
) {
params['a_path_' + count] = $(this).find('span.a_path').text();
params['v_path_' + count] = $(this).find('span.v_path').text();
params['v_path_' + count] = $(this).find('span.v_path').text();
params['aPath_' + count] = $(this).find('span.aPath').text();
params['vPath_' + count] = $(this).find('span.vPath').text();

var pos2_name = $(this).find('span.pos2_name').text();
if (! pos2_name) {
Expand Down
74 changes: 37 additions & 37 deletions libraries/navigation/NavigationTree.class.php
Expand Up @@ -19,14 +19,14 @@ class PMA_NavigationTree {
* This does not include nodes created after the grouping
* of nodes has been performed
*/
private $a_path = array();
private $_aPath = array();

/**
* @var array The virtual paths to all expanded nodes in the tree
* This includes nodes created after the grouping of
* nodes has been performed
*/
private $v_path = array();
private $_vPath = array();

/**
* @var int Position in the list of databases,
Expand Down Expand Up @@ -86,19 +86,19 @@ public function __construct($pos)
// Save the position at which we are in the database list
$this->pos = $pos;
// Get the active node
if (isset($_REQUEST['a_path'])) {
$this->a_path[0] = $this->parsePath($_REQUEST['a_path']);
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['a_path_0'])) {
} else if (isset($_REQUEST['aPath_0'])) {
$count = 0;
while (isset($_REQUEST['a_path_' . $count])) {
$this->a_path[$count] = $this->parsePath(
$_REQUEST['a_path_' . $count]
while (isset($_REQUEST['aPath_' . $count])) {
$this->_aPath[$count] = $this->parsePath(
$_REQUEST['aPath_' . $count]
);
$this->pos2_name[$count] = $_REQUEST['pos2_name_' . $count];
$this->pos2_value[$count] = $_REQUEST['pos2_value_' . $count];
Expand All @@ -109,13 +109,13 @@ public function __construct($pos)
$count++;
}
}
if (isset($_REQUEST['v_path'])) {
$this->v_path[0] = $this->parsePath($_REQUEST['v_path']);
} else if (isset($_REQUEST['v_path_0'])) {
if (isset($_REQUEST['vPath'])) {
$this->_vPath[0] = $this->parsePath($_REQUEST['vPath']);
} else if (isset($_REQUEST['vPath_0'])) {
$count = 0;
while (isset($_REQUEST['v_path_' . $count])) {
$this->v_path[$count] = $this->parsePath(
$_REQUEST['v_path_' . $count]
while (isset($_REQUEST['vPath_' . $count])) {
$this->_vPath[$count] = $this->parsePath(
$_REQUEST['vPath_' . $count]
);
$count++;
}
Expand Down Expand Up @@ -164,8 +164,8 @@ private function buildPath()
}

// Whether build other parts of the tree depends
// on whether we have any paths in $this->a_path
foreach ($this->a_path as $key => $path) {
// on whether we have any paths in $this->_aPath
foreach ($this->_aPath as $key => $path) {
$retval = $this->buildPathPart(
$path,
$this->pos2_name[$key],
Expand Down Expand Up @@ -580,7 +580,7 @@ public function renderPath()
$this->searchClause
);
$clientResults = 0;
if (! empty($_REQUEST['results']) {
if (! empty($_REQUEST['results'])) {
$clientResults = (int)$_REQUEST['results'];
}
$otherResults = $results - $clientResults;
Expand Down Expand Up @@ -616,17 +616,17 @@ private function getPaginationParamsHtml($node)
{
$retval = '';
$paths = $node->getPaths();
if (isset($paths['a_path_clean'][2])) {
if (isset($paths['aPath_clean'][2])) {
$retval .= "<span class='hide pos2_name'>";
$retval .= $paths['a_path_clean'][2];
$retval .= $paths['aPath_clean'][2];
$retval .= "</span>";
$retval .= "<span class='hide pos2_value'>";
$retval .= $node->pos2;
$retval .= "</span>";
}
if (isset($paths['a_path_clean'][4])) {
if (isset($paths['aPath_clean'][4])) {
$retval .= "<span class='hide pos3_name'>";
$retval .= $paths['a_path_clean'][4];
$retval .= $paths['aPath_clean'][4];
$retval .= "</span>";
$retval .= "<span class='hide pos3_value'>";
$retval .= $node->pos3;
Expand Down Expand Up @@ -695,9 +695,9 @@ public function renderNode($node, $recursive = -1, $class = '')

$icon = $this->_commonFunctions->getImage('b_plus.png');
$match = 1;
foreach ($this->a_path as $path) {
foreach ($this->_aPath as $path) {
$match = 1;
foreach ($paths['a_path_clean'] as $key => $part) {
foreach ($paths['aPath_clean'] as $key => $part) {
if (! isset($path[$key]) || $part != $path[$key]) {
$match = 0;
break;
Expand All @@ -714,9 +714,9 @@ public function renderNode($node, $recursive = -1, $class = '')
}
}

foreach ($this->v_path as $path) {
foreach ($this->_vPath as $path) {
$match = 1;
foreach ($paths['v_path_clean'] as $key => $part) {
foreach ($paths['vPath_clean'] as $key => $part) {
if ((! isset($path[$key]) || $part != $path[$key])) {
$match = 0;
break;
Expand All @@ -731,11 +731,11 @@ public function renderNode($node, $recursive = -1, $class = '')

$retval .= "<a class='expander$loaded$container'";
$retval .= " target='_self' href='#'>";
$retval .= "<span class='hide a_path'>";
$retval .= $paths['a_path'];
$retval .= "<span class='hide aPath'>";
$retval .= $paths['aPath'];
$retval .= "</span>";
$retval .= "<span class='hide v_path'>";
$retval .= $paths['v_path'];
$retval .= "<span class='hide vPath'>";
$retval .= $paths['vPath'];
$retval .= "</span>";
$retval .= "<span class='hide pos'>";
$retval .= $this->pos;
Expand Down Expand Up @@ -847,7 +847,7 @@ public function renderNode($node, $recursive = -1, $class = '')
*/
private function setVisibility()
{
foreach ($this->v_path as $path) {
foreach ($this->_vPath as $path) {
$node = $this->tree;
foreach ($path as $value) {
$child = $node->getChild($value);
Expand Down Expand Up @@ -881,8 +881,8 @@ private function fastFilterHtml($node)
$paths = $node->getPaths();
$url_params = array(
'pos' => $this->pos,
'a_path' => $paths['a_path'],
'v_path' => $paths['v_path'],
'aPath' => $paths['aPath'],
'vPath' => $paths['vPath'],
'pos2_name' => $node->real_name,
'pos2_value' => 0
);
Expand Down Expand Up @@ -912,18 +912,18 @@ private function getPageSelector($node)
if ($node->type == Node::CONTAINER && ! $node->is_group) {
$paths = $node->getPaths();

$level = isset($paths['a_path_clean'][4]) ? 3 : 2;
$level = isset($paths['aPath_clean'][4]) ? 3 : 2;
$_url_params = array(
'a_path' => $paths['a_path'],
'v_path' => $paths['v_path'],
'aPath' => $paths['aPath'],
'vPath' => $paths['vPath'],
'pos' => $this->pos,
'server' => $GLOBALS['server'],
'pos2_name' => $paths['a_path_clean'][2]
'pos2_name' => $paths['aPath_clean'][2]
);
if ($level == 3) {
$pos = $node->pos3;
$_url_params['pos2_value'] = $node->pos2;
$_url_params['pos3_name'] = $paths['a_path_clean'][4];
$_url_params['pos3_name'] = $paths['aPath_clean'][4];
} else {
$pos = $node->pos2;
}
Expand Down
34 changes: 17 additions & 17 deletions libraries/navigation/Nodes/Node.class.php
Expand Up @@ -307,7 +307,7 @@ public function hasSiblings()
{
$retval = false;
$paths = $this->getPaths();
if (count($paths['a_path_clean']) > 3) {
if (count($paths['aPath_clean']) > 3) {
$retval = true;
} else {
foreach ($this->parent->children as $child) {
Expand Down Expand Up @@ -348,29 +348,29 @@ public function numChildren()
*/
public function getPaths()
{
$a_path = array();
$a_path_clean = array();
$aPath = array();
$aPath_clean = array();
foreach ($this->parents(true, true, false) as $parent) {
$a_path[] = base64_encode($parent->real_name);
$a_path_clean[] = $parent->real_name;
$aPath[] = base64_encode($parent->real_name);
$aPath_clean[] = $parent->real_name;
}
$a_path = implode('.', array_reverse($a_path));
$a_path_clean = array_reverse($a_path_clean);
$aPath = implode('.', array_reverse($aPath));
$aPath_clean = array_reverse($aPath_clean);

$v_path = array();
$v_path_clean = array();
$vPath = array();
$vPath_clean = array();
foreach ($this->parents(true, true, true) as $parent) {
$v_path[] = base64_encode($parent->name);
$v_path_clean[] = $parent->name;
$vPath[] = base64_encode($parent->name);
$vPath_clean[] = $parent->name;
}
$v_path = implode('.', array_reverse($v_path));
$v_path_clean = array_reverse($v_path_clean);
$vPath = implode('.', array_reverse($vPath));
$vPath_clean = array_reverse($vPath_clean);

return array(
'a_path' => $a_path,
'a_path_clean' => $a_path_clean,
'v_path' => $v_path,
'v_path_clean' => $v_path_clean
'aPath' => $aPath,
'aPath_clean' => $aPath_clean,
'vPath' => $vPath,
'vPath_clean' => $vPath_clean
);
}

Expand Down

0 comments on commit 9aa3ac6

Please sign in to comment.