[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] calendar/class.base.php, 1.1.2.1
From: |
nomail |
Subject: |
[Phpgroupware-cvs] calendar/class.base.php, 1.1.2.1 |
Date: |
Thu, 20 May 2004 18:39:31 -0000 |
Update of /calendar
Added Files:
Branch: proposal-branch
class.base.php
date: 2004/04/16 21:21:51; author: seek3r; state: Exp; lines: +140 -0
Log Message:
bringing savannah cvs back up to date with what we were doing on our private
cvs server. We will not be doing dev from this cvs tree
=====================================================================
No syntax errors detected in -
=====================================================================
<?php
/**************************************************************************\
* phpGroupWare
*
* http://www.phpgroupware.org
*
* This file written by Dan Kuykendall <address@hidden> *
* Copyright (C) 2003 Dan Kuykendall
*
*
-------------------------------------------------------------------------*
* This program is free software; you can redistribute it and/or modify
it *
* under the terms of the GNU General Public License as published by the
*
* Free Software Foundation; either version 2 of the License, or (at
your *
* option) any later version.
*
\**************************************************************************/
/* $Id: class.base.php,v 1.1.2.1 2004/04/16 21:21:51 seek3r Exp $ */
/* $Source: /cvsroot/phpgroupware/calendar/Attic/class.base.php,v $ */
$functions = array();
$functions['calendar_base'] = array(
'type'=>'internal',
'abstract'=>'Loads up the side menu data'
);
$functions['start'] = array(
'type'=>'public',
'title'=>'Calendar',
'abstract'=>'Starting point for the Calendar app'
);
$functions['add_event'] = array(
'type'=>'public',
'title'=>'Add a calendar event.',
'abstract'=>'Adds a calendar event.'
);
$functions['list_events'] = array(
'type'=>'public',
'title'=>'Show calendar events for a range of dates.',
'abstract'=>'Generates the list of events for a given data
space.'
);
$GLOBALS['docs']['calendar']['classes']['calendar_base'] = array(
'abstract'=>'Default class for the Calendar App',
'functions'=>$functions
);
$GLOBALS['calendar_base_menus_loaded'] = false;
class calendar_base
{
var $sec;
function calendar_base()
{
if (! $GLOBALS['calendar_base_menus_loaded'])
{
$GLOBALS['phpgw']->add_appmenu('App
menu','Home','skel.base.start');
$GLOBALS['phpgw']->add_appmenu('App
menu','Preferences','skel.base.prefs&appname=skel');
$GLOBALS['phpgw']->add_appmenu('App menu','ACL
Tester','skel.base.acl_tester');
$GLOBALS['phpgw']->add_appmenu('App menu','HTML
Outputted by app','skel.base.htmloutputtest');
$GLOBALS['phpgw']->add_appmenu('App
menu','Display all docs','skel.base.view_docs');
$GLOBALS['calendar_base_menus_loaded'] = true;
}
}
function start()
{
$args = new safe_args();
$args->set('answer', NOVAR, 'any');
$args = $args->get(func_get_args());
$result['answer'] = 'blah blah';
//$result['text'] =
validate($args['answer'],(BIT01|BIT02|BIT03|BIT04|BIT05|BIT06|BIT07|BIT08|BIT09|BIT10|BIT11|BIT12|BIT13|BIT14|BIT15|BIT17|BIT18|BIT19|BIT20));
$result['text'] = sanitize($args['answer'],'string');
return $result;
/*
$data =
file_get_contents(PHPGW_ROOT.SEP.'calendar'.SEP.'test.ics');
$t = createObject(calendar_icalendar);
$t->parsevCalendar($data);
print_r($t);
echo $t->exportvCalendar();
*/
/*
$data['start'] = 20040326;
$data['summary'] = 'test1';
$data['rrule'] = 'FREQ=YEARLY';
$hh = createObject('calendar_event',$data);
print_r($hh);
*/
$result['text'] = lang('You doubted my skill? You
bastard!');
// $GLOBALS['phpgw']->add_xsl('calendar.base');
return $result;
}
function list_events()
{
$args = new safe_args();
$args->set('uid',
$GLOBALS['phpgw_data']['user']['uid'], 'any');
$args->set('start', REQUIRED, 'any');
$args->set('end', REQUIRED, 'any');
$args = $args->get(func_get_args());
$sql = "SELECT * FROM phpgw_cal_events
WHERE ( DTSTART <
".$args['end']." and ".$args['start']." < DTEND)";
$dbresult = $GLOBALS['phpgw']->db->Execute($sql);
while (!$dbresult->EOF)
{
if($dbresult->fields['RRULE'] == 'NONE')
{
$events[] = $dbresult->fields;
}
else
{
/* We are now at a stage where we must
increment thru each potential reoccurance to see if any fall in our date space
*/
$rrule_parts = explode('=',
$dbresult->fields['RRULE']);
switch ($rrule_parts[1])
{
case 'DAILY':
$dbresult->fields['DTSTART'] = $dbresult->fields['DTSTART'];
break;
case 'WEEKLY':
break;
case 'MONTHLY':
break;
}
}
$dbresult->MoveNext();
}
print_r($events);
return $events;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] calendar/class.base.php, 1.1.2.1,
nomail <=