本文整理汇总了PHP中FormUI::on_success方法的典型用法代码示例。如果您正苦于以下问题:PHP FormUI::on_success方法的具体用法?PHP FormUI::on_success怎么用?PHP FormUI::on_success使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormUI
的用法示例。
在下文中一共展示了FormUI::on_success方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_plugin_ui
public function action_plugin_ui($plugin_id, $action)
{
if ($plugin_id == $this->plugin_id()) {
$frequencies = array('manually' => _t('Manually', 'exportsnapshot'), 'hourly' => _t('Hourly', 'exportsnapshot'), 'daily' => _t('Daily', 'exportsnapshot'), 'weekly' => _t('Weekly', 'exportsnapshot'), 'monthly' => _t('Monthly', 'exportsnapshot'));
$types = array('blogml' => _t('BlogML', 'exportsnapshot'), 'wxr' => _t('WXR', 'exportsnapshot'));
switch ($action) {
case _t('Configure'):
$ui = new FormUI('export');
$ui->append('text', 'exportsnapshot_max_snapshots', 'option:exportsnapshot__max_snapshots', _t('Max Snapshots to Save:', 'exportsnapshot'));
$ui->append('select', 'exportsnapshot_freq', 'option:exportsnapshot__frequency', _t('Auto Snapshot frequency:', 'exportsnapshot'), $frequencies);
$ui->append('select', 'exportsnapshot_type', 'option:exportsnapshot__type', _t('Type of export:', 'exportsnapshot'), $types);
$ui->append('submit', 'save', _t('Save'));
$ui->on_success(array($this, 'updated_config'));
$ui->out();
break;
case _t('Take Snapshot'):
self::run('manual');
Session::notice(_t('Snapshot saved!', 'exportsnapshot'));
//CronTab::add_single_cron('snapshot_single', array( 'ExportSnapshot', 'run' ), HabariDateTime::date_create(), 'Run a single snapshot.' );
//Session::notice( _t( 'Snapshot scheduled for next cron run.' ) );
// don't display the configuration page, just redirect back to the plugin page
Utils::redirect(URL::get('admin', 'page=plugins'));
break;
}
}
}
示例2: action_plugin_ui
/**
* Create the configuration FromUI
*/
public function action_plugin_ui($plugin_id, $action)
{
if ($plugin_id == $this->plugin_id()) {
switch ($action) {
case _t('Configure'):
$ui = new FormUI(strtolower(get_class($this)));
// add language selector
$ui->append('select', 'lang', 'option:autokeyword__lang', _t('Language'), array('en' => 'English'));
// add single word entries
$ui->append('text', 'min_1word_length', 'option:autokeyword__min_1word_length', _t('Minimum length for one word keywords'));
$ui->append('text', 'min_1word_occur', 'option:autokeyword__min_1word_occur', _t('Minimum occurance for one word keywords'));
// add two word phrase entries
$ui->append('text', 'min_2word_length', 'option:autokeyword__min_2word_length', _t('Minimum length for single words in two word phrases'));
$ui->append('text', 'min_2phrase_length', 'option:autokeyword__min_2phrase_length', _t('Minimum length for entire two word phrase'));
$ui->append('text', 'min_2phrase_occur', 'option:autokeyword__min_2phrase_occur', _t('Minimum occurance for entire two word phrase'));
// add three word phrase entries
$ui->append('text', 'min_3word_length', 'option:autokeyword__min_3word_length', _t('Minimum length for single words in three word phrases'));
$ui->append('text', 'min_3phrase_length', 'option:autokeyword__min_3phrase_length', _t('Minimum length for entire three word phrase'));
$ui->append('text', 'min_3phrase_occur', 'option:autokeyword__min_3phrase_occur', _t('Minimum occurance for entire three word phrase'));
// misc
$ui->append('submit', 'save', 'Save');
$ui->on_success(array($this, 'updated_config'));
$ui->out();
break;
}
}
}
示例3: configure
public function configure()
{
$class_name = strtolower(get_class($this));
$form = new FormUI($class_name);
$form->append('select', 'frequency', 'database_optimizer__frequency', _t('Optimization Frequency'), array('hourly' => 'hourly', 'daily' => 'daily', 'weekly' => 'weekly', 'monthly' => 'monthly'));
$form->append('submit', 'save', _t('Save'));
$form->on_success(array($this, 'updated_config'));
$form->out();
}
示例4: action_plugin_ui_login
public function action_plugin_ui_login()
{
$ui = new FormUI('linkit_login');
$ui->append('text', 'email', 'linkit__email', _t('Your email address:'));
$ui->append('password', 'password', 'linkit__password', _t('Your password:'));
$ui->append('submit', 'login', _t('Log In'));
$ui->on_success(array($this, 'do_login'));
$ui->out();
}
示例5: action_plugin_ui_configure
public function action_plugin_ui_configure()
{
$ui = new FormUI('autoclose');
$age_in_days = $ui->append('text', 'age_in_days', 'autoclose__age_in_days', _t('Post age (days) for autoclose', 'autoclose'));
$age_in_days->add_validator('validate_required');
$ui->append('submit', 'save', _t('Save', 'autoclose'));
$ui->set_option('success_message', _t('Configuration saved', 'autoclose'));
$ui->on_success(array($this, 'updated_config'));
$ui->out();
}
示例6: configure
public function configure()
{
$ui = new FormUI('tracfeed');
$connection_string = $ui->append('text', 'connection_string', 'tracfeed__connection_string', _t('Connection String:', 'tracfeed'));
$username = $ui->append('text', 'username', 'tracfeed__username', _t('Username (or blank for sqlite):', 'tracfeed'));
$password = $ui->append('password', 'password', 'tracfeed__password', _t('Password (or blank for sqlite):', 'tracfeed'));
$ui->on_success(array($this, 'updated_config'));
$ui->append('submit', 'save', _t('Save', 'tracfeed'));
return $ui;
}
示例7: configure
public function configure()
{
$form = new FormUI('lipsum');
// $form->set_settings( array( 'use_session_errors' => true ) );
$form->append(FormControlText::create('num_posts', 'option:lipsum__num_posts')->add_validator('validate_lipsum_numbers')->label(_t('Number of posts to have present:', __CLASS__)));
$form->append(FormControlText::create('num_comments', 'option:lipsum__num_comments')->add_validator('validate_lipsum_numbers')->label(_t('Max number of comments for each post:', __CLASS__)));
$form->append(FormControlText::create('num_tags', 'option:lipsum__num_tags')->add_validator('validate_lipsum_numbers')->label(_t('Max number of tags for each post:', __CLASS__)));
$form->append(FormControlSubmit::create('save')->set_caption('Save'));
$form->on_success(array($this, 'updated_config'));
echo $form->get();
}
示例8: post_options
/**
* Handles POST requests from the options admin page
*/
public function post_options()
{
$option_items = array();
$timezones = DateTimeZone::listIdentifiers();
$timezones = array_merge(array('' => ''), array_combine(array_values($timezones), array_values($timezones)));
$option_items[_t('Name & Tagline')] = array('title' => array('label' => _t('Site Name'), 'type' => 'text', 'helptext' => ''), 'tagline' => array('label' => _t('Site Tagline'), 'type' => 'text', 'helptext' => ''), 'about' => array('label' => _t('About'), 'type' => 'textarea', 'helptext' => ''));
$option_items[_t('Publishing')] = array('pagination' => array('label' => _t('Items per Page'), 'type' => 'text', 'helptext' => ''), 'atom_entries' => array('label' => _t('Entries to show in Atom feed'), 'type' => 'text', 'helptext' => ''), 'comments_require_id' => array('label' => _t('Require Comment Author Info'), 'type' => 'checkbox', 'helptext' => ''), 'spam_percentage' => array('label' => _t('Comment SPAM Threshold'), 'type' => 'text', 'helptext' => _t('The likelihood a comment is considered SPAM, in percent.')));
$option_items[_t('Time & Date')] = array('timezone' => array('label' => _t('Time Zone'), 'type' => 'select', 'selectarray' => $timezones, 'helptext' => _t('Current Date Time: %s', array(HabariDateTime::date_create()->format()))), 'dateformat' => array('label' => _t('Date Format'), 'type' => 'text', 'helptext' => _t('Current Date: %s', array(HabariDateTime::date_create()->date))), 'timeformat' => array('label' => _t('Time Format'), 'type' => 'text', 'helptext' => _t('Current Time: %s', array(HabariDateTime::date_create()->time))));
$option_items[_t('Language')] = array('locale' => array('label' => _t('Locale'), 'type' => 'select', 'selectarray' => array_merge(array('' => 'default'), array_combine(HabariLocale::list_all(), HabariLocale::list_all())), 'helptext' => _t('International language code')), 'system_locale' => array('label' => _t('System Locale'), 'type' => 'text', 'helptext' => _t('The appropriate locale code for your server')));
$option_items[_t('Troubleshooting')] = array('log_min_severity' => array('label' => _t('Minimum Severity'), 'type' => 'select', 'selectarray' => LogEntry::list_severities(), 'helptext' => _t('Only log entries with a this or higher severity.')), 'log_backtraces' => array('label' => _t('Log Backtraces'), 'type' => 'checkbox', 'helptext' => _t('Logs error backtraces to the log table\'s data column. Can drastically increase log size!')));
/*$option_items[_t('Presentation')] = array(
'encoding' => array(
'label' => _t('Encoding'),
'type' => 'select',
'selectarray' => array(
'UTF-8' => 'UTF-8'
),
'helptext' => '',
),
);*/
$option_items = Plugins::filter('admin_option_items', $option_items);
$form = new FormUI('Admin Options');
$tab_index = 3;
foreach ($option_items as $name => $option_fields) {
$fieldset = $form->append('wrapper', Utils::slugify(_u($name)), $name);
$fieldset->class = 'container settings';
$fieldset->append('static', $name, '<h2>' . htmlentities($name, ENT_COMPAT, 'UTF-8') . '</h2>');
foreach ($option_fields as $option_name => $option) {
$field = $fieldset->append($option['type'], $option_name, $option_name, $option['label']);
$field->template = 'optionscontrol_' . $option['type'];
$field->class = 'item clear';
if ($option['type'] == 'select' && isset($option['selectarray'])) {
$field->options = $option['selectarray'];
}
$field->tabindex = $tab_index;
$tab_index++;
if (isset($option['helptext'])) {
$field->helptext = $option['helptext'];
} else {
$field->helptext = '';
}
}
}
/* @todo: filter for additional options from plugins
* We could either use existing config forms and simply extract
* the form controls, or we could create something different
*/
$submit = $form->append('submit', 'apply', _t('Apply'), 'admincontrol_submit');
$submit->tabindex = $tab_index;
$form->on_success(array($this, 'form_options_success'));
$this->theme->form = $form->get();
$this->theme->option_names = array_keys($option_items);
$this->theme->display('options');
}
示例9: configure
/**
* Implement the simple plugin configuration.
* @return FormUI The configuration form
*/
public function configure()
{
$ui = new FormUI('maintenance_mode');
// Add a text control for the maintenance mode text
$ui->append('textarea', 'mm_text', self::OPTION_NAME . '__text', _t('Display Text: '));
// Add checkbox to put in/out of maintenance mode
$ui->append('checkbox', 'in_maintenance', self::OPTION_NAME . '__in_maintenance', _t('In Maintenance Mode'));
$ui->append('checkbox', 'display_feeds', self::OPTION_NAME . '__display_feeds', _t('Display Feeds When In Maintenance Mode'));
$ui->append('submit', 'save', _t('Save'));
$ui->on_success(array($this, 'updated_config'));
$ui->out();
}
示例10: configure
/**
* Implement the simple plugin configuration.
* @return FormUI The configuration form
*/
public function configure()
{
$form = new FormUI('piwik');
$form->append('text', 'siteurl', 'option:piwik__siteurl', _t('Piwik site URL', 'piwik'));
$form->append('text', 'sitenum', 'option:piwik__sitenum', _t('Piwik site number', 'piwik'));
$form->append('text', 'auth_token', 'option:piwik__auth_token', _t('Piwik Auth Token', 'piwik'));
$form->append('checkbox', 'trackloggedin', 'option:piwik__trackloggedin', _t('Track logged-in users', 'piwik'));
$form->append('checkbox', 'use_clickheat', 'option:piwik__use_clickheat', _t('Include PiWik Click Heat Plugin JS', 'piwik'));
$form->append('submit', 'save', _t('Save', 'piwik'));
$form->on_success(array($this, 'save_config'));
return $form->get();
}
示例11: action_plugin_ui
public function action_plugin_ui($plugin_id, $action)
{
if ($plugin_id == $this->plugin_id()) {
if ($action == _t('Configure')) {
$class_name = strtolower(get_class($this));
$form = new FormUI($class_name);
$form->append('select', 'format', 'dateyurl__format', _t('URL Format'), array('date' => '/{year}/{month}/{day}/{slug}', 'month' => '/{year}/{month}/{slug}'));
$form->append('textmulti', 'rules', 'dateyurl__rules', _t('Rules to Change'));
$form->append('submit', 'save', _t('Save'));
$form->on_success(array($this, 'updated_config'));
$form->out();
}
}
}
示例12: action_plugin_ui
/**
* Method that responds to the user selecting an action on the plugin page
* @param string $plugin_id String containning the id of the plugin
* @param string $action The action string suplied via the filter_plugin_config hook
**/
public function action_plugin_ui($plugin_id, $action)
{
if ($plugin_id == $this->plugin_id()) {
switch ($action) {
case _t('Configure'):
$ui = new FormUI(strtolower(get_class($this)));
$colophontitle = $ui->add('text', 'colophon_title', _t('Enter your Title:'));
$colophontext = $ui->add('textarea', 'colophon_text', _t('Enter your Text:'));
$ui->on_success(array($this, 'updated_config'));
$ui->out();
break;
}
}
}
示例13: action_plugin_ui
/**
* Plugin UI - Displays the various config options depending on the "option"
* chosen.
*
* @access public
* @param string $plugin_id
* @param string $action
* @return void
*/
public function action_plugin_ui($plugin_id, $action)
{
$ui = new FormUI(strtolower(__CLASS__));
switch ($action) {
case _t('Configure'):
$ui = new FormUI(strtolower(__CLASS__));
$post_fieldset = $ui->append('fieldset', 'post_settings', _t('Fetch trac tickets using custom query', 'tracdashmodule'));
$trac_query = $post_fieldset->append('textmulti', 'trac_query', 'tracdashmodule__trac_query', _t('Enter custom query:', 'tracdashmodule'));
$ui->on_success(array($this, 'updated_config'));
$ui->append('submit', 'save', _t('Save', 'tracdashmodule'));
$ui->out();
break;
}
}
示例14: action_plugin_ui
public function action_plugin_ui($plugin_id, $action)
{
if ($plugin_id == $this->plugin_id()) {
switch ($action) {
case _t('Configure'):
$ui = new FormUI(strtolower(get_class($this)));
$max_dimension = $ui->append('text', 'max_dimension', 'photology__maxdim', _t('Maximum size of thumbnail (length and width)'));
$max_dimension->add_validator(array($this, 'validate_numeric'));
$ui->append('submit', 'save', _t('Save'));
$ui->on_success(array($this, 'update_config'));
$ui->out();
break;
}
}
}
示例15: action_plugin_ui
/**
* Creates a UI form to handle the plguin configurations
*
* @param string $plugin_id The id of a plugin
* @param array $actions An array of actions that apply to this plugin
*/
public function action_plugin_ui($plugin_id, $action)
{
if ($this->plugin_id() == $plugin_id && $action == _t('Configure')) {
$form = new FormUI(strtolower(get_class($this)));
$form->append('fieldset', 'fieldset1', _t('Tag Registered Users', 'woopra'));
$tag_registered = $form->fieldset1->append('checkbox', 'tag_registered', 'option:woopra__tag_registered', _t('Enabled', 'woopra'));
$label2 = $form->fieldset1->append('label', 'label2', _t('Display users avatars', 'woopra'));
$display_avatar = $form->fieldset1->append('radio', 'display_avatar', 'option:woopra__display_avatar', _t('Display users avatars', 'woopra'), array('no' => 'Disabled', 'userimage' => 'Local user image', 'gravatar' => 'Gravatar'));
$form->append('fieldset', 'fieldset2', _t('Exclude Users', 'woopra'));
$excluded_users = $form->fieldset2->append('textmulti', 'excluded_users', 'option:woopra__excluded_users', _t('Don\'t track visits from the following user names', 'woopra'));
$form->append('submit', 'save', _t('Save'));
$form->on_success(array($this, 'save_config'));
$form->out();
}
}