Subversion Repositories oidplus

Rev

Rev 967 | Rev 970 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 967 Rev 968
Line 483... Line 483...
483
                }
483
                }
484
                return array($id, $parent, $res, $row);
484
                return array($id, $parent, $res, $row);
485
        }
485
        }
486
 
486
 
487
        public static function getAlternativesForQuery($id) {
487
        public static function getAlternativesForQuery($id) {
-
 
488
                // Attention: This is NOT an implementation of 1.3.6.1.4.1.37476.2.5.2.3.7 !
-
 
489
                //            This is the function that calls getAlternativesForQuery() of every plugin that implements 1.3.6.1.4.1.37476.2.5.2.3.7
-
 
490
 
488
                // e.g. used for "Reverse Alt Id"
491
                // e.g. used for "Reverse Alt Id"
489
                $alternatives = array();
492
                $alternatives = array();
490
                foreach (array_merge(OIDplus::getPagePlugins(),OIDplus::getObjectTypePlugins()) as $plugin) {
493
                foreach (array_merge(OIDplus::getPagePlugins(),OIDplus::getObjectTypePlugins()) as $plugin) {
491
                        if ($plugin->implementsFeature('1.3.6.1.4.1.37476.2.5.2.3.7')) {
494
                        if ($plugin->implementsFeature('1.3.6.1.4.1.37476.2.5.2.3.7')) {
492
                                $tmp = $plugin->getAlternativesForQuery($id);
495
                                $tmp = $plugin->getAlternativesForQuery($id);
493
                                if (is_array($tmp)) {
496
                                if (is_array($tmp)) {
494
                                        $alternatives = array_merge($tmp, $alternatives);
497
                                        $alternatives = array_merge($tmp, $alternatives);
495
                                }
498
                                }
496
                        }
499
                        }
497
                }
500
                }
-
 
501
 
-
 
502
                // If something is more than one time, remove it
498
                $alternatives = array_unique($alternatives);
503
                $alternatives = array_unique($alternatives);
-
 
504
 
-
 
505
                // If a plugin accidentally added the own ID, remove it. This function lists only alternatives, not the own ID
-
 
506
                $alternatives_tmp = array();
-
 
507
                foreach ($alternatives as $alt) {
-
 
508
                        if ($alt !== $id) $alternatives_tmp[] = $alt;
-
 
509
                }
-
 
510
                $alternatives = $alternatives_tmp;
-
 
511
 
499
                return $alternatives;
512
                return $alternatives;
500
        }
513
        }
501
 
514
 
502
        public function gui($id, &$out, &$handled) {
515
        public function gui($id, &$out, &$handled) {
503
                if ($id === 'oidplus:system') {
516
                if ($id === 'oidplus:system') {