DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: ScoutNet Calendar

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2004-03-28T17:16:49
Author:Carsten Horst
Email:carsten@sprog.de
Info 3:
Info 4:

EXT: ScoutNet Calendar

Extension Key: sp_scoutnetcalendar

Copyright 2003 - 2004, Carsten Horst, <carsten@sprog.de>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

EXT: ScoutNet Calendar 1

Introduction 1

What does it do? 1

Screenshots 2

Users manual 2

Adminstration 3

Configuration 3

Reference 3

Tutorial 4

Known problems 6

To-Do list 6

Changelog 6

Introduction

What does it do?

The primary intention of this extension is to fetch XML styled calendar data from the GermanScoutNet calendar project. The ScoutNet Calendar system is a calendar system of Germanscouting groups.

The fetched calendar entries could then be displayed in various ways (see Screenshots, tableand list style).

If you're not a member of Germanscouting groups, but want to use this extension, you can do this in two ways:

You have a source, which generates calendar data as XML data (remote mode)

You disable fetching external data, but insert the calendar entries manually (local mode)

This version of the extension has nothing to do with the 0.x ones. It is completely rewritten code and work'scompletely different.

Screenshots

img-1

img-2 img-3

Users manual

There are six different display modes of the calendar data:

  • the current month table
  • next n months table
  • list of todays entries
  • list of the next n days entries
  • list of entries of the current week
  • list of entries of the current month

You can display more than one of these modes on one page, if you insert more than one plugin on a page. If you enter the selector boxes on a page, the end usercan reduce the selected data specified by different categories.

Adminstration

Make sure that the XML data you fetch, is nicely formatted XML. Because XML is very strict and the parser will fail, if the syntax is not 100% correct!

To fetch data from the ScoutNet calendar project I have provided a ScoutNetcalendar template file (xml.tpl) in the pi subdirectory of this extension. Use this template to fetch correct data. You can do this e.g. with the following URL:

http://kalender.scoutnet.de/2.0/show.php?id=<calendar id>&template=http://www.yourdom.de/typo3conf/ext/sp_scoutnetcalendar/pi1/xml.tpl

I'm working with the calendar team to get the XML data without using a local template file.

After the data is fetched, every content in the database table tx_spscoutnetcalendar_entry is droppedand each entry is written in this database.

So the rendering and caching of the displayed content is completely managed by Typo3.

If you upgrade from a 0.x version you can completely drop the database table tx_spscoutnetcalendar it's not used any more.

Configuration

To use the extension you need at least two pages in your Typo tree: A Sysfolder to store the ScoutNet calendar definitions and a normal page where you want the calendar data to be displayed.

You can customize through some constant variables in your template how things are displayed on the front enddepending on the display mode:

  • Next n months tableBy default you will see a table displaying 12 months: The last two, the current and the next 9 months. This is achieved through two constant variables: startMonth=-2 and endMonth=9. It should now be clear how to change these values in the way you want the data be displayed. Remember startMonths < endMonths, everything else couldn'tmake sense.You can also change how many months will be displayed per row. The variable monthsInARow does this job. If you change this variable, you also have to change the template:In the template file (calendar.tmpl), found in the pi subdirectory of the extension, There is the section ###NMONTHS### which defines one row. If you change the value of monthsInARow e.g. To 6 this section must provide the following markers: ###MONTH1### ###MONTH2### ###MONTH3### ... ###MONTH6###
  • Next n days entry listWith the constant variable nextNDaysEntries you can control the number of days, from where the calendar entries should be displayed.

FAQ

Q: If I am using frames, howto change the target frame of links?

A: Set config.ATagParams = target="tgtframe"in the setup section of your template (Thanks to Frank Abschlag)

Reference

You can also change these constant values through the constant editor on your template page.

templateFile

Property

templateFile

Data type

string

Description

Template File: Used to render the Output

Default

EXT:sp_scoutnetcalendar/pi1/calendar.tmpl
disableFetching

