Fix problems when friendica is installed in a subpath; small CSS-Fixes

This commit is contained in:
friendica 2012-06-04 19:18:20 +02:00
parent 7115197a33
commit 2c80f61876
8 changed files with 47 additions and 35 deletions

View file

@ -480,7 +480,7 @@ function wdcal_get_list_range_params($day, $weekstartday, $num_days, $type)
/**
*
*/
function wdcal_print_feed()
function wdcal_print_feed($base_path = "")
{
$user_id = dav_compat_get_curr_user_id();
$cals = array();
@ -538,7 +538,7 @@ function wdcal_print_feed()
$ret['error'] = null;
foreach ($cals as $c) {
$events = $c->listItemsByRange($date[0], $date[1]);
$events = $c->listItemsByRange($date[0], $date[1], $base_path);
$ret["events"] = array_merge($ret["events"], $events);
}

View file

@ -113,9 +113,10 @@ abstract class AnimexxCalSource
* @abstract
* @param string $sd
* @param string $ed
* @param string $base_path
* @return array
*/
public abstract function listItemsByRange($sd, $ed);
public abstract function listItemsByRange($sd, $ed, $base_path);
/**
@ -134,4 +135,4 @@ abstract class AnimexxCalSource
return null;
}
}
}

View file

@ -249,7 +249,7 @@ class AnimexxCalSourcePrivate extends AnimexxCalSource
return $obj_id . ".ics";
}
private function jqcal2wdcal($row, $usr_id) {
private function jqcal2wdcal($row, $usr_id, $base_path) {
$evo = new DBClass_friendica_jqcalendar($row);
$not = q("SELECT COUNT(*) num FROM %s%snotifications WHERE `ical_uri` = '%s' AND `ical_recurr_uri` = '%s'",
CALDAV_SQL_DB, CALDAV_SQL_PREFIX, dbesc($row["ical_uri"]), $row["ical_recurr_uri"]
@ -274,8 +274,8 @@ class AnimexxCalSourcePrivate extends AnimexxCalSource
"location" => $evo->Location,
"attendees" => '',
"has_notification" => ($not[0]["num"] > 0 ? 1 : 0),
"url_detail" => "/dav/wdcal/" . $evo->ical_uri . "/",
"url_edit" => "/dav/wdcal/" . $evo->ical_uri . "/edit/",
"url_detail" => $base_path . $evo->ical_uri . "/",
"url_edit" => $base_path . $evo->ical_uri . "/edit/",
"special_type" => "",
);
return $arr;
@ -284,9 +284,10 @@ class AnimexxCalSourcePrivate extends AnimexxCalSource
/**
* @param string $sd
* @param string $ed
* @param string $base_path
* @return array
*/
public function listItemsByRange($sd, $ed)
public function listItemsByRange($sd, $ed, $base_path)
{
$usr_id = IntVal($this->calendarDb->uid);
@ -300,7 +301,7 @@ class AnimexxCalSourcePrivate extends AnimexxCalSource
$usr_id, $this->getNamespace(), $this->namespace_id, dbesc($von), dbesc($bis));
$events = array();
foreach ($evs as $row) $events[] = $this->jqcal2wdcal($row, $usr_id);
foreach ($evs as $row) $events[] = $this->jqcal2wdcal($row, $usr_id, $base_path);
return $events;
}