Mastering Joomla! 1.5 Extension and Framework Development-第九章翻译-系统消息队列(2)

来源:互联网 发布:编程笔记本推荐2017 编辑:程序博客网 时间:2024/05/17 06:24

 

其他类型消息和message类型消息显示式样是一样的。假若想仅使用bespoke消息样式来格式化其他消息样式而不显示。这在用作调试时非常有用。

下面例子演示了如何给页面增加CSS样式,并通过前面所讲的method调用方式,来修改bespoke类型消息的显示样式。

$css = '/* Bespoke Error Messages */

#system-message dt.bespoke

{

display: none;

}

dl#system-message dd.bespoke ul

{

color: #30A427;

border-top: 3px solid #94CA8D;

border-bottom: 3px solid #94CA8D;

background: #C8DEC7 url(notice-bespoke.png) 4px 4px no-repeat;

}';

//$css变量赋于样式的字符串

$doc =& JFactory::getDocument();

$doc->addStyleDeclaration($css);

//给当前文档页面增加该部分css

Now when bespoke messages are rendered, they will appear like this:

现在bespoke类型消息显示样式被改变,显示如下。

图略244

 

原创粉丝点击