Conditions | 21 |
Paths | 18 |
Total Lines | 684 |
Code Lines | 550 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
1114 | public function getNavTabs($section) |
||
1115 | { |
||
1116 | $data = $this->getDatabaseAccessor(); |
||
1117 | $lang = $this->lang; |
||
1118 | $plugin_manager = $this->plugin_manager; |
||
1119 | |||
1120 | $hide_advanced = ($this->conf['show_advanced'] === false); |
||
1121 | $tabs = []; |
||
1122 | |||
1123 | switch ($section) { |
||
1124 | case 'root': |
||
1125 | $tabs = [ |
||
1126 | 'intro' => [ |
||
1127 | 'title' => $lang['strintroduction'], |
||
1128 | 'url' => 'intro', |
||
1129 | 'icon' => 'Introduction', |
||
1130 | ], |
||
1131 | 'servers' => [ |
||
1132 | 'title' => $lang['strservers'], |
||
1133 | 'url' => 'servers', |
||
1134 | 'icon' => 'Servers', |
||
1135 | ], |
||
1136 | ]; |
||
1137 | |||
1138 | break; |
||
1139 | case 'server': |
||
1140 | $hide_users = true; |
||
1141 | if ($data) { |
||
1142 | $hide_users = !$data->isSuperUser(); |
||
1143 | } |
||
1144 | |||
1145 | $tabs = [ |
||
1146 | 'databases' => [ |
||
1147 | 'title' => $lang['strdatabases'], |
||
1148 | 'url' => 'alldb', |
||
1149 | 'urlvars' => ['subject' => 'server'], |
||
1150 | 'help' => 'pg.database', |
||
1151 | 'icon' => 'Databases', |
||
1152 | ], |
||
1153 | ]; |
||
1154 | if ($data && $data->hasRoles()) { |
||
1155 | $tabs = array_merge($tabs, [ |
||
1 ignored issue
–
show
|
|||
1156 | 'roles' => [ |
||
1157 | 'title' => $lang['strroles'], |
||
1158 | 'url' => 'roles', |
||
1159 | 'urlvars' => ['subject' => 'server'], |
||
1160 | 'hide' => $hide_users, |
||
1161 | 'help' => 'pg.role', |
||
1162 | 'icon' => 'Roles', |
||
1163 | ], |
||
1164 | ]); |
||
1 ignored issue
–
show
|
|||
1165 | } else { |
||
1166 | $tabs = array_merge($tabs, [ |
||
1 ignored issue
–
show
|
|||
1167 | 'users' => [ |
||
1168 | 'title' => $lang['strusers'], |
||
1169 | 'url' => 'users', |
||
1170 | 'urlvars' => ['subject' => 'server'], |
||
1171 | 'hide' => $hide_users, |
||
1172 | 'help' => 'pg.user', |
||
1173 | 'icon' => 'Users', |
||
1174 | ], |
||
1175 | 'groups' => [ |
||
1176 | 'title' => $lang['strgroups'], |
||
1177 | 'url' => 'groups', |
||
1178 | 'urlvars' => ['subject' => 'server'], |
||
1179 | 'hide' => $hide_users, |
||
1180 | 'help' => 'pg.group', |
||
1181 | 'icon' => 'UserGroups', |
||
1182 | ], |
||
1183 | ]); |
||
1 ignored issue
–
show
|
|||
1184 | } |
||
1185 | |||
1186 | $tabs = array_merge($tabs, [ |
||
1 ignored issue
–
show
|
|||
1187 | 'account' => [ |
||
1188 | 'title' => $lang['straccount'], |
||
1189 | 'url' => ($data && $data->hasRoles()) ? 'roles' : 'users', |
||
1190 | 'urlvars' => ['subject' => 'server', 'action' => 'account'], |
||
1191 | 'hide' => !$hide_users, |
||
1192 | 'help' => 'pg.role', |
||
1193 | 'icon' => 'User', |
||
1194 | ], |
||
1195 | 'tablespaces' => [ |
||
1196 | 'title' => $lang['strtablespaces'], |
||
1197 | 'url' => 'tablespaces', |
||
1198 | 'urlvars' => ['subject' => 'server'], |
||
1199 | 'hide' => !$data || !$data->hasTablespaces(), |
||
1200 | 'help' => 'pg.tablespace', |
||
1201 | 'icon' => 'Tablespaces', |
||
1202 | ], |
||
1203 | 'export' => [ |
||
1204 | 'title' => $lang['strexport'], |
||
1205 | 'url' => 'alldb', |
||
1206 | 'urlvars' => ['subject' => 'server', 'action' => 'export'], |
||
1207 | 'hide' => !$this->isDumpEnabled(), |
||
1208 | 'icon' => 'Export', |
||
1209 | ], |
||
1210 | ]); |
||
1 ignored issue
–
show
|
|||
1211 | |||
1212 | break; |
||
1213 | case 'database': |
||
1214 | $tabs = [ |
||
1215 | 'schemas' => [ |
||
1216 | 'title' => $lang['strschemas'], |
||
1217 | 'url' => 'schemas', |
||
1218 | 'urlvars' => ['subject' => 'database'], |
||
1219 | 'help' => 'pg.schema', |
||
1220 | 'icon' => 'Schemas', |
||
1221 | ], |
||
1222 | 'sql' => [ |
||
1223 | 'title' => $lang['strsql'], |
||
1224 | 'url' => 'database', |
||
1225 | 'urlvars' => ['subject' => 'database', 'action' => 'sql', 'new' => 1], |
||
1226 | 'help' => 'pg.sql', |
||
1227 | 'tree' => false, |
||
1228 | 'icon' => 'SqlEditor', |
||
1229 | ], |
||
1230 | 'find' => [ |
||
1231 | 'title' => $lang['strfind'], |
||
1232 | 'url' => 'database', |
||
1233 | 'urlvars' => ['subject' => 'database', 'action' => 'find'], |
||
1234 | 'tree' => false, |
||
1235 | 'icon' => 'Search', |
||
1236 | ], |
||
1237 | 'variables' => [ |
||
1238 | 'title' => $lang['strvariables'], |
||
1239 | 'url' => 'database', |
||
1240 | 'urlvars' => ['subject' => 'database', 'action' => 'variables'], |
||
1241 | 'help' => 'pg.variable', |
||
1242 | 'tree' => false, |
||
1243 | 'icon' => 'Variables', |
||
1244 | ], |
||
1245 | 'processes' => [ |
||
1246 | 'title' => $lang['strprocesses'], |
||
1247 | 'url' => 'database', |
||
1248 | 'urlvars' => ['subject' => 'database', 'action' => 'processes'], |
||
1249 | 'help' => 'pg.process', |
||
1250 | 'tree' => false, |
||
1251 | 'icon' => 'Processes', |
||
1252 | ], |
||
1253 | 'locks' => [ |
||
1254 | 'title' => $lang['strlocks'], |
||
1255 | 'url' => 'database', |
||
1256 | 'urlvars' => ['subject' => 'database', 'action' => 'locks'], |
||
1257 | 'help' => 'pg.locks', |
||
1258 | 'tree' => false, |
||
1259 | 'icon' => 'Key', |
||
1260 | ], |
||
1261 | 'admin' => [ |
||
1262 | 'title' => $lang['stradmin'], |
||
1263 | 'url' => 'database', |
||
1264 | 'urlvars' => ['subject' => 'database', 'action' => 'admin'], |
||
1265 | 'tree' => false, |
||
1266 | 'icon' => 'Admin', |
||
1267 | ], |
||
1268 | 'privileges' => [ |
||
1269 | 'title' => $lang['strprivileges'], |
||
1270 | 'url' => 'privileges', |
||
1271 | 'urlvars' => ['subject' => 'database'], |
||
1272 | 'hide' => !isset($data->privlist['database']), |
||
1273 | 'help' => 'pg.privilege', |
||
1274 | 'tree' => false, |
||
1275 | 'icon' => 'Privileges', |
||
1276 | ], |
||
1277 | 'languages' => [ |
||
1278 | 'title' => $lang['strlanguages'], |
||
1279 | 'url' => 'languages', |
||
1280 | 'urlvars' => ['subject' => 'database'], |
||
1281 | 'hide' => $hide_advanced, |
||
1282 | 'help' => 'pg.language', |
||
1283 | 'icon' => 'Languages', |
||
1284 | ], |
||
1285 | 'casts' => [ |
||
1286 | 'title' => $lang['strcasts'], |
||
1287 | 'url' => 'casts', |
||
1288 | 'urlvars' => ['subject' => 'database'], |
||
1289 | 'hide' => $hide_advanced, |
||
1290 | 'help' => 'pg.cast', |
||
1291 | 'icon' => 'Casts', |
||
1292 | ], |
||
1293 | 'export' => [ |
||
1294 | 'title' => $lang['strexport'], |
||
1295 | 'url' => 'database', |
||
1296 | 'urlvars' => ['subject' => 'database', 'action' => 'export'], |
||
1297 | 'hide' => !$this->isDumpEnabled(), |
||
1298 | 'tree' => false, |
||
1299 | 'icon' => 'Export', |
||
1300 | ], |
||
1301 | ]; |
||
1302 | |||
1303 | break; |
||
1304 | case 'schema': |
||
1305 | $tabs = [ |
||
1306 | 'tables' => [ |
||
1307 | 'title' => $lang['strtables'], |
||
1308 | 'url' => 'tables', |
||
1309 | 'urlvars' => ['subject' => 'schema'], |
||
1310 | 'help' => 'pg.table', |
||
1311 | 'icon' => 'Tables', |
||
1312 | ], |
||
1313 | 'views' => [ |
||
1314 | 'title' => $lang['strviews'], |
||
1315 | 'url' => 'views', |
||
1316 | 'urlvars' => ['subject' => 'schema'], |
||
1317 | 'help' => 'pg.view', |
||
1318 | 'icon' => 'Views', |
||
1319 | ], |
||
1320 | 'matviews' => [ |
||
1321 | 'title' => 'M '.$lang['strviews'], |
||
1322 | 'url' => 'materializedviews', |
||
1323 | 'urlvars' => ['subject' => 'schema'], |
||
1324 | 'help' => 'pg.matview', |
||
1325 | 'icon' => 'MViews', |
||
1326 | ], |
||
1327 | 'sequences' => [ |
||
1328 | 'title' => $lang['strsequences'], |
||
1329 | 'url' => 'sequences', |
||
1330 | 'urlvars' => ['subject' => 'schema'], |
||
1331 | 'help' => 'pg.sequence', |
||
1332 | 'icon' => 'Sequences', |
||
1333 | ], |
||
1334 | 'functions' => [ |
||
1335 | 'title' => $lang['strfunctions'], |
||
1336 | 'url' => 'functions', |
||
1337 | 'urlvars' => ['subject' => 'schema'], |
||
1338 | 'help' => 'pg.function', |
||
1339 | 'icon' => 'Functions', |
||
1340 | ], |
||
1341 | 'fulltext' => [ |
||
1342 | 'title' => $lang['strfulltext'], |
||
1343 | 'url' => 'fulltext', |
||
1344 | 'urlvars' => ['subject' => 'schema'], |
||
1345 | 'help' => 'pg.fts', |
||
1346 | 'tree' => true, |
||
1347 | 'icon' => 'Fts', |
||
1348 | ], |
||
1349 | 'domains' => [ |
||
1350 | 'title' => $lang['strdomains'], |
||
1351 | 'url' => 'domains', |
||
1352 | 'urlvars' => ['subject' => 'schema'], |
||
1353 | 'help' => 'pg.domain', |
||
1354 | 'icon' => 'Domains', |
||
1355 | ], |
||
1356 | 'aggregates' => [ |
||
1357 | 'title' => $lang['straggregates'], |
||
1358 | 'url' => 'aggregates', |
||
1359 | 'urlvars' => ['subject' => 'schema'], |
||
1360 | 'hide' => $hide_advanced, |
||
1361 | 'help' => 'pg.aggregate', |
||
1362 | 'icon' => 'Aggregates', |
||
1363 | ], |
||
1364 | 'types' => [ |
||
1365 | 'title' => $lang['strtypes'], |
||
1366 | 'url' => 'types', |
||
1367 | 'urlvars' => ['subject' => 'schema'], |
||
1368 | 'hide' => $hide_advanced, |
||
1369 | 'help' => 'pg.type', |
||
1370 | 'icon' => 'Types', |
||
1371 | ], |
||
1372 | 'operators' => [ |
||
1373 | 'title' => $lang['stroperators'], |
||
1374 | 'url' => 'operators', |
||
1375 | 'urlvars' => ['subject' => 'schema'], |
||
1376 | 'hide' => $hide_advanced, |
||
1377 | 'help' => 'pg.operator', |
||
1378 | 'icon' => 'Operators', |
||
1379 | ], |
||
1380 | 'opclasses' => [ |
||
1381 | 'title' => $lang['stropclasses'], |
||
1382 | 'url' => 'opclasses', |
||
1383 | 'urlvars' => ['subject' => 'schema'], |
||
1384 | 'hide' => $hide_advanced, |
||
1385 | 'help' => 'pg.opclass', |
||
1386 | 'icon' => 'OperatorClasses', |
||
1387 | ], |
||
1388 | 'conversions' => [ |
||
1389 | 'title' => $lang['strconversions'], |
||
1390 | 'url' => 'conversions', |
||
1391 | 'urlvars' => ['subject' => 'schema'], |
||
1392 | 'hide' => $hide_advanced, |
||
1393 | 'help' => 'pg.conversion', |
||
1394 | 'icon' => 'Conversions', |
||
1395 | ], |
||
1396 | 'privileges' => [ |
||
1397 | 'title' => $lang['strprivileges'], |
||
1398 | 'url' => 'privileges', |
||
1399 | 'urlvars' => ['subject' => 'schema'], |
||
1400 | 'help' => 'pg.privilege', |
||
1401 | 'tree' => false, |
||
1402 | 'icon' => 'Privileges', |
||
1403 | ], |
||
1404 | 'export' => [ |
||
1405 | 'title' => $lang['strexport'], |
||
1406 | 'url' => 'schemas', |
||
1407 | 'urlvars' => ['subject' => 'schema', 'action' => 'export'], |
||
1408 | 'hide' => !$this->isDumpEnabled(), |
||
1409 | 'tree' => false, |
||
1410 | 'icon' => 'Export', |
||
1411 | ], |
||
1412 | ]; |
||
1413 | if (!$data->hasFTS()) { |
||
1414 | unset($tabs['fulltext']); |
||
1415 | } |
||
1416 | |||
1417 | break; |
||
1418 | case 'table': |
||
1419 | $tabs = [ |
||
1420 | 'columns' => [ |
||
1421 | 'title' => $lang['strcolumns'], |
||
1422 | 'url' => 'tblproperties', |
||
1423 | 'urlvars' => ['subject' => 'table', 'table' => Decorator::field('table')], |
||
1424 | 'icon' => 'Columns', |
||
1425 | 'branch' => true, |
||
1426 | ], |
||
1427 | 'browse' => [ |
||
1428 | 'title' => $lang['strbrowse'], |
||
1429 | 'icon' => 'Columns', |
||
1430 | 'url' => 'display', |
||
1431 | 'urlvars' => ['subject' => 'table', 'table' => Decorator::field('table')], |
||
1432 | 'return' => 'table', |
||
1433 | 'branch' => true, |
||
1434 | ], |
||
1435 | 'select' => [ |
||
1436 | 'title' => $lang['strselect'], |
||
1437 | 'icon' => 'Search', |
||
1438 | 'url' => 'tables', |
||
1439 | 'urlvars' => ['subject' => 'table', 'table' => Decorator::field('table'), 'action' => 'confselectrows'], |
||
1440 | 'help' => 'pg.sql.select', |
||
1441 | ], |
||
1442 | 'insert' => [ |
||
1443 | 'title' => $lang['strinsert'], |
||
1444 | 'url' => 'tables', |
||
1445 | 'urlvars' => [ |
||
1446 | 'action' => 'confinsertrow', |
||
1447 | 'table' => Decorator::field('table'), |
||
1448 | ], |
||
1449 | 'help' => 'pg.sql.insert', |
||
1450 | 'icon' => 'Operator', |
||
1451 | ], |
||
1452 | 'indexes' => [ |
||
1453 | 'title' => $lang['strindexes'], |
||
1454 | 'url' => 'indexes', |
||
1455 | 'urlvars' => ['subject' => 'table', 'table' => Decorator::field('table')], |
||
1456 | 'help' => 'pg.index', |
||
1457 | 'icon' => 'Indexes', |
||
1458 | 'branch' => true, |
||
1459 | ], |
||
1460 | 'constraints' => [ |
||
1461 | 'title' => $lang['strconstraints'], |
||
1462 | 'url' => 'constraints', |
||
1463 | 'urlvars' => ['subject' => 'table', 'table' => Decorator::field('table')], |
||
1464 | 'help' => 'pg.constraint', |
||
1465 | 'icon' => 'Constraints', |
||
1466 | 'branch' => true, |
||
1467 | ], |
||
1468 | 'triggers' => [ |
||
1469 | 'title' => $lang['strtriggers'], |
||
1470 | 'url' => 'triggers', |
||
1471 | 'urlvars' => ['subject' => 'table', 'table' => Decorator::field('table')], |
||
1472 | 'help' => 'pg.trigger', |
||
1473 | 'icon' => 'Triggers', |
||
1474 | 'branch' => true, |
||
1475 | ], |
||
1476 | 'rules' => [ |
||
1477 | 'title' => $lang['strrules'], |
||
1478 | 'url' => 'rules', |
||
1479 | 'urlvars' => ['subject' => 'table', 'table' => Decorator::field('table')], |
||
1480 | 'help' => 'pg.rule', |
||
1481 | 'icon' => 'Rules', |
||
1482 | 'branch' => true, |
||
1483 | ], |
||
1484 | 'admin' => [ |
||
1485 | 'title' => $lang['stradmin'], |
||
1486 | 'url' => 'tables', |
||
1487 | 'urlvars' => ['subject' => 'table', 'table' => Decorator::field('table'), 'action' => 'admin'], |
||
1488 | 'icon' => 'Admin', |
||
1489 | ], |
||
1490 | 'info' => [ |
||
1491 | 'title' => $lang['strinfo'], |
||
1492 | 'url' => 'info', |
||
1493 | 'urlvars' => ['subject' => 'table', 'table' => Decorator::field('table')], |
||
1494 | 'icon' => 'Statistics', |
||
1495 | ], |
||
1496 | 'privileges' => [ |
||
1497 | 'title' => $lang['strprivileges'], |
||
1498 | 'url' => 'privileges', |
||
1499 | 'urlvars' => ['subject' => 'table', 'table' => Decorator::field('table')], |
||
1500 | 'help' => 'pg.privilege', |
||
1501 | 'icon' => 'Privileges', |
||
1502 | ], |
||
1503 | 'import' => [ |
||
1504 | 'title' => $lang['strimport'], |
||
1505 | 'url' => 'tblproperties', |
||
1506 | 'urlvars' => ['subject' => 'table', 'table' => Decorator::field('table'), 'action' => 'import'], |
||
1507 | 'icon' => 'Import', |
||
1508 | 'hide' => false, |
||
1509 | ], |
||
1510 | 'export' => [ |
||
1511 | 'title' => $lang['strexport'], |
||
1512 | 'url' => 'tblproperties', |
||
1513 | 'urlvars' => ['subject' => 'table', 'table' => Decorator::field('table'), 'action' => 'export'], |
||
1514 | 'icon' => 'Export', |
||
1515 | 'hide' => false, |
||
1516 | ], |
||
1517 | ]; |
||
1518 | |||
1519 | break; |
||
1520 | case 'view': |
||
1521 | $tabs = [ |
||
1522 | 'columns' => [ |
||
1523 | 'title' => $lang['strcolumns'], |
||
1524 | 'url' => 'viewproperties', |
||
1525 | 'urlvars' => ['subject' => 'view', 'view' => Decorator::field('view')], |
||
1526 | 'icon' => 'Columns', |
||
1527 | 'branch' => true, |
||
1528 | ], |
||
1529 | 'browse' => [ |
||
1530 | 'title' => $lang['strbrowse'], |
||
1531 | 'icon' => 'Columns', |
||
1532 | 'url' => 'display', |
||
1533 | 'urlvars' => [ |
||
1534 | 'action' => 'confselectrows', |
||
1535 | 'return' => 'schema', |
||
1536 | 'subject' => 'view', |
||
1537 | 'view' => Decorator::field('view'), |
||
1538 | ], |
||
1539 | 'branch' => true, |
||
1540 | ], |
||
1541 | 'select' => [ |
||
1542 | 'title' => $lang['strselect'], |
||
1543 | 'icon' => 'Search', |
||
1544 | 'url' => 'views', |
||
1545 | 'urlvars' => ['action' => 'confselectrows', 'view' => Decorator::field('view')], |
||
1546 | 'help' => 'pg.sql.select', |
||
1547 | ], |
||
1548 | 'definition' => [ |
||
1549 | 'title' => $lang['strdefinition'], |
||
1550 | 'url' => 'viewproperties', |
||
1551 | 'urlvars' => ['subject' => 'view', 'view' => Decorator::field('view'), 'action' => 'definition'], |
||
1552 | 'icon' => 'Definition', |
||
1553 | ], |
||
1554 | 'rules' => [ |
||
1555 | 'title' => $lang['strrules'], |
||
1556 | 'url' => 'rules', |
||
1557 | 'urlvars' => ['subject' => 'view', 'view' => Decorator::field('view')], |
||
1558 | 'help' => 'pg.rule', |
||
1559 | 'icon' => 'Rules', |
||
1560 | 'branch' => true, |
||
1561 | ], |
||
1562 | 'privileges' => [ |
||
1563 | 'title' => $lang['strprivileges'], |
||
1564 | 'url' => 'privileges', |
||
1565 | 'urlvars' => ['subject' => 'view', 'view' => Decorator::field('view')], |
||
1566 | 'help' => 'pg.privilege', |
||
1567 | 'icon' => 'Privileges', |
||
1568 | ], |
||
1569 | 'export' => [ |
||
1570 | 'title' => $lang['strexport'], |
||
1571 | 'url' => 'viewproperties', |
||
1572 | 'urlvars' => ['subject' => 'view', 'view' => Decorator::field('view'), 'action' => 'export'], |
||
1573 | 'icon' => 'Export', |
||
1574 | 'hide' => false, |
||
1575 | ], |
||
1576 | ]; |
||
1577 | |||
1578 | break; |
||
1579 | case 'matview': |
||
1580 | $tabs = [ |
||
1581 | 'columns' => [ |
||
1582 | 'title' => $lang['strcolumns'], |
||
1583 | 'url' => 'materializedviewproperties', |
||
1584 | 'urlvars' => ['subject' => 'matview', 'matview' => Decorator::field('matview')], |
||
1585 | 'icon' => 'Columns', |
||
1586 | 'branch' => true, |
||
1587 | ], |
||
1588 | 'browse' => [ |
||
1589 | 'title' => $lang['strbrowse'], |
||
1590 | 'icon' => 'Columns', |
||
1591 | 'url' => 'display', |
||
1592 | 'urlvars' => [ |
||
1593 | 'action' => 'confselectrows', |
||
1594 | 'return' => 'schema', |
||
1595 | 'subject' => 'matview', |
||
1596 | 'matview' => Decorator::field('matview'), |
||
1597 | ], |
||
1598 | 'branch' => true, |
||
1599 | ], |
||
1600 | 'select' => [ |
||
1601 | 'title' => $lang['strselect'], |
||
1602 | 'icon' => 'Search', |
||
1603 | 'url' => 'materializedviews', |
||
1604 | 'urlvars' => ['action' => 'confselectrows', 'matview' => Decorator::field('matview')], |
||
1605 | 'help' => 'pg.sql.select', |
||
1606 | ], |
||
1607 | 'definition' => [ |
||
1608 | 'title' => $lang['strdefinition'], |
||
1609 | 'url' => 'materializedviewproperties', |
||
1610 | 'urlvars' => ['subject' => 'matview', 'matview' => Decorator::field('matview'), 'action' => 'definition'], |
||
1611 | 'icon' => 'Definition', |
||
1612 | ], |
||
1613 | 'indexes' => [ |
||
1614 | 'title' => $lang['strindexes'], |
||
1615 | 'url' => 'indexes', |
||
1616 | 'urlvars' => ['subject' => 'matview', 'matview' => Decorator::field('matview')], |
||
1617 | 'help' => 'pg.index', |
||
1618 | 'icon' => 'Indexes', |
||
1619 | 'branch' => true, |
||
1620 | ], |
||
1621 | /*'constraints' => [ |
||
1622 | 'title' => $lang['strconstraints'], |
||
1623 | 'url' => 'constraints', |
||
1624 | 'urlvars' => ['subject' => 'matview', 'matview' => Decorator::field('matview')], |
||
1625 | 'help' => 'pg.constraint', |
||
1626 | 'icon' => 'Constraints', |
||
1627 | 'branch' => true, |
||
1628 | */ |
||
1629 | |||
1630 | 'rules' => [ |
||
1631 | 'title' => $lang['strrules'], |
||
1632 | 'url' => 'rules', |
||
1633 | 'urlvars' => ['subject' => 'matview', 'matview' => Decorator::field('matview')], |
||
1634 | 'help' => 'pg.rule', |
||
1635 | 'icon' => 'Rules', |
||
1636 | 'branch' => true, |
||
1637 | ], |
||
1638 | 'privileges' => [ |
||
1639 | 'title' => $lang['strprivileges'], |
||
1640 | 'url' => 'privileges', |
||
1641 | 'urlvars' => ['subject' => 'matview', 'matview' => Decorator::field('matview')], |
||
1642 | 'help' => 'pg.privilege', |
||
1643 | 'icon' => 'Privileges', |
||
1644 | ], |
||
1645 | 'export' => [ |
||
1646 | 'title' => $lang['strexport'], |
||
1647 | 'url' => 'materializedviewproperties', |
||
1648 | 'urlvars' => ['subject' => 'matview', 'matview' => Decorator::field('matview'), 'action' => 'export'], |
||
1649 | 'icon' => 'Export', |
||
1650 | 'hide' => false, |
||
1651 | ], |
||
1652 | ]; |
||
1653 | |||
1654 | break; |
||
1655 | case 'function': |
||
1656 | $tabs = [ |
||
1657 | 'definition' => [ |
||
1658 | 'title' => $lang['strdefinition'], |
||
1659 | 'url' => 'functions', |
||
1660 | 'urlvars' => [ |
||
1661 | 'subject' => 'function', |
||
1662 | 'function' => Decorator::field('function'), |
||
1663 | 'function_oid' => Decorator::field('function_oid'), |
||
1664 | 'action' => 'properties', |
||
1665 | ], |
||
1666 | 'icon' => 'Definition', |
||
1667 | ], |
||
1668 | 'privileges' => [ |
||
1669 | 'title' => $lang['strprivileges'], |
||
1670 | 'url' => 'privileges', |
||
1671 | 'urlvars' => [ |
||
1672 | 'subject' => 'function', |
||
1673 | 'function' => Decorator::field('function'), |
||
1674 | 'function_oid' => Decorator::field('function_oid'), |
||
1675 | ], |
||
1676 | 'icon' => 'Privileges', |
||
1677 | ], |
||
1678 | ]; |
||
1679 | |||
1680 | break; |
||
1681 | case 'aggregate': |
||
1682 | $tabs = [ |
||
1683 | 'definition' => [ |
||
1684 | 'title' => $lang['strdefinition'], |
||
1685 | 'url' => 'aggregates', |
||
1686 | 'urlvars' => [ |
||
1687 | 'subject' => 'aggregate', |
||
1688 | 'aggrname' => Decorator::field('aggrname'), |
||
1689 | 'aggrtype' => Decorator::field('aggrtype'), |
||
1690 | 'action' => 'properties', |
||
1691 | ], |
||
1692 | 'icon' => 'Definition', |
||
1693 | ], |
||
1694 | ]; |
||
1695 | |||
1696 | break; |
||
1697 | case 'role': |
||
1698 | $tabs = [ |
||
1699 | 'definition' => [ |
||
1700 | 'title' => $lang['strdefinition'], |
||
1701 | 'url' => 'roles', |
||
1702 | 'urlvars' => [ |
||
1703 | 'subject' => 'role', |
||
1704 | 'rolename' => Decorator::field('rolename'), |
||
1705 | 'action' => 'properties', |
||
1706 | ], |
||
1707 | 'icon' => 'Definition', |
||
1708 | ], |
||
1709 | ]; |
||
1710 | |||
1711 | break; |
||
1712 | case 'popup': |
||
1713 | $tabs = [ |
||
1714 | 'sql' => [ |
||
1715 | 'title' => $lang['strsql'], |
||
1716 | 'url' => '/src/views/sqledit', |
||
1717 | 'urlvars' => ['action' => 'sql', 'subject' => 'schema'], |
||
1718 | 'help' => 'pg.sql', |
||
1719 | 'icon' => 'SqlEditor', |
||
1720 | ], |
||
1721 | 'find' => [ |
||
1722 | 'title' => $lang['strfind'], |
||
1723 | 'url' => '/src/views/sqledit', |
||
1724 | 'urlvars' => ['action' => 'find', 'subject' => 'schema'], |
||
1725 | 'icon' => 'Search', |
||
1726 | ], |
||
1727 | ]; |
||
1728 | |||
1729 | break; |
||
1730 | case 'column': |
||
1731 | $tabs = [ |
||
1732 | 'properties' => [ |
||
1733 | 'title' => $lang['strcolprop'], |
||
1734 | 'url' => 'colproperties', |
||
1735 | 'urlvars' => [ |
||
1736 | 'subject' => 'column', |
||
1737 | 'table' => Decorator::field('table'), |
||
1738 | 'column' => Decorator::field('column'), |
||
1739 | ], |
||
1740 | 'icon' => 'Column', |
||
1741 | ], |
||
1742 | 'privileges' => [ |
||
1743 | 'title' => $lang['strprivileges'], |
||
1744 | 'url' => 'privileges', |
||
1745 | 'urlvars' => [ |
||
1746 | 'subject' => 'column', |
||
1747 | 'table' => Decorator::field('table'), |
||
1748 | 'column' => Decorator::field('column'), |
||
1749 | ], |
||
1750 | 'help' => 'pg.privilege', |
||
1751 | 'icon' => 'Privileges', |
||
1752 | ], |
||
1753 | ]; |
||
1754 | |||
1755 | break; |
||
1756 | case 'fulltext': |
||
1757 | $tabs = [ |
||
1758 | 'ftsconfigs' => [ |
||
1759 | 'title' => $lang['strftstabconfigs'], |
||
1760 | 'url' => 'fulltext', |
||
1761 | 'urlvars' => ['subject' => 'schema'], |
||
1762 | 'hide' => !$data->hasFTS(), |
||
1763 | 'help' => 'pg.ftscfg', |
||
1764 | 'tree' => true, |
||
1765 | 'icon' => 'FtsCfg', |
||
1766 | ], |
||
1767 | 'ftsdicts' => [ |
||
1768 | 'title' => $lang['strftstabdicts'], |
||
1769 | 'url' => 'fulltext', |
||
1770 | 'urlvars' => ['subject' => 'schema', 'action' => 'viewdicts'], |
||
1771 | 'hide' => !$data->hasFTS(), |
||
1772 | 'help' => 'pg.ftsdict', |
||
1773 | 'tree' => true, |
||
1774 | 'icon' => 'FtsDict', |
||
1775 | ], |
||
1776 | 'ftsparsers' => [ |
||
1777 | 'title' => $lang['strftstabparsers'], |
||
1778 | 'url' => 'fulltext', |
||
1779 | 'urlvars' => ['subject' => 'schema', 'action' => 'viewparsers'], |
||
1780 | 'hide' => !$data->hasFTS(), |
||
1781 | 'help' => 'pg.ftsparser', |
||
1782 | 'tree' => true, |
||
1783 | 'icon' => 'FtsParser', |
||
1784 | ], |
||
1785 | ]; |
||
1786 | |||
1787 | break; |
||
1788 | } |
||
1789 | |||
1790 | // Tabs hook's place |
||
1791 | $plugin_functions_parameters = [ |
||
1792 | 'tabs' => &$tabs, |
||
1793 | 'section' => $section, |
||
1794 | ]; |
||
1795 | $plugin_manager->do_hook('tabs', $plugin_functions_parameters); |
||
1796 | |||
1797 | return $tabs; |
||
1798 | } |
||
2166 |