当前位置: 首页>>代码示例>>PHP>>正文


PHP html_table::add_header方法代码示例

本文整理汇总了PHP中html_table::add_header方法的典型用法代码示例。如果您正苦于以下问题:PHP html_table::add_header方法的具体用法?PHP html_table::add_header怎么用?PHP html_table::add_header使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在html_table的用法示例。


在下文中一共展示了html_table::add_header方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: list_rights

 /**
  * Creates ACL rights table
  *
  * @param array $attrib Template object attributes
  *
  * @return string HTML Content
  */
 private function list_rights($attrib = array())
 {
     // Get ACL for the folder
     $acl = $this->rc->storage->get_acl($this->mbox);
     if (!is_array($acl)) {
         $acl = array();
     }
     // Keep special entries (anyone/anonymous) on top of the list
     if (!empty($this->specials) && !empty($acl)) {
         foreach ($this->specials as $key) {
             if (isset($acl[$key])) {
                 $acl_special[$key] = $acl[$key];
                 unset($acl[$key]);
             }
         }
     }
     // Sort the list by username
     uksort($acl, 'strnatcasecmp');
     if (!empty($acl_special)) {
         $acl = array_merge($acl_special, $acl);
     }
     // Get supported rights and build column names
     $supported = $this->rights_supported();
     // depending on server capability either use 'te' or 'd' for deleting msgs
     $deleteright = implode(array_intersect(str_split('ted'), $supported));
     // Use advanced or simple (grouped) rights
     $advanced = $this->rc->config->get('acl_advanced_mode');
     if ($advanced) {
         $items = array();
         foreach ($supported as $sup) {
             $items[$sup] = $sup;
         }
     } else {
         $items = array('read' => 'lrs', 'write' => 'wi', 'delete' => $deleteright, 'other' => preg_replace('/[lrswi' . $deleteright . ']/', '', implode($supported)));
     }
     // Create the table
     $attrib['noheader'] = true;
     $table = new html_table($attrib);
     // Create table header
     $table->add_header('user', $this->gettext('identifier'));
     foreach (array_keys($items) as $key) {
         $label = $this->gettext('shortacl' . $key);
         $table->add_header(array('class' => 'acl' . $key, 'title' => $label), $label);
     }
     $js_table = array();
     foreach ($acl as $user => $rights) {
         if ($this->rc->storage->conn->user == $user) {
             continue;
         }
         // filter out virtual rights (c or d) the server may return
         $userrights = array_intersect($rights, $supported);
         $userid = rcube_utils::html_identifier($user);
         if (!empty($this->specials) && in_array($user, $this->specials)) {
             $user = $this->gettext($user);
         }
         $table->add_row(array('id' => 'rcmrow' . $userid));
         $table->add('user', rcube::Q($user));
         foreach ($items as $key => $right) {
             $in = $this->acl_compare($userrights, $right);
             switch ($in) {
                 case 2:
                     $class = 'enabled';
                     break;
                 case 1:
                     $class = 'partial';
                     break;
                 default:
                     $class = 'disabled';
                     break;
             }
             $table->add('acl' . $key . ' ' . $class, '');
         }
         $js_table[$userid] = implode($userrights);
     }
     $this->rc->output->set_env('acl', $js_table);
     $this->rc->output->set_env('acl_advanced', $advanced);
     $out = $table->show();
     return $out;
 }
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:86,代码来源:acl.php

示例2: 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;
 }
开发者ID:jdsn,项目名称:w2c--ispconfig3_roundcube,代码行数:35,代码来源:ispconfig3_spam.php

示例3: 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);
 }
开发者ID:npk,项目名称:roundcubemail,代码行数:41,代码来源:rcmail.php

