|
From: <be...@us...> - 2014-07-11 17:19:04
|
Revision: 12702
http://sourceforge.net/p/xoops/svn/12702
Author: beckmi
Date: 2014-07-11 17:18:50 +0000 (Fri, 11 Jul 2014)
Log Message:
-----------
Adding RandomQuote update
Added Paths:
-----------
XoopsModules/randomquote/branches/mamba/
XoopsModules/randomquote/branches/mamba/randomquote/
XoopsModules/randomquote/branches/mamba/randomquote/admin/
XoopsModules/randomquote/branches/mamba/randomquote/admin/about.php
XoopsModules/randomquote/branches/mamba/randomquote/admin/admin_footer.php
XoopsModules/randomquote/branches/mamba/randomquote/admin/admin_header.php
XoopsModules/randomquote/branches/mamba/randomquote/admin/index.html
XoopsModules/randomquote/branches/mamba/randomquote/admin/index.php
XoopsModules/randomquote/branches/mamba/randomquote/admin/main.php
XoopsModules/randomquote/branches/mamba/randomquote/admin/menu.php
XoopsModules/randomquote/branches/mamba/randomquote/assets/
XoopsModules/randomquote/branches/mamba/randomquote/assets/css/
XoopsModules/randomquote/branches/mamba/randomquote/assets/css/index.html
XoopsModules/randomquote/branches/mamba/randomquote/assets/images/
XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/
XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/arrow.gif
XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/index.html
XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/off.png
XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/on.png
XoopsModules/randomquote/branches/mamba/randomquote/assets/images/index.html
XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/
XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/bg.png
XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/index.html
XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/left_both.png
XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/right_both.png
XoopsModules/randomquote/branches/mamba/randomquote/assets/images/randomquote_logo.png
XoopsModules/randomquote/branches/mamba/randomquote/assets/index.html
XoopsModules/randomquote/branches/mamba/randomquote/blocks/
XoopsModules/randomquote/branches/mamba/randomquote/blocks/index.html
XoopsModules/randomquote/branches/mamba/randomquote/blocks/views.php
XoopsModules/randomquote/branches/mamba/randomquote/class/
XoopsModules/randomquote/branches/mamba/randomquote/class/forms/
XoopsModules/randomquote/branches/mamba/randomquote/class/forms/RandomQuote.php
XoopsModules/randomquote/branches/mamba/randomquote/class/index.html
XoopsModules/randomquote/branches/mamba/randomquote/class/quotes.php
XoopsModules/randomquote/branches/mamba/randomquote/docs/
XoopsModules/randomquote/branches/mamba/randomquote/docs/changelog.txt
XoopsModules/randomquote/branches/mamba/randomquote/docs/credits.txt
XoopsModules/randomquote/branches/mamba/randomquote/docs/index.html
XoopsModules/randomquote/branches/mamba/randomquote/docs/install.txt
XoopsModules/randomquote/branches/mamba/randomquote/docs/lang_diff.txt
XoopsModules/randomquote/branches/mamba/randomquote/docs/licencs.txt
XoopsModules/randomquote/branches/mamba/randomquote/docs/readme.txt
XoopsModules/randomquote/branches/mamba/randomquote/header.php
XoopsModules/randomquote/branches/mamba/randomquote/include/
XoopsModules/randomquote/branches/mamba/randomquote/include/config.php
XoopsModules/randomquote/branches/mamba/randomquote/include/functions.php
XoopsModules/randomquote/branches/mamba/randomquote/include/index.html
XoopsModules/randomquote/branches/mamba/randomquote/include/install.php
XoopsModules/randomquote/branches/mamba/randomquote/include/update.php
XoopsModules/randomquote/branches/mamba/randomquote/include/waiting.plugin.php
XoopsModules/randomquote/branches/mamba/randomquote/index.php
XoopsModules/randomquote/branches/mamba/randomquote/language/
XoopsModules/randomquote/branches/mamba/randomquote/language/english/
XoopsModules/randomquote/branches/mamba/randomquote/language/english/admin.php
XoopsModules/randomquote/branches/mamba/randomquote/language/english/blocks.php
XoopsModules/randomquote/branches/mamba/randomquote/language/english/help/
XoopsModules/randomquote/branches/mamba/randomquote/language/english/help/help.html
XoopsModules/randomquote/branches/mamba/randomquote/language/english/help/index.html
XoopsModules/randomquote/branches/mamba/randomquote/language/english/index.html
XoopsModules/randomquote/branches/mamba/randomquote/language/english/main.php
XoopsModules/randomquote/branches/mamba/randomquote/language/english/modinfo.php
XoopsModules/randomquote/branches/mamba/randomquote/language/index.html
XoopsModules/randomquote/branches/mamba/randomquote/sql/
XoopsModules/randomquote/branches/mamba/randomquote/sql/index.html
XoopsModules/randomquote/branches/mamba/randomquote/sql/mysql.sql
XoopsModules/randomquote/branches/mamba/randomquote/templates/
XoopsModules/randomquote/branches/mamba/randomquote/templates/admin/
XoopsModules/randomquote/branches/mamba/randomquote/templates/admin/index.html
XoopsModules/randomquote/branches/mamba/randomquote/templates/admin/randomquote_admin_about.tpl
XoopsModules/randomquote/branches/mamba/randomquote/templates/admin/randomquote_admin_help.tpl
XoopsModules/randomquote/branches/mamba/randomquote/templates/blocks/
XoopsModules/randomquote/branches/mamba/randomquote/templates/blocks/index.html
XoopsModules/randomquote/branches/mamba/randomquote/templates/blocks/randomquote_quotes_block_day.tpl
XoopsModules/randomquote/branches/mamba/randomquote/templates/blocks/randomquote_quotes_block_random.tpl
XoopsModules/randomquote/branches/mamba/randomquote/templates/blocks/randomquote_quotes_block_recent.tpl
XoopsModules/randomquote/branches/mamba/randomquote/templates/index.html
XoopsModules/randomquote/branches/mamba/randomquote/templates/randomquote_footer.tpl
XoopsModules/randomquote/branches/mamba/randomquote/templates/randomquote_header.tpl
XoopsModules/randomquote/branches/mamba/randomquote/templates/randomquote_index.tpl
XoopsModules/randomquote/branches/mamba/randomquote/xoops_version.php
Added: XoopsModules/randomquote/branches/mamba/randomquote/admin/about.php
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/admin/about.php (rev 0)
+++ XoopsModules/randomquote/branches/mamba/randomquote/admin/about.php 2014-07-11 17:18:50 UTC (rev 12702)
@@ -0,0 +1,24 @@
+<?php
+/**
+ * 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-2013 The XOOPS Project
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @version $Id$
+ * @link http://sourceforge.net/projects/xoops/
+ * @since 2.0.0
+ */
+
+include_once __DIR__ . '/admin_header.php';
+echo $adminMenu->addNavigation("about.php");
+echo $adminMenu->renderabout('25J998Y3QEDZW', false);
+include_once __DIR__ . '/admin_footer.php';
Property changes on: XoopsModules/randomquote/branches/mamba/randomquote/admin/about.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/randomquote/branches/mamba/randomquote/admin/admin_footer.php
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/admin/admin_footer.php (rev 0)
+++ XoopsModules/randomquote/branches/mamba/randomquote/admin/admin_footer.php 2014-07-11 17:18:50 UTC (rev 12702)
@@ -0,0 +1,26 @@
+<?php
+/**
+ * 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-2013 The XOOPS Project
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @version $Id$
+ * @link http://sourceforge.net/projects/xoops/
+ * @since 2.0.0
+ */
+
+echo "<div align='center'><a href='http://www.xoops.org' target='_blank'>
+ <img src='" . $pathIcon32 . "/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a></div>";
+echo "<div class='center smallsmall italic pad5'>
+ <strong>" . $xoopsModule->getVar('name') . "</strong> " . _AM_RANDOMQUOTE_MAINTAINEDBY . "
+ <a href='http://xoops.org' title='Visit Support Forum' class='tooltip' rel='external'>Support Forum</a></div>";
+xoops_cp_footer();
Property changes on: XoopsModules/randomquote/branches/mamba/randomquote/admin/admin_footer.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/randomquote/branches/mamba/randomquote/admin/admin_header.php
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/admin/admin_header.php (rev 0)
+++ XoopsModules/randomquote/branches/mamba/randomquote/admin/admin_header.php 2014-07-11 17:18:50 UTC (rev 12702)
@@ -0,0 +1,53 @@
+<?php
+/**
+ * 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-2013 The XOOPS Project
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @version $Id$
+ * @link http://sourceforge.net/projects/xoops/
+ * @since 2.0.0
+ */
+
+include_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
+include_once XOOPS_ROOT_PATH . '/include/cp_header.php';
+include_once '../include/config.php';
+include_once '../include/functions.php';
+
+$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
+
+$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
+$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
+$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
+//load handlers
+$quotesHandler =& xoops_getModuleHandler('quotes', $thisDirname);
+
+$myts =& MyTextSanitizer::getInstance();
+if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
+ include_once(XOOPS_ROOT_PATH . "/class/template.php");
+ $xoopsTpl = new XoopsTpl();
+}
+
+$xoopsTpl->assign('pathIcon16', $pathIcon16);
+$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_cp_header();
+$adminMenu = new ModuleAdmin();
Property changes on: XoopsModules/randomquote/branches/mamba/randomquote/admin/admin_header.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/randomquote/branches/mamba/randomquote/admin/index.html
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/admin/index.html (rev 0)
+++ XoopsModules/randomquote/branches/mamba/randomquote/admin/index.html 2014-07-11 17:18:50 UTC (rev 12702)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
Added: XoopsModules/randomquote/branches/mamba/randomquote/admin/index.php
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/admin/index.php (rev 0)
+++ XoopsModules/randomquote/branches/mamba/randomquote/admin/index.php 2014-07-11 17:18:50 UTC (rev 12702)
@@ -0,0 +1,31 @@
+<?php
+/**
+ * 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-2013 The XOOPS Project
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @version $Id$
+ * @link http://sourceforge.net/projects/xoops/
+ * @since 2.0.0
+ */
+
+include_once __DIR__ . '/admin_header.php';
+//count "total citas"
+$count_quotes = $quotesHandler->getCount();
+// InfoBox citas
+$adminMenu->addInfoBox(_AM_RANDOMQUOTE_STATISTICS);
+// InfoBox citas
+$adminMenu->addInfoBoxLine(_AM_RANDOMQUOTE_STATISTICS, _AM_RANDOMQUOTE_THEREARE_CITAS, $count_quotes);
+// Render Index
+echo $adminMenu->addNavigation("index.php");
+echo $adminMenu->renderIndex();
+include_once __DIR__ . '/admin_footer.php';
Property changes on: XoopsModules/randomquote/branches/mamba/randomquote/admin/index.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/randomquote/branches/mamba/randomquote/admin/main.php
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/admin/main.php (rev 0)
+++ XoopsModules/randomquote/branches/mamba/randomquote/admin/main.php 2014-07-11 17:18:50 UTC (rev 12702)
@@ -0,0 +1,148 @@
+<?php
+/**
+ * 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-2013 The XOOPS Project
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @version $Id$
+ * @link http://sourceforge.net/projects/xoops/
+ * @since 2.0.0
+ */
+
+include_once __DIR__ . '/admin_header.php';
+//It recovered the value of argument op in URL$
+$op = cleanVarsRandomquote($_REQUEST, 'op', 'list', 'string');
+switch ($op) {
+ case "list":
+ default:
+ echo $adminMenu->addNavigation('main.php');
+ $adminMenu->addItemButton(_AM_RANDOMQUOTE_NEWCITAS, 'main.php?op=new_quote', 'add');
+ echo $adminMenu->renderButton('left');
+ $criteria = new CriteriaCompo();
+ $criteria->setSort("id");
+ $criteria->setOrder("ASC");
+ $numrows = $quotesHandler->getCount();
+ $quotes_arr = $quotesHandler->getall($criteria);
+
+ //Table view
+ if ($numrows > 0) {
+ echo "<table width='100%' cellspacing='1' class='outer'>
+ <tr>
+ <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_QUOTE . "</th>
+ <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_AUTHOR . "</th>
+ <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_STATUS . "</th>
+ <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_WAITING . "</th>
+ <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_ONLINE . "</th>
+
+ <th align='center' width='10%'>" . _AM_RANDOMQUOTE_FORMACTION . "</th>
+ </tr>";
+
+ $class = "odd";
+
+ foreach (array_keys($quotes_arr) as $i) {
+ if ($quotes_arr[$i]->getVar("quotes_pid") == 0) {
+ echo "<tr class='" . $class . "'>";
+ $class = ($class == "even") ? "odd" : "even";
+ echo "<td>" . $quotes_arr[$i]->getVar("quote") . "</td>";
+ echo "<td align=\"center\">" . $quotes_arr[$i]->getVar("author") . "</td>";
+
+ $verif_quote_status = ($quotes_arr[$i]->getVar("quote_status") == 1) ? _YES : _NO;
+ echo "<td align=\"center\">" . $verif_quote_status . "</td>";
+
+ $verif_quote_waiting = ($quotes_arr[$i]->getVar("quote_waiting") == 1) ? _YES : _NO;
+ echo "<td align=\"center\">" . $verif_quote_waiting . "</td>";
+
+ $verif_quote_online = ($quotes_arr[$i]->getVar("quote_online") == 1) ? _YES : _NO;
+ echo "<td align=\"center\">" . $verif_quote_online . "</td>";
+
+ echo "<td align='center' width='10%'>
+ <a href='main.php?op=edit_quote&id=" . $quotes_arr[$i]->getVar("id") . "'><img src=" . $pathIcon16 . "/edit.png alt='" . _EDIT . "' title='" . _EDIT . "'></a>
+ <a href='main.php?op=delete_quote&id=" . $quotes_arr[$i]->getVar("id") . "'><img src=" . $pathIcon16 . "/delete.png alt='" . _DELETE . "' title='" . _DELETE . "'></a>
+ </td>";
+ echo "</tr>";
+ }
+ }
+ echo "</table><br /><br />";
+ }
+
+ break;
+ case "new_quote":
+ echo $adminMenu->addNavigation("main.php");
+ $adminMenu->addItemButton(_AM_RANDOMQUOTE_QUOTESLIST, 'main.php?op=list', 'list');
+ echo $adminMenu->renderButton('left');
+
+ $obj =& $quotesHandler->create();
+ $form = $obj->getForm();
+ $form->display();
+ break;
+ case "save_quote":
+ if (!$GLOBALS["xoopsSecurity"]->check()) {
+ redirect_header("main.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ }
+ if (isset($_REQUEST["id"])) {
+ $obj =& $quotesHandler->get($_REQUEST["id"]);
+ } else {
+ $obj =& $quotesHandler->create();
+ }
+
+ //Form texto
+ $obj->setVar("quote", $_REQUEST["quote"]);
+ //Form autor
+ $obj->setVar("author", $_REQUEST["author"]);
+ //Form quote_status
+ $verif_quote_status = ($_REQUEST["quote_status"] == 1) ? "1" : "0";
+ $obj->setVar("quote_status", $verif_quote_status);
+ //Form quote_waiting
+ $verif_quote_waiting = ($_REQUEST["quote_waiting"] == 1) ? "1" : "0";
+ $obj->setVar("quote_waiting", $verif_quote_waiting);
+ //Form quote_online
+ $verif_quote_online = ($_REQUEST["quote_online"] == 1) ? "1" : "0";
+ $obj->setVar("quote_online", $verif_quote_online);
+
+ if ($quotesHandler->insert($obj)) {
+ redirect_header("main.php?op=list", 2, _AM_RANDOMQUOTE_FORMOK);
+ }
+
+ echo $obj->getHtmlErrors();
+ $form =& $obj->getForm();
+ $form->display();
+ break;
+ case "edit_quote":
+ echo $adminMenu->addNavigation("main.php");
+ $adminMenu->addItemButton(_AM_RANDOMQUOTE_NEWCITAS, 'main.php?op=new_quote', 'add');
+ $adminMenu->addItemButton(_AM_RANDOMQUOTE_QUOTESLIST, 'main.php?op=list', 'list');
+ echo $adminMenu->renderButton('left');
+ $obj = $quotesHandler->get($_REQUEST["id"]);
+ $form = $obj->getForm();
+ $form->display();
+ break;
+ case "delete_quote":
+ $obj =& $quotesHandler->get($_REQUEST["id"]);
+ if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) {
+ if (!$GLOBALS["xoopsSecurity"]->check()) {
+ redirect_header("main.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ }
+ if ($quotesHandler->delete($obj)) {
+ redirect_header("main.php", 3, _AM_RANDOMQUOTE_FORMDELOK);
+ } else {
+ echo $obj->getHtmlErrors();
+ }
+ } else {
+ xoops_confirm(
+ array("ok" => 1, "id" => $_REQUEST["id"], "op" => "delete_quote"),
+ $_SERVER["REQUEST_URI"],
+ sprintf(_AM_RANDOMQUOTE_FORMSUREDEL, $obj->getVar("quote"))
+ );
+ }
+ break;
+}
+include_once __DIR__ . '/admin_footer.php';
Property changes on: XoopsModules/randomquote/branches/mamba/randomquote/admin/main.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/randomquote/branches/mamba/randomquote/admin/menu.php
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/admin/menu.php (rev 0)
+++ XoopsModules/randomquote/branches/mamba/randomquote/admin/menu.php 2014-07-11 17:18:50 UTC (rev 12702)
@@ -0,0 +1,39 @@
+<?php
+/**
+ * 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-2013 The XOOPS Project
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @version $Id$
+ * @link http://sourceforge.net/projects/xoops/
+ * @since 2.0.0
+ */
+
+$dirname = basename(dirname(__DIR__));
+$module_handler =& xoops_gethandler("module");
+$xoopsModule =& XoopsModule::getByDirname($dirname);
+$moduleInfo =& $module_handler->get($xoopsModule->getVar("mid"));
+$pathIcon32 = $moduleInfo->getInfo("icons32");
+$adminmenu = array();
+$i = 1;
+$adminmenu[$i]["title"] = _MI_RANDOMQUOTE_ADMENU1;
+$adminmenu[$i]["link"] = "admin/index.php";
+$adminmenu[$i]["icon"] = $pathIcon32 . "/home.png";
+++$i;
+$adminmenu[$i]["title"] = _MI_RANDOMQUOTE_ADMENU2;
+$adminmenu[$i]["link"] = "admin/main.php";
+$adminmenu[$i]["icon"] = $pathIcon32 . "/content.png";
+++$i;
+$adminmenu[$i]["title"] = _MI_RANDOMQUOTE_ADMENU3;
+$adminmenu[$i]["link"] = "admin/about.php";
+$adminmenu[$i]["icon"] = $pathIcon32 . "/about.png";
+unset($i);
Property changes on: XoopsModules/randomquote/branches/mamba/randomquote/admin/menu.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/randomquote/branches/mamba/randomquote/assets/css/index.html
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/assets/css/index.html (rev 0)
+++ XoopsModules/randomquote/branches/mamba/randomquote/assets/css/index.html 2014-07-11 17:18:50 UTC (rev 12702)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
Added: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/arrow.gif
===================================================================
(Binary files differ)
Index: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/arrow.gif
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/arrow.gif 2014-07-11 10:35:55 UTC (rev 12701)
+++ XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/arrow.gif 2014-07-11 17:18:50 UTC (rev 12702)
Property changes on: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/arrow.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/index.html
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/index.html (rev 0)
+++ XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/index.html 2014-07-11 17:18:50 UTC (rev 12702)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
Added: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/off.png
===================================================================
(Binary files differ)
Index: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/off.png
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/off.png 2014-07-11 10:35:55 UTC (rev 12701)
+++ XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/off.png 2014-07-11 17:18:50 UTC (rev 12702)
Property changes on: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/off.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/on.png
===================================================================
(Binary files differ)
Index: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/on.png
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/on.png 2014-07-11 10:35:55 UTC (rev 12701)
+++ XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/on.png 2014-07-11 17:18:50 UTC (rev 12702)
Property changes on: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/icons/on.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/index.html
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/assets/images/index.html (rev 0)
+++ XoopsModules/randomquote/branches/mamba/randomquote/assets/images/index.html 2014-07-11 17:18:50 UTC (rev 12702)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
Added: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/bg.png
===================================================================
(Binary files differ)
Index: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/bg.png
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/bg.png 2014-07-11 10:35:55 UTC (rev 12701)
+++ XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/bg.png 2014-07-11 17:18:50 UTC (rev 12702)
Property changes on: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/bg.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/index.html
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/index.html (rev 0)
+++ XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/index.html 2014-07-11 17:18:50 UTC (rev 12702)
@@ -0,0 +1 @@
+<script type="text/javascript">history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/left_both.png
===================================================================
(Binary files differ)
Index: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/left_both.png
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/left_both.png 2014-07-11 10:35:55 UTC (rev 12701)
+++ XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/left_both.png 2014-07-11 17:18:50 UTC (rev 12702)
Property changes on: XoopsModules/randomquote/branches/mamba/randomquote/assets/images/menu/left_both.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsMod...
[truncated message content] |
|
From: <zy...@us...> - 2014-12-08 20:18:19
|
Revision: 12889
http://sourceforge.net/p/xoops/svn/12889
Author: zyspec
Date: 2014-12-08 20:18:04 +0000 (Mon, 08 Dec 2014)
Log Message:
-----------
- Require PHP 5.3 & XOOPS 2.5.7+
- Significant security improvements for all vars passed from forms
- Replaced cleanVarsRandomquote with XoopsRequest
- removed need for ./include/config.php
- fixed typo in ./docs/licencs file name to license.txt
- General code (& comment) cleanup
- added module search capability
- added support for XOOPS Tag module
- added date quote was created to database
- removed "day" block - can be accomplished setting quote cache
Modified Paths:
--------------
XoopsModules/randomquote/branches/zyspec/randomquote/admin/about.php
XoopsModules/randomquote/branches/zyspec/randomquote/admin/admin_footer.php
XoopsModules/randomquote/branches/zyspec/randomquote/admin/admin_header.php
XoopsModules/randomquote/branches/zyspec/randomquote/admin/index.php
XoopsModules/randomquote/branches/zyspec/randomquote/admin/main.php
XoopsModules/randomquote/branches/zyspec/randomquote/admin/menu.php
XoopsModules/randomquote/branches/zyspec/randomquote/blocks/views.php
XoopsModules/randomquote/branches/zyspec/randomquote/class/quotes.php
XoopsModules/randomquote/branches/zyspec/randomquote/docs/changelog.txt
XoopsModules/randomquote/branches/zyspec/randomquote/docs/install.txt
XoopsModules/randomquote/branches/zyspec/randomquote/header.php
XoopsModules/randomquote/branches/zyspec/randomquote/include/config.php
XoopsModules/randomquote/branches/zyspec/randomquote/include/functions.php
XoopsModules/randomquote/branches/zyspec/randomquote/include/install.php
XoopsModules/randomquote/branches/zyspec/randomquote/include/update.php
XoopsModules/randomquote/branches/zyspec/randomquote/include/waiting.plugin.php
XoopsModules/randomquote/branches/zyspec/randomquote/index.php
XoopsModules/randomquote/branches/zyspec/randomquote/language/english/admin.php
XoopsModules/randomquote/branches/zyspec/randomquote/language/english/blocks.php
XoopsModules/randomquote/branches/zyspec/randomquote/language/english/help/help.html
XoopsModules/randomquote/branches/zyspec/randomquote/language/english/main.php
XoopsModules/randomquote/branches/zyspec/randomquote/language/english/modinfo.php
XoopsModules/randomquote/branches/zyspec/randomquote/sql/mysql.sql
XoopsModules/randomquote/branches/zyspec/randomquote/templates/admin/randomquote_admin_help.tpl
XoopsModules/randomquote/branches/zyspec/randomquote/templates/blocks/randomquote_quotes_block_day.tpl
XoopsModules/randomquote/branches/zyspec/randomquote/templates/blocks/randomquote_quotes_block_random.tpl
XoopsModules/randomquote/branches/zyspec/randomquote/templates/blocks/randomquote_quotes_block_recent.tpl
XoopsModules/randomquote/branches/zyspec/randomquote/templates/randomquote_header.tpl
XoopsModules/randomquote/branches/zyspec/randomquote/templates/randomquote_index.tpl
XoopsModules/randomquote/branches/zyspec/randomquote/xoops_version.php
Added Paths:
-----------
XoopsModules/randomquote/branches/zyspec/
XoopsModules/randomquote/branches/zyspec/randomquote/
XoopsModules/randomquote/branches/zyspec/randomquote/docs/license.txt
Removed Paths:
-------------
XoopsModules/randomquote/branches/zyspec/randomquote/class/forms/
XoopsModules/randomquote/branches/zyspec/randomquote/docs/licencs.txt
Modified: XoopsModules/randomquote/branches/zyspec/randomquote/admin/about.php
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/admin/about.php 2014-11-26 07:33:36 UTC (rev 12873)
+++ XoopsModules/randomquote/branches/zyspec/randomquote/admin/about.php 2014-12-08 20:18:04 UTC (rev 12889)
@@ -1,18 +1,23 @@
<?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-2013 The XOOPS Project
- * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package randomquote
+ * @author XOOPS Module Development Team
+ * @author Mamba
+ * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project}
+ * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
* @version $Id$
* @link http://sourceforge.net/projects/xoops/
* @since 2.0.0
Modified: XoopsModules/randomquote/branches/zyspec/randomquote/admin/admin_footer.php
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/admin/admin_footer.php 2014-11-26 07:33:36 UTC (rev 12873)
+++ XoopsModules/randomquote/branches/zyspec/randomquote/admin/admin_footer.php 2014-12-08 20:18:04 UTC (rev 12889)
@@ -1,26 +1,36 @@
<?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-2013 The XOOPS Project
- * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package randomquote
+ * @author XOOPS Module Development Team
+ * @author Mamba
+ * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project}
+ * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
* @version $Id$
* @link http://sourceforge.net/projects/xoops/
* @since 2.0.0
*/
-echo "<div align='center'><a href='http://www.xoops.org' target='_blank'>
- <img src='" . $pathIcon32 . "/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a></div>";
-echo "<div class='center smallsmall italic pad5'>
- <strong>" . $xoopsModule->getVar('name') . "</strong> " . _AM_RANDOMQUOTE_MAINTAINEDBY . "
- <a href='http://xoops.org' title='Visit Support Forum' class='tooltip' rel='external'>Support Forum</a></div>";
+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();
Modified: XoopsModules/randomquote/branches/zyspec/randomquote/admin/admin_header.php
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/admin/admin_header.php 2014-11-26 07:33:36 UTC (rev 12873)
+++ XoopsModules/randomquote/branches/zyspec/randomquote/admin/admin_header.php 2014-12-08 20:18:04 UTC (rev 12889)
@@ -1,53 +1,57 @@
<?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-2013 The XOOPS Project
- * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package randomquote
+ * @author XOOPS Module Development Team
+ * @author Mamba
+ * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project}
+ * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
* @version $Id$
* @link http://sourceforge.net/projects/xoops/
* @since 2.0.0
*/
+$thisDirname = basename(dirname(__DIR__));
+
include_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
-include_once XOOPS_ROOT_PATH . '/include/cp_header.php';
-include_once '../include/config.php';
-include_once '../include/functions.php';
+include_once $GLOBALS['xoops']->path('/include/cp_header.php');
+//include_once $GLOBALS['xoops']->path("modules/{$thisDirname}/include/config.php");
+include_once $GLOBALS['xoops']->path("modules/{$thisDirname}/include/functions.php");
-$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
+XoopsLoad::load('xoopsrequest');
+XoopsLoad::load('quotes', $thisDirname);
+XoopsLoad::load('constants', $thisDirname);
-$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
-$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
-$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
-//load handlers
-$quotesHandler =& xoops_getModuleHandler('quotes', $thisDirname);
+$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', $thisDirname);
$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);
-}
+require_once "{$pathModuleAdmin}/moduleadmin/moduleadmin.php";
+
xoops_cp_header();
$adminMenu = new ModuleAdmin();
Modified: XoopsModules/randomquote/branches/zyspec/randomquote/admin/index.php
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/admin/index.php 2014-11-26 07:33:36 UTC (rev 12873)
+++ XoopsModules/randomquote/branches/zyspec/randomquote/admin/index.php 2014-12-08 20:18:04 UTC (rev 12889)
@@ -1,18 +1,23 @@
<?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-2013 The XOOPS Project
- * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package randomquote
+ * @author XOOPS Module Development Team
+ * @author Mamba
+ * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project}
+ * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
* @version $Id$
* @link http://sourceforge.net/projects/xoops/
* @since 2.0.0
@@ -26,6 +31,6 @@
// InfoBox citas
$adminMenu->addInfoBoxLine(_AM_RANDOMQUOTE_STATISTICS, _AM_RANDOMQUOTE_THEREARE_CITAS, $count_quotes);
// Render Index
-echo $adminMenu->addNavigation("index.php");
+echo $adminMenu->addNavigation('index.php');
echo $adminMenu->renderIndex();
include_once __DIR__ . '/admin_footer.php';
Modified: XoopsModules/randomquote/branches/zyspec/randomquote/admin/main.php
===================================================================
--- XoopsModules/randomquote/branches/mamba/randomquote/admin/main.php 2014-11-26 07:33:36 UTC (rev 12873)
+++ XoopsModules/randomquote/branches/zyspec/randomquote/admin/main.php 2014-12-08 20:18:04 UTC (rev 12889)
@@ -1,82 +1,96 @@
<?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-2013 The XOOPS Project
- * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package randomquote
+ * @author XOOPS Module Development Team
+ * @author Mamba
+ * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project}
+ * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
* @version $Id$
* @link http://sourceforge.net/projects/xoops/
* @since 2.0.0
*/
include_once __DIR__ . '/admin_header.php';
-//It recovered the value of argument op in URL$
-$op = cleanVarsRandomquote($_REQUEST, 'op', 'list', 'string');
+
+//xoops_load('xoopsrequest');
+
+$op = XoopsRequest::getCmd('op', '');
+//$op = cleanVarsRandomquote($_REQUEST, 'op', '', 'string');
switch ($op) {
case "list":
default:
echo $adminMenu->addNavigation('main.php');
$adminMenu->addItemButton(_AM_RANDOMQUOTE_NEWCITAS, 'main.php?op=new_quote', 'add');
- echo $adminMenu->renderButton('left');
+ echo $adminMenu->renderButton('right');
$criteria = new CriteriaCompo();
- $criteria->setSort("id");
- $criteria->setOrder("ASC");
- $numrows = $quotesHandler->getCount();
- $quotes_arr = $quotesHandler->getall($criteria);
+ if (isset($_REQUEST['status'])) {
+ $status = XoopsRequest::getInt('status', RandomquoteConstants::STATUS_ONLINE);
+ $criteria->add(new Criteria('status', $status));
+ } else {
+ $criteria->setSort('id');
+ }
+ $criteria->setOrder('ASC');
+ $quotesObjArray = $quotesHandler->getAll($criteria);
+ $quoteCount = (!empty($quotesObjArray) ? count($quotesObjArray) : 0);
+// $quoteCount = $quotesHandler->getCount();
//Table view
- if ($numrows > 0) {
- echo "<table width='100%' cellspacing='1' class='outer'>
- <tr>
- <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_QUOTE . "</th>
- <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_AUTHOR . "</th>
- <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_STATUS . "</th>
- <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_WAITING . "</th>
- <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_ONLINE . "</th>
+ if ($quoteCount) {
+ echo "<table class='width100 outer' cellspacing='1'>\n"
+ . " <thead>\n"
+ . " <tr>\n"
+ . " <th class='txtcenter'>" . _AM_RANDOMQUOTE_QUOTES_QUOTE . "</th>\n"
+ . " <th class='txtcenter'>" . _AM_RANDOMQUOTE_QUOTES_AUTHOR . "</th>\n"
+ . " <th class='txtcenter'>" . _AM_RANDOMQUOTE_QUOTES_STATUS . "</th>\n"
+ . " <th class='txtcenter width10'>" . _AM_RANDOMQUOTE_FORMACTION . "</th>\n"
+ . " </tr>\n"
+ . " </thead>\n"
+ . " <tbody>\n";
- <th align='center' width='10%'>" . _AM_RANDOMQUOTE_FORMACTION . "</th>
- </tr>";
+ $class = 'even';
- $class = "odd";
-
- foreach (array_keys($quotes_arr) as $i) {
- if ($quotes_arr[$i]->getVar("quotes_pid") == 0) {
- echo "<tr class='" . $class . "'>";
- $class = ($class == "even") ? "odd" : "even";
- echo "<td>" . $quotes_arr[$i]->getVar("quote") . "</td>";
- echo "<td align=\"center\">" . $quotes_arr[$i]->getVar("author") . "</td>";
-
- $verif_quote_status = ($quotes_arr[$i]->getVar("quote_status") == 1) ? _YES : _NO;
- echo "<td align=\"center\">" . $verif_quote_status . "</td>";
-
- $verif_quote_waiting = ($quotes_arr[$i]->getVar("quote_waiting") == 1) ? _YES : _NO;
- echo "<td align=\"center\">" . $verif_quote_waiting . "</td>";
-
- $verif_quote_online = ($quotes_arr[$i]->getVar("quote_online") == 1) ? _YES : _NO;
- echo "<td align=\"center\">" . $verif_quote_online . "</td>";
-
- echo "<td align='center' width='10%'>
- <a href='main.php?op=edit_quote&id=" . $quotes_arr[$i]->getVar("id") . "'><img src=" . $pathIcon16 . "/edit.png alt='" . _EDIT . "' title='" . _EDIT . "'></a>
- <a href='main.php?op=delete_quote&id=" . $quotes_arr[$i]->getVar("id") . "'><img src=" . $pathIcon16 . "/delete.png alt='" . _DELETE . "' title='" . _DELETE . "'></a>
- </td>";
- echo "</tr>";
- }
+ $statusIcons = array(RandomquoteConstants::STATUS_OFFLINE => array('image' => 'off.png', 'text' => _AM_RANDOMQUOTE_QUOTES_OFFLINE),
+ RandomquoteConstants::STATUS_ONLINE => array('image' => 'on.png', 'text' => _AM_RANDOMQUOTE_QUOTES_ONLINE),
+ RandomquoteConstants::STATUS_WAITING => array('image' => 'warning.png', 'text' => _AM_RANDOMQUOTE_QUOTES_WAITING)
+ );
+ foreach($quotesObjArray as $quoteObj) {
+// foreach (array_keys($quotes_arr) as $i) {
+ $class = ('even' == $class) ? 'odd' : 'even';
+ $thisStatus = $quoteObj->getVar('quote_status');
+ $quote_status_link = "<img src='{$pathIcon16}/{$statusIcons[$thisStatus]['image']}'"
+ . " alt='{$statusIcons[$thisStatus]['text']}'"
+ . " title='{$statusIcons[$thisStatus]['text']}' />";
+ echo " <tr class='{$class}'>\n"
+ . " <td>" . $quoteObj->getVar('quote') . "</td>\n"
+ . " <td class='txtcenter width20'>" . $quoteObj->getVar('author') . "</td>\n"
+ . " <td class='txtcenter width10'>" . $quote_status_link . "</td>\n"
+ . " <td class='txtcenter width10'>\n"
+ . " <a href='main.php?op=edit_quote&id=" . $quoteObj->getVar('id') . "'><img src='{$pathIcon16}/edit.png' alt='" . _EDIT . "' title='" . _EDIT . "' /></a>\n"
+ . " <a href='main.php?op=delete_quote&id=" . $quoteObj->getVar('id') . "'><img src='{$pathIcon16}/delete.png' alt='" . _DELETE . "' title='" . _DELETE . "' /></a>\n"
+ . " </td>\n"
+ . " </tr>\n";
}
- echo "</table><br /><br />";
+ echo " </tbody>\n"
+ . "</table><br /><br />\n";
}
break;
- case "new_quote":
- echo $adminMenu->addNavigation("main.php");
+
+ case 'new_quote':
+ echo $adminMenu->addNavigation('main.php');
$adminMenu->addItemButton(_AM_RANDOMQUOTE_QUOTESLIST, 'main.php?op=list', 'list');
echo $adminMenu->renderButton('left');
@@ -84,63 +98,112 @@
$form = $obj->getForm();
$form->display();
break;
- case "save_quote":
- if (!$GLOBALS["xoopsSecurity"]->check()) {
- redirect_header("main.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+
+ case 'save_quote':
+ // check to make sure this passes form submission security
+ if (($GLOBALS['xoopsSecurity'] instanceof XoopsSecurity)) {
+ if ( !$GLOBALS['xoopsSecurity']->check()) {
+ // failed xoops security check
+ redirect_header($_SERVER['PHP_SELF'], RandomquoteConstants::REDIRECT_DELAY_MEDIUM, $GLOBALS['xoopsSecurity']->getErrors(true));
+ exit();
+ }
+ } else {
+ redirect_header('index.php', RandomquoteConstants::REDIRECT_DELAY_MEDIUM, _MD_RANDOMQUOTE_INVALID_SECURITY_TOKEN);
}
- if (isset($_REQUEST["id"])) {
- $obj =& $quotesHandler->get($_REQUEST["id"]);
+
+ $input = new stdClass; // setup input array
+
+ $input->id = XoopsRequest::getInt('id', RandomquoteConstants::DEFAULT_ID, 'POST');
+ $input->quote = XoopsRequest::getString('quote', '', 'POST');
+ $input->author = XoopsRequest::getString('author', '', 'POST');
+ $input->item_tag = XoopsRequest::getString('item_tag', '', 'POST');
+
+ $verify_quote_status = XoopsRequest::getInt('quote_status', RandomquoteConstants::STATUS_OFFLINE, 'POST');
+ $input->quote_status = (in_array($verify_quote_status, array(RandomquoteConstants::STATUS_ONLINE, RandomquoteConstants::STATUS_OFFLINE, RandomquoteConstants::STATUS_WAITING))) ? $verify_quote_status : RandomquoteConstants::STATUS_OFFLINE;
+
+ if (!empty($input->id)) {
+ $obj = $quotesHandler->get($input->id);
+ $add_msg = _AM_RANDOMQUOTE_FORM_UPDATE_OK;
} else {
- $obj =& $quotesHandler->create();
+ $obj = $quotesHandler->create();
+ $add_msg = _AM_RANDOMQUOTE_FORM_ADD_OK;
}
- //Form texto
- $obj->setVar("quote", $_REQUEST["quote"]);
- //Form autor
- $obj->setVar("author", $_REQUEST["author"]);
- //Form quote_status
- $verif_quote_status = ($_REQUEST["quote_status"] == 1) ? "1" : "0";
- $obj->setVar("quote_status", $verif_quote_status);
- //Form quote_waiting
- $verif_quote_waiting = ($_REQUEST["quote_waiting"] == 1) ? "1" : "0";
- $obj->setVar("quote_waiting", $verif_quote_waiting);
- //Form quote_online
- $verif_quote_online = ($_REQUEST["quote_online"] == 1) ? "1" : "0";
- $obj->setVar("quote_online", $verif_quote_online);
+ $obj->setVars(array('quote' => $input->quote,
+ 'author' => $input->author,
+ 'quote_status' => $input->quote_status)
+ );
- if ($quotesHandler->insert($obj)) {
- redirect_header("main.php?op=list", 2, _AM_RANDOMQUOTE_FORMOK);
+ if ($objId = $quotesHandler->insert($obj)) {
+// $module_handler =& xoops_gethandler('module');
+ $tagModule =& XoopsModule::getByDirname('tag');
+ if (($tagModule instanceof XoopsModule) && ($tagModule->isactive())) {
+ $tag_handler =& xoops_getmodulehandler('tag', 'tag');
+ $tag_handler->updateByItem($input->item_tag, $objId, $thisDirname, 0);
+ }
+ redirect_header("main.php?op=list", RandomquoteConstants::REDIRECT_DELAY_MEDIUM, $add_msg);
}
echo $obj->getHtmlErrors();
$form =& $obj->getForm();
$form->display();
break;
- case "edit_quote":
- echo $adminMenu->addNavigation("main.php");
+
+ case 'edit_quote':
+ echo $adminMenu->addNavigation('main.php');
$adminMenu->addItemButton(_AM_RANDOMQUOTE_NEWCITAS, 'main.php?op=new_quote', 'add');
$adminMenu->addItemButton(_AM_RANDOMQUOTE_QUOTESLIST, 'main.php?op=list', 'list');
echo $adminMenu->renderButton('left');
- $obj = $quotesHandler->get($_REQUEST["id"]);
+ $id = XoopsRequest::getInt('id', RandomquoteConstants::DEFAULT_ID);
+// $id = cleanVarsRandomquote($_POST, 'id', RandomquoteConstants::DEFAULT_ID, 'int');
+ if (empty($id)) {
+ redirect_header($_SERVER['PHP_SELF'] . "&op=new_quote");
+ }
+ $obj = $quotesHandler->get($id);
$form = $obj->getForm();
$form->display();
break;
- case "delete_quote":
- $obj =& $quotesHandler->get($_REQUEST["id"]);
- if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) {
- if (!$GLOBALS["xoopsSecurity"]->check()) {
- redirect_header("main.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+
+ case 'delete_quote':
+ $request_ok = XoopsRequest::getInt('ok', RandomquoteConstants::CONFIRM_NOT_OK, 'POST');
+ $id = XoopsRequest::getInt('id', RandomquoteConstants::DEFAULT_ID);
+// $request_ok = cleanVarsRandomquote($_POST, 'ok', RandomquoteConstants::CONFIRM_NOT_OK, 'int');
+// $id = cleanVarsRandomquote($_REQUEST, 'id', RandomquoteConstants::DEFAULT_ID, 'int');
+ if ($request_ok) {
+ // check to make sure this passes form submission security
+ if (($GLOBALS['xoopsSecurity'] instanceof XoopsSecurity)) {
+ if ( !$GLOBALS['xoopsSecurity']->check()) {
+ // failed xoops security check
+ redirect_header($_SERVER['PHP_SELF'], RandomquoteConstants::REDIRECT_DELAY_MEDIUM, $GLOBALS['xoopsSecurity']->getErrors(true));
+ exit();
+ }
+ } else {
+ redirect_header('index.php', RandomquoteConstants::REDIRECT_DELAY_MEDIUM, _MD_RANDOMQUOTE_INVALID_SECURITY_TOKEN);
}
- if ($quotesHandler->delete($obj)) {
- redirect_header("main.php", 3, _AM_RANDOMQUOTE_FORMDELOK);
+ $obj =& $quotesHandler->get($id);
+ if (($obj instanceof RandomquoteQuotes)) {
+ $item_id = $obj->getVar('id');
+ if ($quotesHandler->delete($obj)) {
+ // now clear out items in tag module for this item
+ $module_handler =& xoops_gethandler('module');
+ $tagModule =& XoopsModule::getByDirname('tag');
+ if (($tagModule instanceof XoopsModule) && ($tagModule->isactive())) {
+ $tag_handler =& xoops_getmodulehandler('tag', 'tag');
+ $tag_handler->updateByItem(array(), $item_id, $thisDirname); //clear all tags for this item
+ }
+ redirect_header($_SERVER['PHP_SELF'], RandomquoteConstants::REDIRECT_DELAY_MEDIUM, _AM_RANDOMQUOTE_FORMDELOK);
+ } else {
+ echo $obj->getHtmlErrors();
+ }
} else {
- echo $obj->getHtmlErrors();
+ redirect_header($_SERVER['PHP_SELF'], RandomquoteConstants::REDIRECT_DELAY_MEDIUM, _AM_RANDOMQUOTE_INVALID_QUOTE_ID);
}
} else {
+ $obj = $quotesHandler->get($id);
xoops_confirm(
- array("ok" => 1, "id" => $_REQUEST["id"], "op" => "delete_quote"),
- $_SERVER["REQUEST_URI"],
- sprintf(_AM_RANDOMQUOTE_FORMSUREDEL, $obj->getVar("quote"))
+ array(...
[truncated message content] |