-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmod_xpertgallery.php
93 lines (78 loc) · 2.48 KB
/
mod_xpertgallery.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
* @package Xpert Gallery
* @version ##VERSION##
* @author ThemeXpert http://www.themexpert.com
* @copyright Copyright (C) 2009 - 2011 ThemeXpert
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
*
*/
// no direct access
defined('_JEXEC') or die('Restricted accessd');
// Check for the framework, if not found eject
include_once JPATH_LIBRARIES . '/xef/bootstrap.php';
if( !defined('XEF_INCLUDED'))
{
echo 'Your Module installation is broken; please re-install. Alternatively, extract the installation archive and copy the xef directory inside your site\'s libraries directory.';
return ;
}
// Include the syndicate functions only once
require_once (dirname(__FILE__). '/helper.php');
//set module id
$module_id = XEFUtility::getModuleId($module, $params);
// Content source
$content_source = $params->get('content_source','joomla');
// Import source and get the class name
$class_name = importSource($content_source);
// Create instance of the class
$instance = new $class_name($module, $params);
// Lets set some variables
$cat_ids = array();
$cat_field = '';
$items = array();
// assign ids based on content source
switch ( $content_source ) {
case 'joomla':
$cat_ids = $params->get('jom_catid');
$cat_field = 'jom_catid';
// Set cat filter alwasy 1
$instance->set( 'jomcatfilter', 1 );
break;
case 'k2':
$cat_ids = $params->get('k2_catid');
$cat_field = 'k2_catid';
// Set cat_filter alwasy 1
$instance->set( 'k2_catfilter', 1 );
break;
case 'easyblog':
$cat_ids = $params->get('eb_catid');
$cat_field = 'eb_catid';
break;
case 'flickr':
$cat_ids = '';
$cat_field = '';
default:
$cat_ids = $params->get('jom_catid');
$cat_field = 'eb_catid';
break;
}
// Populate items
if( $content_source == 'flickr')
{
$items = $instance->getItems();
}else{
foreach ($cat_ids as $id) {
// Set cat id
$instance->set( $cat_field, array($id) );
$items[] = $instance->getItems();
}
}
// Load Stylesheet file
XEFUtility::loadStyleSheet($module, $params);
// Load Module specific script
XEFXpertGalleryHelper::loadScript($module, $params);
// Load Module specific style defination
//XEFXpertScrollerHelper::load_style($module, $params);
// Assign some variable to use inside views
$overview_elements = $params->get('overview_elements');
require JModuleHelper::getLayoutPath($module->module, $params->get('layout', 'default'));