Skip to content

Commit e6c97bd

Browse files
committed
logo name change,
Notifications cleanup (work in progress)
1 parent 139b5ba commit e6c97bd

6 files changed

Lines changed: 70 additions & 69 deletions

File tree

class/Files/CreateArchitecture.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ public function setBaseFoldersFiles($module)
123123
}
124124
//Copy the logo of the module
125125
$modImage = str_replace(' ', '', mb_strtolower($module->getVar('mod_image')));
126-
$this->copyFile('assets/images', TDMC_UPLOAD_IMGMOD_PATH . '/' . $modImage, $modImage);
126+
$targetImage = 'logoModule.png';
127+
$this->copyFile('assets/images', TDMC_UPLOAD_IMGMOD_PATH . '/' . $modImage, $targetImage);
128+
127129
// Copy of 'module_author_logo.png' file in uploads dir
128130
$logoPng = $stlModuleAuthor . '_logo.png';
129131
$logoGifFrom = TDMC_UPLOAD_IMGMOD_PATH . '/' . $logoPng;

class/Files/Language/LanguageModinfo.php

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
*
2525
* @author Txmod Xoops http://www.txmodxoops.org
2626
*
27-
* @version $Id: LanguageModinfo.php 12258 2014-01-02 09:33:29Z timgno $
2827
*/
2928

