Skip to content

Commit

Permalink
Merge pull request #4 from mambax7/master
Browse files Browse the repository at this point in the history
3.4. Beta 3
  • Loading branch information
mambax7 authored Apr 1, 2020
2 parents 23afd15 + 2ae18d9 commit 61c6003
Show file tree
Hide file tree
Showing 292 changed files with 12,090 additions and 12,082 deletions.
44 changes: 22 additions & 22 deletions abandontribe.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

use XoopsModules\Yogurt;

require __DIR__.'/header.php';
require __DIR__ . '/header.php';

/**
* Verify Token
Expand All @@ -31,28 +31,28 @@
/**
* Receiving info from get parameters
*/
$reltribeuser_id = (int) $_POST['reltribe_id'];
$reltribeuser_id = \Xmf\Request::getInt('reltribe_id', 0, 'POST');
if (!isset($_POST['confirm']) || 1 != $_POST['confirm']) {
xoops_confirm(['reltribe_id' => $reltribeuser_id, 'confirm' => 1], 'abandontribe.php', _MD_YOGURT_ASKCONFIRMABANDONTRIBE, _MD_YOGURT_CONFIRMABANDON);
xoops_confirm(['reltribe_id' => $reltribeuser_id, 'confirm' => 1], 'abandontribe.php', _MD_YOGURT_ASKCONFIRMABANDONTRIBE, _MD_YOGURT_CONFIRMABANDON);
} else {
/**
* Creating the factory and the criteria to delete the picture
* The user must be the owner
*/
$reltribeuserFactory = new Yogurt\ReltribeuserHandler($xoopsDB);
$criteria_rel_id = new \Criteria('rel_id', $reltribeuser_id);
$uid = (int)$xoopsUser->getVar('uid');
$criteria_uid = new \Criteria('rel_user_uid', $uid);
$criteria = new \CriteriaCompo($criteria_rel_id);
$criteria->add($criteria_uid);
/**
* Creating the factory and the criteria to delete the picture
* The user must be the owner
*/
$reltribeuserFactory = new Yogurt\ReltribeuserHandler($xoopsDB);
$criteria_rel_id = new \Criteria('rel_id', $reltribeuser_id);
$uid = (int)$xoopsUser->getVar('uid');
$criteria_uid = new \Criteria('rel_user_uid', $uid);
$criteria = new \CriteriaCompo($criteria_rel_id);
$criteria->add($criteria_uid);

/**
* Try to delete
*/
if ($reltribeuserFactory->deleteAll($criteria)) {
redirect_header('tribes.php', 1, _MD_YOGURT_TRIBEABANDONED);
} else {
redirect_header('tribes.php', 1, _MD_YOGURT_NOCACHACA);
}
/**
* Try to delete
*/
if ($reltribeuserFactory->deleteAll($criteria)) {
redirect_header('tribes.php', 1, _MD_YOGURT_TRIBEABANDONED);
} else {
redirect_header('tribes.php', 1, _MD_YOGURT_NOCACHACA);
}
}
include __DIR__.'/../../footer.php';
require dirname(dirname(__DIR__)) . '/footer.php';
9 changes: 4 additions & 5 deletions admin/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @package
* @since
* @author XOOPS Development Team
* @author XOOPS Development Team
*/

require_once __DIR__.'/admin_header.php';
require_once __DIR__ . '/admin_header.php';
xoops_cp_header();

$adminObject->displayNavigation(basename(__FILE__));
$adminObject->setPaypal('xoopsfoundation@gmail.com');
$adminObject::setPaypal('xoopsfoundation@gmail.com');
$adminObject->displayAbout(false);

require_once __DIR__.'/admin_footer.php';
require_once __DIR__ . '/admin_footer.php';
3 changes: 1 addition & 2 deletions admin/admin_footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
* @since
* @author XOOPS Development Team
*/

$pathIcon32 = Xmf\Module\Admin::iconUrl('', 32);

echo "<div class='adminfooter'>\n"." <div style='text-align: center;'>\n"." <a href='https://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"." </div>\n".' '._AM_MODULEADMIN_ADMIN_FOOTER."\n".'</div>';
echo "<div class='adminfooter'>\n" . " <div style='text-align: center;'>\n" . " <a href='https://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" . " </div>\n" . ' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . '</div>';

xoops_cp_footer();
16 changes: 5 additions & 11 deletions admin/admin_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@
* @since
* @author XOOPS Development Team
*/
include dirname(__DIR__) . '/preloads/autoloader.php';

use XoopsModules\Yogurt;

include dirname(__DIR__).'/preloads/autoloader.php';

require dirname(dirname(dirname(__DIR__))).'/include/cp_header.php';
require dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
//require $GLOBALS['xoops']->path('www/class/xoopsformloader.php');
require dirname(__DIR__).'/include/common.php';
require dirname(__DIR__) . '/include/common.php';

