Ejemplo n.º 1
0
 static function getPrintList($for_admin, $ticket)
 {
     $result = array();
     $path = JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'plugins' . DS . 'ticketprint';
     $files = JFolder::files($path, ".xml\$");
     foreach ($files as $file) {
         $id = pathinfo($file, PATHINFO_FILENAME);
         if (!FSS_Helper::IsPluignEnabled("ticketprint", $id)) {
             continue;
         }
         $xml = simplexml_load_file($path . DS . $file);
         if ($for_admin && (int) $xml->admin != 1) {
             continue;
         }
         if (!$for_admin && (int) $xml->user != 1) {
             continue;
         }
         if ($xml->can_run_php) {
             $fn = create_function('$for_admin,$ticket', (string) $xml->can_run_php);
             if (!$fn($for_admin, $ticket)) {
                 continue;
             }
         }
         $result[str_ireplace(".xml", "", $file)] = (string) $xml->title;
     }
     return $result;
 }
Ejemplo n.º 2
0
 static function LoadPlugins($also_disabled = false)
 {
     // load in all php files in components/com_fss/plugins/tickets and for each make a new object
     if (empty(self::$plugins)) {
         self::$plugins = array();
         $path = JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'plugins' . DS . 'tickets';
         $files = JFolder::files($path, ".php\$");
         foreach ($files as $file) {
             $fullpath = $path . DS . $file;
             $info = pathinfo($fullpath);
             if (!FSS_Helper::IsPluignEnabled("tickets", $info['filename'])) {
                 continue;
             }
             $ext = $info['extension'];
             $classname = "SupportActions" . $info['filename'];
             require_once $fullpath;
             if (class_exists($classname)) {
                 $plugin = new $classname();
                 $plugin->enabled = true;
                 $plugin->php_file = $fullpath;
                 $plugin->id = $info['filename'];
                 self::$plugins[] = $plugin;
             }
         }
     }
     return self::$plugins;
 }
Ejemplo n.º 3
0
 static function load()
 {
     if (self::$loaded) {
         return;
     }
     $path = JPATH_SITE . DS . "components" . DS . "com_fss" . DS . "plugins" . DS . "gui" . DS;
     $files = JFolder::files($path, ".php\$");
     foreach ($files as $file) {
         $id = pathinfo($file, PATHINFO_FILENAME);
         if (!FSS_Helper::IsPluignEnabled("gui", $id)) {
             continue;
         }
         $class = "FSS_GUIPlugin_" . $id;
         require_once $path . DS . $file;
         if (class_exists($class)) {
             self::$plugins[$id] = new $class();
             self::$plugins[$id]->id = $id;
         }
     }
     self::$loaded = true;
 }
Ejemplo n.º 4
0
 private function load_plugins()
 {
     if (empty($this->plugins)) {
         $this->plugins = array();
         $path = JPATH_SITE . DS . "components" . DS . "com_fss" . DS . "plugins" . DS . "userlist" . DS;
         $files = JFolder::files($path, ".php\$");
         foreach ($files as $file) {
             $id = pathinfo($file, PATHINFO_FILENAME);
             if (!FSS_Helper::IsPluignEnabled("userlist", $id)) {
                 continue;
             }
             $class = "User_List_" . $id;
             require_once $path . DS . $file;
             if (class_exists($class)) {
                 $this->plugins[$id] = new $class();
                 $this->plugins[$id]->id = $id;
             }
         }
     }
     return $this->plugins;
 }