Commit Graph

16 Commits

Author SHA1 Message Date
Bharat Mediratta
2aad580f53 Move specialized (pretty) url generation back into Item_Model so that
we're not relying on overriding url::site() to do tricks around item
urls.  This means that you won't get item urls by doing
url::site("albums/37"), for example, but it also means that we won't
get pretty urls where we don't expect them (like in the action of a
<form> element).

Incidentally, this will help us move over to using the slug format
because if you've got a bad character in a url, the edit forms will
now work on it since they'll be id based.
2009-09-08 13:44:52 -07:00
Bharat Mediratta
6084848088 Improve comment. 2009-09-08 10:20:06 -07:00
Bharat Mediratta
714a82d1e0 Automagically generate pretty urls for movies, too. 2009-09-07 21:49:19 -07:00
Bharat Mediratta
7889ae1085 Fix a bug where we were not properly decoding the path in the fallback
code in get_item_from_uri() by using relative_url() instead of
relative_path().
2009-09-07 21:33:00 -07:00
Bharat Mediratta
a73b5e8226 Switch to using Item_Model::relative_url() for the url path. 2009-09-07 20:59:42 -07:00
Andy Staudacher
b4b638be44 Undo url helper changes - url methods no longer return a SafeString.
Adding SafeString::of_safe_html() calls where urls are passed as parameters to t() and t2().
2009-08-29 16:28:30 -07:00
Andy Staudacher
a10063ff68 Add more factory methods for convenience:
SafeString::purify() and SafeString::of_safe_html().

Removing SafeString::mark_html_safe() since it's no longer needed.
2009-08-29 12:34:09 -07:00
Andy Staudacher
1d633457c4 Have url::site() and other methods return a SafeString, just as t() and t2().
Benefits:
 - url::site() is often used in views and we can ensure in the url class that returned strings are indeed safe for use in HTML. Makes the list of vars of unknown safety status shorter.
 - url::site() is often used as message parameter to t() and t2(). The parameter would be HTML-escaped if it wasn't marked as safe HTML already. Makes the usage simpler / shorter.
2009-08-29 11:31:00 -07:00
Bharat Mediratta
7347d1e50d Use ENT_QUOTEs when decoding the $current_uri otherwise apostrophes
are treated as &#039; which doesn't match in our relative_path_cache.
2009-06-24 21:34:07 -07:00
Tim Almdal
8189c1fc6b Removed extra whitespace
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-06-09 21:45:57 +08:00
Tim Almdal
f0ea6d532c Create a new method in MY_url.php "get_item_from_uri" which loads the item
based on the uri.  Then use this helper method in logout.php to insure that
the guest user has access to the "continue" uri.  If they don't redirect to
the root album and let it deal with access issues.

Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-06-09 21:45:43 +08:00
Bharat Mediratta
12ef4272ae Work around a problem with the CGI sapi on urls that don't contain
index.php (ie, /gallery3 instead of /gallery3/index.php) that causes
is to mis-route.
2009-06-04 18:40:38 -07:00
Bharat Mediratta
e5a0104769 Make sure the item is loaded in parse_url() before we use it. 2009-06-04 18:19:49 -07:00
Bharat Mediratta
ce285b8feb Use the relative_path_cache to look up items which should be a faster
query than using the level + the components.
2009-05-29 21:23:08 -07:00
Bharat Mediratta
5e7cc75a29 Convert a few more references of APPPATH to MODPATH/gallery 2009-05-27 16:29:33 -07:00
Bharat Mediratta
28b41056e3 Restructure things so that the application is now just another module.
Kohana makes this type of transition fairly straightforward in that
all controllers/helpers/etc are still located in the cascading
filesystem without any extra effort, except that I've temporarily
added a hack to force modules/gallery into the module path.

Rename what's left of "core" to be "application" so that it conforms
more closely to the Kohana standard (basically, just
application/config/config.php which is the minimal thing that you need
in the application directory)

There's still considerable work left to be done here.
2009-05-27 15:07:27 -07:00