summaryrefslogtreecommitdiff
path: root/core/helpers/album.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/helpers/album.php')
-rw-r--r--core/helpers/album.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/helpers/album.php b/core/helpers/album.php
index c45b9bd8..41d90013 100644
--- a/core/helpers/album.php
+++ b/core/helpers/album.php
@@ -30,9 +30,10 @@ class album_Core {
* @param string $name the name of this new album (it will become the directory name on disk)
* @param integer $title the title of the new album
* @param string $description (optional) the longer description of this album
+ * @param string $path (optional) the name to use as the filesystem path component
* @return Item_Model
*/
- static function create($parent, $name, $title, $description=null, $owner_id=null) {
+ static function create($parent, $name, $title, $description=null, $path=null, $owner_id=null) {
if (!$parent->loaded || !$parent->is_album()) {
throw new Exception("@todo INVALID_PARENT");
}
@@ -42,6 +43,7 @@ class album_Core {
$album->title = $title;
$album->description = $description;
$album->name = $name;
+ $album->path = !empty($path) ? $path : preg_replace("/[^A-Za-z0-9\.\-_]/", "_", $name);
$album->owner_id = $owner_id;
$album->thumb_dirty = 1;
$album->resize_dirty = 1;