getLanguageFlagFile() public static method

public static getLanguageFlagFile ( $language ) : string
$language
return string
Example #1
0
 public function getLanguageFlagAction()
 {
     $iconPath = Tool::getLanguageFlagFile($this->getParam("language"));
     if (Tool\Admin::isExtJS6()) {
         header("Content-Type: image/svg+xml");
     } else {
         header("Content-Type: image/png");
     }
     echo file_get_contents($iconPath);
     exit;
 }
Example #2
0
}
?>


<table>
    <tr>
        <th>Flag</th>
        <th>Code</th>
        <th>Name</th>
    </tr>
    <?php 
foreach ($languageOptions as $lang) {
    ?>
        <tr>
            <td><img style="width:16px" src="<?php 
    echo str_replace(PIMCORE_DOCUMENT_ROOT, "", \Pimcore\Tool::getLanguageFlagFile($lang["language"]));
    ?>
"></td>
            <td><?php 
    echo $lang["language"];
    ?>
</td>
            <td><?php 
    echo $lang["display"];
    ?>
</td>
        </tr>
    <?php 
}
?>
</table>
 public function getLanguageFlagAction()
 {
     $iconPath = Tool::getLanguageFlagFile($this->getParam("language"));
     header("Content-Type: image/png");
     echo file_get_contents($iconPath);
     exit;
 }
Example #4
0
    }
}
?>


<?php 
// language icons
?>

<?php 
$languages = \Pimcore\Tool::getValidLanguages();
?>

<?php 
foreach ($languages as $language) {
    $iconFile = \Pimcore\Tool::getLanguageFlagFile($language);
    $iconFile = preg_replace("@^" . preg_quote(PIMCORE_DOCUMENT_ROOT, "@") . "@", "", $iconFile);
    ?>
    /* tab icon for localized fields [ <?php 
    echo $language;
    ?>
 ] */
    .pimcore_icon_language_<?php 
    echo strtolower($language);
    ?>
 {
        background: url(<?php 
    echo $iconFile;
    ?>
) left center no-repeat;
    }