本文整理汇总了PHP中Jaws_Utils::RowColor方法的典型用法代码示例。如果您正苦于以下问题:PHP Jaws_Utils::RowColor方法的具体用法?PHP Jaws_Utils::RowColor怎么用?PHP Jaws_Utils::RowColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jaws_Utils
的用法示例。
在下文中一共展示了Jaws_Utils::RowColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Summary
/**
* Displays blog summary with some statistics
*
* @access public
* @return string XHTML template content
*/
function Summary()
{
$model = $this->gadget->model->load('Summary');
$summary = $model->GetSummary();
if (Jaws_Error::IsError($summary)) {
$summary = array();
}
$tpl = $this->gadget->template->loadAdmin('Summary.html');
$tpl->SetBlock('summary');
$tpl->SetVariable('menubar', $this->MenuBar('Summary'));
// Ok, start the stats!
$tpl->SetVariable('blog_stats', _t('BLOG_STATS'));
// First entry
$tpl->SetBlock('summary/item');
$bg = Jaws_Utils::RowColor(null);
$tpl->SetVariable('bgcolor', $bg);
$tpl->SetVariable('label', _t('BLOG_FIRST_ENTRY'));
if (isset($summary['min_date'])) {
$date = Jaws_Date::getInstance();
$tpl->SetVariable('value', $date->Format($summary['min_date']));
} else {
$tpl->SetVariable('value', '');
}
$tpl->ParseBlock('summary/item');
// Last entry
$tpl->SetBlock('summary/item');
$bg = Jaws_Utils::RowColor($bg);
$tpl->SetVariable('bgcolor', $bg);
$tpl->SetVariable('label', _t('BLOG_LAST_ENTRY'));
if (isset($summary['max_date'])) {
$date = Jaws_Date::getInstance();
$tpl->SetVariable('value', $date->Format($summary['max_date']));
} else {
$tpl->SetVariable('value', '');
}
$tpl->ParseBlock('summary/item');
// Blog entries
$tpl->SetBlock('summary/item');
$bg = Jaws_Utils::RowColor($bg);
$tpl->SetVariable('bgcolor', $bg);
$tpl->SetVariable('label', _t('BLOG_TOTAL_ENTRIES'));
$tpl->SetVariable('value', isset($summary['qty_posts']) ? $summary['qty_posts'] : '');
$tpl->ParseBlock('summary/item');
// Avg. entries per week
$tpl->SetBlock('summary/item');
$bg = Jaws_Utils::RowColor($bg);
$tpl->SetVariable('bgcolor', $bg);
$tpl->SetVariable('label', _t('BLOG_AVERAGE_ENTRIES'));
$tpl->SetVariable('value', isset($summary['AvgEntriesPerWeek']) ? $summary['AvgEntriesPerWeek'] : '');
$tpl->ParseBlock('summary/item');
// Comments
$tpl->SetBlock('summary/item');
$bg = Jaws_Utils::RowColor($bg);
$tpl->SetVariable('bgcolor', $bg);
$tpl->SetVariable('label', _t('BLOG_COMMENTS_RECEIVED'));
$tpl->SetVariable('value', isset($summary['CommentsQty']) ? $summary['CommentsQty'] : '');
$tpl->ParseBlock('summary/item');
// Recent entries
if (isset($summary['Entries']) && count($summary['Entries']) > 0) {
$tpl->SetBlock('summary/recent');
$tpl->SetVariable('title', _t('BLOG_RECENT_ENTRIES'));
$date = Jaws_Date::getInstance();
foreach ($summary['Entries'] as $e) {
$tpl->SetBlock('summary/recent/link');
$url = BASE_SCRIPT . '?gadget=Blog&action=EditEntry&id=' . $e['id'];
if ($e['published'] === false) {
$extra = '<span style="color: #999; font-size: 10px;"> [' . _t('BLOG_DRAFT') . '] </span>';
} else {
$extra = '';
}
$tpl->SetVariable('url', $url);
$tpl->SetVariable('title', $e['title']);
$tpl->SetVariable('extra', $extra);
$tpl->SetVariable('date', $date->Format($e['publishtime']));
$tpl->ParseBlock('summary/recent/link');
}
$tpl->ParseBlock('summary/recent');
}
$tpl->ParseBlock('summary');
return $tpl->Get();
}