本文整理汇总了PHP中Language::getLanguageId方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::getLanguageId方法的具体用法?PHP Language::getLanguageId怎么用?PHP Language::getLanguageId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Language
的用法示例。
在下文中一共展示了Language::getLanguageId方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: putGS
</SELECT>
</TD>
</TR>
<tr style="display: none;" id="topic_list">
<td align="right"><?php
putGS("Top element");
?>
:</td>
<td>
<select name="f_root_topic_id" class="input_select">
<?php
$TOL_Language = camp_session_get('LoginLanguageId', 1);
$lang = new Language($TOL_Language);
$currentLanguageId = $lang->getLanguageId();
//$currentLanguages = Language::GetLanguages(null, $TOL_Language);
//$currentLanguageId = $currentLanguages[0]->getLanguageId();
$topics = Topic::GetTree();
foreach ($topics as $topicPath) {
$printTopic = array();
foreach ($topicPath as $topicId => $topic) {
$translations = $topic->getTranslations();
if (array_key_exists($currentLanguageId, $translations)) {
$currentTopic = $translations[$currentLanguageId];
} elseif ($currentLanguageId != 1 && array_key_exists(1, $translations)) {
$currentTopic = $translations[1];
} else {
$currentTopic = end($translations);
}
$printTopic[] = $currentTopic;
示例2: if
<TD>
<DIV STYLE="width: 15px;">
<?php if (count($fields) > 1 && $i != 0) { ?><A HREF="do_reorder.php?f_article_type=<?php print urlencode($articleTypeName); ?>&f_field_name=<?php print $field->getPrintName(); ?>&f_move=up&<?php echo SecurityToken::URLParameter(); ?>"><IMG BORDER="0" SRC="<?php echo $Campsite['ADMIN_IMAGE_BASE_URL']; ?>/up_arrow.png"></A><?php } else { ?> <?php } ?>
</DIV>
</TD>
</TR></TABLE>
</TD>
<TD>
<?php if ($duplicateFieldName) { echo '<div class="failure_message">'; } ?>
<A HREF="rename.php?f_article_type=<?php print urlencode($articleTypeName); ?>&f_field_name=<?php print $field->getPrintName(); ?>"><?php print htmlspecialchars($field->getPrintName()); ?></A>
<?php if ($duplicateFieldName) { echo '**</div>'; } ?>
</TD>
<TD>
<A HREF="retype.php?f_article_type=<?php print urlencode($articleTypeName); ?>&f_field_name=<?php print $field->getPrintName(); ?>"><?php print htmlspecialchars($field->getVerboseTypeName($languageObj->getLanguageId())); ?></A>
</TD>
<TD>
<?php print htmlspecialchars($field->getDisplayName()); ?> <?php print htmlspecialchars($field->getDisplayNameLanguageCode()); ?>
</TD>
<td>
<a href="javascript: void(0);" onclick="HideAll(field_ids); ShowElement('translate_field_<?php p($i); ?>');"><img src="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/localizer.png" alt="<?php putGS("Translate"); ?>" title="<?php putGS("Translate"); ?>" border="0"></a>
</td>
<TD ALIGN="CENTER">
<?php if ($field->getType() == ArticleTypeField::TYPE_BODY) { ?>
<input type="checkbox" <?php if ($field->isContent()) { ?>checked<?php } ?> id="set_is_content_<?php echo $i; ?>" name="set_is_content_<?php echo $i; ?>" onclick="if (confirm('<?php putGS('Are you sure you want to make $1 a $2 field?', $field->getPrintName(), $contentType); ?>')) { location.href='/<?php p($ADMIN); ?>/article_types/fields/set_is_content.php?f_article_type=<?php print urlencode($articleTypeName); ?>&f_field_name=<?php print urlencode($field->getPrintName()); ?>&f_is_content=<?php print $setContentField; ?>&<?php echo SecurityToken::URLParameter(); ?>' } else { document.getElementById('set_is_content_<?php echo $i; ?>').checked = <?php echo $isContentField; ?> }">
<?php } else { ?>
<?php putGS('N/A'); ?>
示例3: urlencode
}
?>
</TD>
<TD>
<A HREF="/<?php
echo $ADMIN;
?>
/article_types/fields/retype.php?f_article_type=<?php
print urlencode($articleTypeName);
?>
&f_field_name=<?php
print $field->getPrintName();
?>
"><?php
print htmlspecialchars($field->getVerboseTypeName($languageObj->getLanguageId()));
?>
</A>
</TD>
<TD>
<?php
print htmlspecialchars($field->getDisplayName($languageObj->getLanguageId()));
?>
<?php
print htmlspecialchars($field->getDisplayNameLanguageCode($languageObj->getLanguageId()));
?>
</TD>
<td>
<a href="javascript: void(0);" onclick="HideAll(field_ids); ShowElement('translate_field_<?php
示例4: Language
?>
" id="<?php
echo $dbColumn->getName();
?>
" <?php
if ($f_edit_mode != "edit") {
?>
disabled<?php
}
?>
>
<option value="0"></option>
<?php
$TOL_Language = camp_session_get('TOL_Language', 'en');
$currentLanguage = new Language($TOL_Language);
$currentLanguageId = $currentLanguage->getLanguageId();
foreach ($subtopics as $topicPath) {
$printTopic = array();
foreach ($topicPath as $topicId => $topic) {
$translations = $topic->getTranslations();
if (array_key_exists($currentLanguageId, $translations)) {
$currentTopic = $translations[$currentLanguageId];
} elseif ($currentLanguageId != 1 && array_key_exists(1, $translations)) {
$currentTopic = $translations[1];
} else {
$currentTopic = end($translations);
}
$printTopic[] = $currentTopic;
}
camp_html_select_option($topicId, $articleTopicId, implode(" / ", $printTopic));
}
示例5: p
<td colspan="2">
<FORM method="POST" action="do_translate.php">
<?php echo SecurityToken::FormParameter(); ?>
<input type="hidden" name="f_type_id" value="<?php p($articleType); ?>">
<table cellpadding="0" cellspacing="0" style="border-top: 1px solid #CFC467; border-bottom: 1px solid #CFC467; background-color: #FFFCDF ; padding-left: 5px; padding-right: 5px;" width="100%">
<tr>
<td align="left">
<table cellpadding="2" cellspacing="1">
<tr>
<td><?php putGS("Add translation:"); ?></td>
<td>
<SELECT NAME="f_type_language_id" class="input_select" alt="select" emsg="<?php putGS("You must select a language."); ?>">
<option value="0"><?php putGS("---Select language---"); ?></option>
<?php
foreach ($allLanguages as $tmpLanguage) {
if ($languageObj->getLanguageId() == $tmpLanguage->getLanguageId())
$selected = true;
else
$selected = false;
camp_html_select_option($tmpLanguage->getLanguageId(),
$selected,
$tmpLanguage->getNativeName());
}
?>
</SELECT>
</td>
<td><input type="text" name="f_type_translation_name" value="" class="input_text" size="15" alt="blank" emsg="<?php putGS('You must enter a name for the type.'); ?>"></td>
<td><input type="submit" name="f_submit" value="<?php putGS("Translate"); ?>" class="button"></td>
</tr>
</table>
示例6: array
if ($f_language_code == "") {
camp_html_add_msg($translator->trans('You must fill in the $1 field.', array('$1' => '<B>' . $translator->trans('Code') . '</B>')));
}
if ($editMode) {
$languageObj = new Language($f_language_id);
}
if ($correct) {
$columns = array('Name' => $f_language_name, 'Code' => $f_language_code, 'OrigName' => $f_native_name, 'Month1' => $f_month_1, 'Month2' => $f_month_2, 'Month3' => $f_month_3, 'Month4' => $f_month_4, 'Month5' => $f_month_5, 'Month6' => $f_month_6, 'Month7' => $f_month_7, 'Month8' => $f_month_8, 'Month9' => $f_month_9, 'Month10' => $f_month_10, 'Month11' => $f_month_11, 'Month12' => $f_month_12, 'ShortMonth1' => $f_short_month_1, 'ShortMonth2' => $f_short_month_2, 'ShortMonth3' => $f_short_month_3, 'ShortMonth4' => $f_short_month_4, 'ShortMonth5' => $f_short_month_5, 'ShortMonth6' => $f_short_month_6, 'ShortMonth7' => $f_short_month_7, 'ShortMonth8' => $f_short_month_8, 'ShortMonth9' => $f_short_month_9, 'ShortMonth10' => $f_short_month_10, 'ShortMonth11' => $f_short_month_11, 'ShortMonth12' => $f_short_month_12, 'WDay1' => $f_sunday, 'WDay2' => $f_monday, 'WDay3' => $f_tuesday, 'WDay4' => $f_wednesday, 'WDay5' => $f_thursday, 'WDay6' => $f_friday, 'WDay7' => $f_saturday, 'ShortWDay1' => $f_short_sunday, 'ShortWDay2' => $f_short_monday, 'ShortWDay3' => $f_short_tuesday, 'ShortWDay4' => $f_short_wednesday, 'ShortWDay5' => $f_short_thursday, 'ShortWDay6' => $f_short_friday, 'ShortWDay7' => $f_short_saturday);
$success = true;
if ($editMode) {
$languageObj->update($columns);
} else {
$languageObj = new Language();
$result = $languageObj->create($columns);
if (PEAR::isError($result)) {
camp_html_add_msg($result->getMessage());
$success = false;
} else {
$f_language_id = $languageObj->getLanguageId();
}
}
if ($success) {
TimeUnit::SetTimeUnit('D', $f_language_id, $D);
TimeUnit::SetTimeUnit('W', $f_language_id, $W);
TimeUnit::SetTimeUnit('M', $f_language_id, $M);
TimeUnit::SetTimeUnit('Y', $f_language_id, $Y);
camp_html_goto_page("/{$ADMIN}/languages/index.php");
}
}
$link = "/{$ADMIN}/languages/add_modify.php" . ($editMode ? "?f_language_id=" . $f_language_id : "");
camp_html_goto_page($link);
示例7: camp_html_breadcrumbs
$articleField = new ArticleTypeField($articleTypeName, $articleTypeFieldName);
$crumbs = array();
$crumbs[] = array($translator->trans('Configure'), "");
$crumbs[] = array($translator->trans('Article Types'), "/{$ADMIN}/article_types/");
$crumbs[] = array($articleTypeName, '');
$crumbs[] = array($translator->trans("Article type fields", array(), 'article_type_fields'), "/{$ADMIN}/article_types/fields/?f_article_type=" . urlencode($articleTypeName));
$crumbs[] = array($translator->trans("Reassign a field type", array(), 'article_type_fields'), "");
echo camp_html_breadcrumbs($crumbs);
include_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/javascript_common.php";
$lang = camp_session_get('LoginLanguageId', 1);
$languageObj = new Language($lang);
// Verify the merge rules
$options = array();
$convertibleFromTypes = $articleField->getConvertibleToTypes();
foreach ($convertibleFromTypes as $type) {
$options[$type] = ArticleTypeField::VerboseTypeName($type, $languageObj->getLanguageId());
}
?>
<script>
function UpdateArticleFieldContext()
{
var my_form = document.forms["add_field_form"]
var field_type = my_form.elements["f_article_field_type"].value
var is_topic = my_form.elements["is_topic"].value
if ((is_topic == "false" && field_type == "topic")
|| (is_topic == "true" && field_type != "topic")) {
ToggleRowVisibility('topic_list')
ToggleBoolValue('is_topic')
}
}
</script>
示例8: p
camp_html_display_msgs();
?>
<P>
<FORM NAME="language_form" METHOD="POST" ACTION="/<?php
echo $ADMIN;
?>
/languages/do_add_modify.php" onsubmit="return <?php
camp_html_fvalidate();
?>
;">
<?php
echo SecurityToken::FormParameter();
if ($editMode) {
?>
<input type="hidden" name="f_language_id" value="<?php
p($languageObj->getLanguageId());
?>
">
<?php
}
?>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" CLASS="box_table">
<TR>
<TD COLSPAN="2">
<?php
if ($editMode) {
?>
<B><?php
putGS("Edit language");
?>
</B>
示例9: array
$crumbs[] = array(getGS("Edit language"), "");
} else {
$crumbs[] = array(getGS("Add new language"), "");
}
$breadcrumbs = camp_html_breadcrumbs($crumbs);
echo $breadcrumbs;
include_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/javascript_common.php");
camp_html_display_msgs();
?>
<P>
<FORM NAME="language_form" METHOD="POST" ACTION="do_add_modify.php" onsubmit="return <?php camp_html_fvalidate(); ?>;">
<?php echo SecurityToken::FormParameter(); ?>
<?php if ($editMode) { ?>
<input type="hidden" name="f_language_id" value="<?php p($languageObj->getLanguageId()); ?>">
<?php } ?>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" CLASS="box_table">
<TR>
<TD COLSPAN="2">
<?php if ($editMode) { ?>
<B><?php putGS("Edit language"); ?></B>
<?php } else { ?>
<B><?php putGS("Add new language"); ?></B>
<?php } ?>
<HR NOSHADE SIZE="1" COLOR="BLACK">
</TD>
</TR>
<TR>
<TD ALIGN="RIGHT" ><?php putGS("Name"); ?>:</TD>
<TD>
示例10: p
<TD ALIGN="CENTER">
<A HREF="/<?php
p($ADMIN);
?>
/article_types/fields/?f_article_type=<?php
print urlencode($articleType);
?>
"><?php
echo $translator->trans('Fields');
?>
</A>
</TD>
<TD>
<?php
print $currentArticleType->getDisplayName($languageObj->getLanguageId());
?>
<?php
print $currentArticleType->getDisplayNameLanguageCode($languageObj->getLanguageId());
?>
</TD>
<td>
<a href="javascript: void(0);" onclick="HideAll(type_ids); ShowElement('translate_type_<?php
p($i);
?>
');"><img src="<?php
echo $Campsite["ADMIN_IMAGE_BASE_URL"];
?>
/localizer.png" alt="<?php