/** * Gets the translation for a given language; default language is the * session language. If no translation is set for that language, we * return the dbTableName. * * @param int p_lang * * @return string */ public function getDisplayName($p_lang = 0) { if (!$p_lang) { $lang = camp_session_get('LoginLanguageId', 1); } else { $lang = $p_lang; } $aObj = new ArticleType($this->m_articleTypeName); $translations = $aObj->getTranslations(); if (!isset($translations[$lang])) return substr($aObj->getTableName(), 1); return $translations[$lang]; } // fn getDisplayName
<?php if ($g_user->hasPermission("DeleteArticleTypes")) { ?> <TD ALIGN="CENTER"> <A HREF="/<?php p($ADMIN); ?>/article_types/do_del.php?f_article_type=<?php print urlencode($articleType); ?>&<?php echo SecurityToken::URLParameter(); ?>" onclick="return confirm('<?php putGS('Are you sure you want to delete the article type $1? WARNING: Deleting this article type will delete all the articles associated with this article type.', htmlspecialchars($articleType)); ?>');"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/delete.png" BORDER="0" ALT="<?php putGS('Delete article type $1', htmlspecialchars($articleType)); ?>" TITLE="<?php putGS('Delete article type $1.', htmlspecialchars($articleType)); ?>" ></A> </TD> <?php } ?> </TR> <tr id="translate_type_<?php p($i); ?>" style="display: none;"><td colspan="6"> <table> <?php $color2 = 0; $isFirstTranslation = true; $typeTranslations = $currentArticleType->getTranslations(); foreach ($typeTranslations as $typeLanguageId => $typeTransName) { ?> <TR <?php if ($color2) { $color2 = 0; ?>class="list_row_even"<?php } else { $color2 = 1; ?>class="list_row_odd"<?php } ?>"> <TD <?php if ($isFirstTranslation) { ?>style="border-top: 2px solid #8AACCE;"<?php } ?> valign="middle" align="center"> <?php $typeLanguage = new Language($typeLanguageId); p($typeLanguage->getCode()); ?> </TD> <TD <?php if ($isFirstTranslation) { ?>style="border-top: 2px solid #8AACCE;"<?php } ?> valign="middle" align="left" width="450px"> <?php echo htmlspecialchars($typeTransName); ?> </TD> </tr>