Browse code

Initial commit

Benjamin Roth authored on07/09/2015 15:02:25
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,44 @@
1
+<?php
2
+/**
3
+ * eSales Media oxVoucher for Contao Open Source CMS
4
+ *
5
+ * Copyright (c) 2015 eSales Media
6
+ *
7
+ * @author  Benjamin Roth [benjamin@esales-media.de]
8
+ * @license proprietary
9
+ */
10
+
11
+$GLOBALS['TL_DCA']['tl_module']['palettes']['oxvoucher_search'] = '{title_legend},name,headline,type;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
12
+$GLOBALS['TL_DCA']['tl_module']['palettes']['oxvoucher_details'] = '{title_legend},name,headline,type;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
13
+$GLOBALS['TL_DCA']['tl_module']['palettes']['oxticket_select'] = '{title_legend},name,headline,type;{oxticket_legend},oxticket_category;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
14
+$GLOBALS['TL_DCA']['tl_module']['palettes']['oxticket_details'] = '{title_legend},name,headline,type;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
15
+
16
+$GLOBALS['TL_DCA']['tl_module']['fields']['oxticket_category'] = array
17
+(
18
+	'label' => &$GLOBALS['TL_LANG']['tl_module']['oxticket_category'],
19
+	'exclude' => true,
20
+	'inputType' => 'select',
21
+	'options_callback' => array('tl_module_oxvoucher', 'getOxCategories'),
22
+	'eval' => array('chosen' => true, 'mandatory'=>true),
23
+	'sql' => "varchar(32) NOT NULL default ''"
24
+);
25
+
26
+class tl_module_oxvoucher extends \Backend {
27
+
28
+	public function getOxCategories()
29
+	{
30
+		$oxDB = \Voucher::getOxDbInstance();
31
+		$arrCategories = array();
32
+
33
+		$objResult = $oxDB->execute("SELECT OXID, OXTITLE FROM oxcategories WHERE OXACTIVE = '1' ORDER BY OXTITLE");
34
+
35
+		if ($objResult->numRows)
36
+		{
37
+			while ($objResult->next())
38
+			{
39
+				$arrCategories[$objResult->OXID] = $objResult->OXTITLE;
40
+			}
41
+		}
42
+		return $arrCategories;
43
+	}
44
+}
0 45
\ No newline at end of file