本文整理汇总了PHP中bootstrap::alert_error方法的典型用法代码示例。如果您正苦于以下问题:PHP bootstrap::alert_error方法的具体用法?PHP bootstrap::alert_error怎么用?PHP bootstrap::alert_error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bootstrap
的用法示例。
在下文中一共展示了bootstrap::alert_error方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_import_course_search
public function render_import_course_search(import_course_search $component)
{
$output = '';
if ($component->get_count() === 0) {
$output .= bootstrap::alert_error(get_string('nomatchingcourses', 'backup'));
$output .= html_writer::empty_tag('input', array('type' => 'text', 'name' => restore_course_search::$VAR_SEARCH, 'value' => $component->get_search()));
$output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'searchcourses', 'value' => get_string('search')));
return $output;
}
$output .= html_writer::tag('div', get_string('totalcoursesearchresults', 'backup', $component->get_count()), array('class' => 'ics-totalresults'));
$table = new html_table();
$table->attributes['class'] = 'table table-striped table-hover';
$table->head = array('', get_string('shortnamecourse'), get_string('fullnamecourse'));
$table->data = array();
foreach ($component->get_results() as $course) {
$row = new html_table_row();
$row->attributes['class'] = 'ics-course';
if (!$course->visible) {
$row->attributes['class'] .= ' muted';
}
$row->cells = array(html_writer::empty_tag('input', array('type' => 'radio', 'name' => 'importid', 'value' => $course->id)), format_string($course->shortname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id))), format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id))));
$table->data[] = $row;
}
$output .= html_writer::table($table);
$output .= html_writer::empty_tag('input', array('type' => 'text', 'name' => restore_course_search::$VAR_SEARCH, 'value' => $component->get_search()));
$output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'searchcourses', 'value' => get_string('search')));
$output .= html_writer::end_tag('div');
return $output;
}
示例2: notification
public function notification($message, $classes = 'notifyproblem')
{
$message = clean_text($message);
if ($classes == 'notifyproblem') {
return bootstrap::alert_error($message);
}
if ($classes == 'notifysuccess') {
return bootstrap::alert_success($message);
}
if ($classes == 'notifymessage') {
return bootstrap::alert_info($message);
}
if ($classes == 'notifymessage') {
return bootstrap::alert_default($message);
}
if ($classes == 'redirectmessage') {
return bootstrap::alert_block_info($message);
}
return bootstrap::alert_default($message);
}
示例3: environment_check_table
//.........这里部分代码省略.........
$stringtouse = 'environmentrecommendcustomcheck';
}
} else {
if ($environment_result->getPart() == 'php_setting') {
if ($status) {
$stringtouse = 'environmentsettingok';
} else {
if ($environment_result->getLevel() == 'required') {
$stringtouse = 'environmentmustfixsetting';
} else {
$stringtouse = 'environmentshouldfixsetting';
}
}
} else {
if ($environment_result->getLevel() == 'required') {
$stringtouse = 'environmentrequireinstall';
} else {
$stringtouse = 'environmentrecommendinstall';
}
}
}
}
// Calculate the status value
if ($environment_result->getBypassStr() != '') {
//Handle bypassed result (warning)
$status = get_string('bypassed');
$warningline = true;
} else {
if ($environment_result->getRestrictStr() != '') {
//Handle restricted result (error)
$status = get_string('restricted');
$errorline = true;
} else {
if ($status) {
//Handle ok result (ok)
$status = get_string('ok');
} else {
if ($environment_result->getLevel() == 'optional') {
//Handle check result (warning)
$status = get_string('check');
$warningline = true;
} else {
//Handle error result (error)
$status = get_string('check');
$errorline = true;
}
}
}
}
}
// Build the text
$linkparts = array();
$linkparts[] = 'admin/environment';
$linkparts[] = $type;
if (!empty($info)) {
$linkparts[] = $info;
}
if (empty($CFG->docroot)) {
$report = get_string($stringtouse, 'admin', $rec);
} else {
$report = $this->doc_link(join($linkparts, '/'), get_string($stringtouse, 'admin', $rec));
}
// Format error or warning line
if ($errorline || $warningline) {
$messagetype = $errorline ? 'important' : 'warning';
} else {
$messagetype = 'success';
}
$status = label::make($messagetype, $status);
// Here we'll store all the feedback found
$feedbacktext = '';
// Append the feedback if there is some
$feedbacktext .= $environment_result->strToReport($environment_result->getFeedbackStr(), 'alert alert-' . $messagetype);
//Append the bypass if there is some
$feedbacktext .= $environment_result->strToReport($environment_result->getBypassStr(), 'alert');
//Append the restrict if there is some
$feedbacktext .= $environment_result->strToReport($environment_result->getRestrictStr(), 'alert alert-important');
$report .= $feedbacktext;
// Add the row to the table
if ($environment_result->getPart() == 'custom_check') {
$otherdata[$messagetype][] = array($info, $report, $status);
} else {
$serverdata[$messagetype][] = array($type, $info, $report, $status);
}
}
}
$servertable->data = array_merge($serverdata['important'], $serverdata['warning'], $serverdata['success']);
$othertable->data = array_merge($otherdata['important'], $otherdata['warning'], $otherdata['success']);
$output = $this->heading(get_string('serverchecks', 'admin'));
$output .= html_writer::table($servertable);
if (count($othertable->data)) {
$output .= $this->heading(get_string('customcheck', 'admin'));
$output .= html_writer::table($othertable);
}
// Finally, if any error has happened, print the summary box.
if (!$result) {
$output .= bootstrap::alert_error(get_string('environmenterrortodo', 'admin'));
}
return $output;
}