diff options
author | steckbrief <steckbrief@chefmail.de> | 2017-12-10 20:22:33 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2017-12-10 20:22:33 +0100 |
commit | 2ec5cbc2aa2fe992d2cccaf6d160950adef521ef (patch) | |
tree | 726ff2e5907825469d81ea8af9e900a864ebc4a6 /lib | |
parent | 6bf09a069577fa9fcefdb0f92da81001465a50e0 (diff) |
create story and character improved
Diffstat (limited to 'lib')
m--------- | lib/commons | 0 | ||||
-rw-r--r-- | lib/functions.stories.inc.php | 8 | ||||
-rw-r--r-- | lib/new-character-dialog.inc.php | 41 | ||||
-rw-r--r-- | lib/new-story-dialog.inc.php | 6 |
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">×</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> |