summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/config/routes.php5
-rw-r--r--core/controllers/albums.php (renamed from core/controllers/album.php)2
-rw-r--r--core/controllers/items.php (renamed from core/controllers/item.php)8
-rw-r--r--core/controllers/photos.php (renamed from core/controllers/photo.php)2
-rw-r--r--core/views/welcome.html.php8
-rw-r--r--themes/default/views/album.html.php2
-rw-r--r--themes/default/views/header.html.php4
7 files changed, 18 insertions, 13 deletions
diff --git a/core/config/routes.php b/core/config/routes.php
index 120e6900..4da97654 100644
--- a/core/config/routes.php
+++ b/core/config/routes.php
@@ -18,6 +18,11 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
+// FIXME Temporary workaround to show the welcome page at /welcome.
+// The problem is that we're routing all requests to /{controllername} to Rest_Controller,
+// even requests to controllers that do not implement Rest_Controller.
+$config['^welcome$'] = 'welcome';
+
// REST configuration
// Any resource requests (eg: album/1 or comment/3) get dispatched to the REST
// dispatcher, and the abstract REST_Controller is not directly routable.
diff --git a/core/controllers/album.php b/core/controllers/albums.php
index 82652d88..ead738d9 100644
--- a/core/controllers/album.php
+++ b/core/controllers/albums.php
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class Album_Controller extends Item_Controller {
+class Albums_Controller extends Items_Controller {
/**
* @see Rest_Controller::_show($resource, $output_format)
diff --git a/core/controllers/item.php b/core/controllers/items.php
index f5c5f9c9..6c202b30 100644
--- a/core/controllers/item.php
+++ b/core/controllers/items.php
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class Item_Controller extends REST_Controller {
+class Items_Controller extends REST_Controller {
protected $resource_type = "item";
/**
@@ -45,7 +45,7 @@ class Item_Controller extends REST_Controller {
// Redirect to the more specific resource type, since it will render
// differently. We could also just delegate here, but it feels more appropriate
// to have a single canonical resource mapping.
- return url::redirect("{$item->type}/$item->id");
+ return url::redirect("{$item->type}s}/$item->id");
}
public function _update($item) {
@@ -90,7 +90,7 @@ class Item_Controller extends REST_Controller {
$this->input->post("title", $this->input->post("name")),
$this->input->post("description"),
$owner_id);
- url::redirect("{$new_item->type}/{$new_item->id}");
+ url::redirect("{$new_item->type}s/{$new_item->id}");
}
break;
}
@@ -103,7 +103,7 @@ class Item_Controller extends REST_Controller {
if ($parent->id) {
$item->delete();
}
- url::redirect("{$parent->type}/{$parent->id}");
+ url::redirect("{$parent->type}s/{$parent->id}");
}
public function _create($item) {
diff --git a/core/controllers/photo.php b/core/controllers/photos.php
index d6d37f98..a5b75b79 100644
--- a/core/controllers/photo.php
+++ b/core/controllers/photos.php
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class Photo_Controller extends Item_Controller {
+class Photos_Controller extends Items_Controller {
/**
* @see Rest_Controller::_show($resource, $output_format)
diff --git a/core/views/welcome.html.php b/core/views/welcome.html.php
index cc85475c..a015fc92 100644
--- a/core/views/welcome.html.php
+++ b/core/views/welcome.html.php
@@ -164,7 +164,7 @@
<div id="actions" class="activity">
<p>
- <?= html::anchor("album/1", "Browse Gallery") ?>
+ <?= html::anchor("albums/1", "Browse Gallery") ?>
<i>(<?= $album_count ?> albums, <?= $photo_count ?> photos)</i>
</p>
<p>
@@ -183,7 +183,7 @@
</p>
<fieldset>
<legend>Photos</legend>
- <form method="post" action="<?= url::site("album/1") ?>" enctype="multipart/form-data">
+ <form method="post" action="<?= url::site("albums/1") ?>" enctype="multipart/form-data">
<input type="submit" value="upload"/>
<input id="photo_upload" name="file[]" type="file"/>
<input type="hidden" name="type" value="photo"/>
@@ -192,7 +192,7 @@
</fieldset>
<fieldset>
<legend>Albums</legend>
- <form method="post" action="<?= url::site("album/1") ?>">
+ <form method="post" action="<?= url::site("albums/1") ?>">
<input type="submit" value="create"/>
<input type="text" name="name"/>
<input type="hidden" name="type" value="album"/>
@@ -210,7 +210,7 @@
</li>
<? if ($deepest_photo): ?>
<li>
- <?= html::anchor("photo/{$deepest_photo->id}", "Deepest photo") ?>
+ <?= html::anchor("photos/{$deepest_photo->id}", "Deepest photo") ?>
<i>(<?= $deepest_photo->level ?> levels deep)</i>
</li>
<? endif ?>
diff --git a/themes/default/views/album.html.php b/themes/default/views/album.html.php
index b2617998..18c53d46 100644
--- a/themes/default/views/album.html.php
+++ b/themes/default/views/album.html.php
@@ -12,7 +12,7 @@
<? $album_class = "gAlbum "; ?>
<? endif ?>
<li class="gItem <?= $album_class ?>">
- <a href="<?= url::site("{$child->type}/{$child->id}") ?>">
+ <a href="<?= url::site("{$child->type}s/{$child->id}") ?>">
<img id="gPhotoID-<?= $child->id ?>" class="gThumbnail"
alt="photo" src="<?= $child->thumbnail_url() ?>"
width="<?= $child->thumbnail_width ?>"
diff --git a/themes/default/views/header.html.php b/themes/default/views/header.html.php
index 03d4357c..1a6a10e8 100644
--- a/themes/default/views/header.html.php
+++ b/themes/default/views/header.html.php
@@ -25,7 +25,7 @@
<ul id="gSiteMenu">
<li><a href="<?= url::base() ?>"><?= _("HOME") ?></a></li>
- <li><a class="active" href="<?= url::site("album/1") ?>"><?= _("BROWSE") ?></a></li>
+ <li><a class="active" href="<?= url::site("albums/1") ?>"><?= _("BROWSE") ?></a></li>
<li><a href="#"><?= _("UPLOAD") ?></a></li>
<li><a href="#"><?= _("MY GALLERY") ?></a></li>
<li><a href="#"><?= _("ADMIN") ?></a></li>
@@ -40,7 +40,7 @@
<ul id="gBreadcrumbs">
<? foreach ($parents as $parent): ?>
- <li><a href="<?= url::site("album/{$parent->id}") ?>"><?= $parent->title_edit ?></a></li>
+ <li><a href="<?= url::site("albums/{$parent->id}") ?>"><?= $parent->title_edit ?></a></li>
<? endforeach ?>
<li class="active"><?= $item->title_edit ?></li>
</ul>