Some support of clean urls has been implemented. See this link:
Suggestions
from .htaccess
...
RewriteEngine On
RewriteRule ^task/(.*)/$ index.php?go=taskView?tsk=$1 [L]
...
Stay compatible
As mod_rewrite is disabled by default, we should make sure, that streber is working without it. We can add an config-option "USE_CLEAN_URLS" which is been set automatically on fresh installations.
If the admin of a streber installation is sure, that mod_rewrite is installed, he could add the line confChange("USE_CLEAN_URLS",true); to the customize.inc.php.
Retro style links with index.php?go= should still work, even if USE_CLEAN_URLS is true.
Mapping requests
Single Item Ids
http://www.streber-pm.org/123
from .htaccess
RewriteRule ^(d+)/$ index.php?go=itemView?item=$1 [L]
Since every item in streber has a unique ID we detect it's type on the fly. Since all links inside streber are build by
$PH->getLink() and
$PH->getUrl() changing the link style would be straight forward:
- add additional option
use_as_item_view to page-handles that are preferred views of items: taskView, effortView, etc.
- add wrapperFunction
std/class_pagehandler.inc.php -> itemView() that queries the item type by... if($item= DbProjectItem->getVisiblebyId($id)) { $type= $item->type; } and does a mapping to the appropriate view function: $page=$g_handles[$type."View"]; if(isset($page)) { $PH->show($page);}
This would reduce html code and make most urls pretty clean.
Submitting POST data
Each page has a <form> element which is rendered in
render/render_page.inc.php:
from render_page.inc.php
$buffer= '<form name="my_form" action="index.php" method="post" enctype="multipart/form-data" >';
When USE_CLEAN_URLS
index.php should be renamed to
submit or the
go parameters inside the POST data.
Other pages
The format of other urls needs some discussion...
http://www.streber-pm.org/index.php?go=taskEdit&tsk=234
might become...
http://www.streber-pm.org/taskEdit/234
http://www.streber-pm.org/234/edit
http://www.streber-pm.org/234/edit/format=pda
http://www.streber-pm.org/index.php?go=projViewTasks&prj=2&preset=my_open
might become...
http://www.streber-pm.org/2/viewTasks/preset=my_open
http://www.streber-pm.org/2/viewTasks/my_open
http://streber.pixtur.de/index.php?go=taskEditDescription&tsk=2267&from=b0023237383c29ff6b7fdb20a5fa7061
might become...
http://streber.pixtur.de/2267/editDescription/from=b0023237383c29ff6b7fdb20a5fa7061