From 77fd1f51a3c5f5a52f72ef8a299fe368228e2285 Mon Sep 17 00:00:00 2001 From: vdigital Date: Fri, 23 May 2008 21:05:41 +0000 Subject: git-svn-id: http://piwigo.org/svn/trunk@2357 68402e56-0260-453c-a942-63ccdbb3a9ee --- BSF/plugins/admin_multi_view/controller.php | 221 ++++++++++++++++++++++++++ BSF/plugins/admin_multi_view/index.php | 30 ++++ BSF/plugins/admin_multi_view/is_admin.inc.php | 47 ++++++ BSF/plugins/admin_multi_view/main.inc.php | 42 +++++ 4 files changed, 340 insertions(+) create mode 100644 BSF/plugins/admin_multi_view/controller.php create mode 100644 BSF/plugins/admin_multi_view/index.php create mode 100644 BSF/plugins/admin_multi_view/is_admin.inc.php create mode 100644 BSF/plugins/admin_multi_view/main.inc.php (limited to 'BSF/plugins/admin_multi_view') diff --git a/BSF/plugins/admin_multi_view/controller.php b/BSF/plugins/admin_multi_view/controller.php new file mode 100644 index 000000000..861df63a7 --- /dev/null +++ b/BSF/plugins/admin_multi_view/controller.php @@ -0,0 +1,221 @@ + + + + + + 0 ) + pwg_set_session_var( 'multiview_show_queries', 1 ); + else + pwg_unset_session_var( 'multiview_show_queries' ); + $refresh_main = true; +} + +if ( isset($_GET['debug_l10n']) ) +{ + if ( $_GET['debug_l10n']>0 ) + pwg_set_session_var( 'multiview_debug_l10n', 1 ); + else + pwg_unset_session_var( 'multiview_debug_l10n' ); + $refresh_main = true; +} + + +if ( isset($_GET['debug_template']) ) +{ + if ( $_GET['debug_template']>0 ) + pwg_set_session_var( 'multiview_debug_template', 1 ); + else + pwg_unset_session_var( 'multiview_debug_template' ); + $refresh_main = true; +} + +$my_url = get_root_url().'plugins/'.basename(dirname(__FILE__)).'/'.basename(__FILE__); + +// +-----------------------------------------------------------------------+ +// | users | +$query = ' +SELECT '.$conf['user_fields']['id'].' AS id,'.$conf['user_fields']['username'].' AS username +FROM '.USERS_TABLE; +if (is_adviser()) +{ + $query .=' + WHERE '.$conf['user_fields']['id']. ' IN ('.$user['id'].','.$conf['guest_id'].') +'; +} +$query .=' + ORDER BY CONVERT('.$conf['user_fields']['username'].',CHAR) +;'; +$user_map = simple_hash_from_query($query, 'id', 'username'); + +$users_html = ''; + + +// +-----------------------------------------------------------------------+ +// | templates | +$my_template = ''; +$themes_html=''; + +// +-----------------------------------------------------------------------+ +// | language | +$lang_html=''; + +// +-----------------------------------------------------------------------+ +// | show queries | +$show_queries_html=''; +if (!$conf['show_queries']) +{ + if ( !pwg_get_session_var( 'multiview_show_queries', 0 ) ) + $show_queries_html.='Show SQL queries'; + else + $show_queries_html.='Hide SQL queries'; +} + +// +-----------------------------------------------------------------------+ +// | debug language | +$debug_l10n_html=''; +if (!$conf['debug_l10n']) +{ + if ( !pwg_get_session_var( 'multiview_debug_l10n', 0 ) ) + $debug_l10n_html.='Debug language'; + else + $debug_l10n_html.='Revert debug language'; +} + +// +-----------------------------------------------------------------------+ +// | debug template | +$debug_template_html=''; +if (!$conf['debug_template']) +{ + if ( !pwg_get_session_var( 'multiview_debug_template', 0 ) ) + $debug_template_html.='Debug template'; + else + $debug_template_html.='Revert debug template'; +} + +?> + + + +Controller +'; +} +?> + + + +
+ + + + + + + + +
User
Theme
Lang
+\n", array($show_queries_html, $debug_l10n_html, $debug_template_html) ); ?> + + +
+ + diff --git a/BSF/plugins/admin_multi_view/index.php b/BSF/plugins/admin_multi_view/index.php new file mode 100644 index 000000000..c15b15795 --- /dev/null +++ b/BSF/plugins/admin_multi_view/index.php @@ -0,0 +1,30 @@ + diff --git a/BSF/plugins/admin_multi_view/is_admin.inc.php b/BSF/plugins/admin_multi_view/is_admin.inc.php new file mode 100644 index 000000000..7ae1f90dc --- /dev/null +++ b/BSF/plugins/admin_multi_view/is_admin.inc.php @@ -0,0 +1,47 @@ + +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"; +} +'; + + $template->append( 'head_elements', $js ); +} +?> diff --git a/BSF/plugins/admin_multi_view/main.inc.php b/BSF/plugins/admin_multi_view/main.inc.php new file mode 100644 index 000000000..d29486fd0 --- /dev/null +++ b/BSF/plugins/admin_multi_view/main.inc.php @@ -0,0 +1,42 @@ + -- cgit v1.2.3