Skip to content

Commit

Permalink
merge Goffy's fixed bug with cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
mambax7 committed Aug 8, 2021
2 parents 404c3bd + 9c40e33 commit 1c832c2
Show file tree
Hide file tree
Showing 11 changed files with 245 additions and 242 deletions.
16 changes: 8 additions & 8 deletions class/Form/ItemForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,17 +283,17 @@ public function createElements($obj)
$moduleId = $helper->getModule()->getVar('mid');
if ($helper->getConfig('perm_rating') && $grouppermHandler->checkRight('global', \_PUBLISHER_RATE, $groups, $moduleId)) {
$options = [
Constants::RATING_NONE => \_MI_BLOG_RATING_NONE,
Constants::RATING_5STARS => \_MI_BLOG_RATING_5STARS,
Constants::RATING_10STARS => \_MI_BLOG_RATING_10STARS,
Constants::RATING_LIKES => \_MI_BLOG_RATING_LIKES,
Constants::RATING_10NUM => \_MI_BLOG_RATING_10NUM,
Constants::RATING_REACTION => \_MI_BLOG_RATING_REACTION,
Constants::RATING_NONE => \_MI_PUBLISHER_RATING_NONE,
Constants::RATING_5STARS => \_MI_PUBLISHER_RATING_5STARS,
Constants::RATING_10STARS => \_MI_PUBLISHER_RATING_10STARS,
Constants::RATING_LIKES => \_MI_PUBLISHER_RATING_LIKES,
Constants::RATING_10NUM => \_MI_PUBLISHER_RATING_10NUM,
Constants::RATING_REACTION => \_MI_PUBLISHER_RATING_REACTION,
];

$votetypeSelect = new \XoopsFormSelect(\_MI_BLOG_RATINGBARS, 'votetype', $obj->getVar('votetype'));
$votetypeSelect = new \XoopsFormSelect(\_MI_PUBLISHER_RATINGBARS, 'votetype', $obj->getVar('votetype'));
$votetypeSelect->addOptionArray($options);
// $votetypeSelect->setDescription(\_MI_BLOG_RATINGBARS_DESC);
// $votetypeSelect->setDescription(\_MI_PUBLISHER_RATINGBARS_DESC);
$this->addElement($votetypeSelect);
unset($votetypeSelect);
}
Expand Down
8 changes: 4 additions & 4 deletions class/RatingsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ public function getItemRating($itemId = 0, $source = 0)
$itemRating['avg_rate_value'] = \number_format($currentRating / $count, 2);
}
if (1 == $count) {
$text = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_BLOG_RATING_CURRENT_1);
$shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_BLOG_RATING_CURRENT_SHORT_1);
$text = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_1);
$shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_SHORT_1);
} else {
$text = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_BLOG_RATING_CURRENT_X);
$shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_BLOG_RATING_CURRENT_SHORT_X);
$text = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_X);
$shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_SHORT_X);
}
$text = \str_replace('%m', $max_units, $text);
$text = \str_replace('%t', $itemRating['nb_ratings'], $text);
Expand Down
16 changes: 8 additions & 8 deletions class/VoteHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ public function getItemRating($itemId = null, $source = null): array
$itemRating['avg_rate_value'] = \number_format($currentRating / $count, 2);
}
if (1 == $count) {
$text = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_BLOG_RATING_CURRENT_1);
$shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_BLOG_RATING_CURRENT_SHORT_1);
$text = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_1);
$shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_SHORT_1);
} else {
$text = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_BLOG_RATING_CURRENT_X);
$shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_BLOG_RATING_CURRENT_SHORT_X);
$text = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_X);
$shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_SHORT_X);
}
$text = \str_replace('%m', $max_units, $text);
$text = \str_replace('%t', $itemRating['nb_vote'], $text);
Expand Down Expand Up @@ -282,11 +282,11 @@ public function getItemRating5($itemObj = null, $source = null): array
$itemRating['avg_rate_value'] = \number_format($currentRating / $count, 2);
}
if (1 == $count) {
$text = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_BLOG_RATING_CURRENT_1);
$shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_BLOG_RATING_CURRENT_SHORT_1);
$text = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_1);
$shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_SHORT_1);
} else {
$text = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_BLOG_RATING_CURRENT_X);
$shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_BLOG_RATING_CURRENT_SHORT_X);
$text = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_X);
$shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_SHORT_X);
}
$text = \str_replace('%m', $max_units, $text);
$text = \str_replace('%t', $itemRating['nb_vote'], $text);
Expand Down
7 changes: 5 additions & 2 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
- set $icons in ItemForm (mamba)
- added votetype to Vote/Ratings classes (mamba)
- fix for integer in archive #162 (liomj/mamba)
- Smarty defaults (goffy)
- added smarty defaults (goffy)
- fixed bug with cloning (goffy)
-- replace _MI_BLOG_ by _MI_PUBLISHER_ (goffy)
-- replace _MA_BLOG_ by _MA_PUBLISHER_ (goffy)
- replace index.html with index.php (mamba)
- add renameColumns, moduleStats to Configurator (mamba)
- logoXoopsPhp8 (mamba)
Expand All @@ -16,7 +19,7 @@
<hr>
- added votetype column in update (goffy)
- added rating selection in item form (mamba)
- added smarty defaults (goffy)


