/** * 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'); } }
/** * 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'); } }