Allow playing of internal messages
[infodrom/phone] / index.php
index b227cf5..fbe62a0 100644 (file)
--- a/index.php
+++ b/index.php
@@ -17,6 +17,8 @@ if (!empty($_POST['func'])) {
     $data['call'] = $_POST['call'];
   } elseif ($_POST['func'] == 'save') {
     save_call();
+  } elseif ($_POST['func'] == 'messages') {
+    $data['messages'] = read_directory('messages');
   }
   header('Content-type: application/json; charset=UTF-8');
   echo json_encode($data);
@@ -60,7 +62,8 @@ if (!empty($_POST['func'])) {
 </div>
 
 <div class="controls">
-<img src="lib/reload.png" onclick="reload()" title="Check phone box">
+<img src="lib/reload.png" onclick="reload()" title="Check phone box"><br>
+<img src="lib/config.png" onclick="toggle_messages()" title="Display configured messages" style="margin-top: 10px;">
 </div>
 
 <div class="phonecall">
@@ -71,7 +74,7 @@ if (!empty($_POST['func'])) {
 <p id="callnote"></p>
 </div>
 
-<div class="editcall">
+<div class="editcall" id="container_edit">
 <p class="title">Edit message</p>
 <div style="padding-left: 5px;">
 <form id="edit_form">
@@ -86,5 +89,12 @@ Note<br><input id="edit_note" type="text" size="31"><br>
 </div>
 </div>
 
+<div class="editcall" id="container_config" >
+<p class="title">Configured messages</p>
+<ul class="phonelist" id="internal_calls">
+<li>Loading data...</li>
+</ul>
+</div>
+
 </body>
 </html>