protected function getInput() { $params = ''; if (isset($this->element['params-field'])) { $params = 'params_'; } $prefix = $this->form->getFormControl(); if (!empty($prefix)) { $prefix .= '_'; } $id = $prefix . $params . $this->element['name']; GAnalyticsHelper::loadjQuery(); $document = JFactory::getDocument(); $document->addScript(JURI::base() . 'components/com_ganalytics/libraries/jquery/multiselect/jquery.multiselect2side.js'); $document->addStyleSheet(JURI::base() . 'components/com_ganalytics/libraries/jquery/multiselect/jquery.multiselect2side.css'); $document->addScript(JURI::base() . 'components/com_ganalytics/models/fields/sortcombo.js'); return parent::getInput(); }
protected function getGroups() { JFactory::getLanguage()->load('com_ganalytics'); if ($this->notLoad) { return array(array(JHtml::_('select.option', $this->value))); } if ($this->value == null) { $this->value = array(); } if (!is_array($this->value)) { $this->value = array($this->value); } GAnalyticsHelper::loadjQuery(); JFactory::getDocument()->addScript(JURI::base() . 'components/com_ganalytics/libraries/jquery/multiselect/jquery.multiselect2side.js'); JFactory::getDocument()->addStyleSheet(JURI::base() . 'components/com_ganalytics/libraries/jquery/multiselect/jquery.multiselect2side.css'); JFactory::getDocument()->addScriptDeclaration("gajQuery(document).ready(function(){createMultiSelectCombo(gajQuery('#" . $this->id . "'));});"); $groups = array('' => array()); foreach ($this->value as $value) { $groups[''][] = JHtml::_('select.option', $value, GAnalyticsHelper::translate($value), 'value', 'text'); } $xml = new SimpleXMLElement(JFile::read(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_ganalytics' . DS . 'helper' . DS . 'metrics.xml')); foreach ($xml->div as $group) { $label = GAnalyticsHelper::translate($group->div); if (!isset($groups[$label])) { $groups[$label] = array(); } foreach ($group->label as $value) { $v = (string) $value->attributes()->for; if (in_array($v, $this->value)) { continue; } $groups[$label][] = JHtml::_('select.option', $v, GAnalyticsHelper::translate($v), 'value', 'text'); } } return $groups; }
<?php /** * @package GAnalytics * @author Digital Peak http://www.digital-peak.com * @copyright Copyright (C) 2012 - 2013 Digital Peak. All rights reserved. * @license http://www.gnu.org/licenses/gpl.html GNU/GPL */ defined('_JEXEC') or die; if (empty($this->profiles)) { echo JText::_('COM_GANALYTICS_DASHBOARD_VIEW_NO_PROFILES'); return; } GAnalyticsHelper::loadjQuery(); jimport('joomla.form.form'); $document = JFactory::getDocument(); $document->addScript((JBrowser::getInstance()->isSSLConnection() ? 'https' : 'http') . '://www.google.com/jsapi'); $document->addScript(JURI::base() . 'components/com_ganalytics/libraries/jquery/ui/jquery-ui.custom.min.js'); $document->addStyleSheet(JURI::base() . 'components/com_ganalytics/libraries/jquery/themes/aristo/jquery-ui.custom.css'); $document->addScript(JURI::base() . 'components/com_ganalytics/libraries/jquery/ext/jquery-cookie.js'); $document->addScript(JURI::base() . 'components/com_ganalytics/libraries/jquery/pnotify/jquery.pnotify.min.js'); $document->addStyleSheet(JURI::base() . 'components/com_ganalytics/libraries/jquery/pnotify/jquery.pnotify.default.css'); $document->addScript(JURI::root() . 'administrator/components/com_ganalytics/libraries/jquery/multiselect/jquery.multiselect2side.js'); $document->addStyleSheet(JURI::root() . 'administrator/components/com_ganalytics/libraries/jquery/multiselect/jquery.multiselect2side.css'); $document->addScript(JURI::base() . 'components/com_ganalytics/libraries/jquery/fancybox/jquery.easing-1.3.pack.js'); $document->addScript(JURI::base() . 'components/com_ganalytics/libraries/jquery/fancybox/jquery.mousewheel-3.0.4.pack.js'); $document->addScript(JURI::base() . 'components/com_ganalytics/libraries/jquery/fancybox/jquery.fancybox-1.3.4.pack.js'); $document->addStyleSheet(JURI::base() . 'components/com_ganalytics/libraries/jquery/fancybox/jquery.fancybox-1.3.4.css'); if (GAnalyticsHelper::isPROMode()) { $document->addScript(JURI::base() . 'components/com_ganalytics/libraries/jquery/ganalytics/chart.js'); } else {