本文整理汇总了PHP中FormUI::out方法的典型用法代码示例。如果您正苦于以下问题:PHP FormUI::out方法的具体用法?PHP FormUI::out怎么用?PHP FormUI::out使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormUI
的用法示例。
在下文中一共展示了FormUI::out方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
}
}
示例2: 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();
}
示例3: 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;
}
}
}
示例4: 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()) {
switch ($action) {
case _t('Configure', $this->class_name):
$ui = new FormUI($this->class_name);
$type = $ui->append('select', 'type', 'option:' . $this->class_name . '__type', _t('Photostream Type', $this->class_name));
$type->options = array('public' => _t('Public photos & video', $this->class_name), 'user' => _t('Public photos & video from you', $this->class_name), 'friends' => _t('Your friends’ photostream', $this->class_name), 'faves' => _t('Public favorites from you', $this->class_name), 'group' => _t('Group pool', $this->class_name));
$type->add_validator('validate_required');
$user_id = $ui->append('text', 'user_id', 'option:' . $this->class_name . '__user_id', _t('Flickr ID (You can get it from <a href="http://idgettr.com">idGettr</a>)', $this->class_name));
$user_id->add_validator('validate_flickr_id');
$num_item = $ui->append('text', 'num_item', 'option:' . $this->class_name . '__num_item', _t('№ of Photos', $this->class_name));
$num_item->add_validator('validate_uint');
$num_item->add_validator('validate_required');
$size = $ui->append('select', 'size', 'option:' . $this->class_name . '__size', _t('Photo Size', $this->class_name));
$size->options = array('square' => _t('Square', $this->class_name), 'thumbnail' => _t('Thumbnail', $this->class_name), 'small' => _t('Small', $this->class_name), 'medium' => _t('Medium', $this->class_name), 'large' => _t('Large', $this->class_name), 'original' => _t('Original', $this->class_name));
$size->add_validator('validate_required');
$tags = $ui->append('text', 'tags', 'option:' . $this->class_name . '__tags', _t('Tags (comma separated, no space)', $this->class_name));
$cache_expiry = $ui->append('text', 'cache_expiry', 'option:' . $this->class_name . '__cache_expiry', _t('Cache Expiry (in seconds)', $this->class_name));
$cache_expiry->add_validator('validate_uint');
$cache_expiry->add_validator('validate_required');
// When the form is successfully completed, call $this->updated_config()
$ui->append('submit', 'save', _t('Save', $this->class_name));
$ui->set_option('success_message', _t('Options saved', $this->class_name));
$ui->out();
break;
}
}
}
示例5: 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();
}
示例6: 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;
}
}
}
示例7: action_theme_ui
/**
* Configuration form for the Charcoal theme
**/
public function action_theme_ui($theme)
{
$ui = new FormUI(__CLASS__);
// This is a fudge as I only need to add a little bit of styling to make things look nice.
$ui->append('static', 'style', '<style type="text/css">#charcoal .formcontrol { line-height: 2.2em; }</style>');
$ui->append('checkbox', 'show_title_image', __CLASS__ . '__show_title_image', _t('Show Title Image:'), 'optionscontrol_checkbox');
$ui->show_title_image->helptext = _t('Check to show the title image, uncheck to display the title text.');
$ui->append('text', 'home_label', __CLASS__ . '__home_label', _t('Home label:'), 'optionscontrol_text');
$ui->home_label->helptext = _t('Set to whatever you want your first tab text to be.');
$ui->append('checkbox', 'show_entry_paperclip', __CLASS__ . '__show_entry_paperclip', _t('Show Entry Paperclip:'), 'optionscontrol_checkbox');
$ui->show_entry_paperclip->helptext = _t('Check to show the paperclip graphic in posts, uncheck to hide it.');
$ui->append('checkbox', 'show_page_paperclip', __CLASS__ . '__show_page_paperclip', _t('Show Page Paperclip:'), 'optionscontrol_checkbox');
$ui->show_page_paperclip->helptext = _t('Check to show the paperclip graphic in pages, uncheck to hide it.');
$ui->append('checkbox', 'show_powered', __CLASS__ . '__show_powered', _t('Show Powered By:'), 'optionscontrol_checkbox');
$ui->show_powered->helptext = _t('Check to show the "powered by Habari" graphic in the sidebar, uncheck to hide it.');
$ui->append('checkbox', 'display_login', __CLASS__ . '__display_login', _t('Display Login:'), 'optionscontrol_checkbox');
$ui->display_login->helptext = _t('Check to show the Login/Logout link in the navigation bar, uncheck to hide it.');
$ui->append('checkbox', 'tags_in_multiple', __CLASS__ . '__tags_in_multiple', _t('Tags in Multiple Posts Page:'), 'optionscontrol_checkbox');
$ui->tags_in_multiple->helptext = _t('Check to show the post tags in the multiple posts pages (search, tags, archives), uncheck to hide them.');
$ui->append('checkbox', 'show_post_nav', __CLASS__ . '__show_post_nav', _t('Show Post Navigation:'), 'optionscontrol_checkbox');
$ui->show_post_nav->helptext = _t('Set to true to show single post navigation links, false to hide them.');
$ui->append('text', 'tags_count', __CLASS__ . '__tags_count', _t('Tag Cloud Count:'), 'optionscontrol_text');
$ui->tags_count->helptext = _t('Set to the number of tags to display on the default "cloud".');
// Save
$ui->append('submit', 'save', _t('Save'));
$ui->set_option('success_message', _t('Options saved'));
$ui->out();
}
示例8: 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();
}
示例9: configure
/**
* Create a configuration form for this plugin
*
**/
public function configure()
{
$form = new FormUI('relativelypopular');
$form->append('checkbox', 'loggedintoo', 'relativelypopular__loggedintoo', _t('Track visits of logged-in users too', 'relativelypopular'));
$form->append('text', 'number_of_periods', 'relativelypopular__number_of_periods', _t('Number of periods to track [default=30]', 'relativelypopular'));
$form->append('text', 'period_length_days', 'relativelypopular__period_length_days', _t('Tracking period length (days) [default=1]', 'relativelypopular'));
$form->append('submit', 'save', 'Save');
$form->out();
}
示例10: 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();
}
示例11: action_plugin_ui
/**
* Creates a UI form to handle the plugin configuration
*
* @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 == 'Configure') {
$form = new FormUI(strtolower(get_class($this)));
$form->append('checkbox', 'enable SmartyPants', 'option:habarimarkdown__smarty', _t('Enable SmartyPants'));
$form->append('submit', 'save', _t('Save'));
$form->out();
}
}
示例12: configure
public function configure()
{
$form = new FormUI('preapproved');
$form->append('text', 'approved_count', 'option:preapproved__approved_count', _t('Required number of approved comments: '));
$form->approved_count->add_validator(array($this, 'validate_integer'));
$form->append('submit', 'save', _t('Save'));
$form->set_option('success_message', _t('Configuration saved'));
$form->out();
}
示例13: 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();
}
示例14: action_plugin_ui
public function action_plugin_ui($plugin_id, $action)
{
if ($plugin_id == $this->plugin_id()) {
$ui = new FormUI('urlapprove');
$ui->append('checkbox', 'redirect_default', 'urlapprove__redirect_default', _t('Redirect all comment author links by default', 'urlapprove'));
$ui->append('textarea', 'whitelist', 'urlapprove__whitelist', _t('Whitelist of domains that will not be redirected, one per line (does not auto-approve)'));
$ui->append('submit', 'submit', 'Submit');
$ui->out();
}
}
示例15: configure
public function configure()
{
$ui = new FormUI(strtolower(get_class($this)));
$clientcode = $ui->append('text', 'clientcode', 'googleads__clientcode', _t('Ad Client Code'));
$adslot = $ui->append('text', 'adslot', 'googleads__adslot', _t('Ad Slot ID'));
$adwidth = $ui->append('text', 'adwidth', 'googleads__adwidth', _t('Ad Width'));
$adheight = $ui->append('text', 'adheight', 'googleads__adheight', _t('Ad Height'));
$ui->append('submit', 'save', _t('Save'));
$ui->out();
}