From b4c33735d6f299d0b708316891c8d72c76c9eaf5 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 12 Feb 2021 14:27:21 -0800 Subject: [PATCH] Closes #4380 - Moved submit button on language file editor modal. Removed some PHP errors. --- e107_admin/lancheck.php | 27 ++++++++++--------- e107_admin/language.php | 17 +++++++++--- e107_handlers/admin_ui.php | 2 +- e107_languages/English/admin/lan_language.php | 4 ++- 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/e107_admin/lancheck.php b/e107_admin/lancheck.php index 22b04c458..d32d77944 100644 --- a/e107_admin/lancheck.php +++ b/e107_admin/lancheck.php @@ -405,7 +405,7 @@ class lancheck // return true; } - return FALSE; + return false; } @@ -1202,7 +1202,7 @@ class lancheck else { // $caption = LAN_SAVED." ".$lan."/".$writeit.""; - $caption = LAN_SAVED." ".$writeit.""; + $caption = LAN_SAVED." ".str_replace('..','',$writeit).""; $status = e107::getMessage()->addSuccess($caption)->render(); } fclose($fp); @@ -1272,7 +1272,7 @@ class lancheck if(!empty($check['bom'][$bomkey])) { $bom_error = "".$tp->lanVars(LAN_CHECK_15,array("'<?php'","'?>'"))."
"; // illegal chars - $this->checkLog('bom',1);; + $this->checkLog('bom',1); } else { @@ -1325,7 +1325,7 @@ class lancheck $editUrl = e_REQUEST_SELF."?".http_build_query($parms,'&'); $text .=" - ".LAN_EDIT.""; + ".LAN_EDIT.""; $text .=""; } @@ -1527,7 +1527,7 @@ class lancheck list($pluginDirectory, $other) = explode("/",$tmpDir, 2); - if($mode == 'plugins' && ($this->thirdPartyPlugins !== true) && !in_array($pluginDirectory, $this->core_plugins)) + if(($this->thirdPartyPlugins !== true) && !in_array($pluginDirectory, $this->core_plugins)) { continue; } @@ -1540,7 +1540,7 @@ class lancheck list($themeDirectory, $other) = explode("/",$tmpDir, 2); - if($mode == 'themes' && ($this->thirdPartyPlugins !== true) && !in_array($themeDirectory, $this->core_themes)) + if(($this->thirdPartyPlugins !== true) && !in_array($themeDirectory, $this->core_themes)) { continue; } @@ -1827,7 +1827,8 @@ class lancheck { $rowamount = round(strlen($trans['orig'][$sk])/34)+1; $hglt1=""; $hglt2=""; - if ($trans['tran'][$sk] == "" && $trans['orig'][$sk]!="") { + if(empty($trans['tran'][$sk]) && !empty($trans['orig'][$sk])) + { $hglt1="";//Missing $hglt2=""; } @@ -1841,10 +1842,10 @@ class lancheck ".htmlentities(str_replace("ndef++","",$trans['orig'][$sk])) .""; $text .= ""; $text .= ($writable) ? "" : ""; //echo "orig --> ".$trans['orig'][$sk]."
"; - if (strpos($trans['orig'][$sk],"ndef++") !== False) + if (strpos($trans['orig'][$sk],"ndef++") !== false) { //echo "+orig --> ".$trans['orig'][$sk]." <> ".strpos($trans['orig'][$sk],"ndef++")."
"; $text .= ""; @@ -1864,10 +1865,10 @@ class lancheck if($writable) { - $text .="
- - -
"; + $text .= '
+ + +
'; if($root_file) { diff --git a/e107_admin/language.php b/e107_admin/language.php index ab0c16490..1e4105499 100644 --- a/e107_admin/language.php +++ b/e107_admin/language.php @@ -188,12 +188,17 @@ if(!empty($_GET['iframe'])) if($return = $lck->init()) { - if($return['caption']) + if(isset($return['caption'])) { $this->addTitle($return['caption']); } - return $return['text']; + if(isset($return['text'])) + { + return $return['text']; + } + + return null; } @@ -846,8 +851,14 @@ if(!empty($_GET['iframe'])) if($opt) { - return "".$opt."
"; + $text = "".$opt."
"; } + else + { + $text = "".LANG_LAN_155.""; + } + + return $text; } } diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index eb21eb0bb..84767ca7d 100755 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -1056,7 +1056,7 @@ class e_admin_dispatcher define('e_ADMIN_UI', true); } - if(!empty($_GET['iframe'])) + if(!empty($_GET['iframe']) && !defined('e_IFRAME')) { define('e_IFRAME', true); } diff --git a/e107_languages/English/admin/lan_language.php b/e107_languages/English/admin/lan_language.php index c19c488a9..731ed4ce5 100644 --- a/e107_languages/English/admin/lan_language.php +++ b/e107_languages/English/admin/lan_language.php @@ -69,4 +69,6 @@ define("LANG_LAN_150", "[b]Search ENTIRE core before commenting out ANY LAN from define("LANG_LAN_151", "Available"); define("LANG_LAN_152", "Courtesy of the [e107 translations team]"); define("LANG_LAN_153", "Pre-release"); -define("LANG_LAN_154", "The Language Pack has been created. You can now submit it to the Github repository as instructed [here]."); \ No newline at end of file +define("LANG_LAN_154", "The Language Pack has been created. You can now submit it to the Github repository as instructed [here]."); + +define("LANG_LAN_155", "Requires additional language packs be installed."); \ No newline at end of file