Skip to content

Commit

Permalink
Merge pull request #23 from mambax7/master
Browse files Browse the repository at this point in the history
1.08 RC-1
  • Loading branch information
mambax7 authored Jul 26, 2021
2 parents 73e8f66 + af78b29 commit 2803686
Show file tree
Hide file tree
Showing 72 changed files with 1,293 additions and 1,553 deletions.
28 changes: 12 additions & 16 deletions admin/about.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
<?php

/**
* Module: XoopsTube
*
/*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
*
* PHP version 5
*
* @category Module
* @package Xoopstube
* @author XOOPS Development Team
* @copyright 2001-2016 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
* @link https://xoops.org/
* @since 1.0.6
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/

use Xmf\Module\Admin;
/**
* @copyright XOOPS Project https://xoops.org/
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
* @author XOOPS Development Team
*/

use Xmf\Module\Admin;
/** @var Admin $adminObject */

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

$adminObject->displayNavigation(basename(__FILE__));
$adminObject::setPaypal('[email protected]');
$adminObject->displayAbout(false);

require_once __DIR__ . '/admin_footer.php';
require __DIR__ . '/admin_footer.php';
32 changes: 18 additions & 14 deletions admin/admin_footer.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
<?php

/**
* Module: XoopsTube
*
/*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
*
* PHP version 5
*
* @category Module
* @package Xoopstube
* @author XOOPS Development Team
* @copyright 2001-2016 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
* @link https://xoops.org/
* @since 1.0.6
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/

/**
* @copyright XOOPS Project https://xoops.org/
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
* @package
* @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();
50 changes: 24 additions & 26 deletions admin/admin_header.php
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
<?php
/**
* Module: XoopsTube
*

/*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
*
* PHP version 5
*
* @category Module
* @package Xoopstube
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/

/**
* @copyright XOOPS Project https://xoops.org/
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
* @package
* @since
* @author XOOPS Development Team
* @copyright 2001-2016 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
* @link https://xoops.org/
* @since 1.0.6
*/

use XoopsModules\Xoopstube;
use Xmf\Module\Admin;
use XoopsModules\Xoopstube\{
Helper
};
/** @var Admin $adminObject */
/** @var Helper $helper */

require dirname(__DIR__, 3) . '/include/cp_header.php';
//require_once $GLOBALS['xoops']->path('www/class/xoopsformloader.php');
require dirname(__DIR__) . '/preloads/autoloader.php';

// require_once dirname(__DIR__) . '/class/Utility.php';
require_once dirname(__DIR__) . '/include/common.php';
require dirname(__DIR__, 3) . '/include/cp_header.php';
require dirname(__DIR__, 3) . '/class/xoopsformloader.php';
require dirname(__DIR__, 3) . '/class/xoopslists.php';
require dirname(__DIR__) . '/include/common.php';
require dirname(__DIR__) . '/include/video.php';

$moduleDirName = \basename(\dirname(__DIR__));
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
$helper = Helper::getInstance();
$adminObject = Xmf\Module\Admin::getInstance();

$adminObject = Admin::getInstance();

$pathIcon16 = Xmf\Module\Admin::iconUrl('', 16);
$pathIcon32 = Xmf\Module\Admin::iconUrl('', 32);
Expand All @@ -50,15 +57,6 @@
$xoopsTpl = new \XoopsTpl();
}

//require_once $moduleDirName . '/config/config.php';
// require_once dirname(__DIR__) . '/class/Utility.php';
require_once dirname(__DIR__) . '/include/video.php';
// require_once dirname(__DIR__) . '/class/Lists.php';
// require_once dirname(__DIR__) . '/class/TextSanitizer.php';
// require_once dirname(__DIR__) . '/class/Tree.php';

require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';

$myts = \MyTextSanitizer::getInstance(); // MyTextSanitizer object

