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-02-15 22:16:40 +0300
committerFelipe Figueroa <amenadiel@gmail.com>2018-02-15 22:16:40 +0300
commitb4944af333e89b9aa9d3bb5e975a4787599a40fc (patch)
tree6a3168933e419b8e7e8854a888bb6a508ee43502 /src/controllers/DomainsController.php
parent8c47e1b02e634855c2327c07a2770bd910072d70 (diff)
remove trailing slashes from use statements
Diffstat (limited to 'src/controllers/DomainsController.php')
-rw-r--r--src/controllers/DomainsController.php135
1 files changed, 71 insertions, 64 deletions
diff --git a/src/controllers/DomainsController.php b/src/controllers/DomainsController.php
index 2371d25c..36bf363e 100644
--- a/src/controllers/DomainsController.php
+++ b/src/controllers/DomainsController.php
@@ -6,17 +6,17 @@
namespace PHPPgAdmin\Controller;
-use \PHPPgAdmin\Decorators\Decorator;
+use PHPPgAdmin\Decorators\Decorator;
/**
- * Base controller class
+ * Base controller class.
*/
class DomainsController extends BaseController
{
public $controller_name = 'DomainsController';
/**
- * Default method to render the controller according to the action parameter
+ * Default method to render the controller according to the action parameter.
*/
public function render()
{
@@ -107,7 +107,8 @@ class DomainsController extends BaseController
}
/**
- * Show default list of domains in the database
+ * Show default list of domains in the database.
+ *
* @param mixed $msg
*/
public function doDefault($msg = '')
@@ -124,27 +125,27 @@ class DomainsController extends BaseController
$domains = $data->getDomains();
$columns = [
- 'domain' => [
+ 'domain' => [
'title' => $lang['strdomain'],
'field' => Decorator::field('domname'),
- 'url' => "domains.php?action=properties&amp;{$this->misc->href}&amp;",
- 'vars' => ['domain' => 'domname'],
+ 'url' => "domains.php?action=properties&amp;{$this->misc->href}&amp;",
+ 'vars' => ['domain' => 'domname'],
],
- 'type' => [
+ 'type' => [
'title' => $lang['strtype'],
'field' => Decorator::field('domtype'),
],
'notnull' => [
- 'title' => $lang['strnotnull'],
- 'field' => Decorator::field('domnotnull'),
- 'type' => 'bool',
+ 'title' => $lang['strnotnull'],
+ 'field' => Decorator::field('domnotnull'),
+ 'type' => 'bool',
'params' => ['true' => 'NOT NULL', 'false' => ''],
],
'default' => [
'title' => $lang['strdefault'],
'field' => Decorator::field('domdef'),
],
- 'owner' => [
+ 'owner' => [
'title' => $lang['strowner'],
'field' => Decorator::field('domowner'),
],
@@ -160,9 +161,9 @@ class DomainsController extends BaseController
$actions = [
'alter' => [
'content' => $lang['stralter'],
- 'attr' => [
+ 'attr' => [
'href' => [
- 'url' => 'domains.php',
+ 'url' => 'domains.php',
'urlvars' => [
'action' => 'alter',
'domain' => Decorator::field('domname'),
@@ -170,11 +171,11 @@ class DomainsController extends BaseController
],
],
],
- 'drop' => [
+ 'drop' => [
'content' => $lang['strdrop'],
- 'attr' => [
+ 'attr' => [
'href' => [
- 'url' => 'domains.php',
+ 'url' => 'domains.php',
'urlvars' => [
'action' => 'confirm_drop',
'domain' => Decorator::field('domname'),
@@ -192,14 +193,14 @@ class DomainsController extends BaseController
$navlinks = [
'create' => [
- 'attr' => [
+ 'attr' => [
'href' => [
- 'url' => 'domains.php',
+ 'url' => 'domains.php',
'urlvars' => [
- 'action' => 'create',
- 'server' => $_REQUEST['server'],
+ 'action' => 'create',
+ 'server' => $_REQUEST['server'],
'database' => $_REQUEST['database'],
- 'schema' => $_REQUEST['schema'],
+ 'schema' => $_REQUEST['schema'],
],
],
],
@@ -224,10 +225,10 @@ class DomainsController extends BaseController
$reqvars = $this->misc->getRequestVars('domain');
$attrs = [
- 'text' => Decorator::field('domname'),
- 'icon' => 'Domain',
+ 'text' => Decorator::field('domname'),
+ 'icon' => 'Domain',
'toolTip' => Decorator::field('domcomment'),
- 'action' => Decorator::actionurl(
+ 'action' => Decorator::actionurl(
'domains.php',
$reqvars,
[
@@ -241,7 +242,7 @@ class DomainsController extends BaseController
}
/**
- * Function to save after altering a domain
+ * Function to save after altering a domain.
*/
public function doSaveAlter()
{
@@ -264,7 +265,8 @@ class DomainsController extends BaseController
}
/**
- * Allow altering a domain
+ * Allow altering a domain.
+ *
* @param mixed $msg
*/
public function doAlter($msg = '')
@@ -285,8 +287,8 @@ class DomainsController extends BaseController
if ($domaindata->recordCount() > 0) {
if (!isset($_POST['domname'])) {
- $_POST['domtype'] = $domaindata->fields['domtype'];
- $_POST['domdefault'] = $domaindata->fields['domdef'];
+ $_POST['domtype'] = $domaindata->fields['domtype'];
+ $_POST['domdefault'] = $domaindata->fields['domdef'];
$domaindata->fields['domnotnull'] = $data->phpBool($domaindata->fields['domnotnull']);
if ($domaindata->fields['domnotnull']) {
$_POST['domnotnull'] = 'on';
@@ -296,7 +298,7 @@ class DomainsController extends BaseController
}
// Display domain info
- echo '<form action="' . \SUBFOLDER . "/src/views/domains.php\" method=\"post\">\n";
+ echo '<form action="'.\SUBFOLDER."/src/views/domains.php\" method=\"post\">\n";
echo "<table>\n";
echo "<tr><th class=\"data left required\" style=\"width: 70px\">{$lang['strname']}</th>\n";
echo '<td class="data1">', $this->misc->printVal($domaindata->fields['domname']), "</td></tr>\n";
@@ -329,7 +331,8 @@ class DomainsController extends BaseController
}
/**
- * Confirm and then actually add a CHECK constraint
+ * Confirm and then actually add a CHECK constraint.
+ *
* @param mixed $confirm
* @param mixed $msg
*/
@@ -353,7 +356,7 @@ class DomainsController extends BaseController
$this->printTitle($lang['straddcheck'], 'pg.constraint.check');
$this->printMsg($msg);
- echo '<form action="' . \SUBFOLDER . "/src/views/domains.php\" method=\"post\">\n";
+ echo '<form action="'.\SUBFOLDER."/src/views/domains.php\" method=\"post\">\n";
echo "<table>\n";
echo "<tr><th class=\"data\">{$lang['strname']}</th>\n";
echo "<th class=\"data required\">{$lang['strdefinition']}</th></tr>\n";
@@ -390,7 +393,8 @@ class DomainsController extends BaseController
}
/**
- * Show confirmation of drop constraint and perform actual drop
+ * Show confirmation of drop constraint and perform actual drop.
+ *
* @param mixed $confirm
* @param mixed $msg
*/
@@ -411,7 +415,7 @@ class DomainsController extends BaseController
$this->misc->printVal($_REQUEST['constraint']),
$this->misc->printVal($_REQUEST['domain'])
), "</p>\n";
- echo '<form action="' . \SUBFOLDER . "/src/views/domains.php\" method=\"post\">\n";
+ echo '<form action="'.\SUBFOLDER."/src/views/domains.php\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"drop_con\" />\n";
echo '<input type="hidden" name="domain" value="', htmlspecialchars($_REQUEST['domain']), "\" />\n";
echo '<input type="hidden" name="constraint" value="', htmlspecialchars($_REQUEST['constraint']), "\" />\n";
@@ -432,6 +436,7 @@ class DomainsController extends BaseController
/**
* Show properties for a domain. Allow manipulating constraints as well.
+ *
* @param mixed $msg
*/
public function doProperties($msg = '')
@@ -474,7 +479,7 @@ class DomainsController extends BaseController
$domaincons = $data->getDomainConstraints($_REQUEST['domain']);
$columns = [
- 'name' => [
+ 'name' => [
'title' => $lang['strname'],
'field' => Decorator::field('conname'),
],
@@ -482,7 +487,7 @@ class DomainsController extends BaseController
'title' => $lang['strdefinition'],
'field' => Decorator::field('consrc'),
],
- 'actions' => [
+ 'actions' => [
'title' => $lang['stractions'],
],
];
@@ -490,14 +495,14 @@ class DomainsController extends BaseController
$actions = [
'drop' => [
'content' => $lang['strdrop'],
- 'attr' => [
+ 'attr' => [
'href' => [
- 'url' => 'domains.php',
+ 'url' => 'domains.php',
'urlvars' => [
- 'action' => 'confirm_drop_con',
- 'domain' => $_REQUEST['domain'],
+ 'action' => 'confirm_drop_con',
+ 'domain' => $_REQUEST['domain'],
'constraint' => Decorator::field('conname'),
- 'type' => Decorator::field('contype'),
+ 'type' => Decorator::field('contype'),
],
],
],
@@ -512,15 +517,15 @@ class DomainsController extends BaseController
$navlinks = [
'drop' => [
- 'attr' => [
+ 'attr' => [
'href' => [
- 'url' => 'domains.php',
+ 'url' => 'domains.php',
'urlvars' => [
- 'action' => 'confirm_drop',
- 'server' => $_REQUEST['server'],
+ 'action' => 'confirm_drop',
+ 'server' => $_REQUEST['server'],
'database' => $_REQUEST['database'],
- 'schema' => $_REQUEST['schema'],
- 'domain' => $_REQUEST['domain'],
+ 'schema' => $_REQUEST['schema'],
+ 'domain' => $_REQUEST['domain'],
],
],
],
@@ -529,30 +534,30 @@ class DomainsController extends BaseController
];
if ($data->hasAlterDomains()) {
$navlinks['addcheck'] = [
- 'attr' => [
+ 'attr' => [
'href' => [
- 'url' => 'domains.php',
+ 'url' => 'domains.php',
'urlvars' => [
- 'action' => 'add_check',
- 'server' => $_REQUEST['server'],
+ 'action' => 'add_check',
+ 'server' => $_REQUEST['server'],
'database' => $_REQUEST['database'],
- 'schema' => $_REQUEST['schema'],
- 'domain' => $_REQUEST['domain'],
+ 'schema' => $_REQUEST['schema'],
+ 'domain' => $_REQUEST['domain'],
],
],
],
'content' => $lang['straddcheck'],
];
$navlinks['alter'] = [
- 'attr' => [
+ 'attr' => [
'href' => [
- 'url' => 'domains.php',
+ 'url' => 'domains.php',
'urlvars' => [
- 'action' => 'alter',
- 'server' => $_REQUEST['server'],
+ 'action' => 'alter',
+ 'server' => $_REQUEST['server'],
'database' => $_REQUEST['database'],
- 'schema' => $_REQUEST['schema'],
- 'domain' => $_REQUEST['domain'],
+ 'schema' => $_REQUEST['schema'],
+ 'domain' => $_REQUEST['domain'],
],
],
],
@@ -564,7 +569,8 @@ class DomainsController extends BaseController
}
/**
- * Show confirmation of drop and perform actual drop
+ * Show confirmation of drop and perform actual drop.
+ *
* @param mixed $confirm
*/
public function doDrop($confirm)
@@ -579,7 +585,7 @@ class DomainsController extends BaseController
$this->printTitle($lang['strdrop'], 'pg.domain.drop');
echo '<p>', sprintf($lang['strconfdropdomain'], $this->misc->printVal($_REQUEST['domain'])), "</p>\n";
- echo '<form action="' . \SUBFOLDER . "/src/views/domains.php\" method=\"post\">\n";
+ echo '<form action="'.\SUBFOLDER."/src/views/domains.php\" method=\"post\">\n";
echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /><label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<p><input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo '<input type="hidden" name="domain" value="', htmlspecialchars($_REQUEST['domain']), "\" />\n";
@@ -598,7 +604,8 @@ class DomainsController extends BaseController
}
/**
- * Displays a screen where they can enter a new domain
+ * Displays a screen where they can enter a new domain.
+ *
* @param mixed $msg
*/
public function doCreate($msg = '')
@@ -638,7 +645,7 @@ class DomainsController extends BaseController
$this->printTitle($lang['strcreatedomain'], 'pg.domain.create');
$this->printMsg($msg);
- echo '<form action="' . \SUBFOLDER . "/src/views/domains.php\" method=\"post\">\n";
+ echo '<form action="'.\SUBFOLDER."/src/views/domains.php\" method=\"post\">\n";
echo "<table>\n";
echo "<tr><th class=\"data left required\" style=\"width: 70px\">{$lang['strname']}</th>\n";
echo "<td class=\"data1\"><input name=\"domname\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
@@ -684,7 +691,7 @@ class DomainsController extends BaseController
}
/**
- * Actually creates the new domain in the database
+ * Actually creates the new domain in the database.
*/
public function doSaveCreate()
{