/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = 'default') { $model = $this->getModel(); $j3 = FabrikWorker::j3(); $app = JFactory::getApplication(); $input = $app->input; $usersConfig = JComponentHelper::getParams('com_fabrik'); $id = $input->get('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0))); $model->setId($id); if (!$model->canView()) { echo FText::_('JERROR_ALERTNOAUTHOR'); return false; } $this->id = $id; $this->row = $this->get('Visualization'); $this->rows = $this->get('Rows'); $this->containerId = $this->get('ContainerId'); $this->calName = $this->get('VizName'); $this->params = $model->getParams(); $tpl = $j3 ? 'bootstrap' : $tpl; $this->_setPath('template', JPATH_SITE . '/plugins/fabrik_visualization/approvals/views/approvals/tmpl/' . $tpl); FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/approvals/views/approvals/tmpl/' . $tpl . '/template.css'); $ref = $model->getJSRenderContext(); $js = "var {$ref} = new fbVisApprovals('approvals_" . $id . "');\n"; $js .= "Fabrik.addBlock('" . $ref . "', {$ref});\n"; $js .= $model->getFilterJs(); $srcs = FabrikHelperHTML::framework(); $srcs['FbListFilter'] = 'media/com_fabrik/js/listfilter.js'; $srcs['Approvals'] = 'plugins/fabrik_visualization/approvals/approvals.js'; FabrikHelperHTML::iniRequireJs($model->getShim()); FabrikHelperHTML::script($srcs, $js); $text = $this->loadTemplate(); FabrikHelperHTML::runContentPlugins($text); echo $text; }
/** * Display the view * * @param string $tmpl Template * * @return JView this */ public function display($tmpl = 'default') { $app = JFactory::getApplication(); $model = $this->getModel(); $input = $app->input; $renderOrder = $input->getInt('renderOrder'); $path = JPATH_ROOT . '/plugins/fabrik_list/email/views/popupwin/tmpl/' . $tmpl; $this->_setPath('template', $path); $this->showToField = $model->getShowToField(); $records = $model->getRecords(); if (count($records) == 0) { $app->enqueueMessage('None of the selected records can be emailed', 'notice'); return; } $this->recordcount = count($records); $this->renderOrder = $renderOrder; $this->recordids = implode(',', $records); $this->listid = $this->get('id', 'list'); $this->showSubject = $model->getShowSubject(); $this->subject = $model->getSubject(); $this->message = $model->getMessage(); $this->allowAttachment = $model->getAllowAttachment(); $this->editor = $model->getEditor(); $this->toType = $model->_toType(); $this->emailTo = $model->_emailTo(); $this->params = $model->getParams(); $this->listEmailTo = $model->formModel->getElementList('list_email_to'); $this->addressBook = $model->addressBook(); $srcs = FabrikHelperHTML::framework(); FabrikHelperHTML::iniRequireJs(); FabrikHelperHTML::script($srcs); return parent::display(); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = 'default') { $app = JFactory::getApplication(); $input = $app->input; $j3 = FabrikWorker::j3(); $srcs = FabrikHelperHTML::framework(); $model = $this->getModel(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model->setId($input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0)))); $this->row = $model->getVisualization(); if (!$model->canView()) { echo FText::_('JERROR_ALERTNOAUTHOR'); return false; } $this->js = $this->get('JS'); $viewName = $this->getName(); $params = $model->getParams(); $this->params = $params; $pluginManager = JModelLegacy::getInstance('Pluginmanager', 'FabrikFEModel'); $plugin = $pluginManager->getPlugIn('slideshow', 'visualization'); $this->showFilters = $model->showFilters(); $this->filters = $this->get('Filters'); $this->filterFormURL = $this->get('FilterFormURL'); $this->params = $model->getParams(); $this->containerId = $this->get('ContainerId'); $srcs['FbListFilter'] = 'media/com_fabrik/js/listfilter.js'; if ($this->get('RequiredFiltersFound')) { $srcs['Slideshow2'] = 'components/com_fabrik/libs/slideshow2/js/slideshow.js'; $mode = $params->get('slideshow_viz_type', 1); switch ($mode) { case 1: break; case 2: $srcs['Kenburns'] = 'components/com_fabrik/libs/slideshow2/js/slideshow.kenburns.js'; break; case 3: $srcs['Push'] = 'components/com_fabrik/libs/slideshow2/js/slideshow.push.js'; break; case 4: $srcs['Fold'] = 'components/com_fabrik/libs/slideshow2/js/slideshow.fold.js'; break; default: break; } JHTML::stylesheet('components/com_fabrik/libs/slideshow2/css/slideshow.css'); $srcs['SlideShow'] = 'plugins/fabrik_visualization/slideshow/slideshow.js'; } FabrikHelperHTML::slimbox(); FabrikHelperHTML::iniRequireJs($model->getShim()); FabrikHelperHTML::script($srcs, $this->js); //FabrikHelperHTML::slimbox(); $tpl = $j3 ? 'bootstrap' : 'default'; $tpl = $params->get('slideshow_viz_layout', $tpl); $tmplpath = $model->pathBase . 'slideshow/views/slideshow/tmpl/' . $tpl; $this->_setPath('template', $tmplpath); FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/slideshow/views/slideshow/tmpl/' . $tpl . '/template.css'); FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/slideshow/views/slideshow/tmpl/' . $tpl . '/custom.css'); echo parent::display(); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = 'default') { $document = JFactory::getDocument(); $app = JFactory::getApplication(); $input = $app->input; $model = $this->getModel(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model->setId($input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0)))); if (!$model->canView()) { echo FText::_('JERROR_ALERTNOAUTHOR'); return false; } $srcs = FabrikHelperHTML::framework(); FabrikHelperHTML::styleSheet('plugins/fabrik_visualization/nvd3_chart/lib/novus-nvd3/src/nv.d3.css'); $srcs['FbListFilter'] = 'media/com_fabrik/js/listfilter.js'; $srcs['AdvancedSearch'] = 'media/com_fabrik/js/advanced-search.js'; $lib = COM_FABRIK_LIVESITE . 'plugins/fabrik_visualization/nvd3_chart/lib/novus-nvd3/'; $document->addScript($lib . 'lib/d3.v2.js'); $document->addScript($lib . 'nv.d3.js'); $document->addScript($lib . 'src/tooltip.js'); $document->addScript($lib . 'lib/fisheye.js'); $document->addScript($lib . 'src/utils.js'); $document->addScript($lib . 'src/models/legend.js'); $document->addScript($lib . 'src/models/axis.js'); $document->addScript($lib . 'src/models/scatter.js'); $document->addScript($lib . 'src/models/line.js'); $document->addScript($lib . 'src/models/lineChart.js'); $document->addScript($lib . 'src/models/multiBar.js'); $document->addScript($lib . 'src/models/multiBarChart.js'); $this->row = $model->getVisualization(); $this->requiredFiltersFound = $model->getRequiredFiltersFound(); $params = $model->getParams(); $js = $model->js(); FabrikHelperHTML::addScriptDeclaration($js); $this->params = $params; $viewName = $this->getName(); $pluginManager = JModelLegacy::getInstance('Pluginmanager', 'FabrikFEModel'); $plugin = $pluginManager->getPlugIn('calendar', 'visualization'); $this->params = $params; $this->postText = $model->postText; $this->assign('containerId', $this->get('ContainerId')); $this->assign('filters', $this->get('Filters')); $this->showFilters = $model->showFilters(); $this->assign('filterFormURL', $this->get('FilterFormURL')); $tpl = $params->get('nvd3_chart_layout', $tpl); $this->_setPath('template', JPATH_ROOT . '/plugins/fabrik_visualization/nvd3_chart/views/nvd3_chart/tmpl/' . $tpl); FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/nvd3_chart/views/nvd3_chart/tmpl/' . $tpl . '/template.css'); // Assign something to Fabrik.blocks to ensure we can clear filters $ref = $model->getJSRenderContext(); $js = "{$ref} = {};"; $js .= "\n" . "Fabrik.addBlock('{$ref}', {$ref});"; $js .= $model->getFilterJs(); FabrikHelperHTML::iniRequireJs($model->getShim()); FabrikHelperHTML::script($srcs, $js); $text = $this->loadTemplate(); FabrikHelperHTML::runContentPlugins($text); echo $text; }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = 'default') { $app = JFactory::getApplication(); $input = $app->input; $j3 = FabrikWorker::j3(); $srcs = FabrikHelperHTML::framework(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model = $this->getModel(); $id = $input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0))); $model->setId($id); $row = $model->getVisualization(); if (!$model->canView()) { echo FText::_('JERROR_ALERTNOAUTHOR'); return false; } $js = $model->render(); $this->containerId = $this->get('ContainerId'); $this->row = $row; $this->showFilters = $input->getInt('showfilters', 1) === 1 ? 1 : 0; $this->filters = $model->getFilters(); $this->advancedSearch = $model->getAdvancedSearchLink(); $this->filterFormURL = $model->getFilterFormURL(); $params = $model->getParams(); $this->params = $params; $this->width = $params->get('timeline_width', '700'); $this->height = $params->get('timeline_height', '300'); $tpl = $j3 ? 'bootstrap' : 'default'; $tpl = $params->get('timeline_layout', $tpl); $tmplpath = '/plugins/fabrik_visualization/timeline/views/timeline/tmpl/' . $tpl; $this->_setPath('template', JPATH_ROOT . $tmplpath); JHTML::stylesheet('media/com_fabrik/css/list.css'); FabrikHelperHTML::stylesheetFromPath($tmplpath . '/template.css'); $srcs['FbListFilter'] = 'media/com_fabrik/js/listfilter.js'; $srcs['Timeline'] = 'plugins/fabrik_visualization/timeline/timeline.js'; $srcs['AdvancedSearch'] = 'media/com_fabrik/js/advanced-search.js'; $js .= $model->getFilterJs(); FabrikHelperHTML::iniRequireJs($model->getShim()); FabrikHelperHTML::script($srcs, $js); JText::script('COM_FABRIK_ADVANCED_SEARCH'); JText::script('COM_FABRIK_LOADING'); $opts = array('alt' => 'calendar', 'class' => 'calendarbutton', 'id' => 'timelineDatePicker_cal_img'); $img = FabrikHelperHTML::image('calendar.png', 'form', @$this->tmpl, $opts); $this->datePicker = '<input type="text" name="timelineDatePicker" id="timelineDatePicker" value="" />' . $img; // Check and add a general fabrik custom css file overrides template css and generic table css FabrikHelperHTML::stylesheetFromPath('media/com_fabrik/css/custom.css'); // Check and add a specific biz template css file overrides template css generic table css and generic custom css FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/timeline/views/timeline/tmpl/' . $tpl . '/custom.css'); return parent::display(); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = 'default') { $app = JFactory::getApplication(); $input = $app->input; $srcs = FabrikHelperHTML::framework(); $srcs[] = 'media/com_fabrik/js/listfilter.js'; $srcs[] = 'media/com_fabrik/js/advanced-search.js'; $model = $this->getModel(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model->setId($input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0)))); $this->row = $model->getVisualization(); if (!$model->canView()) { echo FText::_('JERROR_ALERTNOAUTHOR'); return false; } if ($this->row->published == 0) { JError::raiseWarning(500, FText::_('JERROR_ALERTNOAUTHOR')); return ''; } $this->requiredFiltersFound = $this->get('RequiredFiltersFound'); if ($this->requiredFiltersFound) { $this->chart = $this->get('Chart'); } else { $this->chart = ''; } $params = $model->getParams(); $this->params = $params; $viewName = $this->getName(); $pluginManager = FabrikWorker::getPluginManager(); $plugin = $pluginManager->getPlugIn('chart', 'visualization'); $this->containerId = $this->get('ContainerId'); $this->filters = $this->get('Filters'); $this->showFilters = $model->showFilters(); $this->filterFormURL = $this->get('FilterFormURL'); $tpl = $params->get('chart_layout', $tpl); $tmplpath = JPATH_ROOT . '/plugins/fabrik_visualization/chart/views/chart/tmpl/' . $tpl; $this->_setPath('template', $tmplpath); FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/chart/views/chart/tmpl/' . $tpl . '/template.css'); // Assign something to Fabrik.blocks to ensure we can clear filters $ref = $model->getJSRenderContext(); $js = "{$ref} = {};"; $js .= "\n" . "Fabrik.addBlock('{$ref}', {$ref});"; $js .= $model->getFilterJs(); FabrikHelperHTML::iniRequireJs($model->getShim()); FabrikHelperHTML::script($srcs, $js); echo parent::display(); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = 'default') { $app = JFactory::getApplication(); $input = $app->input; $j3 = FabrikWorker::j3(); $srcs = FabrikHelperHTML::framework(); $srcs['FbListFilter'] = 'media/com_fabrik/js/listfilter.js'; $srcs['AdvancedSearch'] = 'media/com_fabrik/js/advanced-search.js'; $model = $this->getModel(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model->setId($input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0)))); $this->row = $model->getVisualization(); if (!$model->canView()) { echo FText::_('JERROR_ALERTNOAUTHOR'); return false; } $this->requiredFiltersFound = $this->get('RequiredFiltersFound'); if ($this->requiredFiltersFound) { $this->chart = $this->get('Fusionchart'); } else { $this->chart = ''; } $params = $model->getParams(); $this->params = $params; $viewName = $this->getName(); $pluginManager = JModelLegacy::getInstance('Pluginmanager', 'FabrikFEModel'); $plugin = $pluginManager->getPlugIn('calendar', 'visualization'); $this->containerId = $this->get('ContainerId'); $this->filters = $this->get('Filters'); $this->showFilters = $model->showFilters(); $this->filterFormURL = $this->get('FilterFormURL'); $tpl = $j3 ? 'bootstrap' : 'default'; $tpl = $params->get('fusionchart_layout', $tpl); $this->_setPath('template', JPATH_ROOT . '/plugins/fabrik_visualization/fusionchart/views/fusionchart/tmpl/' . $tpl); FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/fusionchart/views/fusionchart/tmpl/' . $tpl . '/template.css'); // Assign something to Fabrik.blocks to ensure we can clear filters $ref = $model->getJSRenderContext(); $js = "{$ref} = {};"; $js .= "\n" . "Fabrik.addBlock('{$ref}', {$ref});"; $js .= $model->getFilterJs(); FabrikHelperHTML::iniRequireJs($model->getShim()); FabrikHelperHTML::script($srcs, $js); $text = $this->loadTemplate(); FabrikHelperHTML::runContentPlugins($text); echo $text; }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = 'default') { $app = JFactory::getApplication(); $input = $app->input; $j3 = FabrikWorker::j3(); $model = $this->getModel(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model->setId($input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0)))); $this->row = $model->getVisualization(); $params = $model->getParams(); $js = $model->getJs(); $srcs = FabrikHelperHTML::framework(); $srcs[] = 'media/com_fabrik/js/listfilter.js'; $srcs[] = 'plugins/fabrik_visualization/media/media.js'; if ($params->get('media_which_player', 'jw') == 'jw') { $srcs[] = 'plugins/fabrik_visualization/media/libs/jw/jwplayer.js'; } FabrikHelperHTML::iniRequireJs($model->getShim()); FabrikHelperHTML::script($srcs, $js); if (!$model->canView()) { echo FText::_('JERROR_ALERTNOAUTHOR'); return false; } $media = $model->getRow(); $this->media = $model->getMedia(); $this->params = $params; $viewName = $this->getName(); $this->containerId = $model->getContainerId(); $this->showFilters = $model->showFilters(); $this->filterFormURL = $model->getFilterFormURL(); $this->filters = $this->get('Filters'); $this->params = $model->getParams(); $tpl = $j3 ? 'bootstrap' : 'default'; $tpl = $params->get('media_layout', $tpl); $tplpath = JPATH_ROOT . '/plugins/fabrik_visualization/media/views/media/tmpl/' . $tpl; $this->_setPath('template', $tplpath); FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/media/views/media/tmpl/' . $tpl . '/template.css'); echo parent::display(); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = 'default') { $app = JFactory::getApplication(); $input = $app->input; $j3 = FabrikWorker::j3(); $srcs = FabrikHelperHTML::framework(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model = $this->getModel(); $id = $input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0))); $model->setId($id); $row = $model->getVisualization(); if (!$model->canView()) { echo FText::_('JERROR_ALERTNOAUTHOR'); return false; } if ($this->get('RequiredFiltersFound')) { $model->render(); } $params = $model->getParams(); $this->params = $params; $this->containerId = $this->get('ContainerId'); $this->row = $row; $this->showFilters = $model->showFilters(); $this->filters = $this->get('Filters'); $this->filterFormURL = $this->get('FilterFormURL'); $tpl = $j3 ? 'bootstrap' : 'default'; $tmplpath = JPATH_ROOT . '/plugins/fabrik_visualization/coverflow/views/coverflow/tmpl/' . $tpl; $this->_setPath('template', $tmplpath); $srcs['FbListFilter'] = 'media/com_fabrik/js/listfilter.js'; // Assign something to Fabrik.blocks to ensure we can clear filters $ref = $model->getJSRenderContext(); $js = "{$ref} = {};"; $js .= "\n" . "Fabrik.addBlock('{$ref}', {$ref});"; $js .= $model->getFilterJs(); FabrikHelperHTML::iniRequireJs($model->getShim()); FabrikHelperHTML::script($srcs, $js); echo parent::display(); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = 'default') { $app = JFactory::getApplication(); $package = $app->getUserState('com_fabrik.package', 'fabrik'); $input = $app->input; $j3 = FabrikWorker::j3(); $Itemid = FabrikWorker::itemId(); $model = $this->getModel(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $id = $input->get('id', $usersConfig->get('visualizationid', $input->get('visualizationid', 0))); $model->setId($id); $this->row = $model->getVisualization(); $params = $model->getParams(); $this->params = $params; $this->containerId = $model->getJSRenderContext(); $this->filters = $this->get('Filters'); $this->showFilters = $model->showFilters(); $this->showTitle = $input->getInt('show-title', 1); $this->filterFormURL = $this->get('FilterFormURL'); $calendar = $this->row; JHTML::stylesheet('media/com_fabrik/css/list.css'); $this->canAdd = (bool) $params->get('calendar-read-only', 0) == 1 ? false : $model->getCanAdd(); $this->requiredFiltersFound = $this->get('RequiredFiltersFound'); if ($params->get('calendar_show_messages', '1') == '1' && $this->canAdd && $this->requiredFiltersFound) { $msg = JText::_('PLG_VISUALIZATION_CALENDAR_DOUBLE_CLICK_TO_ADD'); $msg .= $model->getDateLimitsMsg(); $app->enqueueMessage($msg); } JHTML::stylesheet('media/com_fabrik/css/list.css'); // Get all list where statements - which are then included in the ajax call to ensure we get the correct data set loaded $urlfilters = new stdClass(); $urlfilters->where = $model->buildQueryWhere(); $urls = new stdClass(); // Don't JRoute as its wont load with sef? $urls->del = 'index.php?option=com_' . $package . '&controller=visualization.calendar&view=visualization&task=deleteEvent&format=raw&Itemid=' . $Itemid . '&id=' . $id; $urls->add = 'index.php?option=com_' . $package . '&view=visualization&format=raw&Itemid=' . $Itemid . '&id=' . $id; $user = JFactory::getUser(); $legend = $params->get('show_calendar_legend', 0) ? $model->getLegend() : ''; $tpl = $j3 ? 'bootstrap' : 'default'; $tpl = $params->get('calendar_layout', $j3); $options = new stdClass(); $options->url = $urls; $options->dateLimits = $model->getDateLimits(); $options->deleteables = $model->getDeleteAccess(); $options->eventLists = $model->getEventLists(); $options->calendarId = $calendar->id; $options->popwiny = $params->get('yoffset', 0); $options->urlfilters = $urlfilters; $options->canAdd = $this->canAdd; $options->showFullDetails = (bool) $params->get('show_full_details', false); $options->restFilterStart = FabrikWorker::getMenuOrRequestVar('resetfilters', 0, false, 'request'); $options->tmpl = $tpl; $o = $model->getAddStandardEventFormInfo(); if ($o != null) { $options->listid = $o->id; } // $$$rob @TODO not sure this is need - it isn't in the timeline viz $model->setRequestFilters(); $options->filters = $model->filters; // End not sure $options->Itemid = $Itemid; $options->show_day = (bool) $params->get('show_day', true); $options->show_week = (bool) $params->get('show_week', true); $options->days = array(JText::_('SUNDAY'), JText::_('MONDAY'), JText::_('TUESDAY'), JText::_('WEDNESDAY'), JText::_('THURSDAY'), JText::_('FRIDAY'), JText::_('SATURDAY')); $options->shortDays = array(JText::_('SUN'), JText::_('MON'), JText::_('TUE'), JText::_('WED'), JText::_('THU'), JText::_('FRI'), JText::_('SAT')); $options->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')); $options->shortMonths = array(JText::_('JANUARY_SHORT'), JText::_('FEBRUARY_SHORT'), JText::_('MARCH_SHORT'), JText::_('APRIL_SHORT'), JText::_('MAY_SHORT'), JText::_('JUNE_SHORT'), JText::_('JULY_SHORT'), JText::_('AUGUST_SHORT'), JText::_('SEPTEMBER_SHORT'), JText::_('OCTOBER_SHORT'), JText::_('NOVEMBER_SHORT'), JText::_('DECEMBER_SHORT')); $options->first_week_day = (int) $params->get('first_week_day', 0); $options->monthday = new stdClass(); $options->monthday->width = (int) $params->get('calendar-monthday-width', 90); $options->monthday->height = (int) $params->get('calendar-monthday-height', 80); $options->greyscaledweekend = $params->get('greyscaled-week-end', 0) === '1'; $options->viewType = $params->get('calendar_default_view', 'monthView'); $options->weekday = new stdClass(); $options->weekday->width = (int) $params->get('calendar-weekday-width', 90); $options->weekday->height = (int) $params->get('calendar-weekday-height', 10); $options->open = (int) $params->get('open-hour', 0); $options->close = (int) $params->get('close-hour', 24); $options->showweekends = (bool) $params->get('calendar-show-weekends', true); $options->readonly = (bool) $params->get('calendar-read-only', false); $options->timeFormat = $params->get('time_format', '%X'); $options->readonlyMonth = (bool) $params->get('readonly_monthview', false); $options->j3 = FabrikWorker::j3(); if (FabrikWorker::j3()) { $options->buttons = new stdClass(); $options->buttons->del = '<button class="btn popupDelete" data-task="deleteCalEvent"><i class="icon-delete"></i></button>'; $options->buttons->edit = '<button class="btn popupEdit" data-task="editCalEvent"><i class="icon-edit"></i></button>'; $options->buttons->view = '<button class="btn popupView" data-task="viewCalEvent"><i class="icon-eye"></i></button>'; } else { $src = COM_FABRIK_LIVESITE . 'plugins/fabrik_visualization/calendar/views/calendar/tmpl/' . $tpl . '/images/minus-sign.png'; $options->buttons = '<img src="' . $src . '" alt = "del" class="fabrikDeleteEvent" />' . JText::_('PLG_VISUALIZATION_CALENDAR_DELETE'); } $json = json_encode($options); JText::script('PLG_VISUALIZATION_CALENDAR_NEXT'); JText::script('PLG_VISUALIZATION_CALENDAR_PREVIOUS'); JText::script('PLG_VISUALIZATION_CALENDAR_DAY'); JText::script('PLG_VISUALIZATION_CALENDAR_WEEK'); JText::script('PLG_VISUALIZATION_CALENDAR_MONTH'); JText::script('PLG_VISUALIZATION_CALENDAR_KEY'); JText::script('PLG_VISUALIZATION_CALENDAR_TODAY'); JText::script('PLG_VISUALIZATION_CALENDAR_CONF_DELETE'); JText::script('PLG_VISUALIZATION_CALENDAR_DELETE'); JText::script('PLG_VISUALIZATION_CALENDAR_VIEW'); JText::script('PLG_VISUALIZATION_CALENDAR_EDIT'); JText::script('PLG_VISUALIZATION_CALENDAR_ADD_EDIT_EVENT'); JText::script('COM_FABRIK_FORM_SAVED'); JText::script('PLG_VISUALIZATION_CALENDAR_EVENT_START_END'); JText::script('PLG_VISUALIZATION_CALENDAR_DATE_ADD_TOO_LATE'); JText::script('PLG_VISUALIZATION_CALENDAR_DATE_ADD_TOO_EARLY'); $ref = $model->getJSRenderContext(); $js = array(); $js[] = "\tvar {$ref} = new fabrikCalendar('{$ref}');"; $js[] = "\t{$ref}.render({$json});"; $js[] = "\tFabrik.addBlock('" . $ref . "', {$ref});"; $js[] = "\t" . $legend . ""; $js[] = "" . $model->getFilterJs(); $js = implode("\n", $js); $srcs = FabrikHelperHTML::framework(); $srcs[] = 'media/com_fabrik/js/listfilter.js'; $srcs[] = 'plugins/fabrik_visualization/calendar/calendar.js'; FabrikHelperHTML::iniRequireJs($model->getShim()); FabrikHelperHTML::script($srcs, $js); $viewName = $this->getName(); $this->params = $model->getParams(); $tpl = $params->get('calendar_layout', $tpl); $tmplpath = JPATH_ROOT . '/plugins/fabrik_visualization/calendar/views/calendar/tmpl/' . $tpl; $this->_setPath('template', $tmplpath); FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/calendar/views/calendar/tmpl/' . $tpl . '/template.css'); // Adding custom.css, just for the heck of it FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/calendar/views/calendar/tmpl/' . $tpl . '/custom.css'); return parent::display(); }
/** * Initialize the js * * @return void */ private function iniJs() { $model = $this->getModel(); $ref = $model->getJSRenderContext(); $json = json_encode($this->jsOptions()); $js = array(); $js[] = "\tvar {$ref} = new fabrikFullcalendar('{$ref}', {$json});"; $js[] = "\tFabrik.addBlock('" . $ref . "', {$ref});"; $js[] = "" . $model->getFilterJs(); $js = implode("\n", $js); $mediaFolder = FabrikHelperHTML::getMediaFolder(); $srcs = FabrikHelperHTML::framework(); $srcs['FbListFilter'] = $mediaFolder . '/listfilter.js'; $srcs['fabrikFullcalendar'] = 'plugins/fabrik_visualization/fullcalendar/fullcalendar.js'; /* $shim = $model->getShim(); $fcLangFolder = 'plugins/fabrik_visualization/fullcalendar/libs/fullcalendar/lang/'; // Figure out what language we are using $lang = strtolower(JFactory::getUser()->getParam('language', JFactory::getLanguage()->getTag())); if ( file_exists( JPATH_BASE . '/' . $fcLangFolder . $lang . '.js') === false ) { $lang = FabrikWorker::getShortLang(); if ( file_exists( JPATH_BASE . '/' . $fcLangFolder . $lang . '.js') === false ) { $lang = 'en-gb'; } } $shim['lang'] = (object) array('deps' => array('lib/moment/moment', 'fullcalendar') ); $shim['viz/fullcalendar/fullcalendar'] = (object) array('deps' => array('lang', 'jquery') ); FabrikHelperHTML::iniRequireJs($shim, array('fullcalendar' => 'plugins/fabrik_visualization/fullcalendar/libs/fullcalendar/fullcalendar.min', 'lang' => $fcLangFolder . $lang)); FabrikHelperHTML::script($srcs, $js); */ $shim = $model->getShim(); $shim['fullcalendar'] = (object) array('deps' => array('lib/moment/moment')); $shim['viz/fullcalendar/fullcalendar'] = (object) array('deps' => array('fullcalendar', 'jquery')); FabrikHelperHTML::iniRequireJs($shim, array('fullcalendar' => 'plugins/fabrik_visualization/fullcalendar/libs/fullcalendar/fullcalendar.min')); FabrikHelperHTML::script($srcs, $js); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = 'default') { $app = JFactory::getApplication(); $input = $app->input; $j3 = FabrikWorker::j3(); $srcs = FabrikHelperHTML::framework(); FabrikHelperHTML::slimbox(); $document = JFactory::getDocument(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model = $this->getModel(); $model->setId($input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0)))); $this->row = $model->getVisualization(); $js = $model->getJs(); $this->txt = $model->getText(); $params = $model->getParams(); $this->params = $params; $tpl = $j3 ? 'bootstrap' : 'default'; $tpl = $params->get('fb_gm_layout', $tpl); $tmplpath = JPATH_ROOT . '/plugins/fabrik_visualization/googlemap/views/googlemap/tmpl/' . $tpl; $srcs[] = 'media/com_fabrik/js/list-plugin.js'; $srcs[] = 'media/com_fabrik/js/listfilter.js'; $uri = JURI::getInstance(); if ($params->get('fb_gm_center') == 'userslocation') { $srcs[] = 'components/com_fabrik/libs/geo-location/geo.js'; } $model->getPluginJsClasses($srcs); global $ispda; if ($ispda == 1) { // Pdabot $template = 'static'; $this->staticmap = $model->getStaticMap(); } else { if (FabrikHelperHTML::isDebug()) { $srcs[] = 'plugins/fabrik_visualization/googlemap/googlemap.js'; } else { $srcs[] = 'plugins/fabrik_visualization/googlemap/googlemap-min.js'; } if ((int) $this->params->get('fb_gm_clustering', '0') == 1) { if (FabrikHelperHTML::isDebug()) { $srcs[] = 'components/com_fabrik/libs/googlemaps/markerclustererplus/src/markerclusterer.js'; } else { $srcs[] = 'components/com_fabrik/libs/googlemaps/markerclustererplus/src/markerclusterer_packed.js'; } } else { // Doesn't work in v3 // FabrikHelperHTML::script('components/com_fabrik/libs/googlemaps/markermanager.js'); } $template = null; } $js .= $model->getPluginJsObjects(); $js .= $model->getFilterJs(); FabrikHelperHTML::iniRequireJs($model->getShim()); FabrikHelperHTML::script($srcs, $js); FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/googlemap/views/googlemap/tmpl/' . $tpl . '/template.css'); // Check and add a general fabrik custom css file overrides template css and generic table css FabrikHelperHTML::stylesheetFromPath('media/com_fabrik/css/custom.css'); // Check and add a specific viz template css file overrides template css generic table css and generic custom css FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/googlemap/views/googlemap/tmpl/' . $tpl . '/custom.css'); $this->filters = $model->getFilters(); $this->showFilters = $model->showFilters(); $this->filterFormURL = $model->getFilterFormURL(); $this->sidebarPosition = $params->get('fb_gm_use_overlays_sidebar'); $this->showOverLays = (bool) $params->get('fb_gm_use_overlays'); if ($model->getShowSideBar()) { $this->showSidebar = 1; $this->overlayUrls = (array) $params->get('fb_gm_overlay_urls'); $this->overlayLabels = (array) $params->get('fb_gm_overlay_labels'); } else { $this->showSidebar = 0; } $this->_setPath('template', $tmplpath); $this->containerId = $model->getContainerId(); $this->groupTemplates = $model->getGroupTemplates(); echo parent::display($template); }