Location: PHPKode > projects > LDAPted > ldapted/includes/extsource/Selection.php
<?php
/***************************************************************************
 *
 *                                  Selection.php
 *                              -------------------
 *
 *   begin                : Friday, Jul 5, 2002
 *   copyright            : (C) 2002 The Kabramps Team
 *   email                : hide@address.com,
 *                          hide@address.com
 *
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 *   See the GNU General Public License for more details.
 *   (http://www.gnu.org/licenses/gpl.html)
 *
 ***************************************************************************/

// include all subclasses:
include ("includes/extsource/File.php");
include ("includes/extsource/LDAPSelection.php");

class Selection {
  
  var $attribute;
  var $xmlDoc;

  function Selection ($attribute, $xmlDoc) {

    switch ($xmlDoc->get_selection_type($attribute)) {
    case "plaintextfile":
      $this = new File ($attribute, $xmlDoc);
      break;
    case "ldap":
      $this = new LDAPSelection ($attribute, $xmlDoc);
      break;  
    default:
      die("Error: unknown selection type");
      break;
    }
    
  }

  function get_selections($value = array()) {
    // 'value' : existing values to filter out from the selection return.
    return array();
  }
  
  function init ($attribute, $xmlDoc) {
    $this->attribute = $attribute;
    $this->xmlDoc = $xmlDoc;
  }
}
?>
Return current item: LDAPted