本文整理汇总了PHP中XoopsLists::getLangList方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsLists::getLangList方法的具体用法?PHP XoopsLists::getLangList怎么用?PHP XoopsLists::getLangList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsLists
的用法示例。
在下文中一共展示了XoopsLists::getLangList方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: b_cubeUtils_langsel_show
function b_cubeUtils_langsel_show($options)
{
if (empty($_SERVER['QUERY_STRING'])) {
$pagenquery = $_SERVER['PHP_SELF'] . '?' . CUBE_UTILS_ML_PARAM_NAME . '=';
} elseif (isset($_SERVER['QUERY_STRING'])) {
$query = explode("&", $_SERVER['QUERY_STRING']);
$langquery = $_SERVER['QUERY_STRING'];
// If the last parameter of the QUERY_STRING is sel_lang, delete it so we don't have repeating sel_lang=...
if (strpos($query[count($query) - 1], CUBE_UTILS_ML_PARAM_NAME . '=') === 0) {
$langquery = str_replace('&' . $query[count($query) - 1], '', $langquery);
}
$pagenquery = $_SERVER['PHP_SELF'] . '?' . $langquery . '&' . CUBE_UTILS_ML_PARAM_NAME . '=';
$pagenquery = str_replace('?&', '?', $pagenquery);
}
//show a drop down list to select language
$block['content'] = "<script type='text/javascript'>\r\n<!--\r\nfunction SelLang_jumpMenu(targ,selObj,restore){\r\neval(targ+\".location='" . $pagenquery . "\"+selObj.options[selObj.selectedIndex].value+\"'\");\r\nif (restore) selObj.selectedIndex=0;\r\n}\r\n-->\r\n</script>";
$block['content'] .= '<div align="center"><select name="' . CUBE_UTILS_ML_PARAM_NAME . '" onChange="SelLang_jumpMenu(\'parent\',this,0)">';
$languages = XoopsLists::getLangList();
$langnames = explode(',', CUBE_UTILS_ML_LANGDESCS);
$langs = explode(',', CUBE_UTILS_ML_LANGS);
for ($i = 0; $i < count($langs); $i++) {
$block['content'] .= '<option value="' . $langs[$i] . '"';
if ($langs[$i] == _LANGCODE) {
$block['content'] .= " selected";
}
$block['content'] .= '>' . $langnames[$i] . '</option>';
}
$block['content'] .= '</select></div>';
return $block;
}
示例2: getLanguages
function getLanguages()
{
include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
$aLanguages = XoopsLists::getLangList();
$ret['default'] = _CO_SOBJECT_ALL;
foreach ($aLanguages as $lang) {
$ret[$lang] = $lang;
}
return $ret;
}
示例3: XoopsLists
$modversion['config'][7]['default'] = '300';
$modversion['config'][8]['name'] = 'list_image_width';
$modversion['config'][8]['title'] = '_MI_SMEDIA_LIST_IMG_WIDTH';
$modversion['config'][8]['description'] = '_MI_SMEDIA_LIST_IMG_WIDTHDSC';
$modversion['config'][8]['formtype'] = 'textbox';
$modversion['config'][8]['valuetype'] = 'text';
$modversion['config'][8]['default'] = '150';
$modversion['config'][9]['name'] = 'default_language';
$modversion['config'][9]['title'] = '_MI_SMEDIA_DEFAULT_LANGUAGE';
$modversion['config'][9]['description'] = '_MI_SMEDIA_DEFAULT_LANGUAGEDSC';
$modversion['config'][9]['formtype'] = 'select';
$modversion['config'][9]['valuetype'] = 'text';
$modversion['config'][9]['default'] = 'english';
include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
$myList = new XoopsLists();
$modversion['config'][9]['options'] = $myList->getLangList();
$modversion['config'][10]['name'] = 'highlight_color';
$modversion['config'][10]['title'] = '_MI_SMEDIA_HIGHLIGHT_COLOR';
$modversion['config'][10]['description'] = '_MI_SMEDIA_HIGHLIGHT_COLORDSC';
$modversion['config'][10]['formtype'] = 'textbox';
$modversion['config'][10]['valuetype'] = 'text';
$modversion['config'][10]['default'] = '#FFFF80';
/*
$modversion['config'][1]['name'] = 'itemtype';
$modversion['config'][1]['title'] = '_MI_SMEDIA_ITEM_TYPE';
$modversion['config'][1]['description'] = '_MI_SMEDIA_ITEM_TYPEDSC';
$modversion['config'][1]['formtype'] = 'select';
$modversion['config'][1]['valuetype'] = 'text';
$modversion['config'][1]['default'] = 'article';
$modversion['config'][1]['options'] = array('Item' => 'item', 'Article' => 'article', 'Project' => 'project');
示例4: __construct
/**
* Constructor
*
* @param string $caption
* @param string $name
* @param mixed $value Pre-selected value (or array of them).
* Legal is any name of a XOOPS_ROOT_PATH."/language/" subdirectory.
* @param int $size Number of rows. "1" makes a drop-down-list.
*/
public function __construct($caption, $name, $value = null, $size = 1)
{
parent::__construct($caption, $name, $value, $size);
$this->addOptionArray(XoopsLists::getLangList());
}
示例5: XoopsFormSelectLang
/**
* Constructor
*
* @param string $caption
* @param string $name
* @param mixed $value Pre-selected value (or array of them).
* Legal is any name of a XOOPS_ROOT_PATH."/language/" subdirectory.
* @param int $size Number of rows. "1" makes a drop-down-list.
*/
function XoopsFormSelectLang($caption, $name, $value = null, $size = 1)
{
$this->XoopsFormSelect($caption, $name, $value, $size);
$this->addOptionArray(XoopsLists::getLangList());
}
示例6: canAddLanguage
/**
* Check to see if other translations can be added
*
* If all languages of the site are also in {@link $_created_languages} then no new
* translation can be created
*
* @return bool true if new translation can be added false if all translation have been created
* @see _canAddLanguage
* @see getCreatedLanguages
*/
function canAddLanguage()
{
if ($this->_canAddLanguage != null) {
return $this->_canAddLanguage;
}
include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
$languageList = XoopsLists::getLangList();
$createdLanguages = $this->getCreatedLanguages();
$this->_canAddLanguage = count($languageList) > count($createdLanguages);
return $this->_canAddLanguage;
}
示例7: sysutil_ml_getlangbyname
function sysutil_ml_getlangbyname($langname)
{
$lang_available = XoopsLists::getLangList();
if ($langname != '' && in_array($langname, $lang_available)) {
$sysutil_ml_langnames = explode(',', SYSUTIL_ML_LANGNAMES);
$idx = array_search($langname, $sysutil_ml_langnames);
$sysutil_ml_langs = explode(',', SYSUTIL_ML_LANGS);
$sysutil_ml_lang = $sysutil_ml_langs[$idx];
return $sysutil_ml_lang;
}
return false;
}
示例8: editfolder_text
function editfolder_text($showmenu = false, $folderid, $languageid)
{
global $xoopsDB, $smartmedia_folder_handler, $xoopsUser, $myts, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
echo "<script type=\"text/javascript\" src=\"funcs.js\"></script>";
echo "<style>";
echo "<!-- ";
echo "select { width: 130px; }";
echo "-->";
echo "</style>";
$cat_sel = '';
$folderObj = $smartmedia_folder_handler->get($folderid, $languageid);
if ($languageid == 'new') {
$bread_lang = _AM_SMEDIA_CREATE;
} else {
$bread_lang = ucfirst($languageid);
}
if ($showmenu) {
smartmedia_adminMenu(2, _AM_SMEDIA_FOLDERS . " > " . _AM_SMEDIA_LANGUAGE_INFO . " > " . $bread_lang);
}
echo "<br />\n";
smartmedia_collapsableBar('bottomtable', 'bottomtableicon');
echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a> " . _AM_SMEDIA_FOLDER_LANGUAGE_INFO_EDITING . "</h3>";
echo "<div id='bottomtable'>";
echo "<span style=\"color: #567; margin: 3px 0 18px 0; font-size: small; display: block; \">" . _AM_SMEDIA_FOLDER_LANGUAGE_INFO_EDITING_INFO . "</span>";
// Start folder form
$sform = new XoopsThemeForm(_AM_SMEDIA_FOLDER, "op", xoops_getenv('PHP_SELF'));
$sform->setExtra('enctype="multipart/form-data"');
$sform->addElement(new XoopsFormHidden('folderid', $folderid));
// Language
$languageOptions = array();
$languageList = XoopsLists::getLangList();
$createdLanguages = $folderObj->getCreatedLanguages();
foreach ($languageList as $language) {
if ($languageid != 'new' || !in_array($language, $createdLanguages)) {
$languageOptions[$language] = $language;
}
}
$language_select = new XoopsFormSelect(_AM_SMEDIA_LANGUAGE_ITEM, 'languageid', $languageid);
$language_select->addOptionArray($languageOptions);
$language_select->setDescription(_AM_SMEDIA_LANGUAGE_ITEM_DSC);
if ($languageid != 'new') {
$language_select->setExtra(smartmedia_make_control_disabled());
$sform->addElement(new XoopsFormHidden('languageid', $languageid));
}
$sform->addElement($language_select, true);
// title
$sform->addElement(new XoopsFormText(_AM_SMEDIA_FOLDER_TITLE, 'title', 50, 255, $folderObj->title()), true);
// title
$sform->addElement(new XoopsFormText(_AM_SMEDIA_FOLDER_TITLE_REQ, 'title', 50, 255, $folderObj->title()), true);
// short_title
//$sform->addElement(new XoopsFormText(_AM_SMEDIA_FOLDER_SHORT_TITLE, 'short_title', 50, 255, $folderObj->short_title()));
// summary
$summary = new XoopsFormTextArea(_AM_SMEDIA_FOLDER_SUMMARY, 'summary', $folderObj->summary('e'), 3, 60);
$summary->setDescription(_AM_SMEDIA_FOLDER_SUMMARYDSC);
$sform->addElement($summary);
// Description
$description_text = new XoopsFormTextArea(_AM_SMEDIA_FOLDER_DESCRIPTION, 'description', $folderObj->description('e'), 7, 60);
$description_text->setDescription(_AM_SMEDIA_FOLDER_DESCRIPTIONDSC);
$sform->addElement($description_text);
// Meta-Description
$meta = new XoopsFormTextArea(_AM_SMEDIA_FOLDER_META_DESCRIPTION, 'meta_description', $folderObj->meta_description('e'), 7, 60);
$meta->setDescription(_AM_SMEDIA_CLIP_META_DESCRIPTIONDSC);
$sform->addElement($meta);
$sform->addElement(new XoopsFormHidden('itemType', 'item_text'));
// Action buttons tray
$button_tray = new XoopsFormElementTray('', '');
$hidden = new XoopsFormHidden('op', 'addfolder_text');
$button_tray->addElement($hidden);
if ($languageid == 'new') {
// We are creating a new folder language info
$butt_create = new XoopsFormButton('', '', _AM_SMEDIA_CREATE, 'submit');
$butt_create->setExtra('onclick="this.form.elements.op.value=\'addfolder_text\'"');
$button_tray->addElement($butt_create);
$butt_clear = new XoopsFormButton('', '', _AM_SMEDIA_CLEAR, 'reset');
$button_tray->addElement($butt_clear);
$butt_cancel = new XoopsFormButton('', '', _AM_SMEDIA_CANCEL, 'button');
$butt_cancel->setExtra('onclick="history.go(-1)"');
$button_tray->addElement($butt_cancel);
} else {
// We are editing a folder language info
$butt_create = new XoopsFormButton('', '', _AM_SMEDIA_MODIFY, 'submit');
$butt_create->setExtra('onclick="this.form.elements.op.value=\'addfolder_text\'"');
$button_tray->addElement($butt_create);
$butt_cancel = new XoopsFormButton('', '', _AM_SMEDIA_CANCEL, 'button');
$butt_cancel->setExtra('onclick="history.go(-1)"');
$button_tray->addElement($butt_cancel);
}
$sform->addElement($button_tray);
$sform->display();
echo "</div>";
unset($hidden);
}
示例9: getLangByName
function getLangByName($languageName = '')
{
include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
$idx = array_search($languageName, $this->mLanguageNames);
$language = $this->mLanguages[$idx];
$availableLangs = XoopsLists::getLangList();
if ($language != '' && in_array($languageName, $availableLangs)) {
return $language;
}
return false;
}
示例10: sysutil_ml_getlangbyname
function sysutil_ml_getlangbyname($langname)
{
include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
$lang_available = XoopsLists::getLangList();
if ($langname != '' && in_array($langname, $lang_available)) {
$sysutil_ml_langnames = explode(',', SYSUTIL_ML_LANGNAMES);
$idx = array_search($langname, $sysutil_ml_langnames);
$sysutil_ml_langs = explode(',', SYSUTIL_ML_LANGS);
$sysutil_ml_lang = $sysutil_ml_langs[$idx];
return $sysutil_ml_lang;
}
return false;
}
示例11: getXoopsLangList
function getXoopsLangList()
{
return XoopsLists::getLangList();
}
示例12: render_field
/**
* Prepares the form field that will be shown on settings form
* and returns the HTML code.
* <br><br>
* <p><strong>Usage:</strong></p>
* <code>echo RMSettings::render_field( string 'field_id', array $field );</code>
*
* @param stdClass $field <p>An object with all field values, including caption, id, description, type, value, etc.</p>
* @return string
*/
public static function render_field($field)
{
if (empty($field)) {
return null;
}
$tc = TextCleaner::getInstance();
switch ($field->field) {
case 'textarea':
if ($field->type == 'array') {
// this is exceptional.. only when value type is arrayneed a smarter way for this
$ele = $field->value != '' ? new RMFormTextArea($field->caption, $field->name, 4, 45, $tc->specialchars(implode('|', $field->value))) : new RMFormTextArea($field->title, $field->name, 4, 45);
} else {
$ele = new RMFormTextArea($field->caption, $field->name, 4, 50, $tc->specialchars($field->value));
}
break;
case 'select':
$ele = new RMFormSelect($field->caption, $field->name, 0, array($field->value));
foreach ($field->options as $caption => $value) {
$ele->addOption($value, defined($caption) ? constant($caption) : $caption);
}
break;
case 'select_multi':
$ele = new RMFormSelect($field->caption, $field->name, 1, array($field->value));
$options = $field->options;
foreach ($options as $value => $caption) {
$value = defined($value) ? constant($value) : $value;
$caption = defined($caption) ? constant($caption) : $caption;
$ele->addOption($value, $caption);
}
break;
case 'yesno':
$ele = new RMFormYesNo($field->caption, $field->name, $field->value);
break;
case 'theme':
case 'theme_multi':
$ele = new RMFormTheme($field->caption, $field->name, $field->field == 'theme_multi' ? 1 : 0, 0, $field->value);
break;
case 'cu-theme':
case 'cu-theme-multi':
$ele = new RMFormTheme($field->caption, $field->name, $field->field == 'cu-theme-multi' ? 1 : 0, 0, $field->value, 1, 'GUI');
break;
case 'tplset':
$ele = new RMFormSelect($field->caption, $field->name, 0, array($field->value));
$tplset_handler =& xoops_gethandler('tplset');
$tplsetlist = $tplset_handler->getList();
asort($tplsetlist);
foreach ($tplsetlist as $key => $name) {
$ele->addOption($key, $name);
}
break;
case 'cpanel':
$ele = new RMFormSelect($field->caption, $field->name, 0, array($field->value));
xoops_load("cpanel", "system");
$list = XoopsSystemCpanel::getGuis();
$ele->addOptionArray($list);
break;
case 'timezone':
$ele = new RMFormTimeZoneField($field->caption, $field->name, 0, 0, $field->value);
break;
case 'language':
case 'language_multi':
$langs = XoopsLists::getLangList();
$ele = new RMFormSelect($field->caption, $field->name, $field->field == 'language_multi' ? 1 : 0, $field->value);
foreach ($langs as $caption => $value) {
$ele->addOption($value, $caption);
}
break;
case 'cu-language':
case 'cu-language-multi':
$ele = new RMFormLanguageField($field->caption, $field->name, $field->field == 'cu-language-multi' ? 1 : 0, 0, $field->value);
break;
case 'startpage':
$ele = new RMFormSelect($field->caption, $field->name, 0, array($field->value));
$module_handler =& xoops_gethandler('module');
$criteria = new CriteriaCompo(new Criteria('hasmain', 1));
$criteria->add(new Criteria('isactive', 1));
$moduleslist = $module_handler->getList($criteria, true);
$moduleslist['--'] = _MD_AM_NONE;
$ele->addOptionsArray($moduleslist);
break;
case 'group':
case 'group_multi':
$ele = new RMFormGroups($field->caption, $field->name, $field->field == 'group_multi' ? 1 : 0, 0, 1, $field->value);
break;
case 'user':
case 'user_multi':
$ele = new RMFormUser($field->caption, $field->name, $field->field == 'user_multi' ? 1 : 0, $field->value);
break;
case 'module_cache':
$ele = new RMFormCacheModuleField($field->caption, $field->name, $field->value);
//.........这里部分代码省略.........