Skip to content

Commit

Permalink
allow distinct NAME + DESCRIPTION for AdminTool Part in Hybride Modules
Browse files Browse the repository at this point in the history
  • Loading branch information
WebDesignWorx authored Jul 8, 2019
1 parent a005507 commit 8c61167
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion wbce/framework/class.wb.php
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,19 @@ public function get_module_name($sModDir = '', $bShowOriginal = false, $sHem = '
if ($sModuleName = get_variable_content('module_name', $sData, true, false)) {
$sRetVal = $sModuleName;
}
if ($this->section_name == 'admintools' && $sToolName = get_variable_content('tool_name', $sData, true, false)) {
$sRetVal = $sToolName;
}
if($sRetVal == ''){
$sInfoFile = WB_PATH . '/modules/' . $sModDir . '/info.php';
$sData = @file_get_contents($sInfoFile);
if ($sModuleName = get_variable_content('module_name', $sData, true, false)) {
$sRetVal = $sModuleName;
}
if ($this->section_name == 'admintools' && $sToolName = get_variable_content('tool_name', $sData, true, false)) {
$sRetVal = $sToolName;
}
}
}
}
if ($sRetVal == '' || $bShowOriginal == true) {
Expand Down Expand Up @@ -1174,7 +1187,7 @@ public function get_module_name($sModDir = '', $bShowOriginal = false, $sHem = '
* @param string $sModDir
* @return string
*/
public function get_module_description($sModDir = '') {
public function get_module_description($sModDir = '', $isTool = false) {
$sRetVal = '';
if (function_exists('get_variable_content')) {
$sLanguageFile = WB_PATH . '/modules/' . $sModDir . '/languages/' . LANGUAGE . '.php';
Expand All @@ -1184,6 +1197,19 @@ public function get_module_description($sModDir = '') {
if ($sModuleDescription = get_variable_content('module_description', $sData, true, false)) {
$sRetVal = $sModuleDescription;
}
if ($this->section_name == 'admintools' && $sToolDescription = get_variable_content('tool_description', $sData, true, false)) {
$sRetVal = $sToolDescription;
}
if($sRetVal == ''){
$sInfoFile = WB_PATH . '/modules/' . $sModDir . '/info.php';
$sData = @file_get_contents($sInfoFile);
if ($sModuleDescription = get_variable_content('module_description', $sData, true, false)) {
$sRetVal = $sModuleDescription;
}
if ($this->section_name == 'admintools' && $sToolDescription = get_variable_content('tool_description', $sData, true, false)) {
$sRetVal = $sToolDescription;
}
}
}
}
if ($sRetVal == '') {
Expand Down

0 comments on commit 8c61167

Please sign in to comment.