Index: /branches/2.2/mobile/inc/class.ui_mobilecalendar.inc.php
===================================================================
--- /branches/2.2/mobile/inc/class.ui_mobilecalendar.inc.php	(revision 3829)
+++ /branches/2.2/mobile/inc/class.ui_mobilecalendar.inc.php	(revision 3926)
@@ -30,4 +30,5 @@
 				'home_search_bar' => 'search_bar.tpl'
 			));
+			$actual_max_results = $_GET["results"]?$_GET["results"]:10;
 			$this->template->set_block("calendar","page");
 			$this->template->set_block('calendar','event_block');
@@ -41,4 +42,11 @@
 			$this->template->set_var('lang_calendar',lang("Calendar"));
 			$this->template->set_var('lang_search',lang("search"));
+			$this->template->set_var('lang_more',lang("more"));
+			$this->template->set_var('lang_events',lang("events"));
+			$this->template->set_var('type',$params['type']);
+			$this->template->set_var('dia',$params['dia']);
+			$this->template->set_var('mes',$params['mes']);
+			$this->template->set_var('ano',$params['ano']);
+			$this->template->set_var('next_max_results',$actual_max_results+10);
 			
 			if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')!="mini_desktop")
@@ -128,5 +136,5 @@
 			$this->template->set_var("lang_today", lang("today"));
 			$this->template->set_var("today_link", "index.php?menuaction=mobile.ui_mobilecalendar.index&type=dia&dia");
-			
+			$show_more_button = false;
 			if($type==="semana") {
 				$tstart = $GLOBALS['phpgw']->datetime->get_weekday_start($year, $month, $day) + $GLOBALS['phpgw']->datetime->tz_offset;
@@ -155,11 +163,26 @@
 				$this->template->parse('events_box','bar_block',true);
 				
+				$total_events = 0; 
 				if(!empty($events)) {
 					foreach($events as $index=>$event)	{
+						if($total_events>=$actual_max_results) {
+							$show_more_button = true;
+							break;
+						}
 						$event_year  = (int) substr($index,0,4);
 						$event_month = (int) substr($index,4,2);
 						$event_day   = (int) substr($index,6,2);
+						$complete_day = $event_year.$this->common->complete_string($event_month,2,"R","0").$this->common->complete_string($event_day,2,"R","0");
+
+						//Se a quantidade de eventos for maior que o máximo pego nessa interação, o botão de mais deve aparecer
+						if(count($events[$complete_day])>$actual_max_results-$total_events) 
+							$show_more_button = true;
+						
+						//Pego os eventos até completar o máximo da paginação
+						$events_to_print = array_slice($events[$complete_day],0,$actual_max_results-$total_events);
+						$total_events += count($events_to_print);
+						
 						print_events_header($this, $event_day, $event_month, $event_year);
-						print_events($this, $events[$event_year.$this->common->complete_string($event_month,2,"R","0").$this->common->complete_string($event_day,2,"R","0")]);	
+						print_events($this, $events_to_print);
 					}		
 				} else {
@@ -272,7 +295,10 @@
 				$this->template->set_var("current_label", $this->daysOfWeek[$GLOBALS['phpgw']->datetime->day_of_week($year,$month,$day)]." - ".$day."/".$month."/".$year);
 				$this->template->parse('events_box','bar_block',true);				
-				
-				if(!empty($events[$year.$month.$day]))
-					print_events($this, $events[$year.$month.$day]);
+
+				if(!empty($events[$year.$month.$day])) {
+					print_events($this, array_slice($events[$year.$month.$day],0,$actual_max_results,true));
+					if(count($events[$year.$month.$day])>$actual_max_results) 
+							$show_more_button = true;
+				}
 				else {
 					$this->template->set_var("msg_no_event", lang("Dont have event that day"));
@@ -280,5 +306,8 @@
 				}
 			}
-			
+			if($show_more_button)
+				$this->template->set_var('show_more','block');
+			else
+				$this->template->set_var('show_more','none');
 			$GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out','page'));
 		}
Index: /branches/2.2/mobile/templates/default/calendar.tpl
===================================================================
--- /branches/2.2/mobile/templates/default/calendar.tpl	(revision 3829)
+++ /branches/2.2/mobile/templates/default/calendar.tpl	(revision 3926)
@@ -14,7 +14,10 @@
 </form>
 
-<dl id="lista_miolo">	>
+<dl id="lista_miolo">	
 	{events_box}	
 </dl>
+<div class="menu-contexto centraliza" style="display:{show_more};">
+	<button name="more_events" title="{lang_more_events}" class="btn-contexto" onClick="location.href='index.php?menuaction=mobile.ui_mobilecalendar.index&type={type}&dia={dia}&mes={mes}&ano={ano}&results={next_max_results}'">{lang_more} 10 {lang_events}</button>
+</div>
 {calendar_box}
 
