$vcdef = array('lpath' => $lpcname, 'auth' => $auth_needed, 'description' => $descriptive_string, 'enabled' => $enabled, 'version' => 'vc-0.2', 'rscs' => array($rsc_class => array( 'hnd' => $rschnd, 'owner_id' => $cal_owner_id, 'hndarg4' => $hnd_argument4, 'qmeth' => $qmeth, 'qarg' => $qarg, 'access' => $rights, ), .... , .... , ) );
Below a simple example. Note that in this example three rewritable directives are used: _fn_month_start()
and _fn_month_end()
, that will expand to specific dates on load time of the definitions. That is when some virtual calendar $vc
does a $vc->fromArray($my_vcdef)
example:
$vcdef = array('lpath' => 'demoical/personal.ics', 'auth' => ':basic', 'description' => 'a calendar with personal events', 'enabled' => 1, 'version' => 'vc-0.2', 'rscs' => array('calendar.bocalupdate' => array( 'hnd' => 'bocalupdate_vevents', 'owner_id' => $user_id, 'qmeth' => 'search', 'qarg' => array( 'start' => '_fn_month_start()', 'end' => '_fn_month_end()', 'enum_recuring' => false, 'daywise' => false, 'owner' => $user_id, 'date_format' => 'server' ) 'access' => 'RW' ) 'infolog.boinfolog' => array( 'hnd' => 'boinfolog_vtodos', 'owner_id' => $user_id, 'qmeth' => 'search', 'qarg' => array( 'start' => $last_year . "-01-01", 'end' => $next_year . "-12-31", 'enum_recuring' => false, 'daywise' => false, 'owner' => '_fn_authuser', 'date_format' => 'server' ) 'access' => 'R' ) ) )
Just so will every directive '_fn_keyword()'
field be evaluated (via lookup table for security) by a private class function from the directivedefs group.
For example: fn_authuser
will be executed by:
_fn_authuser() { return $GLOBALS['egw_info']['user']['account_id']; }