本文整理汇总了PHP中html_table::set_row_attribs方法的典型用法代码示例。如果您正苦于以下问题:PHP html_table::set_row_attribs方法的具体用法?PHP html_table::set_row_attribs怎么用?PHP html_table::set_row_attribs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html_table
的用法示例。
在下文中一共展示了html_table::set_row_attribs方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
/**
* Template object for key information page content
*/
function tpl_key_data($attrib)
{
$out = '';
$table = new html_table(array('cols' => 2));
// Key user ID
$table->add('title', $this->enigma->gettext('keyuserid'));
$table->add(null, rcube::Q($this->data->name));
// Key ID
$table->add('title', $this->enigma->gettext('keyid'));
$table->add(null, $this->data->subkeys[0]->get_short_id());
// Key type
$keytype = $this->data->get_type();
if ($keytype == enigma_key::TYPE_KEYPAIR) {
$type = $this->enigma->gettext('typekeypair');
} else {
if ($keytype == enigma_key::TYPE_PUBLIC) {
$type = $this->enigma->gettext('typepublickey');
}
}
$table->add('title', $this->enigma->gettext('keytype'));
$table->add(null, $type);
// Key fingerprint
$table->add('title', $this->enigma->gettext('fingerprint'));
$table->add(null, $this->data->subkeys[0]->get_fingerprint());
$out .= html::tag('fieldset', null, html::tag('legend', null, $this->enigma->gettext('basicinfo')) . $table->show($attrib));
// Subkeys
$table = new html_table(array('cols' => 5, 'id' => 'enigmasubkeytable', 'class' => 'records-table'));
$table->add_header('id', $this->enigma->gettext('subkeyid'));
$table->add_header('algo', $this->enigma->gettext('subkeyalgo'));
$table->add_header('created', $this->enigma->gettext('subkeycreated'));
$table->add_header('expires', $this->enigma->gettext('subkeyexpires'));
$table->add_header('usage', $this->enigma->gettext('subkeyusage'));
$now = time();
$date_format = $this->rc->config->get('date_format', 'Y-m-d');
$usage_map = array(enigma_key::CAN_ENCRYPT => $this->enigma->gettext('typeencrypt'), enigma_key::CAN_SIGN => $this->enigma->gettext('typesign'), enigma_key::CAN_CERTIFY => $this->enigma->gettext('typecert'), enigma_key::CAN_AUTHENTICATE => $this->enigma->gettext('typeauth'));
foreach ($this->data->subkeys as $subkey) {
$algo = $subkey->get_algorithm();
if ($algo && $subkey->length) {
$algo .= ' (' . $subkey->length . ')';
}
$usage = array();
foreach ($usage_map as $key => $text) {
if ($subkey->usage & $key) {
$usage[] = $text;
}
}
$table->add('id', $subkey->get_short_id());
$table->add('algo', $algo);
$table->add('created', $subkey->created ? $this->rc->format_date($subkey->created, $date_format, false) : '');
$table->add('expires', $subkey->expires ? $this->rc->format_date($subkey->expires, $date_format, false) : $this->enigma->gettext('expiresnever'));
$table->add('usage', implode(',', $usage));
$table->set_row_attribs($subkey->revoked || $subkey->expires && $subkey->expires < $now ? 'deleted' : '');
}
$out .= html::tag('fieldset', null, html::tag('legend', null, $this->enigma->gettext('subkeys')) . $table->show());
// Additional user IDs
$table = new html_table(array('cols' => 2, 'id' => 'enigmausertable', 'class' => 'records-table'));
$table->add_header('id', $this->enigma->gettext('userid'));
$table->add_header('valid', $this->enigma->gettext('uservalid'));
foreach ($this->data->users as $user) {
$username = $user->name;
if ($user->comment) {
$username .= ' (' . $user->comment . ')';
}
$username .= ' <' . $user->email . '>';
$table->add('id', rcube::Q(trim($username)));
$table->add('valid', $this->enigma->gettext($user->valid ? 'valid' : 'unknown'));
$table->set_row_attribs($user->revoked || !$user->valid ? 'deleted' : '');
}
$out .= html::tag('fieldset', null, html::tag('legend', null, $this->enigma->gettext('userids')) . $table->show());
return $out;
}
示例2: array
function gen_table($attrib)
{
$this->rcmail_inst->output->set_env('framed', true);
$out = '<fieldset><legend>' . $this->gettext('forward_entries') . '</legend>' . "\n";
$rule_table = new html_table(array('id' => 'rule-table', 'class' => 'records-table', 'cellspacing' => '0', 'cols' => 2));
$rule_table->add_header("", $this->gettext('forward_entries'));
$rule_table->add_header(array('width' => '16px'), '');
try {
$session_id = $this->soap->login($this->rcmail_inst->config->get('remote_soap_user'), $this->rcmail_inst->config->get('remote_soap_pass'));
$mail_user = $this->soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username']));
$this->soap->logout($session_id);
$forward = explode(",", $mail_user[0]['cc']);
if (!empty($forward[0])) {
for ($i = 0; $i < count($forward); $i++) {
$class = $class == 'odd' ? 'even' : 'odd';
if ($forward[$i] == get_input_value('_forwardingaddress', RCUBE_INPUT_GET)) {
$class = 'selected';
}
$rule_table->set_row_attribs(array('class' => $class, 'id' => 'rule_' . $forward[$i]));
$this->_rule_row($rule_table, $forward[$i], $attrib);
}
} else {
$rule_table->add(array('colspan' => '2'), rep_specialchars_output($this->gettext('forwardnomails')));
$rule_table->set_row_attribs(array('class' => 'odd'));
$rule_table->add_row();
}
} catch (SoapFault $e) {
$this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error');
}
$out .= "<div id=\"rule-cont\">" . $rule_table->show() . "</div>\n";
$out .= "</fieldset>\n";
return $out;
}
示例3: array
function gen_table($attrib)
{
$this->rcmail_inst->output->set_env('framed', true);
$out = '<fieldset><legend>' . $this->gettext('policy_entries') . '</legend>' . "\n";
$spam_table = new html_table(array('id' => 'spam-table', 'class' => 'records-table', 'cellspacing' => '0', 'cols' => 4));
$spam_table->add_header(array('width' => '220px'), $this->gettext('policy_entries'));
$spam_table->add_header(array('class' => 'value', 'width' => '150px'), $this->gettext('policy_tag'));
$spam_table->add_header(array('class' => 'value', 'width' => '150px'), $this->gettext('policy_tag2'));
$spam_table->add_header(array('class' => 'value', 'width' => '130px'), $this->gettext('policy_kill'));
try {
$session_id = $this->soap->login($this->rcmail_inst->config->get('remote_soap_user'), $this->rcmail_inst->config->get('remote_soap_pass'));
$mail_user = $this->soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username']));
$spam_user = $this->soap->mail_spamfilter_user_get($session_id, array('email' => $mail_user[0]['email']));
$policies = $this->soap->mail_policy_get($session_id, array(1 => 1));
for ($i = 0; $i < count($policies); $i++) {
$class = $class == 'odd' ? 'even' : 'odd';
if ($policies[$i]['id'] == $spam_user[0]['policy_id']) {
$class = 'selected';
}
$spam_table->set_row_attribs(array('class' => $class));
$this->_spam_row($spam_table, $policies[$i]['policy_name'], $policies[$i]['spam_tag_level'], $policies[$i]['spam_tag2_level'], $policies[$i]['spam_kill_level'], $attrib);
}
$this->soap->logout($session_id);
} catch (SoapFault $e) {
$this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error');
}
if (count($policies) == 0) {
$spam_table->add(array('colspan' => '4'), rep_specialchars_output($this->gettext('spamnopolicies')));
$spam_table->set_row_attribs(array('class' => 'odd'));
$spam_table->add_row();
}
$out .= "<div id=\"spam-cont\">" . $spam_table->show() . "</div>\n";
$out .= "</fieldset>\n";
return $out;
}
示例4: array
function gen_form()
{
$this->rcmail_inst->output->set_env('framed', true);
$out = '<form class="propform"><fieldset><legend>' . $this->gettext('acc_general') . '</legend>' . "\n";
$table = new html_table(array('cols' => 2, 'cellpadding' => 3, 'class' => 'propform'));
$table->add('title', rcube::Q($this->gettext('username')));
$table->add('', rcube::Q($this->rcmail_inst->user->data['username']));
$table->add('title', rcube::Q($this->gettext('server')));
$table->add('', rcube::Q($this->rcmail_inst->user->data['mail_host']));
$table->add('title', rcube::Q($this->gettext('acc_lastlogin')));
$table->add('', rcube::Q($this->rcmail_inst->user->data['last_login']));
$identity = $this->rcmail_inst->user->get_identity();
$table->add('title', rcube::Q($this->gettext('acc_defaultidentity')));
$table->add('', rcube::Q($identity['name'] . ' <' . $identity['email'] . '>'));
$out .= $table->show();
$out .= "</fieldset>\n";
$out .= '<fieldset><legend>' . $this->gettext('acc_alias') . '</legend>' . "\n";
$alias_table = new html_table(array('id' => 'alias-table', 'class' => 'records-table', 'cellspacing' => '0', 'cols' => 1));
$alias_table->add_header(array('width' => '100%'), $this->gettext('mail'));
try {
$session_id = $this->soap->login($this->rcmail_inst->config->get('remote_soap_user'), $this->rcmail_inst->config->get('remote_soap_pass'));
$mail_user = $this->soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username']));
$alias = $this->soap->mail_alias_get($session_id, array('destination' => $mail_user[0]['email'], 'type' => 'alias', 'active' => 'y'));
$this->soap->logout($session_id);
$class = $class == 'odd' ? 'even' : 'odd';
$alias_table->set_row_attribs(array('class' => $class));
$alias_table->add('', $mail_user[0]['email']);
for ($i = 0; $i < count($alias); $i++) {
$class = $class == 'odd' ? 'even' : 'odd';
$alias_table->set_row_attribs(array('class' => $class));
$alias_table->add('', $alias[$i]['source']);
}
} catch (SoapFault $e) {
$this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error');
}
$out .= "<div id=\"alias-cont\">" . $alias_table->show() . "</div>\n";
$out .= "</fieldset></form>\n";
return $out;
}
示例5: Q
function render_box($p)
{
$this->add_texts('localization');
$rcmail = rcmail::get_instance();
if (!$attrib['id']) {
$attrib['id'] = 'bounce-box';
$attrib['class'] = 'popupmenu';
}
$button = new html_inputfield(array('type' => 'button'));
$submit = new html_inputfield(array('type' => 'submit'));
$table = new html_table(array('cols' => 2, 'id' => 'form'));
$table->add('title', html::label('_to', Q(rcube_label('to'))));
$table->add('editfield', html::tag('textarea', array('spellcheck' => 'false', 'id' => '_to', 'name' => '_to', 'cols' => '50', 'rows' => '2', 'tabindex' => '2', 'class' => 'editfield', 'onclick' => 'select_field(this)')));
$table->set_row_attribs(array('id' => 'compose-cc'));
$table->add('title', html::a(array('href' => '#cc', 'onclick' => 'return rcmail_ui.hide_header_form(\'cc\')'), html::img(array('src' => $rcmail->config->get('skin_path') . '/images/icons/minus.gif', 'title' => rcube_label('delete'), 'alt' => rcube_label('delete')))) . ' ' . html::label('_cc', Q(rcube_label('cc'))));
$table->add(null, html::tag('textarea', array('spellcheck' => 'false', 'id' => '_cc', 'name' => '_cc', 'cols' => '50', 'rows' => '2', 'value' => '', 'class' => 'editfield', 'onclick' => 'select_field(this)')));
$table->set_row_attribs(array('id' => 'compose-bcc'));
$table->add('title', html::a(array('href' => '#bcc', 'onclick' => 'return rcmail_ui.hide_header_form(\'bcc\')'), html::img(array('src' => $rcmail->config->get('skin_path') . '/images/icons/minus.gif', 'title' => rcube_label('delete'), 'alt' => rcube_label('delete')))) . ' ' . html::label('_bcc', Q(rcube_label('bcc'))));
$table->add(null, html::tag('textarea', array('spellcheck' => 'false', 'id' => '_bcc', 'cols' => '50', 'name' => '_bcc', 'rows' => '2', 'value' => '', 'class' => 'editfield', 'onclick' => 'select_field(this)')));
$table->add(null, null);
$table->add(formlinks, html::a(array('href' => '#cc', 'onclick' => 'return rcmail_ui.show_header_form(\'cc\')', 'id' => 'cc-link'), Q(rcube_label('addcc'))) . '<span class="separator">|</span>' . html::a(array('href' => '#bcc', 'onclick' => 'return rcmail_ui.show_header_form(\'bcc\')', 'id' => 'bcc-link'), Q(rcube_label('addbcc'))));
$target_url = $_SERVER['REQUEST_URI'];
$rcmail->output->add_footer(html::div($attrib, $rcmail->output->form_tag(array('name' => 'bounceform', 'method' => 'post', 'action' => './', 'enctype' => 'multipart/form-data'), html::tag('input', array('type' => "hidden", 'name' => '_action', 'value' => 'bounce')) . html::div('bounce-title', Q($this->gettext('bouncemessage'))) . html::div('bounce-body', $table->show() . html::div('buttons', $button->show(rcube_label('close'), array('class' => 'button', 'onclick' => "\$('#{$attrib['id']}').hide()")) . ' ' . $button->show(Q($this->gettext('bounce')), array('class' => 'button mainaction', 'onclick' => JS_OBJECT_NAME . ".command('plugin.bounce.send', this.bounceform)")))))));
$rcmail->output->add_label('norecipientwarning');
$rcmail->output->add_gui_object('bouncebox', $attrib['id']);
$rcmail->output->add_gui_object('bounceform', 'bounceform');
$this->include_stylesheet('bounce.css');
$rcmail->output->set_env('autocomplete_min_length', $rcmail->config->get('autocomplete_min_length'));
$rcmail->output->add_gui_object('messageform', 'bounceform');
}
示例6: array
function gen_table($attrib)
{
$this->rcmail_inst->output->set_env('framed', TRUE);
$out = '<fieldset><legend>' . $this->gettext('wblistentries') . '</legend>' . "\n";
$rule_table = new html_table(array('id' => 'rule-table', 'class' => 'records-table', 'cellspacing' => '0', 'cols' => 4));
$rule_table->add_header("", $this->gettext('wblistentries'));
$rule_table->add_header(array('width' => '16px'), '');
$rule_table->add_header(array('width' => '20px'), '');
$rule_table->add_header(array('width' => '16px'), '');
try {
$session_id = $this->soap->login($this->rcmail_inst->config->get('remote_soap_user'), $this->rcmail_inst->config->get('remote_soap_pass'));
$mail_user = $this->soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username']));
$spam_user = $this->soap->mail_spamfilter_user_get($session_id, array('email' => $mail_user[0]['email']));
$wblist = $this->soap->mail_spamfilter_whitelist_get($session_id, array('rid' => $spam_user[0]['id']));
//$blist = $this->soap->mail_spamfilter_blacklist_get($session_id, array('rid' => $spam_user[0]['id']));
//$wblist = array_merge($wlist, $blist);
$this->soap->logout($session_id);
for ($i = 0; $i < count($wblist); $i++) {
$class = $class == 'odd' ? 'even' : 'odd';
if ($wblist[$i]['wblist_id'] == get_input_value('_id', RCUBE_INPUT_GET)) {
$class = 'selected';
}
$rule_table->set_row_attribs(array('class' => $class, 'id' => 'rule_' . $wblist[$i]['wblist_id']));
$this->_rule_row($rule_table, $wblist[$i]['email'], $wblist[$i]['wb'], $wblist[$i]['active'], $wblist[$i]['wblist_id'], $attrib);
}
} catch (SoapFault $e) {
$this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error');
}
if (count($wblist) == 0) {
$rule_table->add(array('colspan' => '4'), rep_specialchars_output($this->gettext('wblistnorules')));
$rule_table->set_row_attribs(array('class' => 'odd'));
$rule_table->add_row();
}
$out .= "<div id=\"rule-cont\">" . $rule_table->show() . "</div>\n";
$out .= "</fieldset>\n";
return $out;
}
示例7: _prefs_block
//.........这里部分代码省略.........
$rcmail->config->set('sauserprefs_languages', array_intersect_key($tmp_array, array_flip($this->sa_locales)));
$ok_languages = array();
}
$i = 0;
$locales_langs = array_merge($ok_locales, $ok_languages);
foreach ($rcmail->config->get('sauserprefs_languages') as $lang_code => $name) {
if (in_array($lang_code, $locales_langs)) {
$button = $this->api->output->button(array('command' => 'plugin.sauserprefs.message_lang', 'prop' => $lang_code, 'type' => 'link', 'class' => 'enabled', 'id' => 'spam_lang_' . $i, 'title' => 'sauserprefs.enabled', 'content' => ' '));
} else {
$button = $this->api->output->button(array('command' => 'plugin.sauserprefs.message_lang', 'prop' => $lang_code, 'type' => 'link', 'class' => 'disabled', 'id' => 'spam_lang_' . $i, 'title' => 'sauserprefs.disabled', 'content' => ' '));
}
$input_spamlang = new html_checkbox(array('style' => 'display: none;', 'name' => '_spamlang[]', 'value' => $lang_code));
$lang_table->add('lang', $name);
$lang_table->add('tick', $button . $input_spamlang->show(in_array($lang_code, $locales_langs) ? $lang_code : ''));
$i++;
}
$table->add('scroller', html::div(array('id' => 'spam-langs-cont'), $lang_table->show()));
$out .= html::tag('fieldset', null, html::tag('legend', null, rcmail::Q($this->gettext('langoptions'))) . $data . $table->show());
}
break;
// Header settings
// Header settings
case 'headers':
$data = html::p(null, rcmail::Q($this->gettext('headersexp')));
$table = new html_table(array('class' => 'headersprefstable', 'cols' => 3));
if (!isset($no_override['fold_headers'])) {
$help_button = html::img(array('class' => $imgclass, 'src' => $attrib['helpicon'], 'alt' => $this->gettext('sieveruleheaders'), 'border' => 0, 'style' => 'margin-left: 4px;'));
$help_button = html::a(array('name' => '_headerhlp', 'href' => "#", 'onclick' => 'return ' . rcmail_output::JS_OBJECT_NAME . '.sauserprefs_help("fold_help");', 'title' => $this->gettext('help')), $help_button);
$field_id = 'rcmfd_spamfoldheaders';
$input_spamreport = new html_checkbox(array('name' => '_spamfoldheaders', 'id' => $field_id, 'value' => '1'));
$table->add('title', html::label($field_id, rcmail::Q($this->gettext('foldheaders'))));
$table->add(null, $input_spamreport->show($this->user_prefs['fold_headers']));
$table->add('help', $help_button);
$table->set_row_attribs(array('id' => 'fold_help', 'style' => 'display: none;'));
$table->add(array('colspan' => '3'), rcmail::Q($this->gettext('foldhelp')));
}
if (!isset($no_override['add_header all Level'])) {
$help_button = html::img(array('class' => $imgclass, 'src' => $attrib['helpicon'], 'alt' => $this->gettext('sieveruleheaders'), 'border' => 0, 'style' => 'margin-left: 4px;'));
$help_button = html::a(array('name' => '_headerhlp', 'href' => "#", 'onclick' => 'return ' . rcmail_output::JS_OBJECT_NAME . '.sauserprefs_help("level_help");', 'title' => $this->gettext('help')), $help_button);
if ($this->user_prefs['remove_header all'] != 'Level') {
$enabled = "1";
$char = $this->user_prefs['add_header all Level'];
$char = substr($char, 7, 1);
} else {
$enabled = "0";
$char = "*";
}
$field_id = 'rcmfd_spamlevelstars';
$input_spamreport = new html_checkbox(array('name' => '_spamlevelstars', 'id' => $field_id, 'value' => '1', 'onchange' => rcmail_output::JS_OBJECT_NAME . '.sauserprefs_toggle_level_char(this)'));
$table->add('title', html::label($field_id, rcmail::Q($this->gettext('spamlevelstars'))));
$table->add(null, $input_spamreport->show($enabled));
$table->add('help', $help_button);
$table->set_row_attribs(array('id' => 'level_help', 'style' => 'display: none;'));
$table->add(array('colspan' => '3'), rcmail::Q($this->gettext('levelhelp')));
$field_id = 'rcmfd_spamlevelchar';
$input_spamsubject = new html_inputfield(array('name' => '_spamlevelchar', 'id' => $field_id, 'value' => $char, 'style' => 'width:20px;', 'disabled' => $enabled ? 0 : 1));
$table->add('title', html::label($field_id, rcmail::Q($this->gettext('spamlevelchar'))));
$table->add(null, $input_spamsubject->show());
$table->add('help', ' ');
}
$out = html::tag('fieldset', null, html::tag('legend', null, rcmail::Q($this->gettext('mainoptions'))) . $data . $table->show());
break;
// Test settings
// Test settings
case 'tests':
$data = html::p(null, rcmail::Q($this->gettext('spamtestssexp')));
示例8: _vacation_table
protected function _vacation_table($ext, $rowid, $defaults, $display, $help_icon)
{
$rcmail = rcube::get_instance();
// begin vacation action
$vacs_table = new html_table(array('class' => 'records-table', 'cellspacing' => '0', 'cols' => 3, 'style' => $defaults['method'] == 'vacation' ? '' : 'display: none;'));
$to_addresses = "";
$vacto_arr = explode(",", $defaults['vacto']);
$field_id_vacfrom = 'rcmfd_sievevacfrom_' . $rowid;
$field_id_vacto = 'rcmfd_sievevacto_' . $rowid;
if (count($this->identities)) {
$select_id = new html_select(array('id' => $field_id_vacfrom, 'name' => "_vacfrom[]", 'class' => 'short', 'onchange' => rcmail_output::JS_OBJECT_NAME . '.enable_sig(this);'));
if ($this->show_vacfrom && in_array('variables', $ext)) {
$select_id->add($this->gettext('autodetect'), "auto");
} elseif (!$this->show_vacfrom) {
$select_id->add($this->gettext('autodetect'), "");
}
foreach ($this->identities as $sql_arr) {
// find currently selected from address
if ($defaults['vacfrom'] != '' && $defaults['vacfrom'] == rcmail::Q($sql_arr['from']['string'])) {
$defaults['vacfrom'] = $sql_arr['identity_id'];
} elseif ($defaults['vacfrom'] != '' && $defaults['vacfrom'] == $sql_arr['from']['mailto']) {
$defaults['vacfrom'] = $sql_arr['identity_id'];
}
$select_id->add($sql_arr['from']['disp_string'], $sql_arr['identity_id']);
$ffield_id = 'rcmfd_vac_' . $rowid . '_' . $sql_arr['identity_id'];
if ($this->force_vacto) {
$curaddress = $sql_arr['email'];
$defaults['vacto'] .= (!empty($defaults['vacto']) ? ',' : '') . $sql_arr['email'];
} else {
$curaddress = in_array($sql_arr['email'], $vacto_arr) ? $sql_arr['email'] : "";
}
$input_address = new html_checkbox(array('id' => $ffield_id, 'name' => '_vacto_check_' . $rowid . '[]', 'value' => $sql_arr['email'], 'onclick' => rcmail_output::JS_OBJECT_NAME . '.sieverules_toggle_vac_to(this, ' . $rowid . ')', 'class' => 'checkbox'));
$to_addresses .= $input_address->show($curaddress) . " " . html::label($ffield_id, rcmail::Q($sql_arr['email'])) . "<br />";
}
}
// deduplicate vacto list
$tmparr = explode(",", $defaults['vacto']);
$tmparr = array_unique($tmparr);
$defaults['vacto'] = implode(",", $tmparr);
if ($rcmail->config->get('sieverules_limit_vacto', true) && strlen($to_addresses) > 0) {
$vacfrom_input = $select_id->show($defaults['vacfrom']);
$input_vacto = new html_hiddenfield(array('id' => $field_id_vacto, 'name' => '_vacto[]', 'value' => $defaults['vacto']));
$vacto_input = $to_addresses . $input_vacto->show();
$vac_help = $this->gettext('vactoexp');
} else {
$input_vacfrom = new html_inputfield(array('id' => $field_id_vacfrom, 'name' => '_vacfrom[]'));
$vacfrom_input = $input_vacfrom->show($defaults['vacfrom']);
$input_vacto = new html_inputfield(array('id' => $field_id_vacto, 'name' => '_vacto[]', 'class' => 'short'));
$vacto_input = $input_vacto->show($defaults['vacto']);
$vac_help = $this->gettext('vactoexp') . '<br /><br />' . $this->gettext('vactoexp_adv');
}
// from param
$vacs_table->set_row_attribs(array('class' => $this->show_vacfrom ? 'advanced' : 'disabled', 'style' => $display['vacfrom']));
$vacs_table->add(null, html::label($field_id_vacfrom, rcmail::Q($this->gettext('from'))));
$vacs_table->add(null, $vacfrom_input);
$sig_button = $this->api->output->button(array('command' => 'plugin.sieverules.vacation_sig', 'prop' => $rowid, 'type' => 'link', 'class' => 'vacsig', 'classact' => 'vacsig_act', 'title' => 'insertsignature', 'content' => ' '));
$vacs_table->add(null, $sig_button);
// to param
$vacs_table->set_row_attribs(array('class' => 'advanced', 'style' => $display['vacadv']));
$vacs_table->add(array('style' => 'vertical-align: top;'), html::label($field_id_vacto, rcmail::Q($this->gettext('sieveto'))));
$vacs_table->add(null, $vacto_input);
$help_button = html::a(array('href' => "#", 'onclick' => 'return ' . rcmail_output::JS_OBJECT_NAME . '.sieverules_help(this, ' . $vacs_table->size() . ');', 'title' => $this->gettext('messagehelp')), $help_icon);
$vacs_table->add(array('style' => 'vertical-align: top;'), $help_button);
$vacs_table->set_row_attribs(array('class' => 'advhelp', 'style' => 'display: none;'));
$vacs_table->add(array('colspan' => 3, 'class' => 'helpmsg'), $vac_help);
$field_id = 'rcmfd_sievevacperiod_' . $rowid;
$input_period = new html_inputfield(array('id' => $field_id, 'name' => '_period[]', 'class' => 'short'));
$vacs_table->set_row_attribs(array('class' => 'advanced', 'style' => $display['vacadv']));
$vacs_table->add(null, html::label($field_id, rcmail::Q($this->gettext('period'))));
$vacs_table->add(null, $input_period->show($defaults['period']));
$help_button = html::a(array('href' => "#", 'onclick' => 'return ' . rcmail_output::JS_OBJECT_NAME . '.sieverules_help(this, ' . (in_array('vacation-seconds', $ext) ? $vacs_table->size() + 1 : $vacs_table->size()) . ');', 'title' => $this->gettext('messagehelp')), $help_icon);
$vacs_table->add(null, $help_button);
if (in_array('vacation-seconds', $ext)) {
$input_periodtype = new html_radiobutton(array('id' => $field_id . '_days', 'name' => '_period_radio_' . $rowid, 'value' => 'days', 'onclick' => rcmail_output::JS_OBJECT_NAME . '.sieverules_period_type(this, ' . $rowid . ')', 'class' => 'radio'));
$period_type_show = $input_periodtype->show($defaults['periodtype']) . " " . html::label($field_id . '_days', rcmail::Q($this->gettext('days')));
$input_periodtype = new html_radiobutton(array('id' => $field_id . '_seconds', 'name' => '_period_radio_' . $rowid, 'value' => 'seconds', 'onclick' => rcmail_output::JS_OBJECT_NAME . '.sieverules_period_type(this, ' . $rowid . ')', 'class' => 'radio'));
$period_type_show .= ' ' . $input_periodtype->show($defaults['periodtype']) . " " . html::label($field_id . '_seconds', rcmail::Q($this->gettext('seconds')));
$input_periodtype = new html_hiddenfield(array('id' => 'rcmfd_sievevacperiodtype_' . $rowid, 'name' => '_periodtype[]'));
$vacs_table->set_row_attribs(array('class' => 'advanced', 'style' => $display['vacadv']));
$vacs_table->add(null, ' ');
$vacs_table->add(null, $period_type_show . $input_periodtype->show($defaults['periodtype']));
$vacs_table->add(null, ' ');
}
$vacs_table->set_row_attribs(array('style' => 'display: none;'));
$vacs_table->add(array('colspan' => 3, 'class' => 'helpmsg'), $this->gettext('vacperiodexp'));
$field_id = 'rcmfd_sievevachandle_' . $rowid;
$input_handle = new html_inputfield(array('id' => $field_id, 'name' => '_handle[]', 'class' => 'short'));
$vacs_table->set_row_attribs(array('class' => $this->show_vachandle ? 'advanced' : 'disabled', 'style' => $display['vachandle']));
$vacs_table->add(null, html::label($field_id, rcmail::Q($this->gettext('sievevachandle'))));
$vacs_table->add(null, $input_handle->show($defaults['handle']));
$help_button = html::a(array('href' => "#", 'onclick' => 'return ' . rcmail_output::JS_OBJECT_NAME . '.sieverules_help(this, ' . $vacs_table->size() . ');', 'title' => $this->gettext('messagehelp')), $help_icon);
$vacs_table->add(null, $help_button);
$vacs_table->set_row_attribs(array('class' => 'advhelp', 'style' => 'display: none;'));
$vacs_table->add(array('colspan' => 3, 'class' => 'helpmsg'), $this->gettext('vachandleexp'));
$field_id = 'rcmfd_sievevacsubject_' . $rowid;
$input_subject = new html_inputfield(array('id' => $field_id, 'name' => '_subject[]'));
$vacs_table->add(null, html::label($field_id, rcmail::Q($this->gettext('subject'))));
$vacs_table->add(array('colspan' => 2), $input_subject->show($defaults['subject']));
if (in_array('variables', $ext)) {
$field_id = 'rcmfd_sievevacsubject_orig_' . $rowid;
//.........这里部分代码省略.........
示例9: array
function gen_table($attrib)
{
$this->rcmail_inst->output->set_env('framed', true);
$out = '<fieldset><legend>' . $this->gettext('fetchmail_entries') . '</legend>' . "\n";
$fetch_table = new html_table(array('id' => 'fetch-table', 'class' => 'records-table', 'cellspacing' => '0', 'cols' => 3));
$fetch_table->add_header("", $this->gettext('fetchmailserver'));
$fetch_table->add_header(array('width' => '20px'), '');
$fetch_table->add_header(array('width' => '16px'), '');
try {
$session_id = $this->soap->login($this->rcmail_inst->config->get('remote_soap_user'), $this->rcmail_inst->config->get('remote_soap_pass'));
$mail_user = $this->soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username']));
$fetchmail = $this->soap->mail_fetchmail_get($session_id, array('destination' => $mail_user[0]['email']));
$this->soap->logout($session_id);
for ($i = 0; $i < count($fetchmail); $i++) {
$class = $class == 'odd' ? 'even' : 'odd';
if ($fetchmail[$i]['mailget_id'] == rcube_utils::get_input_value('_id', RCUBE_INPUT_GET)) {
$class = 'selected';
}
$fetch_table->set_row_attribs(array('class' => $class, 'id' => 'fetch_' . $fetchmail[$i]['mailget_id']));
$this->_fetch_row($fetch_table, $fetchmail[$i]['source_username'] . '@' . $fetchmail[$i]['source_server'], $fetchmail[$i]['active'], $fetchmail[$i]['mailget_id'], $attrib);
}
} catch (SoapFault $e) {
$this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error');
}
if (count($fetchmail) == 0) {
$fetch_table->add(array('colspan' => '3'), rcube_utils::rep_specialchars_output($this->gettext('nofetch')));
$fetch_table->set_row_attribs(array('class' => 'odd'));
$fetch_table->add_row();
}
$out .= "<div id=\"fetch-cont\">" . $fetch_table->show() . "</div>\n";
$out .= "</fieldset>\n";
return $out;
}
示例10: _action_row
//.........这里部分代码省略.........
$display['vachandle'] = $this->show_vachandle ? '' : 'display: none;';
}
} elseif ($action['type'] == 'redirect' || $action['type'] == 'redirect_copy') {
$defaults['method'] = $action['type'];
$defaults['address'] = $action['target'];
} elseif ($action['type'] == 'imapflags' || $action['type'] == 'imap4flags') {
$defaults['method'] = $action['type'];
$defaults['flags'] = $action['target'];
} elseif ($action['type'] == 'notify' || $action['type'] == 'enotify') {
$defaults['method'] = $action['type'];
$defaults['nfrom'] = $action['from'];
$defaults['nimpt'] = $action['importance'];
$defaults['nmethod'] = $action['method'];
$defaults['noptions'] = $action['options'];
$defaults['nmsg'] = $action['msg'];
// check advanced enabled
if (!empty($defaults['nfrom']) || !empty($defaults['nimpt'])) {
$display['noteadv'] = '';
}
} elseif ($action['type'] == 'editheaderadd' || $action['type'] == 'editheaderrem') {
$defaults['method'] = $action['type'];
$defaults['headername'] = $action['name'];
$defaults['headerval'] = $action['value'];
$defaults['headerindex'] = $action['index'];
$defaults['headerop'] = $action['operator'];
if ($action['type'] == 'editheaderrem' && (!empty($defaults['headerindex']) || !empty($defaults['headerval']))) {
$display['eheadadv'] = '';
}
} elseif ($action['type'] == 'discard' || $action['type'] == 'keep' || $action['type'] == 'stop') {
$defaults['method'] = $action['type'];
}
// hide the "template" row
if (!isset($action)) {
$actions_table->set_row_attribs(array('style' => 'display: none;'));
}
// action type select box
$select_action = new html_select(array('name' => "_act[]", 'onchange' => rcmail_output::JS_OBJECT_NAME . '.sieverules_action_select(this)'));
foreach ($allowed_actions as $value => $text) {
$select_action->add($text, $value);
}
// add action type to UI
$actions_table->add('action', $select_action->show($defaults['method']));
// begin vacation action
$vacs_table = new html_table(array('class' => 'records-table', 'cellspacing' => '0', 'cols' => 3, 'style' => $defaults['method'] == 'vacation' ? '' : 'display: none;'));
$to_addresses = "";
$vacto_arr = explode(",", $defaults['vacto']);
$field_id_vacfrom = 'rcmfd_sievevacfrom_' . $rowid;
$field_id_vacto = 'rcmfd_sievevacto_' . $rowid;
if (count($this->identities)) {
$select_id = new html_select(array('id' => $field_id_vacfrom, 'name' => "_vacfrom[]", 'class' => 'short', 'onchange' => rcmail_output::JS_OBJECT_NAME . '.enable_sig(this);'));
if ($this->show_vacfrom && in_array('variables', $ext)) {
$select_id->add($this->gettext('autodetect'), "auto");
} elseif (!$this->show_vacfrom) {
$select_id->add($this->gettext('autodetect'), "");
}
foreach ($this->identities as $sql_arr) {
// find currently selected from address
if ($defaults['vacfrom'] != '' && $defaults['vacfrom'] == rcmail::Q($sql_arr['from']['string'])) {
$defaults['vacfrom'] = $sql_arr['identity_id'];
} elseif ($defaults['vacfrom'] != '' && $defaults['vacfrom'] == $sql_arr['from']['mailto']) {
$defaults['vacfrom'] = $sql_arr['identity_id'];
}
$select_id->add($sql_arr['from']['disp_string'], $sql_arr['identity_id']);
$ffield_id = 'rcmfd_vac_' . $rowid . '_' . $sql_arr['identity_id'];
if ($this->force_vacto) {
$curaddress = $sql_arr['email'];
示例11: _action_row
private function _action_row($ext, $actions_table, $rowid, $action, $attrib, $example)
{
$rcmail = rcmail::get_instance();
static $a_mailboxes;
$imgclass = null;
if (!isset($action)) {
$actions_table->set_row_attribs(array('style' => 'display: none;'));
$imgclass = 'nohtc';
}
$help_icon = html::img(array('src' => $attrib['helpicon'], 'alt' => $this->gettext('messagehelp'), 'border' => 0));
$vacadvstyle = $action['type'] != 'vacation' && $this->force_vacto ? '' : 'display: none;';
$vacadvstyle_from = $this->show_vacfrom ? $vacadvstyle : 'display: none;';
$vacadvstyle_handle = $this->show_vachandle ? $vacadvstyle : 'display: none;';
$vacadvclass_from = $this->show_vacfrom ? 'advanced' : 'disabled';
$vacadvclass_handle = $this->show_vachandle ? 'advanced' : 'disabled';
$vacshowadv = $action['type'] != 'vacation' && $this->force_vacto ? '1' : '';
$noteadvstyle = 'display: none;';
$noteshowadv = '';
// setup allowed actions
$allowed_actions = array();
$config_actions = $rcmail->config->get('sieverules_allowed_actions', array());
if (in_array('fileinto', $ext) && ($config_actions['fileinto'] || $action['type'] == 'fileinto')) {
$allowed_actions['fileinto'] = $this->gettext('messagemoveto');
}
if (in_array('fileinto', $ext) && in_array('copy', $ext) && ($config_actions['fileinto'] || $action['type'] == 'fileinto')) {
$allowed_actions['fileinto_copy'] = $this->gettext('messagecopyto');
}
if (in_array('vacation', $ext) && ($config_actions['vacation'] || $action['type'] == 'vacation')) {
$allowed_actions['vacation'] = $this->gettext('messagevacation');
}
if (in_array('reject', $ext) && ($config_actions['reject'] || $action['type'] == 'reject')) {
$allowed_actions['reject'] = $this->gettext('messagereject');
} elseif (in_array('ereject', $ext) && ($config_actions['reject'] || $action['type'] == 'ereject')) {
$allowed_actions['ereject'] = $this->gettext('messagereject');
}
if (in_array('imapflags', $ext) && ($config_actions['imapflags'] || $action['type'] == 'imapflags')) {
$allowed_actions['imapflags'] = $this->gettext('messageimapflags');
} elseif (in_array('imap4flags', $ext) && ($config_actions['imapflags'] || $action['type'] == 'imap4flags')) {
$allowed_actions['imap4flags'] = $this->gettext('messageimapflags');
}
if (in_array('notify', $ext) && ($config_actions['notify'] || $action['type'] == 'notify')) {
$allowed_actions['notify'] = $this->gettext('messagenotify');
} elseif (in_array('enotify', $ext) && ($config_actions['notify'] || $action['type'] == 'enotify')) {
$allowed_actions['enotify'] = $this->gettext('messagenotify');
}
if ($config_actions['redirect'] || $action['type'] == 'redirect') {
$allowed_actions['redirect'] = $this->gettext('messageredirect');
}
if (in_array('copy', $ext) && ($config_actions['redirect'] || $action['type'] == 'redirect_copy')) {
$allowed_actions['redirect_copy'] = $this->gettext('messageredirectcopy');
}
if ($config_actions['keep'] || $action['type'] == 'keep') {
$allowed_actions['keep'] = $this->gettext('messagekeep');
}
if ($config_actions['discard'] || $action['type'] == 'discard') {
$allowed_actions['discard'] = $this->gettext('messagediscard');
}
if ($config_actions['stop'] || $action['type'] == 'stop') {
$allowed_actions['stop'] = $this->gettext('messagestop');
}
// set the default action
reset($allowed_actions);
$method = key($allowed_actions);
$folder = 'INBOX';
$reject = '';
$identity = $rcmail->user->get_identity();
if ($this->show_vacfrom) {
$vacfrom = in_array('variables', $ext) ? 'auto' : $identity['email'];
} else {
$vacfrom = null;
}
$vacto = null;
$address = '';
$days = '';
$handle = '';
$subject = '';
$origsubject = '';
$msg = '';
$charset = RCMAIL_CHARSET;
$flags = '';
$nfrom = '';
$nimpt = '';
$nmethod = '';
$noptions = '';
$nmsg = '';
if ($action['type'] == 'fileinto' || $action['type'] == 'fileinto_copy') {
$method = $action['type'];
$folder = $rcmail->config->get('sieverules_include_imap_root', true) ? $action['target'] : $rcmail->imap->mod_mailbox($action['target']);
if ($rcmail->config->get('sieverules_folder_delimiter', false)) {
$folder = str_replace($rcmail->imap->get_hierarchy_delimiter(), $rcmail->config->get('sieverules_folder_delimiter'), $folder);
}
} elseif ($action['type'] == 'reject' || $action['type'] == 'ereject') {
$method = $action['type'];
$reject = htmlspecialchars($action['target']);
} elseif ($action['type'] == 'vacation') {
$method = 'vacation';
$days = $action['days'];
$vacfrom_default = $vacfrom;
$vacfrom = $action['from'];
$vacto = $action['addresses'];
//.........这里部分代码省略.........
示例12: foreach
/**
* Generate the html of the account lists
* @param type $attrib
* @return type
*/
function show_accounts_list($attrib)
{
$table = new html_table(array('id' => 'fetchmail-rc-table', 'class' => 'records-table', 'cellspacing' => '0', 'cols' => 1));
$table->add_header(array('colspan' => 2), $this->gettext('accounts'));
$accounts_list = $this->accounts_get_sorted_list();
if (count($accounts_list) == 0) {
$table->add(array('colspan' => '2'), rep_specialchars_output($this->gettext('noaccounts')));
} else {
foreach ($accounts_list as $account) {
$idx = $account['fetchmail_rc_id'];
$table->set_row_attribs(array('id' => 'rcmrow' . $idx));
if ($account['mail_enabled'] == 0) {
$table->add(null, Q($account['mail_host']) . ' (' . $this->gettext('disabled') . ')');
} else {
$table->add(null, Q($account['mail_host']) . ($account['count_error'] > 0 ? ' (' . $this->gettext('short_mail_error') . ')' : ''));
}
}
}
return html::tag('div', array('id' => 'fetchmail_rc-list-filters'), $table->show($attrib));
}