alecpl
2011-02-16 207cc0b9b3cfdfb29e4f02e83014320fd12eeb68
plugins/example_addressbook/example_addressbook_backend.php
@@ -11,6 +11,7 @@
{
  public $primary_key = 'ID';
  public $readonly = true;
  public $groups = true;
  
  private $filter;
  private $result;
@@ -36,6 +37,14 @@
    $this->filter = null;
  }
  function list_groups($search = null)
  {
    return array(
      array('ID' => 'testgroup1', 'name' => "Testgroup"),
      array('ID' => 'testgroup2', 'name' => "Sample Group"),
    );
  }
  public function list_records($cols=null, $subset=0)
  {
    $this->result = $this->count();
@@ -44,7 +53,7 @@
    return $this->result;
  }
  public function search($fields, $value, $strict=false, $select=true)
  public function search($fields, $value, $strict=false, $select=true, $nocount=false, $required=array())
  {
    // no search implemented, just list all records
    return $this->list_records();
@@ -68,5 +77,33 @@
    
    return $assoc && $sql_arr ? $sql_arr : $this->result;
  }
  function create_group($name)
  {
    $result = false;
    return $result;
  }
  function delete_group($gid)
  {
    return false;
  }
  function rename_group($gid, $newname)
  {
    return $newname;
  }
  function add_to_group($group_id, $ids)
  {
    return false;
  }
  function remove_from_group($group_id, $ids)
  {
     return false;
  }
  
}