/** * 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_now = new JDate('now', 'UTC'); $date_now->setTimezone(new DateTimeZone($user->getParam('timezone', $config->get('offset')))); self::$time_today = floor($date_now->toUnix() / 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 = modPFganttHelperProjects::getDateRange(); self::$project_start = $dates[0]; self::$project_end = $dates[1]; }
$limit = (int) $params->get('limit', 25); if ($count < $limit || $limit == 0) { $limit = $count; } // Bail out if we have nothing to display if (!$count) { ?> <div class="alert"><?php echo JText::_('MOD_PF_GANTT_EMPTY'); ?> </div> <?php return; } $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')); modPFganttHelper::loadMedia(); $css = array(); $css[] = '#mod_pf_gantt_' . $module->id . ' .fn-gantt .leftPanel'; $css[] = '{'; $css[] = ' width: ' . (int) $params->get('column_width', 225) . 'px;'; $css[] = '}'; $css[] = '#mod_pf_gantt_' . $module->id . ' .fn-gantt .leftPanel .name'; $css[] = '{'; $css[] = ' width: ' . ((int) $params->get('column_width', 225) - 50) . 'px;'; $css[] = '}'; $css[] = '#mod_pf_gantt_' . $module->id . ' .fn-gantt .leftPanel .name .fn-label'; $css[] = '{'; $css[] = ' width: ' . ((int) $params->get('column_width', 225) - 50) . 'px;'; $css[] = '}'; $css[] = '#mod_pf_gantt_' . $module->id . ' .fn-gantt .navigate .nav-slider-content'; $css[] = '{';
<?php /** * @package mod_pf_gantt * * @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; } // Do nothing if the module is set to hide the overview chart if ((int) $params->get('show_overview', 1) == 0 && PFApplicationHelper::getActiveProjectId() == 0) { return ''; } // Get the helper class require_once dirname(__FILE__) . '/helper.php'; modPFganttHelper::init($params, $module->id); $items = modPFganttHelper::getItems(); // Include layout $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_pf_gantt', $params->get('layout', 'default'));