diff --git a/themes/smartpocket/template/menubar.tpl b/themes/smartpocket/template/menubar.tpl
index 19b6b5481..5929146e6 100644
--- a/themes/smartpocket/template/menubar.tpl
+++ b/themes/smartpocket/template/menubar.tpl
@@ -1,7 +1,7 @@
-{if !empty($blocks) }
+{if !empty($blocks) }
{foreach from=$blocks key=id item=block}
{if not empty($block->template)}
@@ -12,4 +12,9 @@
{/if}
{/foreach}
-{/if}
\ No newline at end of file
+{/if}
+
+
diff --git a/themes/smartpocket/themeconf.inc.php b/themes/smartpocket/themeconf.inc.php
index 2d64b6553..e4104c9aa 100644
--- a/themes/smartpocket/themeconf.inc.php
+++ b/themes/smartpocket/themeconf.inc.php
@@ -56,6 +56,22 @@ if (!empty($_COOKIE['screen_size']))
$this->assign('picture_derivative_params', ImageStdParams::get_by_type($type));
$this->assign('thumbnail_derivative_params', ImageStdParams::get_by_type(IMG_SQUARE));
+//------------------------------------------------------------- mobile version
+add_event_handler('init', 'mobile_link');
+
+function mobile_link()
+{
+ global $template, $conf;
+ if ( !empty($conf['mobile_theme']) && (get_device() != 'desktop' || mobile_theme()))
+ {
+ $template->assign('TOGGLE_MOBILE_THEME_URL',
+ add_url_params(
+ duplicate_index_url(),
+ array('mobile' => mobile_theme() ? 'false' : 'true')
+ )
+ );
+ }
+}
if ( !function_exists( 'add_menu_on_public_pages' ) ) {