Revert "Agree on argument type."

This reverts commit 0f6b1be0e6.
This commit is contained in:
Thomas Tanghus 2012-06-15 00:53:13 +02:00
parent 0f6b1be0e6
commit 6d43e6565e
4 changed files with 10 additions and 10 deletions

View File

@ -45,7 +45,7 @@ foreach($lines as $line) {
}
$i++;
}
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true);
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), 1);
$id = $calendars[0]['id'];
foreach($uids as $uid) {
$prefix=$suffix=$content=array();

View File

@ -11,11 +11,11 @@ OCP\User::checkLoggedIn();
OCP\App::checkAppEnabled('calendar');
// Create default calendar ...
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true);
// if( count($calendars) == 0){
// OC_Calendar_Calendar::addCalendar(OCP\USER::getUser(),'Default calendar');
// $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true);
// }
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), 1);
if( count($calendars) == 0){
OC_Calendar_Calendar::addCalendar(OCP\USER::getUser(),'Default calendar');
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), 1);
}
$eventSources = array();
foreach($calendars as $calendar){

View File

@ -44,13 +44,13 @@ class OC_Calendar_Calendar{
/**
* @brief Returns the list of calendars for a specific user.
* @param string $uid User ID
* @param boolean $active Only return calendars with this $active state, default(=false) is don't care
* @param boolean $active Only return calendars with this $active state, default(=null) is don't care
* @return array
*/
public static function allCalendars($uid, $active=false){
public static function allCalendars($uid, $active=null){
$values = array($uid);
$active_where = '';
if ($active === true){
if (!is_null($active) && $active){
$active_where = ' AND active = ?';
$values[] = $active;
}

View File

@ -1,7 +1,7 @@
<?php
class OC_Search_Provider_Calendar extends OC_Search_Provider{
function search($query){
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true);
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), 1);
if(count($calendars)==0 || !OCP\App::isEnabled('calendar')){
//return false;
}