4require_once
'Services/Contact/BuddySystem/classes/states/class.ilAbstractBuddySystemRelationState.php';
39 $this->lng =
$DIC[
'lng'];
47 if (
null === self::$instance) {
48 self::$instance =
new self;
58 public function getValidStates()
60 if (
null !== self::$valid_states) {
65 $iter =
new DirectoryIterator(dirname(__FILE__));
66 foreach ($iter as
$file) {
74 require_once
$file->getFilename();
75 $class = str_replace(array(
'class.',
'.php'),
'',
$file->getBasename());
76 $reflection =
new ReflectionClass($class);
78 !$reflection->isAbstract() &&
79 $reflection->isSubclassOf(
'ilBuddySystemRelationState')
81 $states[] =
new $class();
85 return (self::$valid_states = $states);
94 foreach ($this->getValidStates() as
$state) {
109 if (
null !== self::$state_option_array[$with_initial_state]) {
110 return self::$state_option_array[$with_initial_state];
115 foreach ($this->getValidStates() as
$state) {
116 if ($with_initial_state || !
$state->isInitial()) {
117 $options[get_class(
$state)] = $this->lng->txt(
'buddy_bs_state_' . strtolower(
$state->getName()));
121 return (self::$state_option_array[$with_initial_state] =
$options);
132 $state_class = get_class($relation->
getState());
133 $renderer_class = $state_class .
'ButtonRenderer';
134 $renderer_path =
"Services/Contact/BuddySystem/classes/states/renderer/class.{$renderer_class}.php";
136 if (!file_exists($renderer_path)) {
140 require_once $renderer_path;
141 if (!class_exists($renderer_class)) {
145 return new $renderer_class($owner_id, $relation);
sprintf('%.4f', $callTime)
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
An exception for terminatinating execution or to throw for unit testing.
Class ilBuddySystemRelationStateFactory.
getStatesAsOptionArray($with_initial_state=false)
static $state_option_array
getRendererByOwnerAndRelation($owner_id, ilBuddySystemRelation $relation)
Class ilBuddySystemRelation.
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file