$moduleDirName = basename(dirname(__DIR__));

/** @var \XoopsModules\Yogurt\Helper $helper */
$helper = \XoopsModules\Yogurt\Helper::getInstance();

/** @var \Xmf\Module\Admin $adminObject */
Expand All @@ -38,12 +34,11 @@
$helper->loadLanguage('modinfo');
$helper->loadLanguage('common');


$myts = MyTextSanitizer::getInstance();

if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) {
require_once $GLOBALS['xoops']->path('class/template.php');
$xoopsTpl = new \XoopsTpl();
require_once $GLOBALS['xoops']->path('class/template.php');
$xoopsTpl = new \XoopsTpl();
}

$pathIcon16 = Xmf\Module\Admin::iconUrl('', 16);
Expand All @@ -53,4 +48,3 @@
// Local icons path
$xoopsTpl->assign('pathModIcon16', $pathIcon16);
$xoopsTpl->assign('pathModIcon32', $pathIcon32);

23 changes: 10 additions & 13 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @package
* @since
* @author XOOPS Development Team
* @author XOOPS Development Team
*/

require_once __DIR__.'/admin_header.php';
require_once __DIR__ . '/admin_header.php';
// Display Admin header
xoops_cp_header();
$adminObject = \Xmf\Module\Admin::getInstance();

//$configurator = include __DIR__ . '/../include/config.php';
//$configurator = require dirname(__DIR__) . '/include/config.php';
//foreach (array_keys($configurator->uploadFolders) as $i) {
// $utility::createFolder($configurator->uploadFolders[$i]);
// $adminObject->addConfigBoxLine($configurator->uploadFolders[$i], 'folder');
Expand All @@ -47,28 +46,28 @@
$adminObject->addInfoBox(_AM_SOAPBOX_MODCONTENT);
if ($totcol > 0) {
if ($totcol> 0) {
$adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="main.php">' . _AM_SOAPBOX_TOTCOL . '</a>' . '</infolabel>', '<span class="green">' . $totcol . '</span>'), '', 'green');
} else {
$adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_SOAPBOX_TOTCOL . '</infolabel>', '<span class="green">' . $totcol . '</span>'), '', 'Green');
}
if ($totpub > 0) {
if ($totpub> 0) {
$adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="main.php">' . _AM_SOAPBOX_TOTART . '</a>' . '</infolabel>', '<span class="green">' . $totpub . '</span>'), '', 'green');
} else {
$adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_SOAPBOX_TOTART . '</infolabel>', '<span class="green">' . $totpub . '</span>'), '', 'green');
}
if ($totoff > 0) {
if ($totoff> 0) {
$adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="main.php">' . _AM_SOAPBOX_TOTOFF . '</a>' . '</infolabel>', '<span class="red">' . $totoff . '</span>'), '', 'red');
} else {
$adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_SOAPBOX_TOTOFF . '</infolabel>', '<span class="green">' . $totoff . '</span>'), '', 'green');
}
if ($totall > 0) {
if ($totall> 0) {
$adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="main.php">' . _AM_SOAPBOX_TOTSUB . '</a>' . '</infolabel>', '<span class="green">' . $totall . '</span>'), '', 'green');
} else {
$adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_SOAPBOX_TOTSUB . '</infolabel>', '<span class="green">' . $totall . '</span>'), '', 'green');
}
if ($totsub > 0) {
if ($totsub> 0) {
$adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="submissions.php">' . _AM_SOAPBOX_NEED_APPROVAL . '</a>' . '</infolabel>', '<span class="green">' . $totsub . '</span>'), '', 'red');
} else {
$adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_SOAPBOX_NEED_APPROVAL . '</infolabel>', '<span class="green">' . $totsub . '</span>'), '', 'green');
Expand All @@ -79,16 +78,14 @@
//------------- Test Data ----------------------------
//if ($publisher->getConfig('displaySampleButton')) {
// xoops_loadLanguage('admin/modulesadmin', 'system');
// require_once __DIR__ . '/../testdata/index.php';
// require_once dirname(__DIR__) . '/testdata/index.php';
// $adminObject->addItemButton(_AM_SYSTEM_MODULES_INSTALL_TESTDATA, '__DIR__ . /../../testdata/index.php?op=load', 'add');
// $adminObject->displayButton('left', '');
//}
//------------- End Test Data ----------------------------

$adminObject->displayIndex();


//echo $utility::getServerStats();

require_once __DIR__.'/admin_footer.php';

require_once __DIR__ . '/admin_footer.php';
Loading

0 comments on commit 61c6003

Please sign in to comment.