本文整理汇总了PHP中FormUI类的典型用法代码示例。如果您正苦于以下问题:PHP FormUI类的具体用法?PHP FormUI怎么用?PHP FormUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FormUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
}
}
示例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;
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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();
}
示例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;
}
}
}
示例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();
}
示例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();
}
示例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;
}
示例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');
}
示例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;
}
示例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;
}
示例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;
}