Exemple #1
0
 public function getAddressPath()
 {
     $app = JFactory::getApplication();
     $id = $app->input->get('id', 0);
     $html = '';
     if ($id) {
         $html = JUDirectoryHelper::getAddressPath($id);
     }
     echo $html;
     exit;
 }
 protected function getLocations($fieldValue)
 {
     $locations = array();
     if ($fieldValue) {
         foreach ($fieldValue as $location) {
             $locations[] = (object) $location;
         }
     } elseif ($this->listing_id) {
         $db = JFactory::getDbo();
         $query = $db->getQuery(true);
         $query->select('*');
         $query->from('#__judirectory_locations');
         $query->where('listing_id = ' . $this->listing_id);
         $query->order('ordering ASC');
         $db->setQuery($query);
         $locations = $db->loadObjectList();
     }
     if ($locations) {
         foreach ($locations as $location) {
             $location->selectAddress = JUDirectoryHelper::getAddressPath($location->address_id ? $location->address_id : 1);
         }
     }
     return $locations;
 }