$indent = ''; for ($i = 0; $i < $cat['indent']; $i++) { $indent .= ' '; } // category translated in this language? $cat['lang'] == $LANGCODE ? $catname = $cat['name'] : ($catname = $cat['name'] . ' (' . $languageCodes[strtoupper($cat['lang'])] . ')'); // show category name in actual language print '<td>'; if ($cat['lang'] != $LANGCODE) { // translate category printf('<a href="%s?action=translatecategory&cat=%s&trlang=%s" title="%s"><span title="%s" class="icon-share"></span></a></a>', $currentLink, $cat['id'], $LANGCODE, $PMF_LANG['ad_categ_translate'], $PMF_LANG['ad_categ_translate']); } printf(" %s<strong>%s</strong>", $indent, $catname); print "</td>\n"; // get languages in use for categories $id_languages = $category->getCategoryLanguagesTranslated($cat["id"]); foreach ($all_lang as $lang => $language) { if ($language == $currentLanguage) { continue; } if (array_key_exists($language, $id_languages)) { $spokenLanguage = PMF_String::preg_replace('/\\(.*\\)/', '', $id_languages[$language]); printf('<td title="%s: %s">', $PMF_LANG['ad_categ_titel'], $spokenLanguage); printf('<span title="%s: %s" class="label label-success"><i class="icon-check icon-white"></i></span></td>', $PMF_LANG['ad_categ_titel'], $spokenLanguage); } else { printf('<td><a href="%s?action=translatecategory&cat=%s&trlang=%s" title="%s">', $currentLink, $cat['id'], $lang, $PMF_LANG['ad_categ_translate']); printf('<span title="%s" class="label label-inverse"><i class="icon-share icon-white"></i></span></a>', $PMF_LANG['ad_categ_translate']); } print "</td>\n"; } print "</tr>\n";
print $user->getAllUserOptions($category->categoryName[$id]['user_id']); ?> </select> </p> <p> <input class="submit" type="submit" name="submit" value="<?php print $PMF_LANG["ad_categ_translatecateg"]; ?> " /> </p> <hr /> <?php print '<p><strong>' . $PMF_LANG["ad_categ_transalready"] . '</strong><br />'; foreach ($category->getCategoryLanguagesTranslated($id) as $language => $namedesc) { print " <strong style=\"vertical-align: top;\">· " . $language . "</strong>: " . $namedesc . "\n<br />"; } print '</p>'; ?> </form> <?php if ($faqconfig->get('main.enableGoogleTranslation') === true) { ?> <script src="https://www.google.com/jsapi?key=<?php echo $faqconfig->get('main.googleTranslationKey'); ?> " type="text/javascript"></script> <script type="text/javascript"> /* <![CDATA[ */
* @category phpMyFAQ * @package Administration * @author Thorsten Rinne <*****@*****.**> * @author Rudi Ferrari <*****@*****.**> * @copyright 2006-2014 phpMyFAQ Team * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 * @link http://www.phpmyfaq.de * @since 2006-09-10 */ if (!defined('IS_VALID_PHPMYFAQ')) { $protocol = 'http'; if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') { $protocol = 'https'; } header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } if ($user->perm->checkRight($user->getUserId(), 'editcateg')) { $category = new PMF_Category($faqConfig, [], false); $category->setUser($currentAdminUser); $category->setGroups($currentAdminGroups); $category->getMissingCategories(); $id = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT); $user_permission = $category->getPermissions('user', array($id)); $group_permission = $category->getPermissions('group', array($id)); $selectedLanguage = PMF_Filter::filterInput(INPUT_GET, 'trlang', FILTER_SANITIZE_STRING, $LANGCODE); $twig->loadTemplate('category/translate.twig')->display(array('PMF_LANG' => $PMF_LANG, 'categoryName' => $category->categoryName[$id]['name'], 'csrfToken' => $user->getCsrfTokenFromSession(), 'languageOptions' => $category->getCategoryLanguagesToTranslate($id, $selectedLanguage), 'groupPermission' => $faqConfig->get('security.permLevel') !== 'basic' ? $group_permission[0] : -1, 'id' => $id, 'parentId' => $category->categoryName[$id]['parent_id'], 'showcat' => $selectedLanguage !== $LANGCODE, 'translations' => $category->getCategoryLanguagesTranslated($id), 'userOptions' => $user->getAllUserOptions($category->categoryName[$id]['user_id']), 'userPermission' => $user_permission[0])); unset($category, $id, $user_permission, $group_permission, $selectedLanguage); } else { require 'noperm.php'; }