Property

disableFetching

Data type

boolean

Description

If you set this to 1, no calendar data will be fetched from external sources

Default

0
enableCaching

Property

enableCaching

Data type

boolean

Description

Enable calendar entry caching. If you set this to 0 no data will be cached. It will be refetched on every page hit!!

Default

1
intervall

Property

intervall

Data type

string

Description

Intervall when the calendar cache should be refreshed (in sec.)

Default

86400
timeout

Property

timeout

Data type

integer

Description

Timeout while fetching XML date from remote site (in sec.)

Default

2
startDayOfWeek

Property

startDayOfWeek

Data type

integer

Description

Start day of the week: 0-Sunday, 1-Monday This is the day that appears in the first column of the calendar tables

Default

1
monthsInARow

Property

monthsInARow

Data type

int

Description

Months in a row: How much months did you define in the ###NMONTHS#

## part of the template

Default

4
startMonth

Property

startMonth

Data type

int

Description

The number of months before the current month to be displayed in the month list

Default

-2
endMonth

Property

endMonth

Data type

int

Description

The number of months after the current month to be displayed in the month list

Default

9
nextNDaysEntries

Property

nextNDaysEntries

Data type

int

Description

The number of days from where the calendar entries shouldbe displayed

Default

5
overlibConfig

Property

overlibConfig

Data type

string

Description

Configuration of the overlib popups

Default

AUTOSTATUSCAP,HAUTO,VAUTO,WIDTH,300,CSSCLASS,BGCLASS,'spscoutnetcalendar-olbg',FGCLASS,'spscoutnetcalendar-olfg',CAPTIONFONTCLASS,'spscoutnetcalendar-olcf',TEXTFONTCLASS,'spscoutnetcalendar-oltf'
dateFormat

Property

dateFormat

Data type

string

Description

The date format used to display date data (strftime syntax)

Default

%d.%m.%Y
timeFormat

Property

timeFormat

Data type

string

Description

The time format used to display time data (strftime syntax)

Default

%H:%M
sections

Property

sections

Data type

string list

Description

Section list to reduce displayed calendar data

Default

Wölflinge,Jungpfadfinder,Pfadfinder,Rover,Leiter
categories

Property

categories

Data type

string list, comma separated

Description

Category list for the drop down list in a calendar entry, while you create it in the backend

Default

[tsref:(constants).plugin.tx_spscoutnetcalendar]

In the setup section of your template are the CSS classes for this extension defined. The following classes are used:

::

a

.spscoutnetcalendar-today
.spscoutnetcalendar-day
.spscoutnetcalendar-month
.spscoutnetcalendar-month A:link
.spscoutnetcalendar-month A:visited
.spscoutnetcalendar-table
.spscoutnetcalendar-wd-row
.spscoutnetcalendar-row-even

b

.spscoutnetcalendar-row-odd
.spscoutnetcalendar-entry
.spscoutnetcalendar-title
.spscoutnetcalendar-date
.spscoutnetcalendar-olbg
.spscoutnetcalendar-olfg
.spscoutnetcalendar-olcf
.spscoutnetcalendar-oltf

