diff --git a/.gitignore b/.gitignore index ea8e5bd42f..312dc0433a 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,7 @@ RCS/* # netbeans nbproject -.DS_Store \ No newline at end of file +# geany +*.geany + +.DS_Store diff --git a/COPYING-README b/COPYING-README index b0caca2ad2..49e035186e 100644 --- a/COPYING-README +++ b/COPYING-README @@ -2,13 +2,14 @@ Files in ownCloud are licensed under the Affero General Public License version 3 the text of which can be found in COPYING-AGPL, or any later version of the AGPL, unless otherwise noted. -Components of ownCloud: -* jQuery is dual licensed under MIT and GPL -* HTTP is three clause BSD license -* MDB2 uses a custom license in the BSD style -* User is AGPL -* XML/RPC is both MIT and PHP license +Licensing of components: +* jQuery: MIT / GPL +* HTTP: 3 clause BSD +* MDB2: BSD style custom +* User: AGPL +* XML/RPC: MIT / PHP +* Silk icons: Creative Commons Attribution All unmodified files from these and other sources retain their original copyright and license notices: see the relevant individual files. -Attribution information for ownCloud is contained in the AUTHORS file. +Attribution information for ownCloud is contained in the AUTHORS file. \ No newline at end of file diff --git a/apps/calendar/ajax/getcal.php b/apps/calendar/ajax/getcal.php index a65c6cf260..3d43677075 100644 --- a/apps/calendar/ajax/getcal.php +++ b/apps/calendar/ajax/getcal.php @@ -28,43 +28,674 @@ $select_year = $_GET["year"]; $user_timezone = OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone", "Europe/London"); foreach($events as $event) { - if ($select_year != substr($event['startdate'], 0, 4)) + if($select_year != substr($event['startdate'], 0, 4) && $event["repeating"] == false) continue; - $object = Sabre_VObject_Reader::read($event['calendardata']); - $vevent = $object->VEVENT; - $dtstart = $vevent->DTSTART; - $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent); - $start_dt = $dtstart->getDateTime(); - $start_dt->setTimezone(new DateTimeZone($user_timezone)); - $end_dt = $dtend->getDateTime(); - $end_dt->setTimezone(new DateTimeZone($user_timezone)); - $year = $start_dt->format('Y'); - $month = $start_dt->format('n') - 1; // return is 0 based - $day = $start_dt->format('j'); - $hour = $start_dt->format('G'); - if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { - $hour = 'allday'; - } + if($select_year == substr($event['startdate'], 0, 4) && $event["repeating"] == false){ + $object = Sabre_VObject_Reader::read($event['calendardata']); + $vevent = $object->VEVENT; + $dtstart = $vevent->DTSTART; + $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent); + $start_dt = $dtstart->getDateTime(); + $start_dt->setTimezone(new DateTimeZone($user_timezone)); + $end_dt = $dtend->getDateTime(); + $end_dt->setTimezone(new DateTimeZone($user_timezone)); + $year = $start_dt->format('Y'); + $month = $start_dt->format('n') - 1; // return is 0 based + $day = $start_dt->format('j'); + $hour = $start_dt->format('G'); + if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { + $hour = 'allday'; + } - $return_event = array(); - foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop) - { - $return_event[$prop] = $event[$prop]; + $return_event = array(); + foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop) + { + $return_event[$prop] = $event[$prop]; + } + $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); + $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); + $return_event['description'] = $event['summary']; + if ($hour == 'allday') + { + $return_event['allday'] = true; + } + if (isset($return[$year][$month][$day][$hour])) + { + $return[$year][$month][$day][$hour][] = $return_event; + } + else + { + $return[$year][$month][$day][$hour] = array(1 => $return_event); + } } - $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); - $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); - $return_event['description'] = $event['summary']; - if ($hour == 'allday') - { - $return_event['allday'] = true; - } - if (isset($return[$year][$month][$day][$hour])) - { - $return[$year][$month][$day][$hour][] = $return_event; - } - else - { - $return[$year][$month][$day][$hour] = array(1 => $return_event); + if($event["repeating"] == 1){ + $object = Sabre_VObject_Reader::read($event['calendardata']); + $vevent = $object->VEVENT; + //echo substr_count($event["calendardata"], "EXDATE"); + $numofelements = substr_count($vevent->RRULE, ";"); + $properties = array("FREQ"=>"false", "UNTIL"=>"false", "COUNT"=>"false", "INTERVAL"=>"false", "BYDAY"=>"false", "BYMONTHDAY"=>"false", "BYWEEKNO"=>"false", "BYMONTH"=>"false", "BYYEARDAY"=>"false", "BYSETPOS"=>"false"); + $exruleproperties = array("FREQ"=>"false", "UNTIL"=>"false", "COUNT"=>"false", "INTERVAL"=>"false", "BYDAY"=>"false", "BYMONTHDAY"=>"false", "BYWEEKNO"=>"false", "BYMONTH"=>"false", "BYYEARDAY"=>"false", "BYSETPOS"=>"false"); + $byday = array("MO"=>"false", "TU"=>"false", "WE"=>"false", "TH"=>"false", "FR"=>"false", "SA"=>"false", "SU"=>"false"); + if($numofelements != 0){ + $rrule = explode(";", $vevent->RRULE); + for($i = 0;$i <= $numofelements;$i++){ + $rule = explode("=", $rrule[$i]); + $property = $rule[0]; + $value = $rule[1]; + $properties[$property] = $value; + } + if($properties["BYDAY"] != "false"){ + $numofdays = substr_count($properties["BYDAY"], ","); + if($numofdays == 0){ + if(strlen($properties["BYDAY"]) != 2){ + $lenght = strlen($properties["BYDAY"]); + switch($lenght){ + case "3": + $properties["BYSETPOS"] = substr($properties["BYDAY"],0,1); + $properties["BYDAY"] = substr($properties["BYDAY"],1,2); + break; + case "4": + $properties["BYSETPOS"] = substr($properties["BYDAY"],0,2); + $properties["BYDAY"] = substr($properties["BYDAY"],2,2); + break; + case "5": + $properties["BYSETPOS"] = substr($properties["BYDAY"],0,3); + $properties["BYDAY"] = substr($properties["BYDAY"],3,2); + break; + case "6": + $properties["BYSETPOS"] = substr($properties["BYDAY"],0,4); + $properties["BYDAY"] = substr($properties["BYDAY"],4,2); + break; + } + } + $byday[$properties["BYDAY"]] = true; + + }else{ + $days = explode(",", $properties["BYDAY"]); + for($i = 0;$i <= $numofdays;$i++){ + $day = $days[$i]; + $byday[$day] = true; + } + } + } + }else{ + $rule = explode("=", $vevent->RRULE); + $properties[$rule[0]] = $rule[1]; + } + if($properties["INTERVAL"] == "false"){ + $properties["INTERVAL"] = 1; + } + $count = 0; //counts all loops + $countedoutputs = 0; //counts only the outputs + $countchecker = true; + $dtstart = $vevent->DTSTART; + $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent); + $start_dt = $dtstart->getDateTime(); + $start_dt->setTimezone(new DateTimeZone($user_timezone)); + $end_dt = $dtend->getDateTime(); + $end_dt->setTimezone(new DateTimeZone($user_timezone)); + $firststart_year = $start_dt->format('Y'); + $firststart_month = $start_dt->format('n'); + $firststart_day = $start_dt->format('j'); + $hour = $start_dt->format('G'); + $interval = 0; + if($properties["UNTIL"] != "false"){ + $until = $properties["UNTIL"]; + $until_year = substr($until, 0, 4); + $until_month = substr($until, 4, 2); + $until_day = substr($until, 6, 2); + } + //print_r($properties); + //print_r($byday); + if($properties["FREQ"] == "DAILY"){ + if($properties["BYDAY"] == "false"){ + $byday = array("MO"=>"1", "TU"=>"1", "WE"=>"1", "TH"=>"1", "FR"=>"1", "SA"=>"1", "SU"=>"1"); + } + while(date("Y", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)) <= $select_year && $countchecker == true){ + if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)), 0, 2))] == "1"){ + $newunixtime = mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval); + $year = date("Y", $newunixtime); + $month = date("n", $newunixtime) - 1; // return is 0 based + $day = date("j", $newunixtime); + if($properties["UNTIL"] != "false"){ + if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ + break; + } + } + if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { + $hour = 'allday'; + } + $return_event = array(); + foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ + $return_event[$prop] = $event[$prop]; + } + $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); + $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); + $return_event['description'] = $event['summary']; + $interval = $properties["INTERVAL"]; + $countedoutputs++; + if($properties["COUNT"] != "false"){ + if($countedoutputs == $properties["COUNT"]){ + $countchecker = false; + } + } + if ($hour == 'allday'){ + $return_event['allday'] = true; + } + if (isset($return[$year][$month][$day][$hour])){ + $return[$year][$month][$day][$hour][] = $return_event; + }else{ + $return[$year][$month][$day][$hour] = array(1 => $return_event); + } + } + $count++; + } + } + if($properties["FREQ"] == "WEEKLY"){ + if($properties["BYDAY"] == "false"){ + $byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year)), 0, 2))] = "1"; + } + while(date("Y", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)) <= $select_year && $countchecker == true){ + if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)), 0, 2))] == "1"){ + $newunixtime = mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval); + $year = date("Y", $newunixtime); + $month = date("n", $newunixtime) - 1; // return is 0 based + $day = date("j", $newunixtime); + if($properties["UNTIL"] != "false"){ + if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ + break; + } + } + if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { + $hour = 'allday'; + } + $return_event = array(); + foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ + $return_event[$prop] = $event[$prop]; + } + $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); + $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); + $return_event['description'] = $event['summary']; + $interval = $properties["INTERVAL"]; + $countedoutputs++; + if($properties["COUNT"] != "false"){ + if($countedoutputs == $properties["COUNT"]){ + $countchecker = false; + } + } + if ($hour == 'allday'){ + $return_event['allday'] = true; + } + if (isset($return[$year][$month][$day][$hour])){ + $return[$year][$month][$day][$hour][] = $return_event; + }else{ + $return[$year][$month][$day][$hour] = array(1 => $return_event); + } + } + $count++; + } + } + if($properties["FREQ"] == "MONTHLY"){ + if(substr_count($properties["BYMONTHDAY"], ",") != 0){ + $numofBYMONTHDAY = substr_count($properties["BYMONTHDAY"], ","); + if($numofBYMONTHDAY == 0){ + $BYMONTHDAY = array(); + $BYMONTHDAY[0] = $properties["BYMONTHDAY"]; + }else{ + $BYMONTHDAY = explode(",", $properties["BYMONTHDAY"]); + } + while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year)) <= $select_year && $countchecker == true){ + for($i = 0;$i <= $numofBYMONTHDAY;$i++){ + $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $BYMONTHDAY[$i], $firststart_year); + $year = date("Y", $newunixtime); + $month = date("n", $newunixtime) - 1; // return is 0 based + $day = date("j", $newunixtime); + if($properties["UNTIL"] != "false"){ + if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ + break; + } + } + if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { + $hour = 'allday'; + } + $return_event = array(); + foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ + $return_event[$prop] = $event[$prop]; + } + $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); + $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); + $return_event['description'] = $event['summary']; + $interval = $properties["INTERVAL"]; + $countedoutputs++; + if($properties["COUNT"] != "false"){ + if($countedoutputs == $properties["COUNT"]){ + $countchecker = false; + } + } + if ($hour == 'allday'){ + $return_event['allday'] = true; + } + if (isset($return[$year][$month][$day][$hour])){ + $return[$year][$month][$day][$hour][] = $return_event; + }else{ + $return[$year][$month][$day][$hour] = array(1 => $return_event); + } + } + $count++; + } + } + //if($properties["BYMONTHDAY"] != "false"){ + if($properties["BYSETPOS"] == "false"){ + while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year)) <= $select_year && $countchecker == true){ + $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year); + $year = date("Y", $newunixtime); + $month = date("n", $newunixtime) - 1; // return is 0 based + $day = date("j", $newunixtime); + if($properties["UNTIL"] != "false"){ + if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ + break; + } + } + if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { + $hour = 'allday'; + } + $return_event = array(); + foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ + $return_event[$prop] = $event[$prop]; + } + $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); + $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); + $return_event['description'] = $event['summary']; + $interval = $properties["INTERVAL"]; + $countedoutputs++; + if($properties["COUNT"] != "false"){ + if($countedoutputs == $properties["COUNT"]){ + $countchecker = false; + } + } + if ($hour == 'allday'){ + $return_event['allday'] = true; + } + if (isset($return[$year][$month][$day][$hour])){ + $return[$year][$month][$day][$hour][] = $return_event; + }else{ + $return[$year][$month][$day][$hour] = array(1 => $return_event); + } + $count++; + } + }else{ + if(!is_nan($properties["BYSETPOS"]) && $properties["BYSETPOS"] >= 1){ + while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){ + $lastdayofmonth = date("t", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)); + $matches = 0; + $matchedday = ""; + for($i = 1;$i <= $lastdayofmonth;$i++){ + $thisday = date("j", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year)); + $thisdayname = strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year)),0,2)); + //echo $thisdayname . " " . $thisday . "\n"; + if($byday[$thisdayname] == 1){ + $matches++; + } + if($matches == $properties["BYSETPOS"]){ + $matchedday = $thisday; + $i = 32; + } + } + $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year); + $year = date("Y", $newunixtime); + $month = date("n", $newunixtime) - 1; // return is 0 based + $day = $matchedday; + if($properties["UNTIL"] != "false"){ + if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ + break; + } + } + if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { + $hour = 'allday'; + } + $return_event = array(); + foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ + $return_event[$prop] = $event[$prop]; + } + $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); + $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); + $return_event['description'] = $event['summary']; + $interval = $properties["INTERVAL"]; + $countedoutputs++; + if($properties["COUNT"] != "false"){ + if($countedoutputs == $properties["COUNT"]){ + $countchecker = false; + } + } + if ($hour == 'allday'){ + $return_event['allday'] = true; + } + if (isset($return[$year][$month][$day][$hour])){ + $return[$year][$month][$day][$hour][] = $return_event; + }else{ + $return[$year][$month][$day][$hour] = array(1 => $return_event); + } + $count++; + } + }elseif(!is_nan($properties["BYSETPOS"]) && $properties["BYSETPOS"] <= -1){ + while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){ + $lastdayofmonth = date("t", mktime(0,0,0, $firststart_month + ($count * $interval), 1, $firststart_year)); + $matches = 0; + $matchedday = ""; + for($i = $lastdayofmonth;$i >= 1;$i--){ + $thisday = date("j", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year)); + $thisdayname = strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year)),0,2)); + //echo $thisdayname . " " . $thisday . "\n"; + if($byday[$thisdayname] == 1){ + $matches++; + } + if($matches == $properties["BYSETPOS"]){ + $matchedday = $thisday; + $i = 0; + } + } + $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year); + $year = date("Y", $newunixtime); + $month = date("n", $newunixtime) - 1; // return is 0 based + $day = $matchedday; + if($properties["UNTIL"] != "false"){ + if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ + break; + } + } + if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { + $hour = 'allday'; + } + $return_event = array(); + foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ + $return_event[$prop] = $event[$prop]; + } + $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); + $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); + $return_event['description'] = $event['summary']; + $interval = $properties["INTERVAL"]; + $countedoutputs++; + if($properties["COUNT"] != "false"){ + if($countedoutputs == $properties["COUNT"]){ + $countchecker = false; + } + } + if ($hour == 'allday'){ + $return_event['allday'] = true; + } + if (isset($return[$year][$month][$day][$hour])){ + $return[$year][$month][$day][$hour][] = $return_event; + }else{ + $return[$year][$month][$day][$hour] = array(1 => $return_event); + } + $count++; + } + //} + } + } + if(strlen($properties["BYDAY"]) == 2){ + while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){ + if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)), 0, 2))] == "1"){ + $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year); + $year = date("Y", $newunixtime); + $month = date("n", $newunixtime) - 1; // return is 0 based + $day = date("j", $newunixtime); + if($properties["UNTIL"] != "false"){ + if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ + break; + } + } + if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { + $hour = 'allday'; + } + $return_event = array(); + foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ + $return_event[$prop] = $event[$prop]; + } + $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); + $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); + $return_event['description'] = $event['summary']; + $interval = $properties["INTERVAL"]; + $countedoutputs++; + if($properties["COUNT"] != "false"){ + if($countedoutputs == $properties["COUNT"]){ + $countchecker = false; + } + } + if ($hour == 'allday'){ + $return_event['allday'] = true; + } + if (isset($return[$year][$month][$day][$hour])){ + $return[$year][$month][$day][$hour][] = $return_event; + }else{ + $return[$year][$month][$day][$hour] = array(1 => $return_event); + } + } + $count++; + } + }else{ + while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){ + $newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval)); + $year = date("Y", $newunixtime); + $month = $month - 1; // return is 0 based + $day = $dateofweekone; + if($properties["UNTIL"] != "false"){ + if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ + break; + } + } + if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { + $hour = 'allday'; + } + $return_event = array(); + foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ + $return_event[$prop] = $event[$prop]; + } + $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); + $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); + $return_event['description'] = $event['summary']; + $interval = $properties["INTERVAL"]; + $countedoutputs++; + if($properties["COUNT"] != "false"){ + if($countedoutputs == $properties["COUNT"]){ + $countchecker = false; + } + } + if ($hour == 'allday'){ + $return_event['allday'] = true; + } + if (isset($return[$year][$month][$day][$hour])){ + $return[$year][$month][$day][$hour][] = $return_event; + }else{ + $return[$year][$month][$day][$hour] = array(1 => $return_event); + } + $count++; + } + } + } + if($properties["FREQ"] == "YEARLY"){ + if($properties["BYMONTH"] != "false"){ + if($properties["BYMONTHDAY"] == false){ + $properties["BYMONTHDAY"] = date("j", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year)); + } + if($properties["BYDAY"] == "false"){ + while(date("Y", mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){ + $newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval)); + $year = date("Y", $newunixtime); + $month = date("n", $newunixtime) - 1; // return is 0 based + $day = date("j", $newunixtime); + if($properties["UNTIL"] != "false"){ + if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ + break; + } + } + if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { + $hour = 'allday'; + } + $return_event = array(); + foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ + $return_event[$prop] = $event[$prop]; + } + $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); + $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); + $return_event['description'] = $event['summary']; + $interval = $properties["INTERVAL"]; + $countedoutputs++; + if($properties["COUNT"] != "false"){ + if($countedoutputs == $properties["COUNT"]){ + $countchecker = false; + } + } + if ($hour == 'allday'){ + $return_event['allday'] = true; + } + if (isset($return[$year][$month][$day][$hour])){ + $return[$year][$month][$day][$hour][] = $return_event; + }else{ + $return[$year][$month][$day][$hour] = array(1 => $return_event); + } + $count++; + } + } + if(strlen($properties["BYDAY"]) == 2){ + while(date("Y", mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){ + $newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval)); + $year = date("Y", $newunixtime); + $month = date("n", $newunixtime) - 1; // return is 0 based + $day = date("j", $newunixtime); + if($properties["UNTIL"] != "false"){ + if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ + break; + } + } + if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { + $hour = 'allday'; + } + $return_event = array(); + foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ + $return_event[$prop] = $event[$prop]; + } + $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); + $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); + $return_event['description'] = $event['summary']; + $interval = $properties["INTERVAL"]; + $countedoutputs++; + if($properties["COUNT"] != "false"){ + if($countedoutputs == $properties["COUNT"]){ + $countchecker = false; + } + } + if ($hour == 'allday'){ + $return_event['allday'] = true; + } + if (isset($return[$year][$month][$day][$hour])){ + $return[$year][$month][$day][$hour][] = $return_event; + }else{ + $return[$year][$month][$day][$hour] = array(1 => $return_event); + } + $count++; + } + }else{ + $number = substr($properties["BYDAY"],0,1); + $weekday = substr($properties["BYDAY"],1,2); + $month = $properties["BYMONTH"]; + $dateofweekone = ""; + for($i = 0; $i <= 7;$i++){ + if(strtoupper(substr(date("D", mktime(0,0,0, $properties["BYMONTH"], $i, $select_year)), 0, 2)) == $weekday){ + $dateofweekone = date("j", mktime(0,0,0, $properties["BYMONTH"], $i, $select_year)); + $i = 8; + } + } + if($number != 1){ + $dateofweekone = $dateofweekone + (7 * ($number - 1)); + } + while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){ + $newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval)); + $year = date("Y", $newunixtime); + $month = $month - 1; // return is 0 based + $day = $dateofweekone; + if($properties["UNTIL"] != "false"){ + if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ + break; + } + } + if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { + $hour = 'allday'; + } + $return_event = array(); + foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ + $return_event[$prop] = $event[$prop]; + } + $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); + $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); + $return_event['description'] = $event['summary']; + $interval = $properties["INTERVAL"]; + $countedoutputs++; + if($properties["COUNT"] != "false"){ + if($countedoutputs == $properties["COUNT"]){ + $countchecker = false; + } + } + if ($hour == 'allday'){ + $return_event['allday'] = true; + } + if (isset($return[$year][$month][$day][$hour])){ + $return[$year][$month][$day][$hour][] = $return_event; + }else{ + $return[$year][$month][$day][$hour] = array(1 => $return_event); + } + $count++; + } + } + }elseif($properties["BYYEARDAY"] != false){ + $numofyeardays = substr_count($properties["BYYEARDAY"], ","); + if($numofyeardays == 0){ + $yeardays = array(); + $yeardays[0] = $properties["BYYEARDAY"]; + }else{ + $yeardays = explode(",", $properties["BYYEARDAY"]); + } + while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval)) + ($yeardays[$numofyeardays]-1) * 86400) <= $select_year && $countchecker == true){ + for($i = 0;$i <= $numofyeardays;$i++){ + $newunixtime = mktime(0,0,0, 1, 1, $firststart_year + ($count * $interval)) + ($yeardays[$i] -1) * 86400; + $year = date("Y", $newunixtime); + $month = date("n", $newunixtime) - 1; // return is 0 based + $day = date("j", $newunixtime); + if($properties["UNTIL"] != "false"){ + if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ + break; + } + } + if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { + $hour = 'allday'; + } + $return_event = array(); + foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ + $return_event[$prop] = $event[$prop]; + } + $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); + $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); + $return_event['description'] = $event['summary']; + $interval = $properties["INTERVAL"]; + $countedoutputs++; + if($properties["COUNT"] != "false"){ + if($countedoutputs == $properties["COUNT"]){ + $countchecker = false; + } + } + if ($hour == 'allday'){ + $return_event['allday'] = true; + } + if (isset($return[$year][$month][$day][$hour])){ + $return[$year][$month][$day][$hour][] = $return_event; + }else{ + $return[$year][$month][$day][$hour] = array(1 => $return_event); + } + } + $count++; + } + } + } } } OC_JSON::encodedPrint($return); diff --git a/apps/calendar/css/style.css b/apps/calendar/css/style.css index 5e19b88f55..80d29ca897 100644 --- a/apps/calendar/css/style.css +++ b/apps/calendar/css/style.css @@ -5,7 +5,7 @@ * See the COPYING-README file. */ -#view {margin-left: 10px; float: left; font-size: 12px;} +#view { float: left; font-size: 12px; height: 100%;} #datecontrol {text-align: center;} #datecontrol_left{font-size: 12px;} #datecontrol_right{font-size: 12px;} @@ -17,7 +17,6 @@ #editentry_dialog {display: none;} #parsingfail_dialog{display: none;} -#view {margin-left: 10px; float: left; font-size: 12px; height: 100%;} #calendar_holder {height: 100%; width: 100%;} #onedayview, #oneweekview, #fourweeksview, #onemonthview, #listview {display: none; position: absolute;bottom: 0; right: 0; left: 160px; top: 80px;} #onedayview table {margin: 0; padding: 0; width: 100%; height: 100%; border-spacing:1px; background: #EEEEEE;} @@ -59,5 +58,5 @@ color:#A9A9A9; select#category{width:140px;} button.category{margin:0 3px;} -.calendar-colorpicker-color{display:inline-block;width:20px;height:20px;margin-right:2px;cursor:pointer;} -.calendar-colorpicker-color.active{background-image:url("../../../core/img/jquery-ui/ui-icons_222222_256x240.png");background-position:-62px -143px;} +.calendar-colorpicker-color{display:inline-block;width:20px;height:20px;margin-right:2px;cursor:pointer;border:2px solid transparent;} +.calendar-colorpicker-color.active{border:2px solid black;} diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js index 131325007a..87954b7aac 100644 --- a/apps/calendar/js/calendar.js +++ b/apps/calendar/js/calendar.js @@ -491,8 +491,6 @@ Calendar={ // based on jquery-colorpicker at jquery.webspirited.com var obj = $('.colorpicker', container); var picker = $('
'); - var size = 20; - //build an array of colors var colors = {}; $(obj).children('option').each(function(i, elm) { @@ -501,7 +499,7 @@ Calendar={ colors[i].label = $(elm).text(); }); for (var i in colors) { - picker.append(''); + picker.append(''); } picker.delegate(".calendar-colorpicker-color", "click", function() { $(obj).val($(this).attr('rel')); diff --git a/apps/calendar/templates/settings.php b/apps/calendar/templates/settings.php index 19a1a543b4..4f50928393 100644 --- a/apps/calendar/templates/settings.php +++ b/apps/calendar/templates/settings.php @@ -11,34 +11,36 @@ OC_UTIL::addStyle('', 'jquery.multiselect'); ?>
- -
+ + - + -
- -
+ +
+
- t('Calendar CalDAV syncing address:');?> -
+ t('Calendar CalDAV syncing address:');?> +
diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php index 083f48e112..ca95a68c6c 100644 --- a/apps/files_sharing/get.php +++ b/apps/files_sharing/get.php @@ -30,8 +30,9 @@ if ($source !== false) { foreach (OC_Files::getdirectorycontent($source) as $i) { $i['date'] = OC_Util::formatDate($i['mtime'] ); if ($i['type'] == 'file') { - $i['extention'] = substr($i['name'], strrpos($i['name'], ".")); - $i['basename'] = substr($i['name'], 0, strrpos($i['name'], ".")); + $fileinfo = pathinfo($i['name']); + $i['basename'] = $fileinfo['filename']; + $i['extention'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : ''; } $i['directory'] = substr($i['directory'], $rootLength); if ($i['directory'] == "/") { @@ -70,7 +71,7 @@ if ($source !== false) { header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Pragma: public"); - header("Content-Disposition: filename=".basename($source)); + header('Content-Disposition: filename="'.basename($source).'"'); header("Content-Type: " . $mimetype); header("Content-Length: " . OC_Filesystem::filesize($source)); //download the file diff --git a/apps/gallery/ajax/cover.php b/apps/gallery/ajax/cover.php index 44d7302851..d83f4daaa5 100644 --- a/apps/gallery/ajax/cover.php +++ b/apps/gallery/ajax/cover.php @@ -1,5 +1,7 @@ 'error', 'data' => array( 'message' => 'You need to log in.'))); - exit(); -} $box_size = 200; $album_name = $_GET['album']; $x = $_GET['x']; diff --git a/apps/gallery/ajax/createAlbum.php b/apps/gallery/ajax/createAlbum.php index 3a490bdc3b..610f761b72 100644 --- a/apps/gallery/ajax/createAlbum.php +++ b/apps/gallery/ajax/createAlbum.php @@ -1,14 +1,11 @@ 'error', 'data' => array( 'message' => 'You need to log in.'))); - exit(); -} +OC_JSON::checkLoggedIn(); +OC_JSON::checkAppEnabled('gallery'); $stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_albums ("uid_owner", "album_name") VALUES ("'.OC_User::getUser().'", "'.$_GET['album_name'].'")'); $stmt->execute(array()); -echo json_encode(array( 'status' => 'success', 'name' => $_GET['album_name'])); +OC_JSON::success(array('name' => $_GET['album_name'])); ?> diff --git a/apps/gallery/ajax/getAlbums.php b/apps/gallery/ajax/getAlbums.php index 2829dae81f..38bea74636 100644 --- a/apps/gallery/ajax/getAlbums.php +++ b/apps/gallery/ajax/getAlbums.php @@ -1,10 +1,7 @@ 'error', 'message' => 'You need to log in')); - exit(); -} +OC_JSON::checkLoggedIn(); +OC_JSON::checkAppEnabled('gallery'); $a = array(); $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ?'); @@ -17,6 +14,6 @@ while ($r = $result->fetchRow()) { $a[] = array('name' => $album_name, 'numOfItems' => min($tmp_res->numRows(), 10)); } -echo json_encode(array('status'=>'success', 'albums'=>$a)); +OC_JSON::success(array('albums'=>$a)); ?> diff --git a/apps/gallery/ajax/getCovers.php b/apps/gallery/ajax/getCovers.php index 57737f2fdd..d84bf2a790 100644 --- a/apps/gallery/ajax/getCovers.php +++ b/apps/gallery/ajax/getCovers.php @@ -1,5 +1,7 @@ 'error', 'data' => array( 'message' => 'You need to log in.'))); - exit(); -} $box_size = 200; $album_name= $_GET['album_name']; @@ -61,6 +58,12 @@ while (($i = $result->fetchRow()) && $counter < $numOfItems) { header('Content-Type: image/png'); +$offset = 3600 * 24; +// calc the string in GMT not localtime and add the offset +header("Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"); +header('Cache-Control: max-age=3600, must-revalidate'); +header('Pragma: public'); + imagepng($targetImg); imagedestroy($targetImg); ?> diff --git a/apps/gallery/ajax/scanForAlbums.php b/apps/gallery/ajax/scanForAlbums.php index a04ad62b1b..de0b141a36 100644 --- a/apps/gallery/ajax/scanForAlbums.php +++ b/apps/gallery/ajax/scanForAlbums.php @@ -1,14 +1,11 @@ 'error', 'message' => 'You need to log in')); - exit(); -} - -echo json_encode(array( 'status' => 'success', 'albums' => OC_GALLERY_SCANNER::scan(''))); -//echo json_encode(array('status' => 'success', 'albums' => array(array('name' => 'test', 'imagesCount' => 1, 'images' => array('dupa'))))); +OC_JSON::success(array('albums' => OC_GALLERY_SCANNER::scan(''))); +//OC_JSON::success(array('albums' => array(array('name' => 'test', 'imagesCount' => 1, 'images' => array('dupa'))))); ?> diff --git a/apps/gallery/ajax/thumbnail.php b/apps/gallery/ajax/thumbnail.php index db428eeff3..f24782390f 100644 --- a/apps/gallery/ajax/thumbnail.php +++ b/apps/gallery/ajax/thumbnail.php @@ -1,5 +1,7 @@ 'error', 'data' => array( 'message' => 'You need to log in.'))); - exit(); -} $box_size = 200; $img = $_GET['img']; diff --git a/apps/gallery/appinfo/app.php b/apps/gallery/appinfo/app.php index 5760bb149d..8f855c470e 100644 --- a/apps/gallery/appinfo/app.php +++ b/apps/gallery/appinfo/app.php @@ -8,7 +8,7 @@ OC_App::addNavigationEntry( array( 'id' => 'gallery_index', 'order' => 20, 'href' => OC_Helper::linkTo('gallery', 'index.php'), - 'icon' => OC_Helper::linkTo('', 'core/img/filetypes/image.png'), + 'icon' => OC_Helper::imagePath('core', 'places/picture.svg'), 'name' => 'Gallery')); class OC_GallerySearchProvider extends OC_Search_Provider{ @@ -17,7 +17,7 @@ OC_App::addNavigationEntry( array( $result = $stmt->execute(array(OC_User::getUser(),'%'.$query.'%')); $results=array(); while($row=$result->fetchRow()){ - $results[]=new OC_Search_Result($row['album_name'],'',OC_Helper::linkTo( 'apps/gallery', 'index.php?view='.$row['album_name']),'Galleries'); + $results[]=new OC_Search_Result($row['album_name'],'',OC_Helper::linkTo('apps/gallery', 'index.php?view='.$row['album_name']),'Galleries'); } return $results; } diff --git a/apps/gallery/index.php b/apps/gallery/index.php index c8d5892e55..87fdafcf13 100644 --- a/apps/gallery/index.php +++ b/apps/gallery/index.php @@ -2,6 +2,7 @@ require_once('../../lib/base.php'); OC_Util::checkLoggedIn(); +OC_Util::checkAppEnabled('gallery'); OC_App::setActiveNavigationEntry( 'gallery_index' ); diff --git a/apps/gallery/lib_scanner.php b/apps/gallery/lib_scanner.php index fcd9b0acb6..5490c4a55a 100644 --- a/apps/gallery/lib_scanner.php +++ b/apps/gallery/lib_scanner.php @@ -42,7 +42,7 @@ class OC_GALLERY_SCANNER { $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE `album_id` = ? AND `file_path` = ?'); $result = $stmt->execute(array($albumId, $img)); if ($result->numRows() == 0) { - $stmt = OC_DB::prepare('INSERT OR REPLACE INTO *PREFIX*gallery_photos (`album_id`, `file_path`) VALUES (?, ?)'); + $stmt = OC_DB::prepare('REPLACE INTO *PREFIX*gallery_photos (`album_id`, `file_path`) VALUES (?, ?)'); $stmt->execute(array($albumId, $img)); } } diff --git a/apps/media/appinfo/app.php b/apps/media/appinfo/app.php index dd1a830a94..475a33500f 100644 --- a/apps/media/appinfo/app.php +++ b/apps/media/appinfo/app.php @@ -29,5 +29,5 @@ OC_APP::registerPersonal('media','settings'); OC_App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' )); -OC_App::addNavigationEntry( array( 'id' => 'media_index', 'order' => 2, 'href' => OC_Helper::linkTo( 'media', 'index.php' ), 'icon' => OC_Helper::imagePath( 'core', 'filetypes/audio.svg' ), 'name' => $l->t('Music') )); +OC_App::addNavigationEntry(array('id' => 'media_index', 'order' => 2, 'href' => OC_Helper::linkTo('media', 'index.php'), 'icon' => OC_Helper::imagePath('core', 'places/music.svg'), 'name' => $l->t('Music'))); ?> diff --git a/apps/media/css/music.css b/apps/media/css/music.css index 8575e6334a..67d5607519 100644 --- a/apps/media/css/music.css +++ b/apps/media/css/music.css @@ -1,6 +1,6 @@ #controls ul.jp-controls { padding:0; } #controls ul.jp-controls li { display:inline; } -#controls ul.jp-controls li a { position:absolute; padding:.8em 1em; } +#controls ul.jp-controls li a { position:absolute; padding:.8em 1em .8em 0; } a.jp-play, a.jp-pause { left:2.5em; } a.jp-pause { display:none; } a.jp-next { left:5em; } @@ -39,7 +39,7 @@ tr.album td.artist { padding-left:1em; } tr.song td.artist { padding-left:2em; } .add {margin: 0 0.5em 0 0; } -#scan { position:absolute; right:13em; top:0em; } +#scan { position:absolute; right:13.5em; top:0em; } #scan .start { position:relative; display:inline; float:right; } #scan .stop { position:relative; display:inline; float:right; } #scan #scanprogressbar { position:relative; display:inline-block; width:10em; height:1.5em; top:.4em; } diff --git a/apps/user_openid/appinfo/info.xml b/apps/user_openid/appinfo/info.xml index 332d2199dd..37be15abfd 100644 --- a/apps/user_openid/appinfo/info.xml +++ b/apps/user_openid/appinfo/info.xml @@ -7,5 +7,4 @@ AGPL Robin Appelman 2 - diff --git a/core/css/styles.css b/core/css/styles.css index 84a024f95b..5d4df586a8 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -50,7 +50,7 @@ input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-b input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-shadow:#ffeedd 0 1px 0; -moz-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; } /* CONTENT ------------------------------------------------------------------ */ -#controls { width:100%; top:3.5em; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; } +#controls { padding: 0 0.5em; width:100%; top:3.5em; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; } #controls .button { display:inline-block; } #content { margin:3.5em 0 0 12.5em; } #leftcontent, .leftcontent { position:fixed; overflow: auto; top:6.4em; width:20em; background:#f8f8f8; border-right:1px solid #ddd; } @@ -117,7 +117,7 @@ tbody tr:hover, tr:active { background-color:#f8f8f8; } #quotatext {padding: .6em 1em;} div.jp-play-bar, div.jp-seek-bar { padding:0; } -.pager { list-style:none; float:right; display:inline; margin:.7em 12.7em 0 0; } +.pager { list-style:none; float:right; display:inline; margin:.7em 13em 0 0; } .pager li { display:inline-block; } li.error { width:640px; margin:4em auto; padding:1em 1em 1em 4em; background:#ffe .8em .8em no-repeat; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; } diff --git a/core/img/filetypes/audio.png b/core/img/filetypes/audio.png index 4c844425d6..a8b3ede3df 100644 Binary files a/core/img/filetypes/audio.png and b/core/img/filetypes/audio.png differ diff --git a/core/img/filetypes/c.png b/core/img/filetypes/c.png new file mode 100644 index 0000000000..34a05cccf0 Binary files /dev/null and b/core/img/filetypes/c.png differ diff --git a/core/img/filetypes/code.png b/core/img/filetypes/code.png new file mode 100644 index 0000000000..0c76bd1297 Binary files /dev/null and b/core/img/filetypes/code.png differ diff --git a/core/img/filetypes/cplusplus.png b/core/img/filetypes/cplusplus.png new file mode 100644 index 0000000000..a87cf847cb Binary files /dev/null and b/core/img/filetypes/cplusplus.png differ diff --git a/core/img/filetypes/csharp.png b/core/img/filetypes/csharp.png new file mode 100644 index 0000000000..ffb8fc932f Binary files /dev/null and b/core/img/filetypes/csharp.png differ diff --git a/core/img/filetypes/css.png b/core/img/filetypes/css.png new file mode 100644 index 0000000000..23f3101811 Binary files /dev/null and b/core/img/filetypes/css.png differ diff --git a/core/img/filetypes/database.png b/core/img/filetypes/database.png new file mode 100644 index 0000000000..3d09261a26 Binary files /dev/null and b/core/img/filetypes/database.png differ diff --git a/core/img/filetypes/file.png b/core/img/filetypes/file.png index 4979044889..8b8b1ca000 100644 Binary files a/core/img/filetypes/file.png and b/core/img/filetypes/file.png differ diff --git a/core/img/filetypes/flash.png b/core/img/filetypes/flash.png new file mode 100644 index 0000000000..5769120b1b Binary files /dev/null and b/core/img/filetypes/flash.png differ diff --git a/core/img/filetypes/folder.png b/core/img/filetypes/folder.png new file mode 100644 index 0000000000..784e8fa482 Binary files /dev/null and b/core/img/filetypes/folder.png differ diff --git a/core/img/filetypes/font.png b/core/img/filetypes/font.png new file mode 100644 index 0000000000..81e41de7d3 Binary files /dev/null and b/core/img/filetypes/font.png differ diff --git a/core/img/filetypes/h.png b/core/img/filetypes/h.png new file mode 100644 index 0000000000..e902abb076 Binary files /dev/null and b/core/img/filetypes/h.png differ diff --git a/core/img/filetypes/html.png b/core/img/filetypes/html.png new file mode 100644 index 0000000000..55d1072eaf Binary files /dev/null and b/core/img/filetypes/html.png differ diff --git a/core/img/filetypes/ical.png b/core/img/filetypes/ical.png new file mode 100644 index 0000000000..658913852d Binary files /dev/null and b/core/img/filetypes/ical.png differ diff --git a/core/img/filetypes/image.png b/core/img/filetypes/image.png index 980a7c6981..4a158fef7e 100644 Binary files a/core/img/filetypes/image.png and b/core/img/filetypes/image.png differ diff --git a/core/img/filetypes/link.png b/core/img/filetypes/link.png new file mode 100644 index 0000000000..68f21d3011 Binary files /dev/null and b/core/img/filetypes/link.png differ diff --git a/core/img/filetypes/model.png b/core/img/filetypes/model.png new file mode 100644 index 0000000000..7851cf34c9 Binary files /dev/null and b/core/img/filetypes/model.png differ diff --git a/core/img/filetypes/ms-excel.png b/core/img/filetypes/ms-excel.png new file mode 100644 index 0000000000..abcd93689a Binary files /dev/null and b/core/img/filetypes/ms-excel.png differ diff --git a/core/img/filetypes/ms-powerpoint.png b/core/img/filetypes/ms-powerpoint.png new file mode 100644 index 0000000000..b4aaad9a45 Binary files /dev/null and b/core/img/filetypes/ms-powerpoint.png differ diff --git a/core/img/filetypes/msword.png b/core/img/filetypes/msword.png new file mode 100644 index 0000000000..813f712f72 Binary files /dev/null and b/core/img/filetypes/msword.png differ diff --git a/core/img/filetypes/pdf.png b/core/img/filetypes/pdf.png new file mode 100644 index 0000000000..8f8095e46f Binary files /dev/null and b/core/img/filetypes/pdf.png differ diff --git a/core/img/filetypes/php.png b/core/img/filetypes/php.png new file mode 100644 index 0000000000..7868a25945 Binary files /dev/null and b/core/img/filetypes/php.png differ diff --git a/core/img/filetypes/presentation.png b/core/img/filetypes/presentation.png new file mode 100644 index 0000000000..b4aaad9a45 Binary files /dev/null and b/core/img/filetypes/presentation.png differ diff --git a/core/img/filetypes/readme.txt b/core/img/filetypes/readme.txt new file mode 100644 index 0000000000..400a64d785 --- /dev/null +++ b/core/img/filetypes/readme.txt @@ -0,0 +1,22 @@ +Silk icon set 1.3 + +_________________________________________ +Mark James +http://www.famfamfam.com/lab/icons/silk/ +_________________________________________ + +This work is licensed under a +Creative Commons Attribution 2.5 License. +[ http://creativecommons.org/licenses/by/2.5/ ] + +This means you may use it for any purpose, +and make any changes you like. +All I ask is that you include a link back +to this page in your credits. + +Are you using this icon set? Send me an email +(including a link or picture if available) to +mjames@gmail.com + +Any other questions about this icon set please +contact mjames@gmail.com \ No newline at end of file diff --git a/core/img/filetypes/rss.png b/core/img/filetypes/rss.png new file mode 100644 index 0000000000..315c4f4fa6 Binary files /dev/null and b/core/img/filetypes/rss.png differ diff --git a/core/img/filetypes/ruby.png b/core/img/filetypes/ruby.png new file mode 100644 index 0000000000..f59b7c4365 Binary files /dev/null and b/core/img/filetypes/ruby.png differ diff --git a/core/img/filetypes/script.png b/core/img/filetypes/script.png new file mode 100644 index 0000000000..63fe6ceff5 Binary files /dev/null and b/core/img/filetypes/script.png differ diff --git a/core/img/filetypes/spreadsheet.png b/core/img/filetypes/spreadsheet.png new file mode 100644 index 0000000000..abcd93689a Binary files /dev/null and b/core/img/filetypes/spreadsheet.png differ diff --git a/core/img/filetypes/svg.png b/core/img/filetypes/svg.png new file mode 100644 index 0000000000..a1291c2dfa Binary files /dev/null and b/core/img/filetypes/svg.png differ diff --git a/core/img/filetypes/text.png b/core/img/filetypes/text.png new file mode 100644 index 0000000000..813f712f72 Binary files /dev/null and b/core/img/filetypes/text.png differ diff --git a/core/img/filetypes/vcf.png b/core/img/filetypes/vcf.png new file mode 100644 index 0000000000..c02f315d20 Binary files /dev/null and b/core/img/filetypes/vcf.png differ diff --git a/core/img/filetypes/video.png b/core/img/filetypes/video.png new file mode 100644 index 0000000000..b0ce7bb198 Binary files /dev/null and b/core/img/filetypes/video.png differ diff --git a/core/img/filetypes/x-.png b/core/img/filetypes/x-.png new file mode 100644 index 0000000000..8443c23eb9 Binary files /dev/null and b/core/img/filetypes/x-.png differ diff --git a/core/img/places/file.png b/core/img/places/file.png new file mode 100644 index 0000000000..4979044889 Binary files /dev/null and b/core/img/places/file.png differ diff --git a/core/img/filetypes/file.svg b/core/img/places/file.svg similarity index 100% rename from core/img/filetypes/file.svg rename to core/img/places/file.svg diff --git a/core/img/places/music.png b/core/img/places/music.png new file mode 100644 index 0000000000..4c844425d6 Binary files /dev/null and b/core/img/places/music.png differ diff --git a/core/img/filetypes/audio.svg b/core/img/places/music.svg similarity index 100% rename from core/img/filetypes/audio.svg rename to core/img/places/music.svg diff --git a/core/img/places/picture.png b/core/img/places/picture.png new file mode 100644 index 0000000000..980a7c6981 Binary files /dev/null and b/core/img/places/picture.png differ diff --git a/core/img/filetypes/image.svg b/core/img/places/picture.svg similarity index 100% rename from core/img/filetypes/image.svg rename to core/img/places/picture.svg diff --git a/files/css/files.css b/files/css/files.css index 1766d03d96..a8419e972e 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -10,7 +10,7 @@ .file_upload_form, #file_newfolder_form { display:inline; float: left;} #fileSelector, #file_upload_submit, #file_newfolder_submit { display:none; } .file_upload_wrapper, #file_newfolder_name { background-repeat:no-repeat; background-position:.5em .5em; padding-left:2em; } -.file_upload_wrapper { font-weight:bold; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; padding-left:0; overflow:hidden; position:relative; margin:.1em 1em;} +.file_upload_wrapper { font-weight:bold; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; padding-left:0; overflow:hidden; position:relative; margin:.1em 1em .1em 0em;} .file_upload_wrapper .file_upload_button_wrapper { position:absolute; top:0; left:0; width:100%; height:100%; cursor:pointer; z-index:1000; } #file_newfolder_name { background-image:url('../../core/img/places/folder.svg'); font-weight:normal; width:7em; } diff --git a/lib/app.php b/lib/app.php index cd4a7293e4..b9eea483a5 100644 --- a/lib/app.php +++ b/lib/app.php @@ -200,23 +200,36 @@ class OC_App{ */ public static function getSettingsNavigation(){ $l=new OC_L10N('core'); - $admin=array( - array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "settings", "users.php" ), "name" => $l->t("Users"), "icon" => OC_Helper::imagePath( "settings", "users.svg" )), - array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "settings", "apps.php?installed" ), "name" => $l->t("Apps"), "icon" => OC_Helper::imagePath( "settings", "apps.svg" )), - ); - $settings=array( - array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "help.php" ), "name" => $l->t("Help"), "icon" => OC_Helper::imagePath( "settings", "help.svg" )), - array( "id" => "personal", "order" => 1, "href" => OC_Helper::linkTo( "settings", "personal.php" ), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath( "settings", "personal.svg" )) - ); - if(count(self::$settingsForms)>0){ - $settings[]=array( "id" => "settings", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "settings.php" ), "name" => $l->t("Settings"), "icon" => OC_Helper::imagePath( "settings", "settings.svg" )); - } - if(count(self::$adminForms)>0){ - $admin[]=array( "id" => "admin", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "admin.php" ), "name" => $l->t("Admin"), "icon" => OC_Helper::imagePath( "settings", "admin.svg" )); - } - if( OC_Group::inGroup( $_SESSION["user_id"], "admin" )){ - $settings=array_merge($admin,$settings); - } + + // by default, settings only contain the help menu + $settings = array( + array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "help.php" ), "name" => $l->t("Help"), "icon" => OC_Helper::imagePath( "settings", "help.svg" )) + ); + + // if the user is logged-in + if (OC_User::isLoggedIn()) { + // personal menu + $settings[] = array( "id" => "personal", "order" => 1, "href" => OC_Helper::linkTo( "settings", "personal.php" ), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath( "settings", "personal.svg" )); + + // if there're some settings forms + if(!empty(self::$settingsForms)) + // settings menu + $settings[]=array( "id" => "settings", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "settings.php" ), "name" => $l->t("Settings"), "icon" => OC_Helper::imagePath( "settings", "settings.svg" )); + + // if the user is an admin + if(OC_Group::inGroup( $_SESSION["user_id"], "admin" )) { + // admin users menu + $settings[] = array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "settings", "users.php" ), "name" => $l->t("Users"), "icon" => OC_Helper::imagePath( "settings", "users.svg" )); + // admin apps menu + $settings[] = array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "settings", "apps.php?installed" ), "name" => $l->t("Apps"), "icon" => OC_Helper::imagePath( "settings", "apps.svg" )); + + // if there're some admin forms + if(!empty(self::$adminForms)) + // admins menu + $settings[]=array( "id" => "admin", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "admin.php" ), "name" => $l->t("Admin"), "icon" => OC_Helper::imagePath( "settings", "admin.svg" )); + } + } + $navigation = self::proceedNavigation($settings); return $navigation; } @@ -237,7 +250,7 @@ class OC_App{ return $list; } - + /** * @brief Read app metadata from the info.xml file * @param string $appid id of the app or the path of the info.xml file @@ -261,7 +274,7 @@ class OC_App{ } return $data; } - + /** * @brief Returns the navigation * @returns associative array @@ -277,7 +290,7 @@ class OC_App{ $navigation = self::proceedNavigation( self::$navigation ); return $navigation; } - + /** * get the id of loaded app * @return string @@ -292,8 +305,8 @@ class OC_App{ return $topFolder; } } - - + + /** * get the forms for either settings, admin or personal */ @@ -315,28 +328,28 @@ class OC_App{ } return $forms; } - + /** * register a settings form to be shown */ public static function registerSettings($app,$page){ self::$settingsForms[]='apps/'.$app.'/'.$page.'.php'; } - + /** * register an admin form to be shown */ public static function registerAdmin($app,$page){ self::$adminForms[]='apps/'.$app.'/'.$page.'.php'; } - + /** * register a personal form to be shown */ public static function registerPersonal($app,$page){ self::$personalForms[]='apps/'.$app.'/'.$page.'.php'; } - + /** * get a list of all apps in the apps folder */