3029
/**
@@ -322,44 +321,46 @@ private function getLanguageNotifications($language, $tableSoleName)
322321
$stuTableSoleName = mb_strtoupper($tableSoleName);
323322
$ucfTableSoleName = ucfirst($tableSoleName);
324323
$getDefinesNotif = [
325-
'GLOBAL_NOTIFY' => 'Global notify',
326-
'GLOBAL_NOTIFY_DESC' => 'Global notify desc',
327-
'CATEGORY_NOTIFY' => 'Category notify',
328-
'CATEGORY_NOTIFY_DESC' => 'Category notify desc',
329-
$stuTableSoleName . '_NOTIFY' => $ucfTableSoleName . ' notify',
330-
$stuTableSoleName . '_NOTIFY_DESC' => $ucfTableSoleName . ' notify desc',
331-
'GLOBAL_NEWCATEGORY_NOTIFY' => 'Global newcategory notify',
332-
'GLOBAL_NEWCATEGORY_NOTIFY_CAPTION' => 'Global newcategory notify caption',
333-
'GLOBAL_NEWCATEGORY_NOTIFY_DESC' => 'Global newcategory notify desc',
334-
'GLOBAL_NEWCATEGORY_NOTIFY_SUBJECT' => 'Global newcategory notify subject',
335-
'GLOBAL_' . $stuTableSoleName . 'MODIFY_NOTIFY' => 'Global ' . $tableSoleName . 'modify notify',
336-
'GLOBAL_' . $stuTableSoleName . 'MODIFY_NOTIFY_CAPTION' => 'Global ' . $tableSoleName . ' modify notify caption',
337-
'GLOBAL_' . $stuTableSoleName . 'MODIFY_NOTIFY_DESC' => 'Global ' . $tableSoleName . 'modify notify desc',
338-
'GLOBAL_' . $stuTableSoleName . 'MODIFY_NOTIFY_SUBJECT' => 'Global ' . $tableSoleName . ' modify notify subject',
339-
'GLOBAL_' . $stuTableSoleName . 'BROKEN_NOTIFY' => 'Global ' . $tableSoleName . ' broken notify',
340-
'GLOBAL_' . $stuTableSoleName . 'BROKEN_NOTIFY_CAPTION' => 'Global ' . $tableSoleName . 'broken notify caption',
341-
'GLOBAL_' . $stuTableSoleName . 'BROKEN_NOTIFY_DESC' => 'Global ' . $tableSoleName . 'broken notify desc',
342-
'GLOBAL_' . $stuTableSoleName . 'BROKEN_NOTIFY_SUBJECT' => 'Global ' . $tableSoleName . 'broken notify subject',
343-
'GLOBAL_' . $stuTableSoleName . 'SUBMIT_NOTIFY' => 'Global ' . $tableSoleName . ' submit notify',
344-
'GLOBAL_' . $stuTableSoleName . 'SUBMIT_NOTIFY_CAPTION' => 'Global ' . $tableSoleName . ' submit notify caption',
345-
'GLOBAL_' . $stuTableSoleName . 'SUBMIT_NOTIFY_DESC' => 'Global ' . $tableSoleName . 'submit notify desc',
346-
'GLOBAL_' . $stuTableSoleName . 'SUBMIT_NOTIFY_SUBJECT' => 'Global ' . $tableSoleName . 'submit notify subject',
347-
'GLOBAL_NEW' . $stuTableSoleName . '_NOTIFY' => 'Global new' . $tableSoleName . ' notify',
348-
'GLOBAL_NEW' . $stuTableSoleName . '_NOTIFY_CAPTION' => 'Global new' . $tableSoleName . ' notify caption',
349-
'GLOBAL_NEW' . $stuTableSoleName . '_NOTIFY_DESC' => 'Global new' . $tableSoleName . ' notify desc',
350-
'GLOBAL_NEW' . $stuTableSoleName . '_NOTIFY_SUBJECT' => 'Global new' . $tableSoleName . ' notify subject',
351-
'CATEGORY_' . $stuTableSoleName . 'SUBMIT_NOTIFY' => 'Category ' . $tableSoleName . 'submit notify',
352-
'CATEGORY_' . $stuTableSoleName . 'SUBMIT_NOTIFY_CAPTION' => 'Category ' . $tableSoleName . ' submit notify caption',
353-
'CATEGORY_' . $stuTableSoleName . 'SUBMIT_NOTIFY_DESC' => 'Category ' . $tableSoleName . ' submit notify desc',
354-
'CATEGORY_' . $stuTableSoleName . 'SUBMIT_NOTIFY_SUBJECT' => 'Category ' . $tableSoleName . ' submit notify subject',
355-
'CATEGORY_NEW' . $stuTableSoleName . '_NOTIFY' => 'Category new' . $tableSoleName . ' notify',
356-
'CATEGORY_NEW' . $stuTableSoleName . '_NOTIFY_CAPTION' => 'Category new' . $tableSoleName . ' notify caption',
357-
'CATEGORY_NEW' . $stuTableSoleName . '_NOTIFY_DESC' => 'Category new' . $tableSoleName . ' notify desc',
358-
'CATEGORY_NEW' . $stuTableSoleName . '_NOTIFY_SUBJECT' => 'Category new' . $tableSoleName . ' notify subject',
359-
$stuTableSoleName . '_APPROVE_NOTIFY' => $ucfTableSoleName . ' approve notify',
360-
$stuTableSoleName . '_APPROVE_NOTIFY_CAPTION' => $ucfTableSoleName . ' approve notify caption',
361-
$stuTableSoleName . '_APPROVE_NOTIFY_DESC' => $ucfTableSoleName . ' approve notify desc',
362-
$stuTableSoleName . '_APPROVE_NOTIFY_SUBJECT' => $ucfTableSoleName . ' approve notify subject',
324+
'GLOBAL_NOTIFY' => 'Global notify',
325+
'GLOBAL_NOTIFY_DESC' => 'Global notify desc',
326+
'CATEGORY_NOTIFY' => 'Category notify',
327+
'CATEGORY_NOTIFY_DESC' => 'Category notify desc',
328+
'CATEGORY_NOTIFY_CAPTION' => 'Category notify caption',
329+
'CATEGORY_NOTIFY_SUBJECT' => 'Category notify Subject',
330+
'NOTIFY' => $ucfTableSoleName . ' notify',
331+
'NOTIFY_DESC' => $ucfTableSoleName . ' notify desc',
332+
'GLOBAL_NEW_CATEGORY_NOTIFY' => 'Global newcategory notify',
333+
'GLOBAL_NEW_CATEGORY_NOTIFY_CAPTION' => 'Global newcategory notify caption',
334+
'GLOBAL_NEW_CATEGORY_NOTIFY_DESC' => 'Global newcategory notify desc',
335+
'GLOBAL_NEW_CATEGORY_NOTIFY_SUBJECT' => 'Global newcategory notify subject',
336+
'GLOBAL_' . 'MODIFY_NOTIFY' => 'Global ' . $tableSoleName . ' modify notify',
337+
'GLOBAL_' . 'MODIFY_NOTIFY_CAPTION' => 'Global ' . $tableSoleName . ' modify notify caption',
338+
'GLOBAL_' . 'MODIFY_NOTIFY_DESC' => 'Global ' . $tableSoleName . ' modify notify desc',
339+
'GLOBAL_' . 'MODIFY_NOTIFY_SUBJECT' => 'Global ' . $tableSoleName . ' modify notify subject',
340+
'GLOBAL_' . 'BROKEN_NOTIFY' => 'Global ' . $tableSoleName . ' broken notify',
341+
'GLOBAL_' . 'BROKEN_NOTIFY_CAPTION' => 'Global ' . $tableSoleName . ' broken notify caption',
342+
'GLOBAL_' . 'BROKEN_NOTIFY_DESC' => 'Global ' . $tableSoleName . ' broken notify desc',
343+
'GLOBAL_' . 'BROKEN_NOTIFY_SUBJECT' => 'Global ' . $tableSoleName . ' broken notify subject',
344+
'GLOBAL_' . 'SUBMIT_NOTIFY' => 'Global ' . $tableSoleName . ' submit notify',
345+
'GLOBAL_' . 'SUBMIT_NOTIFY_CAPTION' => 'Global ' . $tableSoleName . ' submit notify caption',
346+
'GLOBAL_' . 'SUBMIT_NOTIFY_DESC' => 'Global ' . $tableSoleName . ' submit notify desc',
347+
'GLOBAL_' . 'SUBMIT_NOTIFY_SUBJECT' => 'Global ' . $tableSoleName . ' submit notify subject',
348+
'GLOBAL_NEW_' . 'NOTIFY' => 'Global new' . $tableSoleName . ' notify',
349+
'GLOBAL_NEW_' . 'NOTIFY_CAPTION' => 'Global new' . $tableSoleName . ' notify caption',
350+
'GLOBAL_NEW_' . 'NOTIFY_DESC' => 'Global new' . $tableSoleName . ' notify desc',
351+
'GLOBAL_NEW_' . 'NOTIFY_SUBJECT' => 'Global new' . $tableSoleName . ' notify subject',
352+
'CATEGORY_' . 'SUBMIT_NOTIFY' => 'Category ' . $tableSoleName . ' submit notify',
353+
'CATEGORY_' . 'SUBMIT_NOTIFY_CAPTION' => 'Category ' . $tableSoleName . ' submit notify caption',
354+
'CATEGORY_' . 'SUBMIT_NOTIFY_DESC' => 'Category ' . $tableSoleName . ' submit notify desc',
355+
'CATEGORY_' . 'SUBMIT_NOTIFY_SUBJECT' => 'Category ' . $tableSoleName . ' submit notify subject',
356+
'CATEGORY_NEW_' . 'NOTIFY' => 'Category new' . $tableSoleName . ' notify',
357+
'CATEGORY_NEW_' . 'NOTIFY_CAPTION' => 'Category new' . $tableSoleName . ' notify caption',
358+
'CATEGORY_NEW_' . 'NOTIFY_DESC' => 'Category new' . $tableSoleName . ' notify desc',
359+
'CATEGORY_NEW_' . 'NOTIFY_SUBJECT' => 'Category new' . $tableSoleName . ' notify subject',
360+
'APPROVE_NOTIFY' => $ucfTableSoleName . ' approve notify',
361+
'APPROVE_NOTIFY_CAPTION' => $ucfTableSoleName . ' approve notify caption',
362+
'APPROVE_NOTIFY_DESC' => $ucfTableSoleName . ' approve notify desc',
363+
'APPROVE_NOTIFY_SUBJECT' => $ucfTableSoleName . ' approve notify subject',
363364
];
364365
foreach ($getDefinesNotif as $defn => $descn) {
365366
$ret .= $df->getDefine($language, $defn, $descn);

class/Files/User/UserXoopsVersion.php

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
*
2525
* @author Txmod Xoops http://www.txmodxoops.org
2626
*
27-
* @version $Id: UserXoopsVersion.php 12258 2014-01-02 09:33:29Z timgno $
2827
*/
2928