<h5>1.08 Alpha 3 [2021-01-01]</h5> Dev: XOOPS 2.5.11, PHP 7.4.13, PHP 8.0
<hr>
Expand Down
144 changes: 72 additions & 72 deletions language/english/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,86 +103,86 @@

// ---------------- Contents ----------------
// Category
\define('_MA_BLOG_CATEGORY', 'Category');
\define('_MA_BLOG_CATEGORY_TITLE', 'Category title');
\define('_MA_BLOG_CATEGORY_DESC', 'Category description');
\define('_MA_BLOG_CATEGORY_LIST', 'List of Category');
\define('_MA_PUBLISHER_CATEGORY', 'Category');
\define('_MA_PUBLISHER_CATEGORY_TITLE', 'Category title');
\define('_MA_PUBLISHER_CATEGORY_DESC', 'Category description');
\define('_MA_PUBLISHER_CATEGORY_LIST', 'List of Category');
// Caption of Category
\define('_MA_BLOG_CATEGORY_ID', 'Id');
\define('_MA_BLOG_CATEGORY_NAME', 'Name');
\define('_MA_BLOG_CATEGORY_DESCRIPTION', 'Description');
\define('_MA_BLOG_CATEGORY_IMAGELIST', 'Imagelist');
\define('_MA_BLOG_CATEGORY_IMAGEUPLOAD', 'Imageupload');
\define('_MA_BLOG_CATEGORY_CREATED', 'Created');
\define('_MA_BLOG_CATEGORY_EDITED', 'Edited');
\define('_MA_BLOG_CATEGORY_PUBLISHED', 'Published');
\define('_MA_BLOG_CATEGORY__RATINGS', '_ratings');
\define('_MA_BLOG_CATEGORY__VOTES', '_votes');
\define('_MA_PUBLISHER_CATEGORY_ID', 'Id');
\define('_MA_PUBLISHER_CATEGORY_NAME', 'Name');
\define('_MA_PUBLISHER_CATEGORY_DESCRIPTION', 'Description');
\define('_MA_PUBLISHER_CATEGORY_IMAGELIST', 'Imagelist');
\define('_MA_PUBLISHER_CATEGORY_IMAGEUPLOAD', 'Imageupload');
\define('_MA_PUBLISHER_CATEGORY_CREATED', 'Created');
\define('_MA_PUBLISHER_CATEGORY_EDITED', 'Edited');
\define('_MA_PUBLISHER_CATEGORY_PUBLISHED', 'Published');
\define('_MA_PUBLISHER_CATEGORY__RATINGS', '_ratings');
\define('_MA_PUBLISHER_CATEGORY__VOTES', '_votes');
// Article
\define('_MA_BLOG_ARTICLE', 'Article');
\define('_MA_BLOG_ARTICLE_DESC', 'Article description');
\define('_MA_BLOG_ARTICLE_LIST', 'List of Article');
\define('_MA_PUBLISHER_ARTICLE', 'Article');
\define('_MA_PUBLISHER_ARTICLE_DESC', 'Article description');
\define('_MA_PUBLISHER_ARTICLE_LIST', 'List of Article');
// Caption of Article
\define('_MA_BLOG_ARTICLE_ID', 'Id');
\define('_MA_BLOG_ARTICLE_TITLE', 'Title');
\define('_MA_BLOG_ARTICLE_SUMMARY', 'Summary');
\define('_MA_BLOG_ARTICLE_DESCRIPTION', 'Description');
\define('_MA_BLOG_ARTICLE_IMAGE', 'Image');
\define('_MA_BLOG_ARTICLE_CREATED', 'Created');
\define('_MA_BLOG_ARTICLE_EDITED', 'Edited');
\define('_MA_BLOG_ARTICLE_PUBLISHED', 'Published');
\define('_MA_BLOG_ARTICLE_CATEGORY', 'Category');
\define('_MA_BLOG_ARTICLE__RATINGS', '_ratings');
\define('_MA_BLOG_ARTICLE__VOTES', '_votes');
\define('_MA_BLOG_ARTICLE__COMMENTS', '_comments');
\define('_MA_BLOG_INDEX_THEREARE', 'There are %s Article');
\define('_MA_BLOG_INDEX_LATEST_LIST', 'Last Blog');
\define('_MA_PUBLISHER_ARTICLE_ID', 'Id');
\define('_MA_PUBLISHER_ARTICLE_TITLE', 'Title');
\define('_MA_PUBLISHER_ARTICLE_SUMMARY', 'Summary');
\define('_MA_PUBLISHER_ARTICLE_DESCRIPTION', 'Description');
\define('_MA_PUBLISHER_ARTICLE_IMAGE', 'Image');
\define('_MA_PUBLISHER_ARTICLE_CREATED', 'Created');
\define('_MA_PUBLISHER_ARTICLE_EDITED', 'Edited');
\define('_MA_PUBLISHER_ARTICLE_PUBLISHED', 'Published');
\define('_MA_PUBLISHER_ARTICLE_CATEGORY', 'Category');
\define('_MA_PUBLISHER_ARTICLE__RATINGS', '_ratings');
\define('_MA_PUBLISHER_ARTICLE__VOTES', '_votes');
\define('_MA_PUBLISHER_ARTICLE__COMMENTS', '_comments');
\define('_MA_PUBLISHER_INDEX_THEREARE', 'There are %s Article');
\define('_MA_PUBLISHER_INDEX_LATEST_LIST', 'Last Blog');
// Submit
\define('_MA_BLOG_SUBMIT', 'Submit');
\define('_MA_PUBLISHER_SUBMIT', 'Submit');
// Form
\define('_MA_BLOG_FORM_OK', 'Successfully saved');
\define('_MA_BLOG_FORM_DELETE_OK', 'Successfully deleted');
\define('_MA_BLOG_FORM_SURE_DELETE', "Are you sure to delete: <b><span style='color : Red;'>%s </span></b>");
\define('_MA_BLOG_FORM_SURE_RENEW', "Are you sure to update: <b><span style='color : Red;'>%s </span></b>");
\define('_MA_BLOG_FORM_SURE_BROKEN', "Are you sure to notify as broken: <b><span style='color : Red;'>%s </span></b>");
\define('_MA_BLOG_INVALID_PARAM', 'Invalid parameter');
\define('_MA_PUBLISHER_FORM_OK', 'Successfully saved');
\define('_MA_PUBLISHER_FORM_DELETE_OK', 'Successfully deleted');
\define('_MA_PUBLISHER_FORM_SURE_DELETE', "Are you sure to delete: <b><span style='color : Red;'>%s </span></b>");
\define('_MA_PUBLISHER_FORM_SURE_RENEW', "Are you sure to update: <b><span style='color : Red;'>%s </span></b>");
\define('_MA_PUBLISHER_FORM_SURE_BROKEN', "Are you sure to notify as broken: <b><span style='color : Red;'>%s </span></b>");
\define('_MA_PUBLISHER_INVALID_PARAM', 'Invalid parameter');
// ---------------- Ratings ----------------
\define('_MA_BLOG_RATING_CURRENT_1', 'Rating: %c / %m (%t rating totally)');
\define('_MA_BLOG_RATING_CURRENT_X', 'Rating: %c / %m (%t ratings totally)');
\define('_MA_BLOG_RATING_CURRENT_SHORT_1', '%c (%t rating)');
\define('_MA_BLOG_RATING_CURRENT_SHORT_X', '%c (%t ratings)');
\define('_MA_BLOG_RATING1', '1 of 5');
\define('_MA_BLOG_RATING2', '2 of 5');
\define('_MA_BLOG_RATING3', '3 of 5');
\define('_MA_BLOG_RATING4', '4 of 5');
\define('_MA_BLOG_RATING5', '5 of 5');
\define('_MA_BLOG_RATING_10_1', '1 of 10');
\define('_MA_BLOG_RATING_10_2', '2 of 10');
\define('_MA_BLOG_RATING_10_3', '3 of 10');
\define('_MA_BLOG_RATING_10_4', '4 of 10');
\define('_MA_BLOG_RATING_10_5', '5 of 10');
\define('_MA_BLOG_RATING_10_6', '6 of 10');
\define('_MA_BLOG_RATING_10_7', '7 of 10');
\define('_MA_BLOG_RATING_10_8', '8 of 10');
\define('_MA_BLOG_RATING_10_9', '9 of 10');
\define('_MA_BLOG_RATING_10_10', '10 of 10');
\define('_MA_BLOG_RATING_VOTE_BAD', 'Invalid vote');
\define('_MA_BLOG_RATING_VOTE_ALREADY', 'You have already voted');
\define('_MA_BLOG_RATING_VOTE_THANKS', 'Thank you for rating');
\define('_MA_BLOG_RATING_NOPERM', "Sorry, you don't have permission to rate items");
\define('_MA_BLOG_RATING_LIKE', 'Like');
\define('_MA_BLOG_RATING_DISLIKE', 'Dislike');
\define('_MA_BLOG_RATING_ERROR1', 'Error: update base table failed!');
\define('_MA_PUBLISHER_RATING_CURRENT_1', 'Rating: %c / %m (%t rating totally)');
\define('_MA_PUBLISHER_RATING_CURRENT_X', 'Rating: %c / %m (%t ratings totally)');
\define('_MA_PUBLISHER_RATING_CURRENT_SHORT_1', '%c (%t rating)');
\define('_MA_PUBLISHER_RATING_CURRENT_SHORT_X', '%c (%t ratings)');
\define('_MA_PUBLISHER_RATING1', '1 of 5');
\define('_MA_PUBLISHER_RATING2', '2 of 5');
\define('_MA_PUBLISHER_RATING3', '3 of 5');
\define('_MA_PUBLISHER_RATING4', '4 of 5');
\define('_MA_PUBLISHER_RATING5', '5 of 5');
\define('_MA_PUBLISHER_RATING_10_1', '1 of 10');
\define('_MA_PUBLISHER_RATING_10_2', '2 of 10');
\define('_MA_PUBLISHER_RATING_10_3', '3 of 10');
\define('_MA_PUBLISHER_RATING_10_4', '4 of 10');
\define('_MA_PUBLISHER_RATING_10_5', '5 of 10');
\define('_MA_PUBLISHER_RATING_10_6', '6 of 10');
\define('_MA_PUBLISHER_RATING_10_7', '7 of 10');
\define('_MA_PUBLISHER_RATING_10_8', '8 of 10');
\define('_MA_PUBLISHER_RATING_10_9', '9 of 10');
\define('_MA_PUBLISHER_RATING_10_10', '10 of 10');
\define('_MA_PUBLISHER_RATING_VOTE_BAD', 'Invalid vote');
\define('_MA_PUBLISHER_RATING_VOTE_ALREADY', 'You have already voted');
\define('_MA_PUBLISHER_RATING_VOTE_THANKS', 'Thank you for rating');
\define('_MA_PUBLISHER_RATING_NOPERM', "Sorry, you don't have permission to rate items");
\define('_MA_PUBLISHER_RATING_LIKE', 'Like');
\define('_MA_PUBLISHER_RATING_DISLIKE', 'Dislike');
\define('_MA_PUBLISHER_RATING_ERROR1', 'Error: update base table failed!');

