mirror of
https://github.com/e107inc/e107.git
synced 2025-08-30 09:39:55 +02:00
Issue #6 - Removed URLs from LANs
This commit is contained in:
@@ -312,7 +312,7 @@ class lancheck
|
||||
|
||||
private $thirdPartyPlugins = true;
|
||||
|
||||
|
||||
private $deprecatedFiles = array('lan_download.php', 'lan_parser_functions.php', 'lan_prefs.php', 'admin/lan_download.php', 'admin/lan_modcomment.php');
|
||||
|
||||
|
||||
function __construct()
|
||||
@@ -475,7 +475,7 @@ class lancheck
|
||||
if($status['error']==FALSE)
|
||||
{
|
||||
$text = $status['message']."<br />";
|
||||
$text .= share($status['file']);
|
||||
$text .= $this->share($status['file']);
|
||||
$mes->addSuccess($text);
|
||||
//$ns->tablerender(LAN_CREATED, $text );
|
||||
}
|
||||
@@ -491,6 +491,73 @@ class lancheck
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Share Language File
|
||||
* @param object $newfile
|
||||
* Usage of e107 is granted to you provided that this function is not modified or removed in any way.
|
||||
* @return
|
||||
*/
|
||||
private function share($newfile)
|
||||
{
|
||||
global $pref;
|
||||
|
||||
if(!$newfile || E107_DEBUG_LEVEL > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
global $tp;
|
||||
$full_link = $tp->createConstants($newfile);
|
||||
|
||||
$email_message = "<br />Site: <a href='".SITEURL."'>".SITENAME."</a>
|
||||
<br />User: ".USERNAME."\n
|
||||
<br />Email: ".USEREMAIL."\n
|
||||
<br />Language: ".$_POST['language']."\n
|
||||
<br />IP:".USERIP."
|
||||
<br />...would like to contribute the following language pack for e107. (see attached)<br />:
|
||||
|
||||
|
||||
<br />Missing Files: ".$_SESSION['lancheck'][$_POST['language']]['file']."
|
||||
<br />Bom Errors : ".$_SESSION['lancheck'][$_POST['language']]['bom']."
|
||||
<br />UTF Errors : ".$_SESSION['lancheck'][$_POST['language']]['utf']."
|
||||
<br />Definition Errors : ".$_SESSION['lancheck'][$_POST['language']]['def']."
|
||||
<br />Total Errors: ".$_SESSION['lancheck'][$_POST['language']]['total']."
|
||||
<br />
|
||||
<br />XML file: ".$_SESSION['lancheck'][$_POST['language']]['xml'];
|
||||
|
||||
|
||||
|
||||
require_once(e_HANDLER."mail.php");
|
||||
|
||||
$send_to = (!$_POST['contribute_pack']) ? "languagepacks@e107inc.org" : "certifiedpack@e107inc.org";
|
||||
$to_name = "e107 Inc.";
|
||||
$Cc = "";
|
||||
$Bcc = "";
|
||||
$returnpath='';
|
||||
$returnreceipt='';
|
||||
$inline ="";
|
||||
|
||||
$subject = (!$_POST['contribute_pack']) ? "[0.7 LanguagePack] " : "[0.7 Certified LanguagePack] ";
|
||||
$subject .= basename($newfile);
|
||||
|
||||
if(!@sendemail($send_to, $subject, $email_message, $to_name, '', '', $newfile, $Cc, $Bcc, $returnpath, $returnreceipt,$inline))
|
||||
{
|
||||
$text = "<div style='padding:40px'>";
|
||||
$text .= defined('LANG_LAN_EML') ? "<b>".LANG_LAN_EML."</b>" : "<b>There was a problem sending the language-pack. Please email your verified language pack to:</b>";
|
||||
$text .= " <a href='mailto:".$send_to."?subject=".$subject."'>".$send_to."</a>";
|
||||
$text .= "</div>";
|
||||
|
||||
return $text;
|
||||
}
|
||||
elseif($_POST['contribute_pack'])
|
||||
{
|
||||
return "<div style='padding:40px'>Pack Sent to e107 Inc. A confirmation email will be sent to ".$pref['siteadminemail']." once it is received.<br />Please also make sure that email coming from ".$send_to." is not blocked by your spam filter.</div>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $language
|
||||
@@ -1098,10 +1165,11 @@ class lancheck
|
||||
$diz .= "| e107 website content management system ".$lan." Language File\n";
|
||||
$diz .= "| Released under the terms and conditions of the\n";
|
||||
$diz .= "| GNU General Public License (http://gnu.org).\n";
|
||||
$diz .= "| Last Modified: ".date("Y/m/d H:i:s")."\n";
|
||||
$diz .= "|\n";
|
||||
$diz .= "| ".chr(36)."URL: $writeit ".chr(36)."\n";
|
||||
$diz .= "| ".chr(36)."Revision: 1.0 ".chr(36)."\n";
|
||||
$diz .= "| ".chr(36)."Id: ".date("Y/m/d H:i:s")." ".chr(36)."\n";
|
||||
// $diz .= "| ".chr(36)."URL: $writeit ".chr(36)."\n";
|
||||
// $diz .= "| ".chr(36)."Revision: 1.0 ".chr(36)."\n";
|
||||
// $diz .= "| ".chr(36)."Id: ".date("Y/m/d H:i:s")." ".chr(36)."\n";
|
||||
$diz .= "| ".chr(36)."Author: ".USERNAME." ".chr(36)."\n";
|
||||
$diz .= "+---------------------------------------------------------------+\n";
|
||||
$diz .= "*".chr(47)."\n\n";
|
||||
@@ -1436,13 +1504,27 @@ class lancheck
|
||||
|
||||
|
||||
$fl = e107::getFile();
|
||||
$tp = e107::getParser();
|
||||
|
||||
$ret = array();
|
||||
|
||||
if($lang_array = $fl->get_files($comp_dir, ".php$","standard",$depth)){
|
||||
sort($lang_array);
|
||||
}
|
||||
|
||||
|
||||
foreach($lang_array as $k=> $f)
|
||||
{
|
||||
$path = str_replace(e_LANGUAGEDIR.e_LANGUAGE."/", "", $f['path'].$f['fname']);
|
||||
|
||||
if(in_array($path, $this->deprecatedFiles))
|
||||
{
|
||||
unset($lang_array[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(strpos($comp_dir,e_LANGUAGEDIR) !== false)
|
||||
{
|
||||
$regexp = "#.php#";
|
||||
@@ -1518,7 +1600,10 @@ class lancheck
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return $ret;
|
||||
|
||||
}
|
||||
@@ -1625,7 +1710,17 @@ class lancheck
|
||||
|
||||
// $text .= "<input class='btn btn-primary' type='button' style='width:60px' name='but_$i' value=\"".LAN_EDIT."\" onclick=\"window.location='".e_SELF."?f=".$comp_dir."/languages/".$lnk."&lan=".$target_lan."&mode={$mode}'\" /> ";
|
||||
|
||||
$text .= "<a class='btn btn-primary' style='width:60px' href'".e_REQUEST_URI."&f=".$comp_dir."/languages/".$lnk."&lan=".$target_lan."&type={$mode}'>".LAN_EDIT."</a> ";
|
||||
$parms = $_GET;
|
||||
$parms['sub'] = 'edit';
|
||||
$parms['file'] = $comp_dir."/languages/".$lnk;
|
||||
$parms['lan'] = $this->transLanguage;
|
||||
$parms['iframe'] = 1;
|
||||
$parms['type'] = $mode;
|
||||
|
||||
$editUrl = e_REQUEST_SELF."?".http_build_query($parms,'&');
|
||||
|
||||
$text .= "<a href='".$editUrl."' class='e-modal btn btn-primary' data-modal-caption='".str_replace("../","",$comp_dir)."' style='width:60px' >".LAN_EDIT."</a> "; // href='".e_REQUEST_URI."&f=".$comp_dir."/languages/".$lnk."&lan=".$target_lan."&type={$mode}'
|
||||
// <a href='".$editUrl."' data-modal-caption='".$subpath."' class='e-modal btn btn-primary' type='button' style='width:60px'>".LAN_EDIT."</a>";
|
||||
|
||||
|
||||
$text .="</td></tr>";
|
||||
|
Reference in New Issue
Block a user