]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/calendar.pm
calendar: Add creation time limits to user's pagespec
[ikiwiki.git] / IkiWiki / Plugin / calendar.pm
index dcf2b6d641abd309428ddd231dfcefe5907faaa3..5aac958841793b3e92cf4b6fe2820c1aa8c4245e 100644 (file)
@@ -66,7 +66,8 @@ sub format_month (@) {
        my %params=@_;
 
        my %linkcache;
-       foreach my $p (pagespec_match_list($params{page}, $params{pages},
+       foreach my $p (pagespec_match_list($params{page}, 
+                               "creation_year($params{year}) and creation_month($params{month}) and ($params{pages})",
                                # add presence dependencies to update
                                # month calendar when pages are added/removed
                                deptype => deptype("presence"))) {
@@ -126,6 +127,7 @@ sub format_month (@) {
        if (exists $pagesources{"$archivebase/$params{year}/$params{month}"}) {
                $url = htmllink($params{page}, $params{destpage}, 
                        "$archivebase/$params{year}/".$params{month},
+                       noimageinline => 1,
                        linktext => " $monthname ");
        }
        add_depends($params{page}, "$archivebase/$params{year}/$params{month}",
@@ -133,6 +135,7 @@ sub format_month (@) {
        if (exists $pagesources{"$archivebase/$pyear/$pmonth"}) {
                $purl = htmllink($params{page}, $params{destpage}, 
                        "$archivebase/$pyear/$pmonth",
+                       noimageinline => 1,
                        linktext => " \&larr ");
        }
        add_depends($params{page}, "$archivebase/$pyear/$pmonth",
@@ -140,6 +143,7 @@ sub format_month (@) {
        if (exists $pagesources{"$archivebase/$nyear/$nmonth"}) {
                $nurl = htmllink($params{page}, $params{destpage}, 
                        "$archivebase/$nyear/$nmonth",
+                       noimageinline => 1,
                        linktext => " \&rarr ");
        }
        add_depends($params{page}, "$archivebase/$nyear/$nmonth",
@@ -205,8 +209,9 @@ EOF
                        }
                        $calendar.=qq{\t\t<td class="$tag $downame{$wday}">};
                        $calendar.=htmllink($params{page}, $params{destpage}, 
-                                           $linkcache{"$params{year}/$params{month}/$day"},
-                                           "linktext" => "$day");
+                               $linkcache{"$params{year}/$params{month}/$day"},
+                               noimageinline => 1,
+                               "linktext" => "$day");
                        $calendar.=qq{</td>\n};
                }
                else {
@@ -255,18 +260,21 @@ sub format_year (@) {
        if (exists $pagesources{"$archivebase/$params{year}"}) {
                $url = htmllink($params{page}, $params{destpage}, 
                        "$archivebase/$params{year}",
+                       noimageinline => 1,
                        linktext => "$params{year}");
        }
        add_depends($params{page}, "$archivebase/$params{year}", deptype("presence"));
        if (exists $pagesources{"$archivebase/$pyear"}) {
                $purl = htmllink($params{page}, $params{destpage}, 
                        "$archivebase/$pyear",
+                       noimageinline => 1,
                        linktext => "\&larr;");
        }
        add_depends($params{page}, "$archivebase/$pyear", deptype("presence"));
        if (exists $pagesources{"$archivebase/$nyear"}) {
                $nurl = htmllink($params{page}, $params{destpage}, 
                        "$archivebase/$nyear",
+                       noimageinline => 1,
                        linktext => "\&rarr;");
        }
        add_depends($params{page}, "$archivebase/$nyear", deptype("presence"));
@@ -293,26 +301,22 @@ EOF
                my $tag;
                my $mtag=sprintf("%02d", $month);
                if ($month == $params{month}) {
-                       if ($pagesources{"$archivebase/$params{year}/$mtag"}) {
-                               $tag = 'this_month_link';
-                       }
-                       else {
-                               $tag = 'this_month_nolink';
-                       }
+                       $tag = 'year-calendar-this-month';
                }
                elsif ($pagesources{"$archivebase/$params{year}/$mtag"}) {
-                       $tag = 'month_link';
+                       $tag = 'year-calendar-month-link';
                } 
                elsif ($future_month && $month >= $future_month) {
-                       $tag = 'month_future';
+                       $tag = 'year-calendar-month-future';
                } 
                else {
-                       $tag = 'month_nolink';
+                       $tag = 'year-calendar-month-nolink';
                }
 
                if ($pagesources{"$archivebase/$params{year}/$mtag"}) {
                        $murl = htmllink($params{page}, $params{destpage}, 
                                "$archivebase/$params{year}/$mtag",
+                               noimageinline => 1,
                                linktext => "$monthabbr");
                        $calendar.=qq{\t<td class="$tag">};
                        $calendar.=$murl;