/** * Public constructor * * @param array $config The component's configuration array */ public function __construct($config = array()) { parent::__construct($config); if (isset($config['use_hypermedia'])) { $this->useHypermedia = (bool) $config['use_hypermedia']; } }
/** * Public constructor. Instantiates a FOFViewCsv object. * * @param array $config The configuration data array */ public function __construct($config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } parent::__construct($config); if (array_key_exists('csv_header', $config)) { $this->csvHeader = $config['csv_header']; } else { $this->csvHeader = $this->input->getBool('csv_header', true); } if (array_key_exists('csv_filename', $config)) { $this->csvFilename = $config['csv_filename']; } else { $this->csvFilename = $this->input->getString('csv_filename', ''); } if (empty($this->csvFilename)) { $view = $this->input->getCmd('view', 'cpanel'); $view = FOFInflector::pluralize($view); $this->csvFilename = strtolower($view); } if (array_key_exists('csv_fields', $config)) { $this->csvFields = $config['csv_fields']; } }
function __construct($config = array()) { parent::__construct($config); $this->lists = new JObject(); $tmpl_path = JPATH_COMPONENT_ADMINISTRATOR . '/plugins/views/buadmin/tmpl'; $this->addTemplatePath($tmpl_path); }
/** * default class construtor * * @param array $config Configuration array */ public function __construct($config = array()) { parent::__construct($config); if (BabioonEventHelper::isVersion3()) { // Joomla! 3.x $renderer = new FOFRenderJoomla3(); } else { // Joomla! 2.5 $renderer = new FOFRenderJoomla(); } $this->setRenderer($renderer); }
/** * The default layout, shows a list of profiles * */ function onBrowse($tpl = null) { // Get reference to profiles model $model = $this->getModel(); // Get profile ID $profileid = AEPlatform::getInstance()->get_active_profile(); $this->profileid = $profileid; // Get profile name $model->setId($profileid); $profile_data = $model->getProfile(); $this->profilename = $profile_data->description; return parent::onBrowse($tpl); }
/** * Executes before rendering the page for the Browse task. * * @param string $tpl Subtemplate to use * * @return boolean Return true to allow rendering of the page * * @since 3.2 */ protected function onBrowse($tpl = null) { /** @var PostinstallModelMessages $model */ $model = $this->getModel(); $this->eid = (int) $model->getState('eid', '700', 'int'); if (empty($this->eid)) { $this->eid = 700; } $this->token = JFactory::getSession()->getFormToken(); $this->extension_options = $model->getComponentOptions(); JToolBarHelper::title(JText::sprintf('COM_POSTINSTALL_MESSAGES_TITLE', $model->getExtensionName($this->eid))); return parent::onBrowse($tpl); }
/** * Modified constructor to enable loading layouts from the plug-ins folder * @param $config */ public function __construct($config = array()) { parent::__construct($config); $tmpl_path = dirname(__FILE__) . '/tmpl'; $this->addTemplatePath($tmpl_path); }
/** * Executes before rendering the page for the Browse task. * * @param string $tpl Subtemplate to use * * @return boolean Return true to allow rendering of the page * * @since 3.2 */ protected function onBrowse($tpl = null) { $this->eid = $this->input->getInt('eid', '700'); $this->token = JFactory::getSession()->getFormToken(); return parent::onBrowse($tpl); }
public function display($tpl = null) { JToolBarHelper::title(JText::_('COM_OVERLOAD_TITLE')); JHtml::_('behavior.framework'); $script = <<<ENDSCRIPT window.addEvent('domready', function() { $('overload-cats').addEvent('change',recalc); $('overload-depth').addEvent('change',recalc); $('overload-articles').addEvent('change',recalc); $('overload-start').addEvent('click', overload_start); }); function recalc() { var cats = $('overload-cats').value; var depth = $('overload-depth').value; var articles = $('overload-articles').value; var totalcats = 0; var totalarticles = 0; for(i=depth; i>0; i--) { totalcats += Math.pow(cats,i); } totalarticles = totalcats * articles; $('overload-projected-articles').set('html', '<b>' + totalarticles + '</b>'); } /** @var The AJAX proxy URL */ var ajax_url = ""; function doAjax(data, successCallback) { var structure = { onSuccess: function(msg, responseXML) { try { var data = JSON.parse(msg); } catch(err) { alert(msg); return; } // Call the callback function successCallback(data); }, onFailure: function(req) { var message = 'AJAX Loading Error: '+req.statusText; alert(message); } }; var ajax_object = null; if(typeof(XHR) == 'undefined') { structure.url = ajax_url; ajax_object = new Request(structure); ajax_object.send(data); } else { ajax_object = new XHR(structure); ajax_object.send(ajax_url, data); } } function overload_start() { var cats = $('overload-cats').value; var depth = $('overload-depth').value; var articles = $('overload-articles').value; var articlesstate = $('overload-articles-state').value; var data = 'categories='+cats+'&depth='+depth+'&articles='+articles+'&articlesstate='+articlesstate+'&task=start'; $('overload-wrapper').setStyle('display','none'); $('overload-results-wrapper').setStyle('display','block'); doAjax(data, overload_process); return false; } function overload_process(msg) { $('overload-results-donecats').set('html',msg.donecats); $('overload-results-totalcats').set('html',msg.totalcats); $('overload-results-article').set('html',msg.article); $('overload-results-articles').set('html',msg.articles); if(msg.done) { alert('All done!'); return; } else { doAjax('task=resume', overload_process); } } ENDSCRIPT; JFactory::getDocument()->addScriptDeclaration($script); parent::display($tpl); }
public function __construct($config = array()) { parent::__construct(); $this->setFrontendPageTitle = true; }