Example #1
0
 protected static function _findItem($needles = null)
 {
     $app = JFactory::getApplication();
     $menus = $app->getMenu('site');
     // Prepare the reverse lookup array.
     if (self::$lookup === null) {
         self::$lookup = array();
         $component = JComponentHelper::getComponent('com_aaws');
         $items = $menus->getItems('component_id', $component->id);
         foreach ($items as $item) {
             if (isset($item->query) && isset($item->query['task'])) {
                 $task = $item->query['task'];
                 if (!isset(self::$lookup[$task])) {
                     self::$lookup[$task] = $item->id;
                 }
             }
         }
     }
     if ($needles) {
         foreach ($needles as $task) {
             if (isset(self::$lookup[$task])) {
                 return self::$lookup[$task];
             }
         }
     } else {
         $active = $menus->getActive();
         if ($active && $active->component == 'com_aaws') {
             return $active->id;
         }
     }
     return null;
 }
Example #2
0
                        $data['TRIP_TYPE'] = 'R';
                        $data['B_LOCATION_1'] = $flight->origin;
                        $data['E_LOCATION_1'] = $flight->destiny;
                        $data['B_DATE_1'] = $dateArrival;
                        //Asigno la fecha inicial, sea fija o periódica
                        $data['B_DATE_2'] = $ffinal;
                        //Asigno lafecha final, sea fija o periódica
                        $data['TRAVELLER_TYPE_ADT'] = '1';
                        $data['TRAVELLER_TYPE_CHD'] = '0';
                        $data['TRAVELLER_TYPE_INF'] = '0';
                        $data['TRAVELLER_TYPE_YCD'] = '0';
                        $data['CABIN'] = 'Economy';
                        $data['AIRLINE'] = '';
                        $data['MAX_CONNECTIONS'] = '';
                        $data['ajax'] = '0';
                        $action = JRoute::_(AawsHelperRoute::getFlowRoute('air.availability'), false);
                        /*-----------------------------------------------------------------------------------------------------------------------------------------*/
                        $html = '<form action="' . $action . '" method="post" >';
                        foreach ($data as $key => $value) {
                            $html .= '<input type="hidden" name="wsform[' . $key . ']" value="' . $value . '" />';
                        }
                        $html .= '</form>';
                        echo $html;
                        ?>
                      <div class="cities" id="ciudades" style="max-width:210px;">
                           <?php 
                        echo $flight->originname;
                        ?>
 - <?php 
                        echo $flight->destinyname;
                        ?>
Example #3
0
 protected function _setVariablesTo(&$xslt, $template)
 {
     switch ($template) {
         case 'Availability':
             $action = 'air.passenger';
             break;
         case 'Detail':
             // Se envia el año, para seleccionar en la fecha de nacimiento
             $xslt->setParameter('', 'year', date('Y'));
             $user = JFactory::getUser();
             if ($user->id != 0) {
                 $phone = explode('~', $user->get('profile.phone', ''));
                 if (count($phone) != 3) {
                     $phone = array('', '', '');
                 }
                 $xslt->setParameter('', 'username', $user->get('name', ''));
                 $xslt->setParameter('', 'email', $user->get('email', ''));
                 $xslt->setParameter('', 'documenttype', $user->get('profile.documenttype', ''));
                 $xslt->setParameter('', 'documentid', $user->get('profile.documentnumber', ''));
                 $xslt->setParameter('', 'phcountry', $phone[0]);
                 $xslt->setParameter('', 'phcode', $phone[1]);
                 $xslt->setParameter('', 'phnumber', $phone[2]);
             }
             $action = 'air.booking';
             break;
     }
     require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'route.php';
     $xslt->setParameter('', 'action', JRoute::_(AawsHelperRoute::getFlowRoute($action)));
 }