<?php

class Warp_GoogleCalendar_Config
{
    private static function getPairedArray(&$result, $user, $file) {
       $array = @file("/usr/local/minerva/etc/users/$user/external/$file");
       # -1 stops odd-sized arrays, where the last line is broken/null
       for($i=0;$i<count($array)-1;$i+=2) {
          $result[$array[$i]] = $array[$i+1];
       }
    }

    public static function getGCalendarList($user) {
        $prv = self::getPairedArray($result, $user, "gcal");
        $pub = self::getPairedArray($result, "public", "gcal");
        return $result;
    }

    public static function getICalList($user) {
        $prv = self::getPairedArray($result, $user, "ical");
        $pub = self::getPairedArray($result, "public", "ical");
        return $result;
     }
}
?>

