Nucleus 管理画面でのエラーメッセージをマークアップ
- 投稿日 : 2010-03-10, 19:32
- 最終更新日時 : 2010-12-21 17:24:24(履歴)
- タグ(Nucleus / CSS)
- カテゴリ(Nucleus)
- 記し人(luvsic)[PDF]
- 閲覧数(3565)
Nucleus 管理画面でのエラーメッセージはかなりそっけない。これは書き出されるHTMLがマークアップされていないため、デザインできなからだ。HTMLソースは下記のようになる。
これはさすがに参っているので、コアハックしてエラーメッセージのデザインできるようにするためのメモ書き。

ADMIN.php 5200行あたり
/**
* Error message
* @param string $msg message that will be shown
*/
function error($msg) {
$this->pagehead();
?>
<h2>Error!</h2>
<?php echo $msg;
echo "<br />";
echo "<a href='index.php' onclick='history.back()'>"._BACK."</a>";
$this->pagefoot();
exit;
}
これを、下記のように編集する。
/**
* Error message
* @param string $msg message that will be shown
*/
function error($msg) {
$this->pagehead();
?>
<div class="errorMsgArea"><h2>Error!</h2><p>
<?php echo $msg;
echo "</p>";
echo "<a href='index.php' onclick='history.back()'>"._BACK."</a></div>";
$this->pagefoot();
exit;
}
CSSのサンプル
.errorMsgArea p {
text-indent: 1.5em;
color: yellow;
font-weight: bold;
}
No comments yet