diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 499e48f..bb714a9 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,5 +1,7 @@ # language: php build: + environment: + php: 8.0.11 nodes: tests: true analysis: @@ -14,9 +16,9 @@ build: override: true tests: override: - - php-scrutinizer-run --enable-security-analysis + - php-scrutinizer-run --enable-security-analysis filter: dependency_paths: - - XoopsCore25/* - - tag/* - - newbb/* + - XoopsCore25/* + - tag/* + - newbb/* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 901524b..8af467f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,15 +1,15 @@ -![alt XOOPS CMS](https://xoops.org/images/logoXoops4GithubRepository.png) +![alt XOOPS CMS](https://xoops.org/images/logoXoopsPhp81.png) # Contributing to [XOOPS CMS](https://xoops.org) [![XOOPS CMS Module](https://img.shields.io/badge/XOOPS%20CMS-Module-blue.svg)](https://xoops.org) [![Software License](https://img.shields.io/badge/license-GPL-brightgreen.svg?style=flat)](https://www.gnu.org/licenses/gpl-2.0.html) Contributions are **welcome** and will be fully **credited**. -We accept contributions via Pull Requests on [Github](https://github.com/XoopsModules25x/xoopspoll). +We accept contributions via Pull Requests on [GitHub](https://github.com/XoopsModules25x/xoopspoll). ## Pull Requests -- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). +- **[PSR-12 Coding Standard](https://www.php-fig.org/psr/psr-12/)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). - **Add tests!** - We encourage providing tests for your contributions. - **Document any change in behavior** - Make sure the `/docs/changelog.txt` and any other relevant documentation are up-to-date. - **Consider our release cycle** - We try to follow [Semantic Versioning v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. @@ -17,4 +17,4 @@ We accept contributions via Pull Requests on [Github](https://github.com/XoopsMo - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting. -**Happy coding, and _May the Source be with You_!** +Happy coding, and **_May the Source be with You_**! diff --git a/README.md b/README.md index 039cff3..66a7dd2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![alt XOOPS CMS](https://xoops.org/images/logoXoops4GithubRepository.png) +![alt XOOPS CMS](https://xoops.org/images/logoXoopsPhp81.png) ## XoopsPoll module for [XOOPS CMS 2.5.9+](https://xoops.org) [![XOOPS CMS Module](https://img.shields.io/badge/XOOPS%20CMS-Module-blue.svg)](https://xoops.org) @@ -7,8 +7,7 @@ [![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/mambax7/xoopspoll.svg?style=flat)](https://scrutinizer-ci.com/g/XoopsModules25x/xoopspoll/?branch=master) [![Codacy Badge](https://api.codacy.com/project/badge/grade/85a08057185d440e9ca996303d3e3c26)](https://www.codacy.com/app/mambax7/xoopspoll_2) [![Code Climate](https://img.shields.io/codeclimate/github/mambax7/xoopspoll.svg?style=flat)](https://codeclimate.com/github/XoopsModules25x/xoopspoll) -[![SensioLabsInsight](https://insight.sensiolabs.com/projects/62de8735-2c10-41b8-9faa-d4cfac041975/mini.png)](https://insight.sensiolabs.com/projects/62de8735-2c10-41b8-9faa-d4cfac041975) -[![Latest Pre-Resease](https://img.shields.io/github/tag/XoopsModules25x/xoopspoll.svg?style=flat)](https://github.com/XoopsModules25x/xoopspoll/tags/) +[![Latest Pre-Release](https://img.shields.io/github/tag/XoopsModules25x/xoopspoll.svg?style=flat)](https://github.com/XoopsModules25x/xoopspoll/tags/) [![Latest Version](https://img.shields.io/github/release/XoopsModules25x/xoopspoll.svg?style=flat)](https://github.com/XoopsModules25x/xoopspoll/releases/) **XoopsPolls** module for [XOOPS CMS](https://xoops.org) can be used to display interactive survey forms on your site. Each poll can display a question on which visitors can ‘vote’. diff --git a/admin/about.php b/admin/about.php index d9c56c3..d1f2fa5 100644 --- a/admin/about.php +++ b/admin/about.php @@ -1,4 +1,4 @@ -displayNavigation(basename(__FILE__)); -$adminObject::setPaypal('xoopsfoundation@gmail.com'); +Admin::setPaypal('xoopsfoundation@gmail.com'); $adminObject->displayAbout(false); require_once __DIR__ . '/admin_footer.php'; diff --git a/admin/admin_footer.php b/admin/admin_footer.php index 8760e65..e5959dc 100644 --- a/admin/admin_footer.php +++ b/admin/admin_footer.php @@ -1,4 +1,4 @@ -\n" - . "
\n" - . ' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" - . ''; +echo " '; xoops_cp_footer(); - diff --git a/admin/admin_header.php b/admin/admin_header.php index affced4..57c6ab6 100644 --- a/admin/admin_header.php +++ b/admin/admin_header.php @@ -1,4 +1,4 @@ -getModule()->getInfo('modicons32'); // Load language files @@ -57,6 +55,7 @@ $helper->loadLanguage('modinfo'); $helper->loadLanguage('main'); $helper->loadLanguage('common'); +$helper->loadLanguage('blocksadmin'); $myts = \MyTextSanitizer::getInstance(); diff --git a/admin/blockform.php b/admin/blockform.php deleted file mode 100644 index 7ba660a..0000000 --- a/admin/blockform.php +++ /dev/null @@ -1,129 +0,0 @@ -loadLanguage('blocksadmin'); - -$form = new \XoopsThemeForm($block['form_title'], 'blockform', 'blocksadmin.php', 'post', true); -if (isset($block['name'])) { - $form->addElement(new \XoopsFormLabel(_AM_SYSTEM_BLOCKS_NAME, $block['name'])); -} -$side_select = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_TYPE, 'bside', $block['side']); -$side_select->addOptionArray([ - 0 => _AM_SYSTEM_BLOCKS_SBLEFT, - 1 => _AM_SYSTEM_BLOCKS_SBRIGHT, - 3 => _AM_SYSTEM_BLOCKS_CBLEFT, - 4 => _AM_SYSTEM_BLOCKS_CBRIGHT, - 5 => _AM_SYSTEM_BLOCKS_CBCENTER, - 7 => _AM_SYSTEM_BLOCKS_CBBOTTOMLEFT, - 8 => _AM_SYSTEM_BLOCKS_CBBOTTOMRIGHT, - 9 => _AM_SYSTEM_BLOCKS_CBBOTTOM, - ]); -$form->addElement($side_select); -$form->addElement(new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'WEIGHT'), 'bweight', 2, 5, $block['weight'])); -$form->addElement(new \XoopsFormRadioYN(constant('CO_' . $moduleDirNameUpper . '_' . 'VISIBLE'), 'bvisible', $block['visible'])); -$mod_select = new \XoopsFormSelect(constant('CO_' . $moduleDirNameUpper . '_' . 'VISIBLEIN'), 'bmodule', $block['modules'], 5, true); -/** @var XoopsModuleHandler $moduleHandler */ -$moduleHandler = xoops_getHandler('module'); -$criteria = new \CriteriaCompo(new \Criteria('hasmain', 1)); -$criteria->add(new \Criteria('isactive', 1)); -$module_list = $moduleHandler->getList($criteria); -$module_list[-1] = _AM_SYSTEM_BLOCKS_TOPPAGE; -$module_list[0] = _AM_SYSTEM_BLOCKS_ALLPAGES; -ksort($module_list); -$mod_select->addOptionArray($module_list); -$form->addElement($mod_select); -$form->addElement(new \XoopsFormText(_AM_TITLE, 'btitle', 50, 255, $block['title']), false); -if ($block['is_custom']) { - $textarea = new \XoopsFormDhtmlTextArea(_AM_SYSTEM_BLOCKS_CONTENT, 'bcontent', $block['content'], 15, 70); - $textarea->setDescription('' . _AM_SYSTEM_BLOCKS_USEFULTAGS . '<{$poll.question}> | -|
---|---|
<{$poll.end_text}> | -|
<{$option.text}> | -<{$option.image}> <{$option.percent}> | -
- <{$poll.totalVotes}>
- - <{$poll.totalVoters}> - |
-
<{$poll.question}> | -|
---|---|
<{$poll.end_text}> | -|
<{$option.text}> | -<{$option.image}> <{$option.percent}> | -
- <{$poll.totalVotes}>
- - <{$poll.totalVoters}> - |
-
getVar('dirname') . "/viewforum.php?forum=$forum'>" . _MD_RETURNTOTHEFORUM . "
'; - } elseif ('restore' === $mode) { - // /** @var NewbbTopicHandler $topicHandler */ - $forums = array(); - $topics_obj = $topicHandler->getAll(new Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); - foreach (array_keys($topics_obj) as $id) { - $topic_obj =& $topics_obj[$id]; - $topicHandler->approve($topic_obj); - $topicHandler->synchronization($topic_obj); - $forums[$topic_obj->getVar('forum_id')] = 1; - } - //irmtfan remove - no need to approve posts manually - see class/post.php approve function - $criteria_forum = new Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); - $forums_obj = $forumHandler->getAll($criteria_forum); - foreach (array_keys($forums_obj) as $id) { - $forumHandler->synchronization($forums_obj[$id]); - } - unset($topics_obj, $forums_obj); - // irmtfan add restore to viewtopic - $restoretopic_id = $topic_obj->getVar('topic_id'); - // irmtfan / missing in URL - echo $action[$mode]['msg'] . "getVar('dirname') . "/viewtopic.php?topic_id=$restoretopic_id'>" . _MD_VIEWTHETOPIC . '
' . "getVar('dirname') . "/viewforum.php?forum=$forum'>" . _MD_RETURNTOTHEFORUM . '
' . "'; - } elseif ('merge' === $mode) { - $pollmodul = null; - /** @var XoopsModuleHandler $moduleHandler */ - $moduleHandler = xoops_getHandler('module'); - $pollModule = $moduleHandler->getByDirname('xoopspoll'); - if (($pollModule instanceof XoopsModule) && $pollModule->isactive()) { - $pollmodul = 'xoopspoll'; - $xpOptHandler = xoops_getModuleHandler('option', 'xoopspoll'); - $xpLogHandler = xoops_getModuleHandler('log', 'xoopspoll'); - } else { - //Umfrage - $pollModule = $moduleHandler->getByDirname('umfrage'); - if (($pollModule instanceof XoopsModule) && $pollModule->isactive()) { - $pollmodul = 'umfrage'; - } - } - - $postHandler = \XoopsModules\Newbb\Helper::getInstance()->getHandler('Post'); - foreach ($topic_id as $tid) { - $topic_obj = $topicHandler->get($tid); - $newtopic_obj = $topicHandler->get($newtopic); - /* return false if destination topic is newer or not existing */ - /* - if ($newtopic>$tid || !is_object($newtopic_obj)) { - redirect_header("javascript:history.go(-1)", 2, _MD_ERROR); - } - */ - $criteria_topic = new Criteria('topic_id', $tid); - $criteria = new CriteriaCompo($criteria_topic); - $criteria->add(new Criteria('pid', 0)); - $postHandler->updateAll('pid', $topicHandler->getTopPostId($newtopic), $criteria, true); - $postHandler->updateAll('topic_id', $newtopic, $criteria_topic, true); - - $topic_views = $topic_obj->getVar('topic_views') + $newtopic_obj->getVar('topic_views'); - $criteria_newtopic = new Criteria('topic_id', $newtopic); - $topicHandler->updateAll('topic_views', $topic_views, $criteria_newtopic, true); - - $topicHandler->synchronization($newtopic); - - $poll_id = $topicHandler->get($tid, 'poll_id'); - if ($poll_id > 0) { - if ('xoopspoll' === $pollmodul) { - $xpPollHandler = xoops_getModuleHandler('poll', 'xoopspoll'); - $poll = $xpPollHandler->get($poll_id); - if (false !== $xpPollHandler->delete($poll)) { - $xpOptHandler->deleteByPollId($poll_id); - $xpLogHandler->deleteByPollId($poll_id); - xoops_comment_delete($xoopsModule->getVar('mid'), $poll_id); - } - } elseif ('umfrage' === $pollmodul) { - include_once $GLOBALS['xoops']->path('modules/umfrage/class/umfrage.php'); - include_once $GLOBALS['xoops']->path('modules/umfrage/class/umfrageoption.php'); - include_once $GLOBALS['xoops']->path('modules/umfrage/class/umfragelog.php'); - include_once $GLOBALS['xoops']->path('modules/umfrage/class/umfragerenderer.php'); - - $poll = new Umfrage($poll_id); - if ($poll->delete() !== false) { - UmfrageOption::deleteByPollId($poll_id); - UmfrageLog::deleteByPollId($poll_id); - xoops_comment_delete($xoopsModule->getVar('mid'), $poll_id); - } - } - } - - $sql = sprintf('DELETE FROM %s WHERE topic_id = %u', $xoopsDB->prefix('bb_topics'), $tid); - $result = $xoopsDB->queryF($sql); - - $sql = sprintf('DELETE FROM %s WHERE topic_id = %u', $xoopsDB->prefix('bb_votedata'), $tid); - $result = $xoopsDB->queryF($sql); - - $sql = sprintf('UPDATE %s SET forum_topics = forum_topics-1 WHERE forum_id = %u', $xoopsDB->prefix('bb_forums'), $forum); - $result = $xoopsDB->queryF($sql); - - $topic_obj->loadFilters('delete'); - $newtopic_obj->loadFilters('update'); - } - // irmtfan full URL - echo $action[$mode]['msg'] . "getVar('dirname') . "/viewtopic.php?topic_id={$newtopic}'>" . _MD_VIEWTHETOPIC . '
' . "getVar('dirname') . "/viewforum.php?forum={$forum}'>" . _MD_RETURNTOTHEFORUM . '
' . "getVar('dirname') . "/index.php'>" . _MD_RETURNFORUMINDEX . '
'; - } elseif ('move' === $mode) { - if ($newforum > 0) { - $topic_id = $topic_id[0]; - $topic_obj = $topicHandler->get($topic_id); - $topic_obj->loadFilters('update'); - $topic_obj->setVar('forum_id', $newforum, true); - $topicHandler->insert($topic_obj, true); - $topic_obj->loadFilters('update'); - - $sql = sprintf('UPDATE %s SET forum_id = %u WHERE topic_id = %u', $xoopsDB->prefix('bb_posts'), $newforum, $topic_id); - if (!$r = $xoopsDB->query($sql)) { - return false; - } - $forumHandler->synchronization($forum); - $forumHandler->synchronization($newforum); - // irmtfan full URL - echo $action[$mode]['msg'] . "getVar('dirname') . "/viewtopic.php?topic_id=$topic_id&forum=$newforum'>" . _MD_GOTONEWFORUM . "
'; - } else { - // irmtfan - issue with javascript:history.go(-1) - redirect_header($_SERVER['HTTP_REFERER'], 2, _MD_ERRORFORUM); - } - } else { - $topic_id = $topic_id[0]; - $forum = $topicHandler->get($topic_id, 'forum_id'); - $forum_new = !empty($newtopic) ? $topicHandler->get($newtopic, 'forum_id') : 0; - - if (!$forumHandler->getPermission($forum, 'moderate') - || (!empty($forum_new) - && !$forumHandler->getPermission($forum_new, 'reply')) - // The forum for the topic to be merged to - || (!empty($newforum) && !$forumHandler->getPermission($newforum, 'post')) // The forum to be moved to - ) { - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id", 2, _NOPERM); - } - - if (!empty($action[$mode]['sql'])) { - $sql = sprintf('UPDATE %s SET ' . $action[$mode]['sql'] . ' WHERE topic_id = %u', $xoopsDB->prefix('bb_topics'), $topic_id); - if (!$r = $xoopsDB->query($sql)) { - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id&order=$order&viewmode=$viewmode", 2, _MD_ERROR_BACK . 'getVar('dirname') . "/viewtopic.php?topic_id=$topic_id&forum=$forum'>" . _MD_VIEWTHETOPIC . "
'; - } -} else { // No submit - $mode = $_GET['mode']; - echo "Software and its documentation made available on the XOOPS web site:
+Software and its documentation made available on the XOOPS website:
In no event shall XOOPS team be liable to you or any third parties for
@@ -43,6 +43,6 @@
and risk and with agreement that you will be solely responsible for any damage to
your computer system or loss of data that results from such activities. No advice
or information, whether oral or written, obtained by you from XOOPS or from XOOPS
- web site shall create any warranty for the software
Additional integration with both the Marquee module and the SmartClone XOOPS modules are included in the extras folder. Copy these plugins to the corresponding folder in those modules to enable support for the XOOPS poll - module. Additionally a patch has been created for the forum module (newbb) + module. Additionally, a patch has been created for the forum module (newbb) to support this version of XOOPS poll. Replace the existing forum module files with the files found in the ./extras/newbb folder.
It is recommended that you delete the ./xoopspoll/extras and @@ -47,7 +47,7 @@
- Tutorial has been started, but we might need your help! Please check out the status of the tutorial here .
+ Tutorial has been started, but we might need your help! Please check out the status of the tutorial here .
To contribute to this Tutorial, please fork it on GitHub.
-
This document describes our Documentation Process and it will help you to understand how to contribute.
+
This document describes our Documentation Process and it will help you to understand how to contribute.
There are more XOOPS Tutorials, so check them out in our XOOPS Tutorial Repository on GitBook.
Translations are on Transifex and in our XOOPS Languages Repository on GitHub.
If you have questions about this module and need help, you can visit our Support Forums on XOOPS Website
+If you have questions about this module and need help, you can visit our Support Forums on XOOPS Website
This module is Open Source and we would love your help in making it better! You can fork this module on GitHub
diff --git a/language/english/help/help.tpl b/language/english/help/help.tpl
index 2ce642c..9a16a86 100644
--- a/language/english/help/help.tpl
+++ b/language/english/help/help.tpl
@@ -2,7 +2,7 @@