Beispiel #1
0
 /**
  * Get defined payment gateway profiles.
  *
  * @return  array
  */
 protected function getOptions()
 {
     // Initialize variables
     $prefix = isset($this->element['prefix']) ? (string) $this->element['prefix'] : '';
     $filter = isset($this->element['filter']) ? (string) $this->element['filter'] : '';
     // Call parent method to get list of plugin
     $options = parent::getOptions();
     $edition = defined('JSN_UNIFORM_EDITION') ? JSN_UNIFORM_EDITION : "free";
     if (strtolower($edition) == "free") {
         return array($options[0]);
     }
     // Loop thru results to filter
     foreach ($options as $k => $v) {
         // Only filter if option is a plugin
         if (is_file(JPATH_ROOT . '/plugins/' . (string) $this->element['folder'] . "/{$v->value}/{$v->value}.php")) {
             if ($prefix and strpos($v->value, $prefix) !== 0) {
                 unset($options[$k]);
             }
             if ($filter and !preg_match($filter, $v->value)) {
                 unset($options[$k]);
             }
         } elseif ($k != '0') {
             unset($options[$k]);
         }
     }
     return $options;
 }