function viewDefault() { // set the toolbar buttons $this->setToolbar(); // call the css file $this->callCssFile(); // display the view template parent::display(); }
function viewDefault($returnAjaxForm = false) { // initialize $returnAjaxForm $this->returnAjaxForm = $returnAjaxForm; $use_ajax = JFactory::getApplication()->input->get('use_ajax', 0, 'INT'); if ($use_ajax) { $this->returnAjaxForm = true; } // add javascript $document = JFactory::getDocument(); if (version_compare(JVERSION, '1.6.0', 'ge')) { $document->addScript(JUri::root(true) . '/media/system/js/core.js'); } else { $document->addScript(JUri::root(true) . '/includes/js/joomla.javascript.js'); } // initialize the template variables $this->setVariables(); // generate the css file name based on the profile $css_file = 'profile_css_' . $this->profile->id . '.css'; // call the css file $this->callCssFile($css_file); // determine to what section to return to $this->setTaskReturn(); if ($returnAjaxForm) { parent::display(); } else { echo '<div class="aiContactSafe" id="aiContactSafe_mainbody_' . $this->profile->id . '">'; parent::display(); echo '</div>'; } // reset the form fields after the form was displayed $model = $this->getModel($this->_sTask, '', $this->_parameters); $model->resetFormFields(); if ($use_ajax) { jexit(); } }