The parsing engine expects XML data in the following format:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<!DOCTYPE ScoutNetCalendarData [
  <!ELEMENT ScoutNetCalendarData (Entry)+>
  <!ELEMENT Entry (CId, SDate, STime, EDate, ETime, Title, Place, Category, Section, Author, Association, Level, Info)>
  <!ELEMENT CId (#PCDATA)>
  <!ELEMENT SDate (#PCDATA)>
  <!ELEMENT STime (#PCDATA)>
  <!ELEMENT EDate (#PCDATA)>
  <!ELEMENT ETime (#PCDATA)>
  <!ELEMENT Title (#PCDATA)>
  <!ELEMENT Place (#PCDATA)>
  <!ELEMENT Category (#PCDATA)>
  <!ELEMENT Section (#PCDATA)>
  <!ELEMENT Author (#PCDATA)>
  <!ELEMENT Association (#PCDATA)>
  <!ELEMENT Level (#PCDATA)>
  <!ELEMENT Info (#PCDATA)>
]>

<ScoutNetCalendarData>
  <Entry>
    <CId>30</CId>
    <SDate>0,0,0,01,01,04</SDate>
    <STime></STime>
    <EDate>0,0,0,01,04,04</EDate>
    <ETime></ETime>
    <Title>Büroferien</Title>
    <Place></Place>
    <Category>Sonstiges</Category>
    <Section><![CDATA[img src=http://kalender.scoutnet.de/2.0/images/5.gif alt=Leiter]]></Section>
    <Author></Author>
    <Association>DPSG</Association>
    <Level>Diözese</Level>
    <Info></Info>
  </Entry>
</ScoutNetCalendarData>

Tutorial

You're free to use this extension in two different modes:

  • Remote mode You have a source where you can fetch a XML file with calendar entries in it.This is the way how the ScoutNet Community calendar system works.
  • Local mode You want to create every single calendar entry by yourself in the backend of your Typo3 system

((generated))

((generated))
Follow the steps below to get the calendar extension working in remote mode :
  • Install the extension via Extension Manager
  • Create ScoutNet calendar definitionentries in a Sysfolder (I suggest to create a new Sysfolder, because later also the calendar entries will be displayed in this folder for reference.
img-4

a

img-4

b

ScoutNet calendar name : The name of the calendar. Will later be displayed on the front end

Calendar ID : The calendar ID given to you by the ScoutNet calendar team. This ID must match the ID in the relevant calendar entries (<Cid> tag in the XML data).

URL : The URL where you want to fetch the XML data from (see Administration)

Last updates : Just for information. It's the date, when the calendar data was last updated

  • Create a new content element on the page, where you want to display calendar data
  • img-5 Insert the ScoutNet calendar definitions you just created in the field “Calendars to display”
  • Select the wanted display mode (See Screenshots)
  • That's it, now you should see some calendar data on your page.
Follow the steps below to get the calendar extension working in local mode :
  • Install the extension via Extension Manager
  • Create ScoutNet calendar definitionentries in a Sysfolder
img-6

a

img-6

b

ScoutNet calendar name : The name of the calendar. Will later be displayed on the front end

Calendar ID : The calendar ID to identify this calendar definition. This ID must match the ID in the relevant calendar entries

URL : leave this empty

Last updates : leave this empty

((Unknown Property))

a

b

Create calendar entries in the Sysfolder where the calendar definition resides.

img-7

a

img-7

b

img-8

To assign a calendar entry to a calendar definition, you must make sure, that the calendar ID's match!The format of the date and time fields are common Typo3 notation: type a 'd' for the current date or time.Via the constant variable categoriesyou can define a comma separated list of categories you can choose while you create a calendar entry. I know that this is not the way it should work, but as a workaround usable.

Set the Constant variable disableFetchingto 1

  • Create a new content element on the page, where you want to display calendar data
  • img-5 Insert the ScoutNet calendar definitions you just created in the field “Calendars to display”
  • Select the wanted display mode (See Screenshots)
  • That's it, now you should see some calendar data on your page.

Limitation:

There's no frontend editing possible for now.

Known problems

None yet.

To-Do list

Feel free to make suggestions!

If you think something is missing in the documentation, feel free to contact me as well.

Changelog

  • 1.0.2 – Due to a lack of functionality of the Windows C-funtion for date and time handling, the daynumber in the calendar table disappeared when there was an event. Changed the regarding function.
  • 1.0.1 – minor changes to make local mode usage more comfortable.extended Tutorial section.
  • 1.0.0 – completelyrewritten code base
  • 0.2.1 – Added documentation
  • 0.2.0 – Initial public release

img-9 EXT: ScoutNet Calendar - 6