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


PHP single_button::add_confirm_action方法代码示例

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


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

示例1: definition

 /**
  * Form definition
  *
  * @uses $CFG
  */
 public function definition()
 {
     // if there are no rows in the table, return.
     // (won't be rows if both olduser and newuser are NULL in session stdClass)
     if (empty($this->urt->data)) {
         return '';
     }
     $mform =& $this->_form;
     // header
     $mform->addElement('header', 'reviewusers', get_string('userreviewtable_legend', 'tool_mergeusers'));
     // table content
     $mform->addElement('static', 'reviewuserslist', '', html_writer::table($this->urt));
     // buttons
     // set up url here so the same url can be used more than once
     $mergeurl = new moodle_url('/admin/tool/mergeusers/index.php');
     $buttonarray = array();
     if ($this->review_step) {
         $mergeurl->param('option', 'mergeusers');
         $mergeusersbutton = new single_button($mergeurl, get_string('mergeusers', 'tool_mergeusers'));
         $mergeusersbutton->add_confirm_action(get_string('mergeusers_confirm', 'tool_mergeusers'));
         $buttonarray[0][] = $this->output->render($mergeusersbutton);
     } else {
         if (count($this->urt->data) === 2) {
             $mergeurl->param('option', 'continueselection');
             $mergeusersbutton = new single_button($mergeurl, get_string('saveselection_submit', 'tool_mergeusers'));
             $buttonarray[0][] = $this->output->render($mergeusersbutton);
         }
     }
     $mergeurl->param('option', 'clearselection');
     $mergeusersbutton = new single_button($mergeurl, get_string('clear_selection', 'tool_mergeusers'));
     $buttonarray[0][] = $this->output->render($mergeusersbutton);
     if ($this->review_step) {
         $mergeurl->param('option', 'searchusers');
         $mergeusersbutton = new single_button($mergeurl, get_string('cancel'));
         $buttonarray[0][] = $this->output->render($mergeusersbutton);
     }
     $htmltable = new html_table();
     $htmltable->attributes['class'] = 'clearfix';
     $htmltable->data = $buttonarray;
     $mform->addElement('static', 'buttonar', '', html_writer::table($htmltable));
     $mform->closeHeaderBefore('buttonar');
 }
开发者ID:advancingdesign,项目名称:moodle-tool_mergeusers,代码行数:47,代码来源:review_form.php

