Jamorabon / phpliteadmin

Automatically exported from code.google.com/p/phpliteadmin
0 stars 0 forks source link

Navigation tabs on top disappear #241

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The tabs ("Browse", "Structure", "SQL", ...) disappear in these cases:
- action=table_empty
- action=table_drop
- action=row_editordelete
- action=row_edit
- action=column_edit
- action=row_create&confirm=1
- action=column_confirm
- action=table_rename&confirm=1
- action=table_create
- action=table_create&confirm=1
- action=trigger_create
- action=index_create
- ...?

But it does not disappear in other similar cases:
- view=delete
- view=rename&database_rename=1

I think this is a bit unintuitive.
Why do the tabs disappear when I am about to drop a table (action=table_drop) 
but not when I delete a database (view=delete)?
It is more or less the same on a different level.

I think that it would be best if the navigation tabs should always be there. 
This way, you can navigate faster.
If you accidentally click to "Drop" a table but wanted to "Empty" it, it is 
faster to click "Empty" directly instead of "Cancel" and then "Empty". 

Original issue reported on code.google.com by crazy4ch...@gmail.com on 2 Jan 2014 at 7:56

GoogleCodeExporter commented 9 years ago
I think that tabs should always be visible as long as the context is either a 
database or a table/view, AND we are not in a multi-step process that should 
not be interrupted by jumping to a different page (I don't remember if any 
multi-step processes exist in PLA, probably not).

Tecnically, tabs don't actually disappear. They *only appear* for a limited 
number of 'actions'. From index.php, line 1252:

if (!isset($_GET['confirm']) && isset($_GET['table']) && isset($_GET['action']) 
&& (
   $_GET['action']=="table_export"
|| $_GET['action']=="table_import"
|| $_GET['action']=="table_sql"
|| $_GET['action']=="row_view"
|| $_GET['action']=="row_create"
|| $_GET['action']=="column_view"
|| $_GET['action']=="table_rename"
|| $_GET['action']=="table_search"
|| $_GET['action']=="table_triggers"
))

We can either add more elements to the check above, or refactor a bit —maybe 
an array + in_array would be more readable.

In the future, it would be nice to have something that tells us whether we are 
in a db/table/view context.

Original comment by dreadnaut on 3 Jan 2014 at 2:46

GoogleCodeExporter commented 9 years ago
I also think there is no multistep process in PLA. And we are always either in 
a DB or table/view context. I think tabs should always be there, either the 
db-tabs or the table / view tabs.
So I am not sure why we need to have a complex if there at all.
Maybe something like
if(isset($_GET['table']))
Would be enough in my opinion.

Original comment by crazy4ch...@gmail.com on 4 Jan 2014 at 5:58

GoogleCodeExporter commented 9 years ago
I just tried this and it looks good. But:
- the blue border between tabs and context currently disappears 
- we need to highlight the tabs differently
If action=column_edit (for example), the structure tab needs to be highlighted. 
If action=row_editordelete, the browse tab needs to be highlighted

Original comment by crazy4ch...@gmail.com on 4 Jan 2014 at 6:02

GoogleCodeExporter commented 9 years ago
Related to this, we could also refactor the tab drawing code, see patch below.

Original comment by dreadnaut on 4 Jan 2014 at 11:22

Attachments: