Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: 1.1/develop
Fetching contributors…

Cannot retrieve contributors at this time

45 lines (36 sloc) 1.43 kB
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Sliders Event Class - this class loads the configuration files js and css
*
* @package PyroCMS
* @subpackage Jqlightbox
* @category events
* @author Bojan Mazej
*/
class Events_Sliders
{
protected $ci;
public function __construct()
{
$this->ci =& get_instance();
// register the public_controller event when this file is autoloaded
Events::register('public_controller', array($this, 'run'));
}
// this will be triggered by the Events::trigger('public_controller') code in Public_Controller.php
public function run()
{
$this->ci->load->model(array('sliders/slider_m'));
// get settings
$settings = $this->ci->slider_m->get_settings();
// add path to module assets
// MODIFY THIS PATH IF YOU'D LIKE TO KEEP THE MODULE ELSEWHERE
Asset::add_path('sliders', 'addons/shared_addons/modules/sliders/');
if($settings->jquery == 1)
{
$this->ci->template->append_js('sliders::jquery.min.js');
}
$this->ci->template->append_js('sliders::jquery.nivo.slider.pack.js');
$this->ci->template->append_css(array('sliders::nivo-slider.css'));
$this->ci->template->append_css(array('sliders::nivo-slider.theme.css'));
}
}
Jump to Line
Something went wrong with that request. Please try again.