3029
/**
@@ -143,7 +142,7 @@ private function getXoopsVersionHeader($module, $language)
143142
'min_xoops' => "'{$module->getVar('mod_min_xoops')}'",
144143
'min_admin' => "'{$module->getVar('mod_min_admin')}'",
145144
'min_db' => "array('mysql' => '{$module->getVar('mod_min_mysql')}', 'mysqli' => '{$module->getVar('mod_min_mysql')}')",
146-
'image' => "'assets/images/{$module->getVar('mod_image')}'",
145+
'image' => "'assets/images/logoModule.png'",
147146
'dirname' => 'basename(__DIR__)',
148147
'dirmoduleadmin' => "'Frameworks/moduleclasses/moduleadmin'",
149148
'sysicons16' => "'../../Frameworks/moduleclasses/icons/16'",
@@ -870,28 +869,28 @@ private function getXoopsVersionNotifications($module, $language)
870869
unset($num);
871870
$num = 1;
872871
if (in_array(1, $tableCategory)) {
873-
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', 'new_category', 'global', 0, 'global', 'newcategory', 'global_newcategory_notify', $num);
872+
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', 'new_category', 'global', 0, 'global_new_category', $tableSoleName, 'global_newcategory_notify', $num);
874873
++$num;
875874
}
876-
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', $tableSoleName . '_modify', 'global', 1, 'global', $tableSoleName . 'modify', 'global_' . $tableSoleName . 'modify_notify', $num);
875+
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', 'modify', 'global', 1, 'global_modify', $tableSoleName, 'global_' . 'modify_notify', $num);
877876
if (in_array(1, $tableBroken)) {
878877
++$num;
879-
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', $tableSoleName . '_broken', 'global', 1, 'global', $tableSoleName . 'broken', 'global_' . $tableSoleName . 'broken_notify', $num);
878+
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', 'broken', 'global', 1, 'global_broken', $tableSoleName, 'global_' . 'broken_notify', $num);
880879
}
881880
if (in_array(1, $tableSubmit)) {
882881
++$num;
883-
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', $tableSoleName . '_submit', 'global', 1, 'global', $tableSoleName . 'submit', 'global_' . $tableSoleName . 'submit_notify', $num);
882+
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', 'submit', 'global', 1, 'global_submit', $tableSoleName, 'global_' . 'submit_notify', $num);
884883
}
885884
++$num;
886-
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', 'new_' . $tableSoleName, 'global', 0, 'global', 'new' . $tableSoleName, 'global_new' . $tableSoleName . '_notify', $num);
885+
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', 'new_' . $tableSoleName, 'global', 0, 'global_new', $tableSoleName, 'global_new' . $tableSoleName . '_notify', $num);
887886
if (in_array(1, $tableCategory)) {
888887
++$num;
889-
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', $tableSoleName . '_submit', 'category', 1, 'category', $tableSoleName . 'submit', 'category_' . $tableSoleName . 'submit_notify', $num);
888+
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', 'submit', 'category', 1, 'category_submit', $tableSoleName, 'category_' . $tableSoleName . 'submit_notify', $num);
890889
++$num;
891-
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', 'new_' . $tableSoleName, 'category', 0, 'category', 'new' . $tableSoleName, 'category_new' . $tableSoleName . '_notify', $num);
890+
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', 'new_category', 'category', 0, 'category', $tableSoleName, 'category_new' . $tableSoleName . '_notify', $num);
892891
}
893892
++$num;
894-
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', 'approve', $tableSoleName, 1, $tableSoleName, 'approve', $tableSoleName . '_approve_notify', $num);
893+
$ret .= $this->getXoopsVersionNotificationCodeComplete($language, 'event', 'approve', $tableSoleName, 1, $tableSoleName, $tableSoleName, $tableSoleName . '_approve_notify', $num);
895894
unset($num);
896895

897896
return $ret;
@@ -1017,11 +1016,11 @@ private function getXoopsVersionNotificationCodeComplete($language, $type, $name
10171016
'name' => "'{$name}'",
10181017
'category' => "'{$category}'",
10191018
'admin_only' => (string)$admin,
1020-
'title' => "{$language}{$title}_{$table}_NOTIFY",
1021-
'caption' => "{$language}{$title}_{$table}_NOTIFY_CAPTION",
1022-
'description' => "{$language}{$title}_{$table}_NOTIFY_DESC",
1019+
'title' => "{$language}{$title}_NOTIFY",
1020+
'caption' => "{$language}{$title}_NOTIFY_CAPTION",
1021+
'description' => "{$language}{$title}_NOTIFY_DESC",
10231022
'mail_template' => "'{$mail}'",
1024-
'mail_subject' => "{$language}{$title}_{$table}_NOTIFY_SUBJECT",
1023+
'mail_subject' => "{$language}{$title}_NOTIFY_SUBJECT",
10251024
];
10261025
$ret .= $uCodeVNCC->getUserModVersion(4, $event, 'notification', "'{$type}'", $num);
10271026

class/LogoGenerator.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,27 @@
2121
*
2222
* @author Xoops Team Developement Modules - https://xoops.org
2323
*
24-
* @version $Id: LogoGenerator.php 12258 2014-01-02 09:33:29Z timgno $
2524
*/
2625
include_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
27-
//include_once XOOPS_ROOT_PATH . '/modules/TDMCreate/include/common.php';
28-
29-
if (function_exists($_GET['f'])) { // get function name and parameter $_GET['f']($_GET["p"]);
30-
include_once __DIR__ . '/LogoGenerator.php';
31-
$ret = LogoGenerator::createLogo($_GET['iconName'], $_GET['caption']);
32-
phpFunction($ret);
33-
} else {
34-
echo 'Method Not Exist';
35-
}
3626

