If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Customization from the Admin / Make Admin language dropdown visible on all Admin pages?

Make Admin language dropdown visible on all Admin pages?

Started by abcisme on 16 Nov 2012, 3:33 PM · Views: 2,257

Results 1 to 3 of 3
16 Nov 2012, 3:33 PM
#1
abcisme avatar

abcisme

Zen Follower

Join Date:
Jun 2006
Posts:
298
Plugin Contributions:
0

Post #1 by abcisme

My store is in English and French. I'd like to have the language selection dropdown box on the admin page stay visible no matter what admin page I'm on. Currently, it hides the dropdown when I view an order, which is a pain when trying to toggle back and forth between French and English orders. (I have SuperOrders 3.0 installed, if that makes a difference.)

Is there a way to make the language dropdown remain visible on all admin pages?

Thanks.

17 Nov 2012, 12:07 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #2 by drbyte

You would need to edit the /admin/includes/header.php file to not only change the limits on which pages it displays for, but also to include all page parameters when the language is changed, else when you choose the other language you'll lose which order you're looking at, etc.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

26 Jan 2020, 8:54 AM
#3
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Post #3 by torvista

I removed the test years ago and I don't think I have needed to do anything else regarding passing parameters.
I think it should be on all admin pages: for checking translations, and on re-entry back into whatever page in admin after a timeout.

//steve removed IF to always show language dropdown
// if ((basename($PHP_SELF) != FILENAME_DEFINE_LANGUAGE . '.php') and (basename($PHP_SELF) != FILENAME_PRODUCTS_OPTIONS_NAME . '.php') and empty($action)) {
$languages_array = array();
$languages = zen_get_languages();
if (sizeof($languages) > 1) {
//$languages_selected = $_GET['language'];
$languages_selected = $_SESSION['language'];
$missing_languages = '';
$count = 0;
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
$test_directory = DIR_WS_LANGUAGES . $languages[$i]['directory'];
$test_file = DIR_WS_LANGUAGES . $languages[$i]['directory'] . '.php';
if (file_exists($test_file) and file_exists($test_directory)) {
$count++;
$languages_array[] = array('id' => $languages[$i]['code'],
'text' => $languages[$i]['name']);
if ($languages[$i]['directory'] == $_SESSION['language']) {
$languages_selected = $languages[$i]['code'];
}
} else {
$missing_languages .= ' ' . ucfirst($languages[$i]['directory']) . ' ' . $languages[$i]['name'];
}
}

// if languages in table do not match valid languages show error message
if ($count != sizeof($languages)) {
$messageStack->add('MISSING LANGUAGE FILES OR DIRECTORIES ...' . $missing_languages, 'caution');
}
$hide_languages = false;
} else {
$hide_languages = true;
} // more than one language
/* steve removed IF} else {
$hide_languages = true;
} // hide when other language dropdown is used
eof */

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...