/** * Responsible to render the views / layouts from the front end. * This is a single point of entry function. * * @since 1.0 * @access public */ public function display($tpl = null) { $doc = JFactory::getDocument(); $type = $doc->getType(); $show = JRequest::getString('show'); if ($type != 'html') { return parent::display($tpl); } // Include main structure here. $theme = FD::themes(); // Capture output. ob_start(); parent::display($tpl); $contents = ob_get_contents(); ob_end_clean(); // Get the menu's suffix $suffix = $this->getMenuSuffix(); // Get the current view. $view = $this->input->get('view', '', 'cmd'); $view = !empty($view) ? ' view-' . $view : ''; // Get the current task $task = $this->input->get('task', '', 'cmd'); $task = !empty($task) ? ' task-' . $task : ''; // Get any "id" or "cid" from the request. $object = $this->input->get('id', $this->input->get('cid', 0, 'int'), 'int'); $object = !empty($object) ? ' object-' . $object : ''; // Get any layout $layout = $this->input->get('layout', '', 'cmd'); $layout = !empty($layout) ? ' layout-' . $layout : ''; $theme->set('suffix', $suffix); $theme->set('layout', $layout); $theme->set('object', $object); $theme->set('task', $task); $theme->set('view', $view); $theme->set('show', $show); $theme->set('contents', $contents); $theme->set('toolbar', $this->getToolbar()); // Component template scripts $page = FD::page(); $scripts = '<script>' . implode('</script><script>', $page->inlineScripts) . '</script>'; $theme->set('scripts', $scripts); // Ensure component template scripts don't get added to the head. $page->inlineScripts = array(); echo $theme->output('site/structure/default'); }
/** * Central method that is called by child items to display the output. * All views that inherit from this class should use display to output the html codes. * * @since 1.0 * @access public * @param string The POSIX path for the theme file. * @return null * * @author Mark Lee <*****@*****.**> */ public function display($tpl = null) { $doc = JFactory::getDocument(); $format = $doc->getType(); $tmpl = JRequest::getString('tmpl'); // Joomla page title should always display EasySocial JToolbarHelper::title(JText::_('COM_EASYSOCIAL_TITLE_EASYSOCIAL'), 'easysocial'); if ($format == 'html') { // Load Joomla's framework. JHTML::_('behavior.framework'); $class = ''; if ($tmpl == 'component') { $class = 'es-window'; } // Main wrapper $class = isset($class) ? $class : ''; // Add the sidebar to the page obj. $sidebar = $this->getSideBar(); // Capture contents. ob_start(); parent::display($tpl); $html = ob_get_contents(); ob_end_clean(); $version = FD::getLocalVersion(); $theme = FD::get('Themes'); $theme->set('version', $version); $theme->set('class', $class); $theme->set('tmpl', $tmpl); $theme->set('html', $html); $theme->set('sidebar', $sidebar); $theme->set('page', $this->page); $contents = $theme->output('admin/structure/default'); echo $contents; return; } return parent::display($tpl); }