mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
- languages: english corrections + keep lang files sorted by key - admin multi view correction: language was not always properly changed - refactor function get_computed_categories (with rub's blessing) git-svn-id: http://piwigo.org/svn/trunk@1860 68402e56-0260-453c-a942-63ccdbb3a9ee
43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<?php
|
|
if (! defined('MULTIVIEW_CONTROLLER') )
|
|
{
|
|
global $user;
|
|
$view_as = pwg_get_session_var( 'multiview_as', 0 );
|
|
if ($view_as)
|
|
{
|
|
$user = build_user( $view_as, true);
|
|
}
|
|
$theme = pwg_get_session_var( 'multiview_theme', '' );
|
|
if ( !empty($theme) )
|
|
{
|
|
list($user['template'], $user['theme']) = explode('/', $theme);
|
|
}
|
|
$lang = pwg_get_session_var( 'multiview_lang', '' );
|
|
if ( !empty($lang) )
|
|
{
|
|
$user['language'] = $lang;
|
|
}
|
|
}
|
|
|
|
add_event_handler('loc_end_page_header', 'multiview_loc_end_page_header');
|
|
|
|
function multiview_loc_end_page_header()
|
|
{
|
|
global $template;
|
|
$my_root_url = get_root_url().'plugins/'. basename(dirname(__FILE__)).'/';
|
|
$js =
|
|
'<script type="text/javascript">
|
|
var theController = window.open("", "mview_controller", "alwaysRaised=yes,dependent=yes,toolbar=no,height=200,width=220,menubar=no,resizable=yes,scrollbars=yes,status=no");
|
|
if ( theController.location.toString()=="about:blank" || !theController.location.toString().match(/^(https?.*\/)controller\.php(\?.+)?$/))
|
|
{
|
|
theController.location = "'.$my_root_url.'controller.php";
|
|
}
|
|
</script>';
|
|
|
|
$template->assign_block_vars( 'head_element', array(
|
|
'CONTENT' => $js
|
|
)
|
|
);
|
|
}
|
|
?>
|