summaryrefslogtreecommitdiff
path: root/core/controllers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-11-04 21:24:42 +0000
committerBharat Mediratta <bharat@menalto.com>2008-11-04 21:24:42 +0000
commit605d2de336eac8c8f80b916d30989b347d813e94 (patch)
tree1e33c92d4b3eedd9f4b3c31e21e11a9f36bcd8b2 /core/controllers
parentade1650846605d648da2565994e309414d908ac5 (diff)
Lots of new stuff!
Replace theme HTML with *almost* the latest stuff from the mockups. (it doesn't include r18467 yet). Our theme format is now modelled after WordPress / Habari's style where you have one entry point per type (eg: album.php) which can load up whatever parts it needs (eg: $theme->display("header")) Created album and photo helpers which have create() functions that form the base of our new API, along with tests for them. Created our own version of the ORM_MPTT since the existing versions were too buggy and unsupported to depend upon. Only has a minimal implementation so far, and the tests are not yet committed. Added path(), thumbnail_path() and resize_path() to Item_Model Extended the scaffolding to allow you to add lots of photos/albums into your hierarchy. Deleted modules/mptt -- we're not going to use this anymore.
Diffstat (limited to 'core/controllers')
-rw-r--r--core/controllers/welcome.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php
index f1201cff..a5719cf0 100644
--- a/core/controllers/welcome.php
+++ b/core/controllers/welcome.php
@@ -42,6 +42,33 @@ class Welcome_Controller extends Template_Controller {
url::redirect("welcome");
}
+ function add($count) {
+ srand(time());
+ $parents = ORM::factory("item")->where("type", "album")->find_all()->as_array();
+ for ($i = 0; $i < $count; $i++) {
+ $parent = $parents[array_rand($parents)];
+ switch(rand(0, 1)) {
+ case 0:
+ $album = album::create($parent->id, "rnd_" . rand(), "Rnd $i", "rnd $i");
+ $parents[] = $album;
+ break;
+
+ case 1:
+ photo::create($parent->id, DOCROOT . "themes/default/images/thumbnail.jpg",
+ "thumbnail.jpg", "rnd_" . rand(), "sample thumbnail");
+ break;
+ }
+
+ print "$i ";
+ if (!($i % 100)) {
+ set_time_limit(30);
+ }
+ }
+ print "<br/>";
+ print html::anchor("welcome", "return");
+ $this->auto_render = false;
+ }
+
private function _get_config_errors() {
$errors = array();
if (!file_exists(VARPATH)) {