function display($tmpl = 'default') { FabrikHelperHTML::packageJS(); $usersConfig =& JComponentHelper::getParams('com_fabrik'); $model = $this->getModel(); $id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))); $model->setId($id); $row =& $model->getVisualization(); $model->setTableIds(); if ($this->get('RequiredFiltersFound')) { $model->render(); } $this->assign('containerId', $this->get('ContainerId')); $this->assignRef('row', $row); $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0); $this->assignRef('filters', $this->get('Filters')); $this->assign('filterFormURL', $this->get('FilterFormURL')); $pluginParams =& $model->getPluginParams(); $this->assignRef('params', $pluginParams); $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'coverflow' . DS . 'views' . DS . 'coverflow' . DS . 'tmpl' . DS . $tmpl; $this->_setPath('template', $tmplpath); //ensure we don't have an incorrect version of mootools loaded JHTML::stylesheet('table.css', 'media/com_fabrik/css/'); FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true); //check and add a general fabrik custom css file overrides template css and generic table css FabrikHelperHTML::stylesheetFromPath("media" . DS . "com_fabrik" . DS . "css" . DS . "custom.css"); //check and add a specific biz template css file overrides template css generic table css and generic custom css FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "plugins" . DS . "visualization" . DS . "coverflow" . DS . "views" . DS . "coverflow" . DS . "tmpl" . DS . $tmpl . DS . "custom.css"); FabrikHelperHTML::cleanMootools(); //assign something to oPackage to ensure we can clear filters $str = "window.addEvent('domready', function(){\n\t\t\tfabrikChart{$this->row->id} = {};"; $str .= "\n" . "oPackage.addBlock('vizualization_{$this->row->id}', fabrikChart{$this->row->id});\n\t\t});"; FabrikHelperHTML::addScriptDeclaration($str); echo parent::display(); }
function display($tmpl = 'default') { FabrikHelperHTML::packageJS(); $usersConfig =& JComponentHelper::getParams('com_fabrik'); $model = $this->getModel(); $id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))); $model->setId($id); $row =& $model->getVisualization(); $model->setTableIds(); $model->render(); $this->assign('containerId', $this->get('ContainerId')); $this->assignRef('row', $row); $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0); $this->assignRef('filters', $this->get('Filters')); $this->assign('filterFormURL', $this->get('FilterFormURL')); $pluginParams =& $model->getPluginParams(); $this->assignRef('params', $pluginParams); $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'timeline' . DS . 'views' . DS . 'timeline' . DS . 'tmpl' . DS . $tmpl; $this->_setPath('template', $tmplpath); //ensure we don't have an incorrect version of mootools loaded JHTML::stylesheet('table.css', 'media/com_fabrik/css/'); FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true); //check and add a general fabrik custom css file overrides template css and generic table css FabrikHelperHTML::stylesheetFromPath("media" . DS . "com_fabrik" . DS . "css" . DS . "custom.css"); //check and add a specific biz template css file overrides template css generic table css and generic custom css FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "plugins" . DS . "visualization" . DS . "timeline" . DS . "views" . DS . "timeline" . DS . "tmpl" . DS . $tmpl . DS . "custom.css"); FabrikHelperHTML::cleanMootools(); 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. */ function display($tpl = 'default') { FabrikHelperHTML::framework(); $app = JFactory::getApplication(); $params = $app->getParams('com_fabrik'); $document = JFactory::getDocument(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model = $this->getModel(); $model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)))); $this->row = $model->getVisualization(); $params = $model->getParams(); $this->assign('params', $params); $pluginParams = $model->getPluginParams(); $tpl = $pluginParams->get('fb_gm_layout', $tpl); $tmplpath = JPATH_ROOT . '/plugins/fabrik_visualization/kaltura/views/kaltura/tmpl/' . $tpl; $js = <<<EOT \t\t<script type="text/javascript" > function entryClicked ( entry_id ) { \twindow.location = "./player.php?entry_id=" + entry_id; } </script> EOT; $this->assignRef('data', $this->get('Data')); FabrikHelperHTML::addScriptDeclaration($js); FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/kaltura/views/kaltura/tmpl/' . $tpl . '/template.css'); $template = null; $this->assign('containerId', $this->get('ContainerId')); $this->assign('showFilters', JRequest::getInt('showfilters', $params->get('show_filters')) === 1 ? 1 : 0); $this->assignRef('filters', $this->get('Filters')); $this->_setPath('template', $tmplpath); echo parent::display($template); }
function display($tmpl = 'default') { FabrikHelperHTML::framework(); FabrikHelperHTML::script('media/com_fabrik/js/list.js'); $model = $this->getModel(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)))); $this->row = $model->getVisualization(); $model->setListIds(); if ($this->row->published == 0) { JError::raiseWarning(500, JText::_('JERROR_ALERTNOAUTHOR')); return ''; } $calendar = $model->_row; $this->media = $model->getMedia(); $params = $model->getParams(); $this->assign('params', $params); $viewName = $this->getName(); $pluginManager = FabrikWorker::getPluginManager(); $plugin = $pluginManager->getPlugIn('media', 'visualization'); $this->assign('containerId', $this->get('ContainerId')); $this->assign('showFilters', JRequest::getInt('showfilters', $params->get('show_filters')) === 1 ? 1 : 0); $this->assignRef('filters', $this->get('Filters')); $this->assign('params', $model->getParams()); $pluginParams = $model->getPluginParams(); $tmpl = $pluginParams->get('media_layout', $tmpl); $tmplpath = JPATH_ROOT . '/plugins/fabrik_visualization/media/views/media/tmpl/' . $tmpl; $this->_setPath('template', $tmplpath); FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/media/views/media/tmpl/' . $tmpl . '/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') { $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; }
/** * 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; }
/** * Add CSS * * @param $tpl */ private function css($tpl) { $lib = COM_FABRIK_LIVESITE . 'plugins/fabrik_visualization/fullcalendar/libs/fullcalendar/'; FabrikHelperHTML::styleSheet($lib . 'fullcalendar.css'); // Add our css FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/fullcalendar/fullcalendar.css'); JHTML::stylesheet('media/com_fabrik/css/list.css'); FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/fullcalendar/views/fullcalendar/tmpl/' . $tpl . '/template.css'); // Adding custom.css, just for the heck of it FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/fullcalendar/views/fullcalendar/tmpl/' . $tpl . '/custom.css'); }
function display($tmpl = 'default') { FabrikHelperHTML::framework(); $model = $this->getModel(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)))); $this->row = $model->getVisualization(); $model->setListIds(); if ($this->row->published == 0) { JError::raiseWarning(500, JText::_('JERROR_ALERTNOAUTHOR')); return ''; } $this->assign('js', $this->get('JS')); $viewName = $this->getName(); $params = $model->getParams(); $this->assign('params', $params); $pluginManager = JModel::getInstance('Pluginmanager', 'FabrikFEModel'); $plugin = $pluginManager->getPlugIn('slideshow', 'visualization'); $this->assign('showFilters', JRequest::getInt('showfilters', $params->get('show_filters')) === 1 ? 1 : 0); $this->assignRef('filters', $this->get('Filters')); $this->assign('filterFormURL', $this->get('FilterFormURL')); $pluginParams = $model->getPluginParams(); $this->assignRef('params', $model->getParams()); $tmpl = $pluginParams->get('slideshow_viz_layout', $tmpl); $tmplpath = $model->pathBase . 'slideshow/views/slideshow/tmpl' . DS . $tmpl; $this->_setPath('template', $tmplpath); FabrikHelperHTML::script('media/com_fabrik/js/list.js'); if ($this->get('RequiredFiltersFound')) { FabrikHelperHTML::script('components/com_fabrik/libs/slideshow2/js/slideshow.js'); $slideshow_viz_type = $pluginParams->get('slideshow_viz_type', 1); switch ($slideshow_viz_type) { case 1: break; case 2: FabrikHelperHTML::script('components/com_fabrik/libs/slideshow2/js/slideshow.kenburns.js'); break; case 3: FabrikHelperHTML::script('components/com_fabrik/libs/slideshow2/js/slideshow.push.js'); break; case 4: FabrikHelperHTML::script('components/com_fabrik/libs/slideshow2/js/slideshow.fold.js'); break; default: break; } JHTML::stylesheet('components/com_fabrik/libs/slideshow2/css/slideshow.css'); FabrikHelperHTML::script('plugins/fabrik_visualization/slideshow/slideshow.js'); } FabrikHelperHTML::addScriptDeclaration($this->js); $tmplpath = JPATH_ROOT . '/plugins/fabrik_visualization/slideshow/views/slideshow/tmpl/' . $tmpl; $this->_setPath('template', $tmplpath); FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/slideshow/views/slideshow/tmpl/' . $tmpl . '/template.css'); echo parent::display(); }
function display($tmpl = 'default') { JHTML::_('behavior.calendar'); FabrikHelperHTML::packageJS(); FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/'); FabrikHelperHTML::script('advanced-search.js', 'media/com_fabrik/js/'); require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php'; FabrikHelperHTML::mocha(); FabrikHelperHTML::loadCalendar(); $model =& $this->getModel(); $usersConfig =& JComponentHelper::getParams('com_fabrik'); $model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)))); $this->row =& $model->getVisualization(); $model->setTableIds(); if ($this->row->state == 0) { JError::raiseWarning(500, JText::_('ALERTNOTAUTH')); return ''; } $calendar =& $model->_row; $this->assign('requiredFiltersFound', $this->get('RequiredFiltersFound')); if ($this->requiredFiltersFound) { $this->assign('chart', $this->get('Chart')); } else { $this->assign('chart', ''); } $viewName = $this->getName(); $pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikModel'); $plugin =& $pluginManager->getPlugIn('calendar', 'visualization'); $this->assign('containerId', $this->get('ContainerId')); $this->assignRef('filters', $this->get('Filters')); $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0); $this->assign('filterFormURL', $this->get('FilterFormURL')); $pluginParams =& $model->getPluginParams(); $this->assignRef('params', $pluginParams); JHTML::stylesheet('table.css', 'media/com_fabrik/css/'); $tmpl = $pluginParams->get('chart_layout', $tmpl); $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'chart' . DS . 'views' . DS . 'chart' . DS . 'tmpl' . DS . $tmpl; $this->_setPath('template', $tmplpath); $ab_css_file = $tmplpath . DS . "template.css"; if (JFile::exists($ab_css_file)) { JHTML::stylesheet('template.css', 'components/com_fabrik/plugins/visualization/chart/views/chart/tmpl/' . $tmpl . '/', true); } //check and add a general fabrik custom css file overrides template css and generic table css FabrikHelperHTML::stylesheetFromPath("media" . DS . "com_fabrik" . DS . "css" . DS . "custom.css"); //check and add a specific biz template css file overrides template css generic table css and generic custom css FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "plugins" . DS . "visualization" . DS . "chart" . DS . "views" . DS . "chart" . DS . "tmpl" . DS . $tmpl . DS . "custom.css"); //assign something to oPackage to ensure we can clear filters $str = "window.addEvent('domready', function(){\n\t\t\tfabrikChart{$this->row->id} = {};"; $str .= "\n" . "oPackage.addBlock('vizualization_{$this->row->id}', fabrikChart{$this->row->id});\n\t\t});"; FabrikHelperHTML::addScriptDeclaration($str); //ensure we don't have an incorrect version of mootools loaded FabrikHelperHTML::cleanMootools(); echo parent::display(); }
/** * Still a wip access the view of subscribed notifications with url: * http://localhost/fabrik30x/index.php?option=com_fabrik&task=cron.display&id=3 * * deletion not routing right yet * * @param string $tpl Template * * @return void */ public function display($tpl = 'default') { $model = $this->getModel(); $model->loadLang(); $this->rows = $model->getUserNotifications(); $this->id = $model->getId(); $j3 = FabrikWorker::j3(); $viewName = $this->getName(); $tpl = $j3 ? 'bootstrap' : 'default'; $tmplpath = JPATH_ROOT . '/plugins/fabrik_cron/notification/views/notification/tmpl/' . $tpl; $this->_setPath('template', $tmplpath); FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_cron/notification/views/notification/tmpl/' . $tpl . '/template.css'); echo parent::display(); }
function display($tmpl = 'default') { $app =& JFactory::getApplication(); FabrikHelperHTML::packageJS(); $params =& $app->getParams('com_fabrik'); $document =& JFactory::getDocument(); $usersConfig =& JComponentHelper::getParams('com_fabrik'); $model =& $this->getModel(); $model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)))); $this->row =& $model->getVisualization(); $this->params =& $model->getParams(); $pluginParams =& $model->getPluginParams(); $this->assignRef('params', $pluginParams); $tmpl = $pluginParams->get('fb_gm_layout', $tmpl); $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'kaltura' . DS . 'views' . DS . 'kaltura' . DS . 'tmpl' . DS . $tmpl; $js = <<<EOT \t\t<script type="text/javascript" > function entryClicked ( entry_id ) { \twindow.location = "./player.php?entry_id=" + entry_id; } </script> EOT; JHTML::stylesheet('table.css', 'media/com_fabrik/css/'); $this->assign('requiredFiltersFound', $this->get('RequiredFiltersFound')); if ($this->requiredFiltersFound) { $this->assignRef('data', $this->get('Data')); } else { $this->assignRef('data', ''); } FabrikHelperHTML::addScriptDeclaration($js); $ab_css_file = $tmplpath . DS . "template.css"; if (JFile::exists($ab_css_file)) { JHTML::stylesheet('template.css', 'components/com_fabrik/plugins/visualization/googlemap/views/googlemap/tmpl/' . $tmpl . '/', true); } //check and add a general fabrik custom css file overrides template css and generic table css FabrikHelperHTML::stylesheetFromPath("media" . DS . "com_fabrik" . DS . "css" . DS . "custom.css"); //check and add a specific biz template css file overrides template css generic table css and generic custom css FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "plugins" . DS . "visualization" . DS . "kaltura" . DS . "views" . DS . "kaltura" . DS . "tmpl" . DS . $tmpl . DS . "custom.css"); $template = null; $this->assign('containerId', $this->get('ContainerId')); $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0); $this->assignRef('filters', $this->get('Filters')); $this->assign('filterFormURL', $this->get('FilterFormURL')); $this->_setPath('template', $tmplpath); //ensure we don't have an incorrect version of mootools loaded FabrikHelperHTML::cleanMootools(); echo parent::display($template); }
/** * 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') { $srcs = FabrikHelperHTML::framework(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model = $this->getModel(); // Needed to load the language file! $pluginManager = FabrikWorker::getPluginManager(); $plugin = $pluginManager->getPlugIn('timeline', 'visualization'); $id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))); $model->setId($id); $row = $model->getVisualization(); $js = $model->render(); $this->assign('containerId', $this->get('ContainerId')); $this->assignRef('row', $row); $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0); $this->assignRef('filters', $this->get('Filters')); $this->advancedSearch = $this->get('AdvancedSearchLink'); $this->assign('filterFormURL', $this->get('FilterFormURL')); $params = $model->getParams(); $this->assignRef('params', $params); $this->width = $params->get('timeline_width', '700'); $this->height = $params->get('timeline_height', '300'); $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[] = 'media/com_fabrik/js/listfilter.js'; $srcs[] = 'plugins/fabrik_visualization/timeline/timeline.js'; $srcs[] = 'media/com_fabrik/js/advanced-search.js'; $srcs[] = 'media/com_fabrik/js/encoder.js'; $js .= $model->getFilterJs(); 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(); }
function display($tmpl = 'default') { require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php'; $model =& $this->getModel(); $usersConfig =& JComponentHelper::getParams('com_fabrik'); $id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))); $model->setId($id); $this->assignRef('row', $this->get('Visualization')); $this->assign('html', $this->get('HTML')); $this->assign('containerId', $this->get('ContainerId')); $this->calName = $this->get('VizName'); $this->assignRef('params', $this->get('PluginParams')); $tmpl = $this->params->get('approvals_layout', $tmpl); $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'approvals' . DS . 'views' . DS . 'approvals' . DS . 'tmpl' . DS . $tmpl; $this->_setPath('template', $tmplpath); $ab_css_file = $tmplpath . DS . "template.css"; if (file_exists($ab_css_file)) { JHTML::stylesheet('template.css', 'components/com_fabrik/plugins/visualization/approvals/views/approvals/tmpl/' . $tmpl . '/', true); } //check and add a general fabrik custom css file overrides template css and generic table css FabrikHelperHTML::stylesheetFromPath("media" . DS . "com_fabrik" . DS . "css" . DS . "custom.css"); //check and add a specific biz template css file overrides template css generic table css and generic custom css FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "plugins" . DS . "visualization" . DS . "approvals" . DS . "views" . DS . "approvals" . DS . "tmpl" . DS . $tmpl . DS . "custom.css"); $text = $this->loadTemplate(); $opt = JRequest::getVar('option'); $view = JRequest::getCmd('view'); JRequest::setVar('view', 'article'); JRequest::setVar('option', 'com_content'); jimport('joomla.html.html.content'); $text .= '{emailcloak=off}'; $text = JHTML::_('content.prepare', $text); $text = preg_replace('/\\{emailcloak\\=off\\}/', '', $text); JRequest::setVar('option', $opt); JRequest::setVar('view', $view); if ($this->_isMambot) { return $text; } else { 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(); $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(); }
function display($tmpl = 'default') { FabrikHelperHTML::slimbox(); $document =& JFactory::getDocument(); FabrikHelperHTML::packageJS(); $usersConfig =& JComponentHelper::getParams('com_fabrik'); $model =& $this->getModel(); $model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)))); $this->row =& $model->getVisualization(); $model->setTableIds(); $js = $model->getJs(); $model->getCustomJsAction(); $this->txt = $model->getText(); $this->params =& $model->getParams(); $params =& $model->getPluginParams(); $this->assignRef('params', $params); $tmpl = $params->get('fb_gm_layout', $tmpl); $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'googlemap' . DS . 'views' . DS . 'googlemap' . DS . 'tmpl' . DS . $tmpl; FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true); FabrikHelperHTML::script('Event.Delegation.js', 'media/com_fabrik/js/', true); if ($params->get('fb_gm_center') == 'userslocation') { $document->addScript('http://code.google.com/apis/gears/gears_init.js'); FabrikHelperHTML::script('geo.js', 'components/com_fabrik/libs/geo-location/'); } $this->get('PluginJsClasses'); $tableplugins = "window.addEvent('domready', function(){\n" . $this->get('PluginJsObjects') . "\n});"; FabrikHelperHTML::addScriptDeclaration($tableplugins); JHTML::stylesheet('table.css', 'media/com_fabrik/css/'); global $ispda; if ($ispda == 1) { //pdabot $template = 'static'; $this->assign('staticmap', $this->get('StaticMap')); } else { //$src = "http://maps.google.com/maps/api/js?sensor=".$params->get('fb_gm_sensor', 'false'); $uri = JURI::getInstance(); $src = $uri->getScheme() . "://maps.google.com/maps/api/js?sensor=" . $params->get('fb_gm_sensor', 'false'); $document->addScript($src); FabrikHelperHTML::script('googlemap.js', 'components/com_fabrik/plugins/visualization/googlemap/', true); if ($this->params->get('fb_gm_clustering') == 1) { $document->addScript('http://google-maps-utility-library-v3.googlecode.com/svn/tags/markermanager/1.0/src/markermanager.js'); } else { if ($this->params->get('fb_gm_clustering') == 2) { //$document->addScript('http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer_compiled.js'); FabrikHelperHTML::script('markerclusterer_packed.js', 'components/com_fabrik/libs/googlemaps/markerclustererplus/src/', true); } else { //doesnt work in v3 //FabrikHelperHTML::script('markermanager.js', 'components/com_fabrik/libs/googlemaps/', true); } } FabrikHelperHTML::addScriptDeclaration($js); $ab_css_file = $tmplpath . DS . 'template.css'; if (JFile::exists($ab_css_file)) { JHTML::stylesheet('template.css', 'components/com_fabrik/plugins/visualization/googlemap/views/googlemap/tmpl/' . $tmpl . '/', true); } $template = null; } //check and add a general fabrik custom css file overrides template css and generic table css FabrikHelperHTML::stylesheetFromPath("media" . DS . "com_fabrik" . DS . "css" . DS . "custom.css"); //check and add a specific viz template css file overrides template css generic table css and generic custom css FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "plugins" . DS . "visualization" . DS . "googlemap" . DS . "views" . DS . "googlemap" . DS . "tmpl" . DS . $tmpl . DS . "custom.css"); $this->assignRef('filters', $this->get('Filters')); $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0); $this->assign('filterFormURL', $this->get('FilterFormURL')); $this->assign('sidebarPosition', $params->get('fb_gm_use_overlays_sidebar')); //if ((int)$params->get('fb_gm_use_overlays', 0) === 1 && (int)$params->get('fb_gm_use_overlays_sidebar', 0) > 0) { if ($this->get('ShowSideBar')) { $this->assign('showSidebar', 1); $this->assign('overlayUrls', $params->get('fb_gm_overlay_urls', array(), '_default', 'array')); $this->assign('overlayLabels', $params->get('fb_gm_overlay_labels', array(), '_default', 'array')); } else { $this->assign('showSidebar', 0); } $this->_setPath('template', $tmplpath); $this->assign('containerId', $this->get('ContainerId')); $this->assignRef('grouptemplates', $this->get('GroupTemplates')); //ensure we don't have an incorrect version of mootools loaded FabrikHelperHTML::cleanMootools(); echo parent::display(); }
/** * loads form's css files * Checks : custom css file, template css file. Including them if found */ function getFormCss() { $tmpl = $this->getForm()->form_template; /* check for a custom css file */ if (JRequest::getVar('incformcss', 1) == 1) { FabrikHelperHTML::stylesheet('form.css', 'media/com_fabrik/css/'); } //check and add a general fabrik custom css file overrides generic form css FabrikHelperHTML::stylesheetFromPath("media" . DS . "com_fabrik" . DS . "css" . DS . "custom.css"); FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "css" . DS . $this->getId() . ".css"); /* check for a form template file (code moved from view) */ if ($tmpl != '') { FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . 'views' . DS . 'form' . DS . 'tmpl' . DS . $tmpl . DS . "template.css"); //check and add a custom form template css FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . 'views' . DS . 'form' . DS . 'tmpl' . DS . $tmpl . DS . "custom.css"); } $app =& JFactory::getApplication(); if ($app->isAdmin() && JRequest::getVar('tmpl') === 'components') { FabrikHelperHTML::stylesheet('system.css', 'administrator/templates/system/css/'); } }
function display($tmpl = 'default') { FabrikHelperHTML::framework(); FabrikHelperHTML::slimbox(); $document = JFactory::getDocument(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model = $this->getModel(); $model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)))); $this->row = $model->getVisualization(); $model->setListIds(); $js = $model->getJs(); $this->txt = $model->getText(); $params = $model->getParams(); $this->assign('params', $params); $tmpl = $params->get('fb_gm_layout', $tmpl); $tmplpath = JPATH_ROOT . '/plugins/fabrik_visualization/googlemap/views/googlemap/tmpl/' . $tmpl; FabrikHelperHTML::script('media/com_fabrik/js/list.js'); $uri = JURI::getInstance(); if ($params->get('fb_gm_center') == 'userslocation') { $document->addScript($uri->getScheme() . '://code.google.com/apis/gears/gears_init.js'); FabrikHelperHTML::script('components/com_fabrik/libs/geo-location/geo.js'); } $src = $this->get('PluginJsClasses'); FabrikHelperHTML::script($src); $tableplugins = "head.ready(function() {\n" . $this->get('PluginJsObjects') . "\n});"; FabrikHelperHTML::addScriptDeclaration($tableplugins); global $ispda; if ($ispda == 1) { //pdabot $template = 'static'; $this->assign('staticmap', $this->get('StaticMap')); } else { $src = $uri->getScheme() . '://maps.google.com/maps/api/js?sensor=' . $params->get('fb_gm_sensor', 'false'); $document->addScript($src); FabrikHelperHTML::script('plugins/fabrik_visualization/googlemap/googlemap.js'); if ((int) $this->params->get('fb_gm_clustering', '0') == 1) { FabrikHelperHTML::script('components/com_fabrik/libs/googlemaps/markerclusterer/src/markerclusterer.js'); //FabrikHelperHTML::script('http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer_compiled.js'); //FabrikHelperHTML::script('components/com_fabrik/libs/googlemaps/markermanager.js'); } else { //doesnt work in v3 //FabrikHelperHTML::script('components/com_fabrik/libs/googlemaps/markermanager.js'); } FabrikHelperHTML::addScriptDeclaration($js); $template = null; } FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/googlemap/views/googlemap/tmpl/' . $tmpl . '/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/' . $tmpl . '/custom.css'); $this->assignRef('filters', $this->get('Filters')); $this->assign('showFilters', JRequest::getInt('showfilters', $params->get('show_filters')) === 1 ? 1 : 0); $this->assign('filterFormURL', $this->get('FilterFormURL')); $this->assign('sidebarPosition', $params->get('fb_gm_use_overlays_sidebar')); if ($this->get('ShowSideBar')) { $this->assign('showSidebar', 1); $this->assign('overlayUrls', (array) $params->get('fb_gm_overlay_urls')); $this->assign('overlayLabels', (array) $params->get('fb_gm_overlay_labels')); } else { $this->assign('showSidebar', 0); } $this->_setPath('template', $tmplpath); $this->assign('containerId', $this->get('ContainerId')); $this->assignRef('grouptemplates', $this->get('GroupTemplates')); echo parent::display($template); }
/** * Checks : J template html override css file then fabrik list tmpl template css file. Including them if found * * @since 3.0 loads lists's css files * * @return void */ public function getListCss() { $tmpl = $this->getTmpl(); $jTmplFolder = FabrikWorker::j3() ? 'tmpl' : 'tmpl25'; // Check for a form template file (code moved from view) if ($tmpl != '') { $qs = '?c=' . $this->getRenderContext(); // $$$rob need & for pdf output which is parsed through xml parser otherwise fails $qs .= '&buttoncount=' . $this->rowActionCount; // $$$ hugh - adding format, so custom CSS can do things like adding overrides for PDF $qs .= '&format=' . $this->app->input->get('format', 'html'); $overRide = 'templates/' . $this->app->getTemplate() . '/html/com_fabrik/list/' . $tmpl . '/template_css.php' . $qs; if (!FabrikHelperHTML::stylesheetFromPath($overRide)) { FabrikHelperHTML::stylesheetFromPath('components/com_fabrik/views/list/' . $jTmplFolder . '/' . $tmpl . '/template_css.php' . $qs); } /* $$$ hugh - as per Skype conversation with Rob, decided to re-instate the custom.css convention. So I'm adding two files: * custom.css - for backward compatibility with existing 2.x custom.css * custom_css.php - what we'll recommend people use for custom css moving forward. */ if (!FabrikHelperHTML::stylesheetFromPath('templates/' . $this->app->getTemplate() . '/html/com_fabrik/list/' . $tmpl . '/custom.css' . $qs)) { FabrikHelperHTML::stylesheetFromPath('components/com_fabrik/views/list/' . $jTmplFolder . '/' . $tmpl . '/custom.css'); } if (!FabrikHelperHTML::stylesheetFromPath('templates/' . $this->app->getTemplate() . '/html/com_fabrik/list/' . $tmpl . '/custom_css.php' . $qs)) { $displayData = new stdClass(); $displayData->tmpl = $tmpl; $displayData->qs = $qs; $displayData->jTmplFolder = $jTmplFolder; $displayData->listModel = $this; $layout = $this->getLayout('list.fabrik-custom-css-qs'); $path = $layout->render($displayData); FabrikHelperHTML::stylesheetFromPath($path); } } }
function display($tmpl = 'default') { $document =& JFactory::getDocument(); FabrikHelperHTML::packageJS(); require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php'; $model =& $this->getModel(); $usersConfig =& JComponentHelper::getParams('com_fabrik'); $model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)))); $this->row =& $model->getVisualization(); $model->setTableIds(); if ($this->row->state == 0) { JError::raiseWarning(500, JText::_('ALERTNOTAUTH')); return ''; } $this->assign('js', $this->get('JS')); $viewName = $this->getName(); $pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikModel'); $plugin =& $pluginManager->getPlugIn('slideshow', 'visualization'); $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0); $this->assignRef('filters', $this->get('Filters')); $this->assign('filterFormURL', $this->get('FilterFormURL')); $pluginParams =& $model->getPluginParams(); $this->assignRef('params', $pluginParams); $tmpl = $pluginParams->get('slideshow_viz_layout', $tmpl); JHTML::stylesheet('table.css', 'media/com_fabrik/css/'); $tmplpath = $model->pathBase . 'slideshow' . DS . 'views' . DS . 'slideshow' . DS . 'tmpl' . DS . $tmpl; $this->_setPath('template', $tmplpath); FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true); if ($this->get('RequiredFiltersFound')) { FabrikHelperHTML::script('slideshow.js', 'components/com_fabrik/libs/slideshow2/js/', true); $slideshow_viz_type = $pluginParams->get('slideshow_viz_type', 1); switch ($slideshow_viz_type) { case 1: break; case 2: FabrikHelperHTML::script('slideshow.kenburns.js', 'components/com_fabrik/libs/slideshow2/js/', true); break; case 3: FabrikHelperHTML::script('slideshow.push.js', 'components/com_fabrik/libs/slideshow2/js/', true); break; case 4: FabrikHelperHTML::script('slideshow.fold.js', 'components/com_fabrik/libs/slideshow2/js/', true); break; default: break; } JHTML::stylesheet('slideshow.css', 'components/com_fabrik/libs/slideshow2/css/'); FabrikHelperHTML::script('slideshow.js', 'components/com_fabrik/plugins/visualization/slideshow/', true); } FabrikHelperHTML::addScriptDeclaration($this->js); $ab_css_file = $tmplpath . DS . "template.css"; if (JFile::exists($ab_css_file)) { JHTML::stylesheet('template.css', $this->srcBase . 'slideshow/views/slideshow/tmpl/' . $tmpl . '/', true); } //check and add a general fabrik custom css file overrides template css and generic table css FabrikHelperHTML::stylesheetFromPath("media" . DS . "com_fabrik" . DS . "css" . DS . "custom.css"); //check and add a specific biz template css file overrides template css generic table css and generic custom css FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "plugins" . DS . "visualization" . DS . "slideshow" . DS . "views" . DS . "slideshow" . DS . "tmpl" . DS . $tmpl . DS . "custom.css"); //ensure we don't have an incorrect version of mootools loaded FabrikHelperHTML::cleanMootools(); echo parent::display(); }
/** * loads form's css files * Checks : custom css file, template css file. Including them if found * * @return void */ public function getFormCss() { $input = $this->app->input; $jTmplFolder = FabrikWorker::j3() ? 'tmpl' : 'tmpl25'; $tmpl = $this->getTmpl(); $v = $this->isEditable() ? 'form' : 'details'; // Check for a form template file (code moved from view) if ($tmpl != '') { $qs = '?c=' . $this->getId(); $qs .= '&rowid=' . $this->getRowId(); /* $$$ need & for pdf output which is parsed through xml parser otherwise fails * If FabrikHelperHTML::styleSheetajax loaded then don't do & */ $view = $this->isEditable() ? 'form' : 'details'; if (FabrikHelperHTML::cssAsAsset()) { $qs .= '&view=' . $v; $qs .= '&rowid=' . $this->getRowId(); } else { $qs .= '&view=' . $v; $qs .= '&rowid=' . $this->getRowId(); } $tmplPath = 'templates/' . $this->app->getTemplate() . '/html/com_fabrik/' . $view . '/' . $tmpl . '/template_css.php' . $qs; if (!FabrikHelperHTML::stylesheetFromPath($tmplPath)) { FabrikHelperHTML::stylesheetFromPath('components/com_fabrik/views/' . $view . '/' . $jTmplFolder . '/' . $tmpl . '/template_css.php' . $qs); } /* $$$ hugh - as per Skype convos with Rob, decided to re-instate the custom.css convention. So I'm adding two files: * custom.css - for backward compat with existing 2.x custom.css * custom_css.php - what we'll recommend people use for custom css moving forward. */ if (!FabrikHelperHTML::stylesheetFromPath('templates/' . $this->app->getTemplate() . '/html/com_fabrik/' . $view . '/' . $tmpl . '/custom.css' . $qs)) { FabrikHelperHTML::stylesheetFromPath('components/com_fabrik/views/' . $view . '/' . $jTmplFolder . '/' . $tmpl . '/custom.css' . $qs); } $path = 'templates/' . $this->app->getTemplate() . '/html/com_fabrik/' . $view . '/' . $tmpl . '/custom_css.php' . $qs; if (!FabrikHelperHTML::stylesheetFromPath($path)) { $displayData = new stdClass(); $displayData->view = $view; $displayData->tmpl = $tmpl; $displayData->qs = $qs; $displayData->jTmplFolder = $jTmplFolder; $displayData->formModel = $this; $layout = $this->getLayout('form.fabrik-custom-css-qs'); $path = $layout->render($displayData); FabrikHelperHTML::stylesheetFromPath($path); } } if ($this->app->isAdmin() && $input->get('tmpl') === 'components') { FabrikHelperHTML::stylesheet('administrator/templates/system/css/system.css'); } }
protected function getManagementJS($data = array()) { global $Itemid; // $$$ rob ALWAYS load the calendar (so its avaible in ajax forms) FabrikHelperHTML::loadcalendar(); $app =& JFactory::getApplication(); $model =& $this->getModel(); $table =& $model->getTable(); $formModel =& $model->getForm(); $elementsNotInTable =& $formModel->getElementsNotInTable(); $keys = array('id' => '', 'name' => '', 'label' => ''); foreach ($elementsNotInTable as &$i) { if (is_a($i, 'TableElement')) { $i = array_intersect_key($i->getPublicProperties(), $keys); } } FabrikHelperHTML::packageJS(); $document =& JFactory::getDocument(); if ($model->requiresSlimbox()) { FabrikHelperHTML::slimbox(); } if ($model->requiresMocha()) { FabrikHelperHTML::mocha(); } FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true); $tmpl = $this->getTmpl(); FabrikHelperHTML::stylesheet('table.css', 'media/com_fabrik/css/'); // check for a custom css file and include it if it exists FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "views" . DS . "table" . DS . "tmpl" . DS . $tmpl . DS . "template.css"); //check and add a general fabrik custom css file overrides template css and generic table css FabrikHelperHTML::stylesheetFromPath("media" . DS . "com_fabrik" . DS . "css" . DS . "custom.css"); //check and add a specific table template css file overrides template css generic table css and generic custom css FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "views" . DS . "table" . DS . "tmpl" . DS . $tmpl . DS . "custom.css"); // check for a custom js file and include it if it exists $aJsPath = JPATH_SITE . DS . "components" . DS . "com_fabrik" . DS . "views" . DS . "table" . DS . "tmpl" . DS . $tmpl . DS . "javascript.js"; if (JFile::exists($aJsPath)) { FabrikHelperHTML::script("javascript.js", 'components/com_fabrik/views/table/tmpl/' . $tmpl . '/', true); } $origRows = $this->rows; $this->rows = array(array()); $tmpItemid = !isset($Itemid) ? 0 : $Itemid; $this->_c = 0; $this->_row = new stdClass(); $script = ''; // $$$ rob done in HTMLHelper //$script = "/* <![CDATA[ */ \n"; static $tableini; if (!$tableini) { $tableini = true; $script .= "var oTables = \$H();\n"; } $opts = new stdClass(); $opts->admin = $app->isAdmin(); $opts->postMethod = $model->getPostMethod(); $opts->filterMethod = $this->filter_action; $opts->form = 'tableform_' . $model->_id; $opts->headings = $model->_jsonHeadings(); $labels = $this->headings; foreach ($labels as &$l) { $l = strip_tags($l); } $opts->labels = $labels; $opts->primaryKey = $table->db_primary_key; $opts->Itemid = $tmpItemid; $opts->formid = $model->_oForm->getId(); $opts->canEdit = $model->canEdit() ? "1" : "0"; $opts->canView = $model->canView() ? "1" : "0"; $opts->page = JRoute::_('index.php'); $opts->isGrouped = $this->isGrouped; $opts->mooversion = FabrikWorker::getMooVersion() == 1 ? 1.2 : 1.1; if (FabrikWorker::nativeMootools12()) { $opts->mooversion = 1.24; } $opts->formels = $elementsNotInTable; //if table data starts as empty then we need the html from the row // template otherwise we can't add a row to the table if ($model->_postMethod == 'ajax') { ob_start(); $this->_row = new stdClass(); $this->_row->id = ''; $this->_row->class = 'fabrik_row'; require COM_FABRIK_FRONTEND . DS . 'views' . DS . 'table' . DS . 'tmpl' . DS . 'default' . DS . 'default_row.php'; $opts->rowtemplate = ob_get_contents(); ob_end_clean(); } //$$$rob if you are loading a table in a window from a form db join select record option // then we want to know the id of the window so we can set its showSpinner() method $opts->winid = JRequest::getVar('winid', ''); $opts->ajaxEditViewLink = $model->ajaxEditViewLink() ? 1 : 0; $opts = json_encode($opts); $lang = new stdClass(); $lang->select_rows = JText::_('SELECT SOME ROWS FOR DELETION'); $lang->yes = JText::_('Yes'); $lang->no = JText::_('No'); $lang->select_colums_to_export = JText::_('SELECT_COLUMNS_TO_EXPORT'); $lang->include_filters = JText::_('INCLUDE_FILTERS'); $lang->include_data = JText::_('INCLUDE_DATA'); $lang->inlcude_raw_data = JText::_('INCLUDE_RAW_DATA'); $lang->include_calculations = JText::_('INLCUDE_CALCULATIONS'); $lang->export = JText::_('EXPORT'); $lang->loading = JText::_('loading'); $lang->savingto = JText::_('Saving to'); $lang->confirmDelete = JText::_('CONFIRMDELETE'); $lang->csv_downloading = JText::_('COM_FABRIK_CSV_DOWNLOADING'); $lang->download_here = JText::_('COM_FABRIK_DOWNLOAD_HERE'); $lang->csv_complete = JText::_('COM_FABRIK_CSV_COMPLETE'); $lang = json_encode($lang); $script .= "\n" . "var oTable{$model->_id} = new fabrikTable({$model->_id},"; $script .= $opts . "," . $lang; $script .= "\n" . ");"; $script .= "\n" . "oTable{$model->_id}.addListenTo('form_{$model->_oForm->_id}');"; $script .= "\n" . "oTable{$model->_id}.addListenTo('table_{$model->_id}');"; $script .= "\n" . "oPackage.addBlock('table_{$model->_id}', oTable{$model->_id});"; //add in plugin objects $plugins = $this->get('PluginJsObjects'); $script .= "\noTable{$model->_id}.addPlugins([\n"; $script .= " " . implode(",\n ", $plugins); $script .= "]\n);\n"; $script .= "oTables.set({$model->_id}, oTable{$model->_id});\n"; FabrikHelperHTML::addScriptDeclaration($script); $this->getElementJs(); //reset data back to original settings $this->rows = $origRows; $this->get('CustomJsAction'); }
function display($tmpl = 'default') { global $Itemid; $app =& JFactory::getApplication(); JHTML::_('behavior.calendar'); require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php'; $pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikModel'); $plugin =& $pluginManager->getPlugIn('calendar', 'visualization'); if (FabrikWorker::nativeMootools12()) { FabrikHelperHTML::script('Mootools.Lang.js', 'components/com_fabrik/libs/mootools1.2/', true); FabrikHelperHTML::script('date.js', 'components/com_fabrik/plugins/element/fabrikdate/', false); FabrikHelperHTML::addScriptDeclaration("Date.defineParsers('%d([-./]%m([-./]%Y((T| )%X)?)?)?');"); } FabrikHelperHTML::mocha(); FabrikHelperHTML::loadCalendar(); $model =& $this->getModel(); $usersConfig =& JComponentHelper::getParams('com_fabrik'); $id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))); $model->setId($id); $this->row =& $model->getVisualization(); $model->setTableIds(); $this->assign('containerId', $this->get('ContainerId')); $this->assignRef('filters', $this->get('Filters')); $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0); $this->assign('filterFormURL', $this->get('FilterFormURL')); $calendar =& $model->_row; $this->calName = $model->getCalName(); $config =& JFactory::getConfig(); $document =& JFactory::getDocument(); $canAdd = $this->get('CanAdd'); $this->assign('requiredFiltersFound', $this->get('RequiredFiltersFound')); if ($canAdd && $this->requiredFiltersFound) { $app->enqueueMessage(JText::_('COM_FABRIK_DOUBLE_CLICK_TO_ADD_EVENT')); } $this->assign('canAdd', $canAdd); //FabrikHelperHTML::mocha(); FabrikHelperHTML::packageJS(); $fbConfig =& JComponentHelper::getParams('com_fabrik'); JHTML::stylesheet('table.css', 'media/com_fabrik/css/'); FabrikHelperHTML::script('element.js', 'media/com_fabrik/js/', true); FabrikHelperHTML::script('form.js', 'media/com_fabrik/js/', true); FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true); FabrikHelperHTML::script('calendar.js', 'components/com_fabrik/plugins/visualization/calendar/', true); $params =& $model->getParams(); //Get the active menu item $usersConfig =& JComponentHelper::getParams('com_fabrik'); $urlfilters = JRequest::get('get'); unset($urlfilters['option']); unset($urlfilters['view']); unset($urlfilters['controller']); unset($urlfilters['Itemid']); unset($urlfilters['visualizationid']); unset($urlfilters['format']); if (empty($urlfilters)) { $urlfilters = new stdClass(); } $urls = new stdClass(); //dont JRoute as its wont load with sef? $urls->del = 'index.php?option=com_fabrik&controller=visualization.calendar&view=visualization&task=deleteEvent&format=raw&Itemid=' . $Itemid . '&id=' . $id; $urls->add = 'index.php?option=com_fabrik&view=visualization&controller=visualization.calendar&format=raw&Itemid=' . $Itemid . '&id=' . $id; $user =& JFactory::getUser(); $legend = $params->get('show_calendar_legend', 0) ? $model->getLegend() : ''; $tmpl = $params->get('calendar_layout', 'default'); $pluginManager->loadJS(); $options = new stdClass(); $options->url = $urls; $options->eventTables =& $model->getEventTables(); $options->calendarId = $calendar->id; $options->popwiny = $params->get('yoffset', 0); $options->urlfilters = $urlfilters; $options->canAdd = $canAdd; $options->tmpl = $tmpl; $formView =& $this->_formView; $formView->_isMambot = true; $o = $model->getAddStandardEventFormInfo(); if ($o != null) { $options->tableid = $o->id; $formView->setId($o->form_id); $options->formid = $o->form_id; } $formModel =& $formView->getModel(); $form =& $formModel->getForm(); $options->mooversion = FabrikWorker::getMooVersion() == 1 ? 1.2 : 1.1; $model->setRequestFilters(); $options->filters =& $model->filters; // end not sure $options->Itemid = $Itemid; $options->standard_event_form = $params->get('use_standard_event_table', 0) == 1 ? true : false; $options->show_day = $params->get('show_day', true); $options->show_week = $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::_('Jan'), JText::_('Feb'), JText::_('Mar'), JText::_('Apr'), JText::_('May'), JText::_('Jun'), JText::_('Jul'), JText::_('Aug'), JText::_('Sept'), JText::_('Oct'), JText::_('Nov'), JText::_('Dec')); $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', 90); $options->greyscaledweekend = $params->get('greyscaled-week-end', 0); $options->viewType = $params->get('calendar_default_view', 'month'); $json = json_encode($options); $lang = new stdClass(); $lang->next = htmlspecialchars(JText::_('Next')); $lang->previous = JText::_('Previous'); $lang->day = JText::_('Day'); $lang->week = JText::_('Week'); $lang->month = JText::_('Month'); $lang->key = htmlspecialchars(JText::_('Key')); $lang->today = JText::_('Today'); $lang->start = JText::_('Start'); $lang->end = JText::_('End'); $lang->deleteConf = JText::_('Are you sure you want to delete this?'); $lang->del = JText::_('delete'); $lang->view = JText::_('view'); $lang->edit = JText::_('edit'); $lang->windowtitle = JText::_('add/edit event'); $lang = json_encode($lang); //$$$ rob - was assigning 'calendar_x' to oPackage.blocks, // but now assigning as 'visualization_x' to enable filter clear link $str = "window.addEvent('domready', function(e) {\n" . " //var m = new MochaUI.Modal();\n" . " {$this->calName} = new fabrikCalendar('calendar_{$calendar->id}');\n" . " {$this->calName}.render({}, {$json}, {$lang});\n" . " oPackage.addBlock('vizualization_" . $calendar->id . "', {$this->calName});\n"; if ($o != null) { $str .= " {$this->calName}.addListenTo('form_{$o->form_id}');\n"; } $fids =& $model->getLinkedFormIds(); foreach ($fids as $fid) { $str .= " {$this->calName}.addListenTo('form_{$fid}');\n"; } $str .= $legend . "\n});\n"; FabrikHelperHTML::addScriptDeclaration($str); $viewName = $this->getName(); $pluginParams =& $model->getPluginParams(); $this->assignRef('params', $pluginParams); $tmpl = $pluginParams->get('calendar_layout', $tmpl); $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'calendar' . DS . 'views' . DS . 'calendar' . DS . 'tmpl' . DS . $tmpl; $this->_setPath('template', $tmplpath); $ab_css_file = $tmplpath . DS . "template.css"; if (JFile::exists($ab_css_file)) { JHTML::stylesheet('template.css', 'components/com_fabrik/plugins/visualization/calendar/views/calendar/tmpl/' . $tmpl . '/', true); } //check and add a general fabrik custom css file overrides template css and generic table css FabrikHelperHTML::stylesheetFromPath("media" . DS . "com_fabrik" . DS . "css" . DS . "custom.css"); //check and add a specific biz template css file overrides template css generic table css and generic custom css FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "plugins" . DS . "visualization" . DS . "calendar" . DS . "views" . DS . "calendar" . DS . "tmpl" . DS . $tmpl . DS . "custom.css"); //ensure we don't have an incorrect version of mootools loaded FabrikHelperHTML::cleanMootools(); echo parent::display(); }
/** * Checks : J template html override css file then fabrik list tmpl template css file. Including them if found * * @since 3.0 loads lists's css files * * @return void */ public function getListCss() { $tmpl = $this->getTmpl(); $app = JFactory::getApplication(); $jTmplFolder = FabrikWorker::j3() ? 'tmpl' : 'tmpl25'; // Check for a form template file (code moved from view) if ($tmpl != '') { $qs = '?c=' . $this->getRenderContext(); // $$$rob need & for pdf output which is parsed through xml parser otherwise fails $qs .= '&buttoncount=' . $this->rowActionCount; $overRide = 'templates/' . $app->getTemplate() . '/html/com_fabrik/list/' . $tmpl . '/template_css.php' . $qs; if (!FabrikHelperHTML::stylesheetFromPath($overRide)) { FabrikHelperHTML::stylesheetFromPath('components/com_fabrik/views/list/' . $jTmplFolder . '/' . $tmpl . '/template_css.php' . $qs); } /* $$$ hugh - as per Skype convos with Rob, decided to re-instate the custom.css convention. So I'm adding two files: * custom.css - for backward compat with existing 2.x custom.css * custom_css.php - what we'll recommend people use for custom css moving foward. */ if (!FabrikHelperHTML::stylesheetFromPath('templates/' . $app->getTemplate() . '/html/com_fabrik/list/' . $tmpl . '/custom.css' . $qs)) { FabrikHelperHTML::stylesheetFromPath('components/com_fabrik/views/list/' . $jTmplFolder . '/' . $tmpl . '/custom.css'); } if (!FabrikHelperHTML::stylesheetFromPath('templates/' . $app->getTemplate() . '/html/com_fabrik/list/' . $tmpl . '/custom_css.php' . $qs)) { FabrikHelperHTML::stylesheetFromPath('components/com_fabrik/views/list/' . $jTmplFolder . '/' . $tmpl . '/custom_css.php' . $qs); } } }
/** * 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); }
/** * loads form's css files * Checks : custom css file, template css file. Including them if found * * @return void */ public function getFormCss() { $app = JFactory::getApplication(); $tmpl = $this->getTmpl(); $v = $this->isEditable() ? 'form' : 'details'; // Check for a form template file (code moved from view) if ($tmpl != '') { $qs = '?c=' . $this->getId(); /* $$$ need & for pdf output which is parsed through xml parser otherwise fails * If FabrikHelperHTML::styleSheetajax loaded then dont do & */ $qs .= FabrikHelperHTML::cssAsAsset() ? '&view=' . $v : '&view=' . $v; $tmplPath = 'templates/' . $app->getTemplate() . '/html/com_fabrik/form/' . $tmpl . '/template_css.php' . $qs; if (!FabrikHelperHTML::stylesheetFromPath($tmplPath)) { FabrikHelperHTML::stylesheetFromPath('components/com_fabrik/views/form/tmpl/' . $tmpl . '/template_css.php' . $qs); } /* $$$ hugh - as per Skype convos with Rob, decided to re-instate the custom.css convention. So I'm adding two files: * custom.css - for backward compat with existing 2.x custom.css * custom_css.php - what we'll recommend people use for custom css moving foward. */ if (!FabrikHelperHTML::stylesheetFromPath('templates/' . $app->getTemplate() . '/html/com_fabrik/form/' . $tmpl . '/custom.css' . $qs)) { FabrikHelperHTML::stylesheetFromPath('components/com_fabrik/views/form/tmpl/' . $tmpl . '/custom.css' . $qs); } if (!FabrikHelperHTML::stylesheetFromPath('templates/' . $app->getTemplate() . '/html/com_fabrik/form/' . $tmpl . '/custom_css.php' . $qs)) { FabrikHelperHTML::stylesheetFromPath('components/com_fabrik/views/form/tmpl/' . $tmpl . '/custom_css.php' . $qs); } } if ($app->isAdmin() && JRequest::getVar('tmpl') === 'components') { FabrikHelperHTML::stylesheet('administrator/templates/system/css/system.css'); } }