|
From: <zy...@us...> - 2014-12-22 19:32:26
|
Revision: 12913
http://sourceforge.net/p/xoops/svn/12913
Author: zyspec
Date: 2014-12-22 19:32:22 +0000 (Mon, 22 Dec 2014)
Log Message:
-----------
- sanitized various ids passed into method/functions to reduce security vulnerability
- added module preference setting to remove admin impressions and clicks from banner count
- added module preference setting to set maximum file upload size
- added ability to change banner status from Admin banner edit page
- added banner and image directory removal on uninstall
- added additional banner categories for industry standard size banners
- moved images, css, & js to assets subdirectory
- moved mimetypes.inc.php from ./class to ./include directory where it belongs
- converted dirname(__FILE__) to __DIR__
- removed files for permissions & block management (functionality previously removed), uses XOOPS standard methods
- removed/commented english language defines that are no longer used
- removed RwbannerAbout class as it's no longer used. Module now uses XOOPS standard method to display module info
- fixed bug if installed in directory other than default preload could not determine if module is active
- re-arranged admin code and tabs to make operations more intuitive
- updated Admin help to reflect operation & usage changes
- minor code & comment cleanup to improve performance & maintainability
Modified Paths:
--------------
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/about.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/admin.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/admin_footer.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/admin_header.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/blocksadmin.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/exibe.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/import.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/index.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/main.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/menu.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/upgrade.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/blocks/ajaxbanner.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/blocks/banner.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/blocks/dropinbanner.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/blocks/estatisticas.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/blocks/lightboxbanner.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/blocks/popadbanner.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/class/FlashHeader.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/class/about.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/class/class.banner.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/class/class.categoria.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/class/class.tags.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/conta_click.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/docs/LEIAME (2).TXT
XoopsModules/rw_banner/branches/zyspec/rwbanner/docs/LEIAME.TXT
XoopsModules/rw_banner/branches/zyspec/rwbanner/docs/LISEZMOI.TXT
XoopsModules/rw_banner/branches/zyspec/rwbanner/docs/README (2).TXT
XoopsModules/rw_banner/branches/zyspec/rwbanner/docs/changelog.txt
XoopsModules/rw_banner/branches/zyspec/rwbanner/docs/header.php_com_hack_rwbanner.txt
XoopsModules/rw_banner/branches/zyspec/rwbanner/docs/header.php_com_hack_rwbanner_french.txt
XoopsModules/rw_banner/branches/zyspec/rwbanner/docs/install.txt
XoopsModules/rw_banner/branches/zyspec/rwbanner/docs/readme.txt
XoopsModules/rw_banner/branches/zyspec/rwbanner/include/bbcode.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/include/functions.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/include/getajaxbanner.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/include/maketags.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/index.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/inser.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/language/english/admin.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/language/english/blocks.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/language/english/help/help.html
XoopsModules/rw_banner/branches/zyspec/rwbanner/language/english/main.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/language/english/modinfo.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/preloads/core.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/sql/mysql.sql
XoopsModules/rw_banner/branches/zyspec/rwbanner/xoops_version.php
Added Paths:
-----------
XoopsModules/rw_banner/branches/zyspec/
XoopsModules/rw_banner/branches/zyspec/rwbanner/
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/banners.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/categories.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/tags.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/assets/
XoopsModules/rw_banner/branches/zyspec/rwbanner/assets/css/
XoopsModules/rw_banner/branches/zyspec/rwbanner/assets/images/
XoopsModules/rw_banner/branches/zyspec/rwbanner/assets/index.html
XoopsModules/rw_banner/branches/zyspec/rwbanner/assets/js/
XoopsModules/rw_banner/branches/zyspec/rwbanner/include/mimetypes.inc.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/templates/blocks/block_ajax_banner.tpl
XoopsModules/rw_banner/branches/zyspec/rwbanner/templates/blocks/block_banner.tpl
XoopsModules/rw_banner/branches/zyspec/rwbanner/templates/blocks/block_dropin_banner.tpl
XoopsModules/rw_banner/branches/zyspec/rwbanner/templates/blocks/block_estatisticas_banner.tpl
XoopsModules/rw_banner/branches/zyspec/rwbanner/templates/blocks/block_lightbox_banner.tpl
XoopsModules/rw_banner/branches/zyspec/rwbanner/templates/blocks/block_popad_banner.tpl
Removed Paths:
-------------
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/about2.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/admin_header2.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/inser.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/insercateg.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/insertag.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/myblockform.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/myblocksadmin.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/mygroupperm.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/mygrouppermform.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/perm.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/permissions.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/permissions2.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/class/mimetypes.inc.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/css/
XoopsModules/rw_banner/branches/zyspec/rwbanner/images/
XoopsModules/rw_banner/branches/zyspec/rwbanner/include/blocksadmin.inc.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/include/gtickets.php
XoopsModules/rw_banner/branches/zyspec/rwbanner/js/
XoopsModules/rw_banner/branches/zyspec/rwbanner/templates/blocks/block_ajax_banner.html
XoopsModules/rw_banner/branches/zyspec/rwbanner/templates/blocks/block_banner.html
XoopsModules/rw_banner/branches/zyspec/rwbanner/templates/blocks/block_dropin_banner.html
XoopsModules/rw_banner/branches/zyspec/rwbanner/templates/blocks/block_estatisticas_banner.html
XoopsModules/rw_banner/branches/zyspec/rwbanner/templates/blocks/block_lightbox_banner.html
XoopsModules/rw_banner/branches/zyspec/rwbanner/templates/blocks/block_popad_banner.html
Modified: XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/about.php
===================================================================
--- XoopsModules/rw_banner/trunk/rwbanner/admin/about.php 2014-10-13 19:09:46 UTC (rev 12815)
+++ XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/about.php 2014-12-22 19:32:22 UTC (rev 12913)
@@ -1,5 +1,5 @@
<?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
@@ -7,14 +7,16 @@
* 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 The XOOPS Project (http://www.xoops.org)
- * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
- * @author XOOPS Development Team
- * @version $Id $
+ */
+/**
+ * @package:: rwbanner
+ * @copyright:: {@link http://www.xoops.org The XOOPS Project}
+ * @license:: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
+ * @author:: XOOPS Module Development Team
+ * @version:: $Id: $
**/
-include_once dirname(__FILE__) . '/admin_header.php';
+include_once __DIR__ . '/admin_header.php';
xoops_cp_header();
@@ -23,4 +25,4 @@
echo $aboutAdmin->addNavigation('about.php');
echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false);
-include 'admin_footer.php';
\ No newline at end of file
+include __DIR__ . '/admin_footer.php';
Deleted: XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/about2.php
===================================================================
--- XoopsModules/rw_banner/trunk/rwbanner/admin/about2.php 2014-10-13 19:09:46 UTC (rev 12815)
+++ XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/about2.php 2014-12-22 19:32:22 UTC (rev 12913)
@@ -1,36 +0,0 @@
-<?php
-// ------------------------------------------------------------------------ //
-// RW-Banner //
-// Copyright (c) 2006 BrInfo //
-// <http://www.brinfo.com.br> //
-// ------------------------------------------------------------------------ //
-// This program is free software; you can redistribute it and/or modify //
-// it under the terms of the GNU General Public License as published by //
-// the Free Software Foundation; either version 2 of the License, or //
-// (at your option) any later version. //
-// //
-// 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. See the //
-// GNU General Public License for more details. //
-// //
-// You should have received a copy of the GNU General Public License //
-// along with this program; if not, write to the Free Software //
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
-// ------------------------------------------------------------------------- //
-// Author: Rodrigo Pereira Lima (BrInfo - Soluções Web) //
-// Site: http://www.brinfo.com.br //
-// Project: RW-Banner //
-// Descrição: Sistema de gerenciamento de mídias publicitárias //
-// ------------------------------------------------------------------------- //
-
-include_once("admin_header.php");
-
-include_once("../class/about.php");
-$aboutObj = new RwbannerAbout(_AM_RWBANNER_ABOUT);
-$aboutObj->render();
Modified: XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/admin.php
===================================================================
--- XoopsModules/rw_banner/trunk/rwbanner/admin/admin.php 2014-10-13 19:09:46 UTC (rev 12815)
+++ XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/admin.php 2014-12-22 19:32:22 UTC (rev 12913)
@@ -1,154 +1,163 @@
<?php
-// ------------------------------------------------------------------------ //
-// RW-Banner //
-// Copyright (c) 2006 BrInfo //
-// <http://www.brinfo.com.br> //
-// ------------------------------------------------------------------------ //
-// This program is free software; you can redistribute it and/or modify //
-// it under the terms of the GNU General Public License as published by //
-// the Free Software Foundation; either version 2 of the License, or //
-// (at your option) any later version. //
-// //
-// 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. See the //
-// GNU General Public License for more details. //
-// //
-// You should have received a copy of the GNU General Public License //
-// along with this program; if not, write to the Free Software //
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
-// ------------------------------------------------------------------------- //
-// Author: Rodrigo Pereira Lima (BrInfo - Soluções Web) //
-// Site: http://www.brinfo.com.br //
-// Project: RW-Banner //
-// Descrição: Sistema de gerenciamento de mídias publicitárias //
-// ------------------------------------------------------------------------- //
+/*
+ RW-Banner
+ Copyright (c) 2006 BrInfo
+ <http://www.brinfo.com.br>
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-$admin_mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+ 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.
-$fct = empty( $_POST['fct'] ) ? '' : trim( $_POST['fct'] ) ;
-$fct = empty( $_GET['fct'] ) ? $fct : trim( $_GET['fct'] ) ;
-if( empty( $fct ) ) $fct = 'preferences' ;
+ 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. See the
+ GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+/**
+ * XOOPS rwbanner Banner Click Redirect page
+ *
+ * @package:: rwbanner
+ * @copyright:: {@link www.brinfo.com.br BrInfo - Soluções Web}
+ * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
+ * @author:: Rodrigo Pereira Lima aka RpLima (http://www.brinfo.com.br)
+ * @since:: 1.0
+ * @version:: $Id $
+ *
+ */
+$admin_mydirname = basename(dirname(__DIR__));
+
+$fct = XoopsRequest::getString('fct', 'preferences');
+$fct = trim($fct);
+/*
+$fct = empty($_POST['fct']) ? 'preferences' : trim($_POST['fct']);
+$fct = empty($_GET['fct']) ? $fct : trim($_GET['fct']);
+*/
+
include "../../../mainfile.php";
-include XOOPS_ROOT_PATH."/include/cp_functions.php";
-include_once XOOPS_ROOT_PATH."/kernel/module.php";
-include_once "../include/gtickets.php" ;// GIJ
+include $GLOBALS['xoops']->path("/include/cp_functions.php");
+include_once $GLOBALS['xoops']->path("/kernel/module.php");
$admintest = 0;
-if (is_object($xoopsUser)) {
- $xoopsModule =& XoopsModule::getByDirname("system");
- if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
- redirect_header(XOOPS_URL.'/user.php',3,_MD_RWBANNER_NOPERM);
- exit();
- }
- $admintest=1;
+if ($GLOBALS['xoopsUser'] instanceof XoopsUser) {
+ $GLOBALS['xoopsModule'] =& XoopsModule::getByDirname('system');
+ if (!$GLOBALS['xoopsUser']->isAdmin($GLOBALS['xoopsModule']->mid()) ) {
+ redirect_header($GLOBALS['xoops']->url('www/user.php'), 3, _MD_RWBANNER_NOPERM);
+ exit();
+ }
+ $admintest = 1;
} else {
- redirect_header(XOOPS_URL.'/user.php',3,_MD_RWBANNER_NOPERM);
- exit();
+ redirect_header($GLOBALS['xoops']->url('www/user.php'), 3, _MD_RWBANNER_NOPERM);
+ exit();
}
// include system category definitions
-include_once XOOPS_ROOT_PATH."/modules/system/constants.php";
+include_once $GLOBALS['xoops']->path('modules/system/constants.php');
$error = false;
-if ($admintest != 0) {
- if (isset($fct) && $fct != '') {
- if (file_exists(XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/xoops_version.php")) {
- if ( file_exists(XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin.php") ) {
- include XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin.php";
- } else {
- include XOOPS_ROOT_PATH."/modules/system/language/english/admin.php";
- }
- if (file_exists(XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin/".$fct.".php")) {
- include XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin/".$fct.".php";
- } elseif (file_exists(XOOPS_ROOT_PATH."/modules/system/language/english/admin/".$fct.".php")) {
- include XOOPS_ROOT_PATH."/modules/system/language/english/admin/".$fct.".php";
- }
- include XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/xoops_version.php";
- $sysperm_handler =& xoops_gethandler('groupperm');
- $category = !empty($modversion['category']) ? intval($modversion['category']) : 0;
- unset($modversion);
- if ($category > 0) {
- $groups =& $xoopsUser->getGroups();
- if (in_array(XOOPS_GROUP_ADMIN, $groups) || false != $sysperm_handler->checkRight('system_admin', $category, $groups, $xoopsModule->getVar('mid'))){
-// if (file_exists(XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/main.php")) {
-// include_once XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/main.php"; GIJ
- if (file_exists("../include/{$fct}.inc.php")) {
- include_once "../include/{$fct}.inc.php" ;
- } else {
- $error = true;
- }
- } else {
- $error = true;
- }
- } elseif ($fct == 'version') {
- if (file_exists(XOOPS_ROOT_PATH."/modules/system/admin/version/main.php")) {
- include_once XOOPS_ROOT_PATH."/modules/system/admin/version/main.php";
- } else {
- $error = true;
- }
- } else {
- $error = true;
- }
- } else {
- $error = true;
- }
- } else {
- $error = true;
- }
+if (0 != $admintest) {
+ if ('' != $fct) {
+ if (file_exists($GLOBALS['xoops']->path("modules/system/admin/{$fct}/xoops_version.php"))) {
+ xoops_loadLanguage('admin', 'system');
+/*
+ if (file_exists($GLOBALS['xoops']->path("modules/system/language/{$GLOBALS['xoopsConfig']['language']}/admin.php"))) {
+ include $GLOBALS['xoops']->path("modules/system/language/{$GLOBALS['xoopsConfig']['language']}/admin.php");
+ } else {
+ include $GLOBALS['xoops']->path('modules/system/language/english/admin.php');
+ }
+*/
+ if (file_exists($GLOBALS['xoops']->path("modules/system/language/{$GLOBALS['xoopsConfig']['language']}/admin/{$fct}.php"))) {
+ include $GLOBALS['xoops']->path("modules/system/language/{$GLOBALS['xoopsConfig']['language']}/admin/{$fct}.php");
+ } elseif (file_exists($GLOBALS['xoops']->path("modules/system/language/english/admin/{$fct}.php"))) {
+ include $GLOBALS['xoops']->path("modules/system/language/english/admin/{$fct}.php");
+ }
+ include $GLOBALS['xoops']->path("modules/system/admin/{$fct}/xoops_version.php");
+ $sysperm_handler =& xoops_gethandler('groupperm');
+ $category = !empty($modversion['category']) ? intval($modversion['category']) : 0;
+ unset($modversion);
+ if ($category > 0) {
+ $groups =& $GLOBALS['xoopsUser']->getGroups();
+ if (in_array(XOOPS_GROUP_ADMIN, $groups) || false != $sysperm_handler->checkRight('system_admin', $category, $groups, $GLOBALS['xoopsModule']->getVar('mid'))) {
+// if (file_exists(XOOPS_ROOT_PATH."modules/system/admin/".$fct."/main.php")) {
+// include_once XOOPS_ROOT_PATH."modules/system/admin/".$fct."/main.php"; GIJ
+ if (file_exists("../include/{$fct}.inc.php")) {
+ include_once "../include/{$fct}.inc.php";
+ } else {
+ $error = true;
+ }
+ } else {
+ $error = true;
+ }
+ } elseif ('version' == $fct) {
+ if (file_exists($GLOBALS['xoops']->path('modules/system/admin/version/main.php'))) {
+ include_once $GLOBALS['xoops']->path('modules/system/admin/version/main.php');
+ } else {
+ $error = true;
+ }
+ } else {
+ $error = true;
+ }
+ } else {
+ $error = true;
+ }
+ } else {
+ $error = true;
+ }
}
if (false != $error) {
- xoops_cp_header();
- echo "<h4>System Configuration</h4>";
- echo '<table class="outer" cellpadding="4" cellspacing="1">';
- echo '<tr>';
- $groups = $xoopsUser->getGroups();
- $all_ok = false;
- if (!in_array(XOOPS_GROUP_ADMIN, $groups)) {
- $sysperm_handler =& xoops_gethandler('groupperm');
- $ok_syscats =& $sysperm_handler->getItemIds('system_admin', $groups);
- } else {
- $all_ok = true;
- }
- $admin_dir = XOOPS_ROOT_PATH."/modules/system/admin";
- $handle = opendir($admin_dir);
- $counter = 0;
- $class = 'even';
- while ($file = readdir($handle)) {
- if (strtolower($file) != 'cvs' && !preg_match("/[.]/", $file) && is_dir($admin_dir.'/'.$file)) {
- include $admin_dir.'/'.$file.'/xoops_version.php';
- if ($modversion['hasAdmin']) {
- $category = isset($modversion['category']) ? intval($modversion['category']) : 0;
- if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) {
- echo "<td class='$class' align='center' valign='bottom' width='19%'>";
- echo "<a href='".XOOPS_URL."/modules/system/admin.php?fct=".$file."'><b>" .trim($modversion['name'])."</b></a>\n";
- echo "</td>";
- $counter++;
- $class = ($class == 'even') ? 'odd' : 'even';
- }
- if ( $counter > 4 ) {
- $counter = 0;
- echo "</tr>";
- echo "<tr>";
- }
- }
- unset($modversion);
- }
- }
- while ($counter < 5) {
- echo '<td class="'.$class.'"> </td>';
- $class = ($class == 'even') ? 'odd' : 'even';
- $counter++;
- }
- echo '</tr></table>';
+ xoops_cp_header();
+ echo "<h4>System Configuration</h4>\n";
+ echo "<table class='outer' cellpadding='4' cellspacing='1'>\n";
+ echo "<tr>\n";
+ $groups = $GLOBALS['xoopsUser']->getGroups();
+ $all_ok = false;
+ if (!in_array(XOOPS_GROUP_ADMIN, $groups)) {
+ $sysperm_handler =& xoops_gethandler('groupperm');
+ $ok_syscats =& $sysperm_handler->getItemIds('system_admin', $groups);
+ } else {
+ $all_ok = true;
+ }
+ $admin_dir = $GLOBALS['xoops']->path('modules/system/admin');
+ $handle = opendir($admin_dir);
+ $counter = 0;
+ $class = 'even';
+ while ($file = readdir($handle)) {
+ if (strtolower($file) != 'cvs' && !preg_match("/[.]/", $file) && is_dir($admin_dir.'/'.$file)) {
+ include $admin_dir.'/'.$file.'/xoops_version.php';
+ if ($modversion['hasAdmin']) {
+ $category = isset($modversion['category']) ? intval($modversion['category']) : 0;
+ if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) {
+ echo "<td class='$class' align='center' valign='bottom' width='19%'>\n";
+ echo " <a href='" . $GLOBALS['xoops']->buildUrl("modules/system/admin.php", array('fct'=>$file)) . "'><b>" . trim($modversion['name']) . "</b></a>\n";
+ echo "</td>\n";
+ ++$counter;
+ $class = ('even' == $class) ? 'odd' : 'even';
+ }
+ if ($counter > 4) {
+ $counter = 0;
+ echo "</tr>\n";
+ echo "<tr>\n";
+ }
+ }
+ unset($modversion);
+ }
+ }
+ while ($counter < 5) {
+ echo "<td class='{$class}'> </td>\n";
+ $class = ('even' == $class) ? 'odd' : 'even';
+ ++$counter;
+ }
+ echo '</tr></table>';
xoops_cp_footer();
}
Modified: XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/admin_footer.php
===================================================================
--- XoopsModules/rw_banner/trunk/rwbanner/admin/admin_footer.php 2014-10-13 19:09:46 UTC (rev 12815)
+++ XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/admin_footer.php 2014-12-22 19:32:22 UTC (rev 12913)
@@ -1,10 +1,26 @@
<?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.
+ */
+/**
+ * @package:: rwbanner
+ * @copyright:: {@link http://www.xoops.org The XOOPS Project}
+ * @license:: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
+ * @author:: XOOPS Module Development Team
+ * @version:: $Id: $
+ **/
global $pathIcon32;
echo "<div class='adminfooter'>\n"
- ." <div style='text-align: center;'>\n"
- ." <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"
- ." </div>\n"
- ." " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n"
- ."</div>";
+ . " <div class='txtcenter'>\n"
+ . " <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"
+ . " </div>\n"
+ . " " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n"
+ . "</div>\n";
-xoops_cp_footer();
\ No newline at end of file
+xoops_cp_footer();
Modified: XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/admin_header.php
===================================================================
--- XoopsModules/rw_banner/trunk/rwbanner/admin/admin_header.php 2014-10-13 19:09:46 UTC (rev 12815)
+++ XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/admin_header.php 2014-12-22 19:32:22 UTC (rev 12913)
@@ -11,42 +11,41 @@
* @copyright The XOOPS Project (http://www.xoops.org)
* @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
* @author XOOPS Development Team
- * @version $Id $
+ * @version $Id: $
**/
-$path = dirname(dirname(dirname(dirname(__FILE__))));
-include_once $path . '/mainfile.php';
-include_once $path . '/header.php';
-include_once $path . '/include/cp_functions.php';
-require_once $path . '/include/cp_header.php';
+require_once "../../../include/cp_header.php";
+include_once $GLOBALS['xoops']->path('/mainfile.php');
+include_once $GLOBALS['xoops']->path('/header.php');
+include_once $GLOBALS['xoops']->path('/include/cp_functions.php');
-include_once $path . "/kernel/module.php";
-include_once $path . "/class/xoopstree.php";
-include_once $path . "/class/xoopslists.php";
-include_once $path . "/class/xoopsformloader.php";
-include_once $path . '/class/pagenav.php';
+include_once $GLOBALS['xoops']->path('/kernel/module.php');
+include_once $GLOBALS['xoops']->path('/class/xoopstree.php');
+include_once $GLOBALS['xoops']->path('/class/xoopslists.php');
+include_once $GLOBALS['xoops']->path('/class/xoopsformloader.php');
+include_once $GLOBALS['xoops']->path('/class/pagenav.php');
-$dirname = basename(dirname(dirname(__FILE__)));
+$path = dirname(dirname(dirname(__DIR__)));
+$dirname = basename(dirname(__DIR__));
$module_handler = xoops_gethandler('module');
$module = $module_handler->getByDirname($dirname);
-if (is_object($xoopsUser)) {
- $xoopsModule = XoopsModule::getByDirname($dirname);
- if (!$xoopsUser->isAdmin($xoopsModule->mid())) {
- redirect_header(XOOPS_URL . "/", 1, _MD_RWBANNER_NOPERM);
+if (is_object($GLOBALS['xoopsUser'])) {
+ $GLOBALS['xoopsModule'] = XoopsModule::getByDirname($dirname);
+ if (!$GLOBALS['xoopsUser']->isAdmin($GLOBALS['xoopsModule']->mid())) {
+ redirect_header($GLOBALS['xoops']->url('www'), 1, _MD_RWBANNER_NOPERM);
exit();
}
} else {
- redirect_header(XOOPS_URL . "/", 1, _MD_RWBANNER_NOPERM);
+ redirect_header($GLOBALS['xoops']->url('www'), 1, _MD_RWBANNER_NOPERM);
exit();
}
-global $xoopsModule;
//$thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname');
//if functions.php file exist
-require_once dirname(dirname(__FILE__)) . '/include/functions.php';
+require_once dirname(__DIR__) . '/include/functions.php';
$myts =& MyTextSanitizer::getInstance();
//$xoopsTpl->assign('module_dir', $module->getVar('dirname'));
@@ -56,12 +55,12 @@
xoops_loadLanguage('modinfo', $dirname);
xoops_loadLanguage('main', $dirname);
-$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
-$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
-$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
+$pathIcon16 = '../' . $GLOBALS['xoopsModule']->getInfo('icons16');
+$pathIcon32 = '../' . $GLOBALS['xoopsModule']->getInfo('icons32');
+$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
-if (file_exists($GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php'))) {
- include_once $GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php');
+if (file_exists($GLOBALS['xoops']->path("{$pathModuleAdmin}/moduleadmin.php"))) {
+ include_once $GLOBALS['xoops']->path("{$pathModuleAdmin}/moduleadmin.php");
} else {
- redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
+ redirect_header($GLOBALS['xoops']->path('admin.php'), 5, _AM_MODULEADMIN_MISSING, false);
}
\ No newline at end of file
Deleted: XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/admin_header2.php
===================================================================
--- XoopsModules/rw_banner/trunk/rwbanner/admin/admin_header2.php 2014-10-13 19:09:46 UTC (rev 12815)
+++ XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/admin_header2.php 2014-12-22 19:32:22 UTC (rev 12913)
@@ -1,62 +0,0 @@
-<?php
-// ------------------------------------------------------------------------ //
-// RW-Banner //
-// Copyright (c) 2006 BrInfo //
-// <http://www.brinfo.com.br> //
-// ------------------------------------------------------------------------ //
-// This program is free software; you can redistribute it and/or modify //
-// it under the terms of the GNU General Public License as published by //
-// the Free Software Foundation; either version 2 of the License, or //
-// (at your option) any later version. //
-// //
-// 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. See the //
-// GNU General Public License for more details. //
-// //
-// You should have received a copy of the GNU General Public License //
-// along with this program; if not, write to the Free Software //
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
-// ------------------------------------------------------------------------- //
-// Author: Rodrigo Pereira Lima (BrInfo - Soluções Web) //
-// Site: http://www.brinfo.com.br //
-// Project: RW-Banner //
-// Descrição: Sistema de gerenciamento de mídias publicitárias //
-// ------------------------------------------------------------------------- //
-
-$path = dirname(dirname(dirname(dirname(__FILE__))));
-include_once $path . '/mainfile.php';
-include_once $path . '/include/cp_header.php';
-include_once $path ."/kernel/module.php";
-include_once $path ."/class/xoopstree.php";
-include_once $path ."/class/xoopslists.php";
-include_once $path ."/class/xoopsformloader.php";
-include_once $path .'/class/pagenav.php';
-
-if (is_object($xoopsUser)){
- $dirname = basename(dirname(dirname(__FILE__)));
- $module_handler = xoops_gethandler('module');
- $module = $module_handler->getByDirname($dirname);
- if (!$xoopsUser->isAdmin($module->mid())){
- redirect_header(XOOPS_URL."/",1,_MD_RWBANNER_NOPERM);
- exit();
- }
-}else{
- redirect_header(XOOPS_URL."/",1,_MD_RWBANNER_NOPERM);
- exit();
-}
-
-include_once XOOPS_ROOT_PATH."/modules/".$module->dirname()."/include/functions.php";
-
-if ( file_exists("../language/".$xoopsConfig['language']."/modinfo.php") ) {
- include("../language/".$xoopsConfig['language']."/modinfo.php");
-} else {
- include("../language/english/modinfo.php");
-}
-
-$myts =& MyTextSanitizer::getInstance();
Copied: XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/banners.php (from rev 12815, XoopsModules/rw_banner/trunk/rwbanner/admin/inser.php)
===================================================================
--- XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/banners.php (rev 0)
+++ XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/banners.php 2014-12-22 19:32:22 UTC (rev 12913)
@@ -0,0 +1,374 @@
+<?php
+/*
+ RW-Banner
+ Copyright (c) 2006 BrInfo
+ <http://www.brinfo.com.br>
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ 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. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+/**
+ *
+ * @copyright:: {@link www.brinfo.com.br BrInfo - Soluções Web}
+ * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
+ * @author:: Rodrigo Pereira Lima aka RpLima (http://www.brinfo.com.br)
+ * @package:: rwbanner
+ * @version:: $Id: $
+ *
+ */
+
+
+include __DIR__ . '/admin_header.php';
+
+include_once $GLOBALS['xoops']->path('/include/cp_functions.php');
+
+include_once $GLOBALS['xoops']->path('/class/uploader.php');
+include_once "../class/class.banner.php";
+
+$local_folder = $GLOBALS['xoopsModuleConfig']['dir_images'];
+$op = XoopsRequest::getCmd('op', '');
+$op = (isset($_POST['post'])) ? 'grava' : $op;
+$id = XoopsRequest::getInt('id', 0);
+$form = XoopsRequest::getArray('form', array(), 'POST');
+
+switch ($op) {
+ case 'grava':
+ $form['usarhtml'] = (isset($form['usarhtml'])) ? $form['usarhtml'] : 0;
+ $form['maxexib'] = (isset($form['maxexibe'])) ? $form['maxexibe'] : 0;
+ $form['maxclick'] = (isset($form['maxclick'])) ? $form['maxclick'] : 0;
+ $form['periodo'] = (isset($form['periodo'])) ? $form['periodo'] : 0;
+ $form['showimg'] = 1;
+
+ $data = date("y:m:d h:i:s");
+ if ('' == $form['grafico']) {
+ //Start the file upload routine
+ $maxfilesize = $GLOBALS['xoopsModuleConfig']['max_upload_sz'];
+ $uploader = new XoopsMediaUploader($local_folder, include_once $GLOBALS['xoops']->path('modules/'.$GLOBALS['xoopsModule']->dirname().'/include/mimetypes.inc.php'), $maxfilesize);
+ $upload_file_count = count($_POST["xoops_upload_file"]);
+ for ($i = 0; $i < $upload_file_count; ++$i) {
+ if ($uploader->fetchMedia($_POST["xoops_upload_file"][$i])) {
+ if (!$uploader->upload()) {
+ redirect_header('index.php',2,$uploader->getErrors());
+ } else {
+ $file_name = $uploader->getSavedFileName();
+ }
+ }
+ }
+ //Fim da rotina de upload de arquivo
+ $upfolder = substr($local_folder, strlen($GLOBALS['xoops']->path('www')), strlen($local_folder) + 1);
+ $form['grafico'] = (1 != $form['usarhtml']) ? $GLOBALS['xoops']->url("www/{$upfolder}/{$file_name}") : '';
+ }
+
+ $banner = new RWbanners($form);
+
+ if (_ADD == $_POST['value']) {
+ if ($banner->grava()) {
+ redirect_header('index.php', 2, _AM_RWBANNER_MSG8);
+ } else {
+ redirect_header('index.php', 2, _AM_RWBANNER_MSG10 . "<br />" . $banner->getError());
+ }
+ } elseif (_EDIT == $_POST['value']) {
+ if ($banner->getStatus() == 2 && $banner->getCategoria() != 0) {
+ $banner->setStatus(1);
+ }
+ if ($banner->edita()) {
+ redirect_header('index.php', 2, _AM_RWBANNER_MSG2);
+ } else {
+ redirect_header('index.php', 2, _AM_RWBANNER_MSG11 . "<br />" . $banner->getError());
+ }
+ } else {
+ redirect_header('index.php', 2, _AM_RWBANNER_MSG10);
+ }
+ break;
+ case 'editar':
+ xoops_cp_header();
+ // rwbanner_adminMenu('',_AM_RWBANNER_TITLE21.' '.$id);
+ $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix('rw_banner') . " WHERE codigo={$id}";
+ $query = $GLOBALS['xoopsDB']->query($sql);
+ $form = $GLOBALS['xoopsDB']->fetchArray($query);
+ //echo '<br><br><br><br><br><br>';
+ monta_form(_EDIT);
+ xoops_cp_footer();
+ break;
+ case 'criar':
+ xoops_cp_header();
+ // rwbanner_adminMenu(3,_AM_RWBANNER_VALUE_BTN1);
+ $indexAdmin = new ModuleAdmin();
+ echo $indexAdmin->addNavigation('banners.php');
+ //echo '<br><br><br><br><br><br>';
+ monta_form(_ADD);
+ xoops_cp_footer();
+ break;
+ default:
+ require_once dirname(__DIR__) . "/include/admin_list_functions.inc.php";
+ $limit = $GLOBALS['xoopsModuleConfig']['total_reg_index'];
+ $order = XoopsRequest::getString('order', 'codigo', 'GET');
+ $seq = XoopsRequest::getString('seq', 'ASC', 'GET');
+ $start = XoopsRequest::getInt('start', 0, 'GET');
+ xoops_cp_header();
+ $indexAdmin = new ModuleAdmin();
+ echo $indexAdmin->addNavigation('banners.php');
+ $indexAdmin->addItemButton(_AM_RWBANNER_VALUE_BTN1, 'banners.php' . '?op=criar', $icon = 'add');
+ echo $indexAdmin->renderButton();
+ lista_banners($order, $seq, null, $limit, $start, true);
+ xoops_cp_footer();
+ break;
+}
+
+function monta_form($value) {
+ global $form, $file_name;
+ include_once $GLOBALS['xoops']->path('/class/xoopsformloader.php');
+
+ echo '
+ <script>
+ function vai(){
+ if (document.getElementById(\'banner\').value != ""){
+ document.getElementById(\'form[grafico]\').value = "";
+ }
+ return true;
+ }
+ </script>
+ ';
+
+ $form_title = (_EDIT == $value) ? _AM_RWBANNER_VALUE_BTN3 : _AM_RWBANNER_VALUE_BTN1;
+
+ // initialize form variables for new banners
+ if (empty($form)) {
+ $form = array('idcliente' => 0,
+ 'categoria' => 0,
+ 'maxexib' => 0,
+ 'maxclick' => 0,
+ 'periodo' => 0,
+ 'grafico' => '',
+ 'url' => '',
+ 'usarhtml' => 0,
+ 'htmlcode' => '',
+ 'target' => '_blank',
+ 'showimg' => 1,
+ 'codigo' => 0,
+ 'status' => 1,
+ 'obs' => ''
+ );
+ }
+
+ $banner_form = new XoopsThemeForm($form_title, "form", "banners.php", "post", false);
+ $banner_form->setExtra('enctype="multipart/form-data"');
+ $banner_id = new XoopsFormLabel(_AM_RWBANNER_TITLE2 . ':', $form['codigo']);
+ //now select status
+ $banner_status = new XoopsFormRadio(_AM_RWBANNER_TAG_TITLE18, 'form[status]', $form['status'], '<br />');
+ $banner_status->addOptionArray(array('0' => _AM_RWBANNER_BANNER_STATUS2,
+ '2' => _AM_RWBANNER_BANNER_STATUS3,
+ '1' => _AM_RWBANNER_BANNER_STATUS1)
+ );
+
+ $user_selbox = new XoopsFormSelectUser(_AM_RWBANNER_TITLE22, 'form[idcliente]', false, $form['idcliente']);
+ $categ_selbox = new XoopsFormSelect(_AM_RWBANNER_TITLE23, 'form[categoria]', $form['categoria']);
+ $categ_selbox->addOption('rodrigo', '--------');
+ $js = 'var campo = document.getElementById("form[categoria]");
+ if (campo.value == \'rodrigo\'){
+ alert("' . _AM_RWBANNER_SELECT_CAT . '");
+ campo.focus();
+ return false;
+ }';
+ if (method_exists( $categ_selbox, 'getEspecValid' )) {
+ $categ_selbox->setEspecValid($js);
+ }
+ $query = "SELECT titulo, cod FROM ".$GLOBALS['xoopsDB']->prefix("rw_categorias");
+ $consulta = $GLOBALS['xoopsDB']->queryF($query);
+ while (list($titulo,$cod) = $GLOBALS['xoopsDB']->fetchRow($consulta)) {
+ $categ_selbox->addOption($cod, $titulo);
+ }
+
+ if (0 == $form['maxexib']) {
+ $exibe = _AM_RWBANNER_UNLIMIT;
+ $check = 'checked';
+ $disa = 'disabled';
+ } else {
+ $exibe = $form['maxexib'];
+ $check = '';
+ $disa = '';
+ }
+ $label = new XoopsFormElementTray(_AM_RWBANNER_TITLE24,'');
+ $max = new XoopsFormText('', "form[maxexibe]", 10, 255, $exibe);
+ $max->setExtra($disa);
+ echo '
+ <script>
+ function checa(){
+ if (document.getElementById(\'form[maxexibe]\').disabled == false){
+ document.getElementById(\'form[maxexibe]\').disabled = true;
+ document.getElementById(\'form[maxexibe]\').value = "'._AM_RWBANNER_BTN_OP3.'";
+ }else{
+ document.getElementById(\'form[maxexibe]\').disabled = false;
+ document.getElementById(\'form[maxexibe]\').value = "";
+ document.getElementById(\'form[maxexibe]\').focus();
+ }
+ }
+ </script>
+ ';
+ $ilimitado = new XoopsFormCheckBox('',_AM_RWBANNER_BTN_OP3);
+ $ilimitado->setExtra('onClick="javascript:checa();" '.$check);
+ $ilimitado->addOption(1,_AM_RWBANNER_BTN_OP3);
+ if (0 == $form['maxclick']) {
+ $exibe1 = _AM_RWBANNER_UNLIMIT;
+ $check1 = 'checked';
+ $disa1 = 'disabled';
+ } else {
+ $exibe1 = $form['maxclick'];
+ $check1 = '';
+ $disa1 = '';
+ }
+ $label1 = new XoopsFormElementTray(_AM_RWBANNER_TITLE500,'');
+ $maxclick = new XoopsFormText('', "form[maxclick]", 10, 255, $exibe1);
+ $maxclick->setExtra($disa1);
+ echo '
+ <script>
+ function checa1(){
+ if (document.getElementById(\'form[maxclick]\').disabled == false){
+ document.getElementById(\'form[maxclick]\').disabled = true;
+ document.getElementById(\'form[maxclick]\').value = "'._AM_RWBANNER_BTN_OP3.'";
+ }else{
+ document.getElementById(\'form[maxclick]\').disabled = false;
+ document.getElementById(\'form[maxclick]\').value = "";
+ document.getElementById(\'form[maxclick]\').focus();
+ }
+ }
+ </script>
+ ';
+ $ilimitado1 = new XoopsFormCheckBox('',_AM_RWBANNER_BTN_OP3);
+ $ilimitado1->setExtra('onClick="javascript:checa1();" '.$check1);
+ $ilimitado1->addOption(1,_AM_RWBANNER_BTN_OP3);
+ if (0 == $form['periodo']) {
+ $exibe2 = _AM_RWBANNER_UNLIMIT;
+ $check2 = 'checked';
+ $disa2 = 'disabled';
+ } else {
+ $exibe2 = $form['periodo'];
+ $check2 = '';
+ $disa2 = '';
+ }
+ $label2 = new XoopsFormElementTray(_AM_RWBANNER_TITLE5001,'');
+ $periodo = new XoopsFormText('', "form[periodo]", 10, 255, $exibe2);
+ $periodo->setExtra($disa2);
+ echo '
+ <script>
+ function checa2(){
+ if (document.getElementById(\'form[periodo]\').disabled == false){
+ document.getElementById(\'form[periodo]\').disabled = true;
+ document.getElementById(\'form[periodo]\').value = "'._AM_RWBANNER_BTN_OP3.'";
+ }else{
+ document.getElementById(\'form[periodo]\').disabled = false;
+ document.getElementById(\'form[periodo]\').value = "";
+ document.getElementById(\'form[periodo]\').focus();
+ }
+ }
+ </script>
+ ';
+ $ilimitado2 = new XoopsFormCheckBox('',_AM_RWBANNER_BTN_OP3);
+ $ilimitado2->setExtra('onClick="javascript:checa2();" '.$check2);
+ $ilimitado2->addOption(1,_AM_RWBANNER_BTN_OP3);
+ $imagem = new XoopsFormText(_AM_RWBANNER_TITLE25, "form[grafico]", 45, 255, $form['grafico']);
+ $js = '
+ var campo = document.getElementById("form[grafico]");
+ var campo1 = document.getElementById("banner");
+ if (campo.value == \'\' && campo1.value == \'\'){
+ alert("' . _AM_RWBANNER_ENTER_IMAGE . '");
+ campo.focus();
+ return false;
+ }';
+ if (method_exists( $imagem, 'getEspecValid' )) {
+ $imagem->setEspecValid($js);
+ }
+ $max_size = $GLOBALS['xoopsModuleConfig']['max_upload_sz'];
+ $file_box = new XoopsFormFile(_AM_RWBANNER_TITLE51_ED, "banner", $max_size);
+ $file_box->setExtra('size ="45" onChange="vai();"');
+ $file_box->setDescription($file_name);
+ $link = new XoopsFormText(_AM_RWBANNER_TITLE26, "form[url]", 45, 255, $form['url']);
+
+ echo '
+ <script>
+ function checar(){
+ if (document.getElementById(\'form[htmlcode]\').disabled == false){
+ document.getElementById(\'form[htmlcode]\').disabled = true;
+ }else{
+ document.getElementById(\'form[htmlcode]\').disabled = false;
+ document.getElementById(\'form[htmlcode]\').focus();
+ }
+ }
+ </script>
+ ';
+
+ $usarhtml = new XoopsFormCheckBox(_AM_RWBANNER_TITLE27, 'form[usarhtml]', $form['usarhtml']);
+ $usarhtml->setExtra('onChange="javascript:checar();"');
+ $usarhtml->addOption(1,_YES);
+ $htmlcode = new XoopsFormTextArea(_AM_RWBANNER_TITLE28,'form[htmlcode]', $form['htmlcode']);
+ if (1 != $form['usarhtml']) {
+ $htmlcode->setExtra('disabled');
+ }
+ $target_selbox = new XoopsFormSelect(_AM_RWBANNER_TITLE29, 'form[target]', $form['target']);
+ $target_selbox->addOption('_blank', '_blank');
+ $target_selbox->addOption('_self', '_self');
+ $target_selbox->addOption('_parent', '_parent');
+ $target_selbox->addOption('_top', '_top');
+ $button_tray = new XoopsFormElementTray('', '');
+ if ($value == _EDIT) {
+ $id = new XoopsFormHidden('form[codigo]', $form['codigo']);
+// $status = new XoopsFormHidden('form[status]', $form['status']);
+ }
+ $submit_btn = new XoopsFormButton('', 'post', _SUBMIT, 'submit');
+ if ($value == _EDIT && 2 == $form['status']) {
+ $obs = new XoopsFormTextArea(_AM_RWBANNER_TITLE5000, 'form[obs]', $form['obs']);
+ $obs->setDescription(_AM_RWBANNER_TITLE5000_DESC);
+ }
+ //render the form
+ if ($form['codigo']) {
+ $banner_form->addElement($banner_id);
+ }
+ $banner_form->addElement($banner_status);
+ $banner_form->addElement($user_selbox);
+ $banner_form->addElement($categ_selbox);
+ if (method_exists($categ_selbox, 'getEspecValid')) {
+ $banner_form->setRequired($categ_selbox);
+ }
+ $label->addElement($max);
+ $label->addElement($ilimitado);
+ $banner_form->addElement($label);
+ $label1->addElement($maxclick);
+ $label1->addElement($ilimitado1);
+ $banner_form->addElement($label1);
+ $label2->addElement($periodo);
+ $label2->addElement($ilimitado2);
+ $banner_form->addElement($label2);
+ $banner_form->addElement($imagem);
+ if (method_exists( $imagem, 'getEspecValid' )) {
+ $banner_form->setRequired($imagem);
+ }
+ $banner_form->addElement($file_box);
+ $banner_form->addElement($link);
+ $banner_form->addElement($usarhtml);
+ $banner_form->addElement($htmlcode);
+ $banner_form->addElement($target_selbox);
+ if ($value == _EDIT && 2 == $form['status']) {
+ $banner_form->addElement($obs);
+ }
+ $button_tray->addElement($submit_btn);
+ $banner_form->addElement($button_tray);
+ $banner_form->addElement($id);
+ $banner_form->addElement($status);
+ $banner_form->addElement(new XoopsFormHidden('value', $value));
+ $banner_form->display();
+}
Modified: XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/blocksadmin.php
===================================================================
--- XoopsModules/rw_banner/trunk/rwbanner/admin/blocksadmin.php 2014-10-13 19:09:46 UTC (rev 12815)
+++ XoopsModules/rw_banner/branches/zyspec/rwbanner/admin/blocksadmin.php 2014-12-22 19:32:22 UTC (rev 12913)
@@ -11,13 +11,13 @@
### =============================================================
### $Id: blocksadmin.php,v 1.3 2007/06/16 22:40:09 kleber Exp $
### =============================================================
-include_once("admin_header.php");
-if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) {
+include_once __DIR__ . '/admin_header.php';
+if (!is_object($GLOBALS['xoopsUser']) || !is_object($GLOBALS['xoopsModule']) || !$GLOBALS['xoopsUser']->isAdmin($GLOBALS['xoopsModule']->mid())) {
exit(MPU_ADM2_403);
}
-if ($xoopsUser->isAdmin($xoopsModule->mid())) {
- include_once XOOPS_ROOT_PATH . '/class/xoopsblock.php';
- $op = "list";
+if ($GLOBALS['xoopsUser']->isAdmin($GLOBALS['xoopsModule']->mid())) {
+ include_once $GLOBALS['xoops']->path('/class/xoopsblock.php');
+ $op = 'list';
if (isset($_POST)) {
foreach ($_POST as $k => $v) {
$$k = $v;
@@ -30,22 +30,22 @@
$bid = isset($_GET['bid']) ? intval($_GET['bid']) : 0;
}
}
- function listar_blocos() {
- global $xoopsUser, $xoopsConfig, $xoopsModule;
+ function listar_blocos()
+ {
include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
$db =& XoopsDatabaseFactory::getDatabaseConnection();
if (file_exists(
- XOOPS_ROOT_PATH . "/modules/system/language/" . $xoopsConfig['language'] . "/admin/blocksadmin.php"
+ XOOPS_ROOT_PATH . "/modules/system/language/" . $GLOBALS['xoopsConfig']['language'] . "/admin/blocksadmin.php"
)
) {
- include_once(XOOPS_ROOT_PATH . "/modules/system/language/" . $xoopsConfig['language'] . "/admin.php");
+ include_once(XOOPS_ROOT_PATH . "/modules/system/language/" . $GLOBALS['xoopsConfig']['language'] . "/admin.php");
include_once(
- XOOPS_ROOT_PATH . "/modules/system/language/" . $xoopsConfig['language'] . "/admin/blocksadmin.php");
- //include_once(XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin/groups.php");
+ XOOPS_ROOT_PATH . "/modules/system/language/" . $GLOBALS['xoopsConfig']['language'] . "/admin/blocksadmin.php");
+ //include_once(XOOPS_ROOT_PATH."/modules/system/language/".$GLOBALS['xoopsConfig']['language']."/admin/groups.php");
} else {
- include_once(XOOPS_ROOT_PATH . "/modules/system/language/portuguesebr/admin.php");
- include_once(XOOPS_ROOT_PATH . "/modules/system/language/portuguesebr/admin/blocksadmin.php");
- include_once(XOOPS_ROOT_PATH . "/modules/system/language/portuguesebr/admin/groups.php");
+ include_once(XOOPS_ROOT_PATH . "/modules/system/language/english/admin.php");
+ include_once(XOOPS_ROOT_PATH . "/modules/system/language/english/admin/blocksadmin.php");
+ include_once(XOOPS_ROOT_PATH . "/modules/system/language/english/admin/groups.php");
}
$module_handler =& xoops_gethandler('module');
$member_handler =& xoops_gethandler('member');
@@ -68,7 +68,7 @@
. _AM_SYSTEM_BLOCKS_VISIBLEIN . "</th><th align='center'>" . _AM_SYSTEM_ADGS . "</th><th align='center'>"
. _AM_XTUBE_ACTION . "</th></tr>
";
- $block_arr =& XoopsBlock::getByModule($xoopsModule->mid());
+ $block_arr =& XoopsBlock::getByModule($GLOBALS['xoopsModule']->mid());
$block_count = count($block_arr);
$class = 'even';
foreach ($block_arr as $i) {
@@ -112,23 +112,23 @@
$name = $i->getVar("name");
echo"<tr valign='top'><td class='$class' align='center'><input type='text' name='title[" . $i->getVar("bid")
. "]' value='" . $title . "'></td><td class='$class' align='center' nowrap='nowrap'>
- <div align='center' >
+ <div align='center' >
<input type='radio' name='side[" . $i->getVar("bid") . "]' value='" . XOOPS_CENTERBLOCK_LEFT . "'$ssel2 />
- <input type='radio' name='side[" . $i->getVar("bid") . "]' value='" . XOOPS_CENTERBLOCK_CENTER . "'$ssel3 />
+ <input type='radio' name='side[" . $i->getVar("bid") . "]' value='" . XOOPS_CENTERBLOCK_CENTER . "'$ssel3 />
<input type='radio' name='side[" . $i->getVar("bid") . "]' value='" . XOOPS_CENTERBLOCK_RIGHT . "'$ssel4 />
- </div>
- <div>
- <span style='float:right'><input type='radio' name='side[" . $i->getVar("bid") . "]' value='"
+ </div>
+ <div>
+ <span style='float:right'><input type='radio' name='side[" . $i->getVar("bid") . "]' value='"
. XOOPS_SIDEBLOCK_RIGHT . "'$ssel1 /></span>
<div align='left'><input type='radio' name='side[" . $i->getVar("bid") . "]' value='"
. XOOPS_SIDEBLOCK_LEFT . "'$ssel0 /></div>
- </div>
- <div align='center'>
+ </div>
+ <div align='center'>
<input type='radio' name='side[" . $i->getVar("bid") . "]' value='" . XOOPS_CENTERBLOCK_BOTTOMLEFT . "'$ssel5 />
- <input type='radio' name='side[" . $i->getVar("bid") . "]' value='" . XOOPS_CENTERBLOCK_BOTTOM . "'$ssel7 />
+ <input type='radio' name='side[" . $i->getVar("bid") . "]' value='" . XOOPS_CENTERBLOCK_BOTTOM . "'$ssel7 />
<input type='radio' name='side[" . $i->getVar("bid") . "]' value='" . XOOPS_CENTERBLOCK_BOTTOMRIGHT
. "'$ssel6 />
- </div>
+ </div>
</td><td class='$class' align='center'><input type='text' name='weight[" . $i->getVar("bid")
. "]' value='" . $i->getVar("weight")
. "' size='5' maxlength='5' /></td><td class='$class' align='center' nowrap><input type='radio' name='visible["
@@ -179,15 +179,14 @@
}
function clone_block($bid) {
- global $xoopsConfig;
if (file_exists(
- XOOPS_ROOT_PATH . "/modules/system/language/" . $xoopsConfig['language'] . "/admin/blocksadmin.php"
+ XOOPS_ROOT_PATH . "/modules/system/language/" . $GLOBALS['xoopsConfig']['language'] . "/admin/blocksadmin.php"
)
) {
- include_once(XOOPS_ROOT_PATH . "/modules/system/language/" . $xoopsConfig['language'] . "/admin.php");
+ include_once(XOOPS_ROOT_PATH . "/modules/system/language/" . $GLOBALS['xoopsConfig']['language'] . "/admin.php");
include_once(
- XOOPS_ROOT_PATH . "/modules/system/language/" . $xoopsConfig['language'] . "/admin/blocksadmin.php");
- //include_once(XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin/groups.php");
+ XOOPS_ROOT_PATH . "/modules/system/language/" . $GLOBALS['xoopsConfig']['language'] . "/admin/blocksadmin.php");
+ //include_once(XOOPS_ROOT_PATH."/modules/system/language/".$GLOBALS['xoopsConfig']['language']."/admin/groups.php");
} else {
include_once(XOOPS_ROOT_PATH . "/modules/system/language/portuguesebr/admin.php");
include_once(XOOPS_ROOT_PATH . "/modules/system/language/portuguesebr/admin/blocksadmin.php");
@@ -230,15 +229,14 @@
}
function clone_block_ok($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options) {
- global $xoopsUser, $xoopsConfig;
if (file_exists(
- XOOPS_ROOT_PATH . "/modules/system/language/" . $xoopsConfig['language'] . "/admin/blocksadmin.php"
+ XOOPS_ROOT_PATH . "/modules/system/language/" . $GLOBALS['xoopsConfig']['language'] . "/admin/blocksadmin.php"
)
) {
- include_once(X...
[truncated message content] |