Skip to content

Commit

Permalink
Merge pull request #4 from mambax7/master
Browse files Browse the repository at this point in the history
2.11 Beta 1
  • Loading branch information
mambax7 committed May 31, 2016
2 parents 905d7e3 + c4c9cfb commit 3e3de73
Show file tree
Hide file tree
Showing 45 changed files with 1,792 additions and 1,152 deletions.
28 changes: 16 additions & 12 deletions admin/about.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
<?php
/*
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.
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.
*/
/**
* Module: RandomQuote
*
* 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 Randomquote
* @author XOOPS Development Team, Mamba
* @copyright 2001-2016 XOOPS Project (http://xoops.org)
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @link http://xoops.org/
* @since 2.0.0
* @package randomquote
* @author XOOPS Module Development Team
* @author Mamba
* @copyright {@link http://xoops.org 2001-2016 XOOPS Project}
* @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
* @link http://xoops.org XOOPS
* @since 2.00
*/

include_once __DIR__ . '/admin_header.php';
Expand Down
60 changes: 40 additions & 20 deletions admin/admin_footer.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,48 @@
<?php
/*
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.
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.
*/
/**
* Module: RandomQuote
*
* 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 Randomquote
* @author XOOPS Development Team, Mamba
* @copyright 2001-2016 XOOPS Project (http://xoops.org)
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @link http://xoops.org/
* @since 2.0.0
* @package randomquote
* @author XOOPS Module Development Team
* @author Mamba
* @copyright {@link http://xoops.org 2001-2016 XOOPS Project}
* @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
* @link http://xoops.org XOOPS
* @since 2.00
*/

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

echo "<div class='adminfooter'>\n"
. " <div class='center'>\n"
. " <a href='"
. $GLOBALS['xoopsModule']->getInfo('author_website_url')
. "' target='_blank'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='"
. $GLOBALS['xoopsModule']->getInfo('author_website_name')
. "' title='"
. $GLOBALS['xoopsModule']->getInfo('author_website_name')
. "'></a>\n"
. " </div>\n"
. " <div class='center smallsmall italic pad5'>\n"
. " "
. _AM_RANDOMQUOTE_MAINTAINED_BY
. " <a class='tooltip' rel='external' href='http://"
. $GLOBALS['xoopsModule']->getInfo('module_website_url')
. "' "
. "title='"
. _AM_RANDOMQUOTE_MAINTAINED_TITLE
. "'>"
. _AM_RANDOMQUOTE_MAINTAINED_TEXT
. "</a>\n"
. " </div>\n"
. "</div>";
xoops_cp_footer();
70 changes: 36 additions & 34 deletions admin/admin_header.php
Original file line number Diff line number Diff line change
@@ -1,52 +1,54 @@
<?php
/*
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.
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.
*/
/**
* Module: RandomQuote
*
* 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 Randomquote
* @author XOOPS Development Team, Mamba
* @copyright 2001-2016 XOOPS Project (http://xoops.org)
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @link http://xoops.org/
* @since 2.0.0
* @package randomquote
* @author XOOPS Module Development Team
* @author Mamba
* @copyright {@link http://xoops.org 2001-2016 XOOPS Project}
* @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
* @link http://xoops.org XOOPS
* @since 2.00
*/

include_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
include_once XOOPS_ROOT_PATH . '/include/cp_header.php';
include_once dirname(__DIR__) . '/include/config.php';
include_once dirname(__DIR__) . '/include/functions.php';
include_once $GLOBALS['xoops']->path('/include/cp_header.php');

$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
$moduleDirName = $GLOBALS['xoopsModule']->getVar('dirname');

$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
//load handlers
$quotesHandler = xoops_getModuleHandler('quotes', $thisDirname);
XoopsLoad::load('xoopsrequest');
XoopsLoad::load('quotes', $moduleDirName);
XoopsLoad::load('constants', $moduleDirName);

