1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Closes #4380 - Moved submit button on language file editor modal. Removed some PHP errors.

This commit is contained in:
Cameron 2021-02-12 14:27:21 -08:00
parent 2bf5ee3909
commit b4c33735d6
4 changed files with 32 additions and 18 deletions

View File

@ -405,7 +405,7 @@ class lancheck
// return true; // return true;
} }
return FALSE; return false;
} }
@ -1202,7 +1202,7 @@ class lancheck
else else
{ {
// $caption = LAN_SAVED." <b>".$lan."/".$writeit."</b>"; // $caption = LAN_SAVED." <b>".$lan."/".$writeit."</b>";
$caption = LAN_SAVED." <b>".$writeit."</b>"; $caption = LAN_SAVED." <b>".str_replace('..','',$writeit)."</b>";
$status = e107::getMessage()->addSuccess($caption)->render(); $status = e107::getMessage()->addSuccess($caption)->render();
} }
fclose($fp); fclose($fp);
@ -1272,7 +1272,7 @@ class lancheck
if(!empty($check['bom'][$bomkey])) if(!empty($check['bom'][$bomkey]))
{ {
$bom_error = "<i>".$tp->lanVars(LAN_CHECK_15,array("'&lt;?php'","'?&gt;'"))."</i><br />"; // illegal chars $bom_error = "<i>".$tp->lanVars(LAN_CHECK_15,array("'&lt;?php'","'?&gt;'"))."</i><br />"; // illegal chars
$this->checkLog('bom',1);; $this->checkLog('bom',1);
} }
else else
{ {
@ -1325,7 +1325,7 @@ class lancheck
$editUrl = e_REQUEST_SELF."?".http_build_query($parms,'&amp;'); $editUrl = e_REQUEST_SELF."?".http_build_query($parms,'&amp;');
$text .="<td class='center' style='width:5%'> $text .="<td class='center' style='width:5%'>
<a href='".$editUrl."' data-modal-caption='".$subpath."' class='e-modal btn btn-primary' type='button'>".LAN_EDIT."</a>"; <a href='".$editUrl."' data-modal-submit='true' data-modal-caption='".$subpath."' class='e-modal btn btn-primary' type='button'>".LAN_EDIT."</a>";
$text .="</td></tr>"; $text .="</td></tr>";
} }
@ -1527,7 +1527,7 @@ class lancheck
list($pluginDirectory, $other) = explode("/",$tmpDir, 2); 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; continue;
} }
@ -1540,7 +1540,7 @@ class lancheck
list($themeDirectory, $other) = explode("/",$tmpDir, 2); 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; continue;
} }
@ -1827,7 +1827,8 @@ class lancheck
{ {
$rowamount = round(strlen($trans['orig'][$sk])/34)+1; $rowamount = round(strlen($trans['orig'][$sk])/34)+1;
$hglt1=""; $hglt2=""; $hglt1=""; $hglt2="";
if ($trans['tran'][$sk] == "" && $trans['orig'][$sk]!="") { if(empty($trans['tran'][$sk]) && !empty($trans['orig'][$sk]))
{
$hglt1="<span class='label label-danger label-important e-tip' title='".LAN_MISSING."'>";//Missing $hglt1="<span class='label label-danger label-important e-tip' title='".LAN_MISSING."'>";//Missing
$hglt2="</span>"; $hglt2="</span>";
} }
@ -1841,10 +1842,10 @@ class lancheck
<td style='width:40%;vertical-align:top'>".htmlentities(str_replace("ndef++","",$trans['orig'][$sk])) ."</td>"; <td style='width:40%;vertical-align:top'>".htmlentities(str_replace("ndef++","",$trans['orig'][$sk])) ."</td>";
$text .= "<td class='forumheader3' style='width:50%;vertical-align:top'>"; $text .= "<td class='forumheader3' style='width:50%;vertical-align:top'>";
$text .= ($writable) ? "<textarea class='input-xxlarge' name='newlang[]' rows='$rowamount' cols='45' style='height:100%'>" : ""; $text .= ($writable) ? "<textarea class='input-xxlarge' name='newlang[]' rows='$rowamount' cols='45' style='height:100%'>" : "";
$text .= htmlentities(str_replace("ndef++","",$trans['tran'][$sk])); $text .= htmlentities(str_replace("ndef++","", varset($trans['tran'][$sk])));
$text .= ($writable) ? "</textarea>" : ""; $text .= ($writable) ? "</textarea>" : "";
//echo "orig --> ".$trans['orig'][$sk]."<br />"; //echo "orig --> ".$trans['orig'][$sk]."<br />";
if (strpos($trans['orig'][$sk],"ndef++") !== False) if (strpos($trans['orig'][$sk],"ndef++") !== false)
{ {
//echo "+orig --> ".$trans['orig'][$sk]." <> ".strpos($trans['orig'][$sk],"ndef++")."<br />"; //echo "+orig --> ".$trans['orig'][$sk]." <> ".strpos($trans['orig'][$sk],"ndef++")."<br />";
$text .= "<input type='hidden' name='newdef[]' value='ndef++".$sk."' />"; $text .= "<input type='hidden' name='newdef[]' value='ndef++".$sk."' />";
@ -1864,10 +1865,10 @@ class lancheck
if($writable) if($writable)
{ {
$text .="<div class='buttons-bar center'> $text .= '<div class="buttons-bar center">
<input type='hidden' name='lan' value='{$lan}' /> <input type="hidden" name="lan" value="'.$lan.'" />
<input class='btn btn-warning' type='submit' name='saveLanguageFile' value=\"".LAN_SAVE." ".str_replace($dir2,"",$root_file)." \" /> <button id="etrigger-submit" class="btn btn-warning" type="submit" name="saveLanguageFile" value="1" >'.LAN_SAVE.' '.str_replace($dir2,'',$root_file).'</button>
</div>"; </div>';
if($root_file) if($root_file)
{ {

View File

@ -188,12 +188,17 @@ if(!empty($_GET['iframe']))
if($return = $lck->init()) if($return = $lck->init())
{ {
if($return['caption']) if(isset($return['caption']))
{ {
$this->addTitle($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) if($opt)
{ {
return "<table class='table table-striped table-bordered' style='margin-left:0px;width:600px'>".$opt."</table>"; $text = "<table class='table table-striped table-bordered' style='margin-left:0px;width:600px'>".$opt."</table>";
} }
else
{
$text = "<span class='label label-default'>".LANG_LAN_155."</span>";
}
return $text;
} }
} }

View File

@ -1056,7 +1056,7 @@ class e_admin_dispatcher
define('e_ADMIN_UI', true); define('e_ADMIN_UI', true);
} }
if(!empty($_GET['iframe'])) if(!empty($_GET['iframe']) && !defined('e_IFRAME'))
{ {
define('e_IFRAME', true); define('e_IFRAME', true);
} }

View File

@ -70,3 +70,5 @@ define("LANG_LAN_151", "Available");
define("LANG_LAN_152", "Courtesy of the [e107 translations team]"); define("LANG_LAN_152", "Courtesy of the [e107 translations team]");
define("LANG_LAN_153", "Pre-release"); 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]."); 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.");