Skip to content

Commit

Permalink
Fixes Issue #4229 - Online language packs not displaying if version c…
Browse files Browse the repository at this point in the history
…ontains "-rc1"
  • Loading branch information
CaMer0n committed Aug 19, 2020
1 parent c0306cc commit daf77da
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 34 deletions.
56 changes: 22 additions & 34 deletions e107_admin/lancheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,10 @@

class lancheck
{

var $core_plugins = array();

var $core_themes = array("bootstrap3", "voux");
public $core_plugins = array();

public $core_themes = array("bootstrap3", "voux");

private $errorsOnly = false;

Expand Down Expand Up @@ -345,12 +345,12 @@ public function init()
{
$this->core_themes[] = $pref['sitetheme'];
$this->core_themes = array_unique($this->core_themes);
}

}/*
if(E107_DEBUG_LEVEL > 0)
{
// print_a($this->core_plugins);
}
print_a($this->core_plugins);
}*/


$acceptedLans = explode(",",e_LANLIST);

Expand Down Expand Up @@ -418,11 +418,11 @@ function countFiles($array)
$key = key($val);
$this->coreImage[$key] = $val;
}
elseif($val)
/* elseif($val)
{
// $this->totalFiles++;
$this->totalFiles++;
}

*/
}
}

Expand Down Expand Up @@ -631,18 +631,6 @@ private function makeLanguagePack($language)
}


// if(!is_writable(e_FILE."public"))
// {
// $ret['error'] = TRUE;
// $ret['message'] = LAN_UPLOAD_777 . " ".e_FILE."public";
// return $ret;
// }

if(is_readable(e_ADMIN."ver.php"))
{
// include(e_ADMIN."ver.php");
}

require_once(e_HANDLER.'pclzip.lib.php');
list($ver, $tmp) = explode(" ", e_VERSION);
if(!$locale = $this->findLocale($language))
Expand Down Expand Up @@ -743,13 +731,14 @@ private function getFileList($language)

}

function removeLanguagePack($language)
/** todo */
/*function removeLanguagePack($language)
{
$files = $this->getFileList($language);
}
}*/



Expand Down Expand Up @@ -875,18 +864,18 @@ public function getOnlineLanguagePacks()
{
$xml = e107::getXml();




$feed = 'https://e107.org/languagepacks.xml';

$version = e_VERSION;

if(!empty($version))
{
$feed .= "?ver=". preg_replace('/[^\d\.]/','',e_VERSION);
list($ver,$tmp) = explode("-", $version);
$feed .= "?ver=". preg_replace('/[^\d\.]/','', $ver);
}

e107::getDebug()->log("Language Pack Feed: ".$feed);

$languages = array();

if($rawData = $xml -> loadXMLfile($feed, true))
Expand Down Expand Up @@ -956,7 +945,6 @@ function check_all($mode='render', $lan=null)
{
// global $ns,$tp;
$mes = e107::getMessage();
$ns = e107::getRender();
$tp = e107::getParser();

if(empty($lan))
Expand Down Expand Up @@ -1022,14 +1010,14 @@ function check_all($mode='render', $lan=null)

if($mode != 'render')
{
return;
return null;
}

$message = "
<form id='lancheck' method='post' action='".e_ADMIN."language.php?mode=main&action=tools'>
<div>\n";

$icon = ($_SESSION['lancheck'][$lan]['total']>0) ? ADMIN_FALSE_ICON : ADMIN_TRUE_ICON;
// $icon = ($_SESSION['lancheck'][$lan]['total']>0) ? ADMIN_FALSE_ICON : ADMIN_TRUE_ICON;


$errors_diz = (deftrue('LAN_CHECK_23')) ? LAN_CHECK_23 : "Errors Found";
Expand Down Expand Up @@ -1765,10 +1753,10 @@ function edit_lanfiles($dir1,$dir2,$f1,$f2,$lan)
if($lan == '')
{
echo "Language selection was lost. ";
return;
return null;
}

$ns = e107::getRender();
// $ns = e107::getRender();
$sql = e107::getDb();


Expand Down Expand Up @@ -1798,7 +1786,7 @@ function edit_lanfiles($dir1,$dir2,$f1,$f2,$lan)

$this->newFile($dir2.$f2,$lan);

$writable = (is_writable($dir2)) ? TRUE : FALSE;
$writable = is_writable($dir2);
$trans = $this->get_lan_file_phrases($dir1,$dir2,$f1,$f2);
$keys = array_keys($trans);
sort($keys);
Expand Down
5 changes: 5 additions & 0 deletions e107_admin/language.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,11 @@ private function renderOnlineLanguagePacks()

$tp = e107::getParser();

if(empty($this->onlinePacks))
{
return null;
}


foreach($this->onlinePacks as $lan=>$value)
{
Expand Down

0 comments on commit daf77da

Please sign in to comment.