本文整理汇总了PHP中FormUI::save方法的典型用法代码示例。如果您正苦于以下问题:PHP FormUI::save方法的具体用法?PHP FormUI::save怎么用?PHP FormUI::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormUI
的用法示例。
在下文中一共展示了FormUI::save方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updated_config
public function updated_config(FormUI $ui)
{
Session::notice(_t('Settings saved.', 's3siloplugin'));
$ui->save();
if (is_null(Options::get('s3_bucket'))) {
Session::notice(_t('Please select a bucket from your S3 account.', 's3siloplugin'));
}
Utils::redirect();
}
示例2: updated_config
public function updated_config(FormUI $ui)
{
$blacklist = explode("\n", $ui->blacklist->value);
$blacklist = array_unique($blacklist);
natsort($blacklist);
$_POST[$ui->blacklist->field] = implode("\n", $blacklist);
Session::notice(_t('Blacklist saved.', 'simpleblacklist'));
$ui->save();
}
示例3: formui_submit
public function formui_submit(FormUI $form)
{
$filename = basename($form->pluginurl);
//local file path (e.g. habari_installation/system/plugins/plugin.zip)
$filePath = $this->downloadplugin_pluginsPath . $filename;
// check if the remote file is successfully opened
if ($fp = fopen($form->pluginurl, 'r')) {
$content = '';
// keep reading until there's nothing left
while ($line = fread($fp, 1024)) {
$content .= $line;
}
$fp = fopen($filePath, 'w');
fwrite($fp, $content);
fclose($fp);
} else {
Session::notice(_t("Error during file download", 'plugin_locale'));
break;
}
$zip = new ZipArchive();
$res = $zip->open($filePath);
if ($res === TRUE) {
$zip->extractTo($this->downloadplugin_pluginsPath);
$zip->close();
//SET 775 Permission ?
Session::notice(_t('Plugin installed', 'plugin_locale'));
} else {
Session::notice(_t('Error during plugin installation', 'plugin_locale'));
$form->save();
unlink($filePath);
break;
}
unlink($filePath);
$form->pluginurl->value = '';
$form->save();
Utils::redirect(URL::get('admin', 'page=plugins'));
}
示例4: updated_config
/**
* Give the user a session message to confirm options were saved.
**/
public function updated_config(FormUI $ui)
{
Session::notice(_t('Twitter options saved.', 'twitter'));
$ui->save();
}
示例5: form_options_success
/**
* Display a message when the site options are saved, and save those options
*
* @param FormUI $form The successfully submitted form
*/
public function form_options_success($form)
{
Session::notice(_t('Successfully updated options'));
$form->save();
Utils::redirect();
}
示例6: updated_config
public function updated_config(FormUI $ui)
{
Session::notice(_t('Bit.ly options saved.', 'bitly'));
$ui->save();
}
示例7: formui_submit
public function formui_submit(FormUI $form)
{
Session::notice(_t('Mollom API Keys saved.', 'mollom'));
$form->save();
}
示例8: save_block
/**
* Display a standard success message upon saving the form
*
* @param FormUI $form The form that will be saved
* @return bool Returning false tells the form that the save was handled
*/
public function save_block(FormUI $form)
{
$form->save();
return false;
}
示例9: formui_submit
public function formui_submit(FormUI $form)
{
Session::notice(_t('Blogroll options saved.', self::DOMAIN));
$form->save();
}
示例10: save_config
/**
* Invoked when the before the plugin configurations are saved
*
* @param FormUI $form The configuration form being saved
* @return true
*/
public function save_config($form)
{
$form->save();
Session::notice('Woopra plugin configuration saved!');
return false;
}
示例11: updated_config
/**
* Perform actions when the admin plugin form is successfully submitted.
*
* @param FormUI $ui The form that successfully completed
* @return boolean True if the normal processing should occur to save plugin options from the form to the database
*/
public function updated_config($ui)
{
$ui->save();
// Delete the cached feed data
DB::query('TRUNCATE {feedlist}');
// Reset the cronjob so that it runs immediately with the change
CronTab::delete_cronjob('feedlist');
CronTab::add_hourly_cron('feedlist', 'load_feeds', 'Load feeds for feedlist plugin.');
return false;
}
示例12: save_config
/**
* Handle the form submition and save options
* @param FormUI $form The FormUI that was submitted
*/
public function save_config(FormUI $form)
{
Session::notice(_t('Piwik plugin configuration saved', 'piwik'));
$form->save();
}
示例13: chosen_engine
/**
* Callback function from choosing the engine.
*
* @param FormUI $ui
* @return string|bool
*/
public function chosen_engine($ui)
{
$this->load_backend($ui->engine->value);
if (!$this->_backend->check_conditions()) {
$ui->set_option('success_message', _t('The engine could not be set up, please check the requirements.'));
} else {
$ui->save();
return '<p>' . _t('Engine saved - please press close and then select Configure in order to check the details and activate the engine.') . '</p>';
}
return false;
}