$pathIcon16 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('icons16'));
$pathIcon32 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('icons32'));
$pathModuleAdmin = $GLOBALS['xoops']->path('www/' . $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin'));
$quotesHandler = xoops_getModuleHandler('quotes', $moduleDirName);

$myts = MyTextSanitizer::getInstance();
if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
include_once(XOOPS_ROOT_PATH . '/class/template.php');
if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) {
include_once $GLOBALS['xoops']->path("/class/template.php");
$xoopsTpl = new XoopsTpl();
}

$xoopsTpl->assign('pathIcon16', $pathIcon16);
$xoopsTpl->assign('pathIcon32', $pathIcon32);
$GLOBALS['xoopsTpl']->assign('pathIcon16', $pathIcon16);
$GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
//Load languages
xoops_loadLanguage('admin', $thisDirname);
xoops_loadLanguage('modinfo', $thisDirname);
xoops_loadLanguage('main', $thisDirname);
// Locad admin menu class
if (file_exists($GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php'))) {
require_once $GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php');
} else {
redirect_header('../../../admin.php', 5, _AM_MODULEADMIN_MISSING, false);
}
xoops_loadLanguage('admin', $moduleDirName);
xoops_loadLanguage('modinfo', $moduleDirName);
xoops_loadLanguage('main', $moduleDirName);
require_once "{$pathModuleAdmin}/moduleadmin/moduleadmin.php";

xoops_cp_header();
$adminMenu = new ModuleAdmin();
47 changes: 30 additions & 17 deletions admin/index.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
<?php
/*
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.
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.
*/
/**
* Module: RandomQuote
*
* 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 Randomquote
* @author XOOPS Development Team, Mamba
* @copyright 2001-2016 XOOPS Project (http://xoops.org)
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @link http://xoops.org/
* @since 2.0.0
* @package randomquote
* @author XOOPS Module Development Team
* @author Mamba
* @copyright {@link http://xoops.org 2001-2016 XOOPS Project}
* @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
* @link http://xoops.org XOOPS
* @since 2.00
*/

include_once __DIR__ . '/admin_header.php';
//count "total citas"
$count_quotes = $quotesHandler->getCount();
// InfoBox citas

//count quotes
$totalCount = $quotesHandler->getCount();
$offlineCount = $quotesHandler->getCount(new Criteria('quote_status', RandomquoteConstants::STATUS_OFFLINE, '='));
$onlineCount = $quotesHandler->getCount(new Criteria('quote_status', RandomquoteConstants::STATUS_ONLINE, '='));
$waitingCount = (string) ($totalCount - $offlineCount - $onlineCount);

// InfoBox quotes
$adminMenu->addInfoBox(_AM_RANDOMQUOTE_STATISTICS);
// InfoBox citas
$adminMenu->addInfoBoxLine(_AM_RANDOMQUOTE_STATISTICS, _AM_RANDOMQUOTE_THEREARE_CITAS, $count_quotes);
// InfoBox quotes
$adminMenu->addInfoBoxLine(_AM_RANDOMQUOTE_STATISTICS, _AM_RANDOMQUOTE_THEREARE_QUOTES, $totalCount);
$adminMenu->addInfoBoxLine(_AM_RANDOMQUOTE_STATISTICS, _AM_RANDOMQUOTE_QUOTES_OFFLINE, $offlineCount, 'red');
$adminMenu->addInfoBoxLine(_AM_RANDOMQUOTE_STATISTICS, _AM_RANDOMQUOTE_QUOTES_ONLINE , $onlineCount, 'green');
$adminMenu->addInfoBoxLine(_AM_RANDOMQUOTE_STATISTICS, _AM_RANDOMQUOTE_QUOTES_WAITING, $waitingCount, 'orange');
// Render Index
echo $adminMenu->addNavigation(basename(__FILE__));
echo $adminMenu->renderIndex();
Expand Down

0 comments on commit 3e3de73

Please sign in to comment.