|
From: <be...@us...> - 2013-09-20 23:11:31
|
Revision: 12072
http://sourceforge.net/p/xoops/svn/12072
Author: beckmi
Date: 2013-09-20 23:11:28 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
xGarage old Beta 3
Modified Paths:
--------------
XoopsModules/xgarage/trunk/xgarage/admin/functions.php
XoopsModules/xgarage/trunk/xgarage/admin/index.php
XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php
XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php
XoopsModules/xgarage/trunk/xgarage/garage.php
XoopsModules/xgarage/trunk/xgarage/include/functions.php
XoopsModules/xgarage/trunk/xgarage/index.php
XoopsModules/xgarage/trunk/xgarage/language/english/admin.php
XoopsModules/xgarage/trunk/xgarage/language/english/main.php
XoopsModules/xgarage/trunk/xgarage/language/english/modinfo.php
XoopsModules/xgarage/trunk/xgarage/sql/garage.sql
XoopsModules/xgarage/trunk/xgarage/templates/cat_index.html
XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html
XoopsModules/xgarage/trunk/xgarage/xoops_version.php
Added Paths:
-----------
XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php
XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php
XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php
XoopsModules/xgarage/trunk/xgarage/blocks/index.html
XoopsModules/xgarage/trunk/xgarage/class/index.html
XoopsModules/xgarage/trunk/xgarage/class/mygrouppermform.php
XoopsModules/xgarage/trunk/xgarage/images/icons/index.html
XoopsModules/xgarage/trunk/xgarage/images/index.html
XoopsModules/xgarage/trunk/xgarage/images/uploads/index.html
XoopsModules/xgarage/trunk/xgarage/include/gtickets.php
XoopsModules/xgarage/trunk/xgarage/include/index.html
XoopsModules/xgarage/trunk/xgarage/include/notification.inc.php
XoopsModules/xgarage/trunk/xgarage/language/english/index.html
XoopsModules/xgarage/trunk/xgarage/language/english/mail_template/
XoopsModules/xgarage/trunk/xgarage/language/english/mail_template/index.html
XoopsModules/xgarage/trunk/xgarage/language/english/mail_template/listing_newpost_notify.tpl
XoopsModules/xgarage/trunk/xgarage/language/index.html
XoopsModules/xgarage/trunk/xgarage/notification_update.php
XoopsModules/xgarage/trunk/xgarage/sql/index.html
XoopsModules/xgarage/trunk/xgarage/templates/blocks/index.html
XoopsModules/xgarage/trunk/xgarage/templates/index.html
Removed Paths:
-------------
XoopsModules/xgarage/trunk/xgarage/admin/error_log
Added: XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1,26 @@
+<?php
+include("../../../mainfile.php");
+include_once(XOOPS_ROOT_PATH."/class/xoopsmodule.php");
+include(XOOPS_ROOT_PATH."/include/cp_functions.php");
+
+ $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+
+ require_once( XOOPS_ROOT_PATH."/modules/$mydirname/include/gtickets.php" ) ;
+
+if ( $xoopsUser ) {
+ $xoopsModule = XoopsModule::getByDirname("garage");
+ if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+ redirect_header(XOOPS_URL."/",3,_NOPERM);
+ exit();
+ }
+} else {
+ redirect_header(XOOPS_URL."/",3,_NOPERM);
+ exit();
+}
+if ( file_exists("../language/".$xoopsConfig['language']."/admin.php") ) {
+ include("../language/".$xoopsConfig['language']."/admin.php");
+} else {
+ include("../language/english/admin.php");
+}
+$myts =& MyTextSanitizer::getInstance();
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: XoopsModules/xgarage/trunk/xgarage/admin/error_log
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/error_log 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/admin/error_log 2013-09-20 23:11:28 UTC (rev 12072)
@@ -1,3 +0,0 @@
-[09-Sep-2007 17:21:09] PHP Parse error: syntax error, unexpected ':' in /home/connectu/public_html/dev/modules/garage/admin/index.php on line 9
-[09-Sep-2007 17:21:47] PHP Parse error: syntax error, unexpected ';' in /home/connectu/public_html/dev/modules/garage/admin/index.php on line 262
-[09-Sep-2007 17:22:26] PHP Parse error: syntax error, unexpected ')' in /home/connectu/public_html/dev/modules/garage/admin/index.php on line 265
Modified: XoopsModules/xgarage/trunk/xgarage/admin/functions.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/functions.php 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/admin/functions.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -1,7 +1,7 @@
<?php
function getCats($gid){
global $xoopsDB;
- $sql = ("SELECT cid,name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE gid = '$gid' ORDER BY name");
+ $sql = "SELECT cid,name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE gid = '$gid' ORDER BY name";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getCats($gid)");
} else {
@@ -14,7 +14,7 @@
}
function getName($cid){
global $xoopsDB;
- $sql = "SELECT name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE cid = $cid";
+ $sql = "SELECT name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE cid = '$cid'";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getName($cid)");
} else {
@@ -23,20 +23,21 @@
return ($name);
}
}
-function addCat($name,$gid) {
+function addCat($name,$gid){
global $xoopsDB;
- $sql = $xoopsDB->query("INSERT INTO ".$xoopsDB->prefix("garage_cats")." VALUES ('','$name','$gid')");
- if (!$result = $sql) {
+ $sql = "INSERT INTO " . $xoopsDB->prefix("garage_cats") . " (name,gid) VALUES ('$name',$gid)";
+ if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: addCat($name,$gid)");
return 0;
- }else{
+ } else {
return 1;
}
+
}
function moveCat($cid,$gid){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage_cats") . " SET gid = $gid WHERE cid = $cid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage_cats") . " SET gid = $gid WHERE cid = '$cid'";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: moveCat($cid,$gid)");
return 0;
@@ -48,7 +49,7 @@
function check4Content($cid){
global $xoopsDB;
- $sql = "SELECT count(*) as count FROM " . $xoopsDB->prefix("garage") . " WHERE cid = $cid";
+ $sql = "SELECT count(*) as count FROM " . $xoopsDB->prefix("garage") . " WHERE cid = '$cid'";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: check4Content($cid)");
return 0;
@@ -61,7 +62,7 @@
function renameCat($cid,$catname){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage_cats") . " SET name = '$catname' WHERE cid = $cid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage_cats") . " SET name = '$catname' WHERE cid = '$cid'";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: renameCat($cid,$catname)");
return 0;
@@ -72,7 +73,7 @@
function approveGarage($gid){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET approved=1 WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET approved=1 WHERE id = '$gid'";
if ( !$result = $xoopsDB->queryF($sql) ) {
exit("$sql > SQL Error in function :: approveGarage($gid)");
} else {
@@ -82,7 +83,7 @@
function disableGarage($gid){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET disabled=1 WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET disabled=1 WHERE id = '$gid'";
if ( !$result = $xoopsDB->queryF($sql) ) {
exit("$sql > SQL Error in function :: disableGarage($gid)");
} else {
@@ -92,7 +93,7 @@
function enableGarage($gid){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET disabled=0 WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET disabled=0 WHERE id = '$gid'";
if ( !$result = $xoopsDB->queryF($sql) ) {
exit("$sql > SQL Error in function :: enableGarage($gid)");
} else {
@@ -101,7 +102,7 @@
}
function getActiveGarages(){
global $xoopsDB;
- $sql = ("SELECT id,name,viewable FROM " . $xoopsDB->prefix("garage") . " WHERE disabled=0 AND approved=1 ORDER BY name");
+ $sql = ("SELECT id,name,viewable FROM " . $xoopsDB->prefix("garage") . " WHERE disabled='0' AND approved='1' ORDER BY name");
$result=$xoopsDB->query($sql);
$rows = array();
while($row = $xoopsDB->fetchArray($result)) {
@@ -112,7 +113,7 @@
function getNewGarages(){
global $xoopsDB;
- $sql = ("SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE approved=0 ORDER BY name");
+ $sql = ("SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE approved='0' ORDER BY name");
$result=$xoopsDB->query($sql);
$rows = array();
while($row = $xoopsDB->fetchArray($result)) {
@@ -123,7 +124,7 @@
function getDisabledGarages(){
global $xoopsDB;
- $sql = ("SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE disabled=1 ORDER BY name");
+ $sql = ("SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE disabled='1' ORDER BY name");
$result=$xoopsDB->query($sql);
$rows = array();
while($row = $xoopsDB->fetchArray($result)) {
@@ -177,6 +178,7 @@
echo "<li id='" . $tblColors[2] . "'><a href=\"index.php?op=view_new\"><span>" . _AM_GARAGES_APPROVE . "</span></a></li>";
echo "<li id='" . $tblColors[3] . "'><a href=\"index.php?op=view_disabled\"><span>" . _AM_GARAGES_DISABLED . "</span></a></li>";
echo "<li id='" . $tblColors[4] . "'><a href=\"index.php?op=cats\"><span>" . _AM_GARAGES_CATEGORIES . "</span></a></li>";
+ echo "<li id='" . $tblColors[5] . "'><a href=\"garageperms.php\"><span>" . _AM_GARAGES_PERMISSIONS . "</span></a></li>";
echo "</ul></div>";
}
Added: XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1,93 @@
+<?php
+// $Id$
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System //
+// Copyright (c) 2000 XOOPS.org //
+// <http://www.xoops.org/> //
+// ------------------------------------------------------------------------ //
+// 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 //
+// ------------------------------------------------------------------------ //
+include_once("admin_header.php");
+include_once("functions.php");
+include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
+include_once XOOPS_ROOT_PATH . "/modules/".$xoopsModule->getVar("dirname")."/class/mygrouppermform.php";
+
+
+xoops_cp_header();
+adminMenu(5, _AM_GARAGES_PERMISSIONS);
+
+
+$permtoset= isset($_POST['permtoset']) ? intval($_POST['permtoset']) : 1;
+$selected=array('','','');
+$selected[$permtoset-1]=' selected';
+echo "<br /><br />";
+echo "<form method='post' name='gselperm' action='garageperms.php'><div><select name='permtoset' onChange='javascript: document.gselperm.submit()'><option value='1'".$selected[0].">"._AM_GARAGES_VIEWFORM."</option><option value='2'".$selected[1].">"._AM_GARAGES_SUBMITFORM."</option></select></div></form>";
+$module_id = $xoopsModule->getVar('mid');
+
+switch($permtoset)
+{
+ case 1:
+ $title_of_form = _AM_GARAGES_VIEWFORM;
+ $perm_name = "garage_view";
+ $perm_desc = _AM_GARAGES_VIEWFORM_DESC;
+ $item_list_view = array();
+ $block_view = array();
+ $result_view = $xoopsDB->query("SELECT cid, name FROM " . $xoopsDB->prefix("garage_cats") . " ");
+ if ($xoopsDB->getRowsNum($result_view)) {
+ while ($myrow_view = $xoopsDB->fetcharray($result_view)) {
+ $item_list_view['cid'] = $myrow_view['cid'];
+ $item_list_view['name'] = $myrow_view['name'];
+ $permform = new MyXoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc);
+ $block_view[] = $item_list_view;
+ foreach ($block_view as $itemlists) {
+ $permform->addItem($itemlists['cid'], $myts->displayTarea($itemlists['name']));
+ }
+ }
+}
+ break;
+
+ case 2:
+ $title_of_form = _AM_GARAGES_SUBMITFORM;
+ $perm_name = "garage_submit";
+ $perm_desc = _AM_GARAGES_SUBMITFORM_DESC;
+ $item_list_view = array();
+ $block_view = array();
+ $result_view = $xoopsDB->query("SELECT cid, name FROM " . $xoopsDB->prefix("garage_cats") . " ");
+ if ($xoopsDB->getRowsNum($result_view)) {
+ while ($myrow_view = $xoopsDB->fetcharray($result_view)) {
+ $item_list_view['cid'] = $myrow_view['cid'];
+ $item_list_view['name'] = $myrow_view['name'];
+ $permform = new MyXoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc);
+ $block_view[] = $item_list_view;
+ foreach ($block_view as $itemlists) {
+ $permform->addItem($itemlists['cid'], $myts->displayTarea($itemlists['name']));
+ }
+ }
+}
+ break;
+
+}
+
+echo $permform->render();
+echo "<br /><br /><br /><br />\n";
+unset ($permform);
+
+xoops_cp_footer();
+?>
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: XoopsModules/xgarage/trunk/xgarage/admin/index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/index.php 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/admin/index.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -3,20 +3,14 @@
include_once("functions.php");
settype($op,"string");
-if(!isset($_POST['op']) && isset($_GET['op']) ) {
- $op = $_GET['op'] ;
-}
-if (!isset($op)) {
- $op = '';
-}
-
+if(isset($_GET['op'])) $op = $_GET['op'];
+if(isset($_POST['op'])) $op = $_POST['op'];
//$op = isset($_GET['op']) ? $_GET['op'] : $_POST['op'];
-if(!isset($_POST['cid']) && isset($_GET['cid']) ) {
- $cid = intval($_GET['cid']);
+//$op = isset($_POST['op']) ? $_POST['op'] : '';
+if (!isset($_POST['cid']) && isset($_GET['cid']) ) {
+ $cid = $_GET['cid'];
}
-//$op = isset($_POST['op']) ? $_POST['op'] : '';
//$cid = isset($_GET['cid']) ? $_GET['cid'] : $_POST['cid'];
-//$cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
$pick = isset($_POST['pick']) ? intval($_POST['pick']) : 0;
$statussel = isset($_POST['statussel']) ? intval($_POST['statussel']) : 0;
$sortsel = isset($_POST['sortsel']) ? $_POST['sortsel'] : 'id';
@@ -24,11 +18,9 @@
$gid = isset($_GET['gid']) ? intval($_GET['gid']) : 0;
$self = $_SERVER['PHP_SELF'];
+global $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
+global $xoopsDB;
-
-global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule, $cattree;
-
-
$myts = &MyTextSanitizer::getInstance();
//echo("Hellow World.");
@@ -90,10 +82,10 @@
else {
xoops_cp_header();
adminMenu(1, _AM_GARAGES_INDEX);
- echo "<div style='height:25px;'> </div>";
+ echo("<div style='height:25px;'> </div>");
xoops_confirm(array('op' => 'delgarage', 'gid' => $gid, 'subop' => 'delok'), 'index.php', _AM_CONFIRMDELETE);
}
- echo "</p>";
+ echo("</p>");
break;
@@ -108,7 +100,7 @@
for($x=0;$x<count($names);$x++){
echo("<div style=\"margin-left:100px;\"><a href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
}
- else echo "<div>"._AM_NONENEW."</div>";
+ else echo("<div>"._AM_NONENEW."</div>");
break;
case "view_disabled":
@@ -127,15 +119,14 @@
case "add_cat":
//echo("testing123");
//adminMenu(4, _AM_GARAGES_CATEGORIES);
- if($_POST['catname']) {
+ if($_POST['catname']){
$success = addCat($_POST['catname'],$_POST['gid']);
- if ($success) {
- redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDED);
+ if($success){
+ redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDED);
exit;
- } else {
- redirect_header("index.php?op=cats&cid=$cid", 5, _AM_CATEGORYADDERROR);
- }
+ } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDERROR);
}
+
break;
case "move_cat":
//echo("testing123");
@@ -236,10 +227,10 @@
xoops_cp_header();
adminMenu(4, _AM_GARAGES_CATEGORIES);
include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
-
$cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
- if(!$cid) $cid = '0';
+
+ $cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
$path = $cattree->getNicePathFromId($cid, "name", $self."?op=cats");
echo "<a href='index.php?op=cats&cid=0'><img src='../images/icons/index.png' align='middle' title='"._AM_GARAGES_INDEX."' alt='"._AM_GARAGES_INDEX."'></a> ".$path;
@@ -258,11 +249,11 @@
// add new cat
echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
echo("<form method='post' action='index.php'>");
- echo(""._AM_NEWCATNAME."<input type='text' name='catname'><br/>"._AM_PARENT);
- $cattree->makeMySelBox("name","",$cid, true,"gid");
- echo("<input type='hidden' name='cid' value='$cid' />");
- echo("<input type='hidden' name='op' value='add_cat' />");
- echo("<br/><input type='submit' value='"._AM_ADDNEWCAT."' />");
+ echo(_AM_NEWCATNAME."<input type='text' name='catname'><br/>"._AM_PARENT);
+ $cattree->makeMySelBox("name","",$cid,true,"gid");
+ echo("<input type='hidden' name='cid' value='$cid'>");
+ echo("<input type='hidden' name='op' value='add_cat'>");
+ echo("<br/><input type='submit' value='"._AM_ADDNEWCAT."'>");
echo("</form>");
echo("</div>");
echo("<br/>");
@@ -270,7 +261,7 @@
if($cid){
echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
echo("<form method='post' action='index.php'>");
- echo(""._AM_MOVECAT."<br/>"._AM_PARENT."");
+ echo(_AM_MOVECAT."<br/>"._AM_PARENT);
$cattree->makeMySelBox("name","",$cid,true,"gid");
echo("<input type='hidden' name='cid' value='$cid'>");
echo("<input type='hidden' name='op' value='move_cat'>");
@@ -331,15 +322,15 @@
xoops_cp_header();
adminMenu(6, _AM_GARAGES_DONATIONS);
- echo "<div style='text-align:center;'>"._AM_INTRO."<br/><br/><br/>";
+ echo("<div style='text-align:center;'>"._AM_INTRO."<br/><br/><br/>");
- echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+ echo('<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----
">
-</form>';
+</form>');
@@ -355,9 +346,9 @@
for($x=0;$x<count($names);$x++){
if($names[$x]['viewable']) $viewable="color:#000000;";
else $viewable="color:#cccccc;";
- echo "<div style=\"margin-left:100px;\"><a style='$viewable' href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>";
+ echo("<div style=\"margin-left:100px;\"><a style='$viewable' href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
}
- else echo "<div>"._AM_NONEACTIVE."</div>";
+ else echo("<div>"._AM_NONEACTIVE."</div>");
break;
}
Added: XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1,70 @@
+<?php
+// $Id$
+
+include '../../../include/cp_header.php';
+$modid = isset($_POST['modid']) ? intval($_POST['modid']) : 0;
+
+// we dont want system module permissions to be changed here
+if ($modid <= 1 || !is_object($xoopsUser) || !$xoopsUser->isAdmin($modid)) {
+ redirect_header(XOOPS_URL.'/index.php', 1, _NOPERM);
+ exit();
+}
+$module_handler =& xoops_gethandler('module');
+$module =& $module_handler->get($modid);
+if (!is_object($module) || !$module->getVar('isactive')) {
+ redirect_header(XOOPS_URL.'/admin.php', 1, _MODULENOEXIST);
+ exit();
+}
+$member_handler =& xoops_gethandler('member');
+$group_list =& $member_handler->getGroupList();
+if (is_array($_POST['perms']) && !empty($_POST['perms'])) {
+ $gperm_handler = xoops_gethandler('groupperm');
+ foreach ($_POST['perms'] as $perm_name => $perm_data) {
+ if (false != $gperm_handler->deleteByModule($modid, $perm_name)) {
+ foreach ($perm_data['groups'] as $group_id => $item_ids) {
+ foreach ($item_ids as $item_id => $selected) {
+ if ($selected == 1) {
+ // make sure that all parent ids are selected as well
+ if ($perm_data['parents'][$item_id] != '') {
+ $parent_ids = explode(':', $perm_data['parents'][$item_id]);
+ foreach ($parent_ids as $pid) {
+ if ($pid != 0 && !in_array($pid, array_keys($item_ids))) {
+ // one of the parent items were not selected, so skip this item
+ $msg[] = sprintf(_AM_GARAGES_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>').' ('._AM_GARAGES_PERMADDNGP.')';
+ continue 2;
+ }
+ }
+ }
+ $gperm =& $gperm_handler->create();
+ $gperm->setVar('gperm_groupid', $group_id);
+ $gperm->setVar('gperm_name', $perm_name);
+ $gperm->setVar('gperm_modid', $modid);
+ $gperm->setVar('gperm_itemid', $item_id);
+ if (!$gperm_handler->insert($gperm)) {
+ $msg[] = sprintf(_AM_GARAGES_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>');
+ } else {
+ $msg[] = sprintf(_AM_GARAGES_PERMADDOK, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>');
+ }
+ unset($gperm);
+ }
+ }
+ }
+ } else {
++ $msg[] = sprintf(_AM_GARAGES_PERMRESETNG, $module->getVar('name').'('.$perm_name.')');
+ }
+ }
+}
+
+$backlink = XOOPS_URL.'/admin.php';
+if ($module->getVar('hasadmin')) {
+ $adminindex = isset($_POST['redirect_url']) ? $_POST['redirect_url'] : $module->getInfo('adminindex');
+ if ($adminindex) {
+ $backlink = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/admin/garageperms.php';
+ }
+}
+
+$msg[] = '<br /><br /><a href="'.$backlink.'">'._BACK.'</a>';
+xoops_cp_header();
+xoops_result($msg);
+xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/blocks/index.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/blocks/index.html (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/blocks/index.html 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xgarage/trunk/xgarage/class/index.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/class/index.html (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/class/index.html 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xgarage/trunk/xgarage/class/mygrouppermform.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/class/mygrouppermform.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/class/mygrouppermform.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1,323 @@
+<?php
+// $Id$
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System //
+// Copyright (c) 2000-2003 XOOPS.org //
+// <http://www.xoops.org/> //
+// ------------------------------------------------------------------------ //
+// 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: Kazumi Ono (AKA onokazu) //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project //
+// ------------------------------------------------------------------------- //
+if (!defined('XOOPS_ROOT_PATH')) {
+ die("XOOPS root path not defined");
+}
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php';
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhidden.php';
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/formbutton.php';
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelementtray.php';
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/form.php';
+
+/**
+ * Renders a form for setting module specific group permissions
+ *
+ * @author Kazumi Ono <on...@my...>
+ * @copyright copyright (c) 2000-2003 XOOPS.org
+ * @package kernel
+ * @subpackage form
+ */
+class MyXoopsGroupPermForm extends XoopsForm
+{
+ /**
+ * Module ID
+ *
+ * @var int
+ */
+ var $_modid;
+ /**
+ * Tree structure of items
+ *
+ * @var array
+ */
+ var $_itemTree;
+ /**
+ * Name of permission
+ *
+ * @var string
+ */
+ var $_permName;
+ /**
+ * Description of permission
+ *
+ * @var string
+ */
+ var $_permDesc;
+
+ /**
+ * Constructor
+ */
+ function MyXoopsGroupPermForm($title, $modid, $permname, $permdesc, $url = "")
+ {
+ global $xoopsModule;
+ $this->XoopsForm($title, 'groupperm_form', XOOPS_URL . "/modules/".$xoopsModule->getVar("dirname")."/admin/mygroupperm.php", 'post');
+ $this->_modid = intval($modid);
+ $this->_permName = $permname;
+ $this->_permDesc = $permdesc;
+ $this->addElement(new XoopsFormHidden('modid', $this->_modid));
+ if ($url != "") {
+ $this->addElement(new XoopsFormHidden('redirect_url', $url));
+ }
+ }
+
+ /**
+ * Adds an item to which permission will be assigned
+ *
+ * @param string $itemName
+ * @param int $itemId
+ * @param int $itemParent
+ * @access public
+ */
+ function addItem($itemId, $itemName, $itemParent = 0)
+ {
+ $this->_itemTree[$itemParent]['children'][] = $itemId;
+ $this->_itemTree[$itemId]['parent'] = $itemParent;
+ $this->_itemTree[$itemId]['name'] = $itemName;
+ $this->_itemTree[$itemId]['id'] = $itemId;
+ }
+
+ /**
+ * Loads all child ids for an item to be used in javascript
+ *
+ * @param int $itemId
+ * @param array $childIds
+ * @access private
+ */
+ function _loadAllChildItemIds($itemId, &$childIds)
+ {
+ if (!empty($this->_itemTree[$itemId]['children'])) {
+ $first_child = $this->_itemTree[$itemId]['children'];
+ foreach ($first_child as $fcid) {
+ array_push($childIds, $fcid);
+ if (!empty($this->_itemTree[$fcid]['children'])) {
+ foreach ($this->_itemTree[$fcid]['children'] as $_fcid) {
+ array_push($childIds, $_fcid);
+ $this->_loadAllChildItemIds($_fcid, $childIds);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Renders the form
+ *
+ * @return string
+ * @access public
+ */
+ function render()
+ {
+ // load all child ids for javascript codes
+ foreach (array_keys($this->_itemTree)as $item_id) {
+ $this->_itemTree[$item_id]['allchild'] = array();
+ $this->_loadAllChildItemIds($item_id, $this->_itemTree[$item_id]['allchild']);
+ }
+ $gperm_handler =& xoops_gethandler('groupperm');
+ $member_handler =& xoops_gethandler('member');
+ $glist =& $member_handler->getGroupList();
+ foreach (array_keys($glist) as $i) {
+ // get selected item id(s) for each group
+ $selected = $gperm_handler->getItemIds($this->_permName, $i, $this->_modid);
+ $ele = new XoopsGroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected);
+ $ele->setOptionTree($this->_itemTree);
+ $this->addElement($ele);
+ unset($ele);
+ }
+ $tray = new XoopsFormElementTray('');
+ $tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
+ $tray->addElement(new XoopsFormButton('', 'reset', _CANCEL, 'reset'));
+ $this->addElement($tray);
+ $ret = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br />';
+ $ret .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1'>\n";
+ $elements =& $this->getElements();
+ foreach (array_keys($elements) as $i) {
+ if (!is_object($elements[$i])) {
+ $ret .= $elements[$i];
+ } elseif (!$elements[$i]->isHidden()) {
+ $ret .= "<tr valign='top' align='left'><td class='head'>" . $elements[$i]->getCaption();
+ if ($elements[$i]->getDescription() != '') {
+ $ret .= '<br /><br /><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>';
+ }
+ $ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n";
+ } else {
+ $ret .= $elements[$i]->render();
+ }
+ }
+ $ret .= '</table></form>';
+ return $ret;
+ }
+}
+
+/**
+ * Renders checkbox options for a group permission form
+ *
+ * @author Kazumi Ono <on...@my...>
+ * @copyright copyright (c) 2000-2003 XOOPS.org
+ * @package kernel
+ * @subpackage form
+ */
+class XoopsGroupFormCheckBox extends XoopsFormElement
+{
+ /**
+ * Pre-selected value(s)
+ *
+ * @var array;
+ */
+ var $_value = array();
+ /**
+ * Group ID
+ *
+ * @var int
+ */
+ var $_groupId;
+ /**
+ * Option tree
+ *
+ * @var array
+ */
+ var $_optionTree;
+
+ /**
+ * Constructor
+ */
+ function XoopsGroupFormCheckBox($caption, $name, $groupId, $values = null)
+ {
+ $this->setCaption($caption);
+ $this->setName($name);
+ if (isset($values)) {
+ $this->setValue($values);
+ }
+ $this->_groupId = $groupId;
+ }
+
+ /**
+ * Sets pre-selected values
+ *
+ * @param mixed $value A group ID or an array of group IDs
+ * @access public
+ */
+ function setValue($value)
+ {
+ if (is_array($value)) {
+ foreach ($value as $v) {
+ $this->setValue($v);
+ }
+ } else {
+ $this->_value[] = $value;
+ }
+ }
+
+ /**
+ * Sets the tree structure of items
+ *
+ * @param array $optionTree
+ * @access public
+ */
+ function setOptionTree(&$optionTree)
+ {
+ $this->_optionTree =& $optionTree;
+ }
+
+ /**
+ * Renders checkbox options for this group
+ *
+ * @return string
+ * @access public
+ */
+ function render()
+ {
+ $ret = '<table class="outer"><tr><td class="odd"><table><tr>';
+ $cols = 1;
+ foreach ($this->_optionTree[0]['children'] as $topitem) {
+ if ($cols > 4) {
+ $ret .= '</tr><tr>';
+ $cols = 1;
+ }
+ $tree = '<td>';
+ $prefix = '';
+ $this->_renderOptionTree($tree, $this->_optionTree[$topitem], $prefix);
+ $ret .= $tree.'</td>';
+ $cols++;
+ }
+ $ret .= '</tr></table></td><td class="even">';
+ foreach (array_keys($this->_optionTree) as $id) {
+ if (!empty($id)) {
+ $option_ids[] = "'".$this->getName().'[groups]['.$this->_groupId.']['.$id.']'."'";
+ }
+ }
+ $checkallbtn_id = $this->getName().'[checkallbtn]['.$this->_groupId.']';
+ $option_ids_str = implode(', ', $option_ids);
+ $ret .= _ALL." <input id=\"".$checkallbtn_id."\" type=\"checkbox\" value=\"\" onclick=\"var optionids = new Array(".$option_ids_str."); xoopsCheckAllElements(optionids, '".$checkallbtn_id."');\" />";
+ $ret .= '</td></tr></table>';
+ return $ret;
+ }
+
+ /**
+ * Renders checkbox options for an item tree
+ *
+ * @param string $tree
+ * @param array $option
+ * @param string $prefix
+ * @param array $parentIds
+ * @access private
+ */
+ function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array())
+ {
+ $tree .= $prefix . "<input type=\"checkbox\" name=\"" . $this->getName() . "[groups][" . $this->_groupId . "][" . $option['id'] . "]\" id=\"" . $this->getName() . "[groups][" . $this->_groupId . "][" . $option['id'] . "]\" onclick=\"";
+ // If there are parent elements, add javascript that will
+ // make them selecteded when this element is checked to make
+ // sure permissions to parent items are added as well.
+ foreach ($parentIds as $pid) {
+ $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']';
+ $tree .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if(ele.checked != true) {ele.checked = this.checked;}";
+ }
+ // If there are child elements, add javascript that will
+ // make them unchecked when this element is unchecked to make
+ // sure permissions to child items are not added when there
+ // is no permission to this item.
+ foreach ($option['allchild'] as $cid) {
+ $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']';
+ $tree .= "var ele = xoopsGetElementById('" . $child_ele . "'); if(this.checked != true) {ele.checked = false;}";
+ }
+ $tree .= '" value="1"';
+ if (in_array($option['id'], $this->_value)) {
+ $tree .= ' checked="checked"';
+ }
+ $tree .= " />" . $option['name'] . "<input type=\"hidden\" name=\"" . $this->getName() . "[parents][" . $option['id'] . "]\" value=\"" . implode(':', $parentIds). "\" /><input type=\"hidden\" name=\"" . $this->getName() . "[itemname][" . $option['id'] . "]\" value=\"" . htmlspecialchars($option['name']). "\" /><br />\n";
+ if (isset($option['children'])) {
+ foreach ($option['children'] as $child) {
+ array_push($parentIds, $option['id']);
+ $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . ' -', $parentIds);
+ }
+ }
+ }
+}
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/class/mygrouppermform.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -13,19 +13,19 @@
<p>XOOPS - <a href="http://www.xoops.org/">http://www.xoops.org/ </a></p>
<p>Script_fu - for his encouragement to get this module done. </p>
<p>gtop00 - thanks for the debaits, on how we should get this working. </p>
-<p>exbanious - You inspired many to make or ask for a garage module. </p>
+<p>exbanious - You inspired many to make or ask for a agarage module. </p>
<p>Mudnuts4x4 - he was the original person to ask for a module like the phpBB garage,<br>
Sorry, its not phpbb, but its close, without a lawsuite. and its original to xoops, and no-one else.</p>
<p><br>
-<strong>Translators:</strong></p>
+ <strong>Translators:</strong></p>
<p>English - Northern <br>
-German - <br>
-Japanese - <br>
+ German - <br>
+ Japanese - <br>
Portuguese - <br>
Greek - <br>
French - <br>
-Dutch - <br>
+Dutch -<br>
Danish - <br>
</p>
<p> </p>
Modified: XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -7,11 +7,11 @@
</head>
<body>
-<h1>Garage Module for XOOPS 2.0 User's Manual </h1>
+<h1>Garages Module for XOOPS 2.0 User's Manual </h1>
<hr>
<p>Add new garage: </p>
<p>Name and Description are required.<br>
- To upload an image, edit your garage afer its added, if site allows image uploads. </p>
+ To upload an image, edit your garage afer its adde, if site allows image uploads. </p>
<p>Edit Garage:</p>
<p>In some web sites, changes must be requested.</p>
<p> </p>
Modified: XoopsModules/xgarage/trunk/xgarage/garage.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -1,5 +1,29 @@
<?php
require('header.php');
+
+
+//Group Perms added by jlm69
+$module_id = $xoopsModule->getVar('mid');
+
+if (is_object($xoopsUser)) {
+$groups = $xoopsUser->getGroups();
+} else {
+$groups = XOOPS_GROUP_ANONYMOUS;
+}
+$gperm_handler =& xoops_gethandler('groupperm');
+if (isset($_POST['item_id'])) {
+$perm_itemid = intval($_POST['item_id']);
+} else {
+$perm_itemid = 0;
+}
+//If no access
+if (!$gperm_handler->checkRight("garage_submit", $perm_itemid, $groups, $module_id)) {
+ redirect_header(XOOPS_URL."/index.php", 3, _NOPERM);
+exit();
+}
+// End Group Perms
+
+
require(XOOPS_ROOT_PATH.'/header.php');
include("include/functions.php");
@@ -8,10 +32,12 @@
settype($url, "string");
settype($name, "string");
settype($image, "string");
+settype($imagechoice, "string");
settype($location, "string");
+settype($year, "string");
settype($make, "string");
settype($model, "string");
-settype($year, "string");
+settype($style, "string");
settype($engine, "string");
settype($color, "string");
settype($rt, "string");
@@ -79,9 +105,10 @@
$url = $myts->makeTboxData4Save($_POST['url']);
$location = $myts->makeTboxData4Save($_POST['location']);
+ $year = $myts->makeTboxData4Save($_POST['year']);
$make = $myts->makeTboxData4Save($_POST['make']);
$model = $myts->makeTboxData4Save($_POST['model']);
- $year = $myts->makeTboxData4Save($_POST['year']);
+ $style = $myts->makeTboxData4Save($_POST['style']);
$engine = $myts->makeTboxData4Save($_POST['engine']);
$color = $myts->makeTboxData4Save($_POST['color']);
$rt = $myts->makeTboxData4Save($_POST['rt']);
@@ -106,7 +133,31 @@
include("image_uploader.php");
- $success = addGarage($a,$uid,$cid,$name,$image,$imageupload,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+ $success = addGarage($a,$uid,$cid,$name,$image,$imageupload,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+
+
+if($success) {
+$notification_handler =& xoops_gethandler('notification');
+$id = $xoopsDB->getInsertId();
+$tags=array();
+$tags['YEAR'] = $year;
+$tags['MAKE'] = $make;
+$tags['MODEL'] = $model;
+$tags['LINK_URL'] = XOOPS_URL . '/modules/garage/index.php?op=view&gid=' . addslashes($id);
+$sql = "SELECT name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE cid=" . addslashes($_POST['cid']);
+$result2 = $xoopsDB->query($sql);
+$row = $xoopsDB->fetchArray($result2);
+
+$tags['CATEGORY_TITLE'] = $row['name'];
+$tags['CATEGORY_URL'] = XOOPS_URL . '/modules/garage/index.php?cid="' . addslashes($cid);
+$notification_handler =& xoops_gethandler('notification');
+$notification_handler->triggerEvent('global', 0, 'new_listing', $tags);
+$notification_handler->triggerEvent('category', $cid, 'new_listing', $tags);
+$notification_handler->triggerEvent ('listing', $gid, 'new_listing', $tags );
+
+
+}
+
if($success) redirect_header("index.php",2,_MD_XG_ADDSUCCESS);
else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
} else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
@@ -133,9 +184,10 @@
if(!$imagechoice) $imagechoice = "0";
$url = $myts->makeTboxData4Save($_POST['url']);
$location = $myts->makeTboxData4Save($_POST['location']);
+ $year = $myts->makeTboxData4Save($_POST['year']);
$make = $myts->makeTboxData4Save($_POST['make']);
$model = $myts->makeTboxData4Save($_POST['model']);
- $year = $myts->makeTboxData4Save($_POST['year']);
+ $style = $myts->makeTboxData4Save($_POST['style']);
$engine = $myts->makeTboxData4Save($_POST['engine']);
$color = $myts->makeTboxData4Save($_POST['color']);
$rt = $myts->makeTboxData4Save($_POST['rt']);
@@ -163,8 +215,8 @@
if($errmsg) $wtime = 15;
else $wtime = 3;
if(($uid == $puid && $xoopsModuleConfig['canuseredit']) || $userIsAdmin){
- if($msg) $success = updateGaragePlusUpload($gid,$ouid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
- else $success = updateGarage($gid,$ouid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+ if($msg) $success = updateGaragePlusUpload($gid,$ouid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+ else $success = updateGarage($gid,$ouid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
if($success) redirect_header("index.php?op=view&gid=$gid",$wtime,_MD_XG_UPDATESUCCESS.$errmsg.$msg);
else redirect_header("index.php?op=view&gid=$gid",$wtime,_MD_XG_UPDATEFAILURE.$errmsg.$msg);
@@ -195,7 +247,6 @@
}
}
}
-
if(!$url) $url = "http://";
include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
$sform = new XoopsThemeForm(_MD_XG_ADDGARAGE, "garageform", xoops_getenv('PHP_SELF'));
@@ -227,9 +278,10 @@
}
$sform->addElement(new XoopsFormText(_MD_XG_URL, 'url', 50, 255, $url), false);
$sform->addElement(new XoopsFormText(_MD_XG_LOCATION, 'location', 50, 75, $location), false);
+ $sform->addElement(new XoopsFormText(_MD_XG_YEAR, 'year', 50, 75, $year), false);
$sform->addElement(new XoopsFormText(_MD_XG_MAKE, 'make', 50, 75, $make), false);
$sform->addElement(new XoopsFormText(_MD_XG_MODEL, 'model', 50, 75, $model), false);
- $sform->addElement(new XoopsFormText(_MD_XG_YEAR, 'year', 50, 75, $year), false);
+ $sform->addElement(new XoopsFormText(_MD_XG_STYLE, 'style', 50, 75, $style), false);
$sform->addElement(new XoopsFormText(_MD_XG_ENGINE, 'engine', 50, 75, $engine), false);
$sform->addElement(new XoopsFormText(_MD_XG_COLOR, 'color', 50, 75, $color), false);
$sform->addElement(new XoopsFormText(_MD_XG_RT, 'rt', 50, 75, $rt), false);
@@ -241,13 +293,13 @@
$sform->addElement(new XoopsFormText(_MD_XG_QUART, 'quart', 50, 75, $quart), false);
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
$sform->addElement(new XoopsFormText($xoopsModuleConfig['listname'], 'list', 50, 255, $list), false);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MFUTURE, 'mfuture', $mfuture, 20, 40), true);
- if($xoopsModuleConfig['usedescript2']) $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_DESCRIPT2, 'descript2', $descript2, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 10, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 10, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MINTERIOR, 'minterior', $minterior, 10, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 10, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 10, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 10, 40), true);
+ if($xoopsModuleConfig['usedescript2']) $sform->addElement(getEditor(_MD_XG_DESCRIPT2, 'descript2', $descript2, 10, 40), false);
if($xoopsModuleConfig['linkgarage']){
$linkgarage_choice = new XoopsFormRadio(_MD_XG_LINKGARAGE,'linkgarage',$linkgarage);
$linkgarage_choice->addOption(0,_MD_XG_NOLINKTOUSER);
@@ -276,9 +328,10 @@
$imagechoice = $garage['imagechoice'];
$url = $garage['url'];
$location = $garage['location'];
+ $year = $garage['year'];
$make = $garage['make'];
$model = $garage['model'];
- $year = $garage['year'];
+ $style = $garage['style'];
$engine = $garage['engine'];
$color = $garage['color'];
$rt = $garage['rt'];
@@ -335,9 +388,10 @@
}
$sform->addElement(new XoopsFormText(_MD_XG_URL, 'url', 50, 255, $url), false);
$sform->addElement(new XoopsFormText(_MD_XG_LOCATION, 'location', 50, 75, $location), false);
+ $sform->addElement(new XoopsFormText(_MD_XG_YEAR, 'year', 50, 75, $year), false);
$sform->addElement(new XoopsFormText(_MD_XG_MAKE, 'make', 50, 75, $make), false);
$sform->addElement(new XoopsFormText(_MD_XG_MODEL, 'model', 50, 75, $model), false);
- $sform->addElement(new XoopsFormText(_MD_XG_YEAR, 'year', 50, 75, $year), false);
+ $sform->addElement(new XoopsFormText(_MD_XG_STYLE, 'style', 50, 75, $style), false);
$sform->addElement(new XoopsFormText(_MD_XG_ENGINE, 'engine', 50, 75, $engine), false);
$sform->addElement(new XoopsFormText(_MD_XG_COLOR, 'color', 50, 75, $color), false);
$sform->addElement(new XoopsFormText(_MD_XG_RT, 'rt', 50, 75, $rt), false);
@@ -349,13 +403,13 @@
$sform->addElement(new XoopsFormText(_MD_XG_QUART, 'quart', 50, 75, $quart), false);
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
$sform->addElement(new XoopsFormText($xoopsModuleConfig['listname'], 'list', 50, 255, $list), false);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MFUTURE, 'mfuture', $mfuture, 20, 40), true);
- if($xoopsModuleConfig['usedescript2']) $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_DESCRIPT2, 'descript2', $descript2, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 20, 40), true);
+ if($xoopsModuleConfig['usedescript2']) $sform->addElement(getEditor(_MD_XG_DESCRIPT2, 'descript2', $descript2, 20, 40), false);
if($xoopsModuleConfig['linkgarage']){
$linkgarage_choice = new XoopsFormRadio(_MD_XG_LINKGARAGE,'linkgarage',$linkgarage);
$linkgarage_choice->addOption(0,_MD_XG_NOLINKTOUSER);
@@ -378,7 +432,7 @@
$redirect_url = "index.php";
$redirect_msg = _MD_XG_CANNOTCHANGE;
}
- redirect_header($redirect_url,2,$redirect_msg);
+ redirect_header($redirect_url,8,$redirect_msg);
exit;
}
}
Added: XoopsModules/xgarage/trunk/xgarage/images/icons/index.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/images/icons/index.html (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/images/icons/index.html 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xgarage/trunk/xgarage/images/index.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/images/index.html (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/images/index.html 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xgarage/trunk/xgarage/images/uploads/index.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/images/uploads/index.html (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/images/uploads/index.html 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/include/functions.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/include/functions.php 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/include/functions.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -16,7 +16,7 @@
function getGarage($gid){
global $xoopsDB;
- $sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,make,model,year,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkGarage FROM " . $xoopsDB->prefix("garage") . " WHERE id = $gid";
+ $sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage FROM " . $xoopsDB->prefix("garage") . " WHERE id = $gid";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getGarage()");
}
@@ -27,31 +27,31 @@
return $Garage;
}
-function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
+function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
global $xoopsDB;
- $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,make,model,year,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkGarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$make','$model','$year','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkGarage')";
+ $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$year','$make','$model','$style','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkgarage')";
if ( !$result = $xoopsDB->query($sql) ) {
- exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage)");
+ exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage)");
} else {
return...
[truncated message content] |