3727
/**
3828
* @param string $val
3929
*/
4030
function phpFunction($val = '')
41-
{ // create php function here
31+
{ // create php function here
4232
echo $val;
4333
}
4434

35+
$myfunction = '\\XoopsModules\\Tdmcreate\\' . $_GET['f'];
36+
37+
if (function_exists($myfunction)) {
38+
$ret = \XoopsModules\Tdmcreate\LogoGenerator::createLogo($_GET['iconName'], $_GET['caption']);
39+
phpFunction($ret);
40+
} else {
41+
echo 'Method Not Exist';
42+
}
43+
44+
4545
/**
4646
* Class LogoGenerator.
4747
*/

class/Modules.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
*
2525
* @author Txmod Xoops <webmaster@txmodxoops.org> - <http://www.txmodxoops.org/>
2626
*
27-
* @version $Id: 1.91 modules.php 13040 2015-04-25 15:12:12Z timgno $
2827
*/
2928
// include __DIR__ . '/autoload.php';
3029

@@ -136,7 +135,7 @@ public function getFormModules($action = false)
136135
{
137136
$helper = Tdmcreate\Helper::getInstance();
138137
if (false === $action) {
139-
$action = $_SERVER['REQUEST_URI'];
138+
$action = \Xmf\Request::getString('REQUEST_URI', '', 'SERVER');
140139
}
141140
$set = [];
142141
$settings = $helper->getHandler('Settings')->getAllSettings(0, 0, 'set_type');
@@ -389,7 +388,7 @@ private static function createLogo($logoIcon, $moduleDirname)
389388
$spaceBorder = (92 - mb_strlen($moduleDirname) * 7.5) / 2;
390389
imagefttext($imageModule, 8.5, 0, $spaceBorder, 45, $textColor, $font, ucfirst($moduleDirname), []);
391390
imagecopy($imageModule, $imageIcon, 29, 2, 0, 0, 32, 32);
392-
$logoImg = '/' . $moduleDirname . '_logo.png';
391+
$logoImg = '/' . 'logoModule.png';
393392
imagepng($imageModule, TDMC_UPLOAD_IMGMOD_PATH . $logoImg);
394393
imagedestroy($imageModule);
395394
imagedestroy($imageIcon);

xoops_version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
$modversion['release_file'] = 'https://github.com/txmodxoops/tdmcreate-1.91/releases';
4141
$modversion['manual'] = 'MANUAL';
4242
$modversion['manual_file'] = XOOPS_URL . "/modules/{$moduleDirName}/docs/manual.txt";
43-
$modversion['image'] = "assets/images/{$moduleDirName}_logo.png";
43+
$modversion['image'] = "assets/images/logoModule.png";
4444
$modversion['dirname'] = $moduleDirName;
4545
// Frameworks icons
4646
$modversion['dirmoduleadmin'] = '/Frameworks/moduleclasses/moduleadmin';

0 commit comments

Comments
 (0)