Merge branch 'master' of github.com:jelhan/croodle
This commit is contained in:
commit
13b3100dde
3 changed files with 31 additions and 25 deletions
|
@ -16,13 +16,13 @@ class DataHandler {
|
|||
$data = $this->readData();
|
||||
if ($data === false) {
|
||||
$return->result = false;
|
||||
$return->errorMsg = 'Es konnten keine Daten mit diesem Identifier gelesen werden.';
|
||||
}
|
||||
else {
|
||||
$return->result = true;
|
||||
$return->version = md5($data);
|
||||
$return->data = $data;
|
||||
$return->errorMsg = 'there is no data with this identifier or data could not be read';
|
||||
return $return;
|
||||
}
|
||||
|
||||
$return->result = true;
|
||||
$return->version = md5($data);
|
||||
$return->data = $data;
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -33,17 +33,23 @@ class DataHandler {
|
|||
$return = new stdClass();
|
||||
$return->id = $this->id;
|
||||
|
||||
// Prüfen, ob die Version noch aktuell ist, wenn Datei schon besteht
|
||||
// check if version is out of date
|
||||
$data_org = $this->readData();
|
||||
if ($data_org !== false && md5($data_org) !== $version) {
|
||||
$return->result = false;
|
||||
$return->errorMsg = 'Die Version ist nicht mehr aktuell.';
|
||||
$return->errorMsg = 'used version is out of date';
|
||||
return $return;
|
||||
}
|
||||
else {
|
||||
$return->result = file_put_contents($this->data_folder.$this->id, $data, LOCK_EX ) ? true : false;
|
||||
if ($return->result === false) $return->errorMsg = 'Die Daten konnten nicht geschrieben werden.';
|
||||
else $return->version = md5($data);
|
||||
|
||||
// write data
|
||||
if(file_put_contents($this->data_folder.$this->id, $data, LOCK_EX ) === false) {
|
||||
$return->result = false;
|
||||
$return->errorMsg = 'data could not be written';
|
||||
return $return;
|
||||
}
|
||||
|
||||
$return->version = md5($data);
|
||||
$return->result = true;
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
|
22
index.html
22
index.html
|
@ -38,7 +38,7 @@
|
|||
{{#options}}
|
||||
<td><input type="text" name="selections[]"/></td>
|
||||
{{/options}}
|
||||
<td><input type="submit" id="addUserFormSubmit" value="Speichern"/></td>
|
||||
<td><input type="submit" id="addUserFormSubmit" value="save"/></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -55,18 +55,18 @@
|
|||
</script>
|
||||
|
||||
<script type="text/html" id="ScheduleAdd_template">
|
||||
<h1>Neues Schedule anlegen</h1>
|
||||
<h1>Create new poll</h1>
|
||||
<form id="addScheduleForm">
|
||||
<p>Titel: <input type="text" name="title" /></p>
|
||||
<p>Beschreibung:<br/>
|
||||
<p>Title: <input type="text" name="title" /></p>
|
||||
<p>Description: <br/>
|
||||
<textarea name="description" /></p>
|
||||
<p id="options">
|
||||
Optionen:<br/>
|
||||
Options: <br/>
|
||||
</p>
|
||||
<div id="moreOptionsButton"></div>
|
||||
<div id="calender"></div>
|
||||
<div id="times"></div>
|
||||
<p><input type="submit" id="addScheduleSubmit" value="Anlegen" /></p>
|
||||
<p><input type="submit" id="addScheduleSubmit" value="create" /></p>
|
||||
</form>
|
||||
</script>
|
||||
|
||||
|
@ -80,11 +80,11 @@
|
|||
|
||||
<script type="text/html" id="ScheduleAddCalender_template">
|
||||
<div id="calenderDatePick"></div>
|
||||
<button id="setTimesButton">Uhrzeiten angeben</button>
|
||||
<button id="setTimesButton">define times</button>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="ScheduleAddTimes_template">
|
||||
<h2>Eine genauere Zeit angeben</h2>
|
||||
<h2>Define times for your dates</h2>
|
||||
<table id='timestable'>
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -104,8 +104,8 @@
|
|||
{{/dates}}
|
||||
</tbody>
|
||||
</table>
|
||||
<button id="timesMoreButton">More times</button>
|
||||
<button id="timesCopyTimelineButton">Copy first line</button>
|
||||
<button id="timesMoreButton">more times</button>
|
||||
<button id="timesCopyTimelineButton">copy first line</button>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="ScheduleAddTimesTimeHead_template">
|
||||
|
@ -117,7 +117,7 @@
|
|||
</script>
|
||||
|
||||
<script type="text/html" id="Startpage_template">
|
||||
<h1>Willkommen</h1>
|
||||
<h1>Welcome</h1>
|
||||
<div id="FindADate">
|
||||
<button id="FindADate-Button">find a date</button>
|
||||
</div>
|
||||
|
|
|
@ -318,10 +318,10 @@ function ScheduleAdd(type) {
|
|||
});
|
||||
}
|
||||
|
||||
identifier = [{value: 'Datum'}];
|
||||
identifier = [{value: 'date'}];
|
||||
for (var g = 0; g < count; g++) {
|
||||
identifier.push({
|
||||
value: 'Zeit '
|
||||
value: 'time '
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue