Ojs\CoreBundle\Service\Twig\FieldDisplayExtension::generateTabsView PHP Method

generateTabsView() private method

private generateTabsView ( $fieldTranslations, $field, $isKeywords = false )
    private function generateTabsView($fieldTranslations, $field, $isKeywords = false)
    {
        $template = '<ul id="tabs" class="nav nav-tabs" data-tabs="tabs">';
        $i = 0;
        foreach ($fieldTranslations as $langCode => $translationValue) {
            if ($i == 0) {
                $template .= '<li class="active"><a href="#' . $field . '-' . $langCode . '" data-toggle="tab">' . $langCode . '</a></li>';
            } else {
                $template .= '<li><a href="#' . $field . '-' . $langCode . '" data-toggle="tab">' . $langCode . '</a></li>';
            }
            $i++;
        }
        $template .= '</ul><div id="my-tab-content" class="tab-content">';
        $t = 0;
        foreach ($fieldTranslations as $langCode => $translationValue) {
            $activeString = $t == 0 ? 'active' : '';
            $template .= '<div class="tab-pane ' . $activeString . '" id="' . $field . '-' . $langCode . '">';
            if ($isKeywords) {
                $explodeValue = explode(',', $translationValue);
                $i = 0;
                foreach ($explodeValue as $explodeItem) {
                    $commaSign = $i != 0 ? ',' : '';
                    $template .= $commaSign . '<a href="' . $this->router->generate('ojs_search_index', ['q' => $explodeItem]) . '" target="_blank">' . $explodeItem . '</a>';
                    $i++;
                }
            } else {
                $template .= $translationValue;
            }
            $template .= '</div>';
            $t++;
        }
        $template .= '</div>';
        return $template;
    }