本文整理汇总了PHP中html_table::add方法的典型用法代码示例。如果您正苦于以下问题:PHP html_table::add方法的具体用法?PHP html_table::add怎么用?PHP html_table::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html_table
的用法示例。
在下文中一共展示了html_table::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: intval
/**
* Callback function when HTML page is rendered
* We'll add an overlay box here.
*/
function render_page($p)
{
if ($_SESSION['plugin.newuserdialog'] && $p['template'] == 'mail') {
$this->add_texts('localization');
$rcmail = rcmail::get_instance();
$identity = $rcmail->user->get_identity();
$identities_level = intval($rcmail->config->get('identities_level', 0));
// compose user-identity dialog
$table = new html_table(array('cols' => 2));
$table->add('title', $this->gettext('name'));
$table->add(null, html::tag('input', array('type' => 'text', 'name' => '_name', 'value' => $identity['name'], 'disabled' => $identities_level == 4)));
$table->add('title', $this->gettext('email'));
$table->add(null, html::tag('input', array('type' => 'text', 'name' => '_email', 'value' => rcube_utils::idn_to_utf8($identity['email']), 'disabled' => in_array($identities_level, array(1, 3, 4)))));
$table->add('title', $this->gettext('organization'));
$table->add(null, html::tag('input', array('type' => 'text', 'name' => '_organization', 'value' => $identity['organization'], 'disabled' => $identities_level == 4)));
$table->add('title', $this->gettext('signature'));
$table->add(null, html::tag('textarea', array('name' => '_signature', 'rows' => '3'), $identity['signature']));
// add overlay input box to html page
$rcmail->output->add_footer(html::tag('form', array('id' => 'newuserdialog', 'action' => $rcmail->url('plugin.newusersave'), 'method' => 'post'), html::p('hint', rcube::Q($this->gettext('identitydialoghint'))) . $table->show() . html::p(array('class' => 'formbuttons'), html::tag('input', array('type' => 'submit', 'class' => 'button mainaction', 'value' => $this->gettext('save'))))));
$title = rcube::JQ($this->gettext('identitydialogtitle'));
$script = "\n\$('#newuserdialog').show()\n .dialog({modal:true, resizable:false, closeOnEscape:false, width:450, title:'{$title}'})\n .submit(function() {\n var i, request = {}, form = \$(this).serializeArray();\n for (i in form)\n request[form[i].name] = form[i].value;\n\n rcmail.http_post('plugin.newusersave', request, true);\n return false;\n });\n\n\$('input[name=_name]').focus();\nrcube_webmail.prototype.new_user_dialog_close = function() { \$('#newuserdialog').dialog('close'); }\n";
// disable keyboard events for messages list (#1486726)
$rcmail->output->add_script($script, 'docready');
$this->include_stylesheet('newuserdialog.css');
}
}
示例2: 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);
}
示例3: intval
/**
* Callback function when HTML page is rendered
* We'll add an overlay box here.
*/
function render_page($p)
{
if ($_SESSION['plugin.newuserdialog']) {
$this->add_texts('localization');
$rcmail = rcmail::get_instance();
$identity = $rcmail->user->get_identity();
$identities_level = intval($rcmail->config->get('identities_level', 0));
// compose user-identity dialog
$table = new html_table(array('cols' => 2));
$table->add('title', $this->gettext('name'));
$table->add(null, html::tag('input', array('type' => "text", 'name' => "_name", 'value' => $identity['name'])));
$table->add('title', $this->gettext('email'));
$table->add(null, html::tag('input', array('type' => "text", 'name' => "_email", 'value' => $identity['email'], 'disabled' => $identities_level == 1 || $identities_level == 3)));
// add overlay input box to html page
$rcmail->output->add_footer(html::div(array('id' => "newuseroverlay"), html::tag('form', array('action' => $rcmail->url('plugin.newusersave'), 'method' => "post"), html::tag('h3', null, Q($this->gettext('identitydialogtitle'))) . html::p('hint', Q($this->gettext('identitydialoghint'))) . $table->show() . html::p(array('class' => "formbuttons"), html::tag('input', array('type' => "submit", 'class' => "button mainaction", 'value' => $this->gettext('save')))))));
$this->include_stylesheet('newuserdialog.css');
}
}
示例4: intval
/**
* Callback function when HTML page is rendered
* We'll add an overlay box here.
*/
function render_page($p)
{
if ($_SESSION['plugin.newuserdialog'] && $p['template'] == 'mail') {
$this->add_texts('localization');
$rcmail = rcmail::get_instance();
$identity = $rcmail->user->get_identity();
$identities_level = intval($rcmail->config->get('identities_level', 0));
// compose user-identity dialog
$table = new html_table(array('cols' => 2));
$table->add('title', $this->gettext('name'));
$table->add(null, html::tag('input', array('type' => 'text', 'name' => '_name', 'value' => $identity['name'])));
$table->add('title', $this->gettext('email'));
$table->add(null, html::tag('input', array('type' => 'text', 'name' => '_email', 'value' => idn_to_utf8($identity['email']), 'disabled' => $identities_level == 1 || $identities_level == 3)));
// add overlay input box to html page
$rcmail->output->add_footer(html::div(array('id' => 'newuseroverlay'), html::tag('form', array('action' => $rcmail->url('plugin.newusersave'), 'method' => 'post'), html::tag('h3', null, Q($this->gettext('identitydialogtitle'))) . html::p('hint', Q($this->gettext('identitydialoghint'))) . $table->show() . html::p(array('class' => 'formbuttons'), html::tag('input', array('type' => 'submit', 'class' => 'button mainaction', 'value' => $this->gettext('save')))))));
// disable keyboard events for messages list (#1486726)
$rcmail->output->add_script("\$(document).ready(function () {\n rcmail.message_list.key_press = function(){};\n rcmail.message_list.key_down = function(){};\n \$('input[name=_name]').focus();\n });", 'foot');
$this->include_stylesheet('newuserdialog.css');
}
}
示例5: array
function gen_form()
{
$user = $this->rcmail_inst->user->get_prefs();
$this->rcmail_inst->output->add_label('ispconfig3_forward.invalidaddress', 'ispconfig3_forward.forwardingempty');
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);
} catch (SoapFault $e) {
$this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error');
}
$this->rcmail_inst->output->set_env('framed', TRUE);
$out .= '<fieldset><legend>' . $this->gettext('acc_forward') . '</legend>' . "\n";
$table = new html_table(array('cols' => 2, 'class' => 'propform'));
$input_forwardingaddress = new html_inputfield(array('name' => '_forwardingaddress', 'id' => 'forwardingaddress', 'value' => $forward[1], 'maxlength' => 320, 'size' => 40));
$table->add('title', rep_specialchars_output($this->gettext('forwardingaddress')));
$table->add('', $input_forwardingaddress->show($mail_user[0]['cc']));
$out .= $table->show();
$out .= "</fieldset>\n";
return $out;
}
示例6: list
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;
}
示例7:
function gen_form()
{
$user = $this->rcmail_inst->user->get_prefs();
$this->rcmail_inst->output->add_label('ispconfig3_forward.invalidaddress', 'ispconfig3_forward.forwardingempty');
$this->rcmail_inst->output->set_env('framed', true);
$out .= '<fieldset><legend>' . $this->gettext('acc_forward') . '</legend>' . "\n";
$table = new html_table(array('cols' => 2, 'class' => 'propform'));
$input_forwardingaddress = new html_inputfield(array('name' => '_forwardingaddress', 'id' => 'forwardingaddress', 'value' => '', 'maxlength' => 320, 'size' => 40));
$table->add('title', rep_specialchars_output($this->gettext('forwardingaddress')));
$table->add('', $input_forwardingaddress->show());
$out .= $table->show();
$out .= "</fieldset>\n";
return $out;
}
示例8: intval
function password_form()
{
$rcmail = rcmail::get_instance();
// add some labels to client
$rcmail->output->add_label('password.nopassword', 'password.nocurpassword', 'password.passwordinconsistency');
$rcmail->output->set_env('product_name', $rcmail->config->get('product_name'));
$table = new html_table(array('cols' => 2));
if ($rcmail->config->get('password_confirm_current')) {
// show current password selection
$field_id = 'curpasswd';
$input_curpasswd = new html_passwordfield(array('name' => '_curpasswd', 'id' => $field_id, 'size' => 20, 'autocomplete' => 'off'));
$table->add('title', html::label($field_id, rcube::Q($this->gettext('curpasswd'))));
$table->add(null, $input_curpasswd->show());
}
// show new password selection
$field_id = 'newpasswd';
$input_newpasswd = new html_passwordfield(array('name' => '_newpasswd', 'id' => $field_id, 'size' => 20, 'autocomplete' => 'off'));
$table->add('title', html::label($field_id, rcube::Q($this->gettext('newpasswd'))));
$table->add(null, $input_newpasswd->show());
// show confirm password selection
$field_id = 'confpasswd';
$input_confpasswd = new html_passwordfield(array('name' => '_confpasswd', 'id' => $field_id, 'size' => 20, 'autocomplete' => 'off'));
$table->add('title', html::label($field_id, rcube::Q($this->gettext('confpasswd'))));
$table->add(null, $input_confpasswd->show());
$rules = '';
$required_length = intval($rcmail->config->get('password_minimum_length'));
if ($required_length > 0) {
$rules .= html::tag('li', array('id' => 'required-length'), $this->gettext(array('name' => 'passwordshort', 'vars' => array('length' => $required_length))));
}
if ($rcmail->config->get('password_require_nonalpha')) {
$rules .= html::tag('li', array('id' => 'require-nonalpha'), $this->gettext('passwordweak'));
}
if (!empty($rules)) {
$rules = html::tag('ul', array('id' => 'ruleslist'), $rules);
}
$out = html::div(array('class' => 'box'), html::div(array('id' => 'prefs-title', 'class' => 'boxtitle'), $this->gettext('changepasswd')) . html::div(array('class' => 'boxcontent'), $table->show() . $rules . html::p(null, $rcmail->output->button(array('command' => 'plugin.password-save', 'type' => 'input', 'class' => 'button mainaction', 'label' => 'save')))));
$rcmail->output->add_gui_object('passform', 'password-form');
return $rcmail->output->form_tag(array('id' => 'password-form', 'name' => 'password-form', 'method' => 'post', 'action' => './?_task=settings&_action=plugin.password-save'), $out);
}
示例9: login_form
/**
* GUI object 'loginform'
* Returns code for the webmail login form
*
* @param array Named parameters
* @return string HTML code for the gui object
*/
protected function login_form($attrib)
{
$default_host = $this->config->get('default_host');
$autocomplete = (int) $this->config->get('login_autocomplete');
$_SESSION['temp'] = true;
// save original url
$url = rcube_utils::get_input_value('_url', rcube_utils::INPUT_POST);
if (empty($url) && !preg_match('/_(task|action)=logout/', $_SERVER['QUERY_STRING'])) {
$url = $_SERVER['QUERY_STRING'];
}
// Disable autocapitalization on iPad/iPhone (#1488609)
$attrib['autocapitalize'] = 'off';
// set atocomplete attribute
$user_attrib = $autocomplete > 0 ? array() : array('autocomplete' => 'off');
$host_attrib = $autocomplete > 0 ? array() : array('autocomplete' => 'off');
$pass_attrib = $autocomplete > 1 ? array() : array('autocomplete' => 'off');
$input_task = new html_hiddenfield(array('name' => '_task', 'value' => 'login'));
$input_action = new html_hiddenfield(array('name' => '_action', 'value' => 'login'));
$input_tzone = new html_hiddenfield(array('name' => '_timezone', 'id' => 'rcmlogintz', 'value' => '_default_'));
$input_url = new html_hiddenfield(array('name' => '_url', 'id' => 'rcmloginurl', 'value' => $url));
$input_user = new html_inputfield(array('name' => '_user', 'id' => 'rcmloginuser', 'required' => 'required') + $attrib + $user_attrib);
$input_pass = new html_passwordfield(array('name' => '_pass', 'id' => 'rcmloginpwd', 'required' => 'required') + $attrib + $pass_attrib);
$input_host = null;
if (is_array($default_host) && count($default_host) > 1) {
$input_host = new html_select(array('name' => '_host', 'id' => 'rcmloginhost'));
foreach ($default_host as $key => $value) {
if (!is_array($value)) {
$input_host->add($value, is_numeric($key) ? $value : $key);
} else {
$input_host = null;
break;
}
}
} else {
if (is_array($default_host) && ($host = key($default_host)) !== null) {
$hide_host = true;
$input_host = new html_hiddenfield(array('name' => '_host', 'id' => 'rcmloginhost', 'value' => is_numeric($host) ? $default_host[$host] : $host) + $attrib);
} else {
if (empty($default_host)) {
$input_host = new html_inputfield(array('name' => '_host', 'id' => 'rcmloginhost') + $attrib + $host_attrib);
}
}
}
$form_name = !empty($attrib['form']) ? $attrib['form'] : 'form';
$this->add_gui_object('loginform', $form_name);
// create HTML table with two cols
$table = new html_table(array('cols' => 2));
$table->add('title', html::label('rcmloginuser', html::quote($this->app->gettext('username'))));
$table->add('input', $input_user->show('mail@box'));
$table->add('title', html::label('rcmloginpwd', html::quote($this->app->gettext('password'))));
$table->add('input', $input_pass->show());
// add host selection row
if (is_object($input_host) && !$hide_host) {
$table->add('title', html::label('rcmloginhost', html::quote($this->app->gettext('server'))));
$table->add('input', $input_host->show(rcube_utils::get_input_value('_host', rcube_utils::INPUT_GPC)));
}
$out = $input_task->show();
$out .= $input_action->show();
$out .= $input_tzone->show();
$out .= $input_url->show();
$out .= $table->show();
if ($hide_host) {
$out .= $input_host->show();
}
if (rcube_utils::get_boolean($attrib['submit'])) {
$submit = new html_inputfield(array('type' => 'submit', 'id' => 'rcmloginsubmit', 'class' => 'button mainaction', 'value' => $this->app->gettext('login')));
$out .= html::p('formbuttons', $submit->show());
}
// surround html output with a form tag
if (empty($attrib['form'])) {
$out = $this->form_tag(array('name' => $form_name, 'method' => 'post'), $out);
}
// include script for timezone detection
$this->include_script('jstz.min.js');
return $out;
}
示例10: attachment_header
/**
*
*/
public function attachment_header($attrib = array())
{
$rcmail = rcmail::get_instance();
$dl_link = strtolower($attrib['downloadlink']) == 'true';
$dl_url = $this->rc->url(array('_frame' => null, '_download' => 1) + $_GET);
$table = new html_table(array('cols' => $dl_link ? 3 : 2));
if (!empty($this->attachment['name'])) {
$table->add('title', rcube::Q($this->rc->gettext('filename')));
$table->add('header', rcube::Q($this->attachment['name']));
if ($dl_link) {
$table->add('download-link', html::a($dl_url, rcube::Q($this->rc->gettext('download'))));
}
}
if (!empty($this->attachment['mimetype'])) {
$table->add('title', rcube::Q($this->rc->gettext('type')));
$table->add('header', rcube::Q($this->attachment['mimetype']));
}
if (!empty($this->attachment['size'])) {
$table->add('title', rcube::Q($this->rc->gettext('filesize')));
$table->add('header', rcube::Q($this->rc->show_bytes($this->attachment['size'])));
}
$this->rc->output->set_env('attachment_download_url', $dl_url);
return $table->show($attrib);
}
示例11: compose_ui
/**
* Init compose UI (add task button and the menu)
*/
private function compose_ui()
{
$this->add_css();
// Options menu button
$this->enigma->add_button(array('type' => 'link', 'command' => 'plugin.enigma', 'onclick' => "rcmail.command('menu-open', 'enigmamenu', event.target, event)", 'class' => 'button enigma', 'title' => 'encryptionoptions', 'label' => 'encryption', 'domain' => $this->enigma->ID, 'width' => 32, 'height' => 32), 'toolbar');
$menu = new html_table(array('cols' => 2));
$chbox = new html_checkbox(array('value' => 1));
$menu->add(null, html::label(array('for' => 'enigmasignopt'), rcube::Q($this->enigma->gettext('signmsg'))));
$menu->add(null, $chbox->show($this->rc->config->get('enigma_sign_all') ? 1 : 0, array('name' => '_enigma_sign', 'id' => 'enigmasignopt')));
$menu->add(null, html::label(array('for' => 'enigmaencryptopt'), rcube::Q($this->enigma->gettext('encryptmsg'))));
$menu->add(null, $chbox->show($this->rc->config->get('enigma_encrypt_all') ? 1 : 0, array('name' => '_enigma_encrypt', 'id' => 'enigmaencryptopt')));
$menu = html::div(array('id' => 'enigmamenu', 'class' => 'popupmenu'), $menu->show());
// Options menu contents
$this->rc->output->add_footer($menu);
}
示例12: table_output
/**
* Create a HTML table based on the given data
*
* @param array Named table attributes
* @param mixed Table row data. Either a two-dimensional array or a valid SQL result set
* @param array List of cols to show
* @param string Name of the identifier col
*
* @return string HTML table code
*/
public function table_output($attrib, $table_data, $a_show_cols, $id_col)
{
$table = new html_table();
// add table header
if (!$attrib['noheader']) {
foreach ($a_show_cols as $col) {
$table->add_header($col, $this->Q($this->gettext($col)));
}
}
if (!is_array($table_data)) {
$db = $this->get_dbh();
while ($table_data && ($sql_arr = $db->fetch_assoc($table_data))) {
$table->add_row(array('id' => 'rcmrow' . rcube_utils::html_identifier($sql_arr[$id_col])));
// format each col
foreach ($a_show_cols as $col) {
$table->add($col, $this->Q($sql_arr[$col]));
}
}
} else {
foreach ($table_data as $row_data) {
$class = !empty($row_data['class']) ? $row_data['class'] : '';
$rowid = 'rcmrow' . rcube_utils::html_identifier($row_data[$id_col]);
$table->add_row(array('id' => $rowid, 'class' => $class));
// format each col
foreach ($a_show_cols as $col) {
$table->add($col, $this->Q(is_array($row_data[$col]) ? $row_data[$col][0] : $row_data[$col]));
}
}
}
return $table->show($attrib);
}
示例13: Q
/**
* Render event details in a table
*/
function event_details_table($event, $title)
{
$table = new html_table(array('cols' => 2, 'border' => 0, 'class' => 'calendar-eventdetails'));
$table->add('ititle', $title);
$table->add('title', Q($event['title']));
$table->add('label', $this->cal->gettext('date'));
$table->add('location', Q($this->cal->lib->event_date_text($event)));
if ($event['location']) {
$table->add('label', $this->cal->gettext('location'));
$table->add('location', Q($event['location']));
}
return $table->show();
}
示例14: _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;
//.........这里部分代码省略.........
示例15: sprintf
function veximaccountadmin_form()
{
$rcmail = rcmail::get_instance();
$this->_load_config();
// add labels to client - to be used in JS alerts
$rcmail->output->add_label('veximaccountadmin.enterallpassfields', 'veximaccountadmin.passwordinconsistency', 'veximaccountadmin.autoresponderlong', 'veximaccountadmin.autoresponderlongnum', 'veximaccountadmin.autoresponderlongmax', 'veximaccountadmin.headerblockdelete', 'veximaccountadmin.headerblockdeleteall', 'veximaccountadmin.headerblockexists', 'veximaccountadmin.headerblockentervalue');
$rcmail->output->set_env('product_name', $rcmail->config->get('product_name'));
$settings = $this->_get_configuration();
$on_avscan = $settings['on_avscan'];
$on_spamassassin = $settings['on_spamassassin'];
$sa_tag = $settings['sa_tag'];
$sa_refuse = $settings['sa_refuse'];
$spam_drop = $settings['spam_drop'];
$on_vacation = $settings['on_vacation'];
$vacation = $settings['vacation'];
$on_forward = $settings['on_forward'];
$forward = $settings['forward'];
$unseen = $settings['unseen'];
$maxmsgsize = $settings['maxmsgsize'];
$user_id = $settings['user_id'];
$domain_id = $settings['domain_id'];
$domain_settings = $this->_get_domain_configuration($domain_id);
$default_sa_tag = $domain_settings['sa_tag'];
$default_sa_refuse = $domain_settings['sa_refuse'];
$default_maxmsgsize = $domain_settings['maxmsgsize'];
$active_domain = $domain_settings['domain'];
$rcmail->output->set_env('vacation_maxlength', $this->config['vexim_vacation_maxlength']);
$out .= '<p class="introtext">' . $this->gettext('introtext') . '</p>' . "\n";
if ($this->config['show_admin_link'] == true and $settings['admin'] == true) {
$out .= '<p class="adminlink">';
$out .= sprintf($this->gettext('adminlinktext'), '<a href="' . $this->config['vexim_url'] . '" target="_blank">', '</a>');
$out .= "</p>\n";
}
// =====================================================================================================
// Password
$out .= '<fieldset><legend>' . $this->gettext('password') . '</legend>' . "\n";
$out .= '<div class="fieldset-content">';
$out .= '<p>' . $this->gettext('passwordcurrentexplanation') . '</p>';
$out .= '<table class="vexim-settings" cellpadding="0" cellspacing="0">';
$field_id = 'curpasswd';
$input_passwordcurrent = new html_passwordfield(array('name' => '_curpasswd', 'id' => $field_id, 'class' => 'text-long', 'autocomplete' => 'off'));
$out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('passwordcurrent')), $input_passwordcurrent->show(), '');
$field_id = 'newpasswd';
$input_passwordnew = new html_passwordfield(array('name' => '_newpasswd', 'id' => $field_id, 'class' => 'text-long', 'autocomplete' => 'off'));
$out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('passwordnew')), $input_passwordnew->show(), '');
$field_id = 'confpasswd';
$input_passwordconf = new html_passwordfield(array('name' => '_confpasswd', 'id' => $field_id, 'class' => 'text-long', 'autocomplete' => 'off'));
$out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('passwordconfirm')), $input_passwordconf->show(), '');
$out .= '</table>';
$out .= '</div></fieldset>' . "\n\n";
// =====================================================================================================
// Spam/Virus
$out .= '<fieldset><legend>' . $this->gettext('spamvirus') . '</legend>' . "\n";
$out .= '<div class="fieldset-content">';
$out .= '<table class="vexim-settings" cellpadding="0" cellspacing="0">';
$field_id = 'on_avscan';
$input_virusenabled = new html_checkbox(array('name' => 'on_avscan', 'id' => $field_id, 'value' => 1));
$out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('virusenabled')), $input_virusenabled->show($on_avscan ? 1 : 0), '<br /><span class="vexim-explanation">' . $this->gettext('virusenabledexplanation') . '</span>');
$field_id = 'on_spamassassin';
$input_spamenabled = new html_checkbox(array('name' => 'on_spamassassin', 'id' => $field_id, 'value' => 1));
$out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('spamenabled')), $input_spamenabled->show($on_spamassassin ? 1 : 0), '<br /><span class="vexim-explanation">' . $this->gettext('spamenabledexplanation') . '</span>');
$field_id = 'sa_tag';
$input_spamscoretag = new html_select(array('name' => 'sa_tag', 'id' => $field_id, 'class' => 'select'));
$decPlaces = 0;
$found_number = false;
for ($i = 1; $i <= 20; $i = $i + 1) {
$i = number_format($i, $decPlaces);
$input_spamscoretag->add($i, $i);
if ($sa_tag == $i) {
$found_number = true;
}
}
for ($i = 25; $i <= 100; $i = $i + 5) {
$i = number_format($i, $decPlaces);
$input_spamscoretag->add($i, $i);
if ($sa_tag == $i) {
$found_number = true;
}
}
// If the value from database cannot be choosed among the list we present,
// add it to the end of the list. This may happen because Vexim lets the
// user write in a number in a textbox.
if (!$found_number) {
$input_spamscoretag->add($sa_tag, $sa_tag);
}
$out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('spamscoretag')), $input_spamscoretag->show($sa_tag), '<br /><span class="vexim-explanation">' . $this->gettext('spamscoretagexplanation') . '. <span class="sameline">' . $this->gettext('domaindefault') . ': ' . $default_sa_tag . '.</span></span>');
$field_id = 'sa_refuse';
$input_spamscorerefuse = new html_select(array('name' => 'sa_refuse', 'id' => $field_id, 'class' => 'select'));
$found_number = false;
for ($i = 1; $i <= 20; $i = $i + 1) {
$i = number_format($i, $decPlaces);
$input_spamscorerefuse->add($i, $i);
if ($sa_refuse == $i) {
$found_number = true;
}
}
for ($i = 25; $i <= 200; $i = $i + 5) {
$i = number_format($i, $decPlaces);
$input_spamscorerefuse->add($i, $i);
if ($sa_refuse == $i) {
//.........这里部分代码省略.........