diff --git a/link/lang/de/strings.php b/link/lang/de/strings.php index 7080aa6..acbc08d 100644 --- a/link/lang/de/strings.php +++ b/link/lang/de/strings.php @@ -2,3 +2,5 @@ App::$strings["Link on Hub"] = "Link auf dem Hub"; App::$strings["Show \"Link on Hub\" in the dropdown menu"] = "Zeige \"Link auf dem Hub\" im Dropdown-Menü"; +App::$strings["Hide side panels on the link page"] = "Seitenwände auf der Linkseite ausblenden"; + diff --git a/link/lang/es/strings.php b/link/lang/es/strings.php index ad25ddc..24cf335 100644 --- a/link/lang/es/strings.php +++ b/link/lang/es/strings.php @@ -2,3 +2,4 @@ App::$strings["Link on Hub"] = "Enlazar con la entrada en el hub"; App::$strings["Show \"Link on Hub\" in the dropdown menu"] = "Mostrar \"Enlazar con la entrada en el hub\" en el menú desplegable"; +App::$strings["Hide side panels on the link page"] = "Ocultar los paneles laterales en la página de enlaces"; \ No newline at end of file diff --git a/link/lang/fr/strings.php b/link/lang/fr/strings.php index bceabb3..ef3c3a4 100644 --- a/link/lang/fr/strings.php +++ b/link/lang/fr/strings.php @@ -2,3 +2,4 @@ App::$strings["Link on Hub"] = "Lien sur le Hub"; App::$strings["Show \"Link on Hub\" in the dropdown menu"] = "Afficher \"Lien sur le Hub\" dans le menu déroulant"; +App::$strings["Hide side panels on the link page"] = "Masquer les panneaux latéraux sur la page de liens"; diff --git a/link/lang/it/strings.php b/link/lang/it/strings.php index 51d303c..04ab92b 100644 --- a/link/lang/it/strings.php +++ b/link/lang/it/strings.php @@ -2,3 +2,4 @@ App::$strings["Link on Hub"] = "Link al hub"; App::$strings["Show \"Link on Hub\" in the dropdown menu"] = "Mostra \"Link al hub\" nel menu a tendina"; +App::$strings["Hide side panels on the link page"] = "Nascondere i pannelli laterali nella pagina dei link"; diff --git a/link/lang/ru/strings.php b/link/lang/ru/strings.php index 554e43c..3db345f 100644 --- a/link/lang/ru/strings.php +++ b/link/lang/ru/strings.php @@ -2,3 +2,4 @@ App::$strings["Link on Hub"] = "Ссылка на хабе"; App::$strings["Show \"Link on Hub\" in the dropdown menu"] = "Показывать \"Ссылку на хабе\" в выпадающем меню"; +App::$strings["Hide side panels on the link page"] = "Скрывать боковые панели на странице ссылки"; diff --git a/link/link.php b/link/link.php index 2f76413..87f1313 100644 --- a/link/link.php +++ b/link/link.php @@ -2,7 +2,7 @@ /** * Name: Link * Description: Using short links on whole hub - * Version: 0.67 + * Version: 0.69 * Author: ivan zlax <@zlax@ussr.win> * Maintainer: ivan zlax <@zlax@ussr.win> */ @@ -15,12 +15,15 @@ function link_load() { Route::register('addon/link/Mod_Link.php','link'); if (get_config('link','linkonhub')) register_hook('dropdown_extras', 'addon/link/link.php', 'dropdown_link'); + if (get_config('link','hideasides')) + register_hook('page_header', 'addon/link/link.php', 'hideasides_header'); set_config('link','linkenabled',1); } function link_unload() { Route::unregister('addon/link/Mod_Link.php','link'); unregister_hook('dropdown_extras', 'addon/link/link.php', 'dropdown_link'); + unregister_hook('page_header', 'addon/link/link.php', 'hideasides_header'); del_config('link','linkenabled'); } @@ -28,16 +31,22 @@ function link_plugin_admin(&$a,&$o) { $t = get_markup_template( "admin.tpl", "addon/link/" ); $o = replace_macros($t, array( '$submit' => t('Submit'), + '$hideasides' => array('hideasides', t('Hide side panels on the link page'), get_config('link', 'hideasides')), '$linkonhub' => array('linkonhub', t('Show "Link on Hub" in the dropdown menu'), get_config('link', 'linkonhub')), )); } function link_plugin_admin_post(&$a) { set_config('link','linkonhub',trim($_POST['linkonhub'])); + set_config('link','hideasides',trim($_POST['hideasides'])); if (get_config('link','linkonhub')) register_hook('dropdown_extras', 'addon/link/link.php', 'dropdown_link'); else unregister_hook('dropdown_extras', 'addon/link/link.php', 'dropdown_link'); + if (get_config('link','hideasides')) + register_hook('page_header', 'addon/link/link.php', 'hideasides_header'); + else + unregister_hook('page_header', 'addon/link/link.php', 'hideasides_header'); info( t('Settings updated.') . EOL ); } @@ -47,3 +56,11 @@ function dropdown_link(&$extras) { $arr['dropdown_extras'] .= ''.t('Link on Hub').''; $extras = $arr; } + +function hideasides_header($a, &$b) { + $querystr = stristr(App::$query_string, '/', true); + if ($querystr == "link") { + $addScriptTag = "\r\n"; + App::$page['htmlhead'] .= $addScriptTag; + } +} diff --git a/link/view/tpl/admin.tpl b/link/view/tpl/admin.tpl index 410db8f..dd696ed 100644 --- a/link/view/tpl/admin.tpl +++ b/link/view/tpl/admin.tpl @@ -1,2 +1,3 @@ {{include file="field_checkbox.tpl" field=$linkonhub}} +{{include file="field_checkbox.tpl" field=$hideasides}}