root/branches/release-26/php/lib/block.mtpages.php @ 1174

Revision 1174, 1.3 kB (checked in by bchoate, 23 months ago)

Updated copyright year for source.

Line 
1<?php
2# Movable Type (r) Open Source (C) 2001-2008 Six Apart, Ltd.
3# This program is distributed under the terms of the
4# GNU General Public License, version 2.
5#
6# $Id$
7
8require_once('block.mtentries.php');
9function smarty_block_mtpages($args, $content, &$ctx, &$repeat) {
10    $args['class'] = 'page';
11    if (isset($args['include_subfolders']) &&
12        $args['include_subfolders'] == 1)
13    {
14        $args['include_subcategories'] = 1;
15    }
16    if (isset($args['folder'])) {
17        $args['category'] = $args['folder'];
18    }
19
20    if(isset($args['no_folder'])) {
21        $folders =& $ctx->mt->db->fetch_folders(array("blog_id" => $ctx->stash('blog_id')));
22        $not_folder = '';
23        if (isset($folders)) {
24            foreach ($folders as $folder) {
25                if ($not_folder == '') {
26                    $not_folder = $folder['category_label'];
27                } else {
28                    $not_folder = $not_folder.' OR '.$folder['category_label'];
29                }
30            }
31        }
32        if ($not_folder != '') {
33            $args['category'] = "NOT ($not_folder)";
34        }
35    }
36
37    $localvars = array('current_timestamp', 'current_timestamp_end', 'current_archive_type');
38    $ctx->localize($localvars);
39
40    $out = smarty_block_mtentries($args, $content, $ctx, $repeat);
41
42    $ctx->restore($localvars);
43
44    return $out;
45}
46?>
Note: See TracBrowser for help on using the browser.