コード例 #1
0
ファイル: index.php プロジェクト: vojtajina/sitellite
if ($cgi->category == 'Sent') {
    $list = $msg->getSent(false, false, $limit, $cgi->offset, $cgi->orderBy, $cgi->sort);
} elseif ($cgi->category == 'Inbox') {
    $list = $msg->getFolder('', false, $limit, $cgi->offset, $cgi->orderBy, $cgi->sort);
} elseif ($cgi->category == 'Trash') {
    $list = $msg->getTrash($limit, $cgi->offset, $cgi->orderBy, $cgi->sort);
} else {
    $list = $msg->getFolder($cgi->category, false, $limit, $cgi->offset, $cgi->orderBy, $cgi->sort);
}
if ($cgi->category == 'Sent') {
    $dg = new DataGrid('sitellite_message', array('subject' => intl_get('Subject'), 'msg_date' => intl_get('Date'), 'recipients' => intl_get('To')), $limit);
    $dg->skipHeader('recipients');
} else {
    $dg = new DataGrid('sitellite_message', array('subject' => intl_get('Subject'), 'msg_date' => intl_get('Date'), 'from_user' => intl_get('From')), $limit);
    if ($cgi->category != 'Trash') {
        $dg->setDeleteUrl(site_prefix() . '/index/cms-messages-delete-action');
        $categories = $msg->categories();
        $dg->footer = template_simple('messages/footer.spt', array('list' => $categories, 'current' => $cgi->category));
    }
}
$dg->primaryKey('id');
$dg->setEditUrl(site_prefix() . '/index/cms-messages-view-action');
if ($cgi->category == 'Sent') {
    $dg->filter(array('subject' => 'filter_cms_messages_subject', 'msg_date' => 'filter_cms_messages_date', 'recipients' => 'filter_cms_messages_to'));
} else {
    $dg->filter(array('subject' => 'filter_cms_messages_subject', 'msg_date' => 'filter_cms_messages_date', 'from_user' => 'filter_cms_messages_from'));
}
$dg->rememberValue('category', $cgi->category);
$dg->list =& $list;
$dg->total =& $msg->total;
page_title(intl_get('Folder') . ': ' . $cgi->category);