本文整理汇总了PHP中JoomFishManager::getDefaultLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP JoomFishManager::getDefaultLanguage方法的具体用法?PHP JoomFishManager::getDefaultLanguage怎么用?PHP JoomFishManager::getDefaultLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoomFishManager
的用法示例。
在下文中一共展示了JoomFishManager::getDefaultLanguage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMenus
/**
* 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: bind
/**
* 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: getDefault
/**
* 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:
* 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>