/** * 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 F0FViewCsv 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 = F0FInflector::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); }
/** * onEdit. * * @param string $tpl Param * * @return void */ public function onAdd($tpl = null) { Extly::loadAwesome(); $file = EHtml::getRelativeFile('js', 'com_autotweet/rule.min.js'); if ($file) { Extly::initApp(CAUTOTWEETNG_VERSION, $file); } return parent::onAdd($tpl); }
public function display($tpl = null) { $app = JFactory::getApplication(); $task = $app->input->getString('task'); $id = $app->input->getInt('id'); $model = $this->getModel('Promotions'); $this->item = $model->getItem($id); parent::display($tpl); }
protected function onBrowse($tpl = null) { $result = parent::onBrowse($tpl); if ($result || is_null($result)) { /** @var AkeebasubsModelCpanels $model */ $model = $this->getModel(); $this->hasGeoIPPlugin = $model->hasGeoIPPlugin(); $this->geoIPPluginNeedsUpdate = $model->GeoIPDBNeedsUpdate(); } return $result; }
protected function onBrowse($tpl = null) { // Add toolbar buttons JToolBarHelper::back('JTOOLBAR_BACK', 'index.php?option=com_admintools'); $model = $this->getModel(); $urlredirection = $model->getRedirectionState(); $this->urlredirection = $urlredirection; $this->loadHelper('select'); // Run the parent method parent::onDisplay(); }
protected function onBrowse($tpl = null) { if (interface_exists('JModel')) { $model = JModelLegacy::getInstance('Masterpw', 'AdmintoolsModel'); } else { $model = JModel::getInstance('Masterpw', 'AdmintoolsModel'); } $masterpw = $model->getMasterPassword(); $this->masterpw = $masterpw; return parent::onBrowse($tpl); }
/** * 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); }
/** * The default layout, shows a list of profiles * */ function onBrowse($tpl = null) { // Get reference to profiles model $model = $this->getModel(); // Get profile ID $profileid = Platform::getInstance()->get_active_profile(); $this->profileid = $profileid; // Get profile name $model->setId($profileid); $profile_data = $model->getProfile(); $this->profilename = $this->escape($profile_data->description); // Get Sort By fields $this->sortFields = array('id' => JText::_('JGRID_HEADING_ID'), 'description' => JText::_('PROFILE_COLLABEL_DESCRIPTION')); return parent::onBrowse($tpl); }
protected function onDisplay($tpl = null) { $subIDs = array(); $user = JFactory::getUser(); if ($user->id) { $mysubs = F0FModel::getTmpInstance('Subscriptions', 'AkeebasubsModel')->user_id($user->id)->paystate('C')->getItemList(); if (!empty($mysubs)) { foreach ($mysubs as $sub) { $subIDs[] = $sub->akeebasubs_level_id; } } $subIDs = array_unique($subIDs); } $this->subIDs = $subIDs; parent::onDisplay($tpl); }
public function display($tpl = null) { $app = JFactory::getApplication(); $this->email = $app->input->getString('email_id'); $this->item = F0FModel::getTmpInstance('Customers', 'J2StoreModel')->getAddressesByemail($this->email); $task = $app->input->getString('task'); $this->currency = J2Store::currency(); if ($task == 'viewOrder' && $this->email) { $this->addresses = F0FModel::getTmpInstance('Addresses', 'J2StoreModel')->email($this->email)->getList(); $this->orders = F0FModel::getTmpInstance('Orders', 'J2StoreModel')->user_email($this->email)->getList(); } JToolbarHelper::title(JTEXT::_('J2STORE_CUSTOMER_VIEW')); JToolbarHelper::cancel(); return parent::display($tpl); //return true; }
/** * Executes before rendering the page for the Add task. * * @param string $tpl Subtemplate to use * * @return boolean Return true to allow rendering of the page */ protected function onAdd($tpl = null) { $id = $this->input->getInt('id'); $this->order = F0FTable::getAnInstance('Order', 'J2StoreTable'); $this->order->load($id); $this->item = $this->order; $this->fieldClass = J2Store::getSelectableBase(); $this->params = J2Store::config(); $this->currency = J2Store::currency(); $this->taxes = $this->order->getOrderTaxrates(); $this->shipping = $this->order->getOrderShippingRate(); $this->coupons = $this->order->getOrderCoupons(); $this->vouchers = $this->order->getOrderVouchers(); $this->orderinfo = $this->order->getOrderInformation(); $this->orderhistory = $this->order->getOrderHistory(); parent::onAdd(); }
/** * onAdd. * * @param string $tpl Param * * @return void */ public function onAdd($tpl = null) { $result = parent::onAdd($tpl); Extly::loadAwesome(); JHtml::stylesheet('lib_extly/ng-table.min.css', false, true); $file = EHtml::getRelativeFile('js', 'com_autotweet/composer/app.min.js'); if ($file) { $this->assign('extensionmainjs', $file); $dependencies = array(); $paths = array(); // Libraries $paths['angular'] = 'media/lib_extly/js/angular/angular.min'; $paths['angular-resource'] = 'media/lib_extly/js/angular/angular-resource.min'; $dependencies['angular-resource'] = array('angular'); $paths['ng-table'] = 'media/lib_extly/js/angular/ng-table-noamd.min'; $dependencies['ng-table'] = array('angular'); // App $paths['requests-service'] = 'media/com_autotweet/js/composer/requests-service.min'; $dependencies['requests-service'] = array('angular-resource', 'extlycore'); $paths['agendas-service'] = 'media/com_autotweet/js/composer/agendas-service.min'; $dependencies['agendas-service'] = array('angular'); $paths['directives'] = 'media/com_autotweet/js/composer/directives.min'; $dependencies['directives'] = array('angular'); $paths['editor-controller'] = 'media/com_autotweet/js/composer/editor-controller.min'; $dependencies['editor-controller'] = array('angular'); $paths['requests-controller'] = 'media/com_autotweet/js/composer/requests-controller.min'; $dependencies['requests-controller'] = array('ng-table', 'requests-service'); $paths['agendas-controller'] = 'media/com_autotweet/js/composer/agendas-controller.min'; $dependencies['agendas-controller'] = array('agendas-service'); $scriptManager = Extly::getScriptManager(); $scriptManager->setFramework(DependencyManager::JS_ANGULAR); $scriptManager->initApp(CAUTOTWEETNG_VERSION, $file, $dependencies, $paths); $list_limit = JFactory::getConfig()->get('list_limit'); $scriptManager->addPostRequireScript("angular.bootstrap(document, ['composerApp']);\n\t\t\t\t\twindow.xtListLimit = {$list_limit};\n\t\t\t\t\tjQuery('.post-attrs-group a').click(function(e) {\n\t\t\t\t\t\tvar btn = jQuery(e.target), v;\n\n\t\t\t\t\t\tif (btn.hasClass('xticon')) {\n\t\t\t\t\t\t \tbtn = btn.parent('a');\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t v = btn.attr('data-value');\n\n\t\t\t\t\t\tjQuery('.xt-subform').hide();\n\t\t\t\t\t\tjQuery('.xt-subform-' + v).show();\n\t\t\t\t\t});"); } $document = JFactory::getDocument(); $document->addScript('//cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js'); $platform = F0FPlatform::getInstance(); $this->assign('editown', $platform->authorise('core.edit.own', $this->input->getCmd('option', 'com_foobar'))); $this->assign('editstate', $platform->authorise('core.edit.state', $this->input->getCmd('option', 'com_foobar'))); return $result; }
protected function onRead($tpl = null) { JLoader::import('joomla.plugin.helper'); JPluginHelper::importPlugin('akeebasubs'); $app = JFactory::getApplication(); $ret = parent::onRead($tpl); switch ($this->getLayout()) { case 'cancel': $event = 'onCancelMessage'; $field = 'cancelurl'; break; case 'order': default: $event = 'onOrderMessage'; $field = 'orderurl'; break; } // Do I have a custom redirect URL? Follow it instead of showing the message // This check has been put here so controller and model can do all their logic and trigger every event if ($this->item->{$field}) { $app->redirect($this->item->{$field}); } $pluginHtml = ''; $jResponse = $app->triggerEvent($event, array($this->subscription)); if (is_array($jResponse) && !empty($jResponse)) { foreach ($jResponse as $pluginResponse) { if (!empty($pluginResponse)) { $pluginHtml .= $pluginResponse; } } } $this->assignRef('pluginHTML', $pluginHtml); // Makes sure SiteGround's SuperCache doesn't cache the subscription page JResponse::setHeader('X-Cache-Control', 'False', true); return $ret; }
public function onRead($tpl = null) { $this->setPreRender(false); $this->setPostRender(false); return parent::onRead($tpl); }
public function display($tpl = null) { parent::display($tpl); }
protected function onBrowse($tpl = null) { $model = $this->getModel(); $this->invoicetemplates = $model->getInvoiceTemplateNames(); parent::onBrowse($tpl); }
function __construct($config = array()) { parent::__construct($config); $this->lists = new JObject(); }
protected function onDisplay($tpl = null) { // Makes sure SiteGround's SuperCache doesn't cache the subscription page JResponse::setHeader('X-Cache-Control', 'False', true); parent::onDisplay($tpl); }
public function onDisplay($tpl = null) { $ret = parent::onDisplay($tpl); if ($ret) { // Get all levels and all active levels $rawActiveLevels = F0FModel::getTmpInstance('Levels', 'AkeebasubsModel')->enabled(1)->getList(); $activeLevels = array(); $allLevels = array(); $ppList = array(); // Let's get all the enabled plugins JPluginHelper::importPlugin('akpayment'); $tempList = JFactory::getApplication()->triggerEvent('onAKPaymentGetIdentity'); // Remove a level for better handling foreach ($tempList as $tempPlugin) { $keys = array_keys($tempPlugin); $name = array_pop($keys); $ppList[$name] = array_pop($tempPlugin); } if (!empty($rawActiveLevels)) { foreach ($rawActiveLevels as $l) { $activeLevels[] = $l->akeebasubs_level_id; $allLevels[$l->akeebasubs_level_id] = $l; } } // Get subscription and subscription level IDs, sort subscriptions // based on status $subIDs = array(); $subscription_ids = array(); $sortTable = array('active' => array(), 'waiting' => array(), 'pending' => array(), 'expired' => array()); if (count($this->items)) { JLoader::import('joomla.utilities.date'); foreach ($this->items as $sub) { $id = $sub->akeebasubs_subscription_id; $subIDs[] = $id; $subscription_ids[] = $id; // Propagate the info the the sub can be cancelled if (isset($ppList[$sub->processor])) { $sub->allow_renew = $ppList[$sub->processor]->recurringCancellation; } else { $sub->allow_renew = true; } if (!$sub->enabled) { $jd = new JDate($sub->publish_up); } if ($sub->enabled) { $sortTable['active'][] = $id; } elseif ($sub->state == 'C' && $jd->toUnix() >= time()) { $sortTable['waiting'][] = $id; } elseif ($sub->state == 'P') { $sortTable['pending'][] = $id; } else { $sortTable['expired'][] = $id; } } } $subIDs = array_unique($subIDs); // Get invoices data $invoices = array(); if (!empty($subscription_ids)) { $rawInvoices = F0FModel::getTmpInstance('Invoices', 'AkeebasubsModel')->subids($subscription_ids)->getList(); if (!empty($rawInvoices)) { foreach ($rawInvoices as $rawInvoice) { $invoices[$rawInvoice->akeebasubs_subscription_id] = $rawInvoice; } } } // Get incoiving extensions $extensions = F0FModel::getTmpInstance('Invoices', 'AkeebasubsModel')->getExtensions(); // Assign variables $this->activeLevels = $activeLevels; $this->allLevels = $allLevels; $this->subIDs = $subIDs; $this->invoices = $invoices; $this->extensions = $extensions; $this->sortTable = $sortTable; } return $ret; }
/** * Executes before rendering the page for the Add task. * * @param string $tpl Subtemplate to use * * @return boolean Return true to allow rendering of the page */ protected function onAdd($tpl = null) { $result = parent::onAdd($tpl); if ($this->item->id == 0 && isset($this->item->published)) { $this->item->published = $this->perms->editstate; } return $result; }