@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | $coupon = new efqCouponHandler(); |
54 | 54 | if ($itemid) { |
55 | - $coupons = $coupon->getByItem($itemid); |
|
55 | + $coupons = $coupon->getByItem($itemid); |
|
56 | 56 | } |
57 | 57 | $sql = "SELECT itemid, title FROM ".$xoopsDB->prefix("efqdiralpha1_items")." WHERE itemid=".$itemid.""; |
58 | 58 | $item_result = $xoopsDB->query($sql); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $xoopsTpl->append('coupons', array('couponid' => $coup['couponid'], 'itemid' => $coup['itemid'], 'descr' => $myts->makeTareaData4Show($coup['descr']), 'image' => $coup['image'], 'publish' => $coup['publish'], 'expire' => $coup['expire'], 'heading' => $coup['heading'], 'lbr' => $coup['lbr'])); |
71 | 71 | } |
72 | 72 | if ($xoopsUser) { |
73 | - $xoopsTpl->assign('admin', $xoopsUser->isAdmin($xoopsModule->mid())); |
|
73 | + $xoopsTpl->assign('admin', $xoopsUser->isAdmin($xoopsModule->mid())); |
|
74 | 74 | } |
75 | 75 | $xoopsTpl->assign('moddir', $moddir); |
76 | 76 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | // ------------------------------------------------------------------------ // |
37 | 37 | |
38 | 38 | include "header.php"; |
39 | -$myts =& MyTextSanitizer::getInstance();// MyTextSanitizer object |
|
39 | +$myts = & MyTextSanitizer::getInstance(); // MyTextSanitizer object |
|
40 | 40 | include_once XOOPS_ROOT_PATH.'/class/module.errorhandler.php'; |
41 | 41 | include_once "class/class.couponhandler.php"; |
42 | 42 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $item_result = $xoopsDB->query($sql); |
59 | 59 | $numrows = $xoopsDB->getRowsNum($item_result); |
60 | 60 | //echo $numrows; |
61 | -while(list($itemid, $itemtitle) = $xoopsDB->fetchRow($item_result)) { |
|
61 | +while (list($itemid, $itemtitle) = $xoopsDB->fetchRow($item_result)) { |
|
62 | 62 | $title = $myts->makeTboxData4Show($itemtitle); |
63 | 63 | $item = $itemid; |
64 | 64 | } |
@@ -49,22 +49,22 @@ discard block |
||
49 | 49 | $moddir = $xoopsModule->getvar("dirname"); |
50 | 50 | |
51 | 51 | if (isset($_GET["item"])) { |
52 | - $get_itemid = intval($_GET["item"]); |
|
52 | + $get_itemid = intval($_GET["item"]); |
|
53 | 53 | } |
54 | 54 | if (isset($_POST["item"])) { |
55 | - $post_itemid = intval($_POST["item"]); |
|
55 | + $post_itemid = intval($_POST["item"]); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | if (isset($_POST["dirid"])) { |
59 | - $post_dirid = intval($_POST["dirid"]); |
|
59 | + $post_dirid = intval($_POST["dirid"]); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $eh = new ErrorHandler; //ErrorHandler object |
63 | 63 | |
64 | 64 | if (isset($_GET["op"])) { |
65 | - $op = $_GET["op"]; |
|
65 | + $op = $_GET["op"]; |
|
66 | 66 | } else if (isset($_POST["op"])) { |
67 | - $op = $_POST["op"]; |
|
67 | + $op = $_POST["op"]; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | if (!empty($_POST['submit'])) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $numrows = $xoopsDB->getRowsNum($allitemcatsresult); |
77 | 77 | $count = 0; |
78 | 78 | $allitemcats = array(); |
79 | - if ( $numrows > 0 ) { |
|
79 | + if ( $numrows > 0 ) { |
|
80 | 80 | while(list($cid) = $xoopsDB->fetchRow($allitemcatsresult)) { |
81 | 81 | $allitemcats[] = $cid; |
82 | 82 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $numrows = $xoopsDB->getRowsNum($activeitemcatsresult); |
86 | 86 | $count = 0; |
87 | 87 | $activeitemcats = array(); |
88 | - if ( $numrows > 0 ) { |
|
88 | + if ( $numrows > 0 ) { |
|
89 | 89 | while(list($cid) = $xoopsDB->fetchRow($activeitemcatsresult)) { |
90 | 90 | $activeitemcats[] = $cid; |
91 | 91 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $numrows = $xoopsDB->getRowsNum($allcatsresult); |
95 | 95 | $allcats = array(); |
96 | 96 | $postedcats = array(); |
97 | - if ( $numrows > 0 ) { |
|
97 | + if ( $numrows > 0 ) { |
|
98 | 98 | while(list($cid) = $xoopsDB->fetchRow($allcatsresult)) { |
99 | 99 | $allcats[] = $cid; |
100 | 100 | if (isset($_POST["selected".$cid.""])) { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | // Based upon the mylinks and the mxDirectory modules // |
31 | 31 | // ------------------------------------------------------------------------- // |
32 | 32 | include '../../../include/cp_header.php'; |
33 | -if ( file_exists("../language/".$xoopsConfig['language']."/main.php") ) { |
|
33 | +if (file_exists("../language/".$xoopsConfig['language']."/main.php")) { |
|
34 | 34 | include "../language/".$xoopsConfig['language']."/main.php"; |
35 | 35 | } else { |
36 | 36 | include "../language/english/main.php"; |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | include_once XOOPS_ROOT_PATH.'/include/xoopscodes.php'; |
42 | 42 | include_once XOOPS_ROOT_PATH.'/class/module.errorhandler.php'; |
43 | 43 | include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
44 | -$myts =& MyTextSanitizer::getInstance(); |
|
44 | +$myts = & MyTextSanitizer::getInstance(); |
|
45 | 45 | $eh = new ErrorHandler; |
46 | -$mytree = new XoopsTree($xoopsDB->prefix("efqdiralpha1_cat"),"cid","pid"); |
|
46 | +$mytree = new XoopsTree($xoopsDB->prefix("efqdiralpha1_cat"), "cid", "pid"); |
|
47 | 47 | include_once "../class/class.datafieldmanager.php"; |
48 | 48 | $datafieldmanager = new efqDataFieldManager(); |
49 | 49 | $moddir = $xoopsModule->getvar("dirname"); |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | $eh = new ErrorHandler; //ErrorHandler object |
63 | 63 | |
64 | 64 | if (isset($_GET["op"])) { |
65 | - $op = $_GET["op"]; |
|
65 | + $op = $_GET["op"]; |
|
66 | 66 | } else if (isset($_POST["op"])) { |
67 | - $op = $_POST["op"]; |
|
67 | + $op = $_POST["op"]; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | if (!empty($_POST['submit'])) { |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | $numrows = $xoopsDB->getRowsNum($allitemcatsresult); |
77 | 77 | $count = 0; |
78 | 78 | $allitemcats = array(); |
79 | - if ( $numrows > 0 ) { |
|
80 | - while(list($cid) = $xoopsDB->fetchRow($allitemcatsresult)) { |
|
79 | + if ($numrows > 0) { |
|
80 | + while (list($cid) = $xoopsDB->fetchRow($allitemcatsresult)) { |
|
81 | 81 | $allitemcats[] = $cid; |
82 | 82 | } |
83 | 83 | } |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | $numrows = $xoopsDB->getRowsNum($activeitemcatsresult); |
86 | 86 | $count = 0; |
87 | 87 | $activeitemcats = array(); |
88 | - if ( $numrows > 0 ) { |
|
89 | - while(list($cid) = $xoopsDB->fetchRow($activeitemcatsresult)) { |
|
88 | + if ($numrows > 0) { |
|
89 | + while (list($cid) = $xoopsDB->fetchRow($activeitemcatsresult)) { |
|
90 | 90 | $activeitemcats[] = $cid; |
91 | 91 | } |
92 | 92 | } |
@@ -94,8 +94,8 @@ discard block |
||
94 | 94 | $numrows = $xoopsDB->getRowsNum($allcatsresult); |
95 | 95 | $allcats = array(); |
96 | 96 | $postedcats = array(); |
97 | - if ( $numrows > 0 ) { |
|
98 | - while(list($cid) = $xoopsDB->fetchRow($allcatsresult)) { |
|
97 | + if ($numrows > 0) { |
|
98 | + while (list($cid) = $xoopsDB->fetchRow($allcatsresult)) { |
|
99 | 99 | $allcats[] = $cid; |
100 | 100 | if (isset($_POST["selected".$cid.""])) { |
101 | 101 | $postedcats[] = $cid; |
@@ -107,22 +107,22 @@ discard block |
||
107 | 107 | |
108 | 108 | //Update these categories to inactive |
109 | 109 | foreach ($postedcats as $cat) { |
110 | - if (! in_array($cat, $allitemcats)) { |
|
110 | + if (!in_array($cat, $allitemcats)) { |
|
111 | 111 | $newid = $xoopsDB->genId($xoopsDB->prefix("efqdiralpha1_item_x_cat")."_xid_seq"); |
112 | 112 | $sql = sprintf("INSERT INTO %s (xid, cid, itemid, active, created) VALUES (%u, %u, %u, '%s', '%s')", $xoopsDB->prefix("efqdiralpha1_item_x_cat"), $newid, $cat, $post_itemid, 1, time()); |
113 | 113 | $xoopsDB->query($sql) or $eh->show("0013"); |
114 | - } else if (! in_array($cat, $activeitemcats)) { |
|
114 | + } else if (!in_array($cat, $activeitemcats)) { |
|
115 | 115 | $sql = "UPDATE ".$xoopsDB->prefix("efqdiralpha1_item_x_cat")." SET active = '1' WHERE itemid = '".$post_itemid."' AND cid='".$cat."'"; |
116 | 116 | $xoopsDB->query($sql) or $eh->show("0013"); |
117 | 117 | } |
118 | 118 | } |
119 | 119 | foreach ($allitemcats as $cat) { |
120 | - if (! in_array($cat, $postedcats)) { |
|
120 | + if (!in_array($cat, $postedcats)) { |
|
121 | 121 | $sql = "UPDATE ".$xoopsDB->prefix("efqdiralpha1_item_x_cat")." SET active = '0' WHERE itemid = '".$post_itemid."' AND cid='".$cat."'"; |
122 | 122 | $xoopsDB->query($sql) or $eh->show("0013"); |
123 | 123 | } |
124 | 124 | } |
125 | - redirect_header(XOOPS_URL."/modules/$moddir/admin/editcategories.php?item=".$post_itemid."",2,_MD_CATEGORIES_UPDATED); |
|
125 | + redirect_header(XOOPS_URL."/modules/$moddir/admin/editcategories.php?item=".$post_itemid."", 2, _MD_CATEGORIES_UPDATED); |
|
126 | 126 | exit(); |
127 | 127 | } else { |
128 | 128 | xoops_cp_header(); |
@@ -56,15 +56,15 @@ discard block |
||
56 | 56 | |
57 | 57 | $moddir = $xoopsModule->getvar("dirname"); |
58 | 58 | if (isset($_GET['dirid'])) { |
59 | - $get_dirid = intval($_GET['dirid']); |
|
59 | + $get_dirid = intval($_GET['dirid']); |
|
60 | 60 | } else { |
61 | 61 | $get_dirid = 0; |
62 | 62 | } |
63 | 63 | if (isset($_GET['dtypeid'])) { |
64 | - $get_dtypeid = intval($_GET['dtypeid']); |
|
64 | + $get_dtypeid = intval($_GET['dtypeid']); |
|
65 | 65 | } |
66 | 66 | if (isset($_GET['catid'])) { |
67 | - $get_catid = intval($_GET['catid']); |
|
67 | + $get_catid = intval($_GET['catid']); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | function catConfig($get_dirid="0") |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | echo "<table width='100%' border='0' cellspacing='1'><tr><td>"; |
176 | 176 | $result = $xoopsDB->query("SELECT c.cid, c.dirid, c.title, c.active, c.pid, c.img, c.allowlist, c.showpopular, c.height, c.width, t.text FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." c LEFT JOIN ".$xoopsDB->prefix("efqdiralpha1_cat_txt")." t ON (c.cid=t.cid) WHERE c.cid='".$catid."'"); |
177 | 177 | $numrows = $xoopsDB->getRowsNum($result); |
178 | - if ( $numrows > 0 ) { |
|
178 | + if ( $numrows > 0 ) { |
|
179 | 179 | while(list($cid, $dirid, $title, $active, $pid, $img, $allowlist, $showpopular, $imgheight, $imgwidth, $descr) = $xoopsDB->fetchRow($result)) { |
180 | 180 | $title = $myts->makeTboxData4Show($title); |
181 | 181 | $parentcat = $pid; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | echo "<table width=\"100%\" class=\"outer\" cellspacing=\"1\">"; |
225 | 225 | $result = $xoopsDB->query("SELECT d.dtypeid, x.cid, d.title, d.section, d.seq, d.icon, f.title, f.typeid, d.defaultyn, d.activeyn, d.options, d.custom FROM ".$xoopsDB->prefix("efqdiralpha1_dtypes")." d, ".$xoopsDB->prefix("efqdiralpha1_fieldtypes")." f, ".$xoopsDB->prefix("efqdiralpha1_dtypes_x_cat")." x WHERE d.fieldtypeid=f.typeid AND d.dtypeid=x.dtypeid AND x.cid='".$catid."' ORDER BY d.section ASC, d.seq ASC") or $eh->show("0013"); |
226 | 226 | $numrows = $xoopsDB->getRowsNum($result); |
227 | - echo "<tr><th>"._MD_DTYPE_ICON."</th><th>"._MD_DTYPE_TITLE."</th><th>"._MD_FTYPE_NAME."</th><th>"._MD_OPTIONS."</th><th>"._MD_CUSTOM."</th><th>"._MD_ACTIVE."</th><th>"._MD_DEFAULT."</th><th>"._MD_DTYPE_SEQ."</th><th>"._MD_SECTION."</th></tr>"; |
|
227 | + echo "<tr><th>"._MD_DTYPE_ICON."</th><th>"._MD_DTYPE_TITLE."</th><th>"._MD_FTYPE_NAME."</th><th>"._MD_OPTIONS."</th><th>"._MD_CUSTOM."</th><th>"._MD_ACTIVE."</th><th>"._MD_DEFAULT."</th><th>"._MD_DTYPE_SEQ."</th><th>"._MD_SECTION."</th></tr>"; |
|
228 | 228 | if ( $numrows > 0 ) { |
229 | 229 | $dtypes = ""; |
230 | 230 | $count = 1; |
@@ -482,8 +482,8 @@ discard block |
||
482 | 482 | $uploader = new XoopsMediaUploader(XOOPS_ROOT_PATH."/modules/$moddir/init_uploads", array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png', 'image/jpg'), 30000, 50, 50); |
483 | 483 | $uploader->setPrefix('icon'); |
484 | 484 | $err = array(); |
485 | - $ucount = count($_POST['xoops_upload_file']); |
|
486 | - if ($ucount != 0) { |
|
485 | + $ucount = count($_POST['xoops_upload_file']); |
|
486 | + if ($ucount != 0) { |
|
487 | 487 | for ($i = 0; $i < $ucount; $i++) { |
488 | 488 | if ($_POST['xoops_upload_file'][$i] != "") { |
489 | 489 | $medianame = $_POST['xoops_upload_file'][$i]; |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | } else { |
529 | 529 | exit(); |
530 | 530 | } |
531 | - $p_title = $myts->makeTboxData4Save($_POST["title"]); |
|
531 | + $p_title = $myts->makeTboxData4Save($_POST["title"]); |
|
532 | 532 | if (isset($_POST["defaultyn"])) { |
533 | 533 | $p_default = $_POST["defaultyn"]; |
534 | 534 | } else { |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | } else { |
657 | 657 | $p_pid = '0'; |
658 | 658 | } |
659 | - $p_title = $myts->makeTboxData4Save($_POST["title"]); |
|
659 | + $p_title = $myts->makeTboxData4Save($_POST["title"]); |
|
660 | 660 | if (isset($_POST["active"])) { |
661 | 661 | $p_active = $_POST["active"]; |
662 | 662 | } else { |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | } else { |
747 | 747 | $p_pid = '0'; |
748 | 748 | } |
749 | - $p_title = $myts->makeTboxData4Save($_POST["title"]); |
|
749 | + $p_title = $myts->makeTboxData4Save($_POST["title"]); |
|
750 | 750 | if (isset($_POST["active"])) { |
751 | 751 | $p_active = $_POST["active"]; |
752 | 752 | } else { |
@@ -893,7 +893,7 @@ discard block |
||
893 | 893 | $xoopsDB->queryF($sql) or $eh->show("0013"); |
894 | 894 | $sql = sprintf("DELETE FROM %s WHERE cid = %u", $xoopsDB->prefix("efqdiralpha1_dtypes_x_cat"), $p_catid); |
895 | 895 | $xoopsDB->queryF($sql) or $eh->show("0013"); |
896 | - redirect_header("categories.php?dirid=".$dirid ,2,_MD_CAT_DELETED); |
|
896 | + redirect_header("categories.php?dirid=".$dirid ,2,_MD_CAT_DELETED); |
|
897 | 897 | exit(); |
898 | 898 | } |
899 | 899 | |
@@ -944,7 +944,7 @@ discard block |
||
944 | 944 | $mainresult = $xoopsDB->query("SELECT cid, title, active, pid FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE dirid='".$dirid."' AND pid='0'"); |
945 | 945 | $numrows = $xoopsDB->getRowsNum($mainresult); |
946 | 946 | $output= ""; |
947 | - if ( $numrows > 0 ) { |
|
947 | + if ( $numrows > 0 ) { |
|
948 | 948 | $output = "<th>"._MD_CATTITLE."</th><th>"._MD_ACTIVE."</th><th>"._MD_ACTION."</th>\n"; |
949 | 949 | $brench = 0; |
950 | 950 | $tab = ""; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | // Based upon the mylinks and the mxDirectory modules // |
31 | 31 | // ------------------------------------------------------------------------- // |
32 | 32 | include '../../../include/cp_header.php'; |
33 | -if ( file_exists("../language/".$xoopsConfig['language']."/main.php") ) { |
|
33 | +if (file_exists("../language/".$xoopsConfig['language']."/main.php")) { |
|
34 | 34 | include "../language/".$xoopsConfig['language']."/main.php"; |
35 | 35 | } else { |
36 | 36 | include "../language/english/main.php"; |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | include_once "../class/class.uploader.php"; |
47 | 47 | include_once '../class/class.fieldtype.php'; |
48 | 48 | |
49 | -$efqtree = new EfqTree($xoopsDB->prefix("efqdiralpha1_cat"),"cid","pid"); |
|
50 | -$myts =& MyTextSanitizer::getInstance(); |
|
49 | +$efqtree = new EfqTree($xoopsDB->prefix("efqdiralpha1_cat"), "cid", "pid"); |
|
50 | +$myts = & MyTextSanitizer::getInstance(); |
|
51 | 51 | $eh = new ErrorHandler; |
52 | -$mytree = new XoopsTree($xoopsDB->prefix("efqdiralpha1_cat"),"cid","pid"); |
|
53 | -$mytree2 = new XoopsTree($xoopsDB->prefix("efqdiralpha1_fieldtypes"),"typeid",0); |
|
52 | +$mytree = new XoopsTree($xoopsDB->prefix("efqdiralpha1_cat"), "cid", "pid"); |
|
53 | +$mytree2 = new XoopsTree($xoopsDB->prefix("efqdiralpha1_fieldtypes"), "typeid", 0); |
|
54 | 54 | //$efqtree = new EfqTree($xoopsDB->prefix("efqdiralpha1_cat"),"cid","pid"); |
55 | -$dirtree = new EfqTree($xoopsDB->prefix("efqdiralpha1_dir"),"dirid",0); |
|
55 | +$dirtree = new EfqTree($xoopsDB->prefix("efqdiralpha1_dir"), "dirid", 0); |
|
56 | 56 | |
57 | 57 | $moddir = $xoopsModule->getvar("dirname"); |
58 | 58 | if (isset($_GET['dirid'])) { |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $get_catid = intval($_GET['catid']); |
68 | 68 | } |
69 | 69 | |
70 | -function catConfig($get_dirid="0") |
|
70 | +function catConfig($get_dirid = "0") |
|
71 | 71 | { |
72 | 72 | global $xoopsDB, $xoopsModule, $xoopsUser, $mytree, $efqtree, $dirtree; |
73 | 73 | if ($get_dirid == "0") { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | if ($get_dirid == 0) { |
77 | 77 | $directoryHandler = new efqDirectoryHandler(); |
78 | 78 | xoops_cp_header(); |
79 | - adminmenu(2,_MD_MANAGE_CATS); |
|
79 | + adminmenu(2, _MD_MANAGE_CATS); |
|
80 | 80 | echo "<h4>"._MD_SELECTDIRECTORY."</h4>"; |
81 | 81 | echo "<table width='100%' border='0' cellspacing='1' class='outer'>"; |
82 | 82 | echo "<table width='100%' border='0' cellspacing='1'><tr><td>"; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | } |
100 | 100 | xoops_cp_header(); |
101 | - adminmenu(-1,_MD_MANAGE_CATS); |
|
101 | + adminmenu(-1, _MD_MANAGE_CATS); |
|
102 | 102 | $dirname = getDirNameFromId($get_dirid); |
103 | 103 | echo "<h4>"._MD_CATCONF." - ".$dirname."</h4>"; |
104 | 104 | echo "<table width='100%' border='0' cellspacing='1' class='outer'>"; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | global $xoopsDB, $efqtree, $mytree, $mytree2, $xoopsUser, $get_catid, $eh, $myts, $xoopsModuleConfig; |
153 | 153 | xoops_cp_header(); |
154 | 154 | $diridfromcatid = getDirId($get_catid); |
155 | - adminmenu(2,_MD_EDITCAT); |
|
155 | + adminmenu(2, _MD_EDITCAT); |
|
156 | 156 | echo "<h4>"._MD_EDITCAT."</h4>"; |
157 | 157 | $pathstring = "<a href='categories.php?dirid=$diridfromcatid'>"._MD_MAIN."</a> : "; |
158 | 158 | $pathstring .= $efqtree->getNicePathFromId($get_catid, "title", "categories.php?op=edit"); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | if ($count_subcats != 0) { |
164 | 164 | $subcategories = ""; |
165 | 165 | echo "<strong>"._MD_SUBCATEGORIES."</strong>:<br />"; |
166 | - for ($i=0; $i <$count_subcats; $i++) { |
|
166 | + for ($i = 0; $i < $count_subcats; $i++) { |
|
167 | 167 | $subcategories .= "<a href='categories.php?op=edit&catid=".$catchildren[$i]['cid']."'>".$catchildren[$i]['title']."</a>"; |
168 | 168 | if ($i + 1 != $count_subcats) { |
169 | 169 | $subcategories .= ", "; |
@@ -175,8 +175,8 @@ discard block |
||
175 | 175 | echo "<table width='100%' border='0' cellspacing='1'><tr><td>"; |
176 | 176 | $result = $xoopsDB->query("SELECT c.cid, c.dirid, c.title, c.active, c.pid, c.img, c.allowlist, c.showpopular, c.height, c.width, t.text FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." c LEFT JOIN ".$xoopsDB->prefix("efqdiralpha1_cat_txt")." t ON (c.cid=t.cid) WHERE c.cid='".$catid."'"); |
177 | 177 | $numrows = $xoopsDB->getRowsNum($result); |
178 | - if ( $numrows > 0 ) { |
|
179 | - while(list($cid, $dirid, $title, $active, $pid, $img, $allowlist, $showpopular, $imgheight, $imgwidth, $descr) = $xoopsDB->fetchRow($result)) { |
|
178 | + if ($numrows > 0) { |
|
179 | + while (list($cid, $dirid, $title, $active, $pid, $img, $allowlist, $showpopular, $imgheight, $imgwidth, $descr) = $xoopsDB->fetchRow($result)) { |
|
180 | 180 | $title = $myts->makeTboxData4Show($title); |
181 | 181 | $parentcat = $pid; |
182 | 182 | if ($img != "") { |
@@ -225,10 +225,10 @@ discard block |
||
225 | 225 | $result = $xoopsDB->query("SELECT d.dtypeid, x.cid, d.title, d.section, d.seq, d.icon, f.title, f.typeid, d.defaultyn, d.activeyn, d.options, d.custom FROM ".$xoopsDB->prefix("efqdiralpha1_dtypes")." d, ".$xoopsDB->prefix("efqdiralpha1_fieldtypes")." f, ".$xoopsDB->prefix("efqdiralpha1_dtypes_x_cat")." x WHERE d.fieldtypeid=f.typeid AND d.dtypeid=x.dtypeid AND x.cid='".$catid."' ORDER BY d.section ASC, d.seq ASC") or $eh->show("0013"); |
226 | 226 | $numrows = $xoopsDB->getRowsNum($result); |
227 | 227 | echo "<tr><th>"._MD_DTYPE_ICON."</th><th>"._MD_DTYPE_TITLE."</th><th>"._MD_FTYPE_NAME."</th><th>"._MD_OPTIONS."</th><th>"._MD_CUSTOM."</th><th>"._MD_ACTIVE."</th><th>"._MD_DEFAULT."</th><th>"._MD_DTYPE_SEQ."</th><th>"._MD_SECTION."</th></tr>"; |
228 | - if ( $numrows > 0 ) { |
|
228 | + if ($numrows > 0) { |
|
229 | 229 | $dtypes = ""; |
230 | 230 | $count = 1; |
231 | - while(list($dtypeid, $cid, $dtypetitle, $section, $dseq, $picture, $ftypename, $ftypeid, $defaultyn, $activeyn, $options, $dcustom) = $xoopsDB->fetchRow($result)) { |
|
231 | + while (list($dtypeid, $cid, $dtypetitle, $section, $dseq, $picture, $ftypename, $ftypeid, $defaultyn, $activeyn, $options, $dcustom) = $xoopsDB->fetchRow($result)) { |
|
232 | 232 | if ($defaultyn == '1') { |
233 | 233 | $default = _MD_YES; |
234 | 234 | $checked = " checked=\"checked\""; |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | } else { |
265 | 265 | $dtypes = $dtypeid; |
266 | 266 | } |
267 | - $count ++; |
|
267 | + $count++; |
|
268 | 268 | echo "<tr><td class=\"even\"><img src=\"$iconurl\" /></td><td class=\"even\"><a href=\"categories.php?op=editdtype&dtypeid=$dtypeid&catid=$get_catid\">$dtypetitle</a></td><td class=\"even\">".$ftypename."</td><td class=\"even\">$options</td><td class=\"even\">$custom</td><td class=\"even\"><input type=\"checkbox\" name=\"activeyn".$dtypeid."\"$activechecked></input></td><td class=\"even\"><input type=\"checkbox\" name=\"defaultyn".$dtypeid."\"$checked></input></td><td class=\"even\"><input type=\"text\" size=\"5\" maxsize=\"10\" name=\"seq".$dtypeid."\" value=\"".$dseq."\"></input></td><td class=\"even\"><input type=\"text\" size=\"5\" maxsize=\"10\" name=\"section".$dtypeid."\" value=\"".$section."\"></input></td></tr>"; |
269 | 269 | } |
270 | 270 | echo "<tr><td class=\"even\"> </td><td class=\"even\" colspan=\"8\"><input type=\"hidden\" name=\"op\" value=\"editdtypes\" /><input type=\"hidden\" name=\"catid\" value=\"".$get_catid."\" /><input type=\"hidden\" name=\"dtypes\" value=\"".$dtypes."\" /><input type=\"submit\" class=\"formButton\" name=\"submit\" id=\"submit\" value=\""._MD_UPDATE."\" /></td></tr>"; |
@@ -360,14 +360,14 @@ discard block |
||
360 | 360 | { |
361 | 361 | global $xoopsDB, $mytree, $mytree2, $xoopsUser, $get_catid, $eh; |
362 | 362 | xoops_cp_header(); |
363 | - adminmenu(2,_MD_EDITCAT); |
|
363 | + adminmenu(2, _MD_EDITCAT); |
|
364 | 364 | echo "<h4>"._MD_EDITDTYPE."</h4>"; |
365 | 365 | echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td>"; |
366 | 366 | |
367 | 367 | $result = $xoopsDB->query("SELECT d.dtypeid, d.title, d.section, d.seq, d.icon, f.title, f.typeid, d.defaultyn, d.activeyn, d.options, d.custom FROM ".$xoopsDB->prefix("efqdiralpha1_dtypes")." d, ".$xoopsDB->prefix("efqdiralpha1_fieldtypes")." f WHERE d.fieldtypeid=f.typeid AND d.dtypeid='".$dtypeid."' ORDER BY d.seq ASC") or $eh->show("0013"); |
368 | 368 | $numrows = $xoopsDB->getRowsNum($result); |
369 | - if ( $numrows > 0 ) { |
|
370 | - while(list($dtypeid, $dtypetitle, $section, $dseq, $picture, $ftypename, $ftypeid, $defaultyn, $activeyn, $options, $dcustom) = $xoopsDB->fetchRow($result)) { |
|
369 | + if ($numrows > 0) { |
|
370 | + while (list($dtypeid, $dtypetitle, $section, $dseq, $picture, $ftypename, $ftypeid, $defaultyn, $activeyn, $options, $dcustom) = $xoopsDB->fetchRow($result)) { |
|
371 | 371 | if ($defaultyn == '1') { |
372 | 372 | $default = _MD_YES; |
373 | 373 | $checked = " checked=\"checked\""; |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | $form->addElement(new XoopsFormImage(_MD_CURRENT_ICON, "current_image", null, $iconurl, "", "")); |
408 | 408 | $fieldtype_tray = new XoopsFormElementTray(_MD_FTYPE_NAME, "", "typeid"); |
409 | 409 | ob_start(); |
410 | - $mytree2->makeMySelBox("title", "title",$ftypeid,1); |
|
410 | + $mytree2->makeMySelBox("title", "title", $ftypeid, 1); |
|
411 | 411 | $selbox = ob_get_contents(); |
412 | 412 | ob_end_clean(); |
413 | 413 | $options_tray = new XoopsFormElementTray(_MD_OPTIONS, ""); |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | $return = ""; |
452 | 452 | $p_dtypeid = $_POST["dtypeid"]; |
453 | 453 | $p_catid = $_POST["catid"]; |
454 | - if (isset ($_POST["title"]) ) { |
|
454 | + if (isset ($_POST["title"])) { |
|
455 | 455 | if (isset($_POST["custom"])) { |
456 | 456 | $p_custom = $_POST["custom"]; |
457 | 457 | } else { |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | //Rename the uploaded file to the same name in a different location that does not have 777 rights or 755. |
497 | 497 | rename("".XOOPS_ROOT_PATH."/modules/".$moddir."/init_uploads/".$savedfilename."", "".XOOPS_ROOT_PATH."/modules/".$moddir."/uploads/".$savedfilename.""); |
498 | 498 | //Delete the uploaded file from the initial upload folder if it is still present in that folder. |
499 | - if(file_exists("".XOOPS_ROOT_PATH."/modules/".$moddir."/init_uploads/".$savedfilename."")) { |
|
499 | + if (file_exists("".XOOPS_ROOT_PATH."/modules/".$moddir."/init_uploads/".$savedfilename."")) { |
|
500 | 500 | unlink("".XOOPS_ROOT_PATH."/modules/".$moddir."/init_uploads/".$savedfilename.""); |
501 | 501 | } |
502 | 502 | $sql = "UPDATE ".$xoopsDB->prefix("efqdiralpha1_dtypes")." SET title = '$p_title', section = '$p_section', fieldtypeid = '$p_fieldtype', defaultyn = '$p_default', activeyn='$p_active', seq='$p_seq', options='$p_options', custom='$p_custom', icon='$savedfilename' WHERE dtypeid = $p_dtypeid"; |
@@ -516,14 +516,14 @@ discard block |
||
516 | 516 | $xoopsDB->query($sql) or $eh->show("0013"); |
517 | 517 | } |
518 | 518 | } |
519 | - redirect_header("categories.php?op=edit&catid=$p_catid",2,_MD_DTYPE_UPDATED); |
|
519 | + redirect_header("categories.php?op=edit&catid=$p_catid", 2, _MD_DTYPE_UPDATED); |
|
520 | 520 | exit(); |
521 | 521 | } |
522 | 522 | |
523 | 523 | function addDatatype() |
524 | 524 | { |
525 | 525 | global $xoopsDB, $_POST, $myts, $eh, $xoopsUser, $moddir; |
526 | - if (isset ($_POST["catid"]) ) { |
|
526 | + if (isset ($_POST["catid"])) { |
|
527 | 527 | $p_catid = $_POST["catid"]; |
528 | 528 | } else { |
529 | 529 | exit(); |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | } |
552 | 552 | $p_fieldtype = intval($_POST["typeid"]); |
553 | 553 | if ($p_fieldtype == '') { |
554 | - redirect_header("categories.php?op=edit&catid=$p_catid",2,_MD_NOFIELDTYPE_SELECTED); |
|
554 | + redirect_header("categories.php?op=edit&catid=$p_catid", 2, _MD_NOFIELDTYPE_SELECTED); |
|
555 | 555 | exit(); |
556 | 556 | } |
557 | 557 | $p_section = $myts->makeTboxData4Save($_POST["section"]); |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | //Rename the uploaded file to the same name in a different location that does not have 777 rights or 755. |
575 | 575 | rename("".XOOPS_ROOT_PATH."/modules/".$moddir."/init_uploads/".$savedfilename."", "".XOOPS_ROOT_PATH."/modules/".$moddir."/uploads/".$savedfilename.""); |
576 | 576 | //Delete the uploaded file from the initial upload folder if it is still present in that folder. |
577 | - if(file_exists("".XOOPS_ROOT_PATH."/modules/".$moddir."/init_uploads/".$savedfilename."")) { |
|
577 | + if (file_exists("".XOOPS_ROOT_PATH."/modules/".$moddir."/init_uploads/".$savedfilename."")) { |
|
578 | 578 | unlink("".XOOPS_ROOT_PATH."/modules/".$moddir."/init_uploads/".$savedfilename.""); |
579 | 579 | } |
580 | 580 | } |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | $newid = $xoopsDB->genId($xoopsDB->prefix("efqdiralpha1_dtypes_x_cat")."_xid_seq"); |
589 | 589 | $sql = sprintf("INSERT INTO %s (xid, cid, dtypeid) VALUES (%u, %u, %u)", $xoopsDB->prefix("efqdiralpha1_dtypes_x_cat"), $newid, $p_catid, $dtypeid); |
590 | 590 | $xoopsDB->query($sql) or $eh->show("0013"); |
591 | - redirect_header("categories.php?op=edit&catid=$p_catid",2,_MD_CAT_UPDATED); |
|
591 | + redirect_header("categories.php?op=edit&catid=$p_catid", 2, _MD_CAT_UPDATED); |
|
592 | 592 | exit(); |
593 | 593 | } |
594 | 594 | |
@@ -599,8 +599,8 @@ discard block |
||
599 | 599 | $return = ""; |
600 | 600 | $dtypes = $_POST["dtypes"]; |
601 | 601 | $p_catid = $_POST["catid"]; |
602 | - $dtypes_arr = split("[|]",$dtypes); |
|
603 | - foreach($dtypes_arr as $dtype) { |
|
602 | + $dtypes_arr = split("[|]", $dtypes); |
|
603 | + foreach ($dtypes_arr as $dtype) { |
|
604 | 604 | $p_section = $myts->makeTboxData4Save($_POST["section".$dtype.""]); |
605 | 605 | if (isset($_POST["defaultyn".$dtype.""])) { |
606 | 606 | $p_defaultyn = '1'; |
@@ -616,19 +616,19 @@ discard block |
||
616 | 616 | $sql = "UPDATE ".$xoopsDB->prefix("efqdiralpha1_dtypes")." SET section = '$p_section', defaultyn = '$p_defaultyn', activeyn='$p_activeyn', seq='$p_seq' WHERE dtypeid = $dtype"; |
617 | 617 | $xoopsDB->query($sql) or $eh->show("0013"); |
618 | 618 | } |
619 | - redirect_header("categories.php?op=edit&catid=$p_catid",2,_MD_CAT_UPDATED); |
|
619 | + redirect_header("categories.php?op=edit&catid=$p_catid", 2, _MD_CAT_UPDATED); |
|
620 | 620 | exit(); |
621 | 621 | } |
622 | 622 | |
623 | 623 | function importDatatypes() |
624 | 624 | { |
625 | 625 | global $xoopsDB, $_POST, $myts, $eh, $moddir, $xoopsUser; |
626 | - if (isset ($_POST["pid"]) ) { |
|
626 | + if (isset ($_POST["pid"])) { |
|
627 | 627 | $p_pid = $_POST["pid"]; |
628 | 628 | } else { |
629 | 629 | exit(); |
630 | 630 | } |
631 | - if (isset ($_POST["catid"]) ) { |
|
631 | + if (isset ($_POST["catid"])) { |
|
632 | 632 | $p_catid = $_POST["catid"]; |
633 | 633 | } else { |
634 | 634 | exit(); |
@@ -637,21 +637,21 @@ discard block |
||
637 | 637 | $sql = "INSERT INTO ".$xoopsDB->prefix("efqdiralpha1_dtypes_x_cat")." (cid, dtypeid) SELECT ".$p_catid.", d.dtypeid FROM ".$xoopsDB->prefix("efqdiralpha1_dtypes")." d, ".$xoopsDB->prefix("efqdiralpha1_dtypes_x_cat")." x WHERE d.dtypeid=x.dtypeid AND x.cid = ".$p_pid." AND d.defaultyn = '1'"; |
638 | 638 | } |
639 | 639 | $xoopsDB->query($sql) or $eh->show("0013"); |
640 | - redirect_header("categories.php?op=edit&catid=$p_catid",2,_MD_CAT_UPDATED); |
|
640 | + redirect_header("categories.php?op=edit&catid=$p_catid", 2, _MD_CAT_UPDATED); |
|
641 | 641 | exit(); |
642 | 642 | } |
643 | 643 | |
644 | 644 | function updateCat() |
645 | 645 | { |
646 | 646 | global $xoopsDB, $_POST, $myts, $eh, $moddir, $xoopsModuleConfig; |
647 | - if (isset ($_POST["catid"]) ) { |
|
647 | + if (isset ($_POST["catid"])) { |
|
648 | 648 | $p_catid = $_POST["catid"]; |
649 | 649 | } else { |
650 | 650 | exit(); |
651 | 651 | } |
652 | 652 | $descr_exists = checkDescription($p_catid); |
653 | 653 | |
654 | - if (isset ($_POST["pid"]) ) { |
|
654 | + if (isset ($_POST["pid"])) { |
|
655 | 655 | $p_pid = $_POST["pid"]; |
656 | 656 | } else { |
657 | 657 | $p_pid = '0'; |
@@ -672,12 +672,12 @@ discard block |
||
672 | 672 | } else { |
673 | 673 | $p_showpopular = 0; |
674 | 674 | } |
675 | - if (isset($_POST["descr"]) ) { |
|
675 | + if (isset($_POST["descr"])) { |
|
676 | 676 | $p_descr = $myts->makeTareaData4Save($_POST["descr"]); |
677 | 677 | } else { |
678 | 678 | $p_descr = false; |
679 | 679 | } |
680 | - if ( $_POST['xoops_upload_file'][0] != "" ) { |
|
680 | + if ($_POST['xoops_upload_file'][0] != "") { |
|
681 | 681 | include_once XOOPS_ROOT_PATH."/modules/$moddir/class/class.uploader.php"; |
682 | 682 | $uploader = new XoopsMediaUploader(XOOPS_ROOT_PATH."/modules/$moddir/init_uploads", array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png', 'image/jpg'), $xoopsModuleConfig['catimagemaxsize'], $xoopsModuleConfig['catimagemaxwidth'], $xoopsModuleConfig['catimagemaxheight']); |
683 | 683 | if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | } |
696 | 696 | $xoopsDB->query($sql2) or $eh->show("0013"); |
697 | 697 | } |
698 | - redirect_header("categories.php?op=edit&catid=$p_catid",2,_MD_CAT_UPDATED); |
|
698 | + redirect_header("categories.php?op=edit&catid=$p_catid", 2, _MD_CAT_UPDATED); |
|
699 | 699 | exit(); |
700 | 700 | } |
701 | 701 | $uploader->setPrefix('efqdir'); |
@@ -708,10 +708,10 @@ discard block |
||
708 | 708 | $xoopsDB->query($sql) or $eh->show("0013"); |
709 | 709 | rename("".XOOPS_ROOT_PATH."/modules/$moddir/init_uploads/".$savedfilename."", "".XOOPS_ROOT_PATH."/modules/$moddir/uploads/".$savedfilename.""); |
710 | 710 | //Delete the uploaded file from the initial upload folder if it is still present in that folder. |
711 | - if(file_exists("".XOOPS_ROOT_PATH."/modules/$moddir/init_uploads/".$savedfilename."")) { |
|
711 | + if (file_exists("".XOOPS_ROOT_PATH."/modules/$moddir/init_uploads/".$savedfilename."")) { |
|
712 | 712 | unlink("".XOOPS_ROOT_PATH."/modules/$moddir/init_uploads/".$savedfilename.""); |
713 | 713 | } |
714 | - redirect_header("categories.php?op=edit&catid=$p_catid",2,_MD_CAT_UPDATED); |
|
714 | + redirect_header("categories.php?op=edit&catid=$p_catid", 2, _MD_CAT_UPDATED); |
|
715 | 715 | exit(); |
716 | 716 | } else { |
717 | 717 | $sql = "UPDATE ".$xoopsDB->prefix("efqdiralpha1_cat")." SET title = '$p_title', active='$p_active', pid='$p_pid', allowlist='$p_allowlist', showpopular='$p_showpopular' WHERE cid = $p_catid"; |
@@ -725,23 +725,23 @@ discard block |
||
725 | 725 | } |
726 | 726 | $xoopsDB->query($sql2) or $eh->show("0013"); |
727 | 727 | } |
728 | - redirect_header("categories.php?op=edit&catid=$p_catid",2,_MD_CAT_UPDATED); |
|
728 | + redirect_header("categories.php?op=edit&catid=$p_catid", 2, _MD_CAT_UPDATED); |
|
729 | 729 | exit(); |
730 | 730 | } |
731 | 731 | } |
732 | - redirect_header("categories.php?op=edit&catid=$p_catid",2,_MD_CAT_NOT_UPDATED); |
|
732 | + redirect_header("categories.php?op=edit&catid=$p_catid", 2, _MD_CAT_NOT_UPDATED); |
|
733 | 733 | exit(); |
734 | 734 | } |
735 | 735 | |
736 | 736 | function newCat() |
737 | 737 | { |
738 | 738 | global $xoopsDB, $_POST, $myts, $eh, $moddir; |
739 | - if (isset ($_POST["dirid"]) ) { |
|
739 | + if (isset ($_POST["dirid"])) { |
|
740 | 740 | $p_dirid = $_POST["dirid"]; |
741 | 741 | } else { |
742 | 742 | exit(); |
743 | 743 | } |
744 | - if (isset ($_POST["pid"]) ) { |
|
744 | + if (isset ($_POST["pid"])) { |
|
745 | 745 | $p_pid = $_POST["pid"]; |
746 | 746 | } else { |
747 | 747 | $p_pid = '0'; |
@@ -776,20 +776,20 @@ discard block |
||
776 | 776 | } else { |
777 | 777 | $p_showpopular = 0; |
778 | 778 | } |
779 | - if (isset ($_POST["descr"]) ) { |
|
779 | + if (isset ($_POST["descr"])) { |
|
780 | 780 | $p_descr = $myts->makeTareaData4Save($_POST["descr"]); |
781 | 781 | } else { |
782 | 782 | $p_descr = ""; |
783 | 783 | } |
784 | 784 | |
785 | - if ( $_POST['xoops_upload_file'][0] != "" ) { |
|
785 | + if ($_POST['xoops_upload_file'][0] != "") { |
|
786 | 786 | include_once XOOPS_ROOT_PATH."/modules/$moddir/class/class.uploader.php"; |
787 | 787 | $uploader = new XoopsMediaUploader(XOOPS_ROOT_PATH."/modules/$moddir/init_uploads", array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png', 'image/jpg'), 30000, 250, 250); |
788 | 788 | if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { |
789 | 789 | $filename = $uploader->getMediaName(); |
790 | 790 | } else { |
791 | 791 | $newid = $xoopsDB->genId($xoopsDB->prefix("efqdiralpha1_cat")."_cid_seq"); |
792 | - $sql = sprintf("INSERT INTO %s (cid, dirid, title, active, pid, allowlist, showpopular) VALUES (%u, %u, '%s', %u, %u, %u, %u)", $xoopsDB->prefix("efqdiralpha1_cat") , $newid, $p_dirid, $p_title, $p_active, $p_pid, $p_allowlist, $p_showpopular); |
|
792 | + $sql = sprintf("INSERT INTO %s (cid, dirid, title, active, pid, allowlist, showpopular) VALUES (%u, %u, '%s', %u, %u, %u, %u)", $xoopsDB->prefix("efqdiralpha1_cat"), $newid, $p_dirid, $p_title, $p_active, $p_pid, $p_allowlist, $p_showpopular); |
|
793 | 793 | $xoopsDB->query($sql) or $eh->show("0013"); |
794 | 794 | if ($newid == 0) { |
795 | 795 | $cid = $xoopsDB->getInsertId(); |
@@ -802,7 +802,7 @@ discard block |
||
802 | 802 | if ($p_import == '1') { |
803 | 803 | importDtypes($p_pid, $cid); |
804 | 804 | } |
805 | - redirect_header("categories.php?op=edit&catid=$cid",2,_MD_CAT_SAVED); |
|
805 | + redirect_header("categories.php?op=edit&catid=$cid", 2, _MD_CAT_SAVED); |
|
806 | 806 | exit(); |
807 | 807 | } |
808 | 808 | $uploader->setPrefix('efqdir'); |
@@ -814,7 +814,7 @@ discard block |
||
814 | 814 | $imagelocation = $uploader->uploadDir; |
815 | 815 | echo $uploader->getErrors(); |
816 | 816 | $newid = $xoopsDB->genId($xoopsDB->prefix("efqdiralpha1_cat")."_cid_seq"); |
817 | - $sql = sprintf("INSERT INTO %s (cid, dirid, title, active, pid, img, allowlist, showpopular, width, height) VALUES (%u, %u, '%s', %u, %u, '%s', %u, %u, %u, %u)", $xoopsDB->prefix("efqdiralpha1_cat") , $newid, $p_dirid, $p_title, $p_active, $p_pid, $savedfilename, $p_allowlist, $p_showpopular, $width, $height); |
|
817 | + $sql = sprintf("INSERT INTO %s (cid, dirid, title, active, pid, img, allowlist, showpopular, width, height) VALUES (%u, %u, '%s', %u, %u, '%s', %u, %u, %u, %u)", $xoopsDB->prefix("efqdiralpha1_cat"), $newid, $p_dirid, $p_title, $p_active, $p_pid, $savedfilename, $p_allowlist, $p_showpopular, $width, $height); |
|
818 | 818 | $xoopsDB->query($sql) or $eh->show("0013"); |
819 | 819 | if ($newid == 0) { |
820 | 820 | $cid = $xoopsDB->getInsertId(); |
@@ -829,15 +829,15 @@ discard block |
||
829 | 829 | } |
830 | 830 | rename("".XOOPS_ROOT_PATH."/modules/$moddir/init_uploads/".$savedfilename."", "".XOOPS_ROOT_PATH."/modules/$moddir/uploads/".$savedfilename.""); |
831 | 831 | //Delete the uploaded file from the initial upload folder if it is still present in that folder. |
832 | - if(file_exists("".XOOPS_ROOT_PATH."/modules/$moddir/init_uploads/".$savedfilename."")) { |
|
832 | + if (file_exists("".XOOPS_ROOT_PATH."/modules/$moddir/init_uploads/".$savedfilename."")) { |
|
833 | 833 | unlink("".XOOPS_ROOT_PATH."/modules/$moddir/init_uploads/".$savedfilename.""); |
834 | 834 | } |
835 | - redirect_header("categories.php?op=edit&catid=$cid",2,_MD_CAT_SAVED); |
|
835 | + redirect_header("categories.php?op=edit&catid=$cid", 2, _MD_CAT_SAVED); |
|
836 | 836 | exit(); |
837 | 837 | } else { |
838 | 838 | echo $uploader->getErrors(); |
839 | 839 | $newid = $xoopsDB->genId($xoopsDB->prefix("efqdiralpha1_cat")."_cid_seq"); |
840 | - $sql = sprintf("INSERT INTO %s (cid, dirid, title, active, pid, img, allowlist, showpopular, width, height) VALUES (%u, %u, '%s', %u, %u, %u, %u, %u, %u, %u)", $xoopsDB->prefix("efqdiralpha1_cat") , $newid, $p_dirid, $p_title, $p_active, $p_pid, '', $p_allowlist, $p_showpopular, '', ''); |
|
840 | + $sql = sprintf("INSERT INTO %s (cid, dirid, title, active, pid, img, allowlist, showpopular, width, height) VALUES (%u, %u, '%s', %u, %u, %u, %u, %u, %u, %u)", $xoopsDB->prefix("efqdiralpha1_cat"), $newid, $p_dirid, $p_title, $p_active, $p_pid, '', $p_allowlist, $p_showpopular, '', ''); |
|
841 | 841 | $xoopsDB->query($sql) or $eh->show("0013"); |
842 | 842 | if ($newid == 0) { |
843 | 843 | $cid = $xoopsDB->getInsertId(); |
@@ -850,12 +850,12 @@ discard block |
||
850 | 850 | if ($p_import == '1') { |
851 | 851 | importDtypes($p_pid, $cid); |
852 | 852 | } |
853 | - redirect_header("categories.php?op=edit&catid=$cid",2,_MD_CAT_SAVED); |
|
853 | + redirect_header("categories.php?op=edit&catid=$cid", 2, _MD_CAT_SAVED); |
|
854 | 854 | exit(); |
855 | 855 | } |
856 | 856 | } |
857 | 857 | |
858 | - redirect_header("categories.php?op=edit&catid=$cid",2,_MD_CAT_SAVED); |
|
858 | + redirect_header("categories.php?op=edit&catid=$cid", 2, _MD_CAT_SAVED); |
|
859 | 859 | exit(); |
860 | 860 | } |
861 | 861 | |
@@ -881,7 +881,7 @@ discard block |
||
881 | 881 | if (isset($_POST['catid'])) { |
882 | 882 | $p_catid = intval($_POST["catid"]); |
883 | 883 | } else { |
884 | - redirect_header("directories.php",2,_MD_INVALID_DIR); |
|
884 | + redirect_header("directories.php", 2, _MD_INVALID_DIR); |
|
885 | 885 | exit(); |
886 | 886 | } |
887 | 887 | $dirid = getDirId($p_catid); |
@@ -893,11 +893,11 @@ discard block |
||
893 | 893 | $xoopsDB->queryF($sql) or $eh->show("0013"); |
894 | 894 | $sql = sprintf("DELETE FROM %s WHERE cid = %u", $xoopsDB->prefix("efqdiralpha1_dtypes_x_cat"), $p_catid); |
895 | 895 | $xoopsDB->queryF($sql) or $eh->show("0013"); |
896 | - redirect_header("categories.php?dirid=".$dirid ,2,_MD_CAT_DELETED); |
|
896 | + redirect_header("categories.php?dirid=".$dirid, 2, _MD_CAT_DELETED); |
|
897 | 897 | exit(); |
898 | 898 | } |
899 | 899 | |
900 | -if(!isset($_POST["op"])) { |
|
900 | +if (!isset($_POST["op"])) { |
|
901 | 901 | $op = isset($_GET["op"]) ? $_GET["op"] : 'main'; |
902 | 902 | } else { |
903 | 903 | $op = $_POST["op"]; |
@@ -938,17 +938,17 @@ discard block |
||
938 | 938 | break; |
939 | 939 | } |
940 | 940 | |
941 | -function getCatOverview($dirid=0) |
|
941 | +function getCatOverview($dirid = 0) |
|
942 | 942 | { |
943 | 943 | global $xoopsDB, $myts, $eh, $mytree, $moddir; |
944 | 944 | $mainresult = $xoopsDB->query("SELECT cid, title, active, pid FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE dirid='".$dirid."' AND pid='0'"); |
945 | 945 | $numrows = $xoopsDB->getRowsNum($mainresult); |
946 | - $output= ""; |
|
947 | - if ( $numrows > 0 ) { |
|
946 | + $output = ""; |
|
947 | + if ($numrows > 0) { |
|
948 | 948 | $output = "<th>"._MD_CATTITLE."</th><th>"._MD_ACTIVE."</th><th>"._MD_ACTION."</th>\n"; |
949 | 949 | $brench = 0; |
950 | 950 | $tab = ""; |
951 | - while(list($cid, $title, $active, $pid) = $xoopsDB->fetchRow($mainresult)) { |
|
951 | + while (list($cid, $title, $active, $pid) = $xoopsDB->fetchRow($mainresult)) { |
|
952 | 952 | //For each cid, get all 'first children' using getFirstChildId() function |
953 | 953 | if ($active != '0') { |
954 | 954 | $activeyn = ""._MD_YES.""; |
@@ -964,22 +964,22 @@ discard block |
||
964 | 964 | return $output; |
965 | 965 | } |
966 | 966 | |
967 | -function getChildrenCategories($childid="0", $level="0") |
|
967 | +function getChildrenCategories($childid = "0", $level = "0") |
|
968 | 968 | { |
969 | 969 | global $xoopsDB, $myts, $eh, $mytree, $get_dirid, $moddir; |
970 | 970 | $tab = " "; |
971 | 971 | $level = $level; |
972 | 972 | $output = ""; |
973 | 973 | $plus = "<img src=\"".XOOPS_URL."/images/arrow.gif\">"; |
974 | - for ($i=0; $i <$level; $i++) |
|
974 | + for ($i = 0; $i < $level; $i++) |
|
975 | 975 | { |
976 | 976 | $tab .= " "; |
977 | 977 | } |
978 | 978 | $sql = "SELECT cid, title, active, pid FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE dirid='".$get_dirid."' AND pid='".$childid."'"; |
979 | 979 | $childresult = $xoopsDB->query($sql); |
980 | 980 | $numrows = $xoopsDB->getRowsNum($childresult); |
981 | - if ( $numrows > 0 ) { |
|
982 | - while(list($cid, $title, $active, $pid) = $xoopsDB->fetchRow($childresult)) { |
|
981 | + if ($numrows > 0) { |
|
982 | + while (list($cid, $title, $active, $pid) = $xoopsDB->fetchRow($childresult)) { |
|
983 | 983 | if ($active != '0') { |
984 | 984 | $activeyn = ""._MD_YES.""; |
985 | 985 | } else { |
@@ -993,7 +993,7 @@ discard block |
||
993 | 993 | return $output; |
994 | 994 | } |
995 | 995 | |
996 | -function importDtypes($pid='0', $catid='0') |
|
996 | +function importDtypes($pid = '0', $catid = '0') |
|
997 | 997 | { |
998 | 998 | global $xoopsDB, $_POST, $eh; |
999 | 999 | if ($pid != 0) { |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | // ------------------------------------------------------------------------- // |
32 | 32 | include '../../../include/cp_header.php'; |
33 | 33 | if (file_exists("../language/" . $xoopsConfig['language'] . "/main.php")) { |
34 | - include "../language/" . $xoopsConfig['language'] . "/main.php"; |
|
34 | + include "../language/" . $xoopsConfig['language'] . "/main.php"; |
|
35 | 35 | } else { |
36 | - include "../language/english/main.php"; |
|
36 | + include "../language/english/main.php"; |
|
37 | 37 | } |
38 | 38 | include '../include/functions.php'; |
39 | 39 | include_once XOOPS_ROOT_PATH . '/class/xoopstree.php'; |
@@ -53,481 +53,481 @@ discard block |
||
53 | 53 | $moddir = $xoopsModule->getvar("dirname"); |
54 | 54 | define('EFQ_MODDIR', $moddir); |
55 | 55 | if (isset($_GET["typeid"])) { |
56 | - $gpc_typeid = intval($_GET["typeid"]); |
|
56 | + $gpc_typeid = intval($_GET["typeid"]); |
|
57 | 57 | } else |
58 | - if (isset($_POST["typeid"])) { |
|
59 | - $gpc_typeid = intval($_POST["typeid"]); |
|
60 | - } else { |
|
61 | - $gpc_typeid = '0'; |
|
62 | - } |
|
63 | - if (isset($_GET["offerid"])) { |
|
64 | - $gpc_offerid = intval($_GET["offerid"]); |
|
65 | - } else { |
|
66 | - $gpc_offerid = 0; |
|
67 | - } |
|
58 | + if (isset($_POST["typeid"])) { |
|
59 | + $gpc_typeid = intval($_POST["typeid"]); |
|
60 | + } else { |
|
61 | + $gpc_typeid = '0'; |
|
62 | + } |
|
63 | + if (isset($_GET["offerid"])) { |
|
64 | + $gpc_offerid = intval($_GET["offerid"]); |
|
65 | + } else { |
|
66 | + $gpc_offerid = 0; |
|
67 | + } |
|
68 | 68 | |
69 | - if (isset($_GET["dirid"])) { |
|
70 | - $gpc_dirid = intval($_GET["dirid"]); |
|
71 | - } else if (isset($_POST["dirid"])) { |
|
72 | - $gpc_dirid = intval($_POST["dirid"]); |
|
73 | - } else { |
|
74 | - $gpc_dirid = 0; |
|
75 | - } |
|
76 | - $eh = new ErrorHandler; //ErrorHandler object |
|
69 | + if (isset($_GET["dirid"])) { |
|
70 | + $gpc_dirid = intval($_GET["dirid"]); |
|
71 | + } else if (isset($_POST["dirid"])) { |
|
72 | + $gpc_dirid = intval($_POST["dirid"]); |
|
73 | + } else { |
|
74 | + $gpc_dirid = 0; |
|
75 | + } |
|
76 | + $eh = new ErrorHandler; //ErrorHandler object |
|
77 | 77 | |
78 | 78 | if (isset($_GET["op"])) { |
79 | - $op = $_GET["op"]; |
|
79 | + $op = $_GET["op"]; |
|
80 | 80 | } else if (isset($_POST["op"])) { |
81 | - $op = $_POST["op"]; |
|
82 | - } else { |
|
83 | - $op = ''; |
|
84 | - } |
|
81 | + $op = $_POST["op"]; |
|
82 | + } else { |
|
83 | + $op = ''; |
|
84 | + } |
|
85 | 85 | |
86 | - //function to list subscription types |
|
87 | - /** |
|
88 | - * listoffers() |
|
89 | - * |
|
90 | - * @return |
|
91 | - */ |
|
92 | - function listoffers() |
|
93 | - { |
|
94 | - include_once '../class/class.formradio.php'; |
|
95 | - global $xoopsDB, $gpc_dirid, $eh, $xoopsUser, $moddir, $itemtypes, $myts; |
|
86 | + //function to list subscription types |
|
87 | + /** |
|
88 | + * listoffers() |
|
89 | + * |
|
90 | + * @return |
|
91 | + */ |
|
92 | + function listoffers() |
|
93 | + { |
|
94 | + include_once '../class/class.formradio.php'; |
|
95 | + global $xoopsDB, $gpc_dirid, $eh, $xoopsUser, $moddir, $itemtypes, $myts; |
|
96 | 96 | |
97 | - $subscription = new efqSubscription(); |
|
98 | - $subscriptionhandler = new efqSubscriptionHandler(); |
|
99 | - xoops_cp_header(); |
|
100 | - adminmenu(4, _MD_MANAGE_SUBSCRIPTION_OFFERS); |
|
101 | - echo "<br />"; |
|
97 | + $subscription = new efqSubscription(); |
|
98 | + $subscriptionhandler = new efqSubscriptionHandler(); |
|
99 | + xoops_cp_header(); |
|
100 | + adminmenu(4, _MD_MANAGE_SUBSCRIPTION_OFFERS); |
|
101 | + echo "<br />"; |
|
102 | 102 | |
103 | - // Select directories from DB |
|
104 | - $directoryhandler = new efqDirectoryHandler(); |
|
103 | + // Select directories from DB |
|
104 | + $directoryhandler = new efqDirectoryHandler(); |
|
105 | 105 | |
106 | - if ($gpc_dirid == 0) { |
|
107 | - $directories = $directoryhandler->getAll(); |
|
106 | + if ($gpc_dirid == 0) { |
|
107 | + $directories = $directoryhandler->getAll(); |
|
108 | 108 | if (count($directories) == 0) { |
109 | - redirect_header(XOOPS_URL . '/modules/' . $moddir . '/admin/index.php', 1, |
|
110 | - _MD_NOACTIVEDIRECTORIES); |
|
111 | - exit(); |
|
112 | - } |
|
109 | + redirect_header(XOOPS_URL . '/modules/' . $moddir . '/admin/index.php', 1, |
|
110 | + _MD_NOACTIVEDIRECTORIES); |
|
111 | + exit(); |
|
112 | + } |
|
113 | 113 | |
114 | 114 | echo '<h4>' . _MD_SELECT_DIRECTORY. '</h4>'; |
115 | - echo '<table width="100%" border="0" cellspacing="1" class="outer">'; |
|
116 | - echo '<tr><th>' . _MD_OFFER_DIRECTORY . '</th></tr>'; |
|
117 | - foreach ($directories as $directory) { |
|
118 | - echo '<td class="even" valign="top"><a href="'.XOOPS_URL.'/modules/' . $moddir . '/admin/subscriptions.php?dirid='.$directory['dirid'].'">'. $myts->makeTboxData4Show($directory['name']) . '</a></td>'; |
|
119 | - echo '</tr>'; |
|
120 | - } |
|
121 | - } else { |
|
122 | - $itemtypehandler = new efqItemTypeHandler(); |
|
123 | - $arr_itemtypes = $itemtypehandler->getByDir($gpc_dirid); |
|
115 | + echo '<table width="100%" border="0" cellspacing="1" class="outer">'; |
|
116 | + echo '<tr><th>' . _MD_OFFER_DIRECTORY . '</th></tr>'; |
|
117 | + foreach ($directories as $directory) { |
|
118 | + echo '<td class="even" valign="top"><a href="'.XOOPS_URL.'/modules/' . $moddir . '/admin/subscriptions.php?dirid='.$directory['dirid'].'">'. $myts->makeTboxData4Show($directory['name']) . '</a></td>'; |
|
119 | + echo '</tr>'; |
|
120 | + } |
|
121 | + } else { |
|
122 | + $itemtypehandler = new efqItemTypeHandler(); |
|
123 | + $arr_itemtypes = $itemtypehandler->getByDir($gpc_dirid); |
|
124 | 124 | $obj_directory = $directoryhandler->get($gpc_dirid); |
125 | 125 | echo '<h4>' . sprintf(_MD_SUBSCR_OFFERS, $obj_directory->getVar('name')) . '</h4>'; |
126 | - echo '<table width="100%" border="0" cellspacing="1" class="outer">'; |
|
127 | - echo '<tr><th>' . _MD_OFFER_TITLE . |
|
128 | - '</th><th>' . _MD_OFFER_DURATION . '</th><th>' . _MD_OFFER_COUNT . "</th><th>" . |
|
129 | - _MD_OFFER_PRICE . "</th><th>" . _MD_OFFER_CURRENCY . "</th><th>" . |
|
130 | - _MD_OFFER_ACTIVE . "</th></tr>"; |
|
126 | + echo '<table width="100%" border="0" cellspacing="1" class="outer">'; |
|
127 | + echo '<tr><th>' . _MD_OFFER_TITLE . |
|
128 | + '</th><th>' . _MD_OFFER_DURATION . '</th><th>' . _MD_OFFER_COUNT . "</th><th>" . |
|
129 | + _MD_OFFER_PRICE . "</th><th>" . _MD_OFFER_CURRENCY . "</th><th>" . |
|
130 | + _MD_OFFER_ACTIVE . "</th></tr>"; |
|
131 | 131 | // For directory, show list of offers |
132 | - $offers = $subscriptionhandler->getOffers($gpc_dirid); |
|
133 | - $countoffers = count($offers); |
|
134 | - if ($countoffers > 0) { |
|
135 | - $i = 0; |
|
136 | - foreach ($offers as $offer) { |
|
137 | - $offertitle = $myts->makeTboxData4Show($offer['title']); |
|
138 | - if ($offer['activeyn'] == '1') { |
|
139 | - $activeyn = _MD_YES; |
|
140 | - } else { |
|
141 | - $activeyn = _MD_NO; |
|
142 | - } |
|
143 | - $subscription = new efqSubscription(); |
|
144 | - $durationarray = $subscription->durationArray(); |
|
145 | - //Show offers |
|
146 | - echo "<tr>"; |
|
147 | - echo '<td class="even"><a href="subscriptions.php?op=editoffer&offerid=' . $offer['offerid'] . |
|
148 | - '">' . $offertitle . '</a></td>'; |
|
149 | - echo '<td class="odd">' . $durationarray[$offer['duration']] . '</td>'; |
|
150 | - echo '<td class="even">' . $offer['count'] . '</td>'; |
|
151 | - echo '<td class="odd">' . $offer['price'] . '</td>'; |
|
152 | - echo '<td class="even">' . $offer['currency'] . '</td>'; |
|
153 | - echo '<td class="odd">' . $activeyn . '</td>'; |
|
154 | - echo '</tr>'; |
|
155 | - $i++; |
|
156 | - } |
|
157 | - } else { |
|
158 | - echo '<tr><td colspan="6" class="odd">' . _MD_NORESULTS . '</td></tr>'; |
|
159 | - } |
|
160 | - echo '</table>'; |
|
132 | + $offers = $subscriptionhandler->getOffers($gpc_dirid); |
|
133 | + $countoffers = count($offers); |
|
134 | + if ($countoffers > 0) { |
|
135 | + $i = 0; |
|
136 | + foreach ($offers as $offer) { |
|
137 | + $offertitle = $myts->makeTboxData4Show($offer['title']); |
|
138 | + if ($offer['activeyn'] == '1') { |
|
139 | + $activeyn = _MD_YES; |
|
140 | + } else { |
|
141 | + $activeyn = _MD_NO; |
|
142 | + } |
|
143 | + $subscription = new efqSubscription(); |
|
144 | + $durationarray = $subscription->durationArray(); |
|
145 | + //Show offers |
|
146 | + echo "<tr>"; |
|
147 | + echo '<td class="even"><a href="subscriptions.php?op=editoffer&offerid=' . $offer['offerid'] . |
|
148 | + '">' . $offertitle . '</a></td>'; |
|
149 | + echo '<td class="odd">' . $durationarray[$offer['duration']] . '</td>'; |
|
150 | + echo '<td class="even">' . $offer['count'] . '</td>'; |
|
151 | + echo '<td class="odd">' . $offer['price'] . '</td>'; |
|
152 | + echo '<td class="even">' . $offer['currency'] . '</td>'; |
|
153 | + echo '<td class="odd">' . $activeyn . '</td>'; |
|
154 | + echo '</tr>'; |
|
155 | + $i++; |
|
156 | + } |
|
157 | + } else { |
|
158 | + echo '<tr><td colspan="6" class="odd">' . _MD_NORESULTS . '</td></tr>'; |
|
159 | + } |
|
160 | + echo '</table>'; |
|
161 | 161 | |
162 | - echo "<h4>" . _MD_ADD_SUBSCR_OFFER . "</h4>"; |
|
163 | - echo '<table width="100%" border="0" cellspacing="1" class="outer"><tr><td>'; |
|
164 | - $form = new XoopsThemeForm(_MD_ADD_OFFER_FORM, 'newofferform', |
|
165 | - 'subscriptions.php'); |
|
162 | + echo "<h4>" . _MD_ADD_SUBSCR_OFFER . "</h4>"; |
|
163 | + echo '<table width="100%" border="0" cellspacing="1" class="outer"><tr><td>'; |
|
164 | + $form = new XoopsThemeForm(_MD_ADD_OFFER_FORM, 'newofferform', |
|
165 | + 'subscriptions.php'); |
|
166 | 166 | |
167 | - $form->addElement(new XoopsFormText(_MD_OFFER_TITLE, "title", 50, 100, ""), true); |
|
167 | + $form->addElement(new XoopsFormText(_MD_OFFER_TITLE, "title", 50, 100, ""), true); |
|
168 | 168 | |
169 | 169 | //$itemtypes_arr = $subscriptionhandler->itemTypesArray($gpc_dirid); |
170 | 170 | foreach($arr_itemtypes as $itemtype) { |
171 | 171 | $itemtypes[] = $itemtype['typename']; |
172 | 172 | } |
173 | - $itemtype_select = new XoopsFormSelect(_MD_SUBSCR_ITEMTYPE, 'typeid'); |
|
174 | - $itemtype_select->addOptionArray($itemtypes); |
|
175 | - $form->addElement($itemtype_select); |
|
173 | + $itemtype_select = new XoopsFormSelect(_MD_SUBSCR_ITEMTYPE, 'typeid'); |
|
174 | + $itemtype_select->addOptionArray($itemtypes); |
|
175 | + $form->addElement($itemtype_select); |
|
176 | 176 | |
177 | - $duration_arr = $subscription->durationArray(); |
|
178 | - $duration_select = new XoopsFormSelect(_MD_OFFER_DURATION, 'duration'); |
|
179 | - $duration_select->addOptionArray($duration_arr); |
|
180 | - $form->addElement($duration_select); |
|
177 | + $duration_arr = $subscription->durationArray(); |
|
178 | + $duration_select = new XoopsFormSelect(_MD_OFFER_DURATION, 'duration'); |
|
179 | + $duration_select->addOptionArray($duration_arr); |
|
180 | + $form->addElement($duration_select); |
|
181 | 181 | |
182 | - $form->addElement(new XoopsFormText(_MD_OFFER_COUNT, "count", 10, 50, ""), true); |
|
183 | - $form->addElement(new XoopsFormText(_MD_OFFER_PRICE, "price", 20, 50, ""), true); |
|
182 | + $form->addElement(new XoopsFormText(_MD_OFFER_COUNT, "count", 10, 50, ""), true); |
|
183 | + $form->addElement(new XoopsFormText(_MD_OFFER_PRICE, "price", 20, 50, ""), true); |
|
184 | 184 | |
185 | - $currency_arr = $subscription->currencyArray(); |
|
186 | - $currency_select = new XoopsFormSelect(_MD_OFFER_CURRENCY, 'currency'); |
|
187 | - $currency_select->addOptionArray($currency_arr); |
|
188 | - $form->addElement($currency_select); |
|
185 | + $currency_arr = $subscription->currencyArray(); |
|
186 | + $currency_select = new XoopsFormSelect(_MD_OFFER_CURRENCY, 'currency'); |
|
187 | + $currency_select->addOptionArray($currency_arr); |
|
188 | + $form->addElement($currency_select); |
|
189 | 189 | |
190 | - $form_active = new XoopsFormCheckBox(_MD_OFFER_ACTIVEYN, "activeyn", 0); |
|
191 | - $form_active->addOption(1, _MD_YESNO); |
|
192 | - $form->addElement($form_active, true); |
|
193 | - $form->addElement(new XoopsFormDhtmlTextArea(_MD_OFFER_DESCR, "descr", "", 5, 50, |
|
194 | - "")); |
|
195 | - $form->addElement(new XoopsFormButton('', 'submit', _MD_SUBMIT, 'submit')); |
|
196 | - $form->addElement(new XoopsFormHidden("op", "addoffer")); |
|
197 | - $form->addElement(new XoopsFormHidden("dirid", $gpc_dirid)); |
|
198 | - $form->addElement(new XoopsFormHidden("uid", $xoopsUser->getVar('uid'))); |
|
199 | - $form->display(); |
|
200 | - echo '</td></tr></table>'; |
|
190 | + $form_active = new XoopsFormCheckBox(_MD_OFFER_ACTIVEYN, "activeyn", 0); |
|
191 | + $form_active->addOption(1, _MD_YESNO); |
|
192 | + $form->addElement($form_active, true); |
|
193 | + $form->addElement(new XoopsFormDhtmlTextArea(_MD_OFFER_DESCR, "descr", "", 5, 50, |
|
194 | + "")); |
|
195 | + $form->addElement(new XoopsFormButton('', 'submit', _MD_SUBMIT, 'submit')); |
|
196 | + $form->addElement(new XoopsFormHidden("op", "addoffer")); |
|
197 | + $form->addElement(new XoopsFormHidden("dirid", $gpc_dirid)); |
|
198 | + $form->addElement(new XoopsFormHidden("uid", $xoopsUser->getVar('uid'))); |
|
199 | + $form->display(); |
|
200 | + echo '</td></tr></table>'; |
|
201 | 201 | |
202 | - //$itemtypehandler = new efqItemTypeHandler(); |
|
203 | - //$arr_itemtypes = $itemtypehandler->getByDir($gpc_dirid); |
|
204 | - $numrows = count($arr_itemtypes); |
|
205 | - if ($numrows > 0) { |
|
206 | - echo '<h4>' . _MD_ITEMTYPES . '</h4>'; |
|
207 | - echo '<table width="100%" border="0" cellspacing="1" class="outer">'; |
|
208 | - echo '<tr><th>' . _MD_ITEMTYPE_NAME . '</th><th>' . _MD_ITEMTYPE_LEVEL . |
|
209 | - '</th><th>' . _MD_ACTION . '</th></tr>'; |
|
210 | - $duration_arr = $subscription->durationArray(); |
|
211 | - foreach ($arr_itemtypes as $itemtype) { |
|
212 | - $typename = $myts->makeTboxData4Show($itemtype['typename']); |
|
213 | - $level = $myts->makeTboxData4Show($itemtype['level']); |
|
214 | - //Show types |
|
215 | - echo '<tr>'; |
|
216 | - echo '<td class="even"><a href="subscriptions.php?op=edittype&typeid=' . $itemtype['typeid'] . |
|
217 | - '">' . $itemtype['typename'] . '</strong></td>'; |
|
218 | - echo '<td class="odd">' . $itemtype['level'] . '</td>'; |
|
219 | - echo '<td class="odd"><a href="subscriptions.php?op=deltype&typeid=' . $itemtype['typeid'] . |
|
220 | - '">' . _MD_DELETE . '</strong></td>'; |
|
221 | - echo '</tr>'; |
|
222 | - } |
|
223 | - echo '</table>'; |
|
224 | - } else { |
|
225 | - echo '<h4>' . _MD_ITEMTYPES . '</h4>'; |
|
226 | - echo '<table width="100%" border="0" cellspacing="1" class="outer">'; |
|
227 | - echo '<tr><th>' . _MD_ITEMTYPE_NAME . '</th><th>' . _MD_ITEMTYPE_LEVEL . |
|
228 | - '</th><th>' . _MD_ACTION . '</th></tr>'; |
|
229 | - echo '<tr>'; |
|
230 | - echo '<td colspan="3" class="even">'._MD_NORESULTS.'</td>'; |
|
231 | - echo '</tr></table>'; |
|
232 | - } |
|
233 | - echo '<h4>' . _MD_ADD_ITEMTYPE . '</h4>'; |
|
202 | + //$itemtypehandler = new efqItemTypeHandler(); |
|
203 | + //$arr_itemtypes = $itemtypehandler->getByDir($gpc_dirid); |
|
204 | + $numrows = count($arr_itemtypes); |
|
205 | + if ($numrows > 0) { |
|
206 | + echo '<h4>' . _MD_ITEMTYPES . '</h4>'; |
|
207 | + echo '<table width="100%" border="0" cellspacing="1" class="outer">'; |
|
208 | + echo '<tr><th>' . _MD_ITEMTYPE_NAME . '</th><th>' . _MD_ITEMTYPE_LEVEL . |
|
209 | + '</th><th>' . _MD_ACTION . '</th></tr>'; |
|
210 | + $duration_arr = $subscription->durationArray(); |
|
211 | + foreach ($arr_itemtypes as $itemtype) { |
|
212 | + $typename = $myts->makeTboxData4Show($itemtype['typename']); |
|
213 | + $level = $myts->makeTboxData4Show($itemtype['level']); |
|
214 | + //Show types |
|
215 | + echo '<tr>'; |
|
216 | + echo '<td class="even"><a href="subscriptions.php?op=edittype&typeid=' . $itemtype['typeid'] . |
|
217 | + '">' . $itemtype['typename'] . '</strong></td>'; |
|
218 | + echo '<td class="odd">' . $itemtype['level'] . '</td>'; |
|
219 | + echo '<td class="odd"><a href="subscriptions.php?op=deltype&typeid=' . $itemtype['typeid'] . |
|
220 | + '">' . _MD_DELETE . '</strong></td>'; |
|
221 | + echo '</tr>'; |
|
222 | + } |
|
223 | + echo '</table>'; |
|
224 | + } else { |
|
225 | + echo '<h4>' . _MD_ITEMTYPES . '</h4>'; |
|
226 | + echo '<table width="100%" border="0" cellspacing="1" class="outer">'; |
|
227 | + echo '<tr><th>' . _MD_ITEMTYPE_NAME . '</th><th>' . _MD_ITEMTYPE_LEVEL . |
|
228 | + '</th><th>' . _MD_ACTION . '</th></tr>'; |
|
229 | + echo '<tr>'; |
|
230 | + echo '<td colspan="3" class="even">'._MD_NORESULTS.'</td>'; |
|
231 | + echo '</tr></table>'; |
|
232 | + } |
|
233 | + echo '<h4>' . _MD_ADD_ITEMTYPE . '</h4>'; |
|
234 | 234 | |
235 | - //Add item type form |
|
236 | - echo '<table width="100%" border="0" cellspacing="1" class="outer"><tr><td>'; |
|
237 | - $form = new XoopsThemeForm(_MD_ADD_ITEMTYPE_FORM, 'newitemtypeform', |
|
238 | - 'subscriptions.php'); |
|
239 | - $form->addElement(new XoopsFormText(_MD_ITEMTYPE_NAME, "typename", 50, 100, ""), true); |
|
240 | - $form->addElement(new XoopsFormText(_MD_ITEMTYPE_LEVEL, "level", 10, 50, ""), true); |
|
241 | - $form->addElement(new XoopsFormButton('', 'submit', _MD_SUBMIT, 'submit')); |
|
242 | - $form->addElement(new XoopsFormHidden("op", "addtype")); |
|
243 | - $form->addElement(new XoopsFormHidden("dirid", $gpc_dirid)); |
|
244 | - $form->addElement(new XoopsFormHidden("uid", $xoopsUser->getVar('uid'))); |
|
245 | - $form->display(); |
|
246 | - } |
|
235 | + //Add item type form |
|
236 | + echo '<table width="100%" border="0" cellspacing="1" class="outer"><tr><td>'; |
|
237 | + $form = new XoopsThemeForm(_MD_ADD_ITEMTYPE_FORM, 'newitemtypeform', |
|
238 | + 'subscriptions.php'); |
|
239 | + $form->addElement(new XoopsFormText(_MD_ITEMTYPE_NAME, "typename", 50, 100, ""), true); |
|
240 | + $form->addElement(new XoopsFormText(_MD_ITEMTYPE_LEVEL, "level", 10, 50, ""), true); |
|
241 | + $form->addElement(new XoopsFormButton('', 'submit', _MD_SUBMIT, 'submit')); |
|
242 | + $form->addElement(new XoopsFormHidden("op", "addtype")); |
|
243 | + $form->addElement(new XoopsFormHidden("dirid", $gpc_dirid)); |
|
244 | + $form->addElement(new XoopsFormHidden("uid", $xoopsUser->getVar('uid'))); |
|
245 | + $form->display(); |
|
246 | + } |
|
247 | 247 | |
248 | 248 | |
249 | - echo '</td></tr></table>'; |
|
250 | - xoops_cp_footer(); |
|
251 | - } |
|
249 | + echo '</td></tr></table>'; |
|
250 | + xoops_cp_footer(); |
|
251 | + } |
|
252 | 252 | |
253 | - /** |
|
254 | - * edittype() |
|
255 | - * |
|
256 | - * @return |
|
257 | - */ |
|
258 | - function edittype($gpc_typeid = 0) |
|
259 | - { |
|
260 | - global $xoopsDB, $eh, $myts, $xoopsUser; |
|
261 | - // Select directories from DB |
|
262 | - //$directoryhandler = new efqDirectoryHandler(); |
|
263 | - //$directories = $directoryhandler->getAll(); |
|
264 | - if ($gpc_typeid == 0) { |
|
265 | - redirect_header(XOOPS_URL . '/modules/' . $moddir . '/admin/subscriptions.php', |
|
266 | - 2, _MD_INVALID_TYPEID); |
|
267 | - exit(); |
|
268 | - } |
|
269 | - xoops_cp_header(); |
|
270 | - adminmenu(4, _MD_MANAGE_SUBSCRIPTION_OFFERS); |
|
271 | - echo "<br />"; |
|
253 | + /** |
|
254 | + * edittype() |
|
255 | + * |
|
256 | + * @return |
|
257 | + */ |
|
258 | + function edittype($gpc_typeid = 0) |
|
259 | + { |
|
260 | + global $xoopsDB, $eh, $myts, $xoopsUser; |
|
261 | + // Select directories from DB |
|
262 | + //$directoryhandler = new efqDirectoryHandler(); |
|
263 | + //$directories = $directoryhandler->getAll(); |
|
264 | + if ($gpc_typeid == 0) { |
|
265 | + redirect_header(XOOPS_URL . '/modules/' . $moddir . '/admin/subscriptions.php', |
|
266 | + 2, _MD_INVALID_TYPEID); |
|
267 | + exit(); |
|
268 | + } |
|
269 | + xoops_cp_header(); |
|
270 | + adminmenu(4, _MD_MANAGE_SUBSCRIPTION_OFFERS); |
|
271 | + echo "<br />"; |
|
272 | 272 | |
273 | - $sql = 'SELECT typeid, typename, level, dirid FROM ' . $xoopsDB->prefix("efqdiralpha1_itemtypes") . |
|
274 | - ' WHERE typeid=' . intval($gpc_typeid); |
|
275 | - $result = $xoopsDB->query($sql) or $eh->show("0013"); |
|
276 | - $numrows = $xoopsDB->getRowsNum($result); |
|
277 | - if ($numrows > 0) { |
|
278 | - //$duration_arr = $subscription->durationArray(); |
|
279 | - while (list($typeid, $typename, $level, $dirid) = $xoopsDB->fetchRow($result)) { |
|
280 | - echo '<table width="100%" border="0" cellspacing="1" class="outer"><tr><td>'; |
|
281 | - $form = new XoopsThemeForm(_MD_EDIT_ITEMTYPE_FORM, 'edititemtypeform', |
|
282 | - 'subscriptions.php'); |
|
283 | - $form->addElement(new XoopsFormText(_MD_ITEMTYPE_NAME, "typename", 50, 100, $typename), true); |
|
284 | - $form->addElement(new XoopsFormText(_MD_ITEMTYPE_LEVEL, "level", 10, 50, $level), true); |
|
285 | - $form->addElement(new XoopsFormButton('', 'submit', _MD_SUBMIT, 'submit')); |
|
286 | - $form->addElement(new XoopsFormHidden("op", "savetype")); |
|
287 | - $form->addElement(new XoopsFormHidden("typeid", $gpc_typeid)); |
|
288 | - $form->addElement(new XoopsFormHidden("dirid", $dirid)); |
|
289 | - $form->addElement(new XoopsFormHidden("uid", $xoopsUser->getVar('uid'))); |
|
290 | - $form->display(); |
|
291 | - echo "</td></tr></table>"; |
|
292 | - } |
|
293 | - } else { |
|
294 | - redirect_header(XOOPS_URL . '/modules/$moddir/admin/subscriptions.php', 2, |
|
295 | - _MD_INVALID_TYPEID); |
|
296 | - exit(); |
|
297 | - } |
|
298 | - xoops_cp_footer(); |
|
299 | - } |
|
273 | + $sql = 'SELECT typeid, typename, level, dirid FROM ' . $xoopsDB->prefix("efqdiralpha1_itemtypes") . |
|
274 | + ' WHERE typeid=' . intval($gpc_typeid); |
|
275 | + $result = $xoopsDB->query($sql) or $eh->show("0013"); |
|
276 | + $numrows = $xoopsDB->getRowsNum($result); |
|
277 | + if ($numrows > 0) { |
|
278 | + //$duration_arr = $subscription->durationArray(); |
|
279 | + while (list($typeid, $typename, $level, $dirid) = $xoopsDB->fetchRow($result)) { |
|
280 | + echo '<table width="100%" border="0" cellspacing="1" class="outer"><tr><td>'; |
|
281 | + $form = new XoopsThemeForm(_MD_EDIT_ITEMTYPE_FORM, 'edititemtypeform', |
|
282 | + 'subscriptions.php'); |
|
283 | + $form->addElement(new XoopsFormText(_MD_ITEMTYPE_NAME, "typename", 50, 100, $typename), true); |
|
284 | + $form->addElement(new XoopsFormText(_MD_ITEMTYPE_LEVEL, "level", 10, 50, $level), true); |
|
285 | + $form->addElement(new XoopsFormButton('', 'submit', _MD_SUBMIT, 'submit')); |
|
286 | + $form->addElement(new XoopsFormHidden("op", "savetype")); |
|
287 | + $form->addElement(new XoopsFormHidden("typeid", $gpc_typeid)); |
|
288 | + $form->addElement(new XoopsFormHidden("dirid", $dirid)); |
|
289 | + $form->addElement(new XoopsFormHidden("uid", $xoopsUser->getVar('uid'))); |
|
290 | + $form->display(); |
|
291 | + echo "</td></tr></table>"; |
|
292 | + } |
|
293 | + } else { |
|
294 | + redirect_header(XOOPS_URL . '/modules/$moddir/admin/subscriptions.php', 2, |
|
295 | + _MD_INVALID_TYPEID); |
|
296 | + exit(); |
|
297 | + } |
|
298 | + xoops_cp_footer(); |
|
299 | + } |
|
300 | 300 | |
301 | - /** |
|
302 | - * editoffer() |
|
303 | - * |
|
304 | - * @return |
|
305 | - */ |
|
306 | - function editoffer($gpc_offerid = 0) |
|
307 | - { |
|
308 | - global $xoopsDB, $eh, $xoopsUser, $itemtypes; |
|
309 | - if ($gpc_offerid == 0) { |
|
310 | - redirect_header(XOOPS_URL . '/modules/' . EFQ_MODDIR . |
|
311 | - '/admin/subscriptions.php', 2, _MD_INVALID_OFFERID); |
|
312 | - } |
|
313 | - $obj_subscr = new efqSubscription(); |
|
314 | - $subscr_offer_handler = new efqSubscriptionOfferHandler(); |
|
315 | - $subscr_handler = new efqSubscriptionHandler(); |
|
301 | + /** |
|
302 | + * editoffer() |
|
303 | + * |
|
304 | + * @return |
|
305 | + */ |
|
306 | + function editoffer($gpc_offerid = 0) |
|
307 | + { |
|
308 | + global $xoopsDB, $eh, $xoopsUser, $itemtypes; |
|
309 | + if ($gpc_offerid == 0) { |
|
310 | + redirect_header(XOOPS_URL . '/modules/' . EFQ_MODDIR . |
|
311 | + '/admin/subscriptions.php', 2, _MD_INVALID_OFFERID); |
|
312 | + } |
|
313 | + $obj_subscr = new efqSubscription(); |
|
314 | + $subscr_offer_handler = new efqSubscriptionOfferHandler(); |
|
315 | + $subscr_handler = new efqSubscriptionHandler(); |
|
316 | 316 | if($subscr_offer_handler->setOffer($gpc_offerid)) { |
317 | 317 | $subcr_offer_set = true; |
318 | 318 | } else { |
319 | 319 | $subcr_offer_set = false; |
320 | 320 | } |
321 | 321 | $obj_subscr_offer = $subscr_offer_handler->getOffer(); |
322 | - xoops_cp_header(); |
|
323 | - adminmenu(4, _MD_MANAGE_SUBSCRIPTION_OFFERS); |
|
324 | - echo "<br />"; |
|
325 | - if ($subcr_offer_set) { |
|
326 | - $duration_arr = $obj_subscr->durationArray(); |
|
327 | - echo '<table width="100%" border="0" cellspacing="1" class="outer"><tr><td>'; |
|
328 | - $form = new XoopsThemeForm(_MD_EDIT_OFFER_FORM, 'newofferform', |
|
329 | - 'subscriptions.php'); |
|
322 | + xoops_cp_header(); |
|
323 | + adminmenu(4, _MD_MANAGE_SUBSCRIPTION_OFFERS); |
|
324 | + echo "<br />"; |
|
325 | + if ($subcr_offer_set) { |
|
326 | + $duration_arr = $obj_subscr->durationArray(); |
|
327 | + echo '<table width="100%" border="0" cellspacing="1" class="outer"><tr><td>'; |
|
328 | + $form = new XoopsThemeForm(_MD_EDIT_OFFER_FORM, 'newofferform', |
|
329 | + 'subscriptions.php'); |
|
330 | 330 | |
331 | - $form->addElement(new XoopsFormText(_MD_OFFER_TITLE, "title", 50, 100, $obj_subscr_offer->getVar('title')), true); |
|
331 | + $form->addElement(new XoopsFormText(_MD_OFFER_TITLE, "title", 50, 100, $obj_subscr_offer->getVar('title')), true); |
|
332 | 332 | |
333 | - $itemtypes_arr = $subscr_handler->itemtypesArray(); |
|
334 | - $itemtype_select = new XoopsFormSelect(_MD_SUBSCR_ITEMTYPE, 'typeid', $obj_subscr_offer->getVar('typeid')); |
|
335 | - $itemtype_select->addOptionArray($itemtypes_arr); |
|
336 | - $form->addElement($itemtype_select); |
|
333 | + $itemtypes_arr = $subscr_handler->itemtypesArray(); |
|
334 | + $itemtype_select = new XoopsFormSelect(_MD_SUBSCR_ITEMTYPE, 'typeid', $obj_subscr_offer->getVar('typeid')); |
|
335 | + $itemtype_select->addOptionArray($itemtypes_arr); |
|
336 | + $form->addElement($itemtype_select); |
|
337 | 337 | |
338 | - //$duration_arr = $subscription->durationArray(); |
|
339 | - $duration_select = new XoopsFormSelect(_MD_OFFER_DURATION, 'duration', $obj_subscr_offer->getVar('duration')); |
|
340 | - $duration_select->addOptionArray($duration_arr); |
|
341 | - $form->addElement($duration_select); |
|
338 | + //$duration_arr = $subscription->durationArray(); |
|
339 | + $duration_select = new XoopsFormSelect(_MD_OFFER_DURATION, 'duration', $obj_subscr_offer->getVar('duration')); |
|
340 | + $duration_select->addOptionArray($duration_arr); |
|
341 | + $form->addElement($duration_select); |
|
342 | 342 | |
343 | - $form->addElement(new XoopsFormText(_MD_OFFER_COUNT, "count", 10, 50, $obj_subscr_offer->getVar('count')), true); |
|
344 | - $form->addElement(new XoopsFormText(_MD_OFFER_PRICE, "price", 20, 50, $obj_subscr_offer->getVar('price')), true); |
|
343 | + $form->addElement(new XoopsFormText(_MD_OFFER_COUNT, "count", 10, 50, $obj_subscr_offer->getVar('count')), true); |
|
344 | + $form->addElement(new XoopsFormText(_MD_OFFER_PRICE, "price", 20, 50, $obj_subscr_offer->getVar('price')), true); |
|
345 | 345 | |
346 | - $currency_arr = $obj_subscr->currencyArray(); |
|
347 | - $currency_select = new XoopsFormSelect(_MD_OFFER_CURRENCY, 'currency', $obj_subscr_offer->getVar('currency')); |
|
348 | - $currency_select->addOptionArray($currency_arr); |
|
349 | - $form->addElement($currency_select); |
|
346 | + $currency_arr = $obj_subscr->currencyArray(); |
|
347 | + $currency_select = new XoopsFormSelect(_MD_OFFER_CURRENCY, 'currency', $obj_subscr_offer->getVar('currency')); |
|
348 | + $currency_select->addOptionArray($currency_arr); |
|
349 | + $form->addElement($currency_select); |
|
350 | 350 | |
351 | - $form_active = new XoopsFormCheckBox(_MD_OFFER_ACTIVEYN, "activeyn", $obj_subscr_offer->getVar('activeyn')); |
|
352 | - $form_active->addOption(1, _MD_YESNO); |
|
353 | - $form->addElement($form_active, true); |
|
354 | - $form->addElement(new XoopsFormDhtmlTextArea(_MD_OFFER_DESCR, "descr", $obj_subscr_offer->getVar('descr'), 5, |
|
355 | - 50, "")); |
|
356 | - $form->addElement(new XoopsFormButton('', 'submit', _MD_SUBMIT, 'submit')); |
|
357 | - $form->addElement(new XoopsFormHidden("op", "saveoffer")); |
|
358 | - $form->addElement(new XoopsFormHidden("offerid", $gpc_offerid)); |
|
359 | - $form->addElement(new XoopsFormHidden("uid", $xoopsUser->getVar('uid'))); |
|
360 | - $form->display(); |
|
361 | - echo '</td></tr></table>'; |
|
362 | - } else { |
|
363 | - redirect_header(XOOPS_URL . '/modules/' . EFQ_MODDIR . |
|
364 | - '/admin/subscriptions.php', 2, _MD_INVALID_OFFERID); |
|
365 | - } |
|
366 | - xoops_cp_footer(); |
|
367 | - } |
|
351 | + $form_active = new XoopsFormCheckBox(_MD_OFFER_ACTIVEYN, "activeyn", $obj_subscr_offer->getVar('activeyn')); |
|
352 | + $form_active->addOption(1, _MD_YESNO); |
|
353 | + $form->addElement($form_active, true); |
|
354 | + $form->addElement(new XoopsFormDhtmlTextArea(_MD_OFFER_DESCR, "descr", $obj_subscr_offer->getVar('descr'), 5, |
|
355 | + 50, "")); |
|
356 | + $form->addElement(new XoopsFormButton('', 'submit', _MD_SUBMIT, 'submit')); |
|
357 | + $form->addElement(new XoopsFormHidden("op", "saveoffer")); |
|
358 | + $form->addElement(new XoopsFormHidden("offerid", $gpc_offerid)); |
|
359 | + $form->addElement(new XoopsFormHidden("uid", $xoopsUser->getVar('uid'))); |
|
360 | + $form->display(); |
|
361 | + echo '</td></tr></table>'; |
|
362 | + } else { |
|
363 | + redirect_header(XOOPS_URL . '/modules/' . EFQ_MODDIR . |
|
364 | + '/admin/subscriptions.php', 2, _MD_INVALID_OFFERID); |
|
365 | + } |
|
366 | + xoops_cp_footer(); |
|
367 | + } |
|
368 | 368 | |
369 | - //function to view one subscription type |
|
370 | - /** |
|
371 | - * viewtype() |
|
372 | - * |
|
373 | - * @return |
|
374 | - */ |
|
375 | - function viewtype() |
|
376 | - { |
|
377 | - global $xoopsDB, $eh, $get_typeid; |
|
378 | - if (isset($get_itemid)) { |
|
379 | - //view type |
|
380 | - } |
|
381 | - } |
|
369 | + //function to view one subscription type |
|
370 | + /** |
|
371 | + * viewtype() |
|
372 | + * |
|
373 | + * @return |
|
374 | + */ |
|
375 | + function viewtype() |
|
376 | + { |
|
377 | + global $xoopsDB, $eh, $get_typeid; |
|
378 | + if (isset($get_itemid)) { |
|
379 | + //view type |
|
380 | + } |
|
381 | + } |
|
382 | 382 | |
383 | - /** |
|
384 | - * saveoffer() |
|
385 | - * |
|
386 | - * @param bool $new |
|
387 | - * @return nothing |
|
388 | - */ |
|
389 | - function saveoffer($new = false) |
|
390 | - { |
|
391 | - global $myts, $moddir, $xoopsDB; |
|
392 | - $obj_offer = new efqSubscriptionOffer(); |
|
393 | - if ($new == true) { |
|
394 | - $obj_offer->setNew(); |
|
395 | - } else { |
|
396 | - $obj_offer->setVar('offerid', intval($_POST['offerid'])); |
|
397 | - } |
|
398 | - $obj_offer->setVar('typeid', intval($_POST['typeid'])); |
|
399 | - $obj_offer->setVar('title', $myts->makeTboxData4Save($_POST['title'])); |
|
400 | - $obj_offer->setVar('duration', intval($_POST['duration'])); |
|
401 | - $obj_offer->setVar('count', intval($_POST['count'])); |
|
402 | - $obj_offer->setVar('price', $myts->makeTboxData4Save($_POST['price'])); |
|
403 | - if (isset($_POST['activeyn'])) { |
|
404 | - $post_activeyn = intval($_POST['activeyn']); |
|
405 | - } else { |
|
406 | - $post_activeyn = 0; |
|
407 | - } |
|
408 | - $obj_offer->setVar('activeyn', $post_activeyn); |
|
409 | - $obj_offer->setVar('currency', $myts->makeTboxData4Save($_POST['currency'])); |
|
410 | - $obj_offer->setVar('descr', $myts->makeTareaData4Save($_POST['descr'])); |
|
411 | - $obj_offer->setVar('dirid', intval($_POST['dirid'])); |
|
412 | - $offerhandler = new efqSubscriptionOfferHandler($obj_offer); |
|
383 | + /** |
|
384 | + * saveoffer() |
|
385 | + * |
|
386 | + * @param bool $new |
|
387 | + * @return nothing |
|
388 | + */ |
|
389 | + function saveoffer($new = false) |
|
390 | + { |
|
391 | + global $myts, $moddir, $xoopsDB; |
|
392 | + $obj_offer = new efqSubscriptionOffer(); |
|
393 | + if ($new == true) { |
|
394 | + $obj_offer->setNew(); |
|
395 | + } else { |
|
396 | + $obj_offer->setVar('offerid', intval($_POST['offerid'])); |
|
397 | + } |
|
398 | + $obj_offer->setVar('typeid', intval($_POST['typeid'])); |
|
399 | + $obj_offer->setVar('title', $myts->makeTboxData4Save($_POST['title'])); |
|
400 | + $obj_offer->setVar('duration', intval($_POST['duration'])); |
|
401 | + $obj_offer->setVar('count', intval($_POST['count'])); |
|
402 | + $obj_offer->setVar('price', $myts->makeTboxData4Save($_POST['price'])); |
|
403 | + if (isset($_POST['activeyn'])) { |
|
404 | + $post_activeyn = intval($_POST['activeyn']); |
|
405 | + } else { |
|
406 | + $post_activeyn = 0; |
|
407 | + } |
|
408 | + $obj_offer->setVar('activeyn', $post_activeyn); |
|
409 | + $obj_offer->setVar('currency', $myts->makeTboxData4Save($_POST['currency'])); |
|
410 | + $obj_offer->setVar('descr', $myts->makeTareaData4Save($_POST['descr'])); |
|
411 | + $obj_offer->setVar('dirid', intval($_POST['dirid'])); |
|
412 | + $offerhandler = new efqSubscriptionOfferHandler($obj_offer); |
|
413 | 413 | if ($obj_offer->isNew()) { |
414 | 414 | $offerhandler->insertOffer($obj_offer); |
415 | 415 | } else { |
416 | 416 | $offerhandler->updateOffer($obj_offer,true); |
417 | 417 | } |
418 | 418 | |
419 | - redirect_header(XOOPS_URL . '/modules/' . $moddir . |
|
420 | - '/admin/subscriptions.php?offerid=' . $obj_offer->getVar('offerid'), 2, |
|
421 | - _MD_SAVED); |
|
422 | - exit(); |
|
423 | - } |
|
419 | + redirect_header(XOOPS_URL . '/modules/' . $moddir . |
|
420 | + '/admin/subscriptions.php?offerid=' . $obj_offer->getVar('offerid'), 2, |
|
421 | + _MD_SAVED); |
|
422 | + exit(); |
|
423 | + } |
|
424 | 424 | |
425 | - /** |
|
426 | - * deltype() |
|
427 | - * |
|
428 | - * @return nothing |
|
429 | - */ |
|
430 | - function deltype() //function to delete an item type |
|
425 | + /** |
|
426 | + * deltype() |
|
427 | + * |
|
428 | + * @return nothing |
|
429 | + */ |
|
430 | + function deltype() //function to delete an item type |
|
431 | 431 | |
432 | - { |
|
433 | - global $xoopsDB, $eh, $moddir; |
|
434 | - $subscription = new efqSubscription(); |
|
435 | - $subscriptionhandler = new efqSubscriptionHandler(); |
|
436 | - if (isset($_GET['typeid'])) { |
|
437 | - $g_typeid = intval($_GET['typeid']); |
|
438 | - } else { |
|
439 | - redirect_header(XOOPS_URL . '/modules/' . $moddir . '/admin/subscriptions.php', |
|
440 | - 2, _MD_ERR_ITEMTYPE_DELETE); |
|
441 | - exit(); |
|
442 | - } |
|
432 | + { |
|
433 | + global $xoopsDB, $eh, $moddir; |
|
434 | + $subscription = new efqSubscription(); |
|
435 | + $subscriptionhandler = new efqSubscriptionHandler(); |
|
436 | + if (isset($_GET['typeid'])) { |
|
437 | + $g_typeid = intval($_GET['typeid']); |
|
438 | + } else { |
|
439 | + redirect_header(XOOPS_URL . '/modules/' . $moddir . '/admin/subscriptions.php', |
|
440 | + 2, _MD_ERR_ITEMTYPE_DELETE); |
|
441 | + exit(); |
|
442 | + } |
|
443 | 443 | |
444 | - if ($subscriptionhandler->countSubscriptionsForType($g_typeid) > 0) { |
|
445 | - redirect_header(XOOPS_URL . '/modules/' . EFQ_MODDIR . |
|
446 | - '/admin/subscriptions.php', 3, _MD_ERR_ITEMTYPE_LINKED_TO_LISTINGS); |
|
447 | - exit(); |
|
448 | - } |
|
449 | - $itemtypehandler = new efqItemTypeHandler(); |
|
450 | - $itemtypehandler->set($g_typeid); |
|
451 | - $obj_itemtype = $itemtypehandler->getObjItemType(); |
|
452 | - //$obj_itemtype->setVar('typeid', $g_typeid); |
|
453 | - $itemtypehandler->delete($obj_itemtype, true); |
|
454 | - redirect_header(XOOPS_URL . '/modules/' . EFQ_MODDIR . |
|
455 | - '/admin/subscriptions.php?dirid='.$obj_itemtype->getVar('dirid'), 1, _MD_ITEMTYPE_DELETED); |
|
456 | - exit(); |
|
457 | - } |
|
444 | + if ($subscriptionhandler->countSubscriptionsForType($g_typeid) > 0) { |
|
445 | + redirect_header(XOOPS_URL . '/modules/' . EFQ_MODDIR . |
|
446 | + '/admin/subscriptions.php', 3, _MD_ERR_ITEMTYPE_LINKED_TO_LISTINGS); |
|
447 | + exit(); |
|
448 | + } |
|
449 | + $itemtypehandler = new efqItemTypeHandler(); |
|
450 | + $itemtypehandler->set($g_typeid); |
|
451 | + $obj_itemtype = $itemtypehandler->getObjItemType(); |
|
452 | + //$obj_itemtype->setVar('typeid', $g_typeid); |
|
453 | + $itemtypehandler->delete($obj_itemtype, true); |
|
454 | + redirect_header(XOOPS_URL . '/modules/' . EFQ_MODDIR . |
|
455 | + '/admin/subscriptions.php?dirid='.$obj_itemtype->getVar('dirid'), 1, _MD_ITEMTYPE_DELETED); |
|
456 | + exit(); |
|
457 | + } |
|
458 | 458 | |
459 | - //function to save an existing subscription type |
|
460 | - /** |
|
461 | - * savetype() |
|
462 | - * |
|
463 | - * @param bool $new |
|
464 | - * @return |
|
465 | - */ |
|
466 | - function savetype($new = false) |
|
467 | - { |
|
468 | - global $post_typeid, $moddir, $myts; |
|
469 | - $p_typeid = $_POST['typeid']; |
|
470 | - $p_dirid = $_POST['dirid']; |
|
459 | + //function to save an existing subscription type |
|
460 | + /** |
|
461 | + * savetype() |
|
462 | + * |
|
463 | + * @param bool $new |
|
464 | + * @return |
|
465 | + */ |
|
466 | + function savetype($new = false) |
|
467 | + { |
|
468 | + global $post_typeid, $moddir, $myts; |
|
469 | + $p_typeid = $_POST['typeid']; |
|
470 | + $p_dirid = $_POST['dirid']; |
|
471 | 471 | $p_typename = $myts->makeTboxData4Save($_POST['typename']); |
472 | - $p_level = $myts->makeTboxData4Save($_POST['level']); |
|
472 | + $p_level = $myts->makeTboxData4Save($_POST['level']); |
|
473 | 473 | $itemtypehandler = new efqItemTypeHandler(); |
474 | - $obj_itemtype = new efqItemType(); |
|
475 | - if ($new) { |
|
476 | - $obj_itemtype->setNew(); |
|
477 | - } |
|
478 | - $obj_itemtype->setVar('typeid', $p_typeid); |
|
479 | - $obj_itemtype->setVar('dirid', $p_dirid); |
|
480 | - $obj_itemtype->setVar('typename', $p_typename); |
|
481 | - $obj_itemtype->setVar('level', $p_level); |
|
482 | - if ($new) { |
|
483 | - if ($itemtypehandler->insert($obj_itemtype)) { |
|
484 | - redirect_header(XOOPS_URL . '/modules/' . $moddir . |
|
485 | - '/admin/subscriptions.php?dirid=' . $obj_itemtype->getVar('dirid'), 2, _MD_SAVED); |
|
486 | - } else { |
|
487 | - echo $obj_itemtype->getErrors(); |
|
488 | - } |
|
489 | - } else { |
|
490 | - if ($itemtypehandler->update($obj_itemtype)) { |
|
491 | - redirect_header(XOOPS_URL . '/modules/' . $moddir . |
|
492 | - '/admin/subscriptions.php?dirid=' . $obj_itemtype->getVar('dirid'), 2, _MD_SAVED); |
|
493 | - } else { |
|
494 | - echo $obj_itemtype->getErrors(); |
|
495 | - } |
|
496 | - } |
|
497 | - exit(); |
|
498 | - } |
|
474 | + $obj_itemtype = new efqItemType(); |
|
475 | + if ($new) { |
|
476 | + $obj_itemtype->setNew(); |
|
477 | + } |
|
478 | + $obj_itemtype->setVar('typeid', $p_typeid); |
|
479 | + $obj_itemtype->setVar('dirid', $p_dirid); |
|
480 | + $obj_itemtype->setVar('typename', $p_typename); |
|
481 | + $obj_itemtype->setVar('level', $p_level); |
|
482 | + if ($new) { |
|
483 | + if ($itemtypehandler->insert($obj_itemtype)) { |
|
484 | + redirect_header(XOOPS_URL . '/modules/' . $moddir . |
|
485 | + '/admin/subscriptions.php?dirid=' . $obj_itemtype->getVar('dirid'), 2, _MD_SAVED); |
|
486 | + } else { |
|
487 | + echo $obj_itemtype->getErrors(); |
|
488 | + } |
|
489 | + } else { |
|
490 | + if ($itemtypehandler->update($obj_itemtype)) { |
|
491 | + redirect_header(XOOPS_URL . '/modules/' . $moddir . |
|
492 | + '/admin/subscriptions.php?dirid=' . $obj_itemtype->getVar('dirid'), 2, _MD_SAVED); |
|
493 | + } else { |
|
494 | + echo $obj_itemtype->getErrors(); |
|
495 | + } |
|
496 | + } |
|
497 | + exit(); |
|
498 | + } |
|
499 | 499 | |
500 | - switch ($op) { |
|
501 | - case 'delete': |
|
502 | - deltype(); |
|
503 | - break; |
|
504 | - case 'addtype': |
|
505 | - savetype(true); |
|
506 | - break; |
|
507 | - case 'edittype': |
|
508 | - edittype($gpc_typeid); |
|
509 | - break; |
|
510 | - case 'deltype': |
|
511 | - deltype($gpc_dirid); |
|
512 | - break; |
|
513 | - case 'savetype': |
|
514 | - savetype(); |
|
515 | - break; |
|
516 | - case 'viewtype': |
|
517 | - viewtype(); |
|
518 | - break; |
|
519 | - case 'addoffer': |
|
520 | - saveoffer(true); |
|
521 | - break; |
|
522 | - case 'editoffer': |
|
523 | - editoffer($gpc_offerid); |
|
524 | - break; |
|
525 | - case 'saveoffer': |
|
526 | - saveoffer(); |
|
527 | - break; |
|
528 | - default: |
|
529 | - listoffers(); |
|
530 | - break; |
|
531 | - } |
|
500 | + switch ($op) { |
|
501 | + case 'delete': |
|
502 | + deltype(); |
|
503 | + break; |
|
504 | + case 'addtype': |
|
505 | + savetype(true); |
|
506 | + break; |
|
507 | + case 'edittype': |
|
508 | + edittype($gpc_typeid); |
|
509 | + break; |
|
510 | + case 'deltype': |
|
511 | + deltype($gpc_dirid); |
|
512 | + break; |
|
513 | + case 'savetype': |
|
514 | + savetype(); |
|
515 | + break; |
|
516 | + case 'viewtype': |
|
517 | + viewtype(); |
|
518 | + break; |
|
519 | + case 'addoffer': |
|
520 | + saveoffer(true); |
|
521 | + break; |
|
522 | + case 'editoffer': |
|
523 | + editoffer($gpc_offerid); |
|
524 | + break; |
|
525 | + case 'saveoffer': |
|
526 | + saveoffer(); |
|
527 | + break; |
|
528 | + default: |
|
529 | + listoffers(); |
|
530 | + break; |
|
531 | + } |
|
532 | 532 | |
533 | 533 | ?> |
534 | 534 | \ No newline at end of file |
@@ -30,17 +30,17 @@ discard block |
||
30 | 30 | // Based upon the mylinks and the mxDirectory modules // |
31 | 31 | // ------------------------------------------------------------------------- // |
32 | 32 | include '../../../include/cp_header.php'; |
33 | -if (file_exists("../language/" . $xoopsConfig['language'] . "/main.php")) { |
|
34 | - include "../language/" . $xoopsConfig['language'] . "/main.php"; |
|
33 | +if (file_exists("../language/".$xoopsConfig['language']."/main.php")) { |
|
34 | + include "../language/".$xoopsConfig['language']."/main.php"; |
|
35 | 35 | } else { |
36 | 36 | include "../language/english/main.php"; |
37 | 37 | } |
38 | 38 | include '../include/functions.php'; |
39 | -include_once XOOPS_ROOT_PATH . '/class/xoopstree.php'; |
|
40 | -include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
41 | -include_once XOOPS_ROOT_PATH . '/include/xoopscodes.php'; |
|
42 | -include_once XOOPS_ROOT_PATH . '/class/module.errorhandler.php'; |
|
43 | -include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
39 | +include_once XOOPS_ROOT_PATH.'/class/xoopstree.php'; |
|
40 | +include_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
41 | +include_once XOOPS_ROOT_PATH.'/include/xoopscodes.php'; |
|
42 | +include_once XOOPS_ROOT_PATH.'/class/module.errorhandler.php'; |
|
43 | +include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
44 | 44 | include_once '../class/class.subscription.php'; |
45 | 45 | include_once '../class/class.directory.php'; |
46 | 46 | include_once '../class/class.itemtype.php'; |
@@ -106,28 +106,28 @@ discard block |
||
106 | 106 | if ($gpc_dirid == 0) { |
107 | 107 | $directories = $directoryhandler->getAll(); |
108 | 108 | if (count($directories) == 0) { |
109 | - redirect_header(XOOPS_URL . '/modules/' . $moddir . '/admin/index.php', 1, |
|
109 | + redirect_header(XOOPS_URL.'/modules/'.$moddir.'/admin/index.php', 1, |
|
110 | 110 | _MD_NOACTIVEDIRECTORIES); |
111 | 111 | exit(); |
112 | 112 | } |
113 | 113 | |
114 | - echo '<h4>' . _MD_SELECT_DIRECTORY. '</h4>'; |
|
114 | + echo '<h4>'._MD_SELECT_DIRECTORY.'</h4>'; |
|
115 | 115 | echo '<table width="100%" border="0" cellspacing="1" class="outer">'; |
116 | - echo '<tr><th>' . _MD_OFFER_DIRECTORY . '</th></tr>'; |
|
116 | + echo '<tr><th>'._MD_OFFER_DIRECTORY.'</th></tr>'; |
|
117 | 117 | foreach ($directories as $directory) { |
118 | - echo '<td class="even" valign="top"><a href="'.XOOPS_URL.'/modules/' . $moddir . '/admin/subscriptions.php?dirid='.$directory['dirid'].'">'. $myts->makeTboxData4Show($directory['name']) . '</a></td>'; |
|
118 | + echo '<td class="even" valign="top"><a href="'.XOOPS_URL.'/modules/'.$moddir.'/admin/subscriptions.php?dirid='.$directory['dirid'].'">'.$myts->makeTboxData4Show($directory['name']).'</a></td>'; |
|
119 | 119 | echo '</tr>'; |
120 | 120 | } |
121 | 121 | } else { |
122 | 122 | $itemtypehandler = new efqItemTypeHandler(); |
123 | 123 | $arr_itemtypes = $itemtypehandler->getByDir($gpc_dirid); |
124 | 124 | $obj_directory = $directoryhandler->get($gpc_dirid); |
125 | - echo '<h4>' . sprintf(_MD_SUBSCR_OFFERS, $obj_directory->getVar('name')) . '</h4>'; |
|
125 | + echo '<h4>'.sprintf(_MD_SUBSCR_OFFERS, $obj_directory->getVar('name')).'</h4>'; |
|
126 | 126 | echo '<table width="100%" border="0" cellspacing="1" class="outer">'; |
127 | - echo '<tr><th>' . _MD_OFFER_TITLE . |
|
128 | - '</th><th>' . _MD_OFFER_DURATION . '</th><th>' . _MD_OFFER_COUNT . "</th><th>" . |
|
129 | - _MD_OFFER_PRICE . "</th><th>" . _MD_OFFER_CURRENCY . "</th><th>" . |
|
130 | - _MD_OFFER_ACTIVE . "</th></tr>"; |
|
127 | + echo '<tr><th>'._MD_OFFER_TITLE. |
|
128 | + '</th><th>'._MD_OFFER_DURATION.'</th><th>'._MD_OFFER_COUNT."</th><th>". |
|
129 | + _MD_OFFER_PRICE."</th><th>"._MD_OFFER_CURRENCY."</th><th>". |
|
130 | + _MD_OFFER_ACTIVE."</th></tr>"; |
|
131 | 131 | // For directory, show list of offers |
132 | 132 | $offers = $subscriptionhandler->getOffers($gpc_dirid); |
133 | 133 | $countoffers = count($offers); |
@@ -144,22 +144,22 @@ discard block |
||
144 | 144 | $durationarray = $subscription->durationArray(); |
145 | 145 | //Show offers |
146 | 146 | echo "<tr>"; |
147 | - echo '<td class="even"><a href="subscriptions.php?op=editoffer&offerid=' . $offer['offerid'] . |
|
148 | - '">' . $offertitle . '</a></td>'; |
|
149 | - echo '<td class="odd">' . $durationarray[$offer['duration']] . '</td>'; |
|
150 | - echo '<td class="even">' . $offer['count'] . '</td>'; |
|
151 | - echo '<td class="odd">' . $offer['price'] . '</td>'; |
|
152 | - echo '<td class="even">' . $offer['currency'] . '</td>'; |
|
153 | - echo '<td class="odd">' . $activeyn . '</td>'; |
|
147 | + echo '<td class="even"><a href="subscriptions.php?op=editoffer&offerid='.$offer['offerid']. |
|
148 | + '">'.$offertitle.'</a></td>'; |
|
149 | + echo '<td class="odd">'.$durationarray[$offer['duration']].'</td>'; |
|
150 | + echo '<td class="even">'.$offer['count'].'</td>'; |
|
151 | + echo '<td class="odd">'.$offer['price'].'</td>'; |
|
152 | + echo '<td class="even">'.$offer['currency'].'</td>'; |
|
153 | + echo '<td class="odd">'.$activeyn.'</td>'; |
|
154 | 154 | echo '</tr>'; |
155 | 155 | $i++; |
156 | 156 | } |
157 | 157 | } else { |
158 | - echo '<tr><td colspan="6" class="odd">' . _MD_NORESULTS . '</td></tr>'; |
|
158 | + echo '<tr><td colspan="6" class="odd">'._MD_NORESULTS.'</td></tr>'; |
|
159 | 159 | } |
160 | 160 | echo '</table>'; |
161 | 161 | |
162 | - echo "<h4>" . _MD_ADD_SUBSCR_OFFER . "</h4>"; |
|
162 | + echo "<h4>"._MD_ADD_SUBSCR_OFFER."</h4>"; |
|
163 | 163 | echo '<table width="100%" border="0" cellspacing="1" class="outer"><tr><td>'; |
164 | 164 | $form = new XoopsThemeForm(_MD_ADD_OFFER_FORM, 'newofferform', |
165 | 165 | 'subscriptions.php'); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $form->addElement(new XoopsFormText(_MD_OFFER_TITLE, "title", 50, 100, ""), true); |
168 | 168 | |
169 | 169 | //$itemtypes_arr = $subscriptionhandler->itemTypesArray($gpc_dirid); |
170 | - foreach($arr_itemtypes as $itemtype) { |
|
170 | + foreach ($arr_itemtypes as $itemtype) { |
|
171 | 171 | $itemtypes[] = $itemtype['typename']; |
172 | 172 | } |
173 | 173 | $itemtype_select = new XoopsFormSelect(_MD_SUBSCR_ITEMTYPE, 'typeid'); |
@@ -203,34 +203,34 @@ discard block |
||
203 | 203 | //$arr_itemtypes = $itemtypehandler->getByDir($gpc_dirid); |
204 | 204 | $numrows = count($arr_itemtypes); |
205 | 205 | if ($numrows > 0) { |
206 | - echo '<h4>' . _MD_ITEMTYPES . '</h4>'; |
|
206 | + echo '<h4>'._MD_ITEMTYPES.'</h4>'; |
|
207 | 207 | echo '<table width="100%" border="0" cellspacing="1" class="outer">'; |
208 | - echo '<tr><th>' . _MD_ITEMTYPE_NAME . '</th><th>' . _MD_ITEMTYPE_LEVEL . |
|
209 | - '</th><th>' . _MD_ACTION . '</th></tr>'; |
|
208 | + echo '<tr><th>'._MD_ITEMTYPE_NAME.'</th><th>'._MD_ITEMTYPE_LEVEL. |
|
209 | + '</th><th>'._MD_ACTION.'</th></tr>'; |
|
210 | 210 | $duration_arr = $subscription->durationArray(); |
211 | 211 | foreach ($arr_itemtypes as $itemtype) { |
212 | 212 | $typename = $myts->makeTboxData4Show($itemtype['typename']); |
213 | 213 | $level = $myts->makeTboxData4Show($itemtype['level']); |
214 | 214 | //Show types |
215 | 215 | echo '<tr>'; |
216 | - echo '<td class="even"><a href="subscriptions.php?op=edittype&typeid=' . $itemtype['typeid'] . |
|
217 | - '">' . $itemtype['typename'] . '</strong></td>'; |
|
218 | - echo '<td class="odd">' . $itemtype['level'] . '</td>'; |
|
219 | - echo '<td class="odd"><a href="subscriptions.php?op=deltype&typeid=' . $itemtype['typeid'] . |
|
220 | - '">' . _MD_DELETE . '</strong></td>'; |
|
216 | + echo '<td class="even"><a href="subscriptions.php?op=edittype&typeid='.$itemtype['typeid']. |
|
217 | + '">'.$itemtype['typename'].'</strong></td>'; |
|
218 | + echo '<td class="odd">'.$itemtype['level'].'</td>'; |
|
219 | + echo '<td class="odd"><a href="subscriptions.php?op=deltype&typeid='.$itemtype['typeid']. |
|
220 | + '">'._MD_DELETE.'</strong></td>'; |
|
221 | 221 | echo '</tr>'; |
222 | 222 | } |
223 | 223 | echo '</table>'; |
224 | 224 | } else { |
225 | - echo '<h4>' . _MD_ITEMTYPES . '</h4>'; |
|
225 | + echo '<h4>'._MD_ITEMTYPES.'</h4>'; |
|
226 | 226 | echo '<table width="100%" border="0" cellspacing="1" class="outer">'; |
227 | - echo '<tr><th>' . _MD_ITEMTYPE_NAME . '</th><th>' . _MD_ITEMTYPE_LEVEL . |
|
228 | - '</th><th>' . _MD_ACTION . '</th></tr>'; |
|
227 | + echo '<tr><th>'._MD_ITEMTYPE_NAME.'</th><th>'._MD_ITEMTYPE_LEVEL. |
|
228 | + '</th><th>'._MD_ACTION.'</th></tr>'; |
|
229 | 229 | echo '<tr>'; |
230 | 230 | echo '<td colspan="3" class="even">'._MD_NORESULTS.'</td>'; |
231 | 231 | echo '</tr></table>'; |
232 | 232 | } |
233 | - echo '<h4>' . _MD_ADD_ITEMTYPE . '</h4>'; |
|
233 | + echo '<h4>'._MD_ADD_ITEMTYPE.'</h4>'; |
|
234 | 234 | |
235 | 235 | //Add item type form |
236 | 236 | echo '<table width="100%" border="0" cellspacing="1" class="outer"><tr><td>'; |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | //$directoryhandler = new efqDirectoryHandler(); |
263 | 263 | //$directories = $directoryhandler->getAll(); |
264 | 264 | if ($gpc_typeid == 0) { |
265 | - redirect_header(XOOPS_URL . '/modules/' . $moddir . '/admin/subscriptions.php', |
|
265 | + redirect_header(XOOPS_URL.'/modules/'.$moddir.'/admin/subscriptions.php', |
|
266 | 266 | 2, _MD_INVALID_TYPEID); |
267 | 267 | exit(); |
268 | 268 | } |
@@ -270,8 +270,8 @@ discard block |
||
270 | 270 | adminmenu(4, _MD_MANAGE_SUBSCRIPTION_OFFERS); |
271 | 271 | echo "<br />"; |
272 | 272 | |
273 | - $sql = 'SELECT typeid, typename, level, dirid FROM ' . $xoopsDB->prefix("efqdiralpha1_itemtypes") . |
|
274 | - ' WHERE typeid=' . intval($gpc_typeid); |
|
273 | + $sql = 'SELECT typeid, typename, level, dirid FROM '.$xoopsDB->prefix("efqdiralpha1_itemtypes"). |
|
274 | + ' WHERE typeid='.intval($gpc_typeid); |
|
275 | 275 | $result = $xoopsDB->query($sql) or $eh->show("0013"); |
276 | 276 | $numrows = $xoopsDB->getRowsNum($result); |
277 | 277 | if ($numrows > 0) { |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | echo "</td></tr></table>"; |
292 | 292 | } |
293 | 293 | } else { |
294 | - redirect_header(XOOPS_URL . '/modules/$moddir/admin/subscriptions.php', 2, |
|
294 | + redirect_header(XOOPS_URL.'/modules/$moddir/admin/subscriptions.php', 2, |
|
295 | 295 | _MD_INVALID_TYPEID); |
296 | 296 | exit(); |
297 | 297 | } |
@@ -307,13 +307,13 @@ discard block |
||
307 | 307 | { |
308 | 308 | global $xoopsDB, $eh, $xoopsUser, $itemtypes; |
309 | 309 | if ($gpc_offerid == 0) { |
310 | - redirect_header(XOOPS_URL . '/modules/' . EFQ_MODDIR . |
|
310 | + redirect_header(XOOPS_URL.'/modules/'.EFQ_MODDIR. |
|
311 | 311 | '/admin/subscriptions.php', 2, _MD_INVALID_OFFERID); |
312 | 312 | } |
313 | 313 | $obj_subscr = new efqSubscription(); |
314 | 314 | $subscr_offer_handler = new efqSubscriptionOfferHandler(); |
315 | 315 | $subscr_handler = new efqSubscriptionHandler(); |
316 | - if($subscr_offer_handler->setOffer($gpc_offerid)) { |
|
316 | + if ($subscr_offer_handler->setOffer($gpc_offerid)) { |
|
317 | 317 | $subcr_offer_set = true; |
318 | 318 | } else { |
319 | 319 | $subcr_offer_set = false; |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | $form->display(); |
361 | 361 | echo '</td></tr></table>'; |
362 | 362 | } else { |
363 | - redirect_header(XOOPS_URL . '/modules/' . EFQ_MODDIR . |
|
363 | + redirect_header(XOOPS_URL.'/modules/'.EFQ_MODDIR. |
|
364 | 364 | '/admin/subscriptions.php', 2, _MD_INVALID_OFFERID); |
365 | 365 | } |
366 | 366 | xoops_cp_footer(); |
@@ -413,11 +413,11 @@ discard block |
||
413 | 413 | if ($obj_offer->isNew()) { |
414 | 414 | $offerhandler->insertOffer($obj_offer); |
415 | 415 | } else { |
416 | - $offerhandler->updateOffer($obj_offer,true); |
|
416 | + $offerhandler->updateOffer($obj_offer, true); |
|
417 | 417 | } |
418 | 418 | |
419 | - redirect_header(XOOPS_URL . '/modules/' . $moddir . |
|
420 | - '/admin/subscriptions.php?offerid=' . $obj_offer->getVar('offerid'), 2, |
|
419 | + redirect_header(XOOPS_URL.'/modules/'.$moddir. |
|
420 | + '/admin/subscriptions.php?offerid='.$obj_offer->getVar('offerid'), 2, |
|
421 | 421 | _MD_SAVED); |
422 | 422 | exit(); |
423 | 423 | } |
@@ -436,13 +436,13 @@ discard block |
||
436 | 436 | if (isset($_GET['typeid'])) { |
437 | 437 | $g_typeid = intval($_GET['typeid']); |
438 | 438 | } else { |
439 | - redirect_header(XOOPS_URL . '/modules/' . $moddir . '/admin/subscriptions.php', |
|
439 | + redirect_header(XOOPS_URL.'/modules/'.$moddir.'/admin/subscriptions.php', |
|
440 | 440 | 2, _MD_ERR_ITEMTYPE_DELETE); |
441 | 441 | exit(); |
442 | 442 | } |
443 | 443 | |
444 | 444 | if ($subscriptionhandler->countSubscriptionsForType($g_typeid) > 0) { |
445 | - redirect_header(XOOPS_URL . '/modules/' . EFQ_MODDIR . |
|
445 | + redirect_header(XOOPS_URL.'/modules/'.EFQ_MODDIR. |
|
446 | 446 | '/admin/subscriptions.php', 3, _MD_ERR_ITEMTYPE_LINKED_TO_LISTINGS); |
447 | 447 | exit(); |
448 | 448 | } |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | $obj_itemtype = $itemtypehandler->getObjItemType(); |
452 | 452 | //$obj_itemtype->setVar('typeid', $g_typeid); |
453 | 453 | $itemtypehandler->delete($obj_itemtype, true); |
454 | - redirect_header(XOOPS_URL . '/modules/' . EFQ_MODDIR . |
|
454 | + redirect_header(XOOPS_URL.'/modules/'.EFQ_MODDIR. |
|
455 | 455 | '/admin/subscriptions.php?dirid='.$obj_itemtype->getVar('dirid'), 1, _MD_ITEMTYPE_DELETED); |
456 | 456 | exit(); |
457 | 457 | } |
@@ -481,15 +481,15 @@ discard block |
||
481 | 481 | $obj_itemtype->setVar('level', $p_level); |
482 | 482 | if ($new) { |
483 | 483 | if ($itemtypehandler->insert($obj_itemtype)) { |
484 | - redirect_header(XOOPS_URL . '/modules/' . $moddir . |
|
485 | - '/admin/subscriptions.php?dirid=' . $obj_itemtype->getVar('dirid'), 2, _MD_SAVED); |
|
484 | + redirect_header(XOOPS_URL.'/modules/'.$moddir. |
|
485 | + '/admin/subscriptions.php?dirid='.$obj_itemtype->getVar('dirid'), 2, _MD_SAVED); |
|
486 | 486 | } else { |
487 | 487 | echo $obj_itemtype->getErrors(); |
488 | 488 | } |
489 | 489 | } else { |
490 | 490 | if ($itemtypehandler->update($obj_itemtype)) { |
491 | - redirect_header(XOOPS_URL . '/modules/' . $moddir . |
|
492 | - '/admin/subscriptions.php?dirid=' . $obj_itemtype->getVar('dirid'), 2, _MD_SAVED); |
|
491 | + redirect_header(XOOPS_URL.'/modules/'.$moddir. |
|
492 | + '/admin/subscriptions.php?dirid='.$obj_itemtype->getVar('dirid'), 2, _MD_SAVED); |
|
493 | 493 | } else { |
494 | 494 | echo $obj_itemtype->getErrors(); |
495 | 495 | } |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | $moddir = $xoopsModule->getvar("dirname"); |
51 | 51 | |
52 | 52 | if (isset($_GET['dirid'])) { |
53 | - $get_dirid = intval($_GET['dirid']); |
|
53 | + $get_dirid = intval($_GET['dirid']); |
|
54 | 54 | } else { |
55 | 55 | $get_dirid = "0"; |
56 | 56 | } |
57 | 57 | if (isset($_GET['typeid'])) { |
58 | - $get_typeid = intval($_GET['typeid']); |
|
58 | + $get_typeid = intval($_GET['typeid']); |
|
59 | 59 | } |
60 | 60 | $datatypes = array('0' => '---', |
61 | 61 | 'textbox' => _MD_FIELDNAMES_TEXTBOX, |
@@ -113,16 +113,16 @@ discard block |
||
113 | 113 | if ($fieldtypes) { |
114 | 114 | $numrows = count($fieldtypes); |
115 | 115 | echo "<tr><th>"._MD_TITLE."</th><th>"._MD_TYPE."</th><th>"._MD_EXT."</th><th>"._MD_ACTIVE."</th></tr>\n"; |
116 | - if ( $numrows > 0 ) { |
|
116 | + if ( $numrows > 0 ) { |
|
117 | 117 | foreach($fieldtypes as $fieldtype) { |
118 | - if ($fieldtype['activeyn'] != '0') { |
|
118 | + if ($fieldtype['activeyn'] != '0') { |
|
119 | 119 | $statusyn = ""._MD_YES.""; |
120 | 120 | } else { |
121 | 121 | $statusyn = ""._MD_NO.""; |
122 | 122 | } |
123 | 123 | echo "<tr><td class=\"even\" valign=\"top\"><a href=\"".XOOPS_URL."/modules/".$moddir."/admin/fieldtypes.php?op=view&typeid=".$fieldtype['typeid']."\">".$fieldtype['title']."</a></td><td class=\"even\" valign=\"top\">".$fieldtype['fieldtype']."</td><td class=\"even\" valign=\"top\">".$fieldtype['ext']."</td><td class=\"even\" valign=\"top\">".$statusyn."</td>"; |
124 | 124 | echo "</td></tr>\n"; |
125 | - } |
|
125 | + } |
|
126 | 126 | } else { |
127 | 127 | echo "<tr><td>"._MD_NORESULTS."</td></tr>"; |
128 | 128 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td>"; |
189 | 189 | $result = $xoopsDB->query("SELECT typeid, dirid, title, fieldtype, descr, ext, activeyn FROM ".$xoopsDB->prefix("efqdiralpha1_fieldtypes")." WHERE typeid='".$get_typeid."'") or $eh->show("0013"); |
190 | 190 | $numrows = $xoopsDB->getRowsNum($result); |
191 | - if ( $numrows > 0 ) { |
|
191 | + if ( $numrows > 0 ) { |
|
192 | 192 | while(list($typeid, $dirid, $title, $fieldtype, $descr, $ext, $activeyn) = $xoopsDB->fetchRow($result)) { |
193 | 193 | $form = new XoopsThemeForm(_MD_EDITFTYPEFORM, 'submitform', 'fieldtypes.php'); |
194 | 194 | $form->addElement(new XoopsFormText(_MD_TITLE, "title", 100, 150, "$title"), true); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | function addFieldtype() |
244 | 244 | { |
245 | 245 | global $xoopsDB, $_POST, $myts, $eh; |
246 | - $p_title = $myts->makeTboxData4Save($_POST["title"]); |
|
246 | + $p_title = $myts->makeTboxData4Save($_POST["title"]); |
|
247 | 247 | $p_fieldtype = $_POST["field_type"]; |
248 | 248 | $p_descr = $myts->makeTareaData4Save($_POST["descr"]); |
249 | 249 | if (isset($_POST["ext"])) { |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | } else { |
304 | 304 | exit(); |
305 | 305 | } |
306 | - $p_title = $myts->makeTboxData4Save($_POST["title"]); |
|
306 | + $p_title = $myts->makeTboxData4Save($_POST["title"]); |
|
307 | 307 | $p_active = intval($_POST["active"]); |
308 | 308 | $p_pid = intval($_POST["pid"]); |
309 | 309 | $p_allowlist = intval($_POST["allowlist"]); |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $mainresult = $xoopsDB->query("SELECT cid, title, active, pid FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE dirid='".$get_dirid."' AND pid='0'"); |
355 | 355 | $numrows = $xoopsDB->getRowsNum($mainresult); |
356 | 356 | $output= ""; |
357 | - if ( $numrows > 0 ) { |
|
357 | + if ( $numrows > 0 ) { |
|
358 | 358 | $output = "<th>"._MD_CATTITLE."</th><th>"._MD_ACTIVEYN."</th><th>"._MD_PARENTCAT."</th>\n"; |
359 | 359 | $brench = 0; |
360 | 360 | $tab = ""; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | // Based upon the mylinks and the mxDirectory modules // |
31 | 31 | // ------------------------------------------------------------------------- // |
32 | 32 | include '../../../include/cp_header.php'; |
33 | -if ( file_exists("../language/".$xoopsConfig['language']."/main.php") ) { |
|
33 | +if (file_exists("../language/".$xoopsConfig['language']."/main.php")) { |
|
34 | 34 | include "../language/".$xoopsConfig['language']."/main.php"; |
35 | 35 | } else { |
36 | 36 | include "../language/english/main.php"; |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | include_once XOOPS_ROOT_PATH.'/class/module.errorhandler.php'; |
43 | 43 | include_once '../class/class.fieldtype.php'; |
44 | 44 | include_once '../class/class.directory.php'; |
45 | -$myts =& MyTextSanitizer::getInstance(); |
|
45 | +$myts = & MyTextSanitizer::getInstance(); |
|
46 | 46 | $eh = new ErrorHandler; |
47 | -$mytree = new XoopsTree($xoopsDB->prefix("efqdiralpha1_cat"),"cid","pid"); |
|
48 | -$mytree2 = new XoopsTree($xoopsDB->prefix("efqdiralpha1_fieldtypes"),"typeid",0); |
|
47 | +$mytree = new XoopsTree($xoopsDB->prefix("efqdiralpha1_cat"), "cid", "pid"); |
|
48 | +$mytree2 = new XoopsTree($xoopsDB->prefix("efqdiralpha1_fieldtypes"), "typeid", 0); |
|
49 | 49 | |
50 | 50 | $moddir = $xoopsModule->getvar("dirname"); |
51 | 51 | |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | |
79 | 79 | function fieldtypesConfig() |
80 | 80 | { |
81 | - global $xoopsDB, $xoopsModule, $xoopsUser, $get_dirid, $moddir, $myts, $eh, $datatypes,$mytree2; |
|
81 | + global $xoopsDB, $xoopsModule, $xoopsUser, $get_dirid, $moddir, $myts, $eh, $datatypes, $mytree2; |
|
82 | 82 | xoops_cp_header(); |
83 | - adminmenu(3,_MD_A_FTYPESADMIN); |
|
83 | + adminmenu(3, _MD_A_FTYPESADMIN); |
|
84 | 84 | |
85 | 85 | if ($get_dirid == "0") { |
86 | 86 | $countopendirs = countOpenDirectories(); |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | if ($fieldtypes) { |
114 | 114 | $numrows = count($fieldtypes); |
115 | 115 | echo "<tr><th>"._MD_TITLE."</th><th>"._MD_TYPE."</th><th>"._MD_EXT."</th><th>"._MD_ACTIVE."</th></tr>\n"; |
116 | - if ( $numrows > 0 ) { |
|
117 | - foreach($fieldtypes as $fieldtype) { |
|
116 | + if ($numrows > 0) { |
|
117 | + foreach ($fieldtypes as $fieldtype) { |
|
118 | 118 | if ($fieldtype['activeyn'] != '0') { |
119 | 119 | $statusyn = ""._MD_YES.""; |
120 | 120 | } else { |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $ext_text = new XoopsFormText("", "ext", 80, 150, ""); |
146 | 146 | $ext_text->setExtra('disabled=true'); |
147 | 147 | $ext_text->setExtra('style=\'background-color:lightgrey\''); |
148 | - $ext_button = new XoopsFormLabel("","<INPUT type=\"button\" value=\""._MD_SET_EXT."\", onClick=\"openExtManager('submitform','".XOOPS_URL."/modules/".$moddir."/admin/extensionmanager.php','field_type', '"._MD_SELECT_FORMTYPE."')\">"); |
|
148 | + $ext_button = new XoopsFormLabel("", "<INPUT type=\"button\" value=\""._MD_SET_EXT."\", onClick=\"openExtManager('submitform','".XOOPS_URL."/modules/".$moddir."/admin/extensionmanager.php','field_type', '"._MD_SELECT_FORMTYPE."')\">"); |
|
149 | 149 | $ext_tray->addElement($ext_text); |
150 | 150 | $ext_tray->addElement($ext_button); |
151 | 151 | $form->addElement($ext_tray); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } else { |
172 | 172 | window.open([url],'ext_window','width=600,height=450'); |
173 | 173 | }\n"; |
174 | - $js .="}\n"; |
|
174 | + $js .= "}\n"; |
|
175 | 175 | $js .= "//--></script>\n<!-- End Extension Manager JavaScript //-->\n"; |
176 | 176 | echo $js; |
177 | 177 | |
@@ -183,13 +183,13 @@ discard block |
||
183 | 183 | { |
184 | 184 | global $xoopsDB, $mytree, $mytree2, $xoopsUser, $get_typeid, $moddir, $eh, $datatypes; |
185 | 185 | xoops_cp_header(); |
186 | - adminmenu(3,_MD_A_FTYPESADMIN); |
|
186 | + adminmenu(3, _MD_A_FTYPESADMIN); |
|
187 | 187 | echo "<h4>"._MD_VIEW_FIELDTYPE."</h4>"; |
188 | 188 | echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td>"; |
189 | 189 | $result = $xoopsDB->query("SELECT typeid, dirid, title, fieldtype, descr, ext, activeyn FROM ".$xoopsDB->prefix("efqdiralpha1_fieldtypes")." WHERE typeid='".$get_typeid."'") or $eh->show("0013"); |
190 | 190 | $numrows = $xoopsDB->getRowsNum($result); |
191 | - if ( $numrows > 0 ) { |
|
192 | - while(list($typeid, $dirid, $title, $fieldtype, $descr, $ext, $activeyn) = $xoopsDB->fetchRow($result)) { |
|
191 | + if ($numrows > 0) { |
|
192 | + while (list($typeid, $dirid, $title, $fieldtype, $descr, $ext, $activeyn) = $xoopsDB->fetchRow($result)) { |
|
193 | 193 | $form = new XoopsThemeForm(_MD_EDITFTYPEFORM, 'submitform', 'fieldtypes.php'); |
194 | 194 | $form->addElement(new XoopsFormText(_MD_TITLE, "title", 100, 150, "$title"), true); |
195 | 195 | //TO DO: change type field to drop down field, based on available types. |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $ext_tray = new XoopsFormElementTray(_MD_EXT, ""); |
202 | 202 | $ext_text = new XoopsFormText("", "ext", 80, 150, "$ext"); |
203 | 203 | $ext_text->setExtra('style=\'background-color:lightgrey\''); |
204 | - $ext_button = new XoopsFormLabel("","<INPUT type=\"button\" value=\""._MD_SET_EXT."\", onClick=\"openExtManager('submitform','".XOOPS_URL."/modules/".$moddir."/admin/extensionmanager.php','field_type', '"._MD_SELECT_FORMTYPE."')\">"); |
|
204 | + $ext_button = new XoopsFormLabel("", "<INPUT type=\"button\" value=\""._MD_SET_EXT."\", onClick=\"openExtManager('submitform','".XOOPS_URL."/modules/".$moddir."/admin/extensionmanager.php','field_type', '"._MD_SELECT_FORMTYPE."')\">"); |
|
205 | 205 | $ext_tray->addElement($ext_text); |
206 | 206 | $ext_tray->addElement($ext_button); |
207 | 207 | $form->addElement($ext_tray); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | } else { |
231 | 231 | window.open([url],'ext_window','width=600,height=450'); |
232 | 232 | }\n"; |
233 | - $js .="}\n"; |
|
233 | + $js .= "}\n"; |
|
234 | 234 | $js .= "//--></script>\n<!-- End Extension Manager JavaScript //-->\n"; |
235 | 235 | echo $js; |
236 | 236 | } |
@@ -264,14 +264,14 @@ discard block |
||
264 | 264 | $newid = $xoopsDB->genId($xoopsDB->prefix("efqdiralpha1_fieldtypes")."_typeid_seq"); |
265 | 265 | $sql = sprintf("INSERT INTO %s (typeid, dirid, title, fieldtype, descr, ext, activeyn) VALUES (%u, '%s', '%s', '%s', '%s', '%s', '%s')", $xoopsDB->prefix("efqdiralpha1_fieldtypes"), $newid, $p_dirid, $p_title, $p_fieldtype, $p_descr, $p_ext, $p_status); |
266 | 266 | $xoopsDB->query($sql) or $eh->show("0013"); |
267 | - redirect_header("fieldtypes.php?dirid=$p_dirid",2,_MD_SAVED); |
|
267 | + redirect_header("fieldtypes.php?dirid=$p_dirid", 2, _MD_SAVED); |
|
268 | 268 | exit(); |
269 | 269 | } |
270 | 270 | |
271 | 271 | function editFieldtype() |
272 | 272 | { |
273 | 273 | global $xoopsDB, $_POST, $myts, $eh; |
274 | - if (isset ($_POST["typeid"]) ) { |
|
274 | + if (isset ($_POST["typeid"])) { |
|
275 | 275 | $p_typeid = intval($_POST["typeid"]); |
276 | 276 | } else { |
277 | 277 | exit(); |
@@ -291,14 +291,14 @@ discard block |
||
291 | 291 | } |
292 | 292 | $sql = "UPDATE ".$xoopsDB->prefix("efqdiralpha1_fieldtypes")." SET title = '$p_title', fieldtype='$p_fieldtype', ext='$p_ext', activeyn='$p_status' WHERE typeid = $p_typeid"; |
293 | 293 | $xoopsDB->query($sql) or $eh->show("0013"); |
294 | - redirect_header("fieldtypes.php?op=view&typeid=$p_typeid",2,_MD_SAVED); |
|
294 | + redirect_header("fieldtypes.php?op=view&typeid=$p_typeid", 2, _MD_SAVED); |
|
295 | 295 | exit(); |
296 | 296 | } |
297 | 297 | |
298 | 298 | function newCat() |
299 | 299 | { |
300 | 300 | global $xoopsDB, $myts, $eh; |
301 | - if (isset ($_POST["dirid"]) ) { |
|
301 | + if (isset ($_POST["dirid"])) { |
|
302 | 302 | $p_dirid = intval($_POST["dirid"]); |
303 | 303 | } else { |
304 | 304 | exit(); |
@@ -308,13 +308,13 @@ discard block |
||
308 | 308 | $p_pid = intval($_POST["pid"]); |
309 | 309 | $p_allowlist = intval($_POST["allowlist"]); |
310 | 310 | $p_showpopular = intval($_POST["showpopular"]); |
311 | - if (isset ($_POST["descr"]) ) { |
|
311 | + if (isset ($_POST["descr"])) { |
|
312 | 312 | $p_descr = $myts->makeTareaData4Save($_POST["descr"]); |
313 | 313 | } else { |
314 | 314 | $p_descr = ""; |
315 | 315 | } |
316 | 316 | $newid = $xoopsDB->genId($xoopsDB->prefix("efqdiralpha1_cat")."_cid_seq"); |
317 | - $sql = sprintf("INSERT INTO %s (cid, dirid, title, active, pid) VALUES (%u, %u, '%s', %u, %u)", $xoopsDB->prefix("efqdiralpha1_cat") , $newid, $p_dirid, $p_title, $p_active, $p_pid); |
|
317 | + $sql = sprintf("INSERT INTO %s (cid, dirid, title, active, pid) VALUES (%u, %u, '%s', %u, %u)", $xoopsDB->prefix("efqdiralpha1_cat"), $newid, $p_dirid, $p_title, $p_active, $p_pid); |
|
318 | 318 | //echo $sql; |
319 | 319 | $xoopsDB->query($sql) or $eh->show("0013"); |
320 | 320 | if ($newid == 0) { |
@@ -324,11 +324,11 @@ discard block |
||
324 | 324 | $sql2 = sprintf("INSERT INTO %s (txtid, cid, text, active, created) VALUES (%u, %u, '%s', %u, '%s')", $xoopsDB->prefix("efqdiralpha1_cat_txt"), $newid, $cid, $p_descr, '1', time()); |
325 | 325 | //echo $sql2; |
326 | 326 | $xoopsDB->query($sql2) or $eh->show("0013"); |
327 | - redirect_header("categories.php?op=edit&cid=$newid",0,_MD_CAT_UPDATED); |
|
327 | + redirect_header("categories.php?op=edit&cid=$newid", 0, _MD_CAT_UPDATED); |
|
328 | 328 | exit(); |
329 | 329 | } |
330 | 330 | |
331 | -if(!isset($_POST['op'])) { |
|
331 | +if (!isset($_POST['op'])) { |
|
332 | 332 | $op = isset($_GET['op']) ? $_GET['op'] : 'main'; |
333 | 333 | } else { |
334 | 334 | $op = $_POST['op']; |
@@ -353,12 +353,12 @@ discard block |
||
353 | 353 | global $xoopsDB, $myts, $eh, $mytree, $get_dirid, $moddir; |
354 | 354 | $mainresult = $xoopsDB->query("SELECT cid, title, active, pid FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE dirid='".$get_dirid."' AND pid='0'"); |
355 | 355 | $numrows = $xoopsDB->getRowsNum($mainresult); |
356 | - $output= ""; |
|
357 | - if ( $numrows > 0 ) { |
|
356 | + $output = ""; |
|
357 | + if ($numrows > 0) { |
|
358 | 358 | $output = "<th>"._MD_CATTITLE."</th><th>"._MD_ACTIVEYN."</th><th>"._MD_PARENTCAT."</th>\n"; |
359 | 359 | $brench = 0; |
360 | 360 | $tab = ""; |
361 | - while(list($cid, $title, $activeyn, $pid) = $xoopsDB->fetchRow($mainresult)) { |
|
361 | + while (list($cid, $title, $activeyn, $pid) = $xoopsDB->fetchRow($mainresult)) { |
|
362 | 362 | $output .= "<tr><td>".$tab."<a href=\"".XOOPS_URL."/modules/$moddir/admin/categories.php?op=edit&cid=$cid\">".$title."</a></td><td>".$activeyn."</td></tr>\n"; |
363 | 363 | $output .= getChildrenCategories($cid); |
364 | 364 | } |
@@ -368,14 +368,14 @@ discard block |
||
368 | 368 | return $output; |
369 | 369 | } |
370 | 370 | |
371 | -function getChildrenCategories($childid="0", $level="1") |
|
371 | +function getChildrenCategories($childid = "0", $level = "1") |
|
372 | 372 | { |
373 | 373 | global $xoopsDB, $myts, $eh, $mytree; |
374 | 374 | $firstchildcats = $mytree->getFirstChildId($childid); |
375 | 375 | $tab = ""; |
376 | 376 | $output = ""; |
377 | 377 | $plus = "<img src=\"".XOOPS_URL."\images\arrow.jpg\">"; |
378 | - for ($i=0; $i <$level; $i++) |
|
378 | + for ($i = 0; $i < $level; $i++) |
|
379 | 379 | { |
380 | 380 | $tab .= " "; |
381 | 381 | } |
@@ -383,8 +383,8 @@ discard block |
||
383 | 383 | $childresult = $xoopsDB->query("SELECT cid, title, active, pid FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE pid='".$childid."'"); |
384 | 384 | //$childresult = $xoopsDB->query("SELECT cid, title, active, pid FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE dirid='".$dirid."' AND pid='".$childid."'"); |
385 | 385 | $numrows = $xoopsDB->getRowsNum($childresult); |
386 | - if ( $numrows > 0 ) { |
|
387 | - while(list($cid, $title, $activeyn, $pid) = $xoopsDB->fetchRow($childresult)) { |
|
386 | + if ($numrows > 0) { |
|
387 | + while (list($cid, $title, $activeyn, $pid) = $xoopsDB->fetchRow($childresult)) { |
|
388 | 388 | $output .= "<tr><td>".$tab."".$plus."</td><td>".$title."</td><td>".$activeyn."</td></tr>\n"; |
389 | 389 | $newlevel = $level++; |
390 | 390 | $output .= getChildrenCategories($cid, $newlevel); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $moddir = $xoopsModule->getvar("dirname"); |
49 | 49 | |
50 | 50 | if (isset($_GET['dirid'])) { |
51 | - $get_dir = intval($_GET['dirid']); |
|
51 | + $get_dir = intval($_GET['dirid']); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | function dirConfig() |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | //Get a list of directories and their properties (included number of categories and items?) |
61 | 61 | $result = $xoopsDB->query("SELECT dirid, postfix, open, name FROM ".$xoopsDB->prefix("efqdiralpha1_dir").""); |
62 | 62 | $numrows = $xoopsDB->getRowsNum($result); |
63 | - if ( $numrows > 0 ) { |
|
63 | + if ( $numrows > 0 ) { |
|
64 | 64 | echo '<form action="directories.php?&op=changestatus" method="post" name="select_directories_form">'; |
65 | 65 | echo "<table width='100%' border='0' cellspacing='1' class='outer'>"; |
66 | 66 | echo "<tr><th> </th><th>"._MD_DIRNAME."</th><th>"._MD_STATUS."</th><th>"._MD_TOTALCATS."</th><th>"._MD_ACTION."</th></tr>\n"; |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td>"; |
116 | 116 | $result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("efqdiralpha1_dir")." WHERE dirid='".$dirid."'"); |
117 | 117 | $numrows = $xoopsDB->getRowsNum($result); |
118 | - if ( $numrows > 0 ) { |
|
118 | + if ( $numrows > 0 ) { |
|
119 | 119 | while(list($dirid, $postfix, $open, $dirname, $descr, $pic) = $xoopsDB->fetchRow($result)) { |
120 | 120 | if ($pic != "") { |
121 | 121 | $picture = XOOPS_URL."/modules/$moddir/uploads/$pic"; |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | echo "no dirid"; |
154 | 154 | exit(); |
155 | 155 | } |
156 | - $p_dirname = $myts->makeTBoxData4Save($_POST["dirname"]); |
|
156 | + $p_dirname = $myts->makeTBoxData4Save($_POST["dirname"]); |
|
157 | 157 | if (isset($_POST["open"])) { |
158 | 158 | $p_open = $_POST["open"]; |
159 | 159 | } else { |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | function newDir() |
232 | 232 | { |
233 | 233 | global $xoopsDB, $_POST, $myts, $eh; |
234 | - if (isset($_POST["postfix"])) { |
|
234 | + if (isset($_POST["postfix"])) { |
|
235 | 235 | $p_postfix = $_POST["postfix"]; |
236 | 236 | } else { |
237 | 237 | $p_postfix = ""; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | // Based upon the mylinks and the mxDirectory modules // |
31 | 31 | // ------------------------------------------------------------------------- // |
32 | 32 | include '../../../include/cp_header.php'; |
33 | -if ( file_exists("../language/".$xoopsConfig['language']."/main.php") ) { |
|
33 | +if (file_exists("../language/".$xoopsConfig['language']."/main.php")) { |
|
34 | 34 | include "../language/".$xoopsConfig['language']."/main.php"; |
35 | 35 | } else { |
36 | 36 | include "../language/english/main.php"; |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
42 | 42 | include_once "../class/class.formimage.php"; |
43 | 43 | include_once XOOPS_ROOT_PATH.'/class/module.errorhandler.php'; |
44 | -$myts =& MyTextSanitizer::getInstance(); |
|
44 | +$myts = & MyTextSanitizer::getInstance(); |
|
45 | 45 | $eh = new ErrorHandler; |
46 | -$mytree = new XoopsTree($xoopsDB->prefix("efqdiralpha1_cat"),"cid","pid"); |
|
46 | +$mytree = new XoopsTree($xoopsDB->prefix("efqdiralpha1_cat"), "cid", "pid"); |
|
47 | 47 | |
48 | 48 | $moddir = $xoopsModule->getvar("dirname"); |
49 | 49 | |
@@ -55,16 +55,16 @@ discard block |
||
55 | 55 | { |
56 | 56 | global $xoopsDB, $xoopsModule, $xoopsUser, $myts, $moddir; |
57 | 57 | xoops_cp_header(); |
58 | - adminmenu(1,_MD_A_DIRADMIN); |
|
58 | + adminmenu(1, _MD_A_DIRADMIN); |
|
59 | 59 | echo "<h4>"._MD_DIRCONF."</h4>"; |
60 | 60 | //Get a list of directories and their properties (included number of categories and items?) |
61 | 61 | $result = $xoopsDB->query("SELECT dirid, postfix, open, name FROM ".$xoopsDB->prefix("efqdiralpha1_dir").""); |
62 | 62 | $numrows = $xoopsDB->getRowsNum($result); |
63 | - if ( $numrows > 0 ) { |
|
63 | + if ($numrows > 0) { |
|
64 | 64 | echo '<form action="directories.php?&op=changestatus" method="post" name="select_directories_form">'; |
65 | 65 | echo "<table width='100%' border='0' cellspacing='1' class='outer'>"; |
66 | 66 | echo "<tr><th> </th><th>"._MD_DIRNAME."</th><th>"._MD_STATUS."</th><th>"._MD_TOTALCATS."</th><th>"._MD_ACTION."</th></tr>\n"; |
67 | - while(list($dirid, $postfix, $open, $name) = $xoopsDB->fetchRow($result)) { |
|
67 | + while (list($dirid, $postfix, $open, $name) = $xoopsDB->fetchRow($result)) { |
|
68 | 68 | $sql = "SELECT COUNT(*) FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE dirid='".$dirid."'"; |
69 | 69 | $result_countcats = $xoopsDB->query($sql); |
70 | 70 | $numrows = $xoopsDB->getRowsNum($result_countcats); |
@@ -110,13 +110,13 @@ discard block |
||
110 | 110 | { |
111 | 111 | global $xoopsDB, $myts, $xoopsUser, $moddir, $xoopsModuleConfig; |
112 | 112 | xoops_cp_header(); |
113 | - adminmenu(1,_MD_A_DIRADMIN); |
|
113 | + adminmenu(1, _MD_A_DIRADMIN); |
|
114 | 114 | echo "<h4>"._MD_EDITDIR."</h4>"; |
115 | 115 | echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td>"; |
116 | 116 | $result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("efqdiralpha1_dir")." WHERE dirid='".$dirid."'"); |
117 | 117 | $numrows = $xoopsDB->getRowsNum($result); |
118 | - if ( $numrows > 0 ) { |
|
119 | - while(list($dirid, $postfix, $open, $dirname, $descr, $pic) = $xoopsDB->fetchRow($result)) { |
|
118 | + if ($numrows > 0) { |
|
119 | + while (list($dirid, $postfix, $open, $dirname, $descr, $pic) = $xoopsDB->fetchRow($result)) { |
|
120 | 120 | if ($pic != "") { |
121 | 121 | $picture = XOOPS_URL."/modules/$moddir/uploads/$pic"; |
122 | 122 | } else { |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $form->display(); |
140 | 140 | } |
141 | 141 | } |
142 | - echo myTextForm("".XOOPS_URL."/modules/$moddir/admin/directories.php",_MD_CANCEL); |
|
142 | + echo myTextForm("".XOOPS_URL."/modules/$moddir/admin/directories.php", _MD_CANCEL); |
|
143 | 143 | echo "</td></tr></table>"; |
144 | 144 | xoops_cp_footer(); |
145 | 145 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | function updateDir() |
148 | 148 | { |
149 | 149 | global $xoopsDB, $_POST, $myts, $eh, $moddir, $xoopsModuleConfig; |
150 | - if (isset ($_POST["dirid"]) ) { |
|
150 | + if (isset ($_POST["dirid"])) { |
|
151 | 151 | $p_dirid = intval($_POST['dirid']); |
152 | 152 | } else { |
153 | 153 | echo "no dirid"; |
@@ -159,12 +159,12 @@ discard block |
||
159 | 159 | } else { |
160 | 160 | $p_open = '0'; |
161 | 161 | } |
162 | - if (isset ($_POST["descr"]) ) { |
|
162 | + if (isset ($_POST["descr"])) { |
|
163 | 163 | $p_descr = $myts->makeTareaData4Save($_POST["descr"]); |
164 | 164 | } else { |
165 | 165 | $p_descr = ""; |
166 | 166 | } |
167 | - if ( $_POST['xoops_upload_file'][0] != "" ) { |
|
167 | + if ($_POST['xoops_upload_file'][0] != "") { |
|
168 | 168 | include_once '../class/class.uploader.php'; |
169 | 169 | //include_once XOOPS_ROOT_PATH.'/class/class.uploader.php'; |
170 | 170 | $uploader = new XoopsMediaUploader(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/init_uploads', array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png', 'image/jpg'), $xoopsModuleConfig['dirimagemaxsize'], $xoopsModuleConfig['dirimagemaxwidth'], $xoopsModuleConfig['dirimagemaxheight']); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | } else { |
174 | 174 | $sql = "UPDATE ".$xoopsDB->prefix("efqdiralpha1_dir")." SET descr = '".$p_descr."', open='".$p_open."', name='".$p_dirname."' WHERE dirid = '".$p_dirid."'"; |
175 | 175 | $xoopsDB->query($sql) or $eh->show("0013"); |
176 | - redirect_header("directories.php?dirid=$p_dirid",2,_MD_DIR_UPDATED); |
|
176 | + redirect_header("directories.php?dirid=$p_dirid", 2, _MD_DIR_UPDATED); |
|
177 | 177 | exit(); |
178 | 178 | } |
179 | 179 | $uploader->setPrefix('efqdir'); |
@@ -186,23 +186,23 @@ discard block |
||
186 | 186 | //Rename the uploaded file to the same name in a different location that does not have 777 rights or 755. |
187 | 187 | rename("".XOOPS_ROOT_PATH."/modules/$moddir/init_uploads/".$savedfilename."", "".XOOPS_ROOT_PATH."/modules/$moddir/uploads/".$savedfilename.""); |
188 | 188 | //Delete the uploaded file from the initial upload folder if it is still present in that folder. |
189 | - if(file_exists("".XOOPS_ROOT_PATH."/modules/$moddir/init_uploads/".$savedfilename."")) { |
|
189 | + if (file_exists("".XOOPS_ROOT_PATH."/modules/$moddir/init_uploads/".$savedfilename."")) { |
|
190 | 190 | unlink("".XOOPS_ROOT_PATH."/modules/$moddir/init_uploads/".$savedfilename.""); |
191 | 191 | } |
192 | - redirect_header("directories.php?op=moddir&dirid=$p_dirid",2,_MD_DIR_UPDATED); |
|
192 | + redirect_header("directories.php?op=moddir&dirid=$p_dirid", 2, _MD_DIR_UPDATED); |
|
193 | 193 | exit(); |
194 | - } else { |
|
194 | + } else { |
|
195 | 195 | echo $uploader->getErrors(); |
196 | 196 | $sql = "UPDATE ".$xoopsDB->prefix("efqdiralpha1_dir")." SET descr = '".$p_descr."', open='".$p_open."', name='".$p_dirname."' WHERE dirid = '".$p_dirid."'"; |
197 | 197 | $xoopsDB->query($sql) or $eh->show("0013"); |
198 | - redirect_header("directories.php?dirid=$p_dirid",2,_MD_DIR_UPDATED); |
|
198 | + redirect_header("directories.php?dirid=$p_dirid", 2, _MD_DIR_UPDATED); |
|
199 | 199 | exit(); |
200 | 200 | } |
201 | 201 | } |
202 | - redirect_header("directories.php?dirid=$p_dirid",2,_MD_DIR_NOT_UPDATED); |
|
202 | + redirect_header("directories.php?dirid=$p_dirid", 2, _MD_DIR_NOT_UPDATED); |
|
203 | 203 | } |
204 | 204 | |
205 | -function changeStatus($status=0) |
|
205 | +function changeStatus($status = 0) |
|
206 | 206 | { |
207 | 207 | global $xoopsDB, $eh, $moddir; |
208 | 208 | $select = $_POST['select']; |
@@ -221,10 +221,10 @@ discard block |
||
221 | 221 | } |
222 | 222 | $sql = sprintf("UPDATE %s SET open=".$status." WHERE dirid IN (%s)", $xoopsDB->prefix("efqdiralpha1_dir"), $directories); |
223 | 223 | $xoopsDB->query($sql) or $eh->show("0013"); |
224 | - redirect_header("directories.php",2,_MD_DIR_UPDATED); |
|
224 | + redirect_header("directories.php", 2, _MD_DIR_UPDATED); |
|
225 | 225 | exit(); |
226 | 226 | } else { |
227 | - redirect_header("directories.php",2,_MD_DIR_NOT_UPDATED); |
|
227 | + redirect_header("directories.php", 2, _MD_DIR_NOT_UPDATED); |
|
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
@@ -246,11 +246,11 @@ discard block |
||
246 | 246 | $sql = sprintf("INSERT INTO %s (dirid, postfix, open, name) VALUES (%u, '%s', '%s', '%s')", $xoopsDB->prefix("efqdiralpha1_dir"), $newid, $p_postfix, $p_open, $p_dirname); |
247 | 247 | $xoopsDB->query($sql) or $eh->show("0013"); |
248 | 248 | $db_dirid = $xoopsDB->getInsertId(); |
249 | - redirect_header("directories.php?op=moddir&dirid=$db_dirid",2,_MD_DIR_SAVED); |
|
249 | + redirect_header("directories.php?op=moddir&dirid=$db_dirid", 2, _MD_DIR_SAVED); |
|
250 | 250 | exit(); |
251 | 251 | } |
252 | 252 | |
253 | -if(!isset($_POST['op'])) { |
|
253 | +if (!isset($_POST['op'])) { |
|
254 | 254 | $op = isset($_GET['op']) ? $_GET['op'] : 'dirConfig'; |
255 | 255 | } else { |
256 | 256 | $op = $_POST['op']; |
@@ -191,7 +191,7 @@ |
||
191 | 191 | } |
192 | 192 | redirect_header("directories.php?op=moddir&dirid=$p_dirid",2,_MD_DIR_UPDATED); |
193 | 193 | exit(); |
194 | - } else { |
|
194 | + } else { |
|
195 | 195 | echo $uploader->getErrors(); |
196 | 196 | $sql = "UPDATE ".$xoopsDB->prefix("efqdiralpha1_dir")." SET descr = '".$p_descr."', open='".$p_open."', name='".$p_dirname."' WHERE dirid = '".$p_dirid."'"; |
197 | 197 | $xoopsDB->query($sql) or $eh->show("0013"); |
@@ -44,24 +44,24 @@ discard block |
||
44 | 44 | $myts =& MyTextSanitizer::getInstance(); |
45 | 45 | $eh = new ErrorHandler; |
46 | 46 | if (isset($_GET['op'])) { |
47 | - $op = $_GET['op']; |
|
47 | + $op = $_GET['op']; |
|
48 | 48 | } else { |
49 | 49 | $op = "showExtFields"; |
50 | 50 | } |
51 | 51 | if (isset($_GET['type'])) { |
52 | - $type = $_GET['type']; |
|
52 | + $type = $_GET['type']; |
|
53 | 53 | } else { |
54 | 54 | $type = "text"; |
55 | 55 | } |
56 | 56 | if (isset($_GET['ext'])) { |
57 | - $ext = $_GET['ext']; |
|
57 | + $ext = $_GET['ext']; |
|
58 | 58 | } else { |
59 | 59 | $ext = ""; |
60 | 60 | } |
61 | 61 | |
62 | 62 | function showExtFields($type="text", $ext="") |
63 | 63 | { |
64 | - global $xoopsConfig, $xoopsDB, $_POST, $myts, $eh, $xoopsUser; |
|
64 | + global $xoopsConfig, $xoopsDB, $_POST, $myts, $eh, $xoopsUser; |
|
65 | 65 | |
66 | 66 | //MHE - This is added code for the listings module, handling the extension manager. |
67 | 67 | if (!headers_sent()) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | header('Cache-Control: no-store, no-cache, must-revalidate'); |
72 | 72 | header("Cache-Control: post-check=0, pre-check=0", false); |
73 | 73 | header("Pragma: no-cache"); |
74 | - } |
|
74 | + } |
|
75 | 75 | echo '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN"\n'; |
76 | 76 | echo '"http://www.w3.org/TR/html4/strict.dtd">'; |
77 | 77 | echo "<html lang=\"en\" dir=\"ltr\">\n"; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | echo '<meta http-equiv="content-language" content="'._LANGCODE.'" />'; |
81 | 81 | echo '<title>Extension Manager</title>'; |
82 | 82 | echo '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/xoops.css" />'; |
83 | - echo '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/modules/system/style.css" />'; |
|
83 | + echo '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/modules/system/style.css" />'; |
|
84 | 84 | echo '<script type="text/javascript"><!--'; |
85 | 85 | echo " |
86 | 86 | function ext_initial_adv(formName, obj, type){ |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | // Based upon the mylinks and the mxDirectory modules // |
31 | 31 | // ------------------------------------------------------------------------- // |
32 | 32 | include '../../../include/cp_header.php'; |
33 | -if ( file_exists("../language/".$xoopsConfig['language']."/main.php") ) { |
|
33 | +if (file_exists("../language/".$xoopsConfig['language']."/main.php")) { |
|
34 | 34 | include "../language/".$xoopsConfig['language']."/main.php"; |
35 | 35 | } else { |
36 | 36 | include "../language/english/main.php"; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | include_once XOOPS_ROOT_PATH."/class/xoopslists.php"; |
42 | 42 | include_once XOOPS_ROOT_PATH."/include/xoopscodes.php"; |
43 | 43 | include_once XOOPS_ROOT_PATH.'/class/module.errorhandler.php'; |
44 | -$myts =& MyTextSanitizer::getInstance(); |
|
44 | +$myts = & MyTextSanitizer::getInstance(); |
|
45 | 45 | $eh = new ErrorHandler; |
46 | 46 | if (isset($_GET['op'])) { |
47 | 47 | $op = $_GET['op']; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $ext = ""; |
60 | 60 | } |
61 | 61 | |
62 | -function showExtFields($type="text", $ext="") |
|
62 | +function showExtFields($type = "text", $ext = "") |
|
63 | 63 | { |
64 | 64 | global $xoopsConfig, $xoopsDB, $_POST, $myts, $eh, $xoopsUser; |
65 | 65 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | if (!headers_sent()) { |
68 | 68 | header('Content-Type:text/html; charset='._CHARSET); |
69 | 69 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
70 | - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|
70 | + header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); |
|
71 | 71 | header('Cache-Control: no-store, no-cache, must-revalidate'); |
72 | 72 | header("Cache-Control: post-check=0, pre-check=0", false); |
73 | 73 | header("Pragma: no-cache"); |
@@ -332,8 +332,8 @@ discard block |
||
332 | 332 | $form_checked->addOption(1, _MD_YESNO); |
333 | 333 | $form->addElement($form_multiple); |
334 | 334 | $form->addElement($form_checked); |
335 | - $ext_update = new XoopsFormLabel("","<INPUT type=\"button\" value=\""._MD_UPDATE."\" onClick=\"ext_input('submitform','ext')\" value=\"Update\">"); |
|
336 | - $ext_cancel = new XoopsFormLabel("","<INPUT type=\"button\" value=\""._MD_CANCEL."\" onClick=\"self.close()\" value=\"Cancel\">"); |
|
335 | + $ext_update = new XoopsFormLabel("", "<INPUT type=\"button\" value=\""._MD_UPDATE."\" onClick=\"ext_input('submitform','ext')\" value=\"Update\">"); |
|
336 | + $ext_cancel = new XoopsFormLabel("", "<INPUT type=\"button\" value=\""._MD_CANCEL."\" onClick=\"self.close()\" value=\"Cancel\">"); |
|
337 | 337 | $ext_tray = new XoopsFormElementTray("", ""); |
338 | 338 | $ext_tray->addElement($ext_update); |
339 | 339 | $ext_tray->addElement($ext_cancel); |
@@ -48,7 +48,7 @@ |
||
48 | 48 | $moddir = $xoopsModule->getvar("dirname"); |
49 | 49 | |
50 | 50 | if (isset($_GET['dirid'])) { |
51 | - $get_dir = intval($_GET['dirid']); |
|
51 | + $get_dir = intval($_GET['dirid']); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | function xdirConfig() |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | // Based upon the mylinks and the mxDirectory modules // |
31 | 31 | // ------------------------------------------------------------------------- // |
32 | 32 | include '../../../include/cp_header.php'; |
33 | -if ( file_exists("../language/".$xoopsConfig['language']."/main.php") ) { |
|
33 | +if (file_exists("../language/".$xoopsConfig['language']."/main.php")) { |
|
34 | 34 | include "../language/".$xoopsConfig['language']."/main.php"; |
35 | 35 | } else { |
36 | 36 | include "../language/english/main.php"; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | include '../class/class.xdir.php'; |
43 | 43 | include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
44 | 44 | include_once XOOPS_ROOT_PATH.'/class/module.errorhandler.php'; |
45 | -$myts =& MyTextSanitizer::getInstance(); |
|
45 | +$myts = & MyTextSanitizer::getInstance(); |
|
46 | 46 | $eh = new ErrorHandler; |
47 | 47 | |
48 | 48 | $moddir = $xoopsModule->getvar("dirname"); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | global $xoopsDB, $xoopsModule, $xoopsUser, $myts, $moddir; |
57 | 57 | xoops_cp_header(); |
58 | - adminmenu(0,_MD_A_DIRADMIN); |
|
58 | + adminmenu(0, _MD_A_DIRADMIN); |
|
59 | 59 | echo "<h4>"._MD_MIGRATE_FROM_XDIR."</h4>"; |
60 | 60 | echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td>"; |
61 | 61 | $form = new XoopsThemeForm(_MD_XIDR_MIGRATE_TO_NEWDIR, 'submitform', 'xdir_migrate.php'); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if (isset($_POST["dirname"]) and $_POST["dirname"] != "") { |
78 | 78 | $p_dirname = $_POST["dirname"]; |
79 | 79 | } else { |
80 | - redirect_header("directories.php?op=moddir&dirid=$db_dirid",2,_MD_XDIR_CREATE_EMPTY_DIR); |
|
80 | + redirect_header("directories.php?op=moddir&dirid=$db_dirid", 2, _MD_XDIR_CREATE_EMPTY_DIR); |
|
81 | 81 | } |
82 | 82 | if (isset($_POST["open"])) { |
83 | 83 | $p_open = $_POST["open"]; |
@@ -96,17 +96,17 @@ discard block |
||
96 | 96 | $xdirHandler->doMigrate($db_dirid); |
97 | 97 | $migration_errors = $xdirHandler->get_errors(); |
98 | 98 | if (count($migration_errors) > 0) { |
99 | - redirect_header("xdir_migrate.php",2,_MD_XDIR_MIGRATION_FAILED); |
|
99 | + redirect_header("xdir_migrate.php", 2, _MD_XDIR_MIGRATION_FAILED); |
|
100 | 100 | } else { |
101 | - redirect_header('directories.php?op=moddir&dirid='.$db_dirid,2,_MD_XDIR_MIGRATION_COMPLETED); |
|
101 | + redirect_header('directories.php?op=moddir&dirid='.$db_dirid, 2, _MD_XDIR_MIGRATION_COMPLETED); |
|
102 | 102 | } |
103 | 103 | } else { |
104 | - redirect_header("xdir_migrate.php",2,_MD_XDIR_MIGRATION_FAILED); |
|
104 | + redirect_header("xdir_migrate.php", 2, _MD_XDIR_MIGRATION_FAILED); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | } |
108 | 108 | |
109 | -if(!isset($_POST['op'])) { |
|
109 | +if (!isset($_POST['op'])) { |
|
110 | 110 | $op = isset($_GET['op']) ? $_GET['op'] : 'dirConfig'; |
111 | 111 | } else { |
112 | 112 | $op = $_POST['op']; |
@@ -51,52 +51,52 @@ discard block |
||
51 | 51 | //$coupon_handler = new ListingsCouponHandler; |
52 | 52 | |
53 | 53 | if (!isset($_GET['op'])) { |
54 | - header('location', 'index.php'); |
|
54 | + header('location', 'index.php'); |
|
55 | 55 | } |
56 | 56 | $op = trim($_GET['op']); |
57 | 57 | $criteria = new CriteriaCompo(); |
58 | 58 | |
59 | 59 | switch ($op) { |
60 | - case 'expired': |
|
60 | + case 'expired': |
|
61 | 61 | $criteria->add(new Criteria('expire', time(), '<')); |
62 | 62 | $criteria->add(new Criteria('expire', '0', '!=')); |
63 | - break; |
|
63 | + break; |
|
64 | 64 | |
65 | 65 | case 'noexp': |
66 | 66 | $criteria->add(new Criteria('expire', '0', '=')); |
67 | - break; |
|
67 | + break; |
|
68 | 68 | |
69 | 69 | case 'future': |
70 | - $criteria->add(new Criteria('publish', time(), '>')); |
|
71 | - break; |
|
70 | + $criteria->add(new Criteria('publish', time(), '>')); |
|
71 | + break; |
|
72 | 72 | } |
73 | 73 | $coupons = $coupon_handler->getObjects($criteria, false); |
74 | 74 | $coupons = $coupon_handler->prepare2show($coupons); |
75 | 75 | $output = "<table>"; |
76 | 76 | foreach ($coupons as $catid => $category) { |
77 | - $output .= '<tr> |
|
77 | + $output .= '<tr> |
|
78 | 78 | <th colspan="2"> |
79 | 79 | '.$category['catTitle'].'; |
80 | 80 | </th> |
81 | 81 | </tr>'; |
82 | - foreach ($category['coupons'] as $key => $coupon) { |
|
83 | - if (!isset($class) || ($class != "odd")) { |
|
84 | - $class = "odd"; |
|
85 | - } |
|
86 | - else { |
|
87 | - $class = "even"; |
|
88 | - } |
|
89 | - $output .= "<tr class='".$class."'> |
|
82 | + foreach ($category['coupons'] as $key => $coupon) { |
|
83 | + if (!isset($class) || ($class != "odd")) { |
|
84 | + $class = "odd"; |
|
85 | + } |
|
86 | + else { |
|
87 | + $class = "even"; |
|
88 | + } |
|
89 | + $output .= "<tr class='".$class."'> |
|
90 | 90 | <td>"; |
91 | - $output .= '<a href="'.XOOPS_URL.'/modules/' .$moddir. '/addcoupon.php?couponid='.$coupon['couponid'].'"><img src="'.XOOPS_URL.'/modules/' .$mydirname. '/images/editicon.gif" alt="'._MD_EDITCOUPON.'" /></a> |
|
91 | + $output .= '<a href="'.XOOPS_URL.'/modules/' .$moddir. '/addcoupon.php?couponid='.$coupon['couponid'].'"><img src="'.XOOPS_URL.'/modules/' .$mydirname. '/images/editicon.gif" alt="'._MD_EDITCOUPON.'" /></a> |
|
92 | 92 | <a href="'.XOOPS_URL.'/modules/' .$moddir. '/singlelink.php?lid='.$coupon['lid'].'">'.$coupon['linkTitle'].'</a><br /> |
93 | 93 | <br /> |
94 | 94 | '._MD_PUBLISHEDON.' '.$coupon['publish']; |
95 | - if ($coupon['expire'] > 0) { |
|
96 | - $output .= "<br />"._MD_EXPIRESON.$coupon['expire']; |
|
97 | - } |
|
98 | - $output .= "<br />"._MD_COUPONHITS." : ".$coupon['counter']; |
|
99 | - $output .= '</div> |
|
95 | + if ($coupon['expire'] > 0) { |
|
96 | + $output .= "<br />"._MD_EXPIRESON.$coupon['expire']; |
|
97 | + } |
|
98 | + $output .= "<br />"._MD_COUPONHITS." : ".$coupon['counter']; |
|
99 | + $output .= '</div> |
|
100 | 100 | </td> |
101 | 101 | <td valign="top">'.$coupon['heading'].'<br />'.$coupon['description'].'</td> |
102 | 102 | </tr> |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | <td colspan="2" class="foot"> |
105 | 105 | <a href="'.XOOPS_URL.'/modules/' .$moddir. '/addcoupon.php?couponid='.$coupon['couponid'].'">'._MD_EDITCOUPON.'</a> |
106 | 106 | </tr>'; |
107 | - } |
|
107 | + } |
|
108 | 108 | } |
109 | 109 | $output .= "</table>"; |
110 | 110 | if (count($coupons) < 1) { |
111 | - $output = _MD_NOSAVINGS; |
|
111 | + $output = _MD_NOSAVINGS; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | echo $output; |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | include '../include/functions.php'; |
42 | 42 | |
43 | 43 | adminmenu(-1); |
44 | -if ( file_exists("../language/".$xoopsConfig['language']."/main.php") ) { |
|
44 | +if (file_exists("../language/".$xoopsConfig['language']."/main.php")) { |
|
45 | 45 | include "../language/".$xoopsConfig['language']."/main.php"; |
46 | 46 | } else { |
47 | 47 | include "../language/english/main.php"; |
48 | 48 | } |
49 | 49 | |
50 | -$coupon_handler =& xoops_getmodulehandler('coupon', $moddir); |
|
50 | +$coupon_handler = & xoops_getmodulehandler('coupon', $moddir); |
|
51 | 51 | //$coupon_handler = new ListingsCouponHandler; |
52 | 52 | |
53 | 53 | if (!isset($_GET['op'])) { |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | } |
89 | 89 | $output .= "<tr class='".$class."'> |
90 | 90 | <td>"; |
91 | - $output .= '<a href="'.XOOPS_URL.'/modules/' .$moddir. '/addcoupon.php?couponid='.$coupon['couponid'].'"><img src="'.XOOPS_URL.'/modules/' .$mydirname. '/images/editicon.gif" alt="'._MD_EDITCOUPON.'" /></a> |
|
92 | - <a href="'.XOOPS_URL.'/modules/' .$moddir. '/singlelink.php?lid='.$coupon['lid'].'">'.$coupon['linkTitle'].'</a><br /> |
|
91 | + $output .= '<a href="'.XOOPS_URL.'/modules/'.$moddir.'/addcoupon.php?couponid='.$coupon['couponid'].'"><img src="'.XOOPS_URL.'/modules/'.$mydirname.'/images/editicon.gif" alt="'._MD_EDITCOUPON.'" /></a> |
|
92 | + <a href="'.XOOPS_URL.'/modules/'.$moddir.'/singlelink.php?lid='.$coupon['lid'].'">'.$coupon['linkTitle'].'</a><br /> |
|
93 | 93 | <br /> |
94 | 94 | '._MD_PUBLISHEDON.' '.$coupon['publish']; |
95 | 95 | if ($coupon['expire'] > 0) { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | </tr> |
103 | 103 | <tr> |
104 | 104 | <td colspan="2" class="foot"> |
105 | - <a href="'.XOOPS_URL.'/modules/' .$moddir. '/addcoupon.php?couponid='.$coupon['couponid'].'">'._MD_EDITCOUPON.'</a> |
|
105 | + <a href="'.XOOPS_URL.'/modules/'.$moddir.'/addcoupon.php?couponid='.$coupon['couponid'].'">'._MD_EDITCOUPON.'</a> |
|
106 | 106 | </tr>'; |
107 | 107 | } |
108 | 108 | } |
@@ -82,8 +82,7 @@ |
||
82 | 82 | foreach ($category['coupons'] as $key => $coupon) { |
83 | 83 | if (!isset($class) || ($class != "odd")) { |
84 | 84 | $class = "odd"; |
85 | - } |
|
86 | - else { |
|
85 | + } else { |
|
87 | 86 | $class = "even"; |
88 | 87 | } |
89 | 88 | $output .= "<tr class='".$class."'> |