示例4: array

 /**
  * Table oultine for event changelog display
  */
 function event_changelog_table($attrib = array())
 {
     $table = new html_table(array('cols' => 5, 'border' => 0, 'cellspacing' => 0));
     $table->add_header('diff', '');
     $table->add_header('revision', $this->cal->gettext('revision'));
     $table->add_header('date', $this->cal->gettext('date'));
     $table->add_header('user', $this->cal->gettext('user'));
     $table->add_header('operation', $this->cal->gettext('operation'));
     $table->add_header('actions', '&nbsp;');
     return $table->show($attrib);
 }
开发者ID:elurofilico,项目名称:i-MSCP-plugins,代码行数:14,代码来源:calendar_ui.php

示例5: 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;
 }
开发者ID:jdsn,项目名称:w2c--ispconfig3_roundcube,代码行数:33,代码来源:ispconfig3_forward.php

示例6: AmavisQuarantine

 function quarantine_display($ajax = false)
 {
     $ajax = $ajax === true ? true : false;
     // Include quarantine class
     include_once 'AmavisQuarantine.php';
     $this->amacube->quarantine = new AmavisQuarantine($this->rc->config->get('amacube_db_dsn'), $this->rc->config->get('amacube_amavis_host'), $this->rc->config->get('amacube_amavis_port'));
     // Parse form
     if (get_input_value('_token', RCUBE_INPUT_POST, false)) {
         $this->quarantine_post();
     }
     $pagination = array();
     if (!$ajax) {
         $output = '';
         // Get all quarantines (0:0)
         // Used to calculate pagination based on total amount of quarantined messages
         $pagination['start'] = 0;
         $pagination['size'] = 0;
     } else {
         $output = array();
         // Get paged quarantines
         $pagination['current'] = get_input_value('page', RCUBE_INPUT_POST, false) ?: 1;
         $pagination['total'] = get_input_value('msgcount', RCUBE_INPUT_POST, false);
         if (!$pagination['current'] || !$pagination['total']) {
             return;
         }
         $pagination['current'] = (int) $pagination['current'];
         $pagination['total'] = (int) $pagination['total'];
         $pagination['size'] = $this->rc->config->get('mail_pagesize');
         $pagination['count'] = ceil($pagination['total'] / $pagination['size']);
         $pagination['start'] = $pagination['current'] * $pagination['size'] - $pagination['size'];
         $pagination['stop'] = $pagination['start'] + $pagination['size'];
     }
     $quarantines = $this->amacube->quarantine->list_quarantines($pagination['start'], $pagination['size']);
     if (!is_array($quarantines)) {
         // Send feedback
         $this->feedback();
         // Return on error
         return;
     }
     if (count($quarantines) == 0) {
         $this->amacube->feedback[] = array('type' => 'notice', 'message' => 'quarantine_no_result');
     }
     if (!$ajax) {
         $pagination['current'] = 1;
         $pagination['size'] = $this->rc->config->get('mail_pagesize');
         $pagination['count'] = ceil(count($quarantines) / $pagination['size']);
         $pagination['start'] = $pagination['current'] * $pagination['size'] - $pagination['size'];
         $pagination['stop'] = $pagination['start'] + $pagination['size'];
         $pagination['total'] = count($quarantines);
     }
     // Pagination string
     $pagination['begin'] = $pagination['start'] + 1;
     $pagination['end'] = $pagination['total'] <= $pagination['size'] ? $pagination['total'] : ($pagination['stop'] > $pagination['total'] ? $pagination['total'] : $pagination['stop']);
     if (count($quarantines) == 0) {
         $string = Q($this->gettext('quarantine_no_result'));
     } else {
         $string = Q($this->gettext('messages')) . ' ' . $pagination['begin'] . ' ' . Q($this->gettext('to')) . ' ' . $pagination['end'] . ' ' . Q($this->gettext('of')) . ' ' . $pagination['total'];
     }
     if (!$ajax) {
         // Store locally for template use (js include not loaded yet; command unavailable)
         $this->rc->amacube->pagecount_string = $string;
     } else {
         $this->rc->output->command('amacube.messagecount', $string);
     }
     // Pagination env
     $this->rc->output->set_env('page', $pagination['current']);
     $this->rc->output->set_env('pagecount', $pagination['count']);
     $this->rc->output->set_env('msgcount', $pagination['total']);
     // Create output
     if (!$ajax) {
         // Create output : header table
         $messages_table = new html_table(array('cols' => 7, 'id' => 'messagelist', 'class' => 'records-table messagelist sortheader fixedheader quarantine-messagelist'));
         // Create output : table : headers
         $messages_table->add_header('release', Q($this->gettext('release')));
         $messages_table->add_header('delete', Q($this->gettext('delete')));
         $messages_table->add_header('received', Q($this->gettext('received')));
         $messages_table->add_header('subject', Q($this->gettext('subject')));
         $messages_table->add_header('sender', Q($this->gettext('sender')));
         $messages_table->add_header('type', Q($this->gettext('mailtype')));
         $messages_table->add_header('level', Q($this->gettext('spamlevel')));
     }
     // Create output : table : rows
     foreach ($quarantines as $key => $value) {
         if (!$ajax) {
             if ($key >= $pagination['start'] && $key < $pagination['stop']) {
                 $messages_table->add('release', $this->_show_radio('rel_' . $quarantines[$key]['id'], $quarantines[$key]['id'], '_rel_' . $quarantines[$key]['id']));
                 $messages_table->add('delete', $this->_show_radio('del_' . $quarantines[$key]['id'], $quarantines[$key]['id'], '_del_' . $quarantines[$key]['id']));
                 $messages_table->add('date', Q(date('Y-m-d H:i:s', $quarantines[$key]['received'])));
                 $messages_table->add('subject', Q($quarantines[$key]['subject']));
                 $messages_table->add('sender', Q($quarantines[$key]['sender']));
                 $messages_table->add('type', Q($this->gettext('content_decode_' . $quarantines[$key]['content'])));
                 $messages_table->add('level', Q($quarantines[$key]['level']));
             }
         } else {
             $string = '<tr>';
             $string .= '<td class="release">' . $this->_show_radio('rel_' . $quarantines[$key]['id'], $quarantines[$key]['id'], '_rel_' . $quarantines[$key]['id']) . '</td>';
             $string .= '<td class="delete">' . $this->_show_radio('del_' . $quarantines[$key]['id'], $quarantines[$key]['id'], '_del_' . $quarantines[$key]['id']) . '</td>';
             $string .= '<td class="date">' . Q(date('Y-m-d H:i:s', $quarantines[$key]['received'])) . '</td>';
             $string .= '<td class="subject">' . Q($quarantines[$key]['subject']) . '</td>';
             $string .= '<td class="sender">' . Q($quarantines[$key]['sender']) . '</td>';
//.........这里部分代码省略.........
开发者ID:zeroserieux,项目名称:amacube,代码行数:101,代码来源:amacube.php

示例7: 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;
 }
开发者ID:rickygestalt,项目名称:ispconfig3_roundcube,代码行数:39,代码来源:ispconfig3_account.php

示例8: array

 /**
  *
  */
 function attendees_list($attrib = array())
 {
     $table = new html_table(array('cols' => 5, 'border' => 0, 'cellpadding' => 0, 'class' => 'rectable'));
     $table->add_header('role', $this->cal->gettext('role'));
     $table->add_header('name', $this->cal->gettext('attendee'));
     $table->add_header('availability', $this->cal->gettext('availability'));
     $table->add_header('confirmstate', $this->cal->gettext('confirmstate'));
     $table->add_header('options', '');
     return $table->show($attrib);
 }
开发者ID:MetallianFR68,项目名称:myroundcube,代码行数:13,代码来源:calendar_ui.php

示例9: 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;
 }
开发者ID:ircf,项目名称:roundcubemail,代码行数:37,代码来源:ispconfig3_wblist.php

示例10: sprintf


//.........这里部分代码省略.........
     // Autoresponder
     $out .= '<fieldset><legend>' . $this->gettext('autoresponder') . '</legend>' . "\n";
     $out .= '<div class="fieldset-content">';
     $out .= '<table class="vexim-settings" cellpadding="0" cellspacing="0">';
     $field_id = 'on_vacation';
     $input_autoresponderenabled = new html_checkbox(array('name' => 'on_vacation', '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('autoresponderenabled')), $input_autoresponderenabled->show($on_vacation ? 1 : 0), '');
     $field_id = 'vacation';
     $input_autorespondermessage = new html_textarea(array('name' => 'vacation', 'id' => $field_id, 'class' => 'textarea'));
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('autorespondermessage')), $input_autorespondermessage->show($vacation), '<br /><span class="vexim-explanation">' . $this->gettext('autorespondermessageexplanation') . '</span>');
     $out .= '</table>';
     $out .= '</div></fieldset>' . "\n\n";
     // =====================================================================================================
     // Forward
     $out .= '<fieldset><legend>' . $this->gettext('forwarding') . '</legend>' . "\n";
     $out .= '<div class="fieldset-content">';
     $out .= '<table class="vexim-settings" cellpadding="0" cellspacing="0">';
     $field_id = 'on_forward';
     $input_forwardingenabled = new html_checkbox(array('name' => 'on_forward', 'id' => $field_id, 'value' => 1));
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('forwardingenabled')), $input_forwardingenabled->show($on_forward ? 1 : 0));
     $field_id = 'forward';
     $input_forwardingaddress = new html_inputfield(array('name' => 'forward', 'id' => $field_id, 'maxlength' => 255, 'class' => 'text-long'));
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('forwardingaddress')), $input_forwardingaddress->show($forward));
     $field_id = 'unseen';
     $input_forwardinglocal = new html_checkbox(array('name' => 'unseen', 'id' => $field_id, 'value' => 1));
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('forwardinglocal')), $input_forwardinglocal->show($unseen ? 1 : 0));
     $out .= '</table>';
     $out .= '</div></fieldset>' . "\n\n";
     // =====================================================================================================
     // Header blocks (based on code from Philip Weir's sauserprefs plugin
     //                http://roundcube.net/plugins/sauserprefs)
     $out .= '<fieldset><legend>' . $this->gettext('blockbyheader') . '</legend>' . "\n";
     $out .= '<div class="fieldset-content">';
     $out .= '<p>' . $this->gettext('blockbyheaderexplanation') . '</p>';
     $table = new html_table(array('class' => 'headerblockprefstable', 'cols' => 3));
     $field_id = 'rcmfd_headerblockrule';
     $input_headerblockrule = new html_select(array('name' => '_headerblockrule', 'id' => $field_id));
     $input_headerblockrule->add($this->gettext('headerfrom'), 'From');
     $input_headerblockrule->add($this->gettext('headerto'), 'To');
     $input_headerblockrule->add($this->gettext('headersubject'), 'Subject');
     $input_headerblockrule->add($this->gettext('headerxmailer'), 'X-Mailer');
     $field_id = 'rcmfd_headerblockvalue';
     $input_headerblockvalue = new html_inputfield(array('name' => '_headerblockvalue', 'id' => $field_id, 'style' => 'width:270px;'));
     $field_id = 'rcmbtn_add_address';
     $button_addaddress = $this->api->output->button(array('command' => 'plugin.veximaccountadmin.headerblock_add', 'type' => 'input', 'class' => 'button', 'label' => 'veximaccountadmin.addrule', 'style' => 'width: 130px;'));
     $table->add(null, $input_headerblockrule->show());
     $table->add(null, $input_headerblockvalue->show());
     $table->add(array('align' => 'right'), $button_addaddress);
     $delete_all = $this->api->output->button(array('command' => 'plugin.veximaccountadmin.headerblock_delete_all', 'type' => 'link', 'label' => 'veximaccountadmin.deleteall'));
     $table->add(array('colspan' => 3, 'id' => 'listcontrols'), $delete_all);
     $table->add_row();
     $address_table = new html_table(array('id' => 'headerblock-rules-table', 'class' => 'records-table', 'cellspacing' => '0', 'cols' => 3));
     $address_table->add_header(array('width' => '120px'), $this->gettext('field'));
     $address_table->add_header(null, $this->gettext('value'));
     $address_table->add_header(array('width' => '40px'), '&nbsp;');
     $this->_address_row($address_table, null, null, $attrib);
     // Get the header rules from DB. Should probably be put in a function.
     $this->_load_config();
     $this->_db_connect('r');
     $sql_result = $this->db->query("SELECT blockhdr, blockval \r\n\t\t   FROM   blocklists\r\n\t\t   WHERE  user_id = '{$user_id}'\r\n\t\t   AND    domain_id = '{$domain_id}'\r\n\t\t   ORDER BY block_id;");
     if ($sql_result && $this->db->num_rows($sql_result) > 0) {
         $norules = 'display: none;';
     }
     $address_table->set_row_attribs(array('style' => $norules));
     $address_table->add(array('colspan' => '3'), rep_specialchars_output($this->gettext('noaddressrules')));
     $address_table->add_row();
     $this->api->output->set_env('address_rule_count', $this->db->num_rows());
     while ($sql_result && ($sql_arr = $this->db->fetch_assoc($sql_result))) {
         $field = $sql_arr['blockhdr'];
         $value = $sql_arr['blockval'];
         $this->_address_row($address_table, $field, $value, $attrib);
     }
     $table->add(array('colspan' => 3), html::div(array('id' => 'headerblock-rules-cont'), $address_table->show()));
     $table->add_row();
     if ($table->size()) {
         $out .= $table->show();
     }
     $out .= '</div></fieldset>' . "\n\n";
     // =====================================================================================================
     // Parameters
     $out .= '<fieldset><legend>' . $this->gettext('parameters') . '</legend>' . "\n";
     $out .= '<div class="fieldset-content">';
     $out .= '<table class="vexim-settings" cellpadding="0" cellspacing="0">';
     $field_id = 'maxmsgsize';
     $input_messagesize = new html_inputfield(array('name' => 'maxmsgsize', 'id' => $field_id, 'maxlength' => 3, 'size' => 4));
     if ($default_maxmsgsize == 0) {
         $default_maxmsgsize = $this->gettext('unlimited');
     } else {
         $default_maxmsgsize = $default_maxmsgsize . ' kb';
     }
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('messagesize')), $input_messagesize->show($maxmsgsize), '<br /><span class="vexim-explanation">' . str_replace('%d', $active_domain, str_replace('%m', $default_maxmsgsize, $this->gettext('messagesizeexplanation'))) . '</span>');
     $out .= '</table>';
     $out .= '</div></fieldset>' . "\n\n";
     // =====================================================================================================
     $out .= html::p(null, $rcmail->output->button(array('command' => 'plugin.veximaccountadmin-save', 'type' => 'input', 'class' => 'button mainaction', 'label' => 'save')));
     $rcmail->output->add_gui_object('veximform', 'veximaccountadminform');
     $out = $rcmail->output->form_tag(array('id' => 'veximaccountadminform', 'name' => 'veximaccountadminform', 'method' => 'post', 'action' => './?_task=settings&_action=plugin.veximaccountadmin-save'), $out);
     $out = html::div(array('class' => 'settingsbox', 'style' => 'margin:0 0 15px 0;'), html::div(array('class' => 'boxtitle'), $this->gettext('accountadministration')) . html::div(array('style' => 'padding:15px'), $outtop . "\n" . $out . "\n" . $outbottom));
     return $out;
 }
