summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/controllers/welcome.php13
-rw-r--r--core/views/welcome.html.php8
2 files changed, 21 insertions, 0 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php
index 9b2ec19d..a75b225f 100644
--- a/core/controllers/welcome.php
+++ b/core/controllers/welcome.php
@@ -21,6 +21,8 @@ class Welcome_Controller extends Template_Controller {
public $template = "welcome.html";
function index() {
+ Session::instance();
+
$this->template->syscheck = new View("welcome_syscheck.html");
$this->template->syscheck->errors = $this->_get_config_errors();
$this->template->syscheck->modules = array();
@@ -149,6 +151,17 @@ class Welcome_Controller extends Template_Controller {
}
}
+ function add_photos() {
+ $path = $this->input->post("path");
+ cookie::set("add_photos_path", $path);
+
+ foreach (glob("$path/*.[Jj][Pp][Gg]") as $file) {
+ set_time_limit(30);
+ photo::create(1, $file, basename($file), basename($file));
+ }
+ url::redirect("welcome");
+ }
+
function add_albums_and_photos($count) {
srand(time());
$parents = ORM::factory("item")->where("type", "album")->find_all()->as_array();
diff --git a/core/views/welcome.html.php b/core/views/welcome.html.php
index 6bbd3ec7..16b4659a 100644
--- a/core/views/welcome.html.php
+++ b/core/views/welcome.html.php
@@ -233,6 +233,14 @@
</form>
</fieldset>
<fieldset>
+ <legend>Server Side Photos</legend>
+ <form method="post" action="<?= url::site("welcome/add_photos") ?>">
+ <input type="submit" value="upload"/>
+ <input type="text" name="path" size="70"
+ value="<?= cookie::get("add_photos_path") ?>" />
+ </form>
+ </fieldset>
+ <fieldset>
<legend>Albums</legend>
<form method="post" action="<?= url::site("albums/1") ?>">
<input type="submit" value="create"/>