Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #6817 #6824

Merged
merged 2 commits into from Jun 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 27 additions & 2 deletions concrete/blocks/switch_language/templates/flags/view.php
@@ -1,12 +1,37 @@
<?php defined('C5_EXECUTE') or die('Access Denied.');
<?php
defined('C5_EXECUTE') or die('Access Denied.');

/* @var Concrete\Core\Form\Service\Form $form */
/* @var Concrete\Core\Block\View\BlockView $view */

// The text label as configured by the user
/* @var string $label */

// Array keys are the multilingual section IDs, array values are the language names (in their own language)
/* @var array $languages */

// The list of multilanguage language sections
/* @var Concrete\Core\Multilingual\Page\Section\Section[] $languageSections */

// The ID of the currently active multilingual section (if available)
/* @var int|null $activeLanguage */

// The default multilingual section
/* @var Concrete\Core\Multilingual\Page\Section\Section $defaultLocale */

// The current language code (without Country code)
/* @var string $locale */

// The ID of the current page
/* @var int $cID */
$ih = Core::make('multilingual/interface/flag');
?>
<div class="ccm-block-switch-language-flags">
<div class="ccm-block-switch-language-flags-label"><?= $label ?></div>
<?php
foreach ($languageSections as $ml) {
?>
<a href="<?= $controller->resolve_language_url($cID, $ml->getCollectionID()) ?>" title="<?= $ml->getLanguageText($locale) ?>" class="<?php if ($activeLanguage == $ml->getCollectionID()) { ?>ccm-block-switch-language-active-flag<?php } ?>"><?= $ih->getSectionFlagIcon($ml) ?></a>
<a href="<?= $controller->resolve_language_url($cID, $ml->getCollectionID()) ?>" title="<?= $languages[$ml->getCollectionID()] ?>" class="<?php if ($activeLanguage == $ml->getCollectionID()) { ?>ccm-block-switch-language-active-flag<?php } ?>"><?= $ih->getSectionFlagIcon($ml) ?></a>
<?php
}
?>
Expand Down
@@ -1,4 +1,29 @@
<?php defined('C5_EXECUTE') or die('Access Denied.');
<?php
defined('C5_EXECUTE') or die('Access Denied.');

/* @var Concrete\Core\Form\Service\Form $form */
/* @var Concrete\Core\Block\View\BlockView $view */

// The text label as configured by the user
/* @var string $label */

// Array keys are the multilingual section IDs, array values are the language names (in their own language)
/* @var array $languages */

// The list of multilanguage language sections
/* @var Concrete\Core\Multilingual\Page\Section\Section[] $languageSections */

// The ID of the currently active multilingual section (if available)
/* @var int|null $activeLanguage */

// The default multilingual section
/* @var Concrete\Core\Multilingual\Page\Section\Section $defaultLocale */

// The current language code (without Country code)
/* @var string $locale */

// The ID of the current page
/* @var int $cID */
$ih = Core::make('multilingual/interface/flag');
?>

Expand All @@ -20,7 +45,7 @@
<label>
<input type="radio" name="language" value="<?= $ml->getCollectionID() ?>" <?php if (is_object($defaultLocale) && $defaultLocale->getCollectionID() == $ml->getCollectionID()) { ?> checked="checked" <?php } ?> />
<?= $ih->getSectionFlagIcon($ml) ?>
<?= $ml->getLanguageText($locale) ?>
<?= $languages[$ml->getCollectionID()] ?>
</label>
</div>
<?php
Expand Down
28 changes: 20 additions & 8 deletions concrete/blocks/switch_language/view.php
Expand Up @@ -4,14 +4,26 @@
/* @var Concrete\Core\Form\Service\Form $form */
/* @var Concrete\Core\Block\View\BlockView $view */

/* @var string $label The text label as configured by the user */

/* @var array $languages Array keys are the multilingual section IDs, array values are the language names (in their own language) */
/* @var Concrete\Core\Multilingual\Page\Section\Section[] $languageSections The list of multilanguage language sections */
/* @var int|null $activeLanguage The ID of the currently active multilingual section (if available) */
/* @var Concrete\Core\Multilingual\Page\Section\Section $defaultLocale The default multilingual section */
/* @var string $locale The current language code (without Country code) */
/* @var int $cID The ID of the current page */
// The text label as configured by the user
/* @var string $label */

// Array keys are the multilingual section IDs, array values are the language names (in their own language)
/* @var array $languages */

// The list of multilanguage language sections
/* @var Concrete\Core\Multilingual\Page\Section\Section[] $languageSections */

// The ID of the currently active multilingual section (if available)
/* @var int|null $activeLanguage */

// The default multilingual section
/* @var Concrete\Core\Multilingual\Page\Section\Section $defaultLocale */

// The current language code (without Country code)
/* @var string $locale */

// The ID of the current page
/* @var int $cID */
?>

<div class="ccm-block-switch-language">
Expand Down