1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* PHPPgAdmin v6.0.0-beta.44 |
5
|
|
|
*/ |
6
|
|
|
|
7
|
|
|
namespace PHPPgAdmin\XHtml; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Class to render tables. Formerly part of Misc.php. |
11
|
|
|
*/ |
12
|
|
|
class HTMLHeaderController extends HTMLController |
13
|
|
|
{ |
14
|
|
|
public $controller_name = 'HTMLHeaderController'; |
15
|
|
|
private $_no_output = false; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Sets the value of private member variable $_no_output. |
19
|
|
|
* |
20
|
|
|
* @param bool $flag [description] |
21
|
|
|
* |
22
|
|
|
* @return $this |
23
|
|
|
*/ |
24
|
|
|
public function setNoOutput($flag) |
25
|
|
|
{ |
26
|
|
|
$this->_no_output = (bool) $flag; |
27
|
|
|
|
28
|
|
|
return $this; |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Prints the page header. If member variable $this->_no_output is |
33
|
|
|
* set then no header is drawn. |
34
|
|
|
* |
35
|
|
|
* @param $title The title of the page |
|
|
|
|
36
|
|
|
* @param $script script tag |
|
|
|
|
37
|
|
|
* @param bool $do_print boolean if false, the function will return the header content |
38
|
|
|
* @param mixed $template |
39
|
|
|
*/ |
40
|
|
|
public function printHeader($title = '', $script = null, $do_print = true, $template = 'header.twig') |
41
|
|
|
{ |
42
|
|
|
if (function_exists('newrelic_disable_autorum')) { |
43
|
|
|
newrelic_disable_autorum(); |
44
|
|
|
} |
45
|
|
|
$appName = $this->appName; |
|
|
|
|
46
|
|
|
$lang = $this->lang; |
47
|
|
|
$plugin_manager = $this->plugin_manager; |
48
|
|
|
|
49
|
|
|
$viewVars = []; |
50
|
|
|
|
51
|
|
|
$viewVars['dir'] = (0 != strcasecmp($lang['applangdir'], 'ltr')) ? ' dir="'.htmlspecialchars($lang['applangdir']).'"' : ''; |
52
|
|
|
$viewVars['headertemplate'] = $template; |
53
|
|
|
$viewVars['title'] = ('' !== $title) ? ' - '.$title : ''; |
54
|
|
|
$viewVars['appName'] = htmlspecialchars($this->appName); |
55
|
|
|
|
56
|
|
|
$viewVars['script'] = $script; |
57
|
|
|
//$this->prtrace($viewVars); |
58
|
|
|
$header_html = $this->view->fetch($template, $viewVars); |
59
|
|
|
|
60
|
|
|
/*$plugins_head = []; |
61
|
|
|
$_params = ['heads' => &$plugins_head]; |
62
|
|
|
|
63
|
|
|
$plugin_manager->doHook('head', $_params); |
64
|
|
|
|
65
|
|
|
foreach ($plugins_head as $tag) { |
66
|
|
|
$header_html .= $tag; |
67
|
|
|
}*/ |
68
|
|
|
|
69
|
|
|
if (!$this->_no_output && $do_print) { |
70
|
|
|
header('Content-Type: text/html; charset=utf-8'); |
71
|
|
|
echo $header_html; |
72
|
|
|
} else { |
73
|
|
|
return $header_html; |
74
|
|
|
} |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Prints the page body. |
79
|
|
|
* |
80
|
|
|
* @param bool $doBody True to output body tag, false to return |
81
|
|
|
* @param string $bodyClass - name of body class |
82
|
|
|
* @param bool $onloadInit - if true, call init() on body load event |
83
|
|
|
*/ |
84
|
|
|
public function printBody($doBody = true, $bodyClass = 'detailbody', $onloadInit = false) |
85
|
|
|
{ |
86
|
|
|
$bodyClass = $this->lang['applangdir'].' '.htmlspecialchars($bodyClass); |
87
|
|
|
$onload = ($onloadInit ? 'onload="init();" ' : ''); |
88
|
|
|
|
89
|
|
|
$bodyHtml = sprintf('<body data-controller="%s" class="%s" %s >', $this->controller_name, $bodyClass, $onload); |
90
|
|
|
$bodyHtml .= "\n"; |
91
|
|
|
|
92
|
|
|
if (!$this->_no_output && $doBody) { |
93
|
|
|
echo $bodyHtml; |
94
|
|
|
} else { |
95
|
|
|
return $bodyHtml; |
96
|
|
|
} |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* Print out the page heading and help link. |
101
|
|
|
* |
102
|
|
|
* @param $title Title, already escaped |
|
|
|
|
103
|
|
|
* @param $help (optional) The identifier for the help link |
|
|
|
|
104
|
|
|
* @param mixed $do_print |
105
|
|
|
*/ |
106
|
|
|
public function printTitle($title, $help = null, $do_print = true) |
107
|
|
|
{ |
108
|
|
|
$lang = $this->lang; |
|
|
|
|
109
|
|
|
|
110
|
|
|
$title_html = '<h2>'; |
111
|
|
|
$title_html .= $this->misc->printHelp($title, $help, false); |
112
|
|
|
$title_html .= "</h2>\n"; |
113
|
|
|
|
114
|
|
|
if ($do_print) { |
115
|
|
|
echo $title_html; |
116
|
|
|
} else { |
117
|
|
|
return $title_html; |
118
|
|
|
} |
119
|
|
|
} |
120
|
|
|
} |
121
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths