public function getActiveGroup() { return JAnalytics::getDbRecord('', null, null, '', 'active_group'); }
public function generateAnalytics($user) { require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRoller.php'; require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRollerSeriesData.php'; require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRollerLineChart.php'; require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRollerColumnChart.php'; $validGroupType = JAnalytics::getGroupType(); $analyticsGroupBy = JRequest::getVar('group_type', 'day'); $analyticsGroupBy = !in_array($analyticsGroupBy, $validGroupType) ? 'day' : $analyticsGroupBy; $chartData1 = JAnalytics::get('', $user->id, null, '', $analyticsGroupBy); $chartData2 = JAnalytics::get(array('message.like', 'comment.like'), $user->id, null, '', $analyticsGroupBy); $linechart = new HighRollerLineChart(); $linechart->legend = new stdClass(); $linechart->credits = new stdClass(); $linechart->chart->renderTo = 'linechart'; $linechart->chart->type = 'area'; $linechart->yAxis = new stdClass(); $linechart->yAxis->title = new stdClass(); $linechart->yAxis->labels = new stdClass(); $linechart->xAxis = new stdClass(); $linechart->xAxis->title = new stdClass(); $linechart->xAxis->labels = new stdClass(); $linechart->yAxis->title->text = ''; $linechart->yAxis->min = 0; $linechart->yAxis->labels->enabled = true; $linechart->xAxis->labels->enabled = true; $linechart->xAxis->categories = JAnalytics::getXAxisCategory($analyticsGroupBy); $linechart->legend->enabled = false; $linechart->credits->enabled = false; //$linechart->title->text = 'Line Chart'; $series1 = new HighRollerSeriesData(); $series1->addName('Activity')->addData($chartData1)->addColor('#82CAFA'); $series2 = new HighRollerSeriesData(); $series2->addName('Comments/Like')->addData($chartData2)->addColor('#6698FF'); $linechart->addSeries($series1); $linechart->addSeries($series2); $html = '<div id="linechart" style="height:160px"></div><script type="text/javascript">' . $linechart->renderChart() . '</script>'; return $html; }
} ?> <div class="moduletable group-module"> <h3><?php echo JText::_('COM_STREAM_LABEL_GROUP_INFO'); ?> </h3> <div class="group-module-info"> <?php require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRoller.php'; require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRollerSeriesData.php'; require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRollerLineChart.php'; require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRollerColumnChart.php'; $chartData1 = JAnalytics::get('', null, $group->id, '', 'day'); $linechart = new HighRollerLineChart(); $linechart->legend = new stdClass(); $linechart->credits = new stdClass(); $linechart->yAxis = new stdClass(); $linechart->yAxis->title = new stdClass(); $linechart->yAxis->labels = new stdClass(); $linechart->xAxis = new stdClass(); $linechart->xAxis->title = new stdClass(); $linechart->xAxis->labels = new stdClass(); $linechart->chart->renderTo = 'linechart'; //$linechart->tooltip->enabled = false; $linechart->yAxis->title->text = ''; $linechart->yAxis->min = 0; $linechart->yAxis->labels->enabled = false; $linechart->xAxis->labels->enabled = false;
$task = JRequest::getCmd('task', ''); $tmpl = JRequest::getCmd('tmpl', '', 'GET'); // If the task is 'azrul_ajax', it would be an ajax call and core file // should not be processing it. if ($task != 'azrul_ajax') { // Require specific controller if requested if ($controller = JRequest::getWord('view', 'company')) { $path = JPATH_COMPONENT . DS . 'controllers' . DS . $controller . '.php'; if (file_exists($path)) { require_once $path; } else { JError::raiseWarning(500, JText::_('Controller missing:' . $controller)); } } $my = JXFactory::getUser(); JAnalytics::log($controller . '.' . JRequest::getCmd('task', 'display'), $my->id, JRequest::getCmd('group_id')); // Create the controller $classname = 'StreamController' . ucfirst($controller); $controller = new $classname(); // Perform the Request task $controller->execute(JRequest::getCmd('task')); // Redirect if set by the controller $controller->redirect(); } /** * Entry poitn for all ajax call */ function StreamAjaxEntry($func, $args = null) { // For AJAX calls, we need to load the language file manually. $lang = JFactory::getLanguage();