本文整理汇总了PHP中html::p方法的典型用法代码示例。如果您正苦于以下问题:PHP html::p方法的具体用法?PHP html::p怎么用?PHP html::p使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html
的用法示例。
在下文中一共展示了html::p方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: message_body_prefix
public function message_body_prefix($arg)
{
if ($this->encrypted_part) {
$arg['prefix'] = html::p(array('class' => 'hint', 'style' => 'margin-bottom:1em'), $this->gettext("show_pgp_mime_body_prefix"));
}
return $arg;
}
示例2: html_output
/**
* This callback function adds a box below the message content
* if there is a vcard attachment available
*/
function html_output($p)
{
$attach_script = false;
foreach ($this->vcard_parts as $part) {
$vcards = rcube_vcard::import($this->message->get_part_content($part, null, true));
// successfully parsed vcards?
if (empty($vcards)) {
continue;
}
// remove part's body
if (in_array($part, $this->vcard_bodies)) {
$p['content'] = '';
}
foreach ($vcards as $idx => $vcard) {
// skip invalid vCards
if (empty($vcard->email) || empty($vcard->email[0])) {
continue;
}
$display = $vcard->displayname . ' <' . $vcard->email[0] . '>';
// add box below message body
$p['content'] .= html::p(array('class' => 'vcardattachment'), html::a(array('href' => "#", 'onclick' => "return plugin_vcard_save_contact('" . rcube::JQ($part . ':' . $idx) . "')", 'title' => $this->gettext('addvcardmsg')), html::span(null, rcube::Q($display))));
}
$attach_script = true;
}
if ($attach_script) {
$this->include_script('vcardattach.js');
$this->include_stylesheet($this->local_skin_path() . '/style.css');
}
return $p;
}
示例3: html_output
/**
* This callback function adds a box below the message content
* if there is a vcard attachment available
*/
function html_output($p)
{
$attach_script = false;
$icon = 'plugins/vcard_attachments/' . $this->local_skin_path() . '/vcard_add_contact.png';
foreach ($this->vcard_parts as $part) {
$vcards = rcube_vcard::import($this->message->get_part_content($part));
// successfully parsed vcards?
if (empty($vcards)) {
continue;
}
// remove part's body
if (in_array($part, $this->vcard_bodies)) {
$p['content'] = '';
}
$style = 'margin:0.5em 1em; padding:0.2em 0.5em; border:1px solid #999; ' . 'border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; width: auto';
foreach ($vcards as $idx => $vcard) {
$display = $vcard->displayname;
if ($vcard->email[0]) {
$display .= ' <' . $vcard->email[0] . '>';
}
// add box below messsage body
$p['content'] .= html::p(array('style' => $style), html::a(array('href' => "#", 'onclick' => "return plugin_vcard_save_contact('" . JQ($part . ':' . $idx) . "')", 'title' => $this->gettext('addvcardmsg')), html::img(array('src' => $icon, 'style' => "vertical-align:middle"))) . ' ' . html::span(null, Q($display)));
}
$attach_script = true;
}
if ($attach_script) {
$this->include_script('vcardattach.js');
}
return $p;
}
示例4: render_page
/**
* 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');
}
}
示例5: 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);
}
示例6: html_output
/**
* This callback function adds a box below the message content
* if there is a vcard attachment available
*/
function html_output($p)
{
if ($this->vcard_part) {
$vcard = new rcube_vcard($this->message->get_part_content($this->vcard_part));
// successfully parsed vcard
if ($vcard->displayname) {
$display = $vcard->displayname;
if ($vcard->email[0]) {
$display .= ' <' . $vcard->email[0] . '>';
}
// add box below messsage body
$p['content'] .= html::p(array('style' => "margin:1em; padding:0.5em; border:1px solid #999; border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; width: auto;"), html::a(array('href' => "#", 'onclick' => "return plugin_vcard_save_contact('" . JQ($this->vcard_part) . "')", 'title' => $this->gettext('addvardmsg')), html::img(array('src' => $this->url('vcard_add_contact.png'), 'align' => "middle"))) . ' ' . html::span(null, Q($display)));
$this->include_script('vcardattach.js');
}
}
return $p;
}
示例7: html_output
/**
* This callback function adds a box below the message content
* if there is a vcard attachment available
*/
function html_output($p)
{
$attach_script = false;
foreach ($this->ics_parts as $part) {
$icscontent = $this->message->get_part_content($part['part'], null, true);
$file_name = $part['uid'];
$file = '../../../cache/import/' . $file_name . '.ics';
file_put_contents($file, $icscontent);
// add box below message body
$p['content'] .= html::p(array('class' => 'icalattachments'), html::a(array('href' => "#", 'class' => rcube::JQ($file_name), 'title' => $this->gettext('addicalinvitemsg')), html::span(null, rcube::Q($this->gettext('addicalinvitemsg')))));
$attach_script = true;
}
if ($attach_script) {
$this->include_stylesheet($this->local_skin_path() . '/style.css');
}
return $p;
}
示例8: render_page
/**
* 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');
}
}
示例9: render_page
/**
* 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');
}
}
示例10: array
if ($session_error || $_REQUEST['_err'] == 'session') {
$OUTPUT->show_message('sessionerror', 'error', null, true, -1);
}
if ($OUTPUT->ajax_call || $OUTPUT->get_env('framed')) {
$OUTPUT->command('session_error', $RCMAIL->url(array('_err' => 'session')));
$OUTPUT->send('iframe');
}
// check if installer is still active
if ($RCMAIL->config->get('enable_installer') && is_readable('./installer/index.php')) {
$OUTPUT->add_footer(html::div(array('style' => "background:#ef9398; border:2px solid #dc5757; padding:0.5em; margin:2em auto; width:50em"),
html::tag('h2', array('style' => "margin-top:0.2em"), "Installer script is still accessible") .
html::p(null, "The install script of your Roundcube installation is still stored in its default location!") .
html::p(null, "Please <b>remove</b> the whole <tt>installer</tt> folder from the Roundcube directory because .
these files may expose sensitive configuration data like server passwords and encryption keys
to the public. Make sure you cannot access the <a href=\"./installer/\">installer script</a> from your browser.")
));
}
$plugin = $RCMAIL->plugins->exec_hook('unauthenticated', array('task' => 'login', 'error' => $session_error));
$RCMAIL->set_task($plugin['task']);
$OUTPUT->send($plugin['task']);
}
// CSRF prevention
else {
// don't check for valid request tokens in these actions
$request_check_whitelist = array('login'=>1, 'spell'=>1, 'spell_html'=>1);
示例11: message_output
/**
* Handler for template_object_messagebody hook.
* This callback function adds a box below the message content
* if there is a key/cert attachment available
*/
function message_output($p)
{
foreach ($this->keys_parts as $part) {
// remove part's body
if (in_array($part, $this->keys_bodies)) {
$p['content'] = '';
}
// add box below message body
$p['content'] .= html::p(array('class' => 'enigmaattachment'), html::a(array('href' => "#", 'onclick' => "return " . rcmail_output::JS_OBJECT_NAME . ".enigma_import_attachment('" . rcube::JQ($part) . "')", 'title' => $this->enigma->gettext('keyattimport')), html::span(null, $this->enigma->gettext('keyattfound'))));
$attach_scripts = true;
}
if ($attach_scripts) {
// add css and js script
$this->add_css();
$this->add_js();
}
return $p;
}
示例12: attendees_form
/**
*
*/
function attendees_form($attrib = array())
{
$input = new html_inputfield(array('name' => 'participant', 'id' => 'edit-attendee-name', 'size' => 30));
$textarea = new html_textarea(array('name' => 'comment', 'id' => 'edit-attendees-comment', 'rows' => 4, 'cols' => 55, 'title' => $this->cal->gettext('itipcommenttitle')));
return html::div($attrib, html::div(null, $input->show() . " " . html::tag('input', array('type' => 'button', 'class' => 'button', 'id' => 'edit-attendee-add', 'value' => $this->cal->gettext('addattendee'))) . " " . html::tag('input', array('type' => 'button', 'class' => 'button', 'id' => 'edit-attendee-schedule', 'value' => $this->cal->gettext('scheduletime') . '...'))) . html::p('attendees-commentbox', html::label(null, $this->cal->gettext('itipcomment') . $textarea->show())));
}
示例13: test_p_with_attributes_and_empty_string_args
public function test_p_with_attributes_and_empty_string_args()
{
$attributes = array('class' => 'test', 'data' => '0101');
$actual = html::p($attributes, '');
$expected = '<p class=test data=0101></p>';
$this->assertSame($expected, $actual);
}
示例14: 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;
}
示例15: twofactor_gauthenticator_form
public function twofactor_gauthenticator_form()
{
$rcmail = rcmail::get_instance();
$this->add_texts('localization/', true);
$rcmail->output->set_env('product_name', $rcmail->config->get('product_name'));
$data = self::__get2FAconfig();
// Fields will be positioned inside of a table
$table = new html_table(array('cols' => 2));
// Activate/deactivate
$field_id = '2FA_activate';
$checkbox_activate = new html_checkbox(array('name' => $field_id, 'id' => $field_id, 'type' => 'checkbox'));
$table->add('title', html::label($field_id, Q($this->gettext('activate'))));
$checked = $data['activate'] ? null : 1;
// :-?
$table->add(null, $checkbox_activate->show($checked));
// secret
$field_id = '2FA_secret';
$input_descsecret = new html_inputfield(array('name' => $field_id, 'id' => $field_id, 'size' => 60, 'type' => 'password', 'value' => $data['secret']));
$table->add('title', html::label($field_id, Q($this->gettext('secret'))));
$html_secret = $input_descsecret->show();
if ($data['secret']) {
$html_secret .= '<input type="button" class="button mainaction" id="2FA_change_secret" value="' . $this->gettext('show_secret') . '">';
} else {
$html_secret .= '<input type="button" class="button mainaction" id="2FA_create_secret" value="' . $this->gettext('create_secret') . '">';
}
$table->add(null, $html_secret);
// recovery codes
$table->add('title', $this->gettext('recovery_codes'));
$html_recovery_codes = '';
$i = 0;
for ($i = 0; $i < $this->_number_recovery_codes; $i++) {
$value = isset($data['recovery_codes'][$i]) ? $data['recovery_codes'][$i] : '';
$html_recovery_codes .= ' <input type="password" name="2FA_recovery_codes[]" value="' . $value . '" maxlength="10"> ';
}
$html_recovery_codes .= '<input type="button" class="button mainaction" id="2FA_show_recovery_codes" value="' . $this->gettext('show_recovery_codes') . '">';
$table->add(null, $html_recovery_codes);
// qr-code
if ($data['secret']) {
$table->add('title', $this->gettext('qr_code'));
$table->add(null, '<input type="button" class="button mainaction" id="2FA_change_qr_code" value="' . $this->gettext('show_qr_code') . '">
<div id="2FA_qr_code" style="display: none; margin-top: 10px;"></div>');
// new JS qr-code, without call to Google
$this->include_script('2FA_qr_code.js');
}
// infor
$table->add(null, '<td><br>' . $this->gettext('msg_infor') . '</td>');
// button to setup all fields if doesn't exists secret
$html_setup_all_fields = '';
if (!$data['secret']) {
$html_setup_all_fields = '<input type="button" class="button mainaction" id="2FA_setup_fields" value="' . $this->gettext('setup_all_fields') . '">';
}
$html_check_code = '<br /><br /><input type="button" class="button mainaction" id="2FA_check_code" value="' . $this->gettext('check_code') . '"> <input type="text" id="2FA_code_to_check" maxlength="10">';
// Build the table with the divs around it
$out = html::div(array('class' => 'settingsbox', 'style' => 'margin: 0;'), html::div(array('id' => 'prefs-title', 'class' => 'boxtitle'), $this->gettext('twofactor_gauthenticator') . ' - ' . $rcmail->user->data['username']) . html::div(array('class' => 'boxcontent'), $table->show() . html::p(null, $rcmail->output->button(array('command' => 'plugin.twofactor_gauthenticator-save', 'type' => 'input', 'class' => 'button mainaction', 'label' => 'save')) . $html_setup_all_fields . $html_check_code)));
// Construct the form
$rcmail->output->add_gui_object('twofactor_gauthenticatorform', 'twofactor_gauthenticator-form');
$out = $rcmail->output->form_tag(array('id' => 'twofactor_gauthenticator-form', 'name' => 'twofactor_gauthenticator-form', 'method' => 'post', 'action' => './?_task=settings&_action=plugin.twofactor_gauthenticator-save'), $out);
return $out;
}