\define('_MA_BLOG_REACTION_LIKE', 'Like');
\define('_MA_BLOG_REACTION_LOVE', 'Love');
\define('_MA_BLOG_REACTION_CARE', 'Care');
\define('_MA_BLOG_REACTION_HAHA', 'Ha Ha');
\define('_MA_BLOG_REACTION_WOW', 'Wow!');
\define('_MA_BLOG_REACTION_SAD', 'Sad');
\define('_MA_BLOG_REACTION_ANGRY', 'Angry');
\define('_MA_PUBLISHER_REACTION_LIKE', 'Like');
\define('_MA_PUBLISHER_REACTION_LOVE', 'Love');
\define('_MA_PUBLISHER_REACTION_CARE', 'Care');
\define('_MA_PUBLISHER_REACTION_HAHA', 'Ha Ha');
\define('_MA_PUBLISHER_REACTION_WOW', 'Wow!');
\define('_MA_PUBLISHER_REACTION_SAD', 'Sad');
\define('_MA_PUBLISHER_REACTION_ANGRY', 'Angry');

// Admin link
\define('_MA_BLOG_ADMIN', 'Admin');
\define('_MA_PUBLISHER_ADMIN', 'Admin');
define('_MD_PUBLISHER_PDF', 'TCPDF for XOOPS installed in /class/libraries/vendor/tecnickcom/tcpdf/');
// ---------------- End ----------------
Loading

0 comments on commit 1c832c2

Please sign in to comment.