part.choosecalendar.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <div id="choosecalendar_dialog" title="<?php echo $l->t("Choose active calendars"); ?>">
  2. <p><b><?php echo $l->t('Your calendars'); ?>:</b></p>
  3. <table width="100%" style="border: 0;">
  4. <?php
  5. $option_calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
  6. for($i = 0; $i < count($option_calendars); $i++){
  7. echo "<tr>";
  8. $tmpl = new OCP\Template('calendar', 'part.choosecalendar.rowfields');
  9. $tmpl->assign('calendar', $option_calendars[$i]);
  10. if(OC_Calendar_Share::allUsersSharedwith($option_calendars[$i]['id'], OC_Calendar_Share::CALENDAR) == array()){
  11. $shared = false;
  12. }else{
  13. $shared = true;
  14. }
  15. $tmpl->assign('shared', $shared);
  16. $tmpl->printpage();
  17. echo "</tr>";
  18. }
  19. ?>
  20. <tr>
  21. <td colspan="6">
  22. <a href="#" onclick="Calendar.UI.Calendar.newCalendar(this);"><input type="button" value="<?php echo $l->t('New Calendar') ?>"></a>
  23. </td>
  24. </tr>
  25. <tr>
  26. <td colspan="6">
  27. <p style="margin: 0 auto;width: 90%;"><input style="display:none;width: 90%;float: left;" type="text" id="caldav_url" onmouseover="$('#caldav_url').select();" title="<?php echo $l->t("CalDav Link"); ?>"><img id="caldav_url_close" style="height: 20px;vertical-align: middle;display: none;" src="<?php echo OCP\Util::imagePath('core', 'actions/delete.svg') ?>" alt="close" onclick="$('#caldav_url').hide();$('#caldav_url_close').hide();"/></p>
  28. </td>
  29. </tr>
  30. </table><br>
  31. <p><b><?php echo $l->t('Shared calendars'); ?>: </b></p>
  32. <table width="100%" style="border: 0;">
  33. <?php
  34. $share = OC_Calendar_Share::allSharedwithuser(OCP\USER::getUser(), OC_Calendar_Share::CALENDAR);
  35. $count = count($share);
  36. for($i = 0; $i < $count; $i++){
  37. $share[$i]['calendar'] = OC_Calendar_App::getCalendar($share[$i]['calendarid'], false, false);
  38. echo '<tr>';
  39. $tmpl = new OCP\Template('calendar', 'part.choosecalendar.rowfields.shared');
  40. $tmpl->assign('share', $share[$i]);
  41. $tmpl->printpage();
  42. echo '</tr>';
  43. }
  44. ?>
  45. </table>
  46. <?php
  47. if($count == 0){
  48. echo '<p style="text-align:center;"><b>' . $l->t('No shared calendars') . '</b></p>';
  49. }
  50. ?>
  51. </div>