2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Functionality for the navigation tree
6 * @package PhpMyAdmin-Navigation
8 if (! defined('PHPMYADMIN')) {
13 * Represents a columns node in the navigation tree
15 * @package PhpMyAdmin-Navigation
17 class Node_Column
extends Node
20 * Initialises the class
22 * @param string $name An identifier for the new node
23 * @param int $type Type of node, may be one of CONTAINER or OBJECT
24 * @param bool $is_group Whether this object has been created
25 * while grouping nodes
29 public function __construct($name, $type = Node
::OBJECT, $is_group = false)
31 parent
::__construct($name, $type, $is_group);
32 $this->icon
= PMA_Util
::getImage('pause.png', '');
34 'text' => 'tbl_structure.php?server=' . $GLOBALS['server']
35 . '&db=%3$s&table=%2$s&field=%1$s'
36 . '&change_column=1'
37 . '&token=' . $GLOBALS['token'],
38 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server']
39 . '&db=%3$s&table=%2$s&field=%1$s'
40 . '&change_column=1'
41 . '&token=' . $GLOBALS['token']
46 * Returns the comment associated with node
47 * This method should be overridden by specific type of nodes
51 public function getComment()
53 $db = PMA_Util
::sqlAddSlashes(
54 $this->realParent()->realParent()->real_name
56 $table = PMA_Util
::sqlAddSlashes(
57 $this->realParent()->real_name
59 $column = PMA_Util
::sqlAddSlashes(
62 $query = "SELECT `COLUMN_COMMENT` ";
63 $query .= "FROM `INFORMATION_SCHEMA`.`COLUMNS` ";
64 $query .= "WHERE `TABLE_SCHEMA`='$db' ";
65 $query .= "AND `TABLE_NAME`='$table' ";
66 $query .= "AND `COLUMN_NAME`='$column' ";
67 return PMA_DBI_fetch_value($query);