本文整理汇总了PHP中html_select类的典型用法代码示例。如果您正苦于以下问题:PHP html_select类的具体用法?PHP html_select怎么用?PHP html_select使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了html_select类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prefs_list
function prefs_list($args)
{
if ($args['section'] == 'mailbox') {
$RCMAIL = rcmail::get_instance();
$field_id = 'rcmfd_html5_notifier';
$select_duration = new html_select(array('name' => '_html5_notifier_duration', 'id' => $field_id));
$select_duration->add($this->gettext('off'), '0');
$times = array('3', '5', '8', '10', '12', '15', '20', '25', '30');
foreach ($times as $time) {
$select_duration->add($time . ' ' . $this->gettext('seconds'), $time);
}
$select_duration->add($this->gettext('durable'), '-1');
$select_smbox = new html_select(array('name' => '_html5_notifier_smbox', 'id' => $field_id));
$select_smbox->add($this->gettext('no_mailbox'), '0');
$select_smbox->add($this->gettext('short_mailbox'), '1');
$select_smbox->add($this->gettext('full_mailbox'), '2');
$content = $select_duration->show($RCMAIL->config->get('html5_notifier_duration') . '');
$content .= $select_smbox->show($RCMAIL->config->get('html5_notifier_smbox') . '');
$content .= html::a(array('href' => '#', 'id' => 'rcmfd_html5_notifier_browser_conf', 'onclick' => 'rcmail_browser_notifications(); return false;'), $this->gettext('conf_browser')) . ' ';
$content .= html::a(array('href' => '#', 'onclick' => 'rcmail_browser_notifications_test(); return false;'), $this->gettext('test_browser'));
$args['blocks']['new_message']['options']['html5_notifier'] = array('title' => html::label($field_id, Q($this->gettext('shownotifies'))), 'content' => $content);
$check_only_new = new html_checkbox(array('name' => '_html5_notifier_only_new', 'id' => $field_id . '_only_new', 'value' => 1));
$content = $check_only_new->show($RCMAIL->config->get('html5_notifier_only_new', false));
$args['blocks']['new_message']['options']['html5_notifier_only_new'] = array('title' => html::label($field_id, Q($this->gettext('onlynew'))), 'content' => $content);
$field_id .= '_excluded';
$input_excluded = new html_inputfield(array('name' => '_html5_notifier_excluded_directories', 'id' => $field_id));
$args['blocks']['new_message']['options']['html5_notifier_excluded_directories'] = array('title' => html::label($field_id, Q($this->gettext('excluded_directories'))), 'content' => $input_excluded->show($RCMAIL->config->get('html5_notifier_excluded_directories') . ''));
$RCMAIL->output->add_script("\$(document).ready(function(){ rcmail_browser_notifications_colorate(); });");
}
return $args;
}
示例2: template_object_identityform
function template_object_identityform($args)
{
if ($this->rcmail_inst->config->get('identity_limit') === true) {
$emails = new html_select(array('name' => '_email', 'id' => 'rcmfd_email', 'class' => 'ff_email'));
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);
$emails->add($mail_user[0]['email'], $mail_user[0]['email']);
for ($i = 0; $i < count($alias); $i++) {
$emails->add($alias[$i]['source'], $alias[$i]['source']);
}
} catch (SoapFault $e) {
$this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error');
}
if (version_compare(RCMAIL_VERSION, '0.7.0') <= 0) {
preg_match('/<input type=\\"text\\" size=\\"40\\" id=\\"rcmfd_email\\" name=\\"_email\\" class=\\"ff_email\\" value=\\"(.*)\\" \\/>/', $args['content'], $test);
$args['content'] = preg_replace('/<input type=\\"text\\" size=\\"40\\" id=\\"rcmfd_email\\" name=\\"_email\\" class=\\"ff_email\\" value=\\"(.*)\\" \\/>/', $emails->show($test[1]), $args['content']);
} else {
preg_match('/<input type=\\"text\\" size=\\"40\\" id=\\"rcmfd_email\\" name=\\"_email\\" class=\\"ff_email\\" value=\\"(.*)\\">/', $args['content'], $test);
$args['content'] = preg_replace('/<input type=\\"text\\" size=\\"40\\" id=\\"rcmfd_email\\" name=\\"_email\\" class=\\"ff_email\\" value=\\"(.*)\\">/', $emails->show($test[1]), $args['content']);
}
}
return $args;
}
示例3: show_settings
function show_settings($args)
{
if ($args['section'] == 'mailbox') {
$this->add_texts('localization/');
$field_id = 'rcmfd_previewpane_layout';
$select = new html_select(array('name' => '_previewpane_layout', 'id' => $field_id));
$select->add(rcmail::Q($this->gettext('threecol.none')), 'none');
$select->add(rcmail::Q($this->gettext('threecol.below')), 'below');
$select->add(rcmail::Q($this->gettext('threecol.right')), 'right');
// add new option at the top of the list
$val = rcube::get_instance()->config->get('preview_pane') ? rcube::get_instance()->config->get('previewpane_layout', 'below') : 'none';
$args['blocks']['main']['options']['preview_pane']['content'] = $select->show($val);
}
return $args;
}
示例4: display_search_field
function display_search_field($content = '')
{
global $CFG, $DB, $OUTPUT;
$usedoptions = array();
$sql = "SELECT DISTINCT content\n FROM {data_content}\n WHERE fieldid=: AND content IS NOT NULL";
if ($used = $DB->get_records_sql($sql, array($this->field->id))) {
foreach ($used as $data) {
$value = $data->content;
if ($value === '') {
continue;
}
$usedoptions[$value] = $value;
}
}
$options = array();
foreach (explode("\n", $this->field->param1) as $option) {
$option = trim($option);
if (!isset($usedoptions[$option])) {
continue;
}
$options[$option] = $option;
}
if (!$options) {
// oh, nothing to search for
return '';
}
return $OUTPUT->select(html_select::make($options, 'f_' . $this->field->id, $content, ' '));
}
示例5: mh_get_form_row
function mh_get_form_row($header = 'from', $input = '', $color = '#ffffff', $delete = false)
{
// header select box
$header_select = new html_select(array('name' => '_mh_header[]', 'class' => 'rcmfd_mh_header'));
$header_select->add(Q($this->gettext('subject')), 'subject');
$header_select->add(Q($this->gettext('from')), 'from');
$header_select->add(Q($this->gettext('to')), 'to');
$header_select->add(Q($this->gettext('cc')), 'cc');
// input field
$input = new html_inputfield(array('name' => '_mh_input[]', 'class' => 'rcmfd_mh_input', 'type' => 'text', 'autocomplete' => 'off', 'value' => $input));
// color box
$color = html::tag('input', array('id' => uniqid(), 'name' => '_mh_color[]', 'type' => 'color', 'text' => 'hidden', 'class' => 'mh_color_input', 'value' => $color, 'data-hex' => 'true'));
// delete button
$button = html::tag('input', array('class' => 'button mh_delete mh_button', 'type' => 'button', 'value' => $this->gettext('mh_delete'), 'title' => $this->gettext('mh_delete_description')));
// add button
$add_button = html::tag('input', array('class' => 'button mh_add mh_button', 'type' => 'button', 'value' => $this->gettext('mh_add'), 'title' => $this->gettext('mh_add_description')));
$content = $header_select->show($header) . html::span('mh_matches', Q($this->gettext('mh_matches'))) . $input->show() . html::span('mh_color', Q($this->gettext('mh_color'))) . $color . $button . $add_button;
if (rcmail::get_instance()->config->get('request_saver_compress_html', false)) {
$content = request_saver::html_compress($content);
}
return $content;
}
示例6: display_add_field
function display_add_field($recordid = 0)
{
global $DB, $OUTPUT;
if ($recordid) {
$content = (int) $DB->get_field('data_content', 'content', array('fieldid' => $this->field->id, 'recordid' => $recordid));
} else {
$content = time();
}
$str = '<div title="' . s($this->field->description) . '">';
$dayselector = html_select::make_time_selector('days', 'field_' . $this->field->id . '_day', $content);
$monthselector = html_select::make_time_selector('months', 'field_' . $this->field->id . '_month', $content);
$yearselector = html_select::make_time_selector('years', 'field_' . $this->field->id . '_year', $content);
$str .= $OUTPUT->select($dayselector) . $OUTPUT->select($monthselector) . $OUTPUT->select($yearselector);
$str .= '</div>';
return $str;
}
示例7: prefs_table
function prefs_table($args)
{
global $CURR_SECTION;
if ($args['section'] == 'folders') {
$this->add_texts('localization');
$rcmail = rcmail::get_instance();
// load folders list when needed
if ($CURR_SECTION) {
$select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true, 'maxlength' => 30, 'exceptions' => array('INBOX')));
} else {
$select = new html_select();
}
$args['blocks']['main']['options']['archive_mbox'] = array('title' => $this->gettext('archivefolder'), 'content' => $select->show($rcmail->config->get('archive_mbox'), array('name' => "_archive_mbox")));
}
return $args;
}
示例8: report_stats_mode_menu
function report_stats_mode_menu($course, $mode, $time, $url)
{
global $CFG, $OUTPUT;
/*
$reportoptions = stats_get_report_options($course->id, $mode);
$timeoptions = report_stats_timeoptions($mode);
if (empty($timeoptions)) {
print_error('nostatstodisplay', '', $CFG->wwwroot.'/course/view.php?id='.$course->id);
}
*/
$options = array();
$options[STATS_MODE_GENERAL] = get_string('statsmodegeneral');
$options[STATS_MODE_DETAILED] = get_string('statsmodedetailed');
if (has_capability('coursereport/stats:view', get_context_instance(CONTEXT_SYSTEM))) {
$options[STATS_MODE_RANKED] = get_string('reports');
}
$popupurl = $url . "?course={$course->id}&time={$time}";
$select = html_select::make_popup_form($popupurl, 'mode', $options, 'switchmode', $mode);
$select->nothinglabel = false;
return $OUTPUT->select($select);
}
示例9: charset_selector
/**
* GUI object 'charsetselector'
*
* @param array Named parameters for the select tag
* @return string HTML code for the gui object
*/
public function charset_selector($attrib)
{
// pass the following attributes to the form class
$field_attrib = array('name' => '_charset');
foreach ($attrib as $attr => $value) {
if (in_array($attr, array('id', 'name', 'class', 'style', 'size', 'tabindex'))) {
$field_attrib[$attr] = $value;
}
}
$charsets = array('UTF-8' => 'UTF-8 (' . $this->app->gettext('unicode') . ')', 'US-ASCII' => 'ASCII (' . $this->app->gettext('english') . ')', 'ISO-8859-1' => 'ISO-8859-1 (' . $this->app->gettext('westerneuropean') . ')', 'ISO-8859-2' => 'ISO-8859-2 (' . $this->app->gettext('easterneuropean') . ')', 'ISO-8859-4' => 'ISO-8859-4 (' . $this->app->gettext('baltic') . ')', 'ISO-8859-5' => 'ISO-8859-5 (' . $this->app->gettext('cyrillic') . ')', 'ISO-8859-6' => 'ISO-8859-6 (' . $this->app->gettext('arabic') . ')', 'ISO-8859-7' => 'ISO-8859-7 (' . $this->app->gettext('greek') . ')', 'ISO-8859-8' => 'ISO-8859-8 (' . $this->app->gettext('hebrew') . ')', 'ISO-8859-9' => 'ISO-8859-9 (' . $this->app->gettext('turkish') . ')', 'ISO-8859-10' => 'ISO-8859-10 (' . $this->app->gettext('nordic') . ')', 'ISO-8859-11' => 'ISO-8859-11 (' . $this->app->gettext('thai') . ')', 'ISO-8859-13' => 'ISO-8859-13 (' . $this->app->gettext('baltic') . ')', 'ISO-8859-14' => 'ISO-8859-14 (' . $this->app->gettext('celtic') . ')', 'ISO-8859-15' => 'ISO-8859-15 (' . $this->app->gettext('westerneuropean') . ')', 'ISO-8859-16' => 'ISO-8859-16 (' . $this->app->gettext('southeasterneuropean') . ')', 'WINDOWS-1250' => 'Windows-1250 (' . $this->app->gettext('easterneuropean') . ')', 'WINDOWS-1251' => 'Windows-1251 (' . $this->app->gettext('cyrillic') . ')', 'WINDOWS-1252' => 'Windows-1252 (' . $this->app->gettext('westerneuropean') . ')', 'WINDOWS-1253' => 'Windows-1253 (' . $this->app->gettext('greek') . ')', 'WINDOWS-1254' => 'Windows-1254 (' . $this->app->gettext('turkish') . ')', 'WINDOWS-1255' => 'Windows-1255 (' . $this->app->gettext('hebrew') . ')', 'WINDOWS-1256' => 'Windows-1256 (' . $this->app->gettext('arabic') . ')', 'WINDOWS-1257' => 'Windows-1257 (' . $this->app->gettext('baltic') . ')', 'WINDOWS-1258' => 'Windows-1258 (' . $this->app->gettext('vietnamese') . ')', 'ISO-2022-JP' => 'ISO-2022-JP (' . $this->app->gettext('japanese') . ')', 'ISO-2022-KR' => 'ISO-2022-KR (' . $this->app->gettext('korean') . ')', 'ISO-2022-CN' => 'ISO-2022-CN (' . $this->app->gettext('chinese') . ')', 'EUC-JP' => 'EUC-JP (' . $this->app->gettext('japanese') . ')', 'EUC-KR' => 'EUC-KR (' . $this->app->gettext('korean') . ')', 'EUC-CN' => 'EUC-CN (' . $this->app->gettext('chinese') . ')', 'BIG5' => 'BIG5 (' . $this->app->gettext('chinese') . ')', 'GB2312' => 'GB2312 (' . $this->app->gettext('chinese') . ')');
if (!empty($_POST['_charset'])) {
$set = $_POST['_charset'];
} else {
if (!empty($attrib['selected'])) {
$set = $attrib['selected'];
} else {
$set = $this->get_charset();
}
}
$set = strtoupper($set);
if (!isset($charsets[$set])) {
$charsets[$set] = $set;
}
$select = new html_select($field_attrib);
$select->add(array_values($charsets), array_keys($charsets));
return $select->show($set);
}
示例10: rrule_selectors
/**
* Drop-down menus for recurrence rules like "each last sunday of"
*/
private function rrule_selectors($part, $noselect = null)
{
// rule selectors
$select_prefix = new html_select(array('name' => 'bydayprefix', 'id' => "edit-recurrence-{$part}-prefix"));
if ($noselect) {
$select_prefix->add($noselect, '');
}
$select_prefix->add(array($this->gettext('first'), $this->gettext('second'), $this->gettext('third'), $this->gettext('fourth'), $this->gettext('last')), array(1, 2, 3, 4, -1));
$select_wday = new html_select(array('name' => 'byday', 'id' => "edit-recurrence-{$part}-byday"));
if ($noselect) {
$select_wday->add($noselect, '');
}
$daymap = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday');
$first = $this->rc->config->get('calendar_first_day', 1);
for ($j = $first; $j <= $first + 6; $j++) {
$d = $j % 7;
$select_wday->add($this->gettext($daymap[$d]), strtoupper(substr($daymap[$d], 0, 2)));
}
return $select_prefix->show() . ' ' . $select_wday->show();
}
示例11: action_div
function action_div($fid, $id, $div = true)
{
$action = isset($this->form) ? $this->form['actions'][$id] : $this->script[$fid]['actions'][$id];
$rows_num = isset($this->form) ? sizeof($this->form['actions']) : sizeof($this->script[$fid]['actions']);
$out = $div ? '<div class="actionrow" id="actionrow' . $id . '">' . "\n" : '';
$out .= '<table><tr><td class="rowactions">';
// action select
$select_action = new html_select(array('name' => "_action_type[{$id}]", 'id' => 'action_type' . $id, 'onchange' => 'action_type_select(' . $id . ')'));
if (in_array('fileinto', $this->exts)) {
$select_action->add(rcube::Q($this->plugin->gettext('messagemoveto')), 'fileinto');
}
if (in_array('fileinto', $this->exts) && in_array('copy', $this->exts)) {
$select_action->add(rcube::Q($this->plugin->gettext('messagecopyto')), 'fileinto_copy');
}
$select_action->add(rcube::Q($this->plugin->gettext('messageredirect')), 'redirect');
if (in_array('copy', $this->exts)) {
$select_action->add(rcube::Q($this->plugin->gettext('messagesendcopy')), 'redirect_copy');
}
if (in_array('reject', $this->exts)) {
$select_action->add(rcube::Q($this->plugin->gettext('messagediscard')), 'reject');
} else {
if (in_array('ereject', $this->exts)) {
$select_action->add(rcube::Q($this->plugin->gettext('messagediscard')), 'ereject');
}
}
if (in_array('vacation', $this->exts)) {
$select_action->add(rcube::Q($this->plugin->gettext('messagereply')), 'vacation');
}
$select_action->add(rcube::Q($this->plugin->gettext('messagedelete')), 'discard');
if (in_array('imapflags', $this->exts) || in_array('imap4flags', $this->exts)) {
$select_action->add(rcube::Q($this->plugin->gettext('setflags')), 'setflag');
$select_action->add(rcube::Q($this->plugin->gettext('addflags')), 'addflag');
$select_action->add(rcube::Q($this->plugin->gettext('removeflags')), 'removeflag');
}
if (in_array('variables', $this->exts)) {
$select_action->add(rcube::Q($this->plugin->gettext('setvariable')), 'set');
}
if (in_array('enotify', $this->exts) || in_array('notify', $this->exts)) {
$select_action->add(rcube::Q($this->plugin->gettext('notify')), 'notify');
}
$select_action->add(rcube::Q($this->plugin->gettext('messagekeep')), 'keep');
$select_action->add(rcube::Q($this->plugin->gettext('rulestop')), 'stop');
$select_type = $action['type'];
if (in_array($action['type'], array('fileinto', 'redirect')) && $action['copy']) {
$select_type .= '_copy';
}
$out .= $select_action->show($select_type);
$out .= '</td>';
// actions target inputs
$out .= '<td class="rowtargets">';
// force domain selection in redirect email input
$domains = (array) $this->rc->config->get('managesieve_domains');
if (!empty($domains)) {
sort($domains);
$domain_select = new html_select(array('name' => "_action_target_domain[{$id}]", 'id' => 'action_target_domain' . $id));
$domain_select->add(array_combine($domains, $domains));
if ($action['type'] == 'redirect') {
$parts = explode('@', $action['target']);
if (!empty($parts)) {
$action['domain'] = array_pop($parts);
$action['target'] = implode('@', $parts);
}
}
}
// redirect target
$out .= '<span id="redirect_target' . $id . '" style="white-space:nowrap;' . ' display:' . ($action['type'] == 'redirect' ? 'inline' : 'none') . '">' . '<input type="text" name="_action_target[' . $id . ']" id="action_target' . $id . '"' . ' value="' . ($action['type'] == 'redirect' ? rcube::Q($action['target'], 'strict', false) : '') . '"' . (!empty($domains) ? ' size="20"' : ' size="35"') . $this->error_class($id, 'action', 'target', 'action_target') . ' />' . (!empty($domains) ? ' @ ' . $domain_select->show($action['domain']) : '') . '</span>';
// (e)reject target
$out .= '<textarea name="_action_target_area[' . $id . ']" id="action_target_area' . $id . '" ' . 'rows="3" cols="35" ' . $this->error_class($id, 'action', 'targetarea', 'action_target_area') . 'style="display:' . (in_array($action['type'], array('reject', 'ereject')) ? 'inline' : 'none') . '">' . (in_array($action['type'], array('reject', 'ereject')) ? rcube::Q($action['target'], 'strict', false) : '') . "</textarea>\n";
// vacation
$vsec = in_array('vacation-seconds', $this->exts);
$out .= '<div id="action_vacation' . $id . '" style="display:' . ($action['type'] == 'vacation' ? 'inline' : 'none') . '">';
$out .= '<span class="label">' . rcube::Q($this->plugin->gettext('vacationreason')) . '</span><br />' . '<textarea name="_action_reason[' . $id . ']" id="action_reason' . $id . '" ' . 'rows="3" cols="35" ' . $this->error_class($id, 'action', 'reason', 'action_reason') . '>' . Q($action['reason'], 'strict', false) . "</textarea>\n";
$out .= '<br /><span class="label">' . rcube::Q($this->plugin->gettext('vacationsubject')) . '</span><br />' . '<input type="text" name="_action_subject[' . $id . ']" id="action_subject' . $id . '" ' . 'value="' . (is_array($action['subject']) ? rcube::Q(implode(', ', $action['subject']), 'strict', false) : $action['subject']) . '" size="35" ' . $this->error_class($id, 'action', 'subject', 'action_subject') . ' />';
$out .= '<br /><span class="label">' . rcube::Q($this->plugin->gettext('vacationaddr')) . '</span><br />' . $this->list_input($id, 'action_addresses', $action['addresses'], true, $this->error_class($id, 'action', 'addresses', 'action_addresses'), 30);
$out .= '<br /><span class="label">' . rcube::Q($this->plugin->gettext($vsec ? 'vacationinterval' : 'vacationdays')) . '</span><br />' . '<input type="text" name="_action_interval[' . $id . ']" id="action_interval' . $id . '" ' . 'value="' . rcube::Q(isset($action['seconds']) ? $action['seconds'] : $action['days'], 'strict', false) . '" size="2" ' . $this->error_class($id, 'action', 'interval', 'action_interval') . ' />';
if ($vsec) {
$out .= ' <label><input type="radio" name="_action_interval_type[' . $id . ']" value="days"' . (!isset($action['seconds']) ? ' checked="checked"' : '') . ' class="radio" />' . $this->plugin->gettext('days') . '</label>' . ' <label><input type="radio" name="_action_interval_type[' . $id . ']" value="seconds"' . (isset($action['seconds']) ? ' checked="checked"' : '') . ' class="radio" />' . $this->plugin->gettext('seconds') . '</label>';
}
$out .= '</div>';
// flags
$flags = array('read' => '\\Seen', 'answered' => '\\Answered', 'flagged' => '\\Flagged', 'deleted' => '\\Deleted', 'draft' => '\\Draft');
$flags_target = (array) $action['target'];
$out .= '<div id="action_flags' . $id . '" style="display:' . (preg_match('/^(set|add|remove)flag$/', $action['type']) ? 'inline' : 'none') . '"' . $this->error_class($id, 'action', 'flags', 'action_flags') . '>';
foreach ($flags as $fidx => $flag) {
$out .= '<input type="checkbox" name="_action_flags[' . $id . '][]" value="' . $flag . '"' . (in_array_nocase($flag, $flags_target) ? 'checked="checked"' : '') . ' />' . rcube::Q($this->plugin->gettext('flag' . $fidx)) . '<br>';
}
$out .= '</div>';
// set variable
$set_modifiers = array('lower', 'upper', 'lowerfirst', 'upperfirst', 'quotewildcard', 'length');
$out .= '<div id="action_set' . $id . '" style="display:' . ($action['type'] == 'set' ? 'inline' : 'none') . '">';
$out .= '<span class="label">' . rcube::Q($this->plugin->gettext('setvarname')) . '</span><br />' . '<input type="text" name="_action_varname[' . $id . ']" id="action_varname' . $id . '" ' . 'value="' . rcube::Q($action['name']) . '" size="35" ' . $this->error_class($id, 'action', 'name', 'action_varname') . ' />';
$out .= '<br /><span class="label">' . rcube::Q($this->plugin->gettext('setvarvalue')) . '</span><br />' . '<input type="text" name="_action_varvalue[' . $id . ']" id="action_varvalue' . $id . '" ' . 'value="' . rcube::Q($action['value']) . '" size="35" ' . $this->error_class($id, 'action', 'value', 'action_varvalue') . ' />';
$out .= '<br /><span class="label">' . rcube::Q($this->plugin->gettext('setvarmodifiers')) . '</span><br />';
foreach ($set_modifiers as $s_m) {
$s_m_id = 'action_varmods' . $id . $s_m;
$out .= sprintf('<input type="checkbox" name="_action_varmods[%s][]" value="%s" id="%s"%s />%s<br>', $id, $s_m, $s_m_id, array_key_exists($s_m, (array) $action) && $action[$s_m] ? ' checked="checked"' : '', rcube::Q($this->plugin->gettext('var' . $s_m)));
}
$out .= '</div>';
// notify
$notify_methods = (array) $this->rc->config->get('managesieve_notify_methods');
//.........这里部分代码省略.........
示例12: get_table_row
function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
{
global $CFG, $OUTPUT, $activechoices, $applytochoices, $filternames;
$row = array();
$filter = $filterinfo->filter;
// Filter name
if (!empty($filternames[$filter])) {
$row[] = $filternames[$filter];
} else {
$row[] = '<span class="error">' . get_string('filemissing', '', $filter) . '</span>';
}
// Disable/off/on
$select = html_select::make_popup_form(action_url($filter, 'setstate'), 'newstate', $activechoices, 'active' . basename($filter), $filterinfo->active);
$select->nothinglabel = false;
$select->form->button->text = get_string('save', 'admin');
$row[] = $OUTPUT->select($select);
// Re-order
$updown = '';
$spacer = '<img src="' . $OUTPUT->old_icon_url('spacer') . '" class="iconsmall" alt="" /> ';
if ($filterinfo->active != TEXTFILTER_DISABLED) {
if (!$isfirstrow) {
$updown .= action_icon(action_url($filter, 'up'), 'up', get_string('up'));
} else {
$updown .= $spacer;
}
if (!$islastactive) {
$updown .= action_icon(action_url($filter, 'down'), 'down', get_string('down'));
} else {
$updown .= $spacer;
}
}
$row[] = $updown;
// Apply to strings.
$select = html_select::make_popup_form(action_url($filter, 'setapplyto'), 'stringstoo', $applytochoices, 'applyto' . basename($filter), $applytostrings);
$select->nothinglabel = false;
$select->disabled = $filterinfo->active == TEXTFILTER_DISABLED;
$select->form->button->text = get_string('save', 'admin');
$row[] = $OUTPUT->select($select);
// Settings link, if required
if (filter_has_global_settings($filter)) {
$row[] = '<a href="' . $CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=filtersetting' . str_replace('/', '', $filter) . '">' . get_string('settings') . '</a>';
} else {
$row[] = '';
}
// Delete
if (substr($filter, 0, 4) != 'mod/') {
$row[] = '<a href="' . action_url($filter, 'delete') . '">' . get_string('delete') . '</a>';
} else {
$row[] = '';
}
return $row;
}
示例13: event_itip_status
/**
* Handler for calendar/itip-status requests
*/
function event_itip_status()
{
$data = rcube_utils::get_input_value('data', rcube_utils::INPUT_POST, true);
// find local copy of the referenced event
$this->load_driver();
$existing = $this->driver->get_event($data, calendar_driver::FILTER_WRITEABLE | calendar_driver::FILTER_PERSONAL);
$itip = $this->load_itip();
$response = $itip->get_itip_status($data, $existing);
// get a list of writeable calendars to save new events to
if (!$existing && !$data['nosave'] && $response['action'] == 'rsvp' || $response['action'] == 'import') {
$calendars = $this->driver->list_calendars(calendar_driver::FILTER_PERSONAL);
$calendar_select = new html_select(array('name' => 'calendar', 'id' => 'itip-saveto', 'is_escaped' => true));
$calendar_select->add('--', '');
$numcals = 0;
foreach ($calendars as $calendar) {
if ($calendar['editable']) {
$calendar_select->add($calendar['name'], $calendar['id']);
$numcals++;
}
}
if ($numcals <= 1) {
$calendar_select = null;
}
}
if ($calendar_select) {
$default_calendar = $this->get_default_calendar($data['sensitivity']);
$response['select'] = html::span('folder-select', $this->gettext('saveincalendar') . ' ' . $calendar_select->show($default_calendar['id']));
} else {
if ($data['nosave']) {
$response['select'] = html::tag('input', array('type' => 'hidden', 'name' => 'calendar', 'id' => 'itip-saveto', 'value' => ''));
}
}
// render small agenda view for the respective day
if ($data['method'] == 'REQUEST' && !empty($data['date']) && $response['action'] == 'rsvp') {
$event_start = rcube_utils::anytodatetime($data['date']);
$day_start = new Datetime(gmdate('Y-m-d 00:00', $data['date']), $this->lib->timezone);
$day_end = new Datetime(gmdate('Y-m-d 23:59', $data['date']), $this->lib->timezone);
// get events on that day from the user's personal calendars
$calendars = $this->driver->list_calendars(calendar_driver::FILTER_PERSONAL);
$events = $this->driver->load_events($day_start->format('U'), $day_end->format('U'), null, array_keys($calendars));
usort($events, function ($a, $b) {
return $a['start'] > $b['start'] ? 1 : -1;
});
$before = $after = array();
foreach ($events as $event) {
// TODO: skip events with free_busy == 'free' ?
if ($event['uid'] == $data['uid'] || $event['end'] < $day_start || $event['start'] > $day_end) {
continue;
} else {
if ($event['start'] < $event_start) {
$before[] = $this->mail_agenda_event_row($event);
} else {
$after[] = $this->mail_agenda_event_row($event);
}
}
}
$response['append'] = array('selector' => '.calendar-agenda-preview', 'replacements' => array('%before%' => !empty($before) ? join("\n", array_slice($before, -3)) : html::div('event-row no-event', $this->gettext('noearlierevents')), '%after%' => !empty($after) ? join("\n", array_slice($after, 0, 3)) : html::div('event-row no-event', $this->gettext('nolaterevents'))));
}
$this->rc->output->command('plugin.update_itip_object_status', $response);
}
示例14: hotpot_print_report_selector
function hotpot_print_report_selector(&$course, &$hotpot, &$formdata)
{
global $CFG, $DB, $OUTPUT;
$reports = hotpot_get_report_names('overview,simplestat,fullstat');
print '<form method="post" action="' . "{$CFG->wwwroot}/mod/hotpot/report.php?hp={$hotpot->id}" . '">';
print '<table cellpadding="2" align="center">';
$menus = array();
$menus['mode'] = array();
foreach ($reports as $name) {
if ($name == 'overview' || $name == 'simplestat' || $name == 'fullstat') {
$module = "quiz";
// standard reports
} else {
if ($name == 'click' && empty($hotpot->clickreporting)) {
$module = "";
// clickreporting is disabled
} else {
$module = "hotpot";
// custom reports
}
}
if ($module) {
$menus['mode'][$name] = get_string("report{$name}", $module);
}
}
$menus['reportusers'] = array('allusers' => get_string('allusers', 'hotpot'), 'allparticipants' => get_string('allparticipants'));
// groups
if ($groups = groups_get_all_groups($course->id)) {
foreach ($groups as $gid => $group) {
$menus['reportusers']["group{$gid}"] = get_string('group') . ': ' . format_string($group->name);
}
}
// get users who have ever atetmpted this HotPot
$users = $DB->get_records_sql("\n SELECT \n u.id, u.firstname, u.lastname\n FROM \n {user} u,\n {hotpot_attempts} ha\n WHERE\n u.id = ha.userid AND ha.hotpot=?\n ORDER BY\n u.lastname\n ", array($hotpot->id));
if (!empty($users)) {
// get context
$cm = get_coursemodule_from_instance('hotpot', $hotpot->id);
$modulecontext = get_context_instance(CONTEXT_MODULE, $cm->id);
$teachers = hotpot_get_users_by_capability($modulecontext, 'mod/hotpot:viewreport');
$students = hotpot_get_users_by_capability($modulecontext, 'mod/hotpot:attempt');
// current students
if (!empty($students)) {
$firsttime = true;
foreach ($users as $user) {
if (array_key_exists($user->id, $teachers)) {
continue;
// skip teachers
}
if (array_key_exists($user->id, $students)) {
if ($firsttime) {
$firsttime = false;
// so we only do this once
$menus['reportusers']['existingstudents'] = get_string('existingstudents');
$menus['reportusers'][] = '------';
}
$menus['reportusers']["{$user->id}"] = fullname($user);
unset($users[$user->id]);
}
}
unset($students);
}
// others (former students, teachers, admins, course creators)
$firsttime = true;
foreach ($users as $user) {
if ($firsttime) {
$firsttime = false;
// so we only do this once
$menus['reportusers'][] = '======';
}
$menus['reportusers']["{$user->id}"] = fullname($user);
}
}
$menus['reportattempts'] = array('all' => get_string('attemptsall', 'hotpot'), 'best' => get_string('attemptsbest', 'hotpot'), 'first' => get_string('attemptsfirst', 'hotpot'), 'last' => get_string('attemptslast', 'hotpot'));
print '<tr><td>';
echo $OUTPUT->help_icon(moodle_help_icon::make('reportcontent', get_string('reportcontent', 'hotpot'), 'hotpot'));
print '</td><th align="right" scope="col">' . get_string('reportcontent', 'hotpot') . ':</th><td colspan="7">';
foreach ($menus as $name => $options) {
$value = $formdata[$name];
print $OUTPUT->select(html_select::make($options, $name, $value, false));
}
print '<input type="submit" value="' . get_string('reportbutton', 'hotpot') . '" /></td></tr>';
$menus = array();
$menus['reportformat'] = array();
$menus['reportformat']['htm'] = get_string('reportformathtml', 'hotpot');
if (file_exists("{$CFG->libdir}/excel") || file_exists("{$CFG->libdir}/excellib.class.php")) {
$menus['reportformat']['xls'] = get_string('reportformatexcel', 'hotpot');
}
$menus['reportformat']['txt'] = get_string('reportformattext', 'hotpot');
if (trim($CFG->hotpot_excelencodings)) {
$menus['reportencoding'] = array(get_string('none') => '');
$encodings = explode(',', $CFG->hotpot_excelencodings);
foreach ($encodings as $encoding) {
$encoding = trim($encoding);
if ($encoding) {
$menus['reportencoding'][$encoding] = $encoding;
}
}
}
$menus['reportwrapdata'] = array('1' => get_string('yes'), '0' => get_string('no'));
$menus['reportshowlegend'] = array('1' => get_string('yes'), '0' => get_string('no'));
//.........这里部分代码省略.........
示例15: scorm_get_toc
//.........这里部分代码省略.........
$startbold = '';
$endbold = '';
$score = '';
if (empty($scoid) && $mode != 'normal') {
$scoid = $sco->id;
}
if (isset($usertracks[$sco->identifier])) {
$usertrack = $usertracks[$sco->identifier];
$strstatus = get_string($usertrack->status, 'scorm');
if ($sco->scormtype == 'sco') {
$statusicon = '<img src="' . $OUTPUT->mod_icon_url('pix/' . $usertrack->status, 'scorm') . '" alt="' . $strstatus . '" title="' . $strstatus . '" />';
} else {
$statusicon = '<img src="' . $OUTPUT->mod_icon_url('pix/assetc', 'scorm') . '" alt="' . get_string('assetlaunched', 'scorm') . '" title="' . get_string('assetlaunched', 'scorm') . '" />';
}
if ($usertrack->status == 'notattempted' || $usertrack->status == 'incomplete' || $usertrack->status == 'browsed') {
$incomplete = true;
if ($play && empty($scoid)) {
$scoid = $sco->id;
}
}
if ($usertrack->score_raw != '') {
$score = '(' . get_string('score', 'scorm') . ': ' . $usertrack->score_raw . ')';
}
$strsuspended = get_string('suspended', 'scorm');
if (isset($usertrack->{'cmi.core.exit'}) && $usertrack->{'cmi.core.exit'} == 'suspend') {
if ($usertrack->status != 'completed') {
$statusicon = '<img src="' . $OUTPUT->mod_icon_url('pix/suspend', 'scorm') . '" alt="' . $strstatus . ' - ' . $strsuspended . '" title="' . $strstatus . ' - ' . $strsuspended . '" />';
}
}
} else {
if ($play && empty($scoid)) {
$scoid = $sco->id;
}
if ($sco->scormtype == 'sco') {
$statusicon = '<img src="' . $OUTPUT->mod_icon_url('pix/notattempted', 'scorm') . '" alt="' . get_string('notattempted', 'scorm') . '" title="' . get_string('notattempted', 'scorm') . '" />';
$incomplete = true;
} else {
$statusicon = '<img src="' . $OUTPUT->mod_icon_url('pix/asset', 'scorm') . '" alt="' . get_string('asset', 'scorm') . '" title="' . get_string('asset', 'scorm') . '" />';
}
}
if ($sco->id == $scoid) {
$startbold = '<b>';
$endbold = '</b>';
$findnext = true;
$shownext = isset($sco->next) ? $sco->next : 0;
$showprev = isset($sco->prev) ? $sco->prev : 0;
}
if ($nextid == 0 && scorm_count_launchable($scorm->id, $currentorg) > 1 && $nextsco !== false && !$findnext) {
if (!empty($sco->launch)) {
$previd = $sco->id;
}
}
require_once 'sequencinglib.php';
if (scorm_seq_evaluate($sco->id, $usertracks)) {
if ($sco->id == $scoid) {
$result->prerequisites = true;
}
$url = $CFG->wwwroot . '/mod/scorm/player.php?a=' . $scorm->id . '&currentorg=' . $currentorg . $modestr . '&scoid=' . $sco->id;
$result->toc .= $statusicon . ' ' . $startbold . '<a href="' . $url . '">' . format_string($sco->title) . '</a>' . $score . $endbold . "</li>\n";
$tocmenus[$sco->id] = scorm_repeater('−', $level) . '>' . format_string($sco->title);
} else {
if ($sco->id == $scoid) {
$result->prerequisites = false;
}
$result->toc .= ' ' . format_string($sco->title) . "</li>\n";
}
}
} else {
$result->toc .= ' ' . format_string($sco->title) . "</li>\n";
}
if ($nextsco !== false && $nextid == 0 && $findnext) {
if (!empty($nextsco->launch)) {
$nextid = $nextsco->id;
}
}
}
for ($i = 0; $i < $level; $i++) {
$result->toc .= "\t\t</ul></li>\n";
}
if ($play) {
$sco = $DB->get_record('scorm_scoes', array('id' => $scoid));
$sco->previd = $previd;
$sco->nextid = $nextid;
$result->sco = $sco;
$result->incomplete = $incomplete;
} else {
$result->incomplete = $incomplete;
}
}
$result->toc .= "\t</ul>\n";
if ($scorm->hidetoc == 0) {
$PAGE->requires->data_for_js('scormdata', array('plusicon' => $OUTPUT->mod_icon_url('pix/plus', 'scorm'), 'minusicon' => $OUTPUT->mod_icon_url('pix/minus', 'scorm')));
$PAGE->requires->js('mod/scorm/datamodels/scorm_datamodels.js');
}
$url = $CFG->wwwroot . '/mod/scorm/player.php?a=' . $scorm->id . '¤torg=' . $currentorg . $modestr;
$select = html_select::make_popup_form($url, 'scoid', $tocmenus, "tocmenu", $sco->id);
$select->nothinglabel = false;
$result->tocmenu = $OUTPUT->select($select);
return $result;
}