# HG changeset patch # User Matti Hamalainen # Date 1504708476 -10800 # Node ID 4e25150aa868b24c71da1b9ac534b8824d979ef1 # Parent 28a2b6e6b52734ea9eefb4f2f3b43ecdbf66046e Change js_path configuration setting to js_file. diff -r 28a2b6e6b527 -r 4e25150aa868 example.cfg --- a/example.cfg Wed Sep 06 16:49:01 2017 +0300 +++ b/example.cfg Wed Sep 06 17:34:36 2017 +0300 @@ -20,8 +20,8 @@ album_icon = "/mgallery/album_sm.png" ;urchin_file = "urchin.inc.php" -; Relative path to Javascript files used by MGallery (mgallery.js) -js_path = "/mgallery/" +; Relative path+filename to mgallery.js +js_file = "/mgallery/mgallery.js" ; Use image from sub-album as album cover image? ; If disabled, album_icon will be always used for cover image diff -r 28a2b6e6b527 -r 4e25150aa868 mgallery.inc.php --- a/mgallery.inc.php Wed Sep 06 16:49:01 2017 +0300 +++ b/mgallery.inc.php Wed Sep 06 17:34:36 2017 +0300 @@ -76,8 +76,9 @@ "title_prefix" => [MG_STR, ""], "title_sep" => [MG_STR, " - "], "page_info" => [MG_STR, "MGallery ".$mgProgVersion." © Copyright ".$mgProgCopyright], + "css" => [MG_STR, NULL], - "js_path" => [MG_STR, NULL], + "js_file" => [MG_STR, NULL], "urchin_file" => [MG_STR, FALSE], "global_flags" => [MG_FLAGS, MGF_JAVASCRIPT | MGF_BREADCRUMBS | MGF_CAPTIONS, &$mgGFlags], diff -r 28a2b6e6b527 -r 4e25150aa868 mgallery.php --- a/mgallery.php Wed Sep 06 16:49:01 2017 +0300 +++ b/mgallery.php Wed Sep 06 17:34:36 2017 +0300 @@ -103,7 +103,7 @@ function mgPrintPageHeader($pageTitle, $pageExtra = "") { - global $pageCSS, $pageCharset, $pageUrchin, $pageJSPath; + global $pageCSS, $pageCharset, $pageUrchin, $pageJSFile; echo "\n". @@ -111,7 +111,7 @@ "\n". " \n". " \n". - " \n". + " \n". " ".strip_tags($pageTitle)."\n". $pageExtra; @@ -181,21 +181,6 @@ } -function mgGetLanguageSelector() -{ - global $pageLang, $pageLanguages; - if (isset($pageLanguages) && count($pageLanguages) > 0) - { - $str = "
"; - foreach ($pageLanguages as $id => $lang) - $str .= "".$lang.""; - return $str."
\n"; - } - else - return ""; -} - - function mgGetNaviActive(&$galIndex, $index, $delta, &$res, &$url, $entities) { global $galPath; @@ -389,7 +374,17 @@ function mgGetPageInfoHeaderEnd() { - return mgGetLanguageSelector().""; + global $pageLang, $pageLanguages; + + $str = "
"; + + if (isset($pageLanguages) && is_array($pageLanguages)) + { + foreach ($pageLanguages as $id => $lang) + $str .= "".$lang.""; + } + + return $str."
"; } @@ -456,7 +451,7 @@ mgReadSettings(); $pageCSS = mgGetSetting("css"); -$pageJSPath = mgGetSetting("js_path"); +$pageJSFile = mgGetSetting("js_file"); $pageUrchin = mgGetSetting("urchin_file"); $galBasePath = mgGetSetting("base_path"); $galBaseURL = mgGetSetting("base_url");