Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

Dcal

Summary: a calendar recipe
Version:2008-12-30
Prerequisites: pmwiki 2.1.27
Status:alpha
Maintainer:CarlosAB

Description

A calendar that uses two markups, one to create entries and other to render the calendar. You can have multiple instances in the same page, you can change the month and year dinamicaly for each one, you can use pagelist to select entries and extract information out of wikipages and use it inside the calendar.

Note

Not all functions are fully implemented, but the recipe is still usable.

  • periodicity
  • duration

Installation

Download the dcal.gz file, unzip it with gunzip, place it inside cookbook/ folder and do a include_once("cookbook/dcal.php"); inside your local/config.php and play with it.

DOWNLOAD:dcal.gzΔ

Syntax

dcalin is a markup that fills an array with information that will be displayed afterwards by dcal.

 (:dcalin
    id="alpha num"  defaults to to "default" sets the calendar id <table id="dcal-?????">

    ut or utime="num" give dcalin unixtime an it will do the rest, defaults to empty

    y or year="num" defaults to current year 
    m or month="num" defaults to current month
    d or day="num" defaults to current day
    h or hour="num" defaults to current hour
    mn or minute="num" defaults to current minute

    dr or duration="num" defaults to empty
    pr or periodicity="hourly,daily,weekly,monthly,yearly" defaults to empty

    ln or link="alpha num char" defaults to nothing
    cl or class="alpha num" defaults to empty
    tx or text="alpaha num char"  defaults to nothing
 :)

dcal makes the table with headers, prev and next links, caption with current month, creates links or just display text related to each dcalin entry

 (:dcal
    id="alpha num" defaults to to "default" sets the calendar id <table id="dcal-?????">
    n or name="alpha num char" replaces calendar caption 

    y or year="num" defaults to current year 
    m or month="num" defaults to current month
    ml or monthlink="alpha num char" defaults to nothing, a link to other place than the current wiki

    fd or firstday="num" defines the day in which weeknames will start
    wl or weeknamelength="num" defines the number of letters week names will have

    pv or prev="alpha num char" defaults to (month - 1)
    nx or next="alpha num char" defaults to (month + 1)
    pd or prevdecor="alpha num char" defaults to html entitie &lsaquo
    nd or nextdecor="alpha num char" defaults to html entitie &rsaquo

    ppv or pprev="alpha num char" defaults to (year - 1)
    nnx or nnext="alpha num char" defaults to (year + 1)
    ppd or ppredecor="alpha num char" defaults to html entitie &laquo
    nnd or nnextdecor="alpha num char" defaults to html entitie &raquo

    w or width="num + (pct|px|em|ex)" defines width for the hole calendar

    dn or dynamic="num" make dcal accept parameters sent trough the GET and POST,
                  store it in cookies (if >1) and if >= 3 shows a selection form as the title
                  if >= 4 creates a form and checkboxes for each item
    st or sendto="alpha num char" form action, defaults to self $PageUrl
    si or sendindex='alpha num char' name for the array you want on sent items, defauts to calitems
    sm or sendmethod="(GET|POST)" defauls to post
    sl or sendlabel="alpha num char" name that will appear in the send button

    sw or showeek="num" shows week number defaults to 0 (no show)
    lc or locale="alpha" changes current locale
 :)

Release Notes

  • 2008-12-30 : First version

Known Issues

  • it will generate wrong links if EnablePathInfo is on and links look like "Blog/Day", there is no checking so when you use dcalin, do it like this (:dcalin link=http://www.pmwiki.org/wiki/Blog/Day :), if you don't, links will look like this http://site/wiki/Main/Blog/Day, where Main is the group for http://site/wiki .

See Also

Contributors

CarlosAB December 30, 2008, at 04:21 AM

Comments

Any comments and changes are welcome.

User notes?: If you use, used or reviewed this recipe, you can add your name. The following format is recognized:
* (+) Optional positive comment. Name, date
* (-) Optional negative comment. Name, date

These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

Edit - History - Print - Recent Changes - Search
Page last modified on January 02, 2009, at 08:32 AM