diff options
author | Felipe Figueroa <amenadiel@gmail.com> | 2018-03-21 14:19:40 +0300 |
---|---|---|
committer | Felipe Figueroa <amenadiel@gmail.com> | 2018-03-21 14:19:40 +0300 |
commit | 0cc5a0bc23dc46ad9b61dc563dab480e024a36cd (patch) | |
tree | 889c4f826fd4b51e45acc325ec2e1d63fae25550 /src/controllers/ViewsController.php | |
parent | f750d03b4e14b0334dcf30281be794a9e4a925b6 (diff) |
more phpdocs for Postgres.php, replaces php views with actual slim routes
Diffstat (limited to 'src/controllers/ViewsController.php')
-rw-r--r-- | src/controllers/ViewsController.php | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/controllers/ViewsController.php b/src/controllers/ViewsController.php index 7f6513c4..48b0ae3c 100644 --- a/src/controllers/ViewsController.php +++ b/src/controllers/ViewsController.php @@ -15,7 +15,7 @@ use PHPPgAdmin\Decorators\Decorator; */ class ViewsController extends BaseController { - public $script = 'views.php'; + public $script = 'views'; public $controller_name = 'ViewsController'; public $table_place = 'views-views'; @@ -120,13 +120,13 @@ class ViewsController extends BaseController $views = $data->getViews(); $columns = [ - 'view' => [ + 'view' => [ 'title' => $lang['strview'], 'field' => Decorator::field('relname'), - 'url' => \SUBFOLDER."/redirect/view?{$this->misc->href}&", + 'url' => \SUBFOLDER . "/redirect/view?{$this->misc->href}&", 'vars' => ['view' => 'relname'], ], - 'owner' => [ + 'owner' => [ 'title' => $lang['strowner'], 'field' => Decorator::field('relowner'), ], @@ -144,11 +144,11 @@ class ViewsController extends BaseController 'keycols' => ['view' => 'relname'], 'url' => 'views.php', ], - 'browse' => [ + 'browse' => [ 'content' => $lang['strbrowse'], 'attr' => [ 'href' => [ - 'url' => 'display.php', + 'url' => 'display', 'urlvars' => [ 'action' => 'confselectrows', 'subject' => 'view', @@ -158,7 +158,7 @@ class ViewsController extends BaseController ], ], ], - 'select' => [ + 'select' => [ 'content' => $lang['strselect'], 'attr' => [ 'href' => [ @@ -178,7 +178,7 @@ class ViewsController extends BaseController // 'vars' => array('view' => 'relname'), // ), - 'alter' => [ + 'alter' => [ 'content' => $lang['stralter'], 'attr' => [ 'href' => [ @@ -190,7 +190,7 @@ class ViewsController extends BaseController ], ], ], - 'drop' => [ + 'drop' => [ 'multiaction' => 'confirm_drop', 'content' => $lang['strdrop'], 'attr' => [ @@ -208,8 +208,8 @@ class ViewsController extends BaseController echo $this->printTable($views, $columns, $actions, $this->table_place, $lang['strnoviews']); $navlinks = [ - 'create' => [ - 'attr' => [ + 'create' => [ + 'attr' => [ 'href' => [ 'url' => 'views.php', 'urlvars' => [ @@ -223,7 +223,7 @@ class ViewsController extends BaseController 'content' => $lang['strcreateview'], ], 'createwiz' => [ - 'attr' => [ + 'attr' => [ 'href' => [ 'url' => 'views.php', 'urlvars' => [ @@ -255,7 +255,7 @@ class ViewsController extends BaseController $attrs = [ 'text' => Decorator::field('relname'), 'icon' => 'View', - 'iconAction' => Decorator::url('display.php', $reqvars, ['view' => Decorator::field('relname')]), + 'iconAction' => Decorator::url('display', $reqvars, ['view' => Decorator::field('relname')]), 'toolTip' => Decorator::field('relcomment'), 'action' => Decorator::redirecturl('redirect.php', $reqvars, ['view' => Decorator::field('relname')]), 'branch' => Decorator::url('views.php', $reqvars, ['action' => 'subtree', 'view' => Decorator::field('relname')]), @@ -313,7 +313,7 @@ class ViewsController extends BaseController $attrs = $data->getTableAttributes($_REQUEST['view']); - echo '<form action="'.\SUBFOLDER.'/src/views/'.$this->script.'" method="post" id="selectform">'; + echo '<form action="' . \SUBFOLDER . '/src/views/' . $this->script . '" method="post" id="selectform">'; echo "\n"; if ($attrs->recordCount() > 0) { @@ -446,7 +446,7 @@ class ViewsController extends BaseController $this->printTrail('view'); $this->printTitle($lang['strdrop'], 'pg.view.drop'); - echo '<form action="'.\SUBFOLDER."/src/views/views.php\" method=\"post\">\n"; + echo '<form action="' . \SUBFOLDER . "/src/views/views.php\" method=\"post\">\n"; //If multi drop if (isset($_REQUEST['ma'])) { @@ -558,7 +558,7 @@ class ViewsController extends BaseController [ 'schemaname' => $arrSelTables[$i]['schemaname'], 'tablename' => $arrSelTables[$i]['tablename'], - 'fieldname' => $attrs->fields['attname'], ] + 'fieldname' => $attrs->fields['attname']] ); $attrs->moveNext(); } @@ -567,7 +567,7 @@ class ViewsController extends BaseController } asort($arrFields); - echo '<form action="'.\SUBFOLDER."/src/views/views.php\" method=\"post\">\n"; + echo '<form action="' . \SUBFOLDER . "/src/views/views.php\" method=\"post\">\n"; echo "<table>\n"; echo "<tr><th class=\"data\">{$lang['strviewname']}</th></tr>"; echo "<tr>\n<td class=\"data1\">\n"; @@ -646,7 +646,7 @@ class ViewsController extends BaseController echo "<p><input type=\"hidden\" name=\"action\" value=\"save_create_wiz\" />\n"; foreach ($arrSelTables as $curTable) { - echo '<input type="hidden" name="formTables[]" value="'.htmlspecialchars(serialize($curTable))."\" />\n"; + echo '<input type="hidden" name="formTables[]" value="' . htmlspecialchars(serialize($curTable)) . "\" />\n"; } echo $this->misc->form; @@ -672,17 +672,17 @@ class ViewsController extends BaseController $this->printTitle($lang['strcreateviewwiz'], 'pg.view.create'); $this->printMsg($msg); - echo '<form action="'.\SUBFOLDER."/src/views/views.php\" method=\"post\">\n"; + echo '<form action="' . \SUBFOLDER . "/src/views/views.php\" method=\"post\">\n"; echo "<table>\n"; echo "<tr><th class=\"data\">{$lang['strtables']}</th></tr>"; echo "<tr>\n<td class=\"data1\">\n"; $arrTables = []; while (!$tables->EOF) { - $arrTmp = []; - $arrTmp['schemaname'] = $tables->fields['nspname']; - $arrTmp['tablename'] = $tables->fields['relname']; - $arrTables[$tables->fields['nspname'].'.'.$tables->fields['relname']] = serialize($arrTmp); + $arrTmp = []; + $arrTmp['schemaname'] = $tables->fields['nspname']; + $arrTmp['tablename'] = $tables->fields['relname']; + $arrTables[$tables->fields['nspname'] . '.' . $tables->fields['relname']] = serialize($arrTmp); $tables->moveNext(); } echo \PHPPgAdmin\XHtml\HTMLController::printCombo($arrTables, 'formTables[]', false, '', true); @@ -725,7 +725,7 @@ class ViewsController extends BaseController $this->printTitle($lang['strcreateview'], 'pg.view.create'); $this->printMsg($msg); - echo '<form action="'.\SUBFOLDER."/src/views/views.php\" method=\"post\">\n"; + echo '<form action="' . \SUBFOLDER . "/src/views/views.php\" method=\"post\">\n"; echo "<table style=\"width: 100%\">\n"; echo "\t<tr>\n\t\t<th class=\"data left required\">{$lang['strname']}</th>\n"; echo "\t<td class=\"data1\"><input name=\"formView\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"", @@ -844,7 +844,7 @@ class ViewsController extends BaseController if ((!in_array($curLink, $arrJoined, true) && in_array($tbl1, $arrUsedTbls, true)) || !count($arrJoined)) { // Make sure for multi-column foreign keys that we use a table alias tables joined to more than once // This can (and should be) more optimized for multi-column foreign keys - $adj_tbl2 = in_array($tbl2, $arrUsedTbls, true) ? "${tbl2} AS alias_ppa_".mktime() : $tbl2; + $adj_tbl2 = in_array($tbl2, $arrUsedTbls, true) ? "${tbl2} AS alias_ppa_" . mktime() : $tbl2; $linkFields .= strlen($linkFields) ? "{$curLink['operator']} ${adj_tbl2} ON (\"{$arrLeftLink['schemaname']}\".\"{$arrLeftLink['tablename']}\".\"{$arrLeftLink['fieldname']}\" = \"{$arrRightLink['schemaname']}\".\"{$arrRightLink['tablename']}\".\"{$arrRightLink['fieldname']}\") " : "${tbl1} {$curLink['operator']} ${adj_tbl2} ON (\"{$arrLeftLink['schemaname']}\".\"{$arrLeftLink['tablename']}\".\"{$arrLeftLink['fieldname']}\" = \"{$arrRightLink['schemaname']}\".\"{$arrRightLink['tablename']}\".\"{$arrRightLink['fieldname']}\") "; @@ -890,7 +890,7 @@ class ViewsController extends BaseController //add where from additional conditions if (strlen($addConditions)) { - $viewQuery .= ' WHERE '.$addConditions; + $viewQuery .= ' WHERE ' . $addConditions; } $status = $data->createView($_POST['formView'], $viewQuery, false, $_POST['formComment']); |