示例2: array

 }
 if (has_capability('mod/workshop:overridegrades', $workshop->context)) {
     print_collapsible_region_start('', 'workshop-viewlet-cleargrades', get_string('toolbox', 'workshop'), false, true);
     echo $output->box_start('generalbox toolbox');
     // Clear aggregated grades
     $url = new moodle_url($workshop->toolbox_url('clearaggregatedgrades'));
     $btn = new single_button($url, get_string('clearaggregatedgrades', 'workshop'), 'post');
     $btn->add_confirm_action(get_string('clearaggregatedgradesconfirm', 'workshop'));
     echo $output->container_start('toolboxaction');
     echo $output->render($btn);
     echo $output->help_icon('clearaggregatedgrades', 'workshop');
     echo $output->container_end();
     // Clear assessments
     $url = new moodle_url($workshop->toolbox_url('clearassessments'));
     $btn = new single_button($url, get_string('clearassessments', 'workshop'), 'post');
     $btn->add_confirm_action(get_string('clearassessmentsconfirm', 'workshop'));
     echo $output->container_start('toolboxaction');
     echo $output->render($btn);
     echo $output->help_icon('clearassessments', 'workshop');
     echo html_writer::empty_tag('img', array('src' => $output->pix_url('i/risk_dataloss'), 'title' => get_string('riskdatalossshort', 'admin'), 'alt' => get_string('riskdatalossshort', 'admin'), 'class' => 'workshop-risk-dataloss'));
     echo $output->container_end();
     echo $output->box_end();
     print_collapsible_region_end();
 }
 if (has_capability('mod/workshop:submit', $PAGE->context)) {
     print_collapsible_region_start('', 'workshop-viewlet-ownsubmission', get_string('yoursubmission', 'workshop'));
     echo $output->box_start('generalbox ownsubmission');
     if ($submission = $workshop->get_submission_by_author($USER->id)) {
         echo $output->render($workshop->prepare_submission_summary($submission, true));
     } else {
         echo $output->container(get_string('noyoursubmission', 'workshop'));
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:31,代码来源:view.php

示例3: options

echo $OUTPUT->confirm('This is the message', $continueurl, $cancelurl);
echo html_writer::tag('p', 'A confirm form with continue/cancel options (with custom buttons):');
$continueurl = new moodle_url('index.php');
$cancelurl = new moodle_url('index.php');
$continuebutton = new single_button($continueurl, 'Custom Button text', 'post');
$cancelbutton = new single_button($cancelurl, 'Something else', 'get');
echo $OUTPUT->confirm('This is another message', $continuebutton, $cancelbutton);
echo html_writer::tag('p', 'A standalone single button. This is still wrapped in a form so you can submit it. There are a couple of ways to generate, via a function call:');
echo $OUTPUT->single_button($continueurl, 'A disabled button', 'post', array('disabled' => true));
echo html_writer::tag('p', 'Or manually create object then render. Note this uses a confirm dialog, try pressing to see popup (needs styling)');
// render directly
$button = new single_button($continueurl, 'Manually rendered button', 'post');
$button->tooltip = 'This is the tooltip';
$button->formid = 'canbeset';
$button->class = 'classonbutton';
$button->add_confirm_action('This message appears to confirm when you push the button');
echo $OUTPUT->render($button);
echo html_writer::tag('p', 'A single select form. Quick way using a function:');
$url = new moodle_url('index.php', array('urlparams' => 'become', 'hidden' => 'fields'));
$options = array(1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four');
echo $OUTPUT->single_select($url, 'youpicked', $options, '', array('' => 'choose'), 'formid');
echo html_writer::tag('p', 'A single select form. Manually rendered:');
$select = new single_select($url, 'youpicked', $options);
$select->set_label('This is a label for the select');
$select->tooltip = 'This is the tooltip';
//this doesn't seem to work - moodle bug?
//$select->add_confirm_action('Confirm you want to do this');
$select->set_help_icon('activities', 'moodle');
echo $OUTPUT->render($select);
echo html_writer::tag('p', 'A url select form. Typically used for navigation.');
$urls = array('/admin/tool/elementlibrary/' => 'Index', '/admin/tool/elementlibrary/common.php' => 'Common elements', '/admin/tool/elementlibrary/mform.php' => 'Moodle form elements', '/admin/tool/elementlibrary/tables.php' => 'Tables', '/admin/tool/elementlibrary/tabs.php' => 'Tabs');
开发者ID:jeisc,项目名称:totara-element-library,代码行数:31,代码来源:forms.php

示例4: summary_page_controls

    /**
     * Creates any controls a the page should have.
     *
     * @param quiz_attempt $attemptobj
     */
    public function summary_page_controls($attemptobj) {
        $output = '';
        // countdown timer
        $output .= $this->countdown_timer();

        // Finish attempt button.
        $output .= $this->container_start('submitbtns mdl-align');
        $options = array(
            'attempt' => $attemptobj->get_attemptid(),
            'finishattempt' => 1,
            'timeup' => 0,
            'slots' => '',
            'sesskey' => sesskey(),
        );

        $button = new single_button(
                new moodle_url($attemptobj->processattempt_url(), $options),
                get_string('submitallandfinish', 'quiz'));
        $button->id = 'responseform';
        $button->add_confirm_action(get_string('confirmclose', 'quiz'));

        $output .= $this->container_start('controls');
        $output .= $this->render($button);
        $output .= $this->container_end();
        $output .= $this->container_end();

        return $output;
    }
开发者ID:nottmoo,项目名称:moodle,代码行数:33,代码来源:renderer.php

示例5: print_start_attempt_button

    public function print_start_attempt_button($canpreview, $buttontext, $unfinished) {
        global $OUTPUT;

        $url = $this->_quizobj->start_attempt_url();
        $button = new single_button($url, $buttontext);
        $button->class .= ' quizstartbuttondiv';

        if (!$unfinished) {
            $strconfirmstartattempt = $this->confirm_start_attempt_message();
            if ($strconfirmstartattempt) {
                $button->add_confirm_action($strconfirmstartattempt);
            }
        }

        $warning = '';

        if ($this->securewindow_required($canpreview)) {
            $button->class .= ' quizsecuremoderequired';

            $button->add_action(new popup_action('click', $url, 'quizpopup',
                    securewindow_access_rule::$popupoptions));

            $warning = html_writer::tag('noscript',
                    $OUTPUT->heading(get_string('noscript', 'quiz')));
        }

        return $OUTPUT->render($button) . $warning;
    }
开发者ID:nottmoo,项目名称:moodle,代码行数:28,代码来源:accessrules.php

示例6: array

foreach ($attemptobj->get_question_iterator() as $number => $question) {
    if ($question->length == 0) {
        continue;
    }
    $flag = '';
    if ($attemptobj->is_question_flagged($question->id)) {
        $flag = ' <img src="' . $OUTPUT->pix_url('i/flagged') . '" alt="' . get_string('flagged', 'question') . '" class="questionflag" />';
    }
    $row = array('<a href="' . s($attemptobj->attempt_url($question->id)) . '">' . $number . $flag . '</a>', get_string($attemptobj->get_question_status($question->id), 'quiz'));
    if ($scorescolumn) {
        $row[] = $attemptobj->get_question_score($question->id);
    }
    $table->data[] = $row;
}
/// Print the summary table.
echo html_writer::table($table);
/// countdown timer
echo $attemptobj->get_timer_html();
/// Finish attempt button.
echo $OUTPUT->container_start('submitbtns mdl-align');
$options = array('attempt' => $attemptobj->get_attemptid(), 'finishattempt' => 1, 'timeup' => 0, 'questionids' => '', 'sesskey' => sesskey());
$button = new single_button(new moodle_url($attemptobj->processattempt_url(), $options), get_string('submitallandfinish', 'quiz'));
$button->id = 'responseform';
$button->add_confirm_action(get_string('confirmclose', 'quiz'));
echo $OUTPUT->container_start('controls');
echo $OUTPUT->render($button);
echo $OUTPUT->container_end();
echo $OUTPUT->container_end();
/// Finish the page
$accessmanager->show_attempt_timer_if_needed($attemptobj->get_attempt(), time());
echo $OUTPUT->footer();
开发者ID:vuchannguyen,项目名称:web,代码行数:31,代码来源:summary.php


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