Skip to content

Commit

Permalink
Merge pull request #53 from OXIDprojects/c-test
Browse files Browse the repository at this point in the history
Fix translation, and overview page
  • Loading branch information
keywan-ghadami-oxid authored Jan 5, 2019
2 parents d55e38e + 6183911 commit 7229beb
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 22 deletions.
7 changes: 2 additions & 5 deletions Controller/CheckConsistency.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,11 @@ protected function _getActiveModules(array $aDisabledModules, array $aModulePath

$aActiveModules = array();
$oModule = oxNew(Module::class);
$oSeoEncoder = oxNew(SeoEncoder::class);
foreach($aTmpActiveModules as $sKey => $sValue)
{
$oModule->load($sKey);
//Version einbinden
$aVersions = $oConfig->getConfigParam('aModuleVersions');
$sTitle = $oModule->getTitle().' - v'.$aVersions[$oModule->getId()];
$aActiveModules[$sKey] = utf8_encode($oSeoEncoder->encodeString(strip_tags($sTitle)));
$sTitle = $oModule->getTitle();
$aActiveModules[$sKey] = $sTitle;
}

$sModulesDir = $oConfig->getModulesDir();
Expand Down
12 changes: 10 additions & 2 deletions Core/InternalModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ protected function getAutoloader(){
return $composerClassLoader;
}

public function load($id){
$this->metaDataVersion = 0;
$this->checked = false;
$this->state = self::FINE;
$res = parent::load($id);
return $res;
}

/**
* @param ModuleStateFixer $oModuleFixHelper
*/
Expand Down Expand Up @@ -489,10 +497,10 @@ public function checkModuleEvents()
*
* @return string
*/
public function getModuleNameSpace($sModulePath)
public function getModuleNameSpace()
{
$package = $this->getComposerPackage();

$sModulePath = $this->getModulePath();
if ($package) {
$autoload = $package->getAutoload();
} else {
Expand Down
41 changes: 30 additions & 11 deletions Core/ModuleExtensionCleanerDebug.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,17 @@ public function setOutput(LoggerInterface $out){
*/
public function cleanExtensions($installedExtensions, \OxidEsales\Eshop\Core\Module\Module $module)
{
$installedExtensions = parent::cleanExtensions($installedExtensions, $module);
$moduleExtensions = $module->getExtensions();

$installedModuleExtensions = $this->filterExtensionsByModule($installedExtensions, $module);

if (count($installedModuleExtensions)) {
$garbage = $this->getModuleExtensionsGarbage($moduleExtensions, $installedModuleExtensions);

if (count($garbage)) {
$installedExtensions = $this->removeGarbage($installedExtensions, $garbage);
}
}

$oModules = oxNew( \OxidEsales\EshopCommunity\Core\Module\ModuleList::class );
//ids will include garbage in case there are files that not registered by any module
Expand Down Expand Up @@ -102,26 +112,35 @@ protected function getModuleExtensionsGarbage($moduleMetaDataExtensions, $module
* Returns extensions list by module id.
*
* @param array $modules Module array (nested format)
* @param string $moduleId Module id/folder name
* @param string $module Module id/folder name
*
* @return array
*/
protected function filterExtensionsByModuleId($modules, $moduleId)
protected function filterExtensionsByModule($modules, $module)
{
$modulePaths = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModulePaths');
if ($module->isMetadataVersionGreaterEqual('2.0')) {
$path = $module->getModuleNameSpace();
} else {

$modulePaths = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModulePaths');

$path = '';
if (isset($modulePaths[$moduleId])) {
$path = $modulePaths[$moduleId] . '/';
$moduleId = $module->getId();
$path = '';
if (isset($modulePaths[$moduleId])) {
$path = $modulePaths[$moduleId] . '/';
}

if (!$path) {
$path = $moduleId . "/";
}
}
$filteredModules = [];

// TODO: This condition should be removed. Need to check integration tests.
if (!$path) {
$path = $moduleId . "/";
return $filteredModules;
}

$filteredModules = [];
foreach ($modules as $class => $extend) {
foreach ($modules as $class => $extend) {
foreach ($extend as $extendPath) {
if (strpos($extendPath, $path) === 0) {
$filteredModules[$class][] = $extendPath;
Expand Down
5 changes: 4 additions & 1 deletion views/admin/en/ac_module_internalls_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@

'AC_STATE_OK_LABEL' => 'Metadata matches data stored in shop',
'AC_STATE_FM_LABEL' => 'Files defined in metadata does not exist',
'AC_STATE_FS_LABEL' => 'Files defined in shop data does not exist'
'AC_STATE_FS_LABEL' => 'Files defined in shop data does not exist',

'SHOP_MODULE_blACActiveCompleteCheck' => 'Allow access to overview page',
'SHOP_MODULE_sACActiveCompleteKey' => 'Access key'
];
5 changes: 4 additions & 1 deletion views/admin/fr/ac_module_internalls_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@

'AC_STATE_OK_LABEL' => 'Les métadonnées correspondent aux données enregistrées dans la boutique',
'AC_STATE_FM_LABEL' => 'Les Fichiers définis dans les métadonnées n\'existent pas',
'AC_STATE_FS_LABEL' => 'Les fichiers définis dans la boutique n\'existent pas'
'AC_STATE_FS_LABEL' => 'Les fichiers définis dans la boutique n\'existent pas',

'SHOP_MODULE_blACActiveCompleteCheck' => 'Autoriser l\'accès à la page d\'aperçu',
'SHOP_MODULE_sACActiveCompleteKey' => 'Clé d\'accès'
];
5 changes: 4 additions & 1 deletion views/admin/lt/ac_module_internalls_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@

'AC_STATE_OK_LABEL' => 'Metadata įrašai sutampa su sisteminiais',
'AC_STATE_FM_LABEL' => 'Neegzistuojantys failai metadata aprašę',
'AC_STATE_FS_LABEL' => 'Neegzistuojantys failai sistemos įrašuose'
'AC_STATE_FS_LABEL' => 'Neegzistuojantys failai sistemos įrašuose',

'SHOP_MODULE_blACActiveCompleteCheck' => 'Consenti l\'accesso alla pagina di panoramica',
'SHOP_MODULE_sACActiveCompleteKey' => 'Chiave di accesso'
];
5 changes: 4 additions & 1 deletion views/admin/ru/ac_module_internalls_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@

'AC_STATE_OK_LABEL' => 'Метаданные соответствует данным, хранящимся в магазине',
'AC_STATE_FM_LABEL' => 'Файлы, определенные в метаданных не существует',
'AC_STATE_FS_LABEL' => 'Файлы, определенные в данных магазина не существует'
'AC_STATE_FS_LABEL' => 'Файлы, определенные в данных магазина не существует',

'SHOP_MODULE_blACActiveCompleteCheck' => 'Разрешить доступ к странице обзора',
'SHOP_MODULE_sACActiveCompleteKey' => 'ключ доступа'
];

0 comments on commit 7229beb

Please sign in to comment.