本文整理汇总了PHP中FormUI类的典型用法代码示例。如果您正苦于以下问题:PHP FormUI类的具体用法?PHP FormUI怎么用?PHP FormUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FormUI类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: action_form_publish_entry
/**
* Add the Key Image field to the post publication form, and allow it to be set from silos
* @param FormUI $form
* @param Post $post
*/
public function action_form_publish_entry($form, $post)
{
$form->insert('publish_controls', new FormControlText('keyimage', $post, 'Key Image', 'admincontrol_text'));
$imageinsert = $form->insert('content', 'static', 'imageinsert', '');
$imageinsert->caption = <<<CAPTION_SCRIPT
<script type="text/javascript">
function add_photo_to_set(fileindex, fileobj) {
\t\$('#keyimage').val(fileobj.url);
}
\$(function(){
\t\$.extend(habari.media.output.image_jpeg, {
\t\tset_key_image: add_photo_to_set
\t});
\t\$.extend(habari.media.output.image_png, {
\t\tset_key_image: add_photo_to_set
\t});
\t\$.extend(habari.media.output.image_gif, {
\t\tset_key_image: add_photo_to_set
\t});
\t\$.extend(habari.media.output.flickr, {
\t\tset_key_image: add_photo_to_set
\t});
});
</script>
CAPTION_SCRIPT;
}
开发者ID:ringmaster,项目名称:heavy,代码行数:31,代码来源:theme.php
示例2: 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;
}
}
}
开发者ID:habari-extras,项目名称:lilliputian,代码行数:28,代码来源:lilliputian.plugin.php
示例3: 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;
}
开发者ID:ringmaster,项目名称:habari_postmark,代码行数:11,代码来源:postmark.plugin.php
示例4: 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;
}
开发者ID:habari-extras,项目名称:prettyphoto,代码行数:7,代码来源:prettyphoto.plugin.php
示例5: 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;
}
}
}
开发者ID:anupom,项目名称:my-blog,代码行数:34,代码来源:flickrfeed.plugin.php
示例6: 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;
}
开发者ID:habari-extras,项目名称:FreeStyle,代码行数:7,代码来源:freestyle.plugin.php
示例7: 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();
}
开发者ID:habari-extras,项目名称:popular_posts,代码行数:11,代码来源:popular_posts.plugin.php
示例8: 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;
}
}
}
开发者ID:habari-extras,项目名称:lifestream,代码行数:38,代码来源:lifestream.plugin.php
示例9: 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();
}
开发者ID:habari-extras,项目名称:acronyms,代码行数:7,代码来源:acronyms.plugin.php
示例10: 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();
}
开发者ID:habari-extras,项目名称:autopinger,代码行数:13,代码来源:autopinger.plugin.php
示例11: configure
public function configure()
{
$form = new FormUI(strtolower(get_class($this)));
$form->append('static', 'why_suppress', _t('<small>If you suppress the list, you can add them manually using the $post->footnotes array.</small>'));
$form->append('checkbox', 'suppress_list', 'footnotes__suppress_list', _t('Don\'t append the footnote list to posts'));
$form->append('submit', 'save', _t('Save'));
return $form;
}
开发者ID:habari-extras,项目名称:footnotes,代码行数:8,代码来源:footnotes.plugin.php
示例12: action_form_publish_event
public function action_form_publish_event(FormUI $form, $post, $context)
{
$event_data = $form->insert('publish_controls', new FormControlFieldset('event_data', _t('Event Data'), 'admincontrol_fieldset'));
$start = $event_data->append(new FormControlTags('event_start', $post, 'Event Start', 'optionscontrol_text'));
$start->add_validator('validate_datetime')->add_validator('validate_required');
$end = $event_data->append(new FormControlTags('event_end', $post, 'Event End', 'optionscontrol_text'));
$end->add_validator('validate_datetime')->add_validator('validate_required');
}
开发者ID:ringmaster,项目名称:elks853,代码行数:8,代码来源:eventone.plugin.php
示例13: 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;
}
开发者ID:ringmaster,项目名称:slugsync,代码行数:8,代码来源:slugsync.plugin.php
示例14: 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;
}
开发者ID:habari-extras,项目名称:RelatedPosts,代码行数:11,代码来源:relatedposts.plugin.php
示例15: configure
public function configure()
{
$class_name = strtolower(get_class($this));
$ui = new FormUI($class_name);
$add_title = $ui->append('checkbox', 'add_title', $class_name . '__add_title', _t('Include title words in count?'));
$ui->append('submit', 'save', 'save');
return $ui;
}
开发者ID:habari-extras,项目名称:postwordcount,代码行数:8,代码来源:postwordcount.plugin.php
示例16: 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;
}
开发者ID:habari-extras,项目名称:mpango,代码行数:8,代码来源:mpango.plugin.php
示例17: 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();
}
}
开发者ID:habari-extras,项目名称:habarimarkdown,代码行数:15,代码来源:habarimarkdown.plugin.php
示例18: 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();
}
开发者ID:habari-extras,项目名称:simpleblacklist,代码行数:9,代码来源:simpleblacklist.plugin.php
示例19: configure
public function configure()
{
$ui = new FormUI('ieadmin');
$ver = $ui->append('text', 'ieversion', 'ieadmin__ieversion', _t('IE version to be compatible with (e.g. 8)', 'ieadmin'));
$ver->add_validator('validate_regex', '/^[7-9]*$/', _t('Please enter a valid version number between 7-9.', 'ieadmin'));
$ui->append('text', 'jsversion', 'ieadmin__jsversion', _t('Script version, if not using "' . self::JS_VERSION . '"', 'isadmin'));
$ui->append('submit', 'save', 'save');
return $ui;
}
开发者ID:habari-extras,项目名称:ie_admin,代码行数:9,代码来源:ie_admin.plugin.php
示例20: 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();
}
开发者ID:habari-extras,项目名称:database_optimizer,代码行数:9,代码来源:database_optimizer.plugin.php
注:本文中的FormUI类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论