Ejemplo n.º 1
0
 /**
  * Get operators by target type
  * @param string $a_type
  * @return type
  */
 public function getOperatorsByTargetType($a_type)
 {
     global $objDefinition;
     switch ($a_type) {
         case 'crsg':
             return array('not_member');
     }
     $class = $objDefinition->getClassName($a_type);
     $location = $objDefinition->getLocation($a_type);
     $full_class = "ilObj" . $class . "Access";
     include_once $location . "/class." . $full_class . ".php";
     include_once './Services/AccessControl/interfaces/interface.ilConditionHandling.php';
     $reflection = new ReflectionClass($full_class);
     if (!$reflection->implementsInterface('ilConditionHandling')) {
         return array();
     }
     $operators = call_user_func(array($full_class, 'getConditionOperators'), $a_type);
     // Add operator lp
     include_once "Services/Tracking/classes/class.ilObjUserTracking.php";
     if (ilObjUserTracking::_enabledLearningProgress()) {
         // only if object type has lp
         include_once "Services/Object/classes/class.ilObjectLP.php";
         if (ilObjectLP::isSupportedObjectType($a_type)) {
             array_unshift($operators, self::OPERATOR_LP);
         }
     }
     return $operators;
 }