Пример #1
0
 /**
  * Get a list of the available menus.
  *
  * @return	array	An array of the available menus (from the menu types table).
  * @since	1.6
  */
 public static function getMenus()
 {
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->select('a.*, SUM(b.home) AS home');
     $query->from('#__menu_types AS a');
     $query->leftJoin('#__menu AS b ON b.menutype = a.menutype AND b.home != 0 AND (b.language=\'*\' OR b.language=\'' . JoomFishManager::getDefaultLanguage() . '\')');
     $query->select('b.language');
     $query->leftJoin('#__languages AS l ON l.lang_code = language');
     $query->select('l.image');
     $query->select('l.sef');
     $query->select('l.title_native');
     $query->where('(b.client_id = 0 OR b.client_id IS NULL)');
     //sqlsrv change
     $query->group('a.id, a.menutype, a.description, a.title, b.menutype,b.language,l.image,l.sef,l.title_native');
     $db->setQuery($query);
     $result = $db->loadObjectList();
     return $result;
 }
Пример #2
0
 /**
  * Overloaded bind function
  *
  * @param   array  $array   Named array
  * @param   mixed  $ignore  An optional array or space separated list of properties to ignore while binding.
  *
  * @return  mixed  Null if operation was satisfactory, otherwise returns an error
  *
  * @see     JTable::bind
  * @since   11.1
  */
 public function bind($array, $ignore = '')
 {
     // Verify that the default home menu is not unset
     if ($this->home == '1' && ($this->language == '*' || $this->language == JoomFishManager::getDefaultLanguage()) && $array['home'] == '0') {
         $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT_DEFAULT'));
         return false;
     }
     //Verify that the default home menu set to "all" languages" is not unset
     if ($this->home == '1' && ($this->language == '*' || $this->language == JoomFishManager::getDefaultLanguage()) && $array['language'] != '*' && $array['language'] != JoomFishManager::getDefaultLanguage()) {
         $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT'));
         return false;
     }
     // Verify that the default home menu is not unpublished
     if ($this->home == '1' && ($this->language == '*' || $this->language == JoomFishManager::getDefaultLanguage()) && $array['published'] != '1') {
         $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_UNPUBLISH_DEFAULT_HOME'));
         return false;
     }
     if (isset($array['params']) && is_array($array['params'])) {
         $registry = new JRegistry();
         $registry->loadArray($array['params']);
         $array['params'] = (string) $registry;
     }
     return JTableNested::bind($array, $ignore);
 }
Пример #3
0
 /**
  * Get menu item by id
  *
  * @param	string	$language	The language code.
  *
  * @return	object	The item object
  * @since	1.5
  */
 public function getDefault($language = '*')
 {
     if (array_key_exists($language, $this->_default) && JApplication::getInstance('site')->getLanguageFilter()) {
         return $this->_items[$this->_default[$language]];
     } elseif (array_key_exists('*', $this->_default)) {
         return $this->_items[$this->_default['*']];
     } elseif (array_key_exists(JoomFishManager::getDefaultLanguage(), $this->_default)) {
         return $this->_items[$this->_default[JoomFishManager::getDefaultLanguage()]];
     } else {
         return 0;
     }
 }
Пример #4
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
 *
 * The "GNU General Public License" (GPL) is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * -----------------------------------------------------------------------------
 * $Id: mod_translate.php 1484 2010-07-01 14:21:32Z akede $
 * @package joomfish
 * @subpackage mod_translate
 *
*/
?>
<span class='modtranslate'>
<?php 
$language = $joomFishManager->getLanguageByCode(JoomFishManager::getDefaultLanguage());
if (isset($language) && $language) {
    echo JText::_('Default language') . ': ';
    $langImg = JoomfishExtensionHelper::getLanguageImageSource($language);
    $outString = $language->title;
    if (file_exists(JPATH_SITE . $langImg)) {
        $outString = '<img src="' . JURI::root(true) . $langImg . '" alt="' . $language->title . '" title="' . $language->title . '" />';
    }
    echo $outString;
}
?>
</span>