summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
m---------lib/commons0
-rw-r--r--lib/functions.stories.inc.php8
-rw-r--r--lib/new-character-dialog.inc.php41
-rw-r--r--lib/new-story-dialog.inc.php6
4 files changed, 53 insertions, 2 deletions
diff --git a/lib/commons b/lib/commons
-Subproject c906747e7aef1308b956a62c911d726065a39ad
+Subproject eb2e78a12505b8d41e0ef62cb1b321cdc540e5f
diff --git a/lib/functions.stories.inc.php b/lib/functions.stories.inc.php
index a8102c3..b882869 100644
--- a/lib/functions.stories.inc.php
+++ b/lib/functions.stories.inc.php
@@ -9,8 +9,8 @@ function visibleName($nameWithUnderscore) {
return urldecode($nameWithUnderscore);
}
-function generateDirectoryName($storyName) {
- return urlencode($storyName);
+function generateDirectoryName($name) {
+ return urlencode($name);
}
function createEntity($path, $description, $file, $filename) {
@@ -27,7 +27,11 @@ function createEntity($path, $description, $file, $filename) {
}
} else {
// Error on directory creation
+ // return 'Could not create directory "'.$path;
+ return 2;
}
+ } else {
+ return 1;
}
}
?>
diff --git a/lib/new-character-dialog.inc.php b/lib/new-character-dialog.inc.php
new file mode 100644
index 0000000..5cf25c0
--- /dev/null
+++ b/lib/new-character-dialog.inc.php
@@ -0,0 +1,41 @@
+<?php
+?>
+ <span id="add-new-character-btn" class="floating-action-btn" data-toggle="modal" data-target="#newCharacterModal">
+ +
+ </span>
+ <!-- Modal -->
+ <div class="modal fade" id="newCharacterModal" role="dialog">
+ <div class="modal-dialog">
+ <!-- Modal content-->
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal">&times;</button>
+ <h4 class="modal-title">Neuen Charakter anlegen</h4>
+ </div>
+ <div class="modal-body">
+ <form action="" method="post" enctype="multipart/form-data" id="create-char-form">
+ <input type="hidden" name="story-name" id="story-name" value="<?=$currentStory;?>">
+ <div class="form-group">
+ <label for="name">Name des Charakters:</label>
+ <input type="text" class="form-control" id="char-name" name="char-name">
+ </div>
+ <div class="form-group">
+ <label for="story-description">Beschreibung des Charakters:</label>
+ <textarea class="form-control" rows="5" id="char-description" name="char-description"></textarea>
+ </div>
+ <div class="form-group">
+ <label for="story-logo">Foto des Charakters:</label>
+ <input type="file" name="char-passphoto" id="char-passphoto">
+ </div>
+ <button type="submit" class="btn btn-info btn-sm">Anlegen</button>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ $('#create-char-form').submit(function(event) {
+ createNewCharacter();
+ event.preventDefault();
+ });
+ </script>
diff --git a/lib/new-story-dialog.inc.php b/lib/new-story-dialog.inc.php
index ee55e4b..73c6abf 100644
--- a/lib/new-story-dialog.inc.php
+++ b/lib/new-story-dialog.inc.php
@@ -36,3 +36,9 @@
</div>
</div>
</div>
+ <script>
+ $('#create-story-form').submit(function(event) {
+ createNewStory();
+ event.preventDefault();
+ });
+ </script>