|
From: <be...@us...> - 2014-02-24 10:31:07
|
Revision: 12331
http://sourceforge.net/p/xoops/svn/12331
Author: beckmi
Date: 2014-02-24 10:31:01 +0000 (Mon, 24 Feb 2014)
Log Message:
-----------
1.03 Beta 1: Site softcored for Smartphons (bleek), Language revised (muki)
Modified Paths:
--------------
XoopsModules/mastop_go2/trunk/mastop_go2/admin/about.php
XoopsModules/mastop_go2/trunk/mastop_go2/admin/admin_footer.php
XoopsModules/mastop_go2/trunk/mastop_go2/admin/admin_header.php
XoopsModules/mastop_go2/trunk/mastop_go2/admin/blockform.php
XoopsModules/mastop_go2/trunk/mastop_go2/admin/blocksadmin.php
XoopsModules/mastop_go2/trunk/mastop_go2/admin/feedback.php
XoopsModules/mastop_go2/trunk/mastop_go2/admin/go2.php
XoopsModules/mastop_go2/trunk/mastop_go2/admin/index.php
XoopsModules/mastop_go2/trunk/mastop_go2/admin/menu/jsdomenu.js
XoopsModules/mastop_go2/trunk/mastop_go2/admin/menu.php
XoopsModules/mastop_go2/trunk/mastop_go2/admin/sec.php
XoopsModules/mastop_go2/trunk/mastop_go2/blocks/mgo_go2.bloco.php
XoopsModules/mastop_go2/trunk/mastop_go2/class/formimage.php
XoopsModules/mastop_go2/trunk/mastop_go2/class/formimage_browse.php
XoopsModules/mastop_go2/trunk/mastop_go2/class/mastop_geral.class.php
XoopsModules/mastop_go2/trunk/mastop_go2/class/mgo_go2_go2.class.php
XoopsModules/mastop_go2/trunk/mastop_go2/class/mgo_sec_section.class.php
XoopsModules/mastop_go2/trunk/mastop_go2/docs/changelog.txt
XoopsModules/mastop_go2/trunk/mastop_go2/docs/credits.txt
XoopsModules/mastop_go2/trunk/mastop_go2/docs/install.txt
XoopsModules/mastop_go2/trunk/mastop_go2/docs/lang_diff.txt
XoopsModules/mastop_go2/trunk/mastop_go2/docs/readme.txt
XoopsModules/mastop_go2/trunk/mastop_go2/include/feedback.form.inc.php
XoopsModules/mastop_go2/trunk/mastop_go2/include/funcoes.inc.php
XoopsModules/mastop_go2/trunk/mastop_go2/include/generator.form.inc.php
XoopsModules/mastop_go2/trunk/mastop_go2/include/go2.form.inc.php
XoopsModules/mastop_go2/trunk/mastop_go2/include/sec.form.inc.php
XoopsModules/mastop_go2/trunk/mastop_go2/language/english/admin.php
XoopsModules/mastop_go2/trunk/mastop_go2/language/english/blocks.php
XoopsModules/mastop_go2/trunk/mastop_go2/language/english/help/help.html
XoopsModules/mastop_go2/trunk/mastop_go2/language/english/main.php
XoopsModules/mastop_go2/trunk/mastop_go2/language/english/modinfo.php
XoopsModules/mastop_go2/trunk/mastop_go2/templates/blocks/mgo_go2.block.tpl.html
XoopsModules/mastop_go2/trunk/mastop_go2/xoops_version.php
Modified: XoopsModules/mastop_go2/trunk/mastop_go2/admin/about.php
===================================================================
--- XoopsModules/mastop_go2/trunk/mastop_go2/admin/about.php 2014-02-24 10:15:11 UTC (rev 12330)
+++ XoopsModules/mastop_go2/trunk/mastop_go2/admin/about.php 2014-02-24 10:31:01 UTC (rev 12331)
@@ -1,17 +1,7 @@
<?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.
- */
-
/**
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @package MastopGo2
* @since
* @author XOOPS Development Team
@@ -27,4 +17,5 @@
echo $aboutAdmin->addNavigation('about.php');
echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false);
-include 'admin_footer.php';
\ No newline at end of file
+include 'admin_footer.php';
+?>
Modified: XoopsModules/mastop_go2/trunk/mastop_go2/admin/admin_footer.php
===================================================================
--- XoopsModules/mastop_go2/trunk/mastop_go2/admin/admin_footer.php 2014-02-24 10:15:11 UTC (rev 12330)
+++ XoopsModules/mastop_go2/trunk/mastop_go2/admin/admin_footer.php 2014-02-24 10:31:01 UTC (rev 12331)
@@ -1,4 +1,16 @@
<?php
+### =============================================================
+### Mastop InfoDigital - Paixão por Internet
+### =============================================================
+### Header com includes padrões para a Admin do Módulo
+### =============================================================
+### Developer: Fernando Santos (topet05), fer...@ma...
+### Copyright: Mastop InfoDigital © 2003-2007
+### -------------------------------------------------------------
+### www.mastop.com.br
+### =============================================================
+### $Id: admin_footer.php 10037 2012-08-08 11:35:43Z beckmi $
+### =============================================================
global $pathIcon32;
echo "<div class='adminfooter'>\n"
@@ -8,4 +20,6 @@
." " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n"
."</div>";
-xoops_cp_footer();
\ No newline at end of file
+xoops_cp_footer();
+
+?>
Modified: XoopsModules/mastop_go2/trunk/mastop_go2/admin/admin_header.php
===================================================================
--- XoopsModules/mastop_go2/trunk/mastop_go2/admin/admin_header.php 2014-02-24 10:15:11 UTC (rev 12330)
+++ XoopsModules/mastop_go2/trunk/mastop_go2/admin/admin_header.php 2014-02-24 10:31:01 UTC (rev 12331)
@@ -11,24 +11,28 @@
### =============================================================
### $Id$
### =============================================================
+
include '../../../include/cp_header.php';
-if ( file_exists("../language/".$xoopsConfig['language']."/modinfo.php") ) {
- include_once("../language/".$xoopsConfig['language']."/modinfo.php");
-} else {
- include_once("../language/portuguesebr/modinfo.php");
+
+if (file_exists("../language/".$xoopsConfig['language']."/modinfo.php")){
+ include_once("../language/".$xoopsConfig['language']."/modinfo.php");
+}else{
+ include_once("../language/portuguesebr/modinfo.php");
}
+
include_once XOOPS_ROOT_PATH."/modules/".MGO_MOD_DIR."/include/funcoes.inc.php";
-$c['lang']['filtros'] = MGO_ADM_FILTROS;
-$c['lang']['exibir'] = MGO_ADM_EXIBIR;
-$c['lang']['exibindo'] = MGO_ADM_EXIBINDO;
-$c['lang']['por_pagina'] = MGO_ADM_PORPAGINA;
-$c['lang']['acao'] = MGO_ADM_ACAO;
-$c['lang']['semresult'] = MGO_ADM_SEMRESULT;
-$c['lang']['showhidemenu'] = MGO_ADM_SHOWHIDEMENU;
-$c['lang']['group_action'] = MGO_ADM_GRP_ACTION;
+$c['lang']['filtros'] = MGO_ADM_FILTROS;
+$c['lang']['exibir'] = MGO_ADM_EXIBIR;
+$c['lang']['exibindo'] = MGO_ADM_EXIBINDO;
+$c['lang']['por_pagina'] = MGO_ADM_PORPAGINA;
+$c['lang']['acao'] = MGO_ADM_ACAO;
+$c['lang']['semresult'] = MGO_ADM_SEMRESULT;
+$c['lang']['showhidemenu'] = MGO_ADM_SHOWHIDEMENU;
+
+$c['lang']['group_action'] = MGO_ADM_GRP_ACTION;
$c['lang']['group_erro_sel'] = MGO_ADM_GRP_ERR_SEL;
-$c['lang']['group_del'] = MGO_ADM_GRP_DEL;
+$c['lang']['group_del'] = MGO_ADM_GRP_DEL;
$c['lang']['group_del_sure'] = MGO_ADM_GRP_DEL_SURE;
$path = dirname(dirname(dirname(dirname(__FILE__))));
@@ -54,46 +58,45 @@
function mgo_adm_menu(){
- global $xoopsModule, $xoopsConfig, $xoopsModuleConfig;
- $adm_url = XOOPS_URL."/modules/".MGO_MOD_DIR."/admin/";
- $links[] = array(0 => XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$xoopsModule->getVar('mid'), 1 => _PREFERENCES);
- //xoops_cp_header();
- echo '
-<link rel="stylesheet" type="text/css" href="menu/style_menu.css" />
-<script type="text/javascript" src="menu/jsdomenu.js"></script>
-<script type="text/javascript" src="menu/jsdomenubar.js"></script>
-<script type="text/javascript">
-function createjsDOMenu() {
- mainMenu1 = new jsDOMenu(170);
- with (mainMenu1) {
- addMenuItem(new menuItem("'._ADD.'", "", "'.$adm_url.'sec.php?op=novo"));
- addMenuItem(new menuItem("'.MGO_ADM_GER.'", "", "'.$adm_url.'sec.php?op=listar"));
- }
+ global $xoopsModule, $xoopsConfig, $xoopsModuleConfig;
+ $adm_url = XOOPS_URL."/modules/".MGO_MOD_DIR."/admin/";
+ $links[] = array(0 => XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$xoopsModule->getVar('mid'), 1 => _PREFERENCES);
- mainMenu2 = new jsDOMenu(170);
- with (mainMenu2) {
- addMenuItem(new menuItem("'._ADD.'", "", "'.$adm_url.'go2.php?op=novo"));
- addMenuItem(new menuItem("'.MGO_ADM_GER.'", "", "'.$adm_url.'go2.php?op=listar"));
- }
+ //xoops_cp_header();
+ echo '
+ <link rel="stylesheet" type="text/css" href="menu/style_menu.css" />
+ <script type="text/javascript" src="menu/jsdomenu.js"></script>
+ <script type="text/javascript" src="menu/jsdomenubar.js"></script>
+ <script type="text/javascript">
+ function createjsDOMenu() {
+ mainMenu1 = new jsDOMenu(170);
+ with (mainMenu1) {
+ addMenuItem(new menuItem("'._ADD.'", "", "'.$adm_url.'sec.php?op=novo"));
+ addMenuItem(new menuItem("'.MGO_ADM_GER.'", "", "'.$adm_url.'sec.php?op=listar"));
+ }
- mainMenu3 = new jsDOMenu(150);
- with (mainMenu3) {
- addMenuItem(new menuItem("'.MGO_ADM_BLOCKS.'", "", "'.$adm_url.'blocksadmin.php"));
- addMenuItem(new menuItem("'._PREFERENCES.'", "", "'.XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$xoopsModule->getVar('mid').'"));
- }
+ mainMenu2 = new jsDOMenu(170);
+ with (mainMenu2) {
+ addMenuItem(new menuItem("'._ADD.'", "", "'.$adm_url.'go2.php?op=novo"));
+ addMenuItem(new menuItem("'.MGO_ADM_GER.'", "", "'.$adm_url.'go2.php?op=listar"));
+ }
- menuBar = new jsDOMenuBar();
- with (menuBar) {
- addMenuBarItem(new menuBarItem("'.MGO_ADM_SEC.'", mainMenu1, "cliid"));
- addMenuBarItem(new menuBarItem("'.MGO_ADM_GO2.'", mainMenu2, "prdid"));
- addMenuBarItem(new menuBarItem("'._OPTIONS.'", mainMenu3, "optid"));
- }
- menuBar.items.cliid.showIcon("sec", "sec", "sec");
- menuBar.items.prdid.showIcon("go2", "go2", "go2");
- menuBar.items.optid.showIcon("opt", "opt", "opt");
- menuBar.moveTo(680, 81);
+ mainMenu3 = new jsDOMenu(150);
+ with (mainMenu3) {
+ addMenuItem(new menuItem("'.MGO_ADM_BLOCKS.'", "", "'.$adm_url.'blocksadmin.php"));
+ addMenuItem(new menuItem("'._PREFERENCES.'", "", "'.XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$xoopsModule->getVar('mid').'"));
+ }
+
+ menuBar = new jsDOMenuBar();
+ with (menuBar) {
+ addMenuBarItem(new menuBarItem("'.MGO_ADM_SEC.'", mainMenu1, "cliid"));
+ addMenuBarItem(new menuBarItem("'.MGO_ADM_GO2.'", mainMenu2, "prdid"));
+ addMenuBarItem(new menuBarItem("'._OPTIONS.'", mainMenu3, "optid"));
+ }
+ menuBar.items.cliid.showIcon("sec", "sec", "sec");
+ menuBar.items.prdid.showIcon("go2", "go2", "go2");
+ menuBar.items.optid.showIcon("opt", "opt", "opt");
+ menuBar.moveTo(680, 81);
+ }</script>';
}
-</script>
-';
-}
-?>
\ No newline at end of file
+?>
Modified: XoopsModules/mastop_go2/trunk/mastop_go2/admin/blockform.php
===================================================================
--- XoopsModules/mastop_go2/trunk/mastop_go2/admin/blockform.php 2014-02-24 10:15:11 UTC (rev 12330)
+++ XoopsModules/mastop_go2/trunk/mastop_go2/admin/blockform.php 2014-02-24 10:31:01 UTC (rev 12331)
@@ -1,72 +1,87 @@
<?php
### =============================================================
-### Mastop InfoDigital - Paix\xE3o por Internet
+### Mastop InfoDigital - Paixão por Internet
### =============================================================
-### Formul\xE1rio para a Clonagem de Blocos
+### Formulário para a Clonagem de Blocos
### =============================================================
### Developer: Fernando Santos (topet05), fer...@ma...
-### Copyright: Mastop InfoDigital \xA9 2003-2007
+### Copyright: Mastop InfoDigital © 2003-2007
### -------------------------------------------------------------
### www.mastop.com.br
### =============================================================
### $Id$
### =============================================================
+
include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
$form = new XoopsThemeForm($block['form_title'], 'blockform', 'blocksadmin.php', "post", true);
-if (isset($block['name'])) {
- $form->addElement(new XoopsFormLabel(_AM_NAME, $block['name']));
+
+if (isset($block['name'])){
+ $form->addElement(new XoopsFormLabel(_AM_NAME, $block['name']));
}
+
$side_select = new XoopsFormSelect(_AM_BLKTYPE, "bside", $block['side']);
$side_select->addOptionArray(array(0 => _AM_SBLEFT, 1 => _AM_SBRIGHT, 3 => _AM_CBLEFT, 4 => _AM_CBRIGHT, 5 => _AM_CBCENTER, 7 => _AM_CBBOTTOMLEFT, 8 => _AM_CBBOTTOMRIGHT, 9 => _AM_CBBOTTOM, ));
+
$form->addElement($side_select);
$form->addElement(new XoopsFormText(_AM_WEIGHT, "bweight", 2, 5, $block['weight']));
$form->addElement(new XoopsFormRadioYN(_AM_VISIBLE, 'bvisible', $block['visible']));
+
$mod_select = new XoopsFormSelect(_AM_VISIBLEIN, "bmodule", $block['modules'], 5, true);
$module_handler =& xoops_gethandler('module');
$criteria = new CriteriaCompo(new Criteria('hasmain', 1));
$criteria->add(new Criteria('isactive', 1));
+
$module_list =& $module_handler->getList($criteria);
$module_list[-1] = _AM_TOPPAGE;
$module_list[0] = _AM_ALLPAGES;
+
ksort($module_list);
$mod_select->addOptionArray($module_list);
$form->addElement($mod_select);
$form->addElement(new XoopsFormText(_AM_TITLE, 'btitle', 50, 255, $block['title']), false);
-if ( $block['is_custom'] ) {
- $textarea = new XoopsFormDhtmlTextArea(_AM_CONTENT, 'bcontent', $block['content'], 15, 70);
- $textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">'._AM_USEFULTAGS.'</span><br /><span style="font-size:x-small;font-weight:normal;">'.sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL.'/').'</span>');
- $form->addElement($textarea, true);
- $ctype_select = new XoopsFormSelect(_AM_CTYPE, 'bctype', $block['ctype']);
- $ctype_select->addOptionArray(array('H' => _AM_HTML, 'P' => _AM_PHP, 'S' => _AM_AFWSMILE, 'T' => _AM_AFNOSMILE));
- $form->addElement($ctype_select);
-} else {
- if ($block['template'] != '') {
- $tplfile_handler =& xoops_gethandler('tplfile');
- $btemplate =& $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $block['bid']);
- if (count($btemplate) > 0) {
- $form->addElement(new XoopsFormLabel(_AM_CONTENT, '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=tplsets&op=edittpl&id='.$btemplate[0]->getVar('tpl_id').'">'._AM_EDITTPL.'</a>'));
- } else {
- $btemplate2 =& $tplfile_handler->find('default', 'block', $block['bid']);
- if (count($btemplate2) > 0) {
- $form->addElement(new XoopsFormLabel(_AM_CONTENT, '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=tplsets&op=edittpl&id='.$btemplate2[0]->getVar('tpl_id').'" target="_blank">'._AM_EDITTPL.'</a>'));
- }
- }
+
+if ($block['is_custom']){
+ $textarea = new XoopsFormDhtmlTextArea(_AM_CONTENT, 'bcontent', $block['content'], 15, 70);
+ $textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">'._AM_USEFULTAGS.'</span><br /><span style="font-size:x-small;font-weight:normal;">'.sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL.'/').'</span>');
+ $form->addElement($textarea, true);
+ $ctype_select = new XoopsFormSelect(_AM_CTYPE, 'bctype', $block['ctype']);
+ $ctype_select->addOptionArray(array('H' => _AM_HTML, 'P' => _AM_PHP, 'S' => _AM_AFWSMILE, 'T' => _AM_AFNOSMILE));
+ $form->addElement($ctype_select);
+}else{
+ if ($block['template'] != ''){
+ $tplfile_handler =& xoops_gethandler('tplfile');
+ $btemplate =& $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $block['bid']);
+ if (count($btemplate) > 0){
+ $form->addElement(new XoopsFormLabel(_AM_CONTENT, '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=tplsets&op=edittpl&id='.$btemplate[0]->getVar('tpl_id').'">'._AM_EDITTPL.'</a>'));
+ }else{
+ $btemplate2 =& $tplfile_handler->find('default', 'block', $block['bid']);
+ if (count($btemplate2) > 0){
+ $form->addElement(new XoopsFormLabel(_AM_CONTENT, '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=tplsets&op=edittpl&id='.$btemplate2[0]->getVar('tpl_id').'" target="_blank">'._AM_EDITTPL.'</a>'));
+ }
}
- if ($block['edit_form'] != false) {
- $form->addElement(new XoopsFormLabel(_AM_OPTIONS, $block['edit_form']));
- }
+ }
+ if ($block['edit_form'] != false){
+ $form->addElement(new XoopsFormLabel(_AM_OPTIONS, $block['edit_form']));
+ }
}
+
$cache_select = new XoopsFormSelect(_AM_BCACHETIME, 'bcachetime', $block['cachetime']);
$cache_select->addOptionArray(array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK, '2592000' => _MONTH));
$form->addElement($cache_select);
-if (isset($block['bid'])) {
- $form->addElement(new XoopsFormHidden('bid', $block['bid']));
+
+if (isset($block['bid'])){
+ $form->addElement(new XoopsFormHidden('bid', $block['bid']));
}
+
$form->addElement(new XoopsFormHidden('op', $block['op']));
$form->addElement(new XoopsFormHidden('fct', 'blocksadmin'));
$button_tray = new XoopsFormElementTray('', ' ');
-if ($block['is_custom']) {
- $button_tray->addElement(new XoopsFormButton('', 'previewblock', _PREVIEW, "submit"));
+
+if ($block['is_custom']){
+ $button_tray->addElement(new XoopsFormButton('', 'previewblock', _PREVIEW, "submit"));
}
+
$button_tray->addElement(new XoopsFormButton('', 'submitblock', _SUBMIT, "submit"));
-$form->addElement($button_tray);
\ No newline at end of file
+$form->addElement($button_tray);
+
+?>
Modified: XoopsModules/mastop_go2/trunk/mastop_go2/admin/blocksadmin.php
===================================================================
--- XoopsModules/mastop_go2/trunk/mastop_go2/admin/blocksadmin.php 2014-02-24 10:15:11 UTC (rev 12330)
+++ XoopsModules/mastop_go2/trunk/mastop_go2/admin/blocksadmin.php 2014-02-24 10:31:01 UTC (rev 12331)
@@ -1,322 +1,343 @@
-<?php
-### =============================================================
-### Mastop InfoDigital - Paixão por Internet
-### =============================================================
-### Manutenção Individual de Blocos e Grupos
-### =============================================================
-### Developer: Fernando Santos (topet05), fer...@ma...
-### Copyright: Mastop InfoDigital © 2003-2007
-### -------------------------------------------------------------
-### www.mastop.com.br
-### =============================================================
-### $Id$
-### =============================================================
-include_once 'admin_header.php';
-xoops_cp_header();
-$aboutAdmin = new ModuleAdmin();
-
-if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
- exit(MGO_ADM_403);
-}
-
-if ( $xoopsUser->isAdmin($xoopsModule->mid()) ) {
- include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
- $op = "list";
- if ( isset($_POST) ) {
- foreach ( $_POST as $k => $v ) {
- $$k = $v;
- }
- }
-
- if ( isset($_GET['op']) ) {
- if ($_GET['op'] == "edit" || $_GET['op'] == "delete" || $_GET['op'] == "delete_ok" || $_GET['op'] == "clone") {
- $op = $_GET['op'];
- $bid = isset($_GET['bid']) ? intval($_GET['bid']) : 0;
- }
- }
-
- function listar_blocos()
- {
- include_once 'admin_header.php';
- //xoops_cp_header();
-
- global $xoopsUser, $xoopsConfig, $xoopsModule;
- 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") ) {
- include_once(XOOPS_ROOT_PATH."/modules/system/language/".$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");
- } 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");
- }
- $module_handler =& xoops_gethandler('module');
- $member_handler =& xoops_gethandler('member');
- $moduleperm_handler =& xoops_gethandler('groupperm');
- $groups =& $member_handler->getGroups();
- $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
- $criteria->add(new Criteria('isactive', 1));
- $module_list =& $module_handler->getList($criteria);
- $module_list[-1] = _AM_TOPPAGE;
- $module_list[0] = _AM_ALLPAGES;
- ksort($module_list);
- echo "
- <h4 style='text-align:left;'>".MGO_MOD_NOME." - "._AM_BADMIN."</h4>";
- $module_handler =& xoops_gethandler('module');
- echo "<form action='".$_SERVER['PHP_SELF']."' name='blockadmin' method='post'>
- <table width='100%' class='outer' cellpadding='4' cellspacing='1'>
- <tr valign='middle'><th align='center'>"._AM_TITLE."</th><th align='center' nowrap='nowrap'>"._AM_SIDE."<br />"._LEFT."-"._CENTER."-"._RIGHT."</th><th align='center'>"._AM_WEIGHT."</th><th align='center'>"._AM_VISIBLE."</th><th align='center'>"._AM_VISIBLEIN."</th><th align='center'>".MGO_ADM_GRUPOS."</th><th align='center'>"._AM_ACTION."</th></tr>
- ";
- $block_arr =& XoopsBlock::getByModule($xoopsModule->mid());
- $block_count = count($block_arr);
- $class = 'even';
- foreach ($block_arr as $i) {
- $groups_perms =& $moduleperm_handler->getGroupIds('block_read', $i->getVar("bid"));
- $sql = 'SELECT module_id FROM '.$db->prefix('block_module_link').' WHERE block_id='.$i->getVar("bid");
- $result = $db->query($sql);
- $modules = array();
- while ($row = $db->fetchArray($result)) {
- $modules[] = intval($row['module_id']);
- }
- $sel0 = $sel1 = $ssel0 = $ssel1 = $ssel2 = $ssel3 = $ssel4 = $ssel5 = $ssel6 = $ssel7 = "";
- if ( $i->getVar("visible") == 1 ) {
- $sel1 = " checked='checked'";
- } else {
- $sel0 = " checked='checked'";
- }
- if ( $i->getVar("side") == XOOPS_SIDEBLOCK_LEFT){
- $ssel0 = " checked='checked'";
- } elseif ( $i->getVar("side") == XOOPS_SIDEBLOCK_RIGHT ){
- $ssel1 = " checked='checked'";
- } elseif ( $i->getVar("side") == XOOPS_CENTERBLOCK_LEFT ){
- $ssel2 = " checked='checked'";
- } elseif ( $i->getVar("side") == XOOPS_CENTERBLOCK_RIGHT ){
- $ssel4 = " checked='checked'";
- } elseif ( $i->getVar("side") == XOOPS_CENTERBLOCK_CENTER ){
- $ssel3 = " checked='checked'";
- } elseif ( $i->getVar("side") == XOOPS_CENTERBLOCK_BOTTOMLEFT ){
- $ssel5 = " checked='checked'";
- } elseif ( $i->getVar("side") == XOOPS_CENTERBLOCK_BOTTOMRIGHT ){
- $ssel6 = " checked='checked'";
- } elseif ( $i->getVar("side") == XOOPS_CENTERBLOCK_BOTTOM ){
- $ssel7 = " checked='checked'";
- }
- if ( $i->getVar("title") == "" ) {
- $title = " ";
- } else {
- $title = $i->getVar("title");
- }
- $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' >
- <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_RIGHT."'$ssel4 />
- </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'>
- <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_BOTTOMRIGHT."'$ssel6 />
- </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[".$i->getVar("bid")."]' value='1'$sel1>"._YES." <input type='radio' name='visible[".$i->getVar("bid")."]' value='0'$sel0>"._NO."</td>";
-
- echo "<td class='$class' align='center'><select size='5' name='bmodule[".$i->getVar("bid")."][]' id='bmodule[".$i->getVar("bid")."][]' multiple='multiple'>";
- foreach ($module_list as $k => $v){
- echo "<option value='$k'".((in_array($k, $modules)) ? " selected='selected'" : "").">$v</option>";
- }
- echo "</select></td>";
-
-
- echo "<td class='$class' align='center'><select size='5' name='groups[".$i->getVar("bid")."][]' id='groups[".$i->getVar("bid")."][]' multiple='multiple'>";
- foreach ($groups as $grp){
- echo "<option value='".$grp->getVar('groupid')."' ".((in_array($grp->getVar('groupid'), $groups_perms)) ? " selected='selected'" : "").">".$grp->getVar('name')."</option>";
- }
- echo "</select></td>";
-
- echo "<td class='$class' align='center'><a href='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin&op=edit&bid=".$i->getVar("bid")."'>"._EDIT."</a> <a href='blocksadmin.php?op=clone&bid=".$i->getVar("bid")."'>"._CLONE."</a>";
- if ($i->getVar('block_type') != 'S' && $i->getVar('block_type') != 'M') {
- echo " <a href='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin&op=delete&bid=".$i->getVar("bid")."'>"._DELETE."</a>";
- }
- echo "
- <input type='hidden' name='oldtitle[".$i->getVar("bid")."]' value='".$i->getVar('title')."' />
- <input type='hidden' name='oldside[".$i->getVar("bid")."]' value='".$i->getVar('side')."' />
- <input type='hidden' name='oldweight[".$i->getVar("bid")."]' value='".$i->getVar('weight')."' />
- <input type='hidden' name='oldvisible[".$i->getVar("bid")."]' value='".$i->getVar('visible')."' />
- <input type='hidden' name='bid[".$i->getVar("bid")."]' value='".$i->getVar("bid")."' />
- </td></tr>
- ";
- $class = ($class == 'even') ? 'odd' : 'even';
- }
- echo "<tr><td class='foot' align='center' colspan='7'>
- <input type='hidden' name='op' value='order' />
- ".$GLOBALS['xoopsSecurity']->getTokenHTML()."
- <input type='submit' name='submit' value='"._SUBMIT."' />
- </td></tr></table>
- </form>
- <br /><br />";
- include_once 'admin_footer.php';
- }
- function clone_block($bid)
- {
- global $xoopsConfig;
- if ( file_exists(XOOPS_ROOT_PATH."/modules/system/language/".$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/".$xoopsConfig['language']."/admin/blocksadmin.php");
- //include_once(XOOPS_ROOT_PATH."/modules/system/language/".$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");
- }
- mgo_adm_menu();
- $myblock = new XoopsBlock($bid);
- $db =& XoopsDatabaseFactory::getDatabaseConnection();
- $sql = 'SELECT module_id FROM '.$db->prefix('block_module_link').' WHERE block_id='.intval($bid);
- $result = $db->query($sql);
- $modules = array();
- while ($row = $db->fetchArray($result)) {
- $modules[] = intval($row['module_id']);
- }
- $is_custom = ($myblock->getVar('block_type') == 'C' || $myblock->getVar('block_type') == 'E') ? true : false;
- $block = array('title'=> $myblock->getVar('title').' Clone', 'form_title' => _AM_CLONEBLOCK, 'name' => $myblock->getVar('name'), 'side' => $myblock->getVar('side'), 'weight' => $myblock->getVar('weight'), 'visible' => $myblock->getVar('visible'), 'content' => $myblock->getVar('content', 'N'), 'modules' => $modules, 'is_custom' => $is_custom, 'ctype' => $myblock->getVar('c_type'), 'cachetime' => $myblock->getVar('bcachetime'), 'op' => 'clone_ok', 'bid' => $myblock->getVar('bid'), 'edit_form' => $myblock->getOptions(), 'template' => $myblock->getVar('template'), 'options' => $myblock->getVar('options'));
- echo '<a href="blocksadmin.php">'. _AM_BADMIN .'</a> <span style="font-weight:bold;">»»</span> '._AM_CLONEBLOCK.'<br /><br />';
- include 'blockform.php';
- $form->display();
- xoops_cp_footer();
- exit();
- }
-
- 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") ) {
- include_once(XOOPS_ROOT_PATH."/modules/system/language/".$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");
- } 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");
- }
- $block = new XoopsBlock($bid);
- $clone =& $block->xoopsClone();
- if (empty($bmodule)) {
- xoops_cp_header();
- xoops_error(sprintf(_AM_NOTSELNG, _AM_VISIBLEIN));
- xoops_cp_footer();
- exit();
- }
- $clone->setVar('side', $bside);
- $clone->setVar('weight', $bweight);
- $clone->setVar('visible', $bvisible);
- //$clone->setVar('content', $_POST['bcontent']);
- $clone->setVar('title', $_POST['btitle']);
- $clone->setVar('bcachetime', $bcachetime);
- if ( isset($options) && (count($options) > 0) ) {
- $options = implode('|', $options);
- $clone->setVar('options', $options);
- }
- $clone->setVar('bid', 0);
- if ($block->getVar('block_type') == 'C' || $block->getVar('block_type') == 'E') {
- $clone->setVar('block_type', 'E');
- } else {
- $clone->setVar('block_type', 'D');
- }
- $newid = $clone->store();
- if (!$newid) {
- xoops_cp_header();
- $clone->getHtmlErrors();
- xoops_cp_footer();
- exit();
- }
- if ($clone->getVar('template') != '') {
- $tplfile_handler =& xoops_gethandler('tplfile');
- $btemplate =& $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $bid);
- if (count($btemplate) > 0) {
- $tplclone =& $btemplate[0]->xoopsClone();
- $tplclone->setVar('tpl_id', 0);
- $tplclone->setVar('tpl_refid', $newid);
- $tplfile_handler->insert($tplclone);
- }
- }
- $db =& XoopsDatabaseFactory::getDatabaseConnection();
- foreach ($bmodule as $bmid) {
- $sql = 'INSERT INTO '.$db->prefix('block_module_link').' (block_id, module_id) VALUES ('.$newid.', '.$bmid.')';
- $db->query($sql);
- }
- $groups =& $xoopsUser->getGroups();
- $count = count($groups);
- for ($i = 0; $i < $count; $i++) {
- $sql = "INSERT INTO ".$db->prefix('group_permission')." (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES (".$groups[$i].", ".$newid.", 1, 'block_read')";
- $db->query($sql);
- }
- redirect_header('blocksadmin.php?op=listar',1,_AM_DBUPDATED);
- }
-
- function setar_ordem($bid, $title, $weight, $visible, $side)
- {
- $myblock = new XoopsBlock($bid);
- $myblock->setVar('title', $title);
- $myblock->setVar('weight', $weight);
- $myblock->setVar('visible', $visible);
- $myblock->setVar('side', $side);
- $myblock->store();
- }
-
- if ( $op == "list" ) {
- mgo_adm_menu();
- listar_blocos();
- xoops_cp_footer();
- exit();
- }
-
- if ( $op == "order" ) {
- if (!$GLOBALS['xoopsSecurity']->check()) {
- redirect_header($_SERVER['PHP_SELF'], 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
- exit();
- }
- foreach (array_keys($bid) as $i) {
- if ( $oldtitle[$i] != $title[$i] || $oldweight[$i] != $weight[$i] || $oldvisible[$i] != $visible[$i] || $oldside[$i] != $side[$i] )
- setar_ordem($bid[$i], $title[$i], $weight[$i], $visible[$i], $side[$i], $bmodule[$i]);
- if(!empty($bmodule[$i]) && count($bmodule[$i]) > 0){
- $sql = sprintf("DELETE FROM %s WHERE block_id = %u", $xoopsDB->prefix('block_module_link'), $bid[$i]);
- $xoopsDB->query($sql);
- if (in_array(0, $bmodule[$i])) {
- $sql = sprintf("INSERT INTO %s (block_id, module_id) VALUES (%u, %d)", $xoopsDB->prefix('block_module_link'), $bid[$i], 0);
- $xoopsDB->query($sql);
- }else{
- foreach ($bmodule[$i] as $bmid) {
- $sql = sprintf("INSERT INTO %s (block_id, module_id) VALUES (%u, %d)", $xoopsDB->prefix('block_module_link'), $bid[$i], intval($bmid));
- $xoopsDB->query($sql);
- }
- }
- }
- $sql = sprintf("DELETE FROM %s WHERE gperm_itemid = %u", $xoopsDB->prefix('group_permission'), $bid[$i]);
- $xoopsDB->query($sql);
- if(!empty($groups[$i])){
- foreach ($groups[$i] as $grp) {
- $sql = sprintf("INSERT INTO %s (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES (%u, %u, 1, 'block_read')", $xoopsDB->prefix('group_permission'), $grp, $bid[$i]);
- $xoopsDB->query($sql);
- }
- }
- }
- redirect_header($_SERVER['PHP_SELF'],1,MGO_ADM_SUCESS2);
- exit();
- }
- if ($op == 'clone') {
- clone_block($bid);
- }
-
- if ($op == 'clone_ok') {
- clone_block_ok($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options);
- }
-} else {
- echo MGO_ADM_403;
-}
\ No newline at end of file
+<?php
+### =============================================================
+### Mastop InfoDigital - Paixão por Internet
+### =============================================================
+### Manutenção Individual de Blocos e Grupos
+### =============================================================
+### Developer: Fernando Santos (topet05), fer...@ma...
+### Copyright: Mastop InfoDigital © 2003-2007
+### -------------------------------------------------------------
+### www.mastop.com.br
+### =============================================================
+### $Id$
+### =============================================================
+
+include_once 'admin_header.php';
+xoops_cp_header();
+$aboutAdmin = new ModuleAdmin();
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())){
+ exit(MGO_ADM_403);
+}
+
+if ( $xoopsUser->isAdmin($xoopsModule->mid())){
+ include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
+ $op = "list";
+ if (isset($_POST)){
+ foreach ($_POST as $k => $v){
+ $$k = $v;
+ }
+ }
+
+ if (isset($_GET['op'])){
+ if ($_GET['op'] == "edit" || $_GET['op'] == "delete" || $_GET['op'] == "delete_ok" || $_GET['op'] == "clone"){
+ $op = $_GET['op'];
+ $bid = isset($_GET['bid']) ? intval($_GET['bid']) : 0;
+ }
+ }
+
+ function listar_blocos(){
+ include_once 'admin_header.php';
+ //xoops_cp_header();
+
+ global $xoopsUser, $xoopsConfig, $xoopsModule;
+ 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")){
+ include_once(XOOPS_ROOT_PATH."/modules/system/language/".$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");
+ }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");
+ }
+
+ $module_handler =& xoops_gethandler('module');
+ $member_handler =& xoops_gethandler('member');
+ $moduleperm_handler =& xoops_gethandler('groupperm');
+ $groups =& $member_handler->getGroups();
+ $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
+ $criteria->add(new Criteria('isactive', 1));
+ $module_list =& $module_handler->getList($criteria);
+ $module_list[-1] = _AM_TOPPAGE;
+ $module_list[0] = _AM_ALLPAGES;
+ ksort($module_list);
+ echo "
+ <h4 style='text-align:left;'>".MGO_MOD_NOME." - "._AM_BADMIN."</h4>";
+ $module_handler =& xoops_gethandler('module');
+ echo "<form action='".$_SERVER['PHP_SELF']."' name='blockadmin' method='post'>
+ <table width='100%' class='outer' cellpadding='4' cellspacing='1'>
+ <tr valign='middle'><th align='center'>"._AM_TITLE."</th><th align='center' nowrap='nowrap'>"._AM_SIDE."<br />"._LEFT."-"._CENTER."-"._RIGHT."</th><th align='center'>"._AM_WEIGHT."</th><th align='center'>"._AM_VISIBLE."</th><th align='center'>"._AM_VISIBLEIN."</th><th align='center'>".MGO_ADM_GRUPOS."</th><th align='center'>"._AM_ACTION."</th></tr>
+ ";
+ $block_arr =& XoopsBlock::getByModule($xoopsModule->mid());
+ $block_count = count($block_arr);
+ $class = 'even';
+ foreach ($block_arr as $i){
+ $groups_perms =& $moduleperm_handler->getGroupIds('block_read', $i->getVar("bid"));
+ $sql = 'SELECT module_id FROM '.$db->prefix('block_module_link').' WHERE block_id='.$i->getVar("bid");
+ $result = $db->query($sql);
+ $modules = array();
+ while ($row = $db->fetchArray($result)){
+ $modules[] = intval($row['module_id']);
+ }
+ $sel0 = $sel1 = $ssel0 = $ssel1 = $ssel2 = $ssel3 = $ssel4 = $ssel5 = $ssel6 = $ssel7 = "";
+ if ($i->getVar("visible") == 1 ){
+ $sel1 = " checked='checked'";
+ }else{
+ $sel0 = " checked='checked'";
+ }
+
+ if ($i->getVar("side") == XOOPS_SIDEBLOCK_LEFT){
+ $ssel0 = " checked='checked'";
+ }elseif ($i->getVar("side") == XOOPS_SIDEBLOCK_RIGHT ){
+ $ssel1 = " checked='checked'";
+ }elseif ($i->getVar("side") == XOOPS_CENTERBLOCK_LEFT ){
+ $ssel2 = " checked='checked'";
+ }elseif ($i->getVar("side") == XOOPS_CENTERBLOCK_RIGHT ){
+ $ssel4 = " checked='checked'";
+ }elseif ($i->getVar("side") == XOOPS_CENTERBLOCK_CENTER ){
+ $ssel3 = " checked='checked'";
+ }elseif ($i->getVar("side") == XOOPS_CENTERBLOCK_BOTTOMLEFT ){
+ $ssel5 = " checked='checked'";
+ }elseif ($i->getVar("side") == XOOPS_CENTERBLOCK_BOTTOMRIGHT ){
+ $ssel6 = " checked='checked'";
+ }elseif ($i->getVar("side") == XOOPS_CENTERBLOCK_BOTTOM ){
+ $ssel7 = " checked='checked'";
+ }
+
+ if ($i->getVar("title") == ""){
+ $title = " ";
+ }else{
+ $title = $i->getVar("title");
+ }
+
+ $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' >
+ <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_RIGHT."'$ssel4 />
+ </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'>
+ <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_BOTTOMRIGHT."'$ssel6 />
+ </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[".$i->getVar("bid")."]' value='1'$sel1>"._YES." <input type='radio' name='visible[".$i->getVar("bid")."]' value='0'$sel0>"._NO."</td>";
+
+ echo "<td class='$class' align='center'><select size='5' name='bmodule[".$i->getVar("bid")."][]' id='bmodule[".$i->getVar("bid")."][]' multiple='multiple'>";
+ foreach ($module_list as $k => $v){
+ echo "<option value='$k'".((in_array($k, $modules)) ? " selected='selected'" : "").">$v</option>";
+ }
+
+ echo "</select></td>";
+
+ echo "<td class='$class' align='center'><select size='5' name='groups[".$i->getVar("bid")."][]' id='groups[".$i->getVar("bid")."][]' multiple='multiple'>";
+ foreach ($groups as $grp){
+ echo "<option value='".$grp->getVar('groupid')."' ".((in_array($grp->getVar('groupid'), $groups_perms)) ? " selected='selected'" : "").">".$grp->getVar('name')."</option>";
+ }
+
+ echo "</select></td>";
+
+ echo "<td class='$class' align='center'><a href='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin&op=edit&bid=".$i->getVar("bid")."'>"._EDIT."</a> <a href='blocksadmin.php?op=clone&bid=".$i->getVar("bid")."'>"._CLONE."</a>";
+
+ if ($i->getVar('block_type') != 'S' && $i->getVar('block_type') != 'M'){
+ echo " <a href='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin&op=delete&bid=".$i->getVar("bid")."'>"._DELETE."</a>";
+ }
+
+ echo "
+ <input type='hidden' name='oldtitle[".$i->getVar("bid")."]' value='".$i->getVar('title')."' />
+ <input type='hidden' name='oldside[".$i->getVar("bid")."]' value='".$i->getVar('side')."' />
+ <input type='hidden' name='oldweight[".$i->getVar("bid")."]' value='".$i->getVar('weight')."' />
+ <input type='hidden' name='oldvisible[".$i->getVar("bid")."]' value='".$i->getVar('visible')."' />
+ <input type='hidden' name='bid[".$i->getVar("bid")."]' value='".$i->getVar("bid")."' />
+ </td></tr>
+ ";
+ $class = ($class == 'even') ? 'odd' : 'even';
+ }
+
+ echo "<tr><td class='foot' align='center' colspan='7'>
+ <input type='hidden' name='op' value='order' />
+ ".$GLOBALS['xoopsSecurity']->getTokenHTML()."
+ <input type='submit' name='submit' value='"._SUBMIT."' />
+ </td></tr></table>
+ </form>
+ <br /><br />";
+ include_once 'admin_footer.php';
+ }
+
+ function clone_block($bid){
+ global $xoopsConfig;
+ if (file_exists(XOOPS_ROOT_PATH."/modules/system/language/".$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/".$xoopsConfig['language']."/admin/blocksadmin.php");
+ //include_once(XOOPS_ROOT_PATH."/modules/system/language/".$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");
+ }
+
+ mgo_adm_menu();
+ $myblock = new XoopsBlock($bid);
+ $db =& XoopsDatabaseFactory::getDatabaseConnection();
+ $sql = 'SELECT module_id FROM '.$db->prefix('block_module_link').' WHERE block_id='.intval($bid);
+ $result = $db->query($sql);
+ $modules = array();
+
+ while ($row = $db->fetchArray($result)){
+ $modules[] = intval($row['module_id']);
+ }
+
+ $is_custom = ($myblock->getVar('block_type') == 'C' || $myblock->getVar('block_type') == 'E') ? true : false;
+ $block = array('title'=> $myblock->getVar('title').' Clone', 'form_title' => _AM_CLONEBLOCK, 'name' => $myblock->getVar('name'), 'side' => $myblock->getVar('side'), 'weight' => $myblock->getVar('weight'), 'visible' => $myblock->getVar('visible'), 'content' => $myblock->getVar('content', 'N'), 'modules' => $modules, 'is_custom' => $is_custom, 'ctype' => $myblock->getVar('c_type'), 'cachetime' => $myblock->getVar('bcachetime'), 'op' => 'clone_ok', 'bid' => $myblock->getVar('bid'), 'edit_form' => $myblock->getOptions(), 'template' => $myblock->getVar('template'), 'options' => $myblock->getVar('options'));
+ echo '<a href="blocksadmin.php">'. _AM_BADMIN .'</a> <span style="font-weight:bold;">»»</span> '._AM_CLONEBLOCK.'<br /><br />';
+ include 'blockform.php';
+ $form->display();
+ xoops_cp_footer();
+ exit();
+ }
+
+ 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")){
+ include_once(XOOPS_ROOT_PATH."/modules/system/language/".$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");
+ }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");
+ }
+
+ $block = new XoopsBlock($bid);
+ $clone =& $block->xoopsClone();
+ if (empty($bmodule)){
+ xoops_cp_header();
+ xoops_error(sprintf(_AM_NOTSELNG, _AM_VISIBLEIN));
+ xoops_cp_footer();
+ exit();
+ }
+
+ $clone->setVar('side', $bside);
+ $clone->setVar('weight', $bweight);
+ $clone->setVar('visible', $bvisible);
+ //$clone->setVar('content', $_POST['bcontent']);
+ $clone->setVar('title', $_POST['btitle']);
+ $clone->setVar('bcachetime', $bcachetime);
+ if (isset($options) && (count($options) > 0)){
+ $options = implode('|', $options);
+ $clone->setVar('options', $options);
+ }
+ $clone->setVar('bid', 0);
+ if ($block->getVar('block_type') == 'C' || $block->getVar('block_type') == 'E') {
+ $clone->setVar('block_type', 'E');
+ }else{
+ $clone->setVar('block_type', 'D');
+ }
+
+ $newid = $clone->store();
+ if (!$newid){
+ xoops_cp_header();
+ $clone->getHtmlErrors();
+ xoops_cp_footer();
+ exit();
+ }
+
+ if ($clone->getVar('template') != ''){
+ $tplfile_handler =& xoops_gethandler('tplfile');
+ $btemplate =& $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $bid);
+ if (count($btemplate) > 0){
+ $tplclone =& $btemplate[0]->xoopsClone();
+ $tplclone->setVar('tpl_id', 0);
+ $tplclone->setVar('tpl_refid', $newid);
+ $tplfile_handler->insert($tplclone);
+ }
+ }
+
+ $db =& XoopsDatabaseFactory::getDatabaseConnection();
+ foreach ($bmodule as $bmid){
+ $sql = 'INSERT INTO '.$db->prefix('block_module_link').' (block_id, module_id) VALUES ('.$newid.', '.$bmid.')';
+ $db->query($sql);
+ }
+ $groups =& $xoopsUser->getGroups();
+ $count = count($groups);
+ for ($i = 0; $i < $count; $i++){
+ $sql = "INSERT INTO ".$db->prefix('group_permission')." (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES (".$groups[$i].", ".$newid.", 1, 'block_read')";
+ $db->query($sql);
+ }
+
+ redirect_header('blocksadmin.php?op=listar',1,_AM_DBUPDATED);
+ }
+
+ function setar_ordem($bid, $title, $weight, $visible, $side){
+ $myblock = new XoopsBlock($bid);
+ $myblock->setVar('title', $title);
+ $myblock->setVar('weight', $weight);
+ $myblock->setVar('visible', $visible);
+ $myblock->setVar('side', $side);
+ $myblock->store();
+ }
+
+ if ( $op == "list" ){
+ mgo_adm_menu();
+ listar_blocos();
+ xoops_cp_footer();
+ exit();
+ }
+
+ if ( $op == "order" ){
+ if (!$GLOBALS['xoopsSecurity']->check()){
+ redirect_header($_SERVER['PHP_SELF'], 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
+ exit();
+ }
+
+foreach (array_keys($bid) as $i){
+ if ( $oldtitle[$i] != $title[$i] || $oldweight[$i] != $weight[$i] || $oldvisible[$i] != $visible[$i] || $oldside[$i] != $side[$i])
+ setar_ordem($bid[$i], $title[$i], $weight[$i], $visible[$i], $side[$i], $bmodule[$i]);
+ if(!empty($bmodule[$i]) && count($bmodule[$i]) > 0){
+ $sql = sprintf("DELETE FROM %s WHERE block_id = %u", $xoopsDB->prefix('block_module_link'), $bid[$i]);
+ $xoopsDB->query($sql);
+ if (in_array(0, $bmodule[$i])){
+ $sql = sprintf("INSERT INTO %s (block_id, module_id) VALUES (%u, %d)", $xoopsDB->prefix('block_module_link'), $bid[$i], 0);
+ $xoopsDB->query($sql);
+ }else{
+ foreach ($bmodule[$i] as $bmid){
+ $sql = sprintf("INSERT INTO %s (block_id, module_id) VALUES (%u, %d)", $xoopsDB->prefix('block_module_link'), $bid[$i], intval($bmid));
+ $xoopsDB->query($sql);
+ }
+ }
+ }
+
+ $sql = sprintf("DELETE FROM %s WHERE gperm_itemid = %u", $xoopsDB->prefix('group_permission'), $bid[$i]);
+ $xoopsDB->query($sql);
+ if(!empty($groups[$i])){
+ foreach ($groups[$i] as $grp){
+ $sql = sprintf("INSERT INTO %s (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES (%u, %u, 1, 'block_read')", $xoopsDB->prefix('group_permission'), $grp, $bid[$i]);
+ $xoopsDB->query($sql);
+ }
+ }
+ }
+
+ redirect_header($_SERVER['PHP_SELF'],1,MGO_ADM_SUCESS2);
+ exit();
+ }
+
+ if ($op == 'clone'){
+ clone_block($bid);
+ }
+
+ if ($op == 'clone_ok'){
+ clone_block_ok($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options);
+ }
+}else{
+ echo MGO_ADM_403;
+}
+
+?>
Modified: XoopsModules/mastop_go2/trunk/mastop_go2/admin/feedback.php
===================================================================
--- XoopsModules/mastop_go2/trunk/mastop_go2/admin/feedback.php 2014-02-24 10:15:11 UTC (rev 12330)
+++ XoopsModules/mastop_go2/trunk/mastop_go2/admin/feedback.php 2014-02-24 10:31:01 UTC (rev 12331)
@@ -1,63 +1,68 @@
<?php
### =============================================================
-### Mastop InfoDigital - Paix\xE3o por Internet
+### Mastop InfoDigital - Paixão por Internet
### =============================================================
-### Arquivo para Solicita\xE7\xE3o de Recursos
+### Arquivo para Solicitação de Recursos
### =============================================================
### Developer: Fernando Santos (topet05), fer...@ma...
-### Copyright: Mastop InfoDigital \xA9 2003-2007
+### Copyright: Mastop InfoDigital © 2003-2007
### -------------------------------------------------------------
### www.mastop.com.br
### =============================================================
### $Id$
### =============================================================
+
include 'admin_header.php';
$op = (isset($_GET['op'])) ? $_GET['op'] : 'feature';
+
if (isset($_GET)) {
- foreach ($_GET as $k => $v) {
- $$k = $v;
- }
+ foreach ($_GET as $k => $v) {
+ $$k = $v;
+ }
}
if (isset($_POST)) {
- foreach ($_POST as $k => $v) {
- $$k = $v;
- }
+ foreach ($_POST as $k => $v) {
+ $$k = $v;
+ }
}
+
switch ($op) {
- case 'salvar':
- $yname = $_POST['yname'];
- $yemail = $_POST['yemail'];
- $ydomain = $_POST['ydomain'];
- $feedback_type = $_POST['feedback_type'];
- $feedback_other = $_POST['feedback_other'];
- $titulo = "Mastop Go2 - FeedBack from ".$ydomain;
- $body = "<b>".$yname." (".$yemail.") - ".$ydomain."</b><br />";
- $body .= "Type: ".$feedback_type.((!empty($feedback_other)) ? " - ".$feedback_other : "")."<br />";
- $body .= $_POST['feedback_content'];
- $xoopsMailer =& getMailer();
- $xoopsMailer->useMail();
- $xoopsMailer->setToEmails('go...@ma...');
- $xoopsMailer->setFromEmail($yemail);
- $xoopsMailer->setFromName($yname);
- $xoopsMailer->setSubject($titulo);
- $xoopsMailer->multimailer->IsHTML(true);
- $xoopsMailer->setBody($body);
- $xoopsMailer->send();
- $msg = '
- <div align="center" style="width: 80%; padding: 10px; padding-top:0px; padding-bottom: 5px; border: 2px solid #9C9C9C; background-color: #F2F2F2; margin-right:auto;margin-left:auto;">
- <h3>'.MGO_ADM_FEEDSUCCESS.'</h3>
- </div>
- ';
- case 'feature':
- default:
- mgo_adm_menu();
- echo (!empty($msg)) ? $msg."<br />" : '';
- $form['titulo'] = MGO_ADM_FEEDBACKN;
- $form['op'] = "salvar";
- include XOOPS_ROOT_PATH."/modules/".MGO_MOD_DIR."/include/feedback.form.inc.php";
- $feedbackform->display();
- break;
+ case 'salvar':
+ $yname = $_POST['yname'];
+ $yemail = $_POST['yemail'];
+ $ydomain = $_POST['ydomain'];
+ $feedback_type = $_POST['feedback_type'];
+ $feedback_other = $_POST['feedback_other'];
+ $titulo = "Mastop Go2 - FeedBack from ".$ydomain;
+ $body = "<b>".$yname." (".$yemail.") - ".$ydomain."</b><br />";
+ $body .= "Type: ".$feedback_type.((!empty($feedback_other)) ? " - ".$feedback_other : "")."<br />";
+ $body .= $_POST['feedback_content'];
+ $xoopsMailer =& getMailer();
+ $xoopsMailer->useMail();
+ $xoopsMailer->setToEmails('go...@ma...');
+ $xoopsMailer->setFromEmail($yemail);
+ $xoopsMailer->setFromName($yname);
+ $xoopsMailer->setSubject($titulo);
+ $xoopsMailer->multimailer->IsHTML(true);
+ $xoopsMailer->setBody($body);
+ $xoopsMailer->send();
+ $msg = '
+ <div align="center" style="width: 80%; padding: 10px; padding-top:0px; padding-bottom: 5px; border: 2px solid #9C9C9C; background-color: #F2F2F2; margin-right:auto;margin-left:auto;">
+ <h3>'.MGO_ADM_FEEDSUCCESS.'</h3>
+ </div>
+ ';
+
+ case 'feature':
+ default:
+ mgo_adm_menu();
+ echo (!empty($msg)) ? $msg."<br />" : '';
+ $form['titulo'] = MGO_ADM_FEEDBACKN;
+ $form['op'] = "salvar";
+ include XOOPS_ROOT_PATH."/modules/".MGO_MOD_DIR."/include/feedback.form.inc.php";
+ $feedbackform->display();
+ break;
}
echo "<div align='center' style='margin-top:10px'><a href='http://www.mastop.com.br/produtos/go2/'><img src='images/mgo2_footer.gif'></a><br /><a style='color: #029116; font-size:11px' href='feedback.php'>".MGO_ADM_FEEDBACK."</a> - <a style='color: #FF0000; font-size:11px' href='http://www.mastop.com.br/produtos/go2/checkversion.php?lang=".$xoopsConfig['language']."&version=".round($xoopsModule->getVar('version') / 100, 2)."' target='_blank'>".MGO_ADM_CHKVERSION."</a></div>";
-xoops_cp_footer();
\ No newline at end of file
+xoops_cp_footer();
+?>
Modified: XoopsModules/mastop_go2/trunk/mastop_go2/admin/go2.php
===================================================================
--- XoopsModules/mastop_go2/trunk/mastop_go2/admin/go2.php 2014-02-24 10:15:11 UTC (rev 12330)
+++ XoopsModules/mastop_go2/trunk/mastop_go2/admin/go2.php 2014-02-24 10:31:01 UTC (rev 12331)
@@ -18,342 +18,328 @@
$op = (isset($_GET['op'])) ? $_GET['op'] : 'listar';
if (isset($_GET)) {
- foreach (
- $_GET as $k => $v
- ) {
- $$k = $v;
- }
+ foreach ($_GET as $k => $v) {
+ $$k = $v;
+ }
}
if (isset($_POST)) {
- foreach (
- $_POST as $k => $v
- ) {
- $$k = $v;
- }
+ foreach ($_POST as $k => $v) {
+ $$k = $v;
+ }
}
+
$sec_classe =& mgo_getClass(MGO_MOD_TABELA0);
$sec_todos = $sec_classe->pegaTudo();
$sec_select = array();
if ($sec_todos) {
- foreach (
- $sec_todos as $v
- ) {
- $sec_select[$v->getVar($v->id)] = $v->getVar("sec_30_nome");
- }
+ foreach ($sec_todos as $v) {
+ $sec_select[$v->getVar($v->id)] = $v->getVar("sec_30_nome");
+ }
}
+
if (!empty($_POST['group_action'])) {
- switch ($_POST['group_action']) {
- case "group_del":
- if (is_array($_POST['checks'])) {
- foreach (
- $_POST['checks'] as $k => $v
- ) {
- $go2_classe =& mgo_getClass(MGO_MOD_TABELA1, $k);
- $go2_classe->delete();
- }
- }
- redirect_header(XOOPS_URL . "/modules/" . MGO_MOD_DIR . "/admin/go2.php?op=listar", 3, MGO_ADM_SUCESS_UPD);
- break;
+ switch ($_POST['group_action']) {
+ case "group_del":
+ if (is_array($_POST['checks'])) {
+ foreach ($_POST['checks'] as $k => $v){
+ $go2_classe =& mgo_getClass(MGO_MOD_TABELA1, $k);
+ $go2_classe->delete();
+ }
+ }
+ redirect_header(XOOPS_URL . "/modules/" . MGO_MOD_DIR . "/admin/go2.php?op=listar", 3, MGO_ADM_SUCESS_UPD);
+ break;
- case "zera_count":
- if (is_array($_POST['checks'])) {
- foreach (
- $_POST['checks'] as $k => $v
- ) {
- ...
[truncated message content] |