/** * Init the helper class and populates member vars * * @param object $params The module params * @param integer $id The module id * * @return void */ public static function init($params, $id) { $user = JFactory::getUser(); $config = JFactory::getConfig(); $date = JFactory::getDate('now', 'UTC'); $date->setTimezone(new DateTimeZone($user->getParam('timezone', $config->get('offset')))); self::$time_today = floor(strtotime($date->format('Y-m-d H:i:s', true, false)) / 86400) * 86400; self::$params = $params; self::$id = (int) $id; if ($params->get('mode')) { self::$project = (int) $params->get('project'); } else { self::$project = (int) PFApplicationHelper::getActiveProjectId(); } // Get project dates $dates = modPFcalendarHelperProjects::getDateRange(); self::$project_start = $dates[0]; self::$project_end = $dates[1]; }
<?php /** * @package mod_pf_calendar * * @author Tobias Kuhn (eaxs) * @copyright Copyright (C) 2006-2013 Tobias Kuhn. All rights reserved. * @license http://www.gnu.org/licenses/gpl.html GNU/GPL, see LICENSE.txt **/ defined('_JEXEC') or die; if (!jimport('projectfork.framework')) { echo JText::_('MOD_PF_GANTT_PROJECTFORK_LIB_NOT_INSTALLED'); return; } if (!PFApplicationHelper::exists('com_projectfork')) { echo JText::_('MOD_PF_GANTT_PROJECTFORK_NOT_INSTALLED'); return; } // Get the helper class require_once dirname(__FILE__) . '/helper.php'; modPFcalendarHelper::init($params, $module->id); $items = modPFcalendarHelper::getItems(); $months = array(JText::_('JANUARY'), JText::_('FEBRUARY'), JText::_('MARCH'), JText::_('APRIL'), JText::_('MAY'), JText::_('JUNE'), JText::_('JULY'), JText::_('AUGUST'), JText::_('SEPTEMBER'), JText::_('OCTOBER'), JText::_('NOVEMBER'), JText::_('DECEMBER')); $days = array(JText::_('SUNDAY'), JText::_('MONDAY'), JText::_('TUESDAY'), JText::_('WEDNESDAY'), JText::_('THURSDAY'), JText::_('FRIDAY'), JText::_('SATURDAY')); $days_short = array(JText::_('SUN'), JText::_('MON'), JText::_('TUE'), JText::_('WED'), JText::_('THU'), JText::_('FRI'), JText::_('SAT')); // Include layout $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_pf_calendar', $params->get('layout', 'default'));
<?php /** * @package mod_pf_calendar * * @author Tobias Kuhn (eaxs) * @copyright Copyright (C) 2013 Tobias Kuhn. All rights reserved. * @license http://www.gnu.org/licenses/gpl.html GNU/GPL, see LICENSE.txt **/ defined('_JEXEC') or die; modPFcalendarHelper::loadMedia(); $js = array(); $js[] = 'jQuery(document).ready(function()'; $js[] = '{'; $js[] = ' jQuery("#mod_pf_calendar_' . $module->id . '").fullCalendar('; $js[] = ' {'; $js[] = ' handleWindowResize: true,'; $js[] = ' editable: false,'; $js[] = ' events: ' . $items . ','; $js[] = ' firstDay: ' . (int) $params->get('week_start', 1) . ','; $js[] = ' aspectRatio: ' . $params->get('aspect_ratio', '1.35') . ','; $js[] = ' monthNames: ' . json_encode($months) . ','; $js[] = ' dayNames: ' . json_encode($days) . ','; $js[] = ' dayNamesShort: ' . json_encode($days_short) . ','; $js[] = ' eventRender: function(event, element)'; $js[] = ' {'; $js[] = ' element.find(".fc-event-title").html(event.title);'; $js[] = ' element.attr("title", event.title_alt);'; $js[] = ' if (event.i_type == "ms") {'; $js[] = ' element.find(\'.fc-event-inner\').prepend(\'<i class="icon-flag"></i> \');'; $js[] = ' }';