本文整理汇总了PHP中FormUI::append方法的典型用法代码示例。如果您正苦于以下问题:PHP FormUI::append方法的具体用法?PHP FormUI::append怎么用?PHP FormUI::append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormUI
的用法示例。
在下文中一共展示了FormUI::append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configure
public function configure()
{
$ui = new FormUI('acronyms');
$iam_key = $ui->append('textarea', 'acronyms', 'acronyms__acronyms', _t('Acronyms'));
$ui->append('submit', 'save', _t('Save'));
$ui->out();
}
示例2: action_plugin_ui
/**
* Executes when the admin plugins page wants to display the UI for a particular plugin action.
* Displays the plugin's UI.
*
* @param string $plugin_id The unique id of a plugin
* @param string $action The action to display
*/
public function action_plugin_ui($plugin_id, $action)
{
// Display the UI for this plugin?
if ($plugin_id == $this->plugin_id) {
// Depending on the action specified, do different things
switch ($action) {
// For the action 'configure':
case 'Configure':
// Create a new Form called 'lifestream'
$ui = new FormUI('lifestream');
// Add a text control for the feed URL
$feedurl = $ui->append('text', 'feedurl', 'lifestream__feedurl', _t('Feed URL'));
// Mark the field as required
$feedurl->add_validator('validate_required');
// Mark the field as requiring a valid URL
$feedurl->add_validator('validate_url');
// Add a text control for the rewrite base
$rewritebase = $ui->append('text', 'lifeurl', 'lifestream__lifeurl', _t('Lifestream URL'));
// Mark the field as required
$rewritebase->add_validator('validate_required');
// Add a text control for the entries per page
$perpage = $ui->append('text', 'perpage', 'lifestream__perpage', _t('Items Per Page'));
// Mark the field as required
$perpage->add_validator('validate_required');
$submit = $ui->append('submit', 'submit', _t('Save'));
// Display the form
$ui->out();
break;
}
}
}
示例3: 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;
}
}
}
示例4: get_form
public function get_form($group = null)
{
if ($group == null) {
$group = Options::get('register__group');
if ($group == null) {
$group = 'anonymous';
}
}
$form = new FormUI('registration');
$form->class[] = 'registration';
$form->append('text', 'email', 'null:null', _t('Email', __CLASS__), 'formcontrol_text');
$form->email->add_validator('validate_email');
$form->append('text', 'username', 'null:null', _t('Username', __CLASS__), 'formcontrol_text');
$form->username->add_validator('validate_required');
$form->username->add_validator('validate_username');
$form->append('password', 'password', 'null:null', _t('Password', __CLASS__), 'formcontrol_password');
$form->password->add_validator('validate_required');
$form->append('password', 'password_confirmation', 'null:null', _t('Confirm Password', __CLASS__), 'formcontrol_password');
$form->password_confirmation->add_validator('validate_required');
$form->password_confirmation->add_validator('validate_same', $form->password);
// Store the group to be added. This is stored locally, not retrieved from unsafe data.
$form->set_option('group_name', $group);
// Create the Register button
$form->append('submit', 'register', _t('Register', __CLASS__), 'formcontrol_submit');
$form->on_success(array($this, 'register_user'));
// Return the form object
return $form;
}
示例5: 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;
}
}
}
示例6: action_plugin_ui
/**
* Respond to the user selecting an action on the plugin page
* @param string $plugin_id The string id of the acted-upon plugin
* @param string $action The action string supplied via the filter_plugin_config hook
**/
public function action_plugin_ui($plugin_id, $action)
{
if ($plugin_id == $this->plugin_id()) {
if ($action == _t('Configure')) {
$ui = new FormUI(strtolower(get_class($this)));
$twitter_username = $ui->append('text', 'username', 'twitter__username', _t('Twitter Username:'));
$twitter_password = $ui->append('password', 'password', 'twitter__password', _t('Twitter Password:'));
$post_fieldset = $ui->append('fieldset', 'post_settings', _t('Autopost Updates from Habari'));
$twitter_post = $post_fieldset->append('checkbox', 'post_status', 'twitter__post_status', _t('Autopost to Twitter:'));
$twitter_post = $post_fieldset->append('text', 'prepend', 'twitter__prepend', _t('Prepend to Autopost:'));
$twitter_post->value = "New Blog Post:";
$tweet_fieldset = $ui->append('fieldset', 'tweet_settings', _t('Displaying Status Updates'));
$twitter_show = $tweet_fieldset->append('checkbox', 'show', 'twitter__show', _t('Display twitter status updates in Habari'));
$twitter_limit = $ui->append('select', 'limit', 'twitter__limit', _t('Number of updates to show'));
$twitter_limit->options = array_combine(range(1, 20), range(1, 20));
$twitter_show = $tweet_fieldset->append('checkbox', 'hide_replies', 'twitter__hide_replies', _t('Do not show @replies'));
$twitter_show = $tweet_fieldset->append('checkbox', 'linkify_urls', 'twitter__linkify_urls', _t('Linkify URLs'));
$twitter_hashtags = $tweet_fieldset->append('text', 'hashtags_query', 'twitter__hashtags_query', _t('#hashtags query link:'));
$twitter_cache_time = $ui->append('text', 'cache', 'twitter__cache', _t('Cache expiry in seconds:'));
$ui->on_success(array($this, 'updated_config'));
$ui->append('submit', 'save', _t('Save'));
$ui->out();
}
}
}
示例7: configure
/**
* Respond to the user selecting an action on the plugin page
*
* @param string $plugin_id The string id of the acted-upon plugin
* @param string $action The action string supplied via the filter_plugin_config hook
*/
public function configure()
{
$ui = new FormUI(strtolower(get_class($this)));
$ping_services = $ui->append('textmulti', 'ping_services', 'option:autopinger__pingservices', _t('Ping Service URLs:'));
$ui->append('submit', 'save', 'Save');
$ui->out();
}
示例8: configure
/**
* Simple plugin configuration
* @return FormUI The configuration form
**/
public function configure()
{
$form = new FormUI('postmark');
$form->append(new FormControlText('apikey', 'postmark__apikey', 'API Key'));
$form->append(new FormControlSubmit('save', _t('Save')));
return $form;
}
示例9: configure
public function configure()
{
$ui = new FormUI(strtolower(get_class($this)));
$clientcode = $ui->append('textarea', 'clientcode', 'freestyle__css', _t('FreeStyle CSS'));
$ui->append('submit', 'save', _t('Save'));
return $ui;
}
示例10: configure
/**
* Create a configuration form for this plugin
*
**/
public function configure()
{
$form = new FormUI('popular_posts');
$form->append('checkbox', 'loggedintoo', 'popular_posts__loggedintoo', _t('Track views of logged-in users too', 'popular_posts'));
$form->append('submit', 'save', 'Save');
$form->out();
}
示例11: action_plugin_ui
public function action_plugin_ui($plugin_id, $action)
{
if ($plugin_id == $this->plugin_id()) {
switch ($action) {
case _('Configure'):
$ui = new FormUI(strtolower(get_class($this)));
// present the user with a list of
// URL shortening services
$service = $ui->append('select', 'service', 'lilliputian__service', _t('The URL shortening service to use: '));
$services = array();
$services['internal'] = 'internal';
$list = Utils::glob(dirname(__FILE__) . '/*.helper.php');
if (count($list) > 0) {
foreach ($list as $item) {
$item = basename($item, '.helper.php');
$services[$item] = $item;
}
}
$service->options = $services;
if (Options::get('lilliputian__service') == 'internal') {
$secret = $ui->append('text', 'secret', 'lilliputian__secret', _t('The secret word that must be passed when generating short URLs. May be blank to disable this security feature.'));
}
$ui->append('submit', 'save', _t('Save'));
$ui->out();
break;
}
}
}
示例12: configure
public function configure()
{
$form = new FormUI(__CLASS__);
$form->append('checkbox', 'hide_social', __CLASS__ . 'hide_social', _t('Hide social area in fullsize image view', __CLASS__));
$form->append('submit', 'submit', _t('Save'));
return $form;
}
示例13: configure
public function configure()
{
$ui = new FormUI('mpango_config');
$ui->append('text', 'github_id', 'mpango__github_id', _t('GitHub ID (optional)'));
$ui->append('text', 'github_secret', 'mpango__github_secret', _t('GitHub Secret (optional)'));
$ui->append('submit', 'save', _t('Save'));
return $ui;
}
示例14: configure
public function configure()
{
$form = new FormUI('slugsync');
$form->append('checkbox', 'draft_updates', 'slugsync__draftupdates', _t('Only update when post status is draft: ', 'slugsync'));
$form->append('submit', 'save', 'Save');
$form->set_option('success_message', _t('Slugsync options saved.', 'slugsync'));
return $form;
}
示例15: configure
/**
* Respond to the user selecting Configure on the plugin page
**/
public function configure()
{
$ui = new FormUI(strtolower(get_class($this)));
$ui->append('text', 'count', 'related_posts__count', _t('No. of posts to be shown'));
$ui->append('text', 'header', 'related_posts__header', _t('Header for Related Posts list'));
$ui->append('submit', 'save', _t('Save'));
return $ui;
}