From: <bh...@us...> - 2008-11-28 05:45:38
|
Revision: 18946 http://gallery.svn.sourceforge.net/gallery/?rev=18946&view=rev Author: bharat Date: 2008-11-28 05:45:35 +0000 (Fri, 28 Nov 2008) Log Message: ----------- Add an easy way to add a bunch of servers from the server side Modified Paths: -------------- gallery3/trunk/core/controllers/welcome.php gallery3/trunk/core/views/welcome.html.php Modified: gallery3/trunk/core/controllers/welcome.php =================================================================== --- gallery3/trunk/core/controllers/welcome.php 2008-11-28 05:18:17 UTC (rev 18945) +++ gallery3/trunk/core/controllers/welcome.php 2008-11-28 05:45:35 UTC (rev 18946) @@ -21,6 +21,8 @@ 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 @@ } } + 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(); Modified: gallery3/trunk/core/views/welcome.html.php =================================================================== --- gallery3/trunk/core/views/welcome.html.php 2008-11-28 05:18:17 UTC (rev 18945) +++ gallery3/trunk/core/views/welcome.html.php 2008-11-28 05:45:35 UTC (rev 18946) @@ -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"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |