Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Figueroa <amenadiel@gmail.com>2018-05-11 00:33:45 +0300
committerFelipe Figueroa <amenadiel@gmail.com>2018-05-11 00:33:45 +0300
commit74f8dcf7961f4543874a30268e1fd869e1fbfd90 (patch)
tree2c2eac6dd6c04c9b79a2c9a018f9041272287d64 /src/controllers/PrivilegesController.php
parentf4fff1d90777778576174c46338fd9f87869f6a5 (diff)
parametrize controller title to reduce duplication when calling printHeader
Diffstat (limited to 'src/controllers/PrivilegesController.php')
-rw-r--r--src/controllers/PrivilegesController.php25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/controllers/PrivilegesController.php b/src/controllers/PrivilegesController.php
index a4599c3d..7b9a9efe 100644
--- a/src/controllers/PrivilegesController.php
+++ b/src/controllers/PrivilegesController.php
@@ -11,14 +11,15 @@ namespace PHPPgAdmin\Controller;
*/
class PrivilegesController extends BaseController
{
- public $table_place = 'privileges-privileges';
-
+ public $table_place = 'privileges-privileges';
+ public $controller_title = 'strprivileges';
/**
* Default method to render the controller according to the action parameter.
*/
public function render()
{
- $this->printHeader($this->lang['strprivileges']);
+
+ $this->printHeader();
$this->printBody();
switch ($this->action) {
@@ -73,8 +74,8 @@ class PrivilegesController extends BaseController
$this->printMsg($msg);
// Determine whether object should be ref'd by name or oid.
- if (isset($_REQUEST[$_REQUEST['subject'].'_oid'])) {
- $object = $_REQUEST[$_REQUEST['subject'].'_oid'];
+ if (isset($_REQUEST[$_REQUEST['subject'] . '_oid'])) {
+ $object = $_REQUEST[$_REQUEST['subject'] . '_oid'];
} else {
$object = $_REQUEST[$_REQUEST['subject']];
}
@@ -179,7 +180,7 @@ class PrivilegesController extends BaseController
$object = $_REQUEST[$_REQUEST['subject']];
if ('function' == $_REQUEST['subject']) {
- $objectoid = $_REQUEST[$_REQUEST['subject'].'_oid'];
+ $objectoid = $_REQUEST[$_REQUEST['subject'] . '_oid'];
$urlvars = [
'action' => 'alter',
'server' => $_REQUEST['server'],
@@ -302,7 +303,7 @@ class PrivilegesController extends BaseController
}
$this->printMsg($msg);
- echo '<form action="'.\SUBFOLDER."/src/views/privileges\" method=\"post\">\n";
+ echo '<form action="' . \SUBFOLDER . "/src/views/privileges\" method=\"post\">\n";
echo "<table>\n";
echo "<tr><th class=\"data left\">{$this->lang['strusers']}</th>\n";
echo '<td class="data1"><select name="username[]" multiple="multiple" size="', min(6, $users->recordCount()), "\">\n";
@@ -356,9 +357,9 @@ class PrivilegesController extends BaseController
echo "<p><input type=\"hidden\" name=\"action\" value=\"save\" />\n";
echo '<input type="hidden" name="mode" value="', htmlspecialchars($mode), "\" />\n";
echo '<input type="hidden" name="subject" value="', htmlspecialchars($_REQUEST['subject']), "\" />\n";
- if (isset($_REQUEST[$_REQUEST['subject'].'_oid'])) {
- echo '<input type="hidden" name="', htmlspecialchars($_REQUEST['subject'].'_oid'),
- '" value="', htmlspecialchars($_REQUEST[$_REQUEST['subject'].'_oid']), "\" />\n";
+ if (isset($_REQUEST[$_REQUEST['subject'] . '_oid'])) {
+ echo '<input type="hidden" name="', htmlspecialchars($_REQUEST['subject'] . '_oid'),
+ '" value="', htmlspecialchars($_REQUEST[$_REQUEST['subject'] . '_oid']), "\" />\n";
}
echo '<input type="hidden" name="', htmlspecialchars($_REQUEST['subject']),
@@ -379,8 +380,8 @@ class PrivilegesController extends BaseController
echo "</form>\n";
} else {
// Determine whether object should be ref'd by name or oid.
- if (isset($_REQUEST[$_REQUEST['subject'].'_oid'])) {
- $object = $_REQUEST[$_REQUEST['subject'].'_oid'];
+ if (isset($_REQUEST[$_REQUEST['subject'] . '_oid'])) {
+ $object = $_REQUEST[$_REQUEST['subject'] . '_oid'];
} else {
$object = $_REQUEST[$_REQUEST['subject']];
}