本文整理汇总了PHP中html::label方法的典型用法代码示例。如果您正苦于以下问题:PHP html::label方法的具体用法?PHP html::label怎么用?PHP html::label使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html
的用法示例。
在下文中一共展示了html::label方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prefs_list
/**
* Handler for user preferences form (preferences_list hook)
*/
function prefs_list($args)
{
if ($args['section'] != 'mailbox') {
return $args;
}
// Load configuration
$this->load_config();
// Load localization and configuration
$this->add_texts('localization/');
if (!empty($_REQUEST['_framed'])) {
$this->rc->output->add_label('newmail_notifier.title', 'newmail_notifier.testbody', 'newmail_notifier.desktopunsupported', 'newmail_notifier.desktopenabled', 'newmail_notifier.desktopdisabled');
$this->include_script('newmail_notifier.js');
}
// Check that configuration is not disabled
$dont_override = (array) $this->rc->config->get('dont_override', array());
foreach (array('basic', 'desktop', 'sound') as $type) {
$key = 'newmail_notifier_' . $type;
if (!in_array($key, $dont_override)) {
$field_id = '_' . $key;
$input = new html_checkbox(array('name' => $field_id, 'id' => $field_id, 'value' => 1));
$content = $input->show($this->rc->config->get($key)) . ' ' . html::a(array('href' => '#', 'onclick' => 'newmail_notifier_test_' . $type . '()'), $this->gettext('test'));
$args['blocks']['new_message']['options'][$key] = array('title' => html::label($field_id, Q($this->gettext($type))), 'content' => $content);
}
}
return $args;
}
示例2: prefs_list
function prefs_list($args)
{
if ($args['section'] == 'mailbox') {
$RCMAIL = rcmail::get_instance();
$field_id = 'rcmfd_html5_notifier';
$select_duration = new html_select(array('name' => '_html5_notifier_duration', 'id' => $field_id));
$select_duration->add($this->gettext('off'), '0');
$times = array('3', '5', '8', '10', '12', '15', '20', '25', '30');
foreach ($times as $time) {
$select_duration->add($time . ' ' . $this->gettext('seconds'), $time);
}
$select_duration->add($this->gettext('durable'), '-1');
$select_smbox = new html_select(array('name' => '_html5_notifier_smbox', 'id' => $field_id));
$select_smbox->add($this->gettext('no_mailbox'), '0');
$select_smbox->add($this->gettext('short_mailbox'), '1');
$select_smbox->add($this->gettext('full_mailbox'), '2');
$content = $select_duration->show($RCMAIL->config->get('html5_notifier_duration') . '');
$content .= $select_smbox->show($RCMAIL->config->get('html5_notifier_smbox') . '');
$content .= html::a(array('href' => '#', 'id' => 'rcmfd_html5_notifier_browser_conf', 'onclick' => 'rcmail_browser_notifications(); return false;'), $this->gettext('conf_browser')) . ' ';
$content .= html::a(array('href' => '#', 'onclick' => 'rcmail_browser_notifications_test(); return false;'), $this->gettext('test_browser'));
$args['blocks']['new_message']['options']['html5_notifier'] = array('title' => html::label($field_id, Q($this->gettext('shownotifies'))), 'content' => $content);
$check_only_new = new html_checkbox(array('name' => '_html5_notifier_only_new', 'id' => $field_id . '_only_new', 'value' => 1));
$content = $check_only_new->show($RCMAIL->config->get('html5_notifier_only_new', false));
$args['blocks']['new_message']['options']['html5_notifier_only_new'] = array('title' => html::label($field_id, Q($this->gettext('onlynew'))), 'content' => $content);
$field_id .= '_excluded';
$input_excluded = new html_inputfield(array('name' => '_html5_notifier_excluded_directories', 'id' => $field_id));
$args['blocks']['new_message']['options']['html5_notifier_excluded_directories'] = array('title' => html::label($field_id, Q($this->gettext('excluded_directories'))), 'content' => $input_excluded->show($RCMAIL->config->get('html5_notifier_excluded_directories') . ''));
$RCMAIL->output->add_script("\$(document).ready(function(){ rcmail_browser_notifications_colorate(); });");
}
return $args;
}
示例3: gen_form
function gen_form()
{
list($form_start, $form_end) = get_form_tags(null, 'plugin.changepasswd_AD.save');
// return the complete form as table
$out = $form_start;
$table = new html_table(array('cols' => 2));
// show old password field
$field_id = 'rcmfd_curpwd';
$input_curpasswd = new html_passwordfield(array('name' => '_curpasswd', 'id' => $field_id));
$table->add('title', html::label($field_id, Q($this->gettext('curpasswd'))));
$table->add(null, $input_curpasswd->show());
// show new password field
$field_id = 'rcmfd_newpwd';
$input_newpasswd = new html_passwordfield(array('name' => '_newpasswd', 'id' => $field_id));
$table->add('title', html::label($field_id, Q($this->gettext('newpasswd'))));
$table->add(null, $input_newpasswd->show());
// show new password confirm field
$field_id = 'rcmfd_cnfpwd';
$input_confpasswd = new html_passwordfield(array('name' => '_confpasswd', 'id' => $field_id));
$table->add('title', html::label($field_id, Q($this->gettext('confpasswd'))));
$table->add(null, $input_confpasswd->show());
$out .= $table->show();
$out .= $form_end;
return $out;
}
示例4: row
public static function row($label, $control, $help = null)
{
if (!empty($help)) {
$help = html::span('help-block', $help);
} else {
$help = '';
}
return html::div('control-group', html::label('control-label', $label) . html::div('controls', $control . $help));
}
示例5: settings_blocks
function settings_blocks($args)
{
if ($args['section'] == 'server') {
$use_subscriptions = rcmail::get_instance()->config->get('use_subscriptions');
$field_id = 'rcmfd_use_subscriptions';
$checkbox = new html_checkbox(array('name' => '_use_subscriptions', 'id' => $field_id, 'value' => 1));
$args['blocks']['main']['options']['use_subscriptions'] = array('title' => html::label($field_id, rcube::Q($this->gettext('useimapsubscriptions'))), 'content' => $checkbox->show($use_subscriptions ? 1 : 0));
}
return $args;
}
示例6: prefs_list
function prefs_list($args)
{
if ($args['section'] == 'compose') {
$this->add_texts('localization/');
$reminder = rcube::get_instance()->config->get('attachment_reminder');
$field_id = 'rcmfd_attachment_reminder';
$checkbox = new html_checkbox(array('name' => '_attachment_reminder', 'id' => $field_id, 'value' => 1));
$args['blocks']['main']['options']['attachment_reminder'] = array('title' => html::label($field_id, rcube::Q($this->gettext('reminderoption'))), 'content' => $checkbox->show($reminder ? 1 : 0));
}
return $args;
}
示例7: preferences_list
function preferences_list($args)
{
if ($args['section'] == 'server') {
$protectimus_authentication_enabled = $this->rcmail->config->get('protectimus_authentication_enabled', $this->rcmail->config->get('protectimus_authentication_enabled_by_default_for_user'));
$field_id = 'protectimus_authentication_enabled';
$checkbox = new html_checkbox(array('name' => '_protectimus_authentication_enabled', 'id' => $field_id, 'value' => 1));
$args['blocks']['protectimus']['name'] = 'Protectimus';
$args['blocks']['protectimus']['options']['protectimus_authentication_enabled'] = array('title' => html::label($field_id, $this->gettext('use_2fa')), 'content' => $checkbox->show($protectimus_authentication_enabled ? 1 : 0));
}
return $args;
}
示例8: item
public static function item($attrs, $template = '')
{
$description = array_take('description', $attrs);
$label = array_take('label', $attrs);
$str = empty($template) ? form::template() : $template;
$str = str_replace('{$field:label}', html::label($label, $attrs['name']), $str);
$str = str_replace('{$field:required}', form::required($attrs['valid']), $str);
$str = str_replace('{$field:description}', form::description($description), $str);
$str = str_replace('{$field:controller}', form::field($attrs), $str);
return $str;
}
示例9: forward_form
public function forward_form()
{
$table = new html_table(array('cols' => 2));
$field_id = 'forwardforwards';
$text_forwardforwards = new html_textarea(array('name' => '_forwardforwards', 'id' => $field_id, 'spellcheck' => 1, 'rows' => 6, 'cols' => 40));
$table->add('title', html::label($field_id, Q($this->gettext('forwardforwards'))));
$table->add(null, $text_forwardforwards->show($this->obj->get_forward_forwards()));
$field_id = 'forwardkeepcopies';
$input_forwardkeepcopies = new html_checkbox(array('name' => '_forwardkeepcopies', 'id' => $field_id, 'value' => 1));
$table->add('title', html::label($field_id, Q($this->gettext('forwardkeepcopies'))));
$table->add(null, $input_forwardkeepcopies->show($this->obj->is_forward_keepcopies() === true || $this->obj->is_forward_keepcopies() == "1" || $this->obj->is_forward_keepcopies() == "t" || $this->obj->is_forward_keepcopies() == "y" || $this->obj->is_forward_keepcopies() == "yes" ? 1 : 0));
$out = html::div(array('class' => "box"), html::div(array('id' => "prefs-title", 'class' => 'boxtitle'), $this->gettext('forward')) . html::div(array('class' => "boxcontent"), $table->show() . html::p(null, $this->rc->output->button(array('command' => 'plugin.forward-save', 'type' => 'input', 'class' => 'button mainaction', 'label' => 'save')))));
$this->rc->output->add_gui_object('forwardform', 'forward-form');
return $this->rc->output->form_tag(array('id' => 'forward-form', 'name' => 'forward-form', 'method' => 'post', 'action' => './?_task=settings&_action=plugin.forward-save'), $out);
}
示例10: preferences_list
function preferences_list($args)
{
if ($args['section'] == 'jabber') {
$jabber_username = $this->rc->config->get('jabber_username');
$jabber_domain = $this->rc->config->get('jabber_domain', 'jappix.com');
$jabber_enc = $this->rc->config->get('jabber_enc');
if ((!$jabber_username || !$jabber_enc || !$jabber_domain) && $this->rc->config->get('jappix_register_url')) {
$field_id = 'rcmfd_register';
$args['blocks']['jabber']['options']['jappix_register'] = array('title' => html::label($field_id, @$this->gettext('requirement')), 'content' => html::tag('a', array('href' => $this->rc->config->get('jappix_register_url'), 'target' => '_blank'), $this->gettext('clickhere')) . ' ' . $this->gettext('registeraccount'));
}
$jappix_enabled = $this->rc->config->get('jappix_enabled', 0);
$field_id = 'rcmfd_enabled';
$checkbox = new html_checkbox(array('name' => '_jappix_enabled', 'value' => 1, 'id' => $field_id, 'onclick' => "if(\$(this).prop('checked') == false || \$('input[name=\\'_jabber_username\\']').val() != ''){ \$('.mainaction').hide(); document.forms.form.submit(); };"));
$args['blocks']['jabber']['options']['jappix_enabled'] = array('title' => html::label($field_id, Q($this->gettext('enabled'))), 'content' => $checkbox->show($jappix_enabled ? 1 : 0));
$field_id_user = 'rcmfd_username';
$input_user = new html_inputfield(array('name' => '_jabber_username', 'id' => $field_id_user, 'size' => 25));
if ($jabber_domain == '%d') {
$jabber_domain = end(explode('@', $this->rc->user->data['username']));
}
$field_id_domain = 'rcmfd_domain';
$input_domain = new html_inputfield(array('name' => '_jabber_domain', 'id' => $field_id_domain, 'size' => 25));
$args['blocks']['jabber']['options']['jabber_username'] = array('title' => html::label($field_id, Q($this->gettext('jappixUsername'))), 'content' => $input_user->show($jabber_username) . ' @ ' . $input_domain->show($jabber_domain));
$field_id = 'rcmfd_enc';
$input = new html_passwordfield(array('name' => '_jabber_password', 'id' => $field_id, 'size' => 25, 'placeholder' => $jabber_enc ? $this->gettext('passwordisset') : $this->gettext('pleaseenterpassword')));
$args['blocks']['jabber']['options']['jabber_password'] = array('title' => html::label($field_id, Q($this->gettext('jappixPassword'))), 'content' => $input->show());
$jappix_full = $this->rc->config->get('jappix_full', 1);
$field_id = 'rcmfd_use_full';
$checkbox = new html_checkbox(array('name' => '_jappix_full', 'value' => 1, 'id' => $field_id, 'onclick' => "if(this.checked){ parent.\$('.button-jappix4roundcube').show(); } else { parent.\$('.button-jappix4roundcube').hide(); }; \$('.mainaction').hide(); document.forms.form.submit();"));
$args['blocks']['jabber']['options']['jappix_full'] = array('title' => html::label($field_id, Q($this->gettext('usefulljappix'))), 'content' => $checkbox->show($jappix_full ? 1 : 0));
$jappix_mini = $this->rc->config->get('jappix_mini', 1);
$field_id = 'rcmfd_use_mini';
$checkbox = new html_checkbox(array('name' => '_jappix_mini', 'value' => 1, 'id' => $field_id, 'onclick' => "if(this.checked){ parent.parent.\$('.jm_position').show(); } else { parent.parent.\$('.jm_position').hide(); }; \$('.mainaction').hide(); document.forms.form.submit();"));
$args['blocks']['jabber']['options']['jappix_mini'] = array('title' => html::label($field_id, Q($this->gettext('useminijappix'))), 'content' => $checkbox->show($jappix_mini ? 1 : 0));
$jappix_mini_autologon = $this->rc->config->get('jappix_mini_autologon', 1);
$field_id = 'rcmfd_use_mini_autologon';
$checkbox = new html_checkbox(array('name' => '_jappix_mini_autologon', 'value' => 1, 'id' => $field_id, 'onclick' => "if(this.checked){ parent.parent.\$('.jm_pane').trigger('click'); } else { if(parent.parent.JappixMini) parent.parent.JappixMini.disconnect(); }; \$('.mainaction').hide(); document.forms.form.submit();"));
$args['blocks']['jabber']['options']['jappix_mini_autologon'] = array('title' => html::label($field_id, Q($this->gettext('minijappixautologon'))), 'content' => $checkbox->show($jappix_mini_autologon ? 1 : 0));
/*
$field_id = 'rcmfd_use_manager';
$args['blocks']['jabber']['options']['jabber_manager'] = array(
'title' => html::label($field_id, Q($this->gettext('manager'))),
'content' => '<a target=\'_blank\' href=\''.$this->rc->config->get('jappix_url').'/?m=manager\'>'.Q($this->gettext('manager')).'</a>',
);
*/
}
return $args;
}
示例11: preferences_list
function preferences_list($params)
{
$rcmail = rcmail::get_instance();
if ($params['section'] == 'addressbook') {
$params['blocks'][$this->id]['name'] = $this->abook_name;
$field_id = 'rc_use_plugin';
$checkbox = new html_checkbox(array('name' => $field_id, 'id' => $field_id, 'value' => 1));
$params['blocks'][$this->id]['options'][$field_id] = array('title' => html::label($field_id, $this->gettext('use') . $this->abook_name), 'content' => $checkbox->show($rcmail->config->get(google_func::$settings_key_use_plugin)));
$field_id = 'rc_google_autosync';
$checkbox = new html_checkbox(array('name' => $field_id, 'id' => $field_id, 'value' => 1));
$params['blocks'][$this->id]['options'][$field_id] = array('title' => html::label($field_id, $this->gettext('autosync')), 'content' => $checkbox->show($rcmail->config->get(google_func::$settings_key_auto_sync)));
$field_id = 'rc_google_authcode';
$input_auth = new html_inputfield(array('name' => $field_id, 'id' => $field_id, 'size' => 45));
$params['blocks'][$this->id]['options'][$field_id] = array('title' => html::label($field_id, $this->gettext('authcode')), 'content' => $input_auth->show($rcmail->config->get(google_func::$settings_key_auth_code)));
$params['blocks'][$this->id]['options']['link'] = array('title' => html::span('', ''), 'content' => html::a(array('href' => google_func::get_client()->createAuthUrl(), 'target' => '_blank'), $this->gettext('authcodelink')));
}
return $params;
}
示例12: preferences_list
function preferences_list($p)
{
try {
//You must set a block or the section will not be displayed
if ($p['section'] == 'server') {
$this->loadData();
// ================================================================
//Auto reply
$p['blocks'][ARBLOCK]['name'] = $this->gettext('autoreply');
$ctrl_id = 'ztp_ar_enabled';
$ctrl = new html_checkbox(array('name' => '_ar_enabled', 'id' => $ctrl_id, 'value' => 1));
$p['blocks'][ARBLOCK]['options']['ar_enabled'] = array('title' => html::label($ctrl_id, Q($this->gettext('ar_enabled'))), 'content' => $ctrl->show($this->ar_enabled));
$ctrl_id = 'ztp_ar_subject';
$ctrl = new html_inputfield(array('type' => 'text', 'name' => '_ar_subject', 'id' => $ctrl_id));
$p['blocks'][ARBLOCK]['options']['ar_subject'] = array('title' => html::label($ctrl_id, Q($this->gettext('ar_subject'))), 'content' => $ctrl->show($this->ar_subject));
$ctrl_id = 'ztp_ar_body';
$ctrl = new html_textarea(array('name' => '_ar_body', 'id' => $ctrl_id, 'rows' => 5, 'cols' => 50));
$p['blocks'][ARBLOCK]['options']['ar_body'] = array('title' => html::label($ctrl_id, Q($this->gettext('ar_body'))), 'content' => $ctrl->show($this->ar_body));
$ctrl_id = 'ztp_ar_ae_enabled';
$ctrl = new html_checkbox(array('name' => '_ar_ae_enabled', 'id' => $ctrl_id, 'value' => 1));
$ctrl2_id = 'ztp_ar_ae_date';
$ctrl2 = new html_inputfield(array('name' => '_ar_ae_date', 'id' => $ctrl2_id));
$p['blocks'][ARBLOCK]['options']['ar_ae_enabled'] = array('title' => html::label($ctrl_id, Q($this->gettext('ar_ae_enabled'))), 'content' => $ctrl->show($this->ar_ae_enabled) . " " . $ctrl2->show($this->ar_ae_date));
// ================================================================
//Forwarder
$p['blocks'][FWBLOCK]['name'] = $this->gettext('forwarder');
$ctrl_id = 'ztp_fw_enabled';
$ctrl = new html_checkbox(array('name' => '_fw_enabled', 'id' => $ctrl_id, 'value' => 1));
$p['blocks'][FWBLOCK]['options']['fw_enabled'] = array('title' => html::label($ctrl_id, Q($this->gettext('fw_enabled'))), 'content' => $ctrl->show($this->fw_enabled));
$ctrl_id = 'ztp_fw_address';
$ctrl = new html_inputfield(array('name' => '_fw_address', 'id' => $ctrl_id));
$p['blocks'][FWBLOCK]['options']['fw_address'] = array('title' => html::label($ctrl_id, Q($this->gettext('fw_address'))), 'content' => $ctrl->show($this->fw_address));
$ctrl_id = 'ztp_fw_keeporiginal';
$ctrl = new html_checkbox(array('name' => '_fw_keeporiginal', 'id' => $ctrl_id, 'value' => 1));
$p['blocks'][FWBLOCK]['options']['fw_keeporiginal'] = array('title' => html::label($ctrl_id, Q($this->gettext('fw_keeporiginal'))), 'content' => $ctrl->show($this->fw_keeporiginal));
}
} catch (Exception $e) {
$p['abort'] = true;
$p['result'] = false;
$p['message'] = $e->getMessage();
}
return $p;
}
示例13: prefs_list
/**
* Handler for user preferences form (preferences_list hook)
*/
public function prefs_list($args)
{
if ($args['section'] != 'mailbox') {
return $args;
}
// Load localization and configuration
$this->add_texts('localization/');
// Check that configuration is not disabled
$dont_override = (array) $this->rc->config->get('dont_override', array());
$key = 'pref_use_infinite_scroll';
if (!in_array($key, $dont_override)) {
$config_key = 'use_infinite_scroll';
$field_id = "_" . $key;
$is_checked = $this->rc->config->get($config_key, true);
$input = new html_checkbox(array('name' => $field_id, 'id' => $field_id, 'value' => 1));
$content = $input->show($is_checked);
$args['blocks']['main']['options'][$key] = array('title' => html::label($field_id, rcube::Q($this->gettext($key))), 'content' => $content);
}
return $args;
}
示例14: header_alter_charsets
function header_alter_charsets($p)
{
if ($msg_uid = get_input_value('_uid', RCUBE_INPUT_GET)) {
$rcmail = rcmail::get_instance();
$alter_charset = (array) $rcmail->config->get('alter_charset', array());
$charset = $this->charset($msg_uid);
$url = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
//error_log($charset."\n",3,"/var/log/nginx/checkmail_error.log");
if ($alias_charset = get_input_value('_alter_charset', RCUBE_INPUT_GET)) {
$charset = $alter_charset[$alias_charset];
$url = str_replace('&_alter_charset=' . $alias_charset, '', $url);
}
$selector = '';
foreach ($alter_charset as $key => $value) {
$selector .= sprintf('<input type="radio" id="r_%s" onclick="window.location.href=\'https://%s&_alter_charset=%s\';" value="%s" %s>', $key, $url, $key, $key, current(array_keys($alter_charset, $charset)) == $key ? 'checked' : '') . html::label($attrib['id'], strtolower($value));
}
$p['output']['selectcharset'] = array('title' => rcube_label('charset'), 'value' => strtr($selector, "\r\n", " "));
}
return $p;
}
示例15: prefs_list
function prefs_list($args)
{
if ($args['section'] != 'general') {
return $args;
}
$this->load_config();
$this->add_texts('localization/');
$dont_override = array_merge((array) $this->rc->config->get('dont_override', array()), (array) $this->rc->config->get('larrymod_dont_override', array()));
foreach (array('headermini', 'hidelabels', 'hidetoplabels', 'superpreview', 'superpreview_hidefolderslist', 'unselectable') as $type) {
$key = 'larrymod_' . $type;
if (!in_array($key, $dont_override)) {
if (empty($args['blocks']['skin']['name'])) {
$args['blocks']['skin'] = array('name' => rcube::Q($this->gettext('skin')));
}
$field_id = '_' . $key;
$input = new html_checkbox(array('name' => $field_id, 'id' => $field_id, 'value' => 1));
$args['blocks']['skin']['options'][$key] = array('title' => html::label($field_id, rcube::Q($this->gettext($type))), 'content' => $input->show($this->rc->config->get($key, false)));
}
}
return $args;
}