require_once COM_FABRIK_FRONTEND . DS . 'views' . DS . 'package' . DS . 'view.html.php'; require_once COM_FABRIK_FRONTEND . DS . 'views' . DS . 'list' . DS . 'view.html.php'; JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_fabrik' . DS . 'tables'); JModel::addIncludePath(COM_FABRIK_FRONTEND . DS . 'models', 'FabrikFEModel'); $formId = (int) $params->get('form_id', 1); $rowid = (int) $params->get('row_id', 0); $layout = $params->get('template', 'default'); $usersConfig = JComponentHelper::getParams('com_fabrik'); $usersConfig->set('rowid', $rowid); $moduleclass_sfx = $params->get('moduleclass_sfx', ''); $model->isMambot = true; $moduleAjax = $params->get('formmodule_useajax', true); $origView = JRequest::getVar('view'); JRequest::setVar('formid', $formId); JRequest::setVar('view', 'form'); $controller = new FabrikControllerForm(); //$$$rob for table views in category blog layouts when no layout specified in {} the blog layout // was being used to render the table - which was not found which gave a 500 error JRequest::setVar('layout', $layout); // Display the view $controller->isMambot = true; $origFormid = JRequest::getInt('formid'); $ajax = JRequest::getVar('ajax'); JRequest::setVar('formid', $params->get('formid')); JRequest::setVar('ajax', $moduleAjax); echo $controller->display(); //reset the layout and view etc for when the component needs them JRequest::setVar('formid', $origFormid); JRequest::setVar('ajax', $ajax); JRequest::setVar('layout', $origLayout); JRequest::setVar('view', $origView);
$origLayout = $input->get('layout'); require_once COM_FABRIK_FRONTEND . '/views/form/view.html.php'; $input->set('layout', $origLayout); JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_fabrik/tables'); JModelLegacy::addIncludePath(COM_FABRIK_FRONTEND . '/models', 'FabrikFEModel'); $formId = (int) $params->get('formid', 1); $rowid = (int) $params->get('row_id', 0); $layout = $params->get('template', ''); $usersConfig = JComponentHelper::getParams('com_fabrik'); $usersConfig->set('rowid', $rowid); $moduleclass_sfx = $params->get('moduleclass_sfx', ''); $moduleAjax = $params->get('formmodule_useajax', true); $origView = $input->get('view'); $input->set('formid', $formId); $input->set('view', 'form'); $controller = new FabrikControllerForm(); /* * For table views in category blog layouts when no layout specified in {} the blog layout * was being used to render the table - which was not found which gave a 500 error */ if ($layout !== '') { $input->set('layout', $layout); } // Display the view $controller->isMambot = true; $controller->set('cacheId', 'admin_module'); $origFormid = $input->getInt('formid'); $ajax = $input->get('ajax'); $input->set('formid', $params->get('formid')); $input->set('ajax', $moduleAjax); echo $controller->view();
$layout = $params->get('template', 'default'); $usersConfig =& JComponentHelper::getParams('com_fabrik'); $usersConfig->set('rowid', $rowid); $usekey = $params->get('usekey', ''); if (!empty($usekey)) { JRequest::setVar('usekey', $usekey); } $moduleclass_sfx = $params->get('moduleclass_sfx', ''); $document =& JFactory::getDocument(); $model->_isMambot = true; $model->_postMethod = $params->get('formmodule_useajax', true) ? 'ajax' : 'post'; $origView = JRequest::getVar('view'); if ($model->_postMethod == 'post') { JRequest::setVar('fabrik', $formId); JRequest::setVar('view', 'form'); $controller = new FabrikControllerForm(); // $$$ hugh - fix for issue with multiple form modules, so the view code doesn't re-use // the first _id and render the same form over. $view = $controller->getView('form', $document->getType()); unset($view->_id); //$$$rob for table views in category blog layouts when no layout specified in {} the blog layout // was being used to render the table - which was not found which gave a 500 error JRequest::setVar('layout', $layout); // Display the view $controller->_isMambot = true; echo $controller->display(); } else { require_once 'components' . DS . 'com_fabrik' . DS . 'controllers' . DS . 'package.php'; JRequest::setVar('flayout', $layout); $document =& JFactory::getDocument(); $viewName = 'Package';