function getView($name = '', $type = 'html', $prefix = '', $config = array()) { if ($name) { $config['template_path'] = $this->basepath . DS . "views" . DS . strtolower($name) . DS . "tmpl"; } else { $config['template_path'] = $this->basepath . DS . "views" . DS . strtolower($this->modulename) . DS . "tmpl"; } return parent::getView($name, $type, 'JTheFactoryView' . ucfirst($this->modulename), $config); }
function &getView($name = '', $type = '', $prefix = 'hotelguideView', $config = array()) { if (empty($type)) { $document =& JFactory::getDocument(); $type = $document->getType(); } if (empty($prefix)) { $prefix = 'hotelguideView'; } $view =& parent::getView($name, $type, $prefix, $config); return $view; }
/** * The default task, * Add the required models and display the view */ function Display() { $userModel = JController::getModel("Users"); //Checks for new user switch ($userModel->checkUser()) { case 0: $viewName = "newuser"; break; case 1: $viewName = "newuser"; break; case 2: //Get the viewname $viewName = JRequest::getVar('view', 'home'); break; default: $viewName = "newuser"; break; } //Get the view $view = JController::getView($viewName, 'html'); //Get the models that all views need $stocksModel = JController::getModel("Stocks"); $portfolioModel = JController::getModel("Portfolio"); $userModel = JController::getModel("Users"); //Add the models every view needs $view->setModel($stocksModel); $view->setModel($portfolioModel); $view->setModel($userModel); //Some additional models if ($viewName == "history") { $view->setModel(JController::getModel("History")); } if ($viewName == 'dealcards') { $view->setModel(JController::getModel("Cards")); } if ($viewName == 'home') { $view->setModel(JController::getModel("Cards")); $view->setModel(JController::getModel("Log")); } //Display the view $view->display(); }
function &getView($name = '', $type = '', $prefix = '', $config = array()) { $config['base_path'] = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'table' . DS . 'emailtableplus'; return parent::getView($name, $type, $prefix, $config); }
/** * Create the View. * This is an overloaded function of JController::getView * and includes addition of the JDocument Object with required scripts and styles * @return object */ public function getView($name = '', $type = '', $prefix = '', $config = array()) { $language = JFactory::getLanguage(); $language->load('com_jce', JPATH_ADMINISTRATOR); $document = JFactory::getDocument(); if (!$name) { $name = JRequest::getWord('view', 'cpanel'); } if (!$type) { $type = $document->getType(); } if (empty($config)) { $config = array('base_path' => dirname(__FILE__)); } $view = parent::getView($name, $type, $prefix, $config); $document = JFactory::getDocument(); $document->setTitle(WFText::_('WF_ADMINISTRATION') . ' :: ' . WFText::_('WF_' . strtoupper($name))); $model = $this->getModel($name); // jquery versions $document->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/jquery/jquery-' . WF_JQUERY . '.min.js?version=' . $model->getVersion()); $document->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/jquery/jquery-ui-' . WF_JQUERYUI . '.custom.min.js?version=' . $model->getVersion()); // jQuery noConflict $document->addScriptDeclaration('jQuery.noConflict();'); $scripts = array(); switch ($name) { case 'help': $scripts[] = 'help.js'; break; default: // load Joomla! core javascript if (method_exists('JHtml', 'core')) { JHtml::core(); } require_once JPATH_ADMINISTRATOR . DS . 'includes' . DS . 'toolbar.php'; JToolBarHelper::title(WFText::_('WF_ADMINISTRATION') . ' ›› ' . WFText::_('WF_' . strtoupper($name)), 'logo.png'); $params = WFParameterHelper::getComponentParams(); $theme = $params->get('preferences.theme', 'jce'); $scripts = array_merge(array('tips.js', 'html5.js')); // Load admin scripts $document->addScript(JURI::root(true) . '/administrator/components/com_jce/media/js/jce.js?version=' . $model->getVersion()); $options = array('labels' => array('ok' => WFText::_('WF_LABEL_OK'), 'cancel' => WFText::_('WF_LABEL_CANCEL'), 'select' => WFText::_('WF_LABEL_SELECT'), 'save' => WFText::_('WF_LABEL_SAVE'), 'saveclose' => WFText::_('WF_LABEL_SAVECLOSE'), 'alert' => WFText::_('WF_LABEL_ALERT'), 'required' => WFText::_('WF_MESSAGE_REQUIRED'))); $document->addScriptDeclaration('jQuery(document).ready(function($){$.jce.init(' . json_encode($options) . ');});'); $view->addHelperPath(dirname(__FILE__) . DS . 'helpers'); $this->addModelPath(dirname(__FILE__) . DS . 'models'); $view->loadHelper('toolbar'); $view->loadHelper('tools'); $view->loadHelper('xml'); $view->loadHelper($name); $this->loadMenu(); break; } if ($model = $this->getModel($name)) { $view->setModel($model, true); } // Load site scripts foreach ($scripts as $script) { $document->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/' . $script . '?version=' . $model->getVersion()); } require_once dirname(__FILE__) . DS . 'helpers' . DS . 'system.php'; $app = JFactory::getApplication(); $app->registerEvent('onAfterRender', 'WFSystemHelper'); $view->assignRef('document', $document); return $view; }
/** * Override of j!'s getView * * Method to get a reference to the current view and load it if necessary. * * @param string $name The view name. Optional, defaults to the controller name. * @param string $type The view type. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for view. Optional. * */ public function getView($name = '', $type = '', $prefix = '', $config = array()) { $viewName = str_replace('FabrikControllerVisualization', '', get_class($this)); $viewName = $viewName == '' ? $this->getViewName() : $name; return parent::getView($viewName, $type, $prefix, $config); }
function getView($name = '') { return parent::getView($name, 'html'); }