/** * return the start, prev, next, end */ function play($module, $offset) { //given some global offset try to determine if we have this //in our array. $ids = array(); if (!empty($_SESSION[$module . 'QUERY_ARRAY'])) { $ids = $_SESSION[$module . 'QUERY_ARRAY']; } if (empty($ids[$offset]) || empty($ids[$offset + 1]) || empty($ids[$offset - 1])) { $ids = SugarVCR::record($module, $offset); } $menu = array(); if (!empty($ids[$offset])) { //return the control given this id $menu['PREV'] = $offset > 1 ? $ids[$offset - 1] : ''; $menu['CURRENT'] = $ids[$offset]; $menu['NEXT'] = !empty($ids[$offset + 1]) ? $ids[$offset + 1] : ''; } return $menu; }