本文整理汇总了PHP中F0FController类的典型用法代码示例。如果您正苦于以下问题:PHP F0FController类的具体用法?PHP F0FController怎么用?PHP F0FController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了F0FController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save()
{
$task = $this->getTask();
// get the Application Object
$app = JFactory::getApplication();
// get the payment id
$payment_id = $app->input->getInt('extension_id');
// if payment id exists
if ($payment_id) {
$data = $app->input->getArray($_POST);
$paymentdata = array();
$paymentdata['extension_id'] = $payment_id;
$registry = new JRegistry();
$registry->loadArray($data);
$paymentdata['params'] = $registry->toString('JSON');
try {
F0FTable::getAnInstance('Payment', 'J2StoreTable')->save($paymentdata);
} catch (Exception $e) {
$msg = $e->getMessage();
}
switch ($task) {
case 'apply':
parent::apply();
break;
case 'save':
parent::save();
break;
case 'savenew':
parent::savenew();
break;
}
}
}
示例2: execute
public function execute($task)
{
if (in_array($task, array('add', 'edit', 'read'))) {
$task = 'browse';
}
parent::execute($task);
}
示例3: execute
public function execute($task)
{
if (!in_array($task, array('offline', 'online'))) {
$task = 'browse';
}
parent::execute($task);
}
示例4: onBeforeBrowse
protected function onBeforeBrowse()
{
$db = JFactory::getDbo();
$config = J2Store::config();
$installation_complete = $config->get('installation_complete', 0);
if (!$installation_complete) {
//installation not completed
JFactory::getApplication()->redirect('index.php?option=com_j2store&view=postconfig');
}
//first check if the currency table has a default records at least.
$rows = F0FModel::getTmpInstance('Currencies', 'J2StoreModel')->enabled(1)->getList();
if (count($rows) < 1) {
//no records found. Dumb default data
F0FModel::getTmpInstance('Currencies', 'J2StoreModel')->create_currency_by_code('USD', 'USD');
}
//update schema
$dbInstaller = new F0FDatabaseInstaller(array('dbinstaller_directory' => JPATH_ADMINISTRATOR . '/components/com_j2store/sql/xml'));
$dbInstaller->updateSchema();
//update cart table
$cols = $db->getTableColumns('#__j2store_carts');
$cols_to_delete = array('product_id', 'vendor_id', 'variant_id', 'product_type', 'product_options', 'product_qty');
foreach ($cols_to_delete as $key) {
if (array_key_exists($key, $cols)) {
$db->setQuery('ALTER TABLE #__j2store_carts DROP COLUMN ' . $key);
try {
$db->execute();
} catch (Exception $e) {
echo $e->getMessage();
}
}
}
return parent::onBeforeBrowse();
}
示例5: execute
public function execute($task)
{
if ($task != 'step') {
$task = 'browse';
}
parent::execute($task);
}
示例6: onBeforeBrowse
public function onBeforeBrowse()
{
$result = parent::onBeforeBrowse();
if ($result) {
$params = JComponentHelper::getParams('com_akeeba');
$model = $this->getThisModel();
$view = $this->getThisView();
/** @var AkeebaModelCpanels $model */
$view->setModel($model);
$aeconfig = Factory::getConfiguration();
// Invalidate stale backups
Factory::resetState(array('global' => true, 'log' => false, 'maxrun' => $params->get('failure_timeout', 180)));
// Just in case the reset() loaded a stale configuration...
Platform::getInstance()->load_configuration();
// Let's make sure the temporary and output directories are set correctly and writable...
$wizmodel = F0FModel::getAnInstance('Confwiz', 'AkeebaModel');
$wizmodel->autofixDirectories();
// Check if we need to toggle the settings encryption feature
$model->checkSettingsEncryption();
// Update the magic component parameters
$model->updateMagicParameters();
// Run the automatic database check
$model->checkAndFixDatabase();
// Run the automatic update site refresh
/** @var AkeebaModelUpdates $updateModel */
$updateModel = F0FModel::getTmpInstance('Updates', 'AkeebaModel');
$updateModel->refreshUpdateSite();
}
return $result;
}
示例7: execute
public function execute($task)
{
if (!in_array($task, array('save', 'cancel', 'downloaddat'))) {
$task = 'browse';
}
parent::execute($task);
}
示例8: execute
public function execute($task)
{
if (!in_array($task, array('purgesessions'))) {
$task = 'browse';
}
parent::execute($task);
}
示例9: execute
public function execute($task)
{
if (!in_array($task, array('read', 'cancel'))) {
$task = 'read';
$this->input->set('task', 'read');
}
parent::execute($task);
}
示例10: execute
public function execute($task)
{
if (!in_array($task, array('savedefaults', 'saveperms', 'saveapplyperms'))) {
$task = 'browse';
}
$this->getThisModel()->setState('task', $task);
parent::execute($task);
}
示例11: execute
/**
* Executes a given controller task. The onBefore<task> and onAfter<task>
* methods are called automatically if they exist.
*
* @param string $task The task to execute, e.g. "browse"
*
* @throws Exception Exception thrown if the onBefore<task> returns false
*
* @return null|bool False on execution failure
*/
public function execute($task)
{
$validTasks = array('force', 'overview', 'startupdate', 'download', 'extract', 'install', 'cleanup');
if (!in_array($task, $validTasks)) {
$task = 'overview';
}
return parent::execute($task);
}
示例12: copy
public function copy()
{
$result = parent::copy();
if ($result) {
JFactory::getApplication()->enqueueMessage(JText::_('COM_AKEEBASUBS_EMAILTEMPLATE_COPIED'), 'message');
}
return $result;
}
示例13: __construct
public function __construct($config = array())
{
parent::__construct($config);
$this->registerTask('getexpirations', 'browse');
$this->registerTask('renewals', 'browse');
$this->registerTask('vies', 'invoices');
$this->registerTask('vatmoss', 'invoices');
$this->cacheableTasks = array();
}
示例14: stepscan
public function stepscan()
{
if (!$this->checkACL('admintools.security')) {
JError::raiseError('403', JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'));
}
$this->input->set('layout', 'scan');
$this->getThisView()->retarray = $this->getThisModel()->stepScan();
$this->getThisView()->setLayout('scan');
$this->layout = 'scan';
parent::display(false);
}
示例15: execute
public function execute($task)
{
// Only task browse and save are valid
$allowedTasks = array('browse', 'save');
// Take browse as the default task
if (!in_array($task, $allowedTasks)) {
$task = 'browse';
}
$this->input->set('task', $task, $this->input);
parent::execute($task);
}