Changeset 3926 for branches/2.2/mobile/inc/class.ui_mobilecalendar.inc.php
- Timestamp:
- 03/29/11 09:33:25 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/mobile/inc/class.ui_mobilecalendar.inc.php
r3829 r3926 30 30 'home_search_bar' => 'search_bar.tpl' 31 31 )); 32 $actual_max_results = $_GET["results"]?$_GET["results"]:10; 32 33 $this->template->set_block("calendar","page"); 33 34 $this->template->set_block('calendar','event_block'); … … 41 42 $this->template->set_var('lang_calendar',lang("Calendar")); 42 43 $this->template->set_var('lang_search',lang("search")); 44 $this->template->set_var('lang_more',lang("more")); 45 $this->template->set_var('lang_events',lang("events")); 46 $this->template->set_var('type',$params['type']); 47 $this->template->set_var('dia',$params['dia']); 48 $this->template->set_var('mes',$params['mes']); 49 $this->template->set_var('ano',$params['ano']); 50 $this->template->set_var('next_max_results',$actual_max_results+10); 43 51 44 52 if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')!="mini_desktop") … … 128 136 $this->template->set_var("lang_today", lang("today")); 129 137 $this->template->set_var("today_link", "index.php?menuaction=mobile.ui_mobilecalendar.index&type=dia&dia"); 130 138 $show_more_button = false; 131 139 if($type==="semana") { 132 140 $tstart = $GLOBALS['phpgw']->datetime->get_weekday_start($year, $month, $day) + $GLOBALS['phpgw']->datetime->tz_offset; … … 155 163 $this->template->parse('events_box','bar_block',true); 156 164 165 $total_events = 0; 157 166 if(!empty($events)) { 158 167 foreach($events as $index=>$event) { 168 if($total_events>=$actual_max_results) { 169 $show_more_button = true; 170 break; 171 } 159 172 $event_year = (int) substr($index,0,4); 160 173 $event_month = (int) substr($index,4,2); 161 174 $event_day = (int) substr($index,6,2); 175 $complete_day = $event_year.$this->common->complete_string($event_month,2,"R","0").$this->common->complete_string($event_day,2,"R","0"); 176 177 //Se a quantidade de eventos for maior que o máximo pego nessa interação, o botão de mais deve aparecer 178 if(count($events[$complete_day])>$actual_max_results-$total_events) 179 $show_more_button = true; 180 181 //Pego os eventos até completar o máximo da paginação 182 $events_to_print = array_slice($events[$complete_day],0,$actual_max_results-$total_events); 183 $total_events += count($events_to_print); 184 162 185 print_events_header($this, $event_day, $event_month, $event_year); 163 print_events($this, $events [$event_year.$this->common->complete_string($event_month,2,"R","0").$this->common->complete_string($event_day,2,"R","0")]);186 print_events($this, $events_to_print); 164 187 } 165 188 } else { … … 272 295 $this->template->set_var("current_label", $this->daysOfWeek[$GLOBALS['phpgw']->datetime->day_of_week($year,$month,$day)]." - ".$day."/".$month."/".$year); 273 296 $this->template->parse('events_box','bar_block',true); 274 275 if(!empty($events[$year.$month.$day])) 276 print_events($this, $events[$year.$month.$day]); 297 298 if(!empty($events[$year.$month.$day])) { 299 print_events($this, array_slice($events[$year.$month.$day],0,$actual_max_results,true)); 300 if(count($events[$year.$month.$day])>$actual_max_results) 301 $show_more_button = true; 302 } 277 303 else { 278 304 $this->template->set_var("msg_no_event", lang("Dont have event that day")); … … 280 306 } 281 307 } 282 308 if($show_more_button) 309 $this->template->set_var('show_more','block'); 310 else 311 $this->template->set_var('show_more','none'); 283 312 $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out','page')); 284 313 }
Note: See TracChangeset
for help on using the changeset viewer.