开发者ID:soujak,项目名称:VeximAccountAdmin,代码行数:101,代码来源:veximaccountadmin.php

示例11: array

 function gen_examples($attrib)
 {
     // create list of example rules
     if (sizeof($this->examples) > 0) {
         $this->api->output->add_gui_object('sieverules_examples', 'sieverules-examples');
         $examples = new html_table($attrib + array('cols' => 1));
         if (!$attrib['noheader']) {
             $examples->add_header(null, $this->gettext('examplefilters'));
         }
         foreach ($this->examples as $idx => $filter) {
             $examples->set_row_attribs(array('id' => 'rcmrowex' . $idx));
             $examples->add(null, rcmail::Q($filter['name']));
         }
         return html::tag('div', array('id' => 'sieverules-list-examples'), $examples->show($attrib));
     } else {
         return '';
     }
 }
开发者ID:Kofl,项目名称:Roundcube-Plugin-SieveRules-Managesieve,代码行数:18,代码来源:sieverules.php

示例12: 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;
 }
开发者ID:rickygestalt,项目名称:ispconfig3_roundcube,代码行数:33,代码来源:ispconfig3_fetchmail.php

示例13: array

 /**
  *
  */
 function attendees_list($attrib = array())
 {
     // add "noreply" checkbox to attendees table only
     $invitations = strpos($attrib['id'], 'attend') !== false;
     $invite = new html_checkbox(array('value' => 1, 'id' => 'edit-attendees-invite'));
     $table = new html_table(array('cols' => 5 + intval($invitations), 'border' => 0, 'cellpadding' => 0, 'class' => 'rectable'));
     $table->add_header('role', $this->cal->gettext('role'));
     $table->add_header('name', $this->cal->gettext($attrib['coltitle'] ?: 'attendee'));
     $table->add_header('availability', $this->cal->gettext('availability'));
     $table->add_header('confirmstate', $this->cal->gettext('confirmstate'));
     if ($invitations) {
         $table->add_header(array('class' => 'invite', 'title' => $this->cal->gettext('sendinvitations')), $invite->show(1) . html::label('edit-attendees-invite', $this->cal->gettext('sendinvitations')));
     }
     $table->add_header('options', '');
     // hide invite column if disabled by config
     $itip_notify = (int) $this->rc->config->get('calendar_itip_send_option', $this->cal->defaults['calendar_itip_send_option']);
     if ($invitations && !($itip_notify & 2)) {
         $css = sprintf('#%s td.invite, #%s th.invite { display:none !important }', $attrib['id'], $attrib['id']);
         $this->rc->output->add_footer(html::tag('style', array('type' => 'text/css'), $css));
     }
     return $table->show($attrib);
 }
开发者ID:nciftci,项目名称:plugins,代码行数:25,代码来源:calendar_ui.php

示例14: foreach

 function gen_examples($attrib)
 {
     if (sizeof($this->examples) > 0) {
         $this->api->output->add_gui_object('sieverules_examples', 'sieverules-examples');
         $examples = new html_table(array('id' => 'sieverules-examples', 'class' => 'records-table', 'cellspacing' => '0', 'cols' => 1));
         $examples->add_header(null, $this->gettext('examplefilters'));
         foreach ($this->examples as $idx => $filter) {
             $examples->set_row_attribs(array('id' => 'rcmrowex' . $idx));
             $examples->add(null, Q($filter['name']));
         }
         return html::tag('div', array('id' => 'sieverules-list-examples'), $examples->show($attrib));
     } else {
         return '';
     }
 }
开发者ID:nansenat16,项目名称:Roundcube-Plugin-SieveRules-Managesieve,代码行数:15,代码来源:sieverules.php

示例15: 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;
 }
开发者ID:jgtoriginal,项目名称:roundcubemail,代码行数:74,代码来源:enigma_ui.php


注:本文中的html_table::add_header方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。