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


PHP bootstrap::alert_error方法代码示例

本文整理汇总了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;
 }
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:29,代码来源:core_backup_renderer.php

示例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);
 }
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:20,代码来源:core_renderer.php

示例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;
 }
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:101,代码来源:core_admin_renderer.php


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