Bläddra i källkod

more Calendar work

causefx 8 år sedan
förälder
incheckning
a27e3dbfe0
4 ändrade filer med 70 tillägg och 18 borttagningar
  1. 1 1
      api/config/default.php
  2. 54 12
      api/functions/homepage-functions.php
  3. 9 5
      api/pages/homepage.php
  4. 6 0
      css/themes/Organizr.css

+ 1 - 1
api/config/default.php

@@ -109,5 +109,5 @@ return array(
     'calendarEnd' => '14',
     'calendarRefresh' => '60000',
     'calendarTimeFormat' => 'h(:mm)t',
-    'calendarLimit' => false
+    'calendarLimit' => '1000'
 );

+ 54 - 12
api/functions/homepage-functions.php

@@ -225,6 +225,44 @@ function getHomepageList(){
             'value' => '3600000'
         ),
     );
+	$limit = array(
+		array(
+			'name' => '1 Item',
+			'value' => '1'
+		),
+		array(
+			'name' => '2 Items',
+			'value' => '2'
+		),
+		array(
+			'name' => '3 Items',
+			'value' => '3'
+		),
+		array(
+			'name' => '4 Items',
+			'value' => '4'
+		),
+		array(
+			'name' => '5 Items',
+			'value' => '5'
+		),
+		array(
+			'name' => '6 Items',
+			'value' => '6'
+		),
+		array(
+			'name' => '7 Items',
+			'value' => '7'
+		),
+		array(
+			'name' => '8 Items',
+			'value' => '8'
+		),
+		array(
+			'name' => 'Unlimited',
+			'value' => '1000'
+		),
+	);
 	$day = array(
 		array(
 			'name' => 'Sunday',
@@ -821,10 +859,11 @@ function getHomepageList(){
                         'options' => $timeFormat
                     ),
 					array(
-                        'type' => 'switch',
+                        'type' => 'select',
                         'name' => 'calendarLimit',
-                        'label' => 'Limit Entries',
-                        'value' => $GLOBALS['calendarLimit']
+                        'label' => 'Items Per Day',
+                        'value' => $GLOBALS['calendarLimit'],
+                        'options' => $limit
                     ),
                     array(
                         'type' => 'select',
@@ -909,10 +948,11 @@ function getHomepageList(){
                         'options' => $timeFormat
                     ),
 					array(
-                        'type' => 'switch',
+                        'type' => 'select',
                         'name' => 'calendarLimit',
-                        'label' => 'Limit Entries',
-                        'value' => $GLOBALS['calendarLimit']
+                        'label' => 'Items Per Day',
+                        'value' => $GLOBALS['calendarLimit'],
+                        'options' => $limit
                     ),
                     array(
                         'type' => 'select',
@@ -983,10 +1023,11 @@ function getHomepageList(){
                         'options' => $timeFormat
                     ),
 					array(
-                        'type' => 'switch',
+                        'type' => 'select',
                         'name' => 'calendarLimit',
-                        'label' => 'Limit Entries',
-                        'value' => $GLOBALS['calendarLimit']
+                        'label' => 'Items Per Day',
+                        'value' => $GLOBALS['calendarLimit'],
+                        'options' => $limit
                     ),
                     array(
                         'type' => 'select',
@@ -1057,10 +1098,11 @@ function getHomepageList(){
                         'options' => $timeFormat
                     ),
 					array(
-                        'type' => 'switch',
+                        'type' => 'select',
                         'name' => 'calendarLimit',
-                        'label' => 'Limit Entries',
-                        'value' => $GLOBALS['calendarLimit']
+                        'label' => 'Items Per Day',
+                        'value' => $GLOBALS['calendarLimit'],
+                        'options' => $limit
                     ),
                     array(
                         'type' => 'select',

+ 9 - 5
api/pages/homepage.php

@@ -30,15 +30,19 @@ $pageHomepage = '
             timeFormat: "'.$GLOBALS['calendarTimeFormat'].'",
             handleWindowResize: true,
             header: {
-                left: "prev,next",
-                center: "title",
-                right: "month,basicDay,basicWeek"
+               left: "prev,next",
+               center: "title",
+               right: "month,basicWeek,basicDay"
+            },
+            views: {
+               basicDay: { buttonText: window.lang.translate("Day"), eventLimit: '.$GLOBALS['calendarLimit'].' },
+               basicWeek: { buttonText: window.lang.translate("Week"), eventLimit: '.$GLOBALS['calendarLimit'].' },
+               month: { buttonText: window.lang.translate("Month"), eventLimit: '.$GLOBALS['calendarLimit'].' },
+               today: { buttonText: window.lang.translate("Today") },
             },
             timezone: "local",
             editable: false,
             droppable: false, // this allows things to be dropped onto the calendar !!!
-            eventLimit: false, // allow "more" link when too many events
-            //eventLimit: tof("'.$GLOBALS['calendarLimit'].'","b"), // allow "more" link when too many events
             selectable: false,
             height: "auto",
             eventRender: function eventRender( event, element, view ) {

+ 6 - 0
css/themes/Organizr.css

@@ -303,6 +303,12 @@ a.mytooltip {
   font-weight: 400;
   line-height: 210px;
 }
+.fc-unthemed .fc-popover {
+  background-color: #1b1b1b;
+}
+.fc-unthemed .fc-divider, .fc-unthemed .fc-popover .fc-header {
+  background: #1f1f1f;
+}
 .table-hover>tbody>tr:hover, .table-striped>tbody>tr:nth-of-type(odd), .table>tbody>tr.active>td, .table>tbody>tr.active>th, .table>tbody>tr>td.active, .table>tbody>tr>th.active, .table>tfoot>tr.active>td, .table>tfoot>tr.active>th, .table>tfoot>tr>td.active, .table>tfoot>tr>th.active, .table>thead>tr.active>td, .table>thead>tr.active>th, .table>thead>tr>td.active, .table>thead>tr>th.active {
   background-color: #1f1f1f!important;
 }