Пример #1
0
 /**
  * Get the translations and override strings
  */
 private function loadTranslations($items, $ids)
 {
     // get the translations
     $qids = implode(',', $ids);
     $db = JFactory::getDbo();
     $lang = $db->quote(JFactory::getLanguage()->getTag());
     $query_translation = $db->getQuery(true)->select('*')->from('#__chpanel_translations')->where("lang = {$lang}")->where("hotel_id IN ({$qids})");
     $translations = $db->setQuery($query_translation)->loadObjectList('hotel_id');
     if ($translations) {
         foreach ($items as $item) {
             if (isset($translations[$item->id])) {
                 $item = CHPanelHelper::applyTranslation($item, $translations[$item->id]);
             }
         }
     }
     return $items;
 }