Server IP : 180.180.241.3 / Your IP : 216.73.216.252 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /AppServ/www/news/tmp/install_5320fcc93572d/media/widgets/spotlight/ |
Upload File : |
<?php /** * @package Widgetkit * @author YOOtheme http://www.yootheme.com * @copyright Copyright (C) YOOtheme GmbH * @license http://www.gnu.org/licenses/gpl.html GNU/GPL */ /* Class: SpotlightWidgetkitHelper Spotlight helper class */ class SpotlightWidgetkitHelper extends WidgetkitHelper { /* type */ public $type; /* options */ public $options; /* Function: Constructor Class Constructor. */ public function __construct($widgetkit) { parent::__construct($widgetkit); // init vars $this->type = strtolower(str_replace('WidgetkitHelper', '', get_class($this))); $this->options = $this['system']->options; // register path $this['path']->register(dirname(__FILE__), $this->type); } /* Function: site Site init actions Returns: Void */ public function site() { $options = array(); // get options foreach (array('duration' => 300) as $option => $value) { $val = $this->options->get('spotlight_'.$option, $value); $options[$option] = is_numeric($val) ? (float) $val : $val; } // is enabled ? if ($this->options->get('spotlight_enable', 1)) { $pluginPath = $this["path"]->url('spotlight:'); $selector = $this->options->get('spotlight_selector', '[data-spotlight]'); $options = json_encode($options); // add stylesheets/javascripts $this['asset']->addFile('css', 'spotlight:css/spotlight.css'); $this['asset']->addString('js', "\$widgetkit.load('{$pluginPath}/js/spotlight.js').done(function(){jQuery(function($){ $('{$selector}').spotlight({$options}); });});"); } } /* Function: dashboard Render dashboard layout Returns: Void */ public function dashboard() { // get xml $xml = simplexml_load_file($this['path']->path('spotlight:spotlight.xml')); // add js $this['asset']->addFile('js', 'spotlight:js/dashboard.js'); // render dashboard echo $this['template']->render('spotlight:layouts/dashboard', compact('xml')); } /* Function: config Save configuration Returns: Void */ public function config() { // save configuration foreach ($this['request']->get('post:', 'array') as $option => $value) { if (preg_match('/^spotlight_/', $option)) { $this['system']->options->set($option, $value); } } $this['system']->saveOptions(); } } // bind events $widgetkit = Widgetkit::getInstance(); $widgetkit['event']->bind('site', array($widgetkit['spotlight'], 'site')); $widgetkit['event']->bind('dashboard', array($widgetkit['spotlight'], 'dashboard')); $widgetkit['event']->bind('task:config_spotlight', array($widgetkit['spotlight'], 'config'));