Beispiel #1
0
                $row = $open . $row_info . $close;
                $tray_def[$tray_id]['__slots__'][$slot_id]['__html__'] = '<li class="arrow">' . $row . '</li>';
            } else {
                $row = array();
                $row = array($open . _V($tray['__title__']) . '<br>' . _V($slot_def['__name__']) . $close, $slot_def['__count__']);
                $tray_def[$tray_id]['__slots__'][$slot_id]['__html__'] = $row;
            }
        }
    }
}
Utils_TrayCommon::sort_trays($tray_def);
if (IPHONE) {
    $html = '';
} else {
    $data_out = array();
}
foreach ($tray_def as $tray_id => $def) {
    foreach ($def['__slots__'] as $slot) {
        if (IPHONE) {
            $html .= $slot['__html__'];
        } else {
            $data_out[] = $slot['__html__'];
        }
    }
}
//display table
if (IPHONE) {
    print '<ul>' . $html . '</ul>';
} else {
    Utils_GenericBrowserCommon::mobile_table($cols_out, $data_out, false);
}
Beispiel #2
0
 public static function mobile_agenda($evmod, $extra_settings = array(), $time_shift = 0, $view_func = null)
 {
     $settings = array('custom_agenda_cols' => null);
     $settings = array_merge($settings, $extra_settings);
     $start = time() + $time_shift;
     $end = $start + 7 * 24 * 60 * 60 + $time_shift;
     if (!IPHONE) {
         $columns = array(array('name' => __('Start'), 'order' => 'start', 'width' => 10), array('name' => __('Duration'), 'order' => 'end', 'width' => 5), array('name' => __('Title'), 'order' => 'title', 'width' => 10));
     }
     //add data
     ob_start();
     $ret_raw = call_user_func(array(str_replace('/', '_', $evmod) . 'Common', 'get_all'), date('Y-m-d', $start), date('Y-m-d', $end));
     ob_get_clean();
     if (!is_array($ret_raw)) {
         trigger_error('Invalid return of event method: get_all (not an array)', E_USER_ERROR);
     }
     if (IPHONE) {
         print '<ul>';
         $date = null;
     } else {
         $data = array();
     }
     $ret = array();
     $i = 0;
     foreach ($ret_raw as $row) {
         $ret[$row['start'] . '_' . $i] = $row;
         $i++;
     }
     ksort($ret);
     foreach ($ret as $row) {
         $ex = Utils_CalendarCommon::process_event($row);
         if ($view_func) {
             $h = mobile_stack_href($view_func, array($row['id']), __('View event'));
         } else {
             $h = '';
         }
         if (IPHONE) {
             if ($date !== $ex['start_date']) {
                 $date = $ex['start_date'];
                 print '</ul><h4>' . $date . '</h4><ul>';
             }
             $start = '<a ' . $h . '>' . $ex['start'] . '</a>';
             $duration = '<a ' . $h . '>' . $ex['duration'] . '</a>';
             $title = '<a ' . $h . '>' . $row['title'] . '</a>';
             print '<li class="arrow">' . $start . $duration . $title . '</li>';
         } else {
             $rrr = array(array('label' => '<a ' . $h . '>' . $ex['start'] . '</a>', 'order_value' => isset($row['timeless']) ? strtotime($row['timeless']) : $row['start']), '<a ' . $h . '>' . $ex['duration'] . '</a>', '<a ' . $h . '>' . $row['title'] . '</a>');
             //				foreach($add_cols as $a)
             //					$rrr[] = $row['custom_agenda_col_'.$a];
             $data[] = $rrr;
         }
     }
     if (IPHONE) {
         print '</ul>';
     } else {
         Utils_GenericBrowserCommon::mobile_table($columns, $data, 'start');
     }
 }