Expand Down
2 changes: 1 addition & 1 deletion admin/altcat.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function makeTreeCheckTable(Xoopstube\Tree $xt, $itemid, $title, $checks, $order
$arr = $xt->getChildTreeArray($cid, $order);
foreach ($arr as $cat) {
$cat['prefix'] = str_replace('.', '-', $cat['prefix']);
$catpath = '&nbsp;' . $cat['prefix'] . '&nbsp;' . htmlspecialchars($cat[$title]);
$catpath = '&nbsp;' . $cat['prefix'] . '&nbsp;' . htmlspecialchars($cat[$title], ENT_QUOTES | ENT_HTML5);
$checked = array_key_exists($cat['cid'], $checks) ? 'checked' : '';
$disabled = ($cat['cid'] === Request::getInt('cid', 0, 'GET')) ? "disabled='yes'" : '';
$level = mb_substr_count($cat['prefix'], '-') + 1;
Expand Down
73 changes: 42 additions & 31 deletions admin/blockform.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
<?php
/**
* Module: XoopsTube
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
*
* PHP version 5
*
* @category Module
* @package Xoopstube
* @author Fernando Santos (topet05), [email protected]
* @copyright Mastop InfoDigital (c) 2003-2007
* @link http://www.mastop.com.br
* @author XOOPS Development Team
* @copyright XOOPS Project
* @link https://xoops.org
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
* @since 1.0.6
*/

use XoopsModules\Xoopstube;
use Xmf\Module\Admin;
use XoopsModules\Xoopstube\{
Helper
};

/** @var Admin $adminObject */
/** @var Helper $helper */

require __DIR__ . '/admin_header.php';

require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';

$moduleDirName = basename(dirname(__DIR__));
$moduleDirNameUpper = mb_strtoupper($moduleDirName); //$capsDirName

$helper->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(
$sideSelect = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_TYPE, 'bside', $block['side']);
$sideSelect->addOptionArray(
[
0 => _AM_SYSTEM_BLOCKS_SBLEFT,
1 => _AM_SYSTEM_BLOCKS_SBRIGHT,
Expand All @@ -37,35 +48,35 @@
9 => _AM_SYSTEM_BLOCKS_CBBOTTOM,
]
);
$form->addElement($side_select);
$form->addElement(new \XoopsFormText(_AM_XOOPSTUBE_WEIGHT, 'bweight', 2, 5, $block['weight']));
$form->addElement(new \XoopsFormRadioYN(_AM_XOOPSTUBE_VISIBLE, 'bvisible', $block['visible']));
$mod_select = new \XoopsFormSelect(_AM_XOOPSTUBE_VISIBLEIN, 'bmodule', $block['modules'], 5, true);
$form->addElement($sideSelect);
$form->addElement(new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'WEIGHT'), 'bweight', 2, 5, $block['weight']));
$form->addElement(new \XoopsFormRadioYN(constant('CO_' . $moduleDirNameUpper . '_' . 'VISIBLE'), 'bvisible', $block['visible']));
$moduleSelect = 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);
$moduleList = $moduleHandler->getList($criteria);
$moduleList[-1] = _AM_SYSTEM_BLOCKS_TOPPAGE;
$moduleList[0] = _AM_SYSTEM_BLOCKS_ALLPAGES;
ksort($moduleList);
$moduleSelect->addOptionArray($moduleList);
$form->addElement($moduleSelect);
$form->addElement(new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . '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('<span style="font-size:x-small;font-weight:bold;">' . _AM_SYSTEM_BLOCKS_USEFULTAGS . '</span><br><span style="font-size:x-small;font-weight:normal;">' . sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL . '/') . '</span>');
$form->addElement($textarea, true);
$ctype_select = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_CTYPE, 'bctype', $block['ctype']);
$ctype_select->addOptionArray(
$ctypeSelect = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_CTYPE, 'bctype', $block['ctype']);
$ctypeSelect->addOptionArray(
[
'H' => _AM_SYSTEM_BLOCKS_HTML,
'P' => _AM_SYSTEM_BLOCKS_PHP,
'S' => _AM_SYSTEM_BLOCKS_AFWSMILE,
'T' => _AM_SYSTEM_BLOCKS_AFNOSMILE,
]
);
$form->addElement($ctype_select);
$form->addElement($ctypeSelect);
} else {
if ('' !== $block['template']) {
/** @var \XoopsTplfileHandler $tplfileHandler */
Expand All @@ -84,8 +95,8 @@
$form->addElement(new \XoopsFormLabel(_AM_SYSTEM_BLOCKS_OPTIONS, $block['edit_form']));
}
}
$cache_select = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_BCACHETIME, 'bcachetime', $block['bcachetime']);
$cache_select->addOptionArray(
$cacheSelect = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_BCACHETIME, 'bcachetime', $block['bcachetime']);
$cacheSelect->addOptionArray(
[
'0' => _NOCACHE,
'30' => sprintf(_SECONDS, 30),
Expand All @@ -100,7 +111,7 @@
'2592000' => _MONTH,
]
);
$form->addElement($cache_select);
$form->addElement($cacheSelect);

/** @var \XoopsGroupPermHandler $grouppermHandler */
$grouppermHandler = xoops_getHandler('groupperm');
Expand All @@ -120,11 +131,11 @@

//Submit buttons
$buttonTray = new \XoopsFormElementTray('', '');
$submit_button = new \XoopsFormButton('', 'submitblock', _SUBMIT, 'submit');
$buttonTray->addElement($submit_button);
$submitButton = new \XoopsFormButton('', 'submitblock', _SUBMIT, 'submit');
$buttonTray->addElement($submitButton);

$cancel_button = new \XoopsFormButton('', '', _CANCEL, 'button');
$cancel_button->setExtra('onclick="history.go(-1)"');
$buttonTray->addElement($cancel_button);
$cancelButton = new \XoopsFormButton('', '', _CANCEL, 'button');
$cancelButton->setExtra('onclick="history.go(-1)"');
$buttonTray->addElement($cancelButton);

$form->addElement($buttonTray);
Loading

0 comments on commit 2803686

Please sign in to comment.