Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / libraries / navigation / Nodes / Node_Function.class.php
blobf6e01a5e4541b628511098f9da701fdcfee24175
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Functionality for the navigation tree
6 * @package PhpMyAdmin-Navigation
7 */
8 if (! defined('PHPMYADMIN')) {
9 exit;
12 /**
13 * Represents a function node in the navigation tree
15 * @package PhpMyAdmin-Navigation
17 class Node_Function extends Node
19 /**
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
27 * @return Node_Function
29 public function __construct($name, $type = Node::OBJECT, $is_group = false)
31 parent::__construct($name, $type, $is_group);
32 $this->icon = PMA_Util::getImage('b_routines.png');
33 $this->links = array(
34 'text' => 'db_routines.php?server=' . $GLOBALS['server']
35 . '&amp;db=%2$s&amp;item_name=%1$s&amp;item_type=FUNCTION'
36 . '&amp;edit_item=1&amp;token=' . $GLOBALS['token'],
37 'icon' => 'db_routines.php?server=' . $GLOBALS['server']
38 . '&amp;db=%2$s&amp;item_name=%1$s&amp;item_type=FUNCTION'
39 . '&amp;export_item=1&amp;token=' . $GLOBALS['token']
41 $this->classes = 'function';
44 /**
45 * Returns the comment associated with node
46 * This method should be overridden by specific type of nodes
48 * @return string
50 public function getComment()
52 $db = PMA_Util::sqlAddSlashes(
53 $this->realParent()->real_name
55 $routine = PMA_Util::sqlAddSlashes(
56 $this->real_name
58 $query = "SELECT `ROUTINE_COMMENT` ";
59 $query .= "FROM `INFORMATION_SCHEMA`.`ROUTINES` ";
60 $query .= "WHERE `ROUTINE_SCHEMA`='$db' ";
61 $query .= "AND `ROUTINE_NAME`='$routine' ";
62 $query .= "AND `ROUTINE_TYPE`='FUNCTION' ";
63 return PMA_DBI_fetch_value($query);