diff --git a/ChangeLog b/ChangeLog index 3ed7eeb3f4..b198d4005c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ phpMyAdmin - ChangeLog ====================== 4.3.0.0 (not yet released) +- rfe #1518 Confirm dialog on accidentally leaving a page 4.2.1.0 (not yet released) - bug #4380 Cannot display table structure with enums containing special characters diff --git a/README.rst b/README.rst index 5536c987b6..33a9b5b60a 100644 --- a/README.rst +++ b/README.rst @@ -5,28 +5,20 @@ A set of PHP-scripts to manage MySQL over the web. http://www.phpmyadmin.net/ -Status ------- - -Continuous integration: +Code status +----------- .. image:: https://secure.travis-ci.org/phpmyadmin/phpmyadmin.png?branch=master :alt: Build status :target: https://travis-ci.org/phpmyadmin/phpmyadmin -Translations: - .. image:: http://l10n.cihar.com/widgets/phpmyadmin-status-badge.png :alt: Translation status :target: https://l10n.cihar.com/engage/phpmyadmin/?utm_source=widget -Code coverage: - .. image:: https://coveralls.io/repos/phpmyadmin/phpmyadmin/badge.png?branch=master :target: https://coveralls.io/r/phpmyadmin/phpmyadmin?branch=master -Code quality: - .. image:: https://scrutinizer-ci.com/g/phpmyadmin/phpmyadmin/badges/quality-score.png?s=93dfde29ffa5771d9c254b7ffb11c4e673315035 :target: https://scrutinizer-ci.com/g/phpmyadmin/phpmyadmin/ diff --git a/libraries/navigation/NavigationTree.class.php b/libraries/navigation/NavigationTree.class.php index de9cc45cc1..f7fa6fee5e 100644 --- a/libraries/navigation/NavigationTree.class.php +++ b/libraries/navigation/NavigationTree.class.php @@ -796,6 +796,31 @@ class PMA_NavigationTree return $retval; } + /** + * Finds whether given tree matches this tree. + * + * @param array $tree Tree to check + * @param string $attribute Attribute to walk + * + * @return boolean + */ + private function _findTreeMatch($tree, $attribute) + { + foreach ($tree as $path) { + $match = true; + foreach ($paths[$attribute] as $key => $part) { + if (! isset($path[$key]) || $part != $path[$key]) { + $match = false; + break; + } + } + if ($match) { + break; + } + } + return $match; + } + /** * Renders a single node or a branch of the tree * @@ -839,14 +864,6 @@ class PMA_NavigationTree || (! in_array($parentName, $sterile) && ! $node->isNew) || (in_array($node->real_name, $sterile)) ) { - $loaded = ''; - if ($node->is_group) { - $loaded = ' loaded'; - } - $container = ''; - if ($node->type == Node::CONTAINER) { - $container = ' container'; - } $retval .= "
"; $iClass = ''; if ($class == 'first') { @@ -856,47 +873,11 @@ class PMA_NavigationTree if (strpos($class, 'last') === false) { $retval .= ""; } - $icon = PMA_Util::getImage('b_plus.png', __('Expand/Collapse')); - foreach ($this->_aPath as $path) { - $match = 1; - foreach ($paths['aPath_clean'] as $key => $part) { - if (! isset($path[$key]) || $part != $path[$key]) { - $match = 0; - break; - } - } - if ($match) { - $loaded = ' loaded'; - if (! $node->is_group) { - $icon = PMA_Util::getImage( - 'b_minus.png' - ); - } - break; - } - } - foreach ($this->_vPath as $path) { - $match = 1; - foreach ($paths['vPath_clean'] as $key => $part) { - if ((! isset($path[$key]) || $part != $path[$key])) { - $match = 0; - break; - } - } - if ($match) { - $loaded = ' loaded'; - $icon = PMA_Util::getImage('b_minus.png'); - break; - } - } + $match = $this->_findTreeMatch($this->_aPath, 'aPath_clean'); + $match |= $this->_findTreeMatch($this->_vPath, 'vPath_clean'); - if (! $GLOBALS['cfg']['NavigationTreeDisableDatabaseExpansion']) { - $retval .= "getCssClasses($match) . '"'; $retval .= " href='#'>"; $retval .= ""; $retval .= $paths['aPath']; @@ -908,7 +889,7 @@ class PMA_NavigationTree $retval .= $this->_pos; $retval .= ""; $retval .= $this->_getPaginationParamsHtml($node); - $retval .= $icon; + $retval .= $node->getIcon($match); $retval .= ""; $retval .= "
"; diff --git a/libraries/navigation/Nodes/Node.class.php b/libraries/navigation/Nodes/Node.class.php index 70dd75b098..655f61aa82 100644 --- a/libraries/navigation/Nodes/Node.class.php +++ b/libraries/navigation/Nodes/Node.class.php @@ -457,5 +457,48 @@ class Node { return ''; } + + /** + * Returns CSS classes for a node + * + * @param boolean $match Whether the node matched loaded tree + * + * @return String with html classes. + */ + public function getCssClasses($match) + { + if ($GLOBALS['cfg']['NavigationTreeDisableDatabaseExpansion']) { + return ''; + } + + $result = array('expander'); + + if ($this->is_group || $match) { + $result[] = 'loaded'; + } + if ($this->type == Node::CONTAINER) { + $result[] = 'container'; + } + + return implode(' ', $result); + } + + /** + * Returns icon for the node + * + * @param boolean $match Whether the node matched loaded tree + * + * @return String with image name + */ + public function getIcon($match) + { + if ($GLOBALS['cfg']['NavigationTreeDisableDatabaseExpansion']) { + return ''; + } elseif ($match && ! $node->is_group) { + return PMA_Util::getImage('b_minus.png'); + } else { + return PMA_Util::getImage('b_plus.png', __('Expand/Collapse')); + } + } } ?> diff --git a/scripts/create-release.sh b/scripts/create-release.sh index aa1a723254..542a153e55 100755 --- a/scripts/create-release.sh +++ b/scripts/create-release.sh @@ -315,6 +315,10 @@ Todo now: 9. send a private twitter message to @phpmya, containing a short version of the announcement -10. the end :-) +10. update demo/php/versions.ini in the scripts repository so that the demo server shows current versions + +11. in case of new major release, update the render.py in website repository to include the new major releases + +12. the end :-) END