當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Skin::build_error_block方法代碼示例

本文整理匯總了PHP中Skin::build_error_block方法的典型用法代碼示例。如果您正苦於以下問題:PHP Skin::build_error_block方法的具體用法?PHP Skin::build_error_block怎麽用?PHP Skin::build_error_block使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Skin的用法示例。


在下文中一共展示了Skin::build_error_block方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ucfirst

// if it was a HEAD request, stop here
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'HEAD') {
    return;
}
// add language information, if known
if (isset($context['page_language'])) {
    $language = ' xml:lang="' . $context['page_language'] . '" ';
} else {
    $language = '';
}
// do our own rendering
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' . "\n" . '<html ' . $language . ' xmlns="http://www.w3.org/1999/xhtml">' . "\n" . '<head>' . "\n";
// the title
if (isset($context['page_title'])) {
    echo '<title>' . ucfirst(strip_tags($context['page_title'])) . '</title>';
}
// styles
echo '<style type="text/css" media="screen">' . "\n" . '<!--' . "\n" . '	body, body p {' . "\n" . '		font-family: Verdana, Arial, Helvetica, sans-serif;' . "\n" . '		font-size:	  x-small;' . "\n" . '		voice-family: "\\"}\\"";' . "\n" . '		voice-family: inherit;' . "\n" . '		font-size:	  small;' . "\n" . '	}' . "\n" . "\n" . '	body {' . "\n" . '		scrollbar-face-color: #FFFFAA;' . "\n" . '	}' . "\n" . "\n" . '	textarea {' . "\n" . '		border: 0px none;' . "\n" . '		width: 99%;' . "\n" . '		background-color: rgb(255, 255, 170);' . "\n" . '	}' . "\n" . '-->' . "\n" . '</style>' . "\n";
// end of meta information
echo "</head>\n<body>\n";
// display error messages, if any
echo Skin::build_error_block();
// render and display the content
if (isset($context['text'])) {
    echo $context['text'];
}
// debug output, if any
if (is_array($context['debug']) && count($context['debug'])) {
    echo "\n" . '<ul id="debug">' . "\n" . '<li>' . implode('</li>' . "\n" . '<li>', $context['debug']) . '<li>' . "\n" . '</ul>' . "\n";
}
echo "\n</body>\n</html>";
開發者ID:rair,項目名稱:yacs,代碼行數:31,代碼來源:panel.php

示例2: sprintf

 // link to the original page
 $context['text'] .= '<p>' . sprintf(i18n::s('The original page is located at %s'), Skin::build_link(Articles::get_permalink($item), Articles::get_permalink($item))) . "</p>\n";
 // insert anchor suffix
 if (is_object($anchor)) {
     $context['text'] .= $anchor->get_suffix();
 }
 //
 // special rendering if everything is ok
 //
 $text = '<html><body>' . "\n";
 // display the title
 if (isset($context['page_title']) && $context['page_title']) {
     $text .= Skin::build_block($context['page_title'], 'page_title');
 }
 // display error messages, if any
 $text .= Skin::build_error_block();
 // render and display the content, if any
 $text .= $context['text'] . "\n";
 $text .= '</body></html>' . "\n";
 // MS-WORD won't import pictures
 $text = preg_replace('/<img (.*?)\\/>/i', '', $text);
 // strip relative links
 $text = preg_replace('/<a (.*?)>(.*?)<\\/a>/is', '\\2', $text);
 //
 // transfer to the user agent
 //
 // handle the output correctly
 render_raw('application/msword; charset=' . $context['charset']);
 // suggest a download
 if (!headers_sent()) {
     $file_name = utf8::to_ascii(Skin::strip($context['page_title']) . '.doc');
開發者ID:rair,項目名稱:yacs,代碼行數:31,代碼來源:fetch_as_msword.php

示例3: echo_error

 /**
  * echo error messages
  *
  * You can override this function into your skin
  */
 public static function echo_error()
 {
     global $context;
     // delegate this to the skin
     if (is_callable(array('Skin', 'build_error_block'))) {
         echo Skin::build_error_block();
     }
 }
開發者ID:rair,項目名稱:yacs,代碼行數:13,代碼來源:page.php

示例4: foreach


//.........這裏部分代碼省略.........
         case 'bottom':
             if ($text) {
                 $text = '<div class="bottom"' . $id . '>' . $text . '</div>';
             }
             break;
         case 'caution':
             Skin::define_img('CAUTION_FLAG', 'codes/caution.gif', i18n::s('<b>Warning:</b> '), '!!!');
             if ($text) {
                 $text = '<div class="caution"' . $id . '>' . CAUTION_FLAG . $text . '</div>';
             }
             break;
         case 'center':
             if ($text) {
                 $text = '<div class="center"' . $id . '>' . $text . '</div>';
             }
             break;
         case 'code':
             if ($text) {
                 $text = '<pre' . $id . '>' . $text . '</pre>';
             }
             break;
         case 'decorated':
             if ($text) {
                 $text = '<table class="decorated"' . $id . '><tr>' . '<td class="image">' . DECORATED_IMG . '</td>' . '<td class="content">' . $text . '</td>' . "</tr></table>\n";
             }
             break;
         case 'description':
             if ($text) {
                 $text = '<div class="description"' . $id . '>' . Codes::beautify($text, $options) . '</div>' . "\n";
             }
             break;
         case 'error':
             if ($text) {
                 $text = Skin::build_error_block($text, $id);
             }
             break;
         case 'header1':
         case 'title':
             if ($text) {
                 $text = '<h2' . $id . '><span>' . Codes::beautify_title($text) . '</span></h2>';
             }
             break;
         case 'header2':
         case 'subtitle':
             if ($text) {
                 $text = '<h3' . $id . '><span>' . Codes::beautify_title($text) . '</span></h3>';
             }
             break;
         case 'header3':
             if ($text) {
                 $text = '<h4' . $id . '>' . Codes::beautify_title($text) . '</h4>';
             }
             break;
         case 'header4':
             if ($text) {
                 $text = '<h5' . $id . '>' . Codes::beautify_title($text) . '</h5>';
             }
             break;
         case 'header5':
             if ($text) {
                 $text = '<h6' . $id . '>' . Codes::beautify_title($text) . '</h6>';
             }
             break;
         case 'indent':
             if ($text) {
                 $text = '<div class="indent"' . $id . '>' . $text . '</div>';
開發者ID:rair,項目名稱:yacs,代碼行數:67,代碼來源:skin_skeleton.php


注:本文中的Skin::build_error_block方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。