Nucleus 管理画面でのエラーメッセージはかなりそっけない。これは書き出されるHTMLがマークアップされていないため、デザインできなからだ。HTMLソースは下記のようになる。
<h2>Error!
</h2>
”本文が空のアイテムは投稿できません!”
<br />
<a href='index.php' onclick='history.back()'>戻る
</a>
これはさすがに参っているので、コアハックしてエラーメッセージのデザインできるようにするためのメモ書き。
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;
}
I confirm. And I have faced it. We can communicate on this theme.
Abusy, 2010-04-17 01:28 #