Subversion Repositories xrowsearch

[/] [trunk/] [classes/] [xrowExternalSearchProvider.php] - Blame information for rev 1

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1 rrobert
<?php
2
 
3
class xrowExternalSearchProvider
4
{
5
 
6
    final static function getExternalProviders()
7
    {
8
        $plugins = array();
9
        $searchini = eZINI::instance( 'xrowsearch.ini' );
10
        $list = $searchini->variable( 'Settings', 'DataProviderList' );
11
        foreach ( $list as $item )
12
        {  
13
            $pluginname = $searchini->variable( $item, 'Plugin' );
14
 
15
            $params = array(
16
                'ExternalURL' => $searchini->variable( $item, 'ExternalURL' ),
17
                'Namespace' => $searchini->variable($item, 'Namespace')
18
            );
19
 
20
           $plugins[] = new $pluginname( $params );
21
        }
22
        return $plugins;
23
    }
24
 
25
    final static function getExternalProvider( $name )
26
    {
27
        $searchini = eZINI::instance( 'xrowsearch.ini' );
28
        $list = $searchini->variable( 'Settings', 'DataProviderList' );
29
        if ( in_array( $name, $list ) )
30
        {
31
            $pluginname = $searchini->variable( $name, 'Plugin' );
32
            $params = array(
33
                'ExternalURL' => $searchini->variable( $name, 'ExternalURL' ),
34
                'Namespace' => $searchini->variable( $name, 'Namespace')
35
            );
36
            return new $pluginname( $params );
37
        }
38
    }
39
}