Widen input element
[infodrom.org/service.infodrom.org] / class / stempel.class.php
index 23a8cff..6146172 100644 (file)
@@ -9,8 +9,20 @@ class Stempel extends DatabaseTable {
 
   public function ajaxEditTask(Array $data)
   {
-    if (!strlen($data['content'])) return false;
-    return $this->modify('task', $data['content']);
+      $content = str_replace(['&amp;','&lt;','&gt;'], ['&','<','>'], $data['content']);
+      return $this->modify('task', utf8_decode($content));
+  }
+
+  public function ajaxSetStatus(Array $data)
+  {
+    if (count($data['ids'])) {
+      $sql = sprintf('UPDATE %s SET status = %d WHERE id IN (%s)',
+                    $this->table,
+                    $data['status'], implode(',',$data['ids']));
+      return $this->execute($sql);
+    }
+
+    return true;
   }
 
 }