Browse Source

Import from svn

Erik Winn 8 years ago
parent
commit
7bbeb662a6
100 changed files with 7087 additions and 0 deletions
  1. 22
    0
      LICENCE
  2. 204
    0
      admin/AccountEditPanel.class.php
  3. 39
    0
      admin/AccountEditPanel.tpl.php
  4. 170
    0
      admin/AccountListPanel.class.php
  5. 10
    0
      admin/AccountListPanel.tpl.php
  6. 123
    0
      admin/AddressEditPanel.class.php
  7. 44
    0
      admin/AddressEditPanel.tpl.php
  8. 222
    0
      admin/AddressListPanel.class.php
  9. 8
    0
      admin/AddressListPanel.tpl.php
  10. 121
    0
      admin/ContentBlockEditPanel.class.php
  11. 42
    0
      admin/ContentBlockEditPanel.tpl.php
  12. 100
    0
      admin/ContentBlockListPanel.class.php
  13. 8
    0
      admin/ContentBlockListPanel.tpl.php
  14. 115
    0
      admin/ContentCategoryEditPanel.class.php
  15. 36
    0
      admin/ContentCategoryEditPanel.tpl.php
  16. 98
    0
      admin/ContentCategoryListPanel.class.php
  17. 8
    0
      admin/ContentCategoryListPanel.tpl.php
  18. 147
    0
      admin/ContentItemEditPanel.class.php
  19. 62
    0
      admin/ContentItemEditPanel.tpl.php
  20. 110
    0
      admin/ContentItemListPanel.class.php
  21. 8
    0
      admin/ContentItemListPanel.tpl.php
  22. 103
    0
      admin/HtmlMetaTagEditPanel.class.php
  23. 24
    0
      admin/HtmlMetaTagEditPanel.tpl.php
  24. 93
    0
      admin/HtmlMetaTagListPanel.class.php
  25. 8
    0
      admin/HtmlMetaTagListPanel.tpl.php
  26. 103
    0
      admin/JavaScriptEditPanel.class.php
  27. 24
    0
      admin/JavaScriptEditPanel.tpl.php
  28. 93
    0
      admin/JavaScriptListPanel.class.php
  29. 8
    0
      admin/JavaScriptListPanel.tpl.php
  30. 121
    0
      admin/MenuEditPanel.class.php
  31. 42
    0
      admin/MenuEditPanel.tpl.php
  32. 123
    0
      admin/MenuItemEditPanel.class.php
  33. 44
    0
      admin/MenuItemEditPanel.tpl.php
  34. 103
    0
      admin/MenuItemListPanel.class.php
  35. 8
    0
      admin/MenuItemListPanel.tpl.php
  36. 101
    0
      admin/MenuListPanel.class.php
  37. 8
    0
      admin/MenuListPanel.tpl.php
  38. 119
    0
      admin/ModuleEditPanel.class.php
  39. 40
    0
      admin/ModuleEditPanel.tpl.php
  40. 102
    0
      admin/ModuleListPanel.class.php
  41. 8
    0
      admin/ModuleListPanel.tpl.php
  42. 103
    0
      admin/OrderChangeEditPanel.class.php
  43. 24
    0
      admin/OrderChangeEditPanel.tpl.php
  44. 94
    0
      admin/OrderChangeListPanel.class.php
  45. 8
    0
      admin/OrderChangeListPanel.tpl.php
  46. 275
    0
      admin/OrderEditPanel.class.php
  47. 123
    0
      admin/OrderEditPanel.tpl.php
  48. 100
    0
      admin/OrderItemEditPanel.class.php
  49. 14
    0
      admin/OrderItemEditPanel.tpl.php
  50. 94
    0
      admin/OrderItemListPanel.class.php
  51. 6
    0
      admin/OrderItemListPanel.tpl.php
  52. 247
    0
      admin/OrderListPanel.class.php
  53. 9
    0
      admin/OrderListPanel.tpl.php
  54. 103
    0
      admin/OrderStatusHistoryEditPanel.class.php
  55. 24
    0
      admin/OrderStatusHistoryEditPanel.tpl.php
  56. 94
    0
      admin/OrderStatusHistoryListPanel.class.php
  57. 8
    0
      admin/OrderStatusHistoryListPanel.tpl.php
  58. 137
    0
      admin/PageEditPanel.class.php
  59. 58
    0
      admin/PageEditPanel.tpl.php
  60. 105
    0
      admin/PageListPanel.class.php
  61. 8
    0
      admin/PageListPanel.tpl.php
  62. 119
    0
      admin/PaymentMethodEditPanel.class.php
  63. 40
    0
      admin/PaymentMethodEditPanel.tpl.php
  64. 102
    0
      admin/PaymentMethodListPanel.class.php
  65. 8
    0
      admin/PaymentMethodListPanel.tpl.php
  66. 125
    0
      admin/PaypalTransactionEditPanel.class.php
  67. 46
    0
      admin/PaypalTransactionEditPanel.tpl.php
  68. 105
    0
      admin/PaypalTransactionListPanel.class.php
  69. 8
    0
      admin/PaypalTransactionListPanel.tpl.php
  70. 123
    0
      admin/PersonEditPanel.class.php
  71. 44
    0
      admin/PersonEditPanel.tpl.php
  72. 103
    0
      admin/PersonListPanel.class.php
  73. 8
    0
      admin/PersonListPanel.tpl.php
  74. 113
    0
      admin/ProductCategoryEditPanel.class.php
  75. 34
    0
      admin/ProductCategoryEditPanel.tpl.php
  76. 98
    0
      admin/ProductCategoryListPanel.class.php
  77. 8
    0
      admin/ProductCategoryListPanel.tpl.php
  78. 145
    0
      admin/ProductEditPanel.class.php
  79. 58
    0
      admin/ProductEditPanel.tpl.php
  80. 111
    0
      admin/ProductImageEditPanel.class.php
  81. 32
    0
      admin/ProductImageEditPanel.tpl.php
  82. 98
    0
      admin/ProductImageListPanel.class.php
  83. 8
    0
      admin/ProductImageListPanel.tpl.php
  84. 112
    0
      admin/ProductListPanel.class.php
  85. 8
    0
      admin/ProductListPanel.tpl.php
  86. 115
    0
      admin/ShippingMethodEditPanel.class.php
  87. 36
    0
      admin/ShippingMethodEditPanel.tpl.php
  88. 100
    0
      admin/ShippingMethodListPanel.class.php
  89. 8
    0
      admin/ShippingMethodListPanel.tpl.php
  90. 101
    0
      admin/ShippingRateEditPanel.class.php
  91. 22
    0
      admin/ShippingRateEditPanel.tpl.php
  92. 93
    0
      admin/ShippingRateListPanel.class.php
  93. 8
    0
      admin/ShippingRateListPanel.tpl.php
  94. 101
    0
      admin/ShoppingCartEditPanel.class.php
  95. 22
    0
      admin/ShoppingCartEditPanel.tpl.php
  96. 99
    0
      admin/ShoppingCartItemEditPanel.class.php
  97. 20
    0
      admin/ShoppingCartItemEditPanel.tpl.php
  98. 92
    0
      admin/ShoppingCartItemListPanel.class.php
  99. 8
    0
      admin/ShoppingCartItemListPanel.tpl.php
  100. 0
    0
      admin/ShoppingCartListPanel.class.php

+ 22
- 0
LICENCE View File

@@ -0,0 +1,22 @@
1
+2008-07-26
2
+
3
+    Quasi CMS is released under the terms of the GPL version 2.0. This covers the code
4
+found in under the directories admin/, core/, and doc/ in the same directory as this file.
5
+This license applies to any code that comprises the CMS itself which contains the
6
+GPL notice at the top of the file.
7
+
8
+    You may freely distribute Quasi CMS and you may distribute modifications of Quasi
9
+CMS under the terms of the GPL. This means that you may not change the license on this
10
+or derivative works and that you must provide the source code of the application if it is
11
+requested of you. Please see the full text of the GPL for a complete description of the
12
+terms of the license.
13
+
14
+    NOTE: THIS LICENSE DOES NOT INCLUDE THE QCODO FRAMEWORK. The
15
+Qcodo framework consists of the software in the directories assets/, includes/ and _devtools/
16
+found in this directory. The QCodo framework is distributed under the terms of the
17
+MIT Open Source licence - please see the file _LICENSE.txt under the includes/ directory
18
+for the precise terms or visit http://www.qcodo.com for more information.
19
+
20
+    You should have received a copy of the GPL with this software - it is normally
21
+located under the doc/ directory. If you did not receive a copy of the license you can
22
+find one at http://www.gnu.org/copyleft/gpl.txt

+ 204
- 0
admin/AccountEditPanel.class.php View File

@@ -0,0 +1,204 @@
1
+<?php
2
+	/**
3
+	 * This is a quick-and-dirty draft QPanel object to do Create, Edit, and Delete functionality
4
+	 * of the Account class.  It uses the code-generated
5
+	 * AccountMetaControl class, which has meta-methods to help with
6
+	 * easily creating/defining controls to modify the fields of a Account columns.
7
+	 *
8
+	 * Any display customizations and presentation-tier logic can be implemented
9
+	 * here by overriding existing or implementing new methods, properties and variables.
10
+	 * 
11
+	 * NOTE: This file is overwritten on any code regenerations.  If you want to make
12
+	 * permanent changes, it is STRONGLY RECOMMENDED to move both account_edit.php AND
13
+	 * account_edit.tpl.php out of this Form Drafts directory.
14
+	 *
15
+	 * @package Quasi
16
+	 * @subpackage Drafts
17
+	 */
18
+	class AccountEditPanel extends QPanel {
19
+		// Local instance of the AccountMetaControl
20
+        protected $mctAccount;
21
+        protected $objAccount;
22
+        protected $pnlListPanel;
23
+                      
24
+        public $dtgOrders;  
25
+        public $objPaginator;
26
+        public $pxyViewOrder;
27
+
28
+		// Controls for Account's Data Fields
29
+		public $lblId;
30
+		public $lblRegistrationDate;
31
+		public $txtUsername;
32
+		public $txtPassword;
33
+		public $txtNotes;
34
+		public $lblLastLogin;
35
+		public $txtLoginCount;
36
+		public $chkOnline;
37
+		public $chkOnetimePassword;
38
+		public $chkValidPassword;
39
+		public $lstType;
40
+		public $lstStatus;
41
+		public $lblPerson;
42
+
43
+		// Other ListBoxes (if applicable) via Unique ReverseReferences and ManyToMany References
44
+
45
+		// Other Controls
46
+		public $btnSave;
47
+		public $btnDelete;
48
+		public $btnCancel;
49
+
50
+		// Callback
51
+		protected $strClosePanelMethod;
52
+
53
+		public function __construct($objParentObject, $strClosePanelMethod, $intId = null, $strControlId = null)
54
+        {
55
+            $this->pnlListPanel =& $objParentObject;
56
+            
57
+			// Call the Parent
58
+			try {
59
+				parent::__construct($objParentObject, $strControlId);
60
+			} catch (QCallerException $objExc) {
61
+				$objExc->IncrementOffset();
62
+				throw $objExc;
63
+			}
64
+
65
+			// Setup Callback and Template
66
+			$this->strTemplate = 'AccountEditPanel.tpl.php';
67
+			$this->strClosePanelMethod = $strClosePanelMethod;
68
+
69
+			// Construct the AccountMetaControl
70
+			// MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
71
+			$this->mctAccount = AccountMetaControl::Create($this, $intId);
72
+            $this->objAccount =& $this->mctAccount->Account;
73
+			// Call MetaControl's methods to create qcontrols based on Account's data fields
74
+			$this->lblId = $this->mctAccount->lblId_Create();
75
+			$this->lblRegistrationDate = $this->mctAccount->lblRegistrationDate_Create();
76
+			$this->txtUsername = $this->mctAccount->txtUsername_Create();
77
+			$this->txtPassword = $this->mctAccount->txtPassword_Create();
78
+            $this->txtPassword->Required = false;           
79
+			$this->txtNotes = $this->mctAccount->txtNotes_Create();
80
+			$this->lblLastLogin = $this->mctAccount->lblLastLogin_Create();
81
+			$this->txtLoginCount = $this->mctAccount->txtLoginCount_Create();
82
+			$this->chkOnline = $this->mctAccount->chkOnline_Create();
83
+			$this->chkOnetimePassword = $this->mctAccount->chkOnetimePassword_Create();
84
+			$this->chkValidPassword = $this->mctAccount->chkValidPassword_Create();
85
+			$this->lstType = $this->mctAccount->lstType_Create();
86
+			$this->lstStatus = $this->mctAccount->lstStatus_Create();
87
+			$this->lblPerson = $this->mctAccount->lblPersonId_Create();
88
+
89
+            // Create a Meta DataGrid to list the Orders for the Account
90
+            $this->dtgOrders = new OrderDataGrid($this);
91
+            $this->dtgOrders->SetDataBinder('AccountOrderDataBinder', $this);
92
+
93
+            $this->dtgOrders->CssClass = 'datagrid';
94
+            $this->dtgOrders->AlternateRowStyle->CssClass = 'alternate';
95
+            $this->objPaginator = new QPaginator($this->dtgOrders);
96
+            $this->dtgOrders->Paginator = $this->objPaginator;
97
+            $this->dtgOrders->ItemsPerPage = 25;
98
+
99
+            $this->pxyViewOrder = new QControlProxy($this);
100
+            $this->pxyViewOrder->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyViewOrder_Click'));
101
+
102
+            $this->dtgOrders->MetaAddProxyColumn($this->pxyViewOrder, 'Id');
103
+                     
104
+            $this->dtgOrders->MetaAddColumn('CreationDate');
105
+            $this->dtgOrders->MetaAddColumn('LastModificationDate');
106
+            $this->dtgOrders->MetaAddColumn('CompletionDate');
107
+            $this->dtgOrders->MetaAddColumn(QQN::Order()->ShippingMethod);
108
+            $this->dtgOrders->MetaAddColumn(QQN::Order()->PaymentMethod);
109
+            $this->dtgOrders->MetaAddTypeColumn('StatusId', 'OrderStatusType');
110
+            
111
+            $strOrderTotalParam = '<?= money_format("%n", $_ITEM->ProductTotalCharged '
112
+                                                 . ' + $_ITEM->ShippingCharged '
113
+                                                 . ' + $_ITEM->HandlingCharged '
114
+                                                 . ' + $_ITEM->Tax ) ?>';
115
+            $objOrderTotalColumn = new QDataGridColumn('Order Total', $strOrderTotalParam );
116
+            $this->dtgOrders->AddColumn($objOrderTotalColumn);
117
+			
118
+            // Create Buttons 
119
+			$this->btnSave = new QButton($this);
120
+			$this->btnSave->Text = QApplication::Translate('Save');
121
+			$this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
122
+			$this->btnSave->CausesValidation = $this;
123
+
124
+			$this->btnCancel = new QButton($this);
125
+			$this->btnCancel->Text = QApplication::Translate('Cancel');
126
+			$this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
127
+
128
+			$this->btnDelete = new QButton($this);
129
+			$this->btnDelete->Text = QApplication::Translate('Delete');
130
+			$this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction(QApplication::Translate('Are you SURE you want to DELETE this') . ' ' . QApplication::Translate('Account') . '?'));
131
+			$this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
132
+			$this->btnDelete->Visible = $this->mctAccount->EditMode;
133
+		}
134
+        /**
135
+        * This binds the Datagrid data retrieval to this Account, the orders listed in the Datagrid will be those
136
+        * associated with this account in the database.
137
+        *
138
+        * If a paginator is set on this DataBinder, it will use it.  If not, then no pagination will be used.
139
+        * It will also perform any sorting requested in by clicking on the column titles in the Datagrid.
140
+        */
141
+        public function AccountOrderDataBinder()
142
+        {
143
+            if ($this->objPaginator)
144
+                $this->dtgOrders->TotalItemCount = Order::CountByAccountId($this->objAccount->Id) ;
145
+            
146
+            $objClauses = array();
147
+
148
+            // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
149
+            // the OrderByClause to the $objClauses array - this is in the datagrid if the user clicks on column title
150
+            if ($objClause = $this->dtgOrders->OrderByClause)
151
+                array_push($objClauses, $objClause);
152
+
153
+            // Add the LimitClause information, as well
154
+            if ($objClause = $this->dtgOrders->LimitClause)
155
+                array_push($objClauses, $objClause);
156
+
157
+            array_push($objClauses, QQ::OrderBy(QQN::Order()->CreationDate, false) );
158
+            
159
+
160
+            $this->dtgOrders->DataSource = Order::LoadArrayByAccountId(
161
+                $this->objAccount->Id, $objClauses
162
+            );
163
+        }
164
+        
165
+        public function pxyViewOrder_Click($strFormId, $strControlId, $strParameter)
166
+        {
167
+            //die($strParameter);
168
+            
169
+            $strParameterArray = explode(',', $strParameter);
170
+            
171
+//            $objEditPanel = new OrderEditPanel($this, $this->strCloseEditPanelMethod, $strParameterArray[0]);
172
+//            $objEditPanel = new OrderEditPanel($this, 'CloseEditPane', $strParameterArray[0]);
173
+            $objEditPanel = new OrderEditPanel($this->pnlListPanel , 'CloseEditPane', $strParameter);
174
+
175
+//            $strMethodName = $this->strSetEditPanelMethod;
176
+//            $this->objForm->$strMethodName($objEditPanel);
177
+            $this->objForm->SetEditPane($objEditPanel);
178
+        }
179
+
180
+
181
+		// Control AjaxAction Event Handlers
182
+		public function btnSave_Click($strFormId, $strControlId, $strParameter) {
183
+			// Delegate "Save" processing to the AccountMetaControl
184
+			$this->mctAccount->SaveAccount();
185
+			$this->CloseSelf(true);
186
+		}
187
+
188
+		public function btnDelete_Click($strFormId, $strControlId, $strParameter) {
189
+			// Delegate "Delete" processing to the AccountMetaControl
190
+			$this->mctAccount->DeleteAccount();
191
+			$this->CloseSelf(true);
192
+		}
193
+
194
+		public function btnCancel_Click($strFormId, $strControlId, $strParameter) {
195
+			$this->CloseSelf(false);
196
+		}
197
+
198
+		// Close Myself and Call ClosePanelMethod Callback
199
+		protected function CloseSelf($blnChangesMade) {
200
+			$strMethod = $this->strClosePanelMethod;
201
+			$this->objForm->$strMethod($blnChangesMade);
202
+		}
203
+	}
204
+?>

+ 39
- 0
admin/AccountEditPanel.tpl.php View File

@@ -0,0 +1,39 @@
1
+    <div id="formActions">
2
+        <div id="save"><?php $_CONTROL->btnSave->Render(); ?></div>
3
+        <div id="cancel"><?php $_CONTROL->btnCancel->Render(); ?></div>
4
+        <div id="delete"><?php $_CONTROL->btnDelete->Render(); ?></div>
5
+    </div>
6
+   <br />
7
+   <br />
8
+   <hr>
9
+	<div id="formControls">
10
+        <?php $_CONTROL->lblId->RenderWithName(); ?>
11
+        <?php $_CONTROL->lblPerson->RenderWithName(); ?>
12
+
13
+		<?php $_CONTROL->lblRegistrationDate->RenderWithName(); ?>
14
+
15
+		<?php $_CONTROL->txtUsername->RenderWithName(); ?>
16
+
17
+		<?php $_CONTROL->txtPassword->RenderWithName(); ?>
18
+
19
+		<?php $_CONTROL->txtNotes->RenderWithName(); ?>
20
+
21
+		<?php $_CONTROL->lblLastLogin->RenderWithName(); ?>
22
+
23
+		<?php $_CONTROL->txtLoginCount->RenderWithName(); ?>
24
+
25
+		<?php $_CONTROL->chkOnline->RenderWithName(); ?>
26
+
27
+		<?php $_CONTROL->chkOnetimePassword->RenderWithName(); ?>
28
+
29
+		<?php $_CONTROL->chkValidPassword->RenderWithName(); ?>
30
+
31
+		<?php $_CONTROL->lstType->RenderWithName(); ?>
32
+
33
+		<?php $_CONTROL->lstStatus->RenderWithName(); ?>
34
+
35
+	</div>
36
+ <hr>
37
+    <strong>Orders: </strong>   
38
+        <?php $_CONTROL->dtgOrders->Render(); ?>
39
+   

+ 170
- 0
admin/AccountListPanel.class.php View File

@@ -0,0 +1,170 @@
1
+<?php
2
+	/**
3
+	 * This is the abstract Panel class for the List All functionality
4
+	 * of the Account class.  This code-generated class
5
+	 * contains a datagrid to display an HTML page that can
6
+	 * list a collection of Account objects.  It includes
7
+	 * functionality to perform pagination and sorting on columns.
8
+	 *
9
+	 * To take advantage of some (or all) of these control objects, you
10
+	 * must create a new QPanel which extends this AccountListPanelBase
11
+	 * class.
12
+	 *
13
+	 * Any and all changes to this file will be overwritten with any subsequent re-
14
+	 * code generation.
15
+	 * 
16
+	 * @package Quasi
17
+	 * @subpackage Drafts
18
+	 * 
19
+	 */
20
+	class AccountListPanel extends QPanel {
21
+		// Local instance of the Meta DataGrid to list Accounts
22
+		public $dtgAccounts;
23
+
24
+		// Other public QControls in this panel
25
+		public $btnCreateNew;
26
+        public $pxyEdit;
27
+        public $objPaginator;
28
+
29
+        public $lblMessage;
30
+        public $txtNameSearch;
31
+        public $txtNumberSearch;
32
+        
33
+		// Callback Method Names
34
+		protected $strSetEditPanelMethod;
35
+		protected $strCloseEditPanelMethod;
36
+		
37
+		public function __construct($objParentObject, $strSetEditPanelMethod, $strCloseEditPanelMethod, $strControlId = null) {
38
+			// Call the Parent
39
+			try {
40
+				parent::__construct($objParentObject, $strControlId);
41
+			} catch (QCallerException $objExc) {
42
+				$objExc->IncrementOffset();
43
+				throw $objExc;
44
+			}
45
+
46
+			// Record Method Callbacks
47
+			$this->strSetEditPanelMethod = $strSetEditPanelMethod;
48
+			$this->strCloseEditPanelMethod = $strCloseEditPanelMethod;
49
+
50
+			// Setup the Template
51
+			$this->Template = 'AccountListPanel.tpl.php';
52
+            //messages (eg. Name not found ..)
53
+            $this->lblMessage = new QLabel($this);
54
+                     
55
+            // a search field for Account by name ..
56
+            $this->txtNameSearch = new QTextBox($this);
57
+            $this->txtNameSearch->AddAction(new QEnterKeyEvent(), new QServerControlAction($this, 'txtNameSearch_Click'));
58
+            $this->txtNameSearch->Name = 'Search by Name:';
59
+
60
+            // a search field for Account by number ..
61
+            $this->txtNumberSearch = new QIntegerTextBox($this);
62
+            $this->txtNumberSearch->AddAction(new QEnterKeyEvent(), new QServerControlAction($this, 'txtNumberSearch_Click'));
63
+            $this->txtNumberSearch->Name = 'Search by Number:';
64
+            $this->txtNumberSearch->CausesValidation = $this->txtNumberSearch;
65
+			// Instantiate the Meta DataGrid
66
+			$this->dtgAccounts = new AccountDataGrid($this);
67
+
68
+			$this->dtgAccounts->CssClass = 'datagrid';
69
+			$this->dtgAccounts->AlternateRowStyle->CssClass = 'alternate';
70
+
71
+            $this->objPaginator = new QPaginator($this->dtgAccounts);
72
+			$this->dtgAccounts->Paginator = $this->objPaginator;
73
+			$this->dtgAccounts->ItemsPerPage = 25;
74
+
75
+			// Create an Edit Column
76
+ 			$this->pxyEdit = new QControlProxy($this);
77
+ 			$this->pxyEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyEdit_Click'));
78
+// 			$this->dtgAccounts->MetaAddEditProxyColumn($this->pxyEdit, 'Edit', 'Edit');
79
+
80
+            $this->dtgAccounts->MetaAddProxyColumn($this->pxyEdit, QQN::Account()->Person);
81
+            $this->dtgAccounts->MetaAddColumn('Id');
82
+            $this->dtgAccounts->GetColumn(1)->Name = 'Account Number';
83
+                     
84
+			$this->dtgAccounts->MetaAddColumn('RegistrationDate');
85
+			$this->dtgAccounts->MetaAddColumn('Username');
86
+//			$this->dtgAccounts->MetaAddColumn('Password');
87
+//			$this->dtgAccounts->MetaAddColumn('Notes');
88
+			$this->dtgAccounts->MetaAddColumn('LastLogin');
89
+			$this->dtgAccounts->MetaAddColumn('LoginCount');
90
+			$this->dtgAccounts->MetaAddColumn('Online');
91
+//			$this->dtgAccounts->MetaAddColumn('OnetimePassword');
92
+//			$this->dtgAccounts->MetaAddColumn('ValidPassword');
93
+			$this->dtgAccounts->MetaAddTypeColumn('TypeId', 'AccountType');
94
+			$this->dtgAccounts->MetaAddTypeColumn('StatusId', 'AccountStatusType');
95
+
96
+			// Setup the Create New button
97
+			$this->btnCreateNew = new QButton($this);
98
+			$this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('Account');
99
+			$this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click'));
100
+		}
101
+
102
+        public function pxyEdit_Click($strFormId, $strControlId, $strParameter)
103
+        {
104
+            $this->lblMessage->Text = '';
105
+            
106
+            $strParameterArray = explode(',', $strParameter);
107
+            $objEditPanel = new AccountEditPanel($this, $this->strCloseEditPanelMethod, $strParameterArray[0]);
108
+
109
+            $strMethodName = $this->strSetEditPanelMethod;
110
+            $this->objForm->$strMethodName($objEditPanel);
111
+        }
112
+        
113
+        public function txtNumberSearch_Click($strFormId, $strControlId, $strParameter)
114
+        {
115
+            $intAccountId = $this->txtNumberSearch->Text;
116
+            if(Account::Load($intAccountId))
117
+            {
118
+                $this->lblMessage->Text = '';
119
+                
120
+                $objEditPanel = new AccountEditPanel($this, $this->strCloseEditPanelMethod, $intAccountId );
121
+
122
+                $strMethodName = $this->strSetEditPanelMethod;
123
+                $this->objForm->$strMethodName($objEditPanel);
124
+            }
125
+            else
126
+                $this->lblMessage->Text = 'Account ' . $intAccountId . ' not found.';
127
+        }
128
+        
129
+        public function txtNameSearch_Click($strFormId, $strControlId, $strParameter)
130
+        {
131
+            $this->lblMessage->Text = '';
132
+            $aryNamesToFind = explode(' ', $this->txtNameSearch->Text);
133
+            $aryPersons = array();
134
+            $aryPersonIds = array();
135
+            if(sizeof($aryNamesToFind) > 1 )
136
+            {
137
+                $aryPersons = Person::QueryArray(
138
+                                        QQ::AndCondition(
139
+                                            QQ::Like(QQN::Person()->FirstName, $aryNamesToFind[0]),
140
+                                            QQ::Like(QQN::Person()->LastName,  $aryNamesToFind[1])
141
+                                        )
142
+                                    );
143
+            }
144
+            elseif(sizeof($aryNamesToFind) == 1 )
145
+            {
146
+                $aryPersons = Person::QueryArray(
147
+                                        QQ::OrCondition(
148
+                                            QQ::Like(QQN::Person()->FirstName, $this->txtNameSearch->Text),
149
+                                            QQ::Like(QQN::Person()->LastName, $this->txtNameSearch->Text)
150
+                                        )
151
+                                    );
152
+            }
153
+
154
+            foreach( $aryPersons as $objPerson )
155
+                $aryPersonIds[] = $objPerson->Id;
156
+
157
+            $aryAccounts = Account::QueryArray( QQ::In( QQN::Account()->PersonId, $aryPersonIds) );
158
+            $this->dtgAccounts->TotalItemCount = sizeof($aryAccounts);
159
+            
160
+            $this->dtgAccounts->DataSource = $aryAccounts;
161
+            $this->dtgAccounts->Refresh();
162
+        }
163
+
164
+		public function btnCreateNew_Click($strFormId, $strControlId, $strParameter) {
165
+			$objEditPanel = new AccountEditPanel($this, $this->strCloseEditPanelMethod, null);
166
+			$strMethodName = $this->strSetEditPanelMethod;
167
+			$this->objForm->$strMethodName($objEditPanel);
168
+		}
169
+	}
170
+?>

+ 10
- 0
admin/AccountListPanel.tpl.php View File

@@ -0,0 +1,10 @@
1
+   <?php $_CONTROL->lblMessage->Render(); ?>
2
+   <?php $_CONTROL->txtNameSearch->RenderWithName(); ?>
3
+   <br />
4
+   <?php $_CONTROL->txtNumberSearch->RenderWithName(); ?>
5
+   <br />
6
+   <?php $_CONTROL->btnCreateNew->Render(); ?>
7
+   <br />
8
+   <br />
9
+   <hr>
10
+	<?php $_CONTROL->dtgAccounts->Render(); ?>

+ 123
- 0
admin/AddressEditPanel.class.php View File

@@ -0,0 +1,123 @@
1
+<?php
2
+	/**
3
+	 * This is a quick-and-dirty draft QPanel object to do Create, Edit, and Delete functionality
4
+	 * of the Address class.  It uses the code-generated
5
+	 * AddressMetaControl class, which has meta-methods to help with
6
+	 * easily creating/defining controls to modify the fields of a Address columns.
7
+	 *
8
+	 * Any display customizations and presentation-tier logic can be implemented
9
+	 * here by overriding existing or implementing new methods, properties and variables.
10
+	 * 
11
+	 * NOTE: This file is overwritten on any code regenerations.  If you want to make
12
+	 * permanent changes, it is STRONGLY RECOMMENDED to move both address_edit.php AND
13
+	 * address_edit.tpl.php out of this Form Drafts directory.
14
+	 *
15
+	 * @package Quasi
16
+	 * @subpackage Drafts
17
+	 */
18
+	class AddressEditPanel extends QPanel {
19
+		// Local instance of the AddressMetaControl
20
+		protected $mctAddress;
21
+
22
+		// Controls for Address's Data Fields
23
+		public $lblId;
24
+		public $txtTitle;
25
+		public $lstPerson;
26
+		public $txtStreet1;
27
+		public $txtStreet2;
28
+		public $txtSuburb;
29
+		public $txtCity;
30
+		public $txtCounty;
31
+		public $lstZone;
32
+		public $lstCountry;
33
+		public $txtPostalCode;
34
+		public $chkIsCurrent;
35
+		public $lstType;
36
+		public $lblCreationDate;
37
+		public $lblLastModificationDate;
38
+
39
+		// Other ListBoxes (if applicable) via Unique ReverseReferences and ManyToMany References
40
+
41
+		// Other Controls
42
+		public $btnSave;
43
+		public $btnDelete;
44
+		public $btnCancel;
45
+
46
+		// Callback
47
+		protected $strClosePanelMethod;
48
+
49
+		public function __construct($objParentObject, $strClosePanelMethod, $intId = null, $strControlId = null) {
50
+			// Call the Parent
51
+			try {
52
+				parent::__construct($objParentObject, $strControlId);
53
+			} catch (QCallerException $objExc) {
54
+				$objExc->IncrementOffset();
55
+				throw $objExc;
56
+			}
57
+
58
+			// Setup Callback and Template
59
+			$this->strTemplate = 'AddressEditPanel.tpl.php';
60
+			$this->strClosePanelMethod = $strClosePanelMethod;
61
+
62
+			// Construct the AddressMetaControl
63
+			// MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
64
+			$this->mctAddress = AddressMetaControl::Create($this, $intId);
65
+
66
+			// Call MetaControl's methods to create qcontrols based on Address's data fields
67
+			$this->lblId = $this->mctAddress->lblId_Create();
68
+			$this->txtTitle = $this->mctAddress->txtTitle_Create();
69
+			$this->lstPerson = $this->mctAddress->lstPerson_Create();
70
+			$this->txtStreet1 = $this->mctAddress->txtStreet1_Create();
71
+			$this->txtStreet2 = $this->mctAddress->txtStreet2_Create();
72
+			$this->txtSuburb = $this->mctAddress->txtSuburb_Create();
73
+			$this->txtCity = $this->mctAddress->txtCity_Create();
74
+			$this->txtCounty = $this->mctAddress->txtCounty_Create();
75
+			$this->lstZone = $this->mctAddress->lstZone_Create();
76
+			$this->lstCountry = $this->mctAddress->lstCountry_Create();
77
+			$this->txtPostalCode = $this->mctAddress->txtPostalCode_Create();
78
+			$this->chkIsCurrent = $this->mctAddress->chkIsCurrent_Create();
79
+			$this->lstType = $this->mctAddress->lstType_Create();
80
+			$this->lblCreationDate = $this->mctAddress->lblCreationDate_Create();
81
+			$this->lblLastModificationDate = $this->mctAddress->lblLastModificationDate_Create();
82
+
83
+			// Create Buttons and Actions on this Form
84
+			$this->btnSave = new QButton($this);
85
+			$this->btnSave->Text = QApplication::Translate('Save');
86
+			$this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
87
+			$this->btnSave->CausesValidation = $this;
88
+
89
+			$this->btnCancel = new QButton($this);
90
+			$this->btnCancel->Text = QApplication::Translate('Cancel');
91
+			$this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
92
+
93
+			$this->btnDelete = new QButton($this);
94
+			$this->btnDelete->Text = QApplication::Translate('Delete');
95
+			$this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction(QApplication::Translate('Are you SURE you want to DELETE this') . ' ' . QApplication::Translate('Address') . '?'));
96
+			$this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
97
+			$this->btnDelete->Visible = $this->mctAddress->EditMode;
98
+		}
99
+
100
+		// Control AjaxAction Event Handlers
101
+		public function btnSave_Click($strFormId, $strControlId, $strParameter) {
102
+			// Delegate "Save" processing to the AddressMetaControl
103
+			$this->mctAddress->SaveAddress();
104
+			$this->CloseSelf(true);
105
+		}
106
+
107
+		public function btnDelete_Click($strFormId, $strControlId, $strParameter) {
108
+			// Delegate "Delete" processing to the AddressMetaControl
109
+			$this->mctAddress->DeleteAddress();
110
+			$this->CloseSelf(true);
111
+		}
112
+
113
+		public function btnCancel_Click($strFormId, $strControlId, $strParameter) {
114
+			$this->CloseSelf(false);
115
+		}
116
+
117
+		// Close Myself and Call ClosePanelMethod Callback
118
+		protected function CloseSelf($blnChangesMade) {
119
+			$strMethod = $this->strClosePanelMethod;
120
+			$this->objForm->$strMethod($blnChangesMade);
121
+		}
122
+	}
123
+?>

+ 44
- 0
admin/AddressEditPanel.tpl.php View File

@@ -0,0 +1,44 @@
1
+<?php
2
+	// This is the HTML template include file (.tpl.php) for addressEditPanel.
3
+	// Remember that this is a DRAFT.  It is MEANT to be altered/modified.
4
+	// Be sure to move this out of the drafts/dashboard subdirectory before modifying to ensure that subsequent 
5
+	// code re-generations do not overwrite your changes.
6
+?>
7
+	<div id="formControls">
8
+		<?php $_CONTROL->lblId->RenderWithName(); ?>
9
+
10
+		<?php $_CONTROL->txtTitle->RenderWithName(); ?>
11
+
12
+		<?php $_CONTROL->lstPerson->RenderWithName(); ?>
13
+
14
+		<?php $_CONTROL->txtStreet1->RenderWithName(); ?>
15
+
16
+		<?php $_CONTROL->txtStreet2->RenderWithName(); ?>
17
+
18
+		<?php $_CONTROL->txtSuburb->RenderWithName(); ?>
19
+
20
+		<?php $_CONTROL->txtCity->RenderWithName(); ?>
21
+
22
+		<?php $_CONTROL->txtCounty->RenderWithName(); ?>
23
+
24
+		<?php $_CONTROL->lstZone->RenderWithName(); ?>
25
+
26
+		<?php $_CONTROL->lstCountry->RenderWithName(); ?>
27
+
28
+		<?php $_CONTROL->txtPostalCode->RenderWithName(); ?>
29
+
30
+		<?php $_CONTROL->chkIsCurrent->RenderWithName(); ?>
31
+
32
+		<?php $_CONTROL->lstType->RenderWithName(); ?>
33
+
34
+		<?php $_CONTROL->lblCreationDate->RenderWithName(); ?>
35
+
36
+		<?php $_CONTROL->lblLastModificationDate->RenderWithName(); ?>
37
+
38
+	</div>
39
+
40
+	<div id="formActions">
41
+		<div id="save"><?php $_CONTROL->btnSave->Render(); ?></div>
42
+		<div id="cancel"><?php $_CONTROL->btnCancel->Render(); ?></div>
43
+		<div id="delete"><?php $_CONTROL->btnDelete->Render(); ?></div>
44
+	</div>

+ 222
- 0
admin/AddressListPanel.class.php View File

@@ -0,0 +1,222 @@
1
+<?php
2
+	/**
3
+	 * This is the abstract Panel class for the List All functionality
4
+	 * of the Address class.  This code-generated class
5
+	 * contains a datagrid to display an HTML page that can
6
+	 * list a collection of Address objects.  It includes
7
+	 * functionality to perform pagination and sorting on columns.
8
+	 *
9
+	 * To take advantage of some (or all) of these control objects, you
10
+	 * must create a new QPanel which extends this AddressListPanelBase
11
+	 * class.
12
+	 *
13
+	 * Any and all changes to this file will be overwritten with any subsequent re-
14
+	 * code generation.
15
+	 * 
16
+	 * @package Quasi
17
+	 * @subpackage Drafts
18
+	 * 
19
+	 */
20
+	class AddressListPanel extends QPanel
21
+    {
22
+		
23
+        protected $strNameToFind;
24
+        protected $objAccount = null;
25
+        
26
+        // Callback Method Names
27
+        protected $strSetEditPanelMethod;
28
+        protected $strCloseEditPanelMethod;
29
+        
30
+        // Local instance of the Meta DataGrid to list Addresses
31
+		public $dtgAddresses;
32
+
33
+        public $lblMessage;
34
+        public $txtNameSearch;
35
+        public $txtNumberSearch;
36
+
37
+		// Other public QControls in this panel
38
+		public $btnCreateNew;
39
+		public $pxyEdit;
40
+
41
+		
42
+		public function __construct($objParentObject, $strSetEditPanelMethod, $strCloseEditPanelMethod, $strControlId = null) {
43
+			// Call the Parent
44
+			try {
45
+				parent::__construct($objParentObject, $strControlId);
46
+			} catch (QCallerException $objExc) {
47
+				$objExc->IncrementOffset();
48
+				throw $objExc;
49
+			}
50
+
51
+			// Record Method Callbacks
52
+			$this->strSetEditPanelMethod = $strSetEditPanelMethod;
53
+			$this->strCloseEditPanelMethod = $strCloseEditPanelMethod;
54
+
55
+			// Setup the Template
56
+			$this->Template = 'AddressListPanel.tpl.php';
57
+            
58
+            //messages (eg. Name not found ..)
59
+            $this->lblMessage = new QLabel($this);
60
+            
61
+            // a search field for Address by name ..
62
+            $this->txtNameSearch = new QTextBox($this);
63
+            $this->txtNameSearch->AddAction(new QEnterKeyEvent(), new QServerControlAction($this, 'txtNameSearch_Click'));
64
+            $this->txtNameSearch->Name = 'Search by Name:';
65
+
66
+            // a search field for Address by account number ..
67
+            $this->txtNumberSearch = new QIntegerTextBox($this);
68
+            $this->txtNumberSearch->AddAction(new QEnterKeyEvent(), new QServerControlAction($this, 'txtNumberSearch_Click'));
69
+            $this->txtNumberSearch->Name = 'Search by Number:';
70
+            $this->txtNumberSearch->CausesValidation = $this->txtNumberSearch;
71
+
72
+			// Instantiate the Meta DataGrid
73
+			$this->dtgAddresses = new AddressDataGrid($this);
74
+
75
+			// Style the DataGrid (if desired)
76
+			$this->dtgAddresses->CssClass = 'datagrid';
77
+			$this->dtgAddresses->AlternateRowStyle->CssClass = 'alternate';
78
+            $this->dtgAddresses->SetDataBinder('AddressDataBinder', $this);
79
+
80
+			// Add Pagination (if desired)
81
+			$this->dtgAddresses->Paginator = new QPaginator($this->dtgAddresses);
82
+			$this->dtgAddresses->ItemsPerPage = 8;
83
+
84
+			// Use the MetaDataGrid functionality to add Columns for this datagrid
85
+
86
+			// Create an Edit Column
87
+			$this->pxyEdit = new QControlProxy($this);
88
+			$this->pxyEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyEdit_Click'));
89
+			$this->dtgAddresses->MetaAddEditProxyColumn($this->pxyEdit, 'Edit', 'Edit');
90
+
91
+			// Create the Other Columns (note that you can use strings for address's properties, or you
92
+			// can traverse down QQN::address() to display fields that are down the hierarchy)
93
+			$this->dtgAddresses->MetaAddColumn('Id');
94
+			$this->dtgAddresses->MetaAddColumn('Title');
95
+			$this->dtgAddresses->MetaAddColumn(QQN::Address()->Person);
96
+			$this->dtgAddresses->MetaAddColumn('Street1');
97
+			$this->dtgAddresses->MetaAddColumn('Street2');
98
+			$this->dtgAddresses->MetaAddColumn('Suburb');
99
+			$this->dtgAddresses->MetaAddColumn('City');
100
+			$this->dtgAddresses->MetaAddColumn('County');
101
+			$this->dtgAddresses->MetaAddTypeColumn('ZoneId', 'ZoneType');
102
+			$this->dtgAddresses->MetaAddTypeColumn('CountryId', 'CountryType');
103
+			$this->dtgAddresses->MetaAddColumn('PostalCode');
104
+			$this->dtgAddresses->MetaAddColumn('IsCurrent');
105
+			$this->dtgAddresses->MetaAddTypeColumn('TypeId', 'AddressType');
106
+			$this->dtgAddresses->MetaAddColumn('CreationDate');
107
+			$this->dtgAddresses->MetaAddColumn('LastModificationDate');
108
+
109
+			// Setup the Create New button
110
+			$this->btnCreateNew = new QButton($this);
111
+			$this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('Address');
112
+			$this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click'));
113
+		}
114
+        public function txtNumberSearch_Click($strFormId, $strControlId, $strParameter)
115
+        {
116
+            $intAccountId = $this->txtNumberSearch->Text;
117
+            if( $this->objAccount = Account::Load($intAccountId) )
118
+            {
119
+                $this->lblMessage->Text = '';
120
+                $this->dtgAddresses->Refresh();
121
+            }
122
+            else
123
+                $this->lblMessage->Text = 'Account ' . $intAccountId . ' not found.';
124
+        }
125
+        
126
+        public function txtNameSearch_Click($strFormId, $strControlId, $strParameter)
127
+        {
128
+            $this->lblMessage->Text = '';
129
+            $this->strNameToFind =$this->txtNameSearch->Text;
130
+            $this->dtgAddresses->Refresh();
131
+        }
132
+        public function AddressDataBinder()
133
+        {
134
+            $aryClauses = array();
135
+            $aryConditions = array();
136
+            $aryPersonIds = array();
137
+            $objCondition = null;
138
+            
139
+            if ($objClause = $this->dtgAddresses->OrderByClause)
140
+                array_push($aryClauses, $objClause);
141
+
142
+            if ($objClause = $this->dtgAddresses->LimitClause)
143
+                array_push($aryClauses, $objClause);
144
+            
145
+            if($this->strNameToFind)
146
+            {
147
+                $aryNamesToFind = explode(' ', $this->txtNameSearch->Text);
148
+                $aryPersons = array();
149
+                if(sizeof($aryNamesToFind) > 1 )
150
+                {
151
+                    $aryPersons = Person::QueryArray(
152
+                                            QQ::AndCondition(
153
+                                                QQ::Like(QQN::Person()->FirstName, $aryNamesToFind[0]),
154
+                                                QQ::Like(QQN::Person()->LastName,  $aryNamesToFind[1])
155
+                                            )
156
+                                        );
157
+                }
158
+                elseif(sizeof($aryNamesToFind) == 1 )
159
+                {
160
+                    $aryPersons = Person::QueryArray(
161
+                                            QQ::OrCondition(
162
+                                                QQ::Like(QQN::Person()->FirstName, $this->txtNameSearch->Text),
163
+                                                QQ::Like(QQN::Person()->LastName, $this->txtNameSearch->Text)
164
+                                            )
165
+                                        );
166
+                }
167
+
168
+                foreach( $aryPersons as $objPerson )
169
+                    $aryPersonIds[] = $objPerson->Id;
170
+            }
171
+
172
+/*            if($this->intAddressStatusId )
173
+            {    
174
+                $this->dtgAddresses->TotalItemCount = Address::QueryCount(QQ::Equal(QQN::Address()->StatusId, $this->intAddressStatusId));
175
+                $aryAddresses = Address::QueryArray(QQ::Equal( QQN::Address()->StatusId, $this->intAddressStatusId), $aryClauses );
176
+            }*/
177
+            
178
+            if($this->objAccount )
179
+            {
180
+                $aryPersons = array();
181
+                $aryPersons = Person::QueryArray(
182
+                                        QQ::OrCondition(
183
+                                            QQ::Equal(QQN::Person()->Id, $this->objAccount->Person->Id),
184
+                                            QQ::Equal(QQN::Person()->OwnerPersonId, $this->objAccount->Person->Id)
185
+                                        )
186
+                                    );
187
+
188
+                
189
+                foreach( $aryPersons as $objPerson )
190
+                    $aryPersonIds[] = $objPerson->Id;
191
+                
192
+            }
193
+            if( count( $aryPersonIds) )
194
+                $aryConditions[] =  QQ::In( QQN::Address()->PersonId, $aryPersonIds);
195
+                 
196
+            if(count($aryConditions) > 1)
197
+                $objCondition = QQ::AndCondition($aryConditions);
198
+            elseif(count($aryConditions) == 1)
199
+                $objCondition = $aryConditions[0];
200
+            else
201
+                $objCondition = QQ::All();
202
+            
203
+            $this->dtgAddresses->TotalItemCount = Address::QueryCount($objCondition);
204
+            $aryAddresses = Address::QueryArray($objCondition, $aryClauses );
205
+            $this->dtgAddresses->DataSource = $aryAddresses;
206
+        }
207
+
208
+		public function pxyEdit_Click($strFormId, $strControlId, $strParameter) {
209
+			$strParameterArray = explode(',', $strParameter);
210
+			$objEditPanel = new AddressEditPanel($this, $this->strCloseEditPanelMethod, $strParameterArray[0]);
211
+
212
+			$strMethodName = $this->strSetEditPanelMethod;
213
+			$this->objForm->$strMethodName($objEditPanel);
214
+		}
215
+
216
+		public function btnCreateNew_Click($strFormId, $strControlId, $strParameter) {
217
+			$objEditPanel = new AddressEditPanel($this, $this->strCloseEditPanelMethod, null);
218
+			$strMethodName = $this->strSetEditPanelMethod;
219
+			$this->objForm->$strMethodName($objEditPanel);
220
+		}
221
+	}
222
+?>

+ 8
- 0
admin/AddressListPanel.tpl.php View File

@@ -0,0 +1,8 @@
1
+   <?php $_CONTROL->lblMessage->Render(); ?>
2
+   <?php $_CONTROL->txtNameSearch->RenderWithName(); ?>
3
+   <?php $_CONTROL->txtNumberSearch->RenderWithName(); ?>
4
+    <?php $_CONTROL->btnCreateNew->Render(); ?>
5
+    <br />
6
+    <br />
7
+    <hr>
8
+	<?php $_CONTROL->dtgAddresses->Render(); ?>

+ 121
- 0
admin/ContentBlockEditPanel.class.php View File

@@ -0,0 +1,121 @@
1
+<?php
2
+	/**
3
+	 * This is a quick-and-dirty draft QPanel object to do Create, Edit, and Delete functionality
4
+	 * of the ContentBlock class.  It uses the code-generated
5
+	 * ContentBlockMetaControl class, which has meta-methods to help with
6
+	 * easily creating/defining controls to modify the fields of a ContentBlock columns.
7
+	 *
8
+	 * Any display customizations and presentation-tier logic can be implemented
9
+	 * here by overriding existing or implementing new methods, properties and variables.
10
+	 * 
11
+	 * NOTE: This file is overwritten on any code regenerations.  If you want to make
12
+	 * permanent changes, it is STRONGLY RECOMMENDED to move both content_block_edit.php AND
13
+	 * content_block_edit.tpl.php out of this Form Drafts directory.
14
+	 *
15
+	 * @package Quasi
16
+	 * @subpackage Drafts
17
+	 */
18
+	class ContentBlockEditPanel extends QPanel {
19
+		// Local instance of the ContentBlockMetaControl
20
+		protected $mctContentBlock;
21
+
22
+		// Controls for ContentBlock's Data Fields
23
+		public $lblId;
24
+		public $txtName;
25
+		public $txtCssclass;
26
+		public $txtTitle;
27
+		public $txtDescription;
28
+		public $chkShowTitle;
29
+		public $chkShowDescription;
30
+		public $chkCollapsable;
31
+		public $txtSortOrder;
32
+		public $lstParentContentBlock;
33
+		public $lstLocation;
34
+
35
+		// Other ListBoxes (if applicable) via Unique ReverseReferences and ManyToMany References
36
+		public $lstPages;
37
+		public $lstContentItems;
38
+		public $lstMenus;
39
+
40
+		// Other Controls
41
+		public $btnSave;
42
+		public $btnDelete;
43
+		public $btnCancel;
44
+
45
+		// Callback
46
+		protected $strClosePanelMethod;
47
+
48
+		public function __construct($objParentObject, $strClosePanelMethod, $intId = null, $strControlId = null) {
49
+			// Call the Parent
50
+			try {
51
+				parent::__construct($objParentObject, $strControlId);
52
+			} catch (QCallerException $objExc) {
53
+				$objExc->IncrementOffset();
54
+				throw $objExc;
55
+			}
56
+
57
+			// Setup Callback and Template
58
+			$this->strTemplate = 'ContentBlockEditPanel.tpl.php';
59
+			$this->strClosePanelMethod = $strClosePanelMethod;
60
+
61
+			// Construct the ContentBlockMetaControl
62
+			// MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
63
+			$this->mctContentBlock = ContentBlockMetaControl::Create($this, $intId);
64
+
65
+			// Call MetaControl's methods to create qcontrols based on ContentBlock's data fields
66
+			$this->lblId = $this->mctContentBlock->lblId_Create();
67
+			$this->txtName = $this->mctContentBlock->txtName_Create();
68
+			$this->txtCssclass = $this->mctContentBlock->txtCssclass_Create();
69
+			$this->txtTitle = $this->mctContentBlock->txtTitle_Create();
70
+			$this->txtDescription = $this->mctContentBlock->txtDescription_Create();
71
+			$this->chkShowTitle = $this->mctContentBlock->chkShowTitle_Create();
72
+			$this->chkShowDescription = $this->mctContentBlock->chkShowDescription_Create();
73
+			$this->chkCollapsable = $this->mctContentBlock->chkCollapsable_Create();
74
+			$this->txtSortOrder = $this->mctContentBlock->txtSortOrder_Create();
75
+			$this->lstParentContentBlock = $this->mctContentBlock->lstParentContentBlock_Create();
76
+			$this->lstLocation = $this->mctContentBlock->lstLocation_Create();
77
+			$this->lstPages = $this->mctContentBlock->lstPages_Create();
78
+			$this->lstContentItems = $this->mctContentBlock->lstContentItems_Create();
79
+			$this->lstMenus = $this->mctContentBlock->lstMenus_Create();
80
+
81
+			// Create Buttons and Actions on this Form
82
+			$this->btnSave = new QButton($this);
83
+			$this->btnSave->Text = QApplication::Translate('Save');
84
+			$this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
85
+			$this->btnSave->CausesValidation = $this;
86
+
87
+			$this->btnCancel = new QButton($this);
88
+			$this->btnCancel->Text = QApplication::Translate('Cancel');
89
+			$this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
90
+
91
+			$this->btnDelete = new QButton($this);
92
+			$this->btnDelete->Text = QApplication::Translate('Delete');
93
+			$this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction(QApplication::Translate('Are you SURE you want to DELETE this') . ' ' . QApplication::Translate('ContentBlock') . '?'));
94
+			$this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
95
+			$this->btnDelete->Visible = $this->mctContentBlock->EditMode;
96
+		}
97
+
98
+		// Control AjaxAction Event Handlers
99
+		public function btnSave_Click($strFormId, $strControlId, $strParameter) {
100
+			// Delegate "Save" processing to the ContentBlockMetaControl
101
+			$this->mctContentBlock->SaveContentBlock();
102
+			$this->CloseSelf(true);
103
+		}
104
+
105
+		public function btnDelete_Click($strFormId, $strControlId, $strParameter) {
106
+			// Delegate "Delete" processing to the ContentBlockMetaControl
107
+			$this->mctContentBlock->DeleteContentBlock();
108
+			$this->CloseSelf(true);
109
+		}
110
+
111
+		public function btnCancel_Click($strFormId, $strControlId, $strParameter) {
112
+			$this->CloseSelf(false);
113
+		}
114
+
115
+		// Close Myself and Call ClosePanelMethod Callback
116
+		protected function CloseSelf($blnChangesMade) {
117
+			$strMethod = $this->strClosePanelMethod;
118
+			$this->objForm->$strMethod($blnChangesMade);
119
+		}
120
+	}
121
+?>

+ 42
- 0
admin/ContentBlockEditPanel.tpl.php View File

@@ -0,0 +1,42 @@
1
+<?php
2
+	// This is the HTML template include file (.tpl.php) for content_blockEditPanel.
3
+	// Remember that this is a DRAFT.  It is MEANT to be altered/modified.
4
+	// Be sure to move this out of the drafts/dashboard subdirectory before modifying to ensure that subsequent 
5
+	// code re-generations do not overwrite your changes.
6
+?>
7
+	<div id="formControls">
8
+		<?php $_CONTROL->lblId->RenderWithName(); ?>
9
+
10
+		<?php $_CONTROL->txtName->RenderWithName(); ?>
11
+
12
+		<?php $_CONTROL->txtCssclass->RenderWithName(); ?>
13
+
14
+		<?php $_CONTROL->txtTitle->RenderWithName(); ?>
15
+
16
+		<?php $_CONTROL->txtDescription->RenderWithName(); ?>
17
+
18
+		<?php $_CONTROL->chkShowTitle->RenderWithName(); ?>
19
+
20
+		<?php $_CONTROL->chkShowDescription->RenderWithName(); ?>
21
+
22
+		<?php $_CONTROL->chkCollapsable->RenderWithName(); ?>
23
+
24
+		<?php $_CONTROL->txtSortOrder->RenderWithName(); ?>
25
+
26
+		<?php $_CONTROL->lstParentContentBlock->RenderWithName(); ?>
27
+
28
+		<?php $_CONTROL->lstLocation->RenderWithName(); ?>
29
+
30
+		<?php $_CONTROL->lstPages->RenderWithName(true, "Rows=7"); ?>
31
+
32
+		<?php $_CONTROL->lstContentItems->RenderWithName(true, "Rows=7"); ?>
33
+
34
+		<?php $_CONTROL->lstMenus->RenderWithName(true, "Rows=7"); ?>
35
+
36
+	</div>
37
+
38
+	<div id="formActions">
39
+		<div id="save"><?php $_CONTROL->btnSave->Render(); ?></div>
40
+		<div id="cancel"><?php $_CONTROL->btnCancel->Render(); ?></div>
41
+		<div id="delete"><?php $_CONTROL->btnDelete->Render(); ?></div>
42
+	</div>

+ 100
- 0
admin/ContentBlockListPanel.class.php View File

@@ -0,0 +1,100 @@
1
+<?php
2
+	/**
3
+	 * This is the abstract Panel class for the List All functionality
4
+	 * of the ContentBlock class.  This code-generated class
5
+	 * contains a datagrid to display an HTML page that can
6
+	 * list a collection of ContentBlock objects.  It includes
7
+	 * functionality to perform pagination and sorting on columns.
8
+	 *
9
+	 * To take advantage of some (or all) of these control objects, you
10
+	 * must create a new QPanel which extends this ContentBlockListPanelBase
11
+	 * class.
12
+	 *
13
+	 * Any and all changes to this file will be overwritten with any subsequent re-
14
+	 * code generation.
15
+	 * 
16
+	 * @package Quasi
17
+	 * @subpackage Drafts
18
+	 * 
19
+	 */
20
+	class ContentBlockListPanel extends QPanel {
21
+		// Local instance of the Meta DataGrid to list ContentBlocks
22
+		public $dtgContentBlocks;
23
+
24
+		// Other public QControls in this panel
25
+		public $btnCreateNew;
26
+		public $pxyEdit;
27
+
28
+		// Callback Method Names
29
+		protected $strSetEditPanelMethod;
30
+		protected $strCloseEditPanelMethod;
31
+		
32
+		public function __construct($objParentObject, $strSetEditPanelMethod, $strCloseEditPanelMethod, $strControlId = null) {
33
+			// Call the Parent
34
+			try {
35
+				parent::__construct($objParentObject, $strControlId);
36
+			} catch (QCallerException $objExc) {
37
+				$objExc->IncrementOffset();
38
+				throw $objExc;
39
+			}
40
+
41
+			// Record Method Callbacks
42
+			$this->strSetEditPanelMethod = $strSetEditPanelMethod;
43
+			$this->strCloseEditPanelMethod = $strCloseEditPanelMethod;
44
+
45
+			// Setup the Template
46
+			$this->Template = 'ContentBlockListPanel.tpl.php';
47
+
48
+			// Instantiate the Meta DataGrid
49
+			$this->dtgContentBlocks = new ContentBlockDataGrid($this);
50
+
51
+			// Style the DataGrid (if desired)
52
+			$this->dtgContentBlocks->CssClass = 'datagrid';
53
+			$this->dtgContentBlocks->AlternateRowStyle->CssClass = 'alternate';
54
+
55
+			// Add Pagination (if desired)
56
+			$this->dtgContentBlocks->Paginator = new QPaginator($this->dtgContentBlocks);
57
+			$this->dtgContentBlocks->ItemsPerPage = 8;
58
+
59
+			// Use the MetaDataGrid functionality to add Columns for this datagrid
60
+
61
+			// Create an Edit Column
62
+			$this->pxyEdit = new QControlProxy($this);
63
+			$this->pxyEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyEdit_Click'));
64
+			$this->dtgContentBlocks->MetaAddEditProxyColumn($this->pxyEdit, 'Edit', 'Edit');
65
+
66
+			// Create the Other Columns (note that you can use strings for content_block's properties, or you
67
+			// can traverse down QQN::content_block() to display fields that are down the hierarchy)
68
+			$this->dtgContentBlocks->MetaAddColumn('Id');
69
+			$this->dtgContentBlocks->MetaAddColumn('Name');
70
+			$this->dtgContentBlocks->MetaAddColumn('Cssclass');
71
+			$this->dtgContentBlocks->MetaAddColumn('Title');
72
+			$this->dtgContentBlocks->MetaAddColumn('Description');
73
+			$this->dtgContentBlocks->MetaAddColumn('ShowTitle');
74
+			$this->dtgContentBlocks->MetaAddColumn('ShowDescription');
75
+			$this->dtgContentBlocks->MetaAddColumn('Collapsable');
76
+			$this->dtgContentBlocks->MetaAddColumn('SortOrder');
77
+			$this->dtgContentBlocks->MetaAddColumn(QQN::ContentBlock()->ParentContentBlock);
78
+			$this->dtgContentBlocks->MetaAddTypeColumn('LocationId', 'BlockLocationType');
79
+
80
+			// Setup the Create New button
81
+			$this->btnCreateNew = new QButton($this);
82
+			$this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('ContentBlock');
83
+			$this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click'));
84
+		}
85
+
86
+		public function pxyEdit_Click($strFormId, $strControlId, $strParameter) {
87
+			$strParameterArray = explode(',', $strParameter);
88
+			$objEditPanel = new ContentBlockEditPanel($this, $this->strCloseEditPanelMethod, $strParameterArray[0]);
89
+
90
+			$strMethodName = $this->strSetEditPanelMethod;
91
+			$this->objForm->$strMethodName($objEditPanel);
92
+		}
93
+
94
+		public function btnCreateNew_Click($strFormId, $strControlId, $strParameter) {
95
+			$objEditPanel = new ContentBlockEditPanel($this, $this->strCloseEditPanelMethod, null);
96
+			$strMethodName = $this->strSetEditPanelMethod;
97
+			$this->objForm->$strMethodName($objEditPanel);
98
+		}
99
+	}
100
+?>

+ 8
- 0
admin/ContentBlockListPanel.tpl.php View File

@@ -0,0 +1,8 @@
1
+<?php
2
+	// This is the HTML template include file (.tpl.php) for ContentBlockListPanel.
3
+	// Remember that this is a DRAFT.  It is MEANT to be altered/modified.
4
+	// Be sure to move this out of the drafts/dashboard directory before modifying to ensure that subsequent 
5
+	// code re-generations do not overwrite your changes.
6
+?>
7
+	<?php $_CONTROL->dtgContentBlocks->Render(); ?>
8
+	<p><?php $_CONTROL->btnCreateNew->Render(); ?></p>

+ 115
- 0
admin/ContentCategoryEditPanel.class.php View File

@@ -0,0 +1,115 @@
1
+<?php
2
+	/**
3
+	 * This is a quick-and-dirty draft QPanel object to do Create, Edit, and Delete functionality
4
+	 * of the ContentCategory class.  It uses the code-generated
5
+	 * ContentCategoryMetaControl class, which has meta-methods to help with
6
+	 * easily creating/defining controls to modify the fields of a ContentCategory columns.
7
+	 *
8
+	 * Any display customizations and presentation-tier logic can be implemented
9
+	 * here by overriding existing or implementing new methods, properties and variables.
10
+	 * 
11
+	 * NOTE: This file is overwritten on any code regenerations.  If you want to make
12
+	 * permanent changes, it is STRONGLY RECOMMENDED to move both content_category_edit.php AND
13
+	 * content_category_edit.tpl.php out of this Form Drafts directory.
14
+	 *
15
+	 * @package Quasi
16
+	 * @subpackage Drafts
17
+	 */
18
+	class ContentCategoryEditPanel extends QPanel {
19
+		// Local instance of the ContentCategoryMetaControl
20
+		protected $mctContentCategory;
21
+
22
+		// Controls for ContentCategory's Data Fields
23
+		public $lblId;
24
+		public $txtName;
25
+		public $txtTitle;
26
+		public $txtDescription;
27
+		public $txtImageUri;
28
+		public $lstParentContentCategory;
29
+		public $lstPublicPermissions;
30
+		public $lstUserPermissions;
31
+		public $lstGroupPermissions;
32
+
33
+		// Other ListBoxes (if applicable) via Unique ReverseReferences and ManyToMany References
34
+		public $lstContentItems;
35
+		public $lstPages;
36
+
37
+		// Other Controls
38
+		public $btnSave;
39
+		public $btnDelete;
40
+		public $btnCancel;
41
+
42
+		// Callback
43
+		protected $strClosePanelMethod;
44
+
45
+		public function __construct($objParentObject, $strClosePanelMethod, $intId = null, $strControlId = null) {
46
+			// Call the Parent
47
+			try {
48
+				parent::__construct($objParentObject, $strControlId);
49
+			} catch (QCallerException $objExc) {
50
+				$objExc->IncrementOffset();
51
+				throw $objExc;
52
+			}
53
+
54
+			// Setup Callback and Template
55
+			$this->strTemplate = 'ContentCategoryEditPanel.tpl.php';
56
+			$this->strClosePanelMethod = $strClosePanelMethod;
57
+
58
+			// Construct the ContentCategoryMetaControl
59
+			// MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
60
+			$this->mctContentCategory = ContentCategoryMetaControl::Create($this, $intId);
61
+
62
+			// Call MetaControl's methods to create qcontrols based on ContentCategory's data fields
63
+			$this->lblId = $this->mctContentCategory->lblId_Create();
64
+			$this->txtName = $this->mctContentCategory->txtName_Create();
65
+			$this->txtTitle = $this->mctContentCategory->txtTitle_Create();
66
+			$this->txtDescription = $this->mctContentCategory->txtDescription_Create();
67
+			$this->txtImageUri = $this->mctContentCategory->txtImageUri_Create();
68
+			$this->lstParentContentCategory = $this->mctContentCategory->lstParentContentCategory_Create();
69
+			$this->lstPublicPermissions = $this->mctContentCategory->lstPublicPermissions_Create();
70
+			$this->lstUserPermissions = $this->mctContentCategory->lstUserPermissions_Create();
71
+			$this->lstGroupPermissions = $this->mctContentCategory->lstGroupPermissions_Create();
72
+			$this->lstContentItems = $this->mctContentCategory->lstContentItems_Create();
73
+			$this->lstPages = $this->mctContentCategory->lstPages_Create();
74
+
75
+			// Create Buttons and Actions on this Form
76
+			$this->btnSave = new QButton($this);
77
+			$this->btnSave->Text = QApplication::Translate('Save');
78
+			$this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
79
+			$this->btnSave->CausesValidation = $this;
80
+
81
+			$this->btnCancel = new QButton($this);
82
+			$this->btnCancel->Text = QApplication::Translate('Cancel');
83
+			$this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
84
+
85
+			$this->btnDelete = new QButton($this);
86
+			$this->btnDelete->Text = QApplication::Translate('Delete');
87
+			$this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction(QApplication::Translate('Are you SURE you want to DELETE this') . ' ' . QApplication::Translate('ContentCategory') . '?'));
88
+			$this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
89
+			$this->btnDelete->Visible = $this->mctContentCategory->EditMode;
90
+		}
91
+
92
+		// Control AjaxAction Event Handlers
93
+		public function btnSave_Click($strFormId, $strControlId, $strParameter) {
94
+			// Delegate "Save" processing to the ContentCategoryMetaControl
95
+			$this->mctContentCategory->SaveContentCategory();
96
+			$this->CloseSelf(true);
97
+		}
98
+
99
+		public function btnDelete_Click($strFormId, $strControlId, $strParameter) {
100
+			// Delegate "Delete" processing to the ContentCategoryMetaControl
101
+			$this->mctContentCategory->DeleteContentCategory();
102
+			$this->CloseSelf(true);
103
+		}
104
+
105
+		public function btnCancel_Click($strFormId, $strControlId, $strParameter) {
106
+			$this->CloseSelf(false);
107
+		}
108
+
109
+		// Close Myself and Call ClosePanelMethod Callback
110
+		protected function CloseSelf($blnChangesMade) {
111
+			$strMethod = $this->strClosePanelMethod;
112
+			$this->objForm->$strMethod($blnChangesMade);
113
+		}
114
+	}
115
+?>

+ 36
- 0
admin/ContentCategoryEditPanel.tpl.php View File

@@ -0,0 +1,36 @@
1
+<?php
2
+	// This is the HTML template include file (.tpl.php) for content_categoryEditPanel.
3
+	// Remember that this is a DRAFT.  It is MEANT to be altered/modified.
4
+	// Be sure to move this out of the drafts/dashboard subdirectory before modifying to ensure that subsequent 
5
+	// code re-generations do not overwrite your changes.
6
+?>
7
+	<div id="formControls">
8
+		<?php $_CONTROL->lblId->RenderWithName(); ?>
9
+
10
+		<?php $_CONTROL->txtName->RenderWithName(); ?>
11
+
12
+		<?php $_CONTROL->txtTitle->RenderWithName(); ?>
13
+
14
+		<?php $_CONTROL->txtDescription->RenderWithName(); ?>
15
+
16
+		<?php $_CONTROL->txtImageUri->RenderWithName(); ?>
17
+
18
+		<?php $_CONTROL->lstParentContentCategory->RenderWithName(); ?>
19
+
20
+		<?php $_CONTROL->lstPublicPermissions->RenderWithName(); ?>
21
+
22
+		<?php $_CONTROL->lstUserPermissions->RenderWithName(); ?>
23
+
24
+		<?php $_CONTROL->lstGroupPermissions->RenderWithName(); ?>
25
+
26
+		<?php $_CONTROL->lstContentItems->RenderWithName(true, "Rows=7"); ?>
27
+
28
+		<?php $_CONTROL->lstPages->RenderWithName(true, "Rows=7"); ?>
29
+
30
+	</div>
31
+
32
+	<div id="formActions">
33
+		<div id="save"><?php $_CONTROL->btnSave->Render(); ?></div>
34
+		<div id="cancel"><?php $_CONTROL->btnCancel->Render(); ?></div>
35
+		<div id="delete"><?php $_CONTROL->btnDelete->Render(); ?></div>
36
+	</div>

+ 98
- 0
admin/ContentCategoryListPanel.class.php View File

@@ -0,0 +1,98 @@
1
+<?php
2
+	/**
3
+	 * This is the abstract Panel class for the List All functionality
4
+	 * of the ContentCategory class.  This code-generated class
5
+	 * contains a datagrid to display an HTML page that can
6
+	 * list a collection of ContentCategory objects.  It includes
7
+	 * functionality to perform pagination and sorting on columns.
8
+	 *
9
+	 * To take advantage of some (or all) of these control objects, you
10
+	 * must create a new QPanel which extends this ContentCategoryListPanelBase
11
+	 * class.
12
+	 *
13
+	 * Any and all changes to this file will be overwritten with any subsequent re-
14
+	 * code generation.
15
+	 * 
16
+	 * @package Quasi
17
+	 * @subpackage Drafts
18
+	 * 
19
+	 */
20
+	class ContentCategoryListPanel extends QPanel {
21
+		// Local instance of the Meta DataGrid to list ContentCategories
22
+		public $dtgContentCategories;
23
+
24
+		// Other public QControls in this panel
25
+		public $btnCreateNew;
26
+		public $pxyEdit;
27
+
28
+		// Callback Method Names
29
+		protected $strSetEditPanelMethod;
30
+		protected $strCloseEditPanelMethod;
31
+		
32
+		public function __construct($objParentObject, $strSetEditPanelMethod, $strCloseEditPanelMethod, $strControlId = null) {
33
+			// Call the Parent
34
+			try {
35
+				parent::__construct($objParentObject, $strControlId);
36
+			} catch (QCallerException $objExc) {
37
+				$objExc->IncrementOffset();
38
+				throw $objExc;
39
+			}
40
+
41
+			// Record Method Callbacks
42
+			$this->strSetEditPanelMethod = $strSetEditPanelMethod;
43
+			$this->strCloseEditPanelMethod = $strCloseEditPanelMethod;
44
+
45
+			// Setup the Template
46
+			$this->Template = 'ContentCategoryListPanel.tpl.php';
47
+
48
+			// Instantiate the Meta DataGrid
49
+			$this->dtgContentCategories = new ContentCategoryDataGrid($this);
50
+
51
+			// Style the DataGrid (if desired)
52
+			$this->dtgContentCategories->CssClass = 'datagrid';
53
+			$this->dtgContentCategories->AlternateRowStyle->CssClass = 'alternate';
54
+
55
+			// Add Pagination (if desired)
56
+			$this->dtgContentCategories->Paginator = new QPaginator($this->dtgContentCategories);
57
+			$this->dtgContentCategories->ItemsPerPage = 8;
58
+
59
+			// Use the MetaDataGrid functionality to add Columns for this datagrid
60
+
61
+			// Create an Edit Column
62
+			$this->pxyEdit = new QControlProxy($this);
63
+			$this->pxyEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyEdit_Click'));
64
+			$this->dtgContentCategories->MetaAddEditProxyColumn($this->pxyEdit, 'Edit', 'Edit');
65
+
66
+			// Create the Other Columns (note that you can use strings for content_category's properties, or you
67
+			// can traverse down QQN::content_category() to display fields that are down the hierarchy)
68
+			$this->dtgContentCategories->MetaAddColumn('Id');
69
+			$this->dtgContentCategories->MetaAddColumn('Name');
70
+			$this->dtgContentCategories->MetaAddColumn('Title');
71
+			$this->dtgContentCategories->MetaAddColumn('Description');
72
+			$this->dtgContentCategories->MetaAddColumn('ImageUri');
73
+			$this->dtgContentCategories->MetaAddColumn(QQN::ContentCategory()->ParentContentCategory);
74
+			$this->dtgContentCategories->MetaAddTypeColumn('PublicPermissionsId', 'PermissionType');
75
+			$this->dtgContentCategories->MetaAddTypeColumn('UserPermissionsId', 'PermissionType');
76
+			$this->dtgContentCategories->MetaAddTypeColumn('GroupPermissionsId', 'PermissionType');
77
+
78
+			// Setup the Create New button
79
+			$this->btnCreateNew = new QButton($this);
80
+			$this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('ContentCategory');
81
+			$this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click'));
82
+		}
83
+
84
+		public function pxyEdit_Click($strFormId, $strControlId, $strParameter) {
85
+			$strParameterArray = explode(',', $strParameter);
86
+			$objEditPanel = new ContentCategoryEditPanel($this, $this->strCloseEditPanelMethod, $strParameterArray[0]);
87
+
88
+			$strMethodName = $this->strSetEditPanelMethod;
89
+			$this->objForm->$strMethodName($objEditPanel);
90
+		}
91
+
92
+		public function btnCreateNew_Click($strFormId, $strControlId, $strParameter) {
93
+			$objEditPanel = new ContentCategoryEditPanel($this, $this->strCloseEditPanelMethod, null);
94
+			$strMethodName = $this->strSetEditPanelMethod;
95
+			$this->objForm->$strMethodName($objEditPanel);
96
+		}
97
+	}
98
+?>

+ 8
- 0
admin/ContentCategoryListPanel.tpl.php View File

@@ -0,0 +1,8 @@
1
+<?php
2
+	// This is the HTML template include file (.tpl.php) for ContentCategoryListPanel.
3
+	// Remember that this is a DRAFT.  It is MEANT to be altered/modified.
4
+	// Be sure to move this out of the drafts/dashboard directory before modifying to ensure that subsequent 
5
+	// code re-generations do not overwrite your changes.
6
+?>
7
+	<?php $_CONTROL->dtgContentCategories->Render(); ?>
8
+	<p><?php $_CONTROL->btnCreateNew->Render(); ?></p>

+ 147
- 0
admin/ContentItemEditPanel.class.php View File

@@ -0,0 +1,147 @@
1
+<?php
2
+	/**
3
+	 * This is a quick-and-dirty draft QPanel object to do Create, Edit, and Delete functionality
4
+	 * of the ContentItem class.  It uses the code-generated
5
+	 * ContentItemMetaControl class, which has meta-methods to help with
6
+	 * easily creating/defining controls to modify the fields of a ContentItem columns.
7
+	 *
8
+	 * Any display customizations and presentation-tier logic can be implemented
9
+	 * here by overriding existing or implementing new methods, properties and variables.
10
+	 * 
11
+	 * NOTE: This file is overwritten on any code regenerations.  If you want to make
12
+	 * permanent changes, it is STRONGLY RECOMMENDED to move both content_item_edit.php AND
13
+	 * content_item_edit.tpl.php out of this Form Drafts directory.
14
+	 *
15
+	 * @package Quasi
16
+	 * @subpackage Drafts
17
+	 */
18
+	class ContentItemEditPanel extends QPanel {
19
+		// Local instance of the ContentItemMetaControl
20
+		protected $mctContentItem;
21
+
22
+		// Controls for ContentItem's Data Fields
23
+		public $lblId;
24
+		public $txtName;
25
+		public $txtCssclass;
26
+		public $txtTitle;
27
+		public $txtDescription;
28
+		public $txtText;
29
+		public $txtSortOrder;
30
+		public $chkShowTitle;
31
+		public $chkShowDescription;
32
+		public $chkShowCreator;
33
+		public $chkShowCreationDate;
34
+		public $chkShowLastModification;
35
+		public $lblCreatorId;
36
+		public $txtCopyrightNotice;
37
+		public $lblCreationDate;
38
+		public $lblLastModification;
39
+		public $lstPublicPermissions;
40
+		public $lstUserPermissions;
41
+		public $lstGroupPermissions;
42
+		public $lstType;
43
+		public $lstStatus;
44
+
45
+		// Other ListBoxes (if applicable) via Unique ReverseReferences and ManyToMany References
46
+		public $lstContentBlocks;
47
+		public $lstContentCategories;
48
+		public $lstUsergroups;
49
+
50
+		// Other Controls
51
+		public $btnSave;
52
+		public $btnDelete;
53
+		public $btnCancel;
54
+
55
+		// Callback
56
+		protected $strClosePanelMethod;
57
+
58
+		public function __construct($objParentObject, $strClosePanelMethod, $intId = null, $strControlId = null) {
59
+			// Call the Parent
60
+			try {
61
+				parent::__construct($objParentObject, $strControlId);
62
+			} catch (QCallerException $objExc) {
63
+				$objExc->IncrementOffset();
64
+				throw $objExc;
65
+			}
66
+
67
+			// Setup Callback and Template
68
+			$this->strTemplate = 'ContentItemEditPanel.tpl.php';
69
+			$this->strClosePanelMethod = $strClosePanelMethod;
70
+
71
+			// Construct the ContentItemMetaControl
72
+			// MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
73
+			$this->mctContentItem = ContentItemMetaControl::Create($this, $intId);
74
+
75
+			// Call MetaControl's methods to create qcontrols based on ContentItem's data fields
76
+			$this->lblId = $this->mctContentItem->lblId_Create();
77
+			$this->txtName = $this->mctContentItem->txtName_Create();
78
+			$this->txtCssclass = $this->mctContentItem->txtCssclass_Create();
79
+			$this->txtTitle = $this->mctContentItem->txtTitle_Create();
80
+			$this->txtDescription = $this->mctContentItem->txtDescription_Create();
81
+			$this->txtText = $this->mctContentItem->txtText_Create();
82
+			$this->txtSortOrder = $this->mctContentItem->txtSortOrder_Create();
83
+			$this->chkShowTitle = $this->mctContentItem->chkShowTitle_Create();
84
+			$this->chkShowDescription = $this->mctContentItem->chkShowDescription_Create();
85
+			$this->chkShowCreator = $this->mctContentItem->chkShowCreator_Create();
86
+			$this->chkShowCreationDate = $this->mctContentItem->chkShowCreationDate_Create();
87
+			$this->chkShowLastModification = $this->mctContentItem->chkShowLastModification_Create();
88
+			$this->lblCreatorId = $this->mctContentItem->lblCreatorId_Create();
89
+			$this->txtCopyrightNotice = $this->mctContentItem->txtCopyrightNotice_Create();
90
+			$this->lblCreationDate = $this->mctContentItem->lblCreationDate_Create();
91
+			$this->lblLastModification = $this->mctContentItem->lblLastModification_Create();
92
+			$this->lstPublicPermissions = $this->mctContentItem->lstPublicPermissions_Create();
93
+			$this->lstUserPermissions = $this->mctContentItem->lstUserPermissions_Create();
94
+			$this->lstGroupPermissions = $this->mctContentItem->lstGroupPermissions_Create();
95
+			$this->lstType = $this->mctContentItem->lstType_Create();
96
+			$this->lstStatus = $this->mctContentItem->lstStatus_Create();
97
+			$this->lstContentBlocks = $this->mctContentItem->lstContentBlocks_Create();
98
+			$this->lstContentCategories = $this->mctContentItem->lstContentCategories_Create();
99
+			$this->lstUsergroups = $this->mctContentItem->lstUsergroups_Create();
100
+
101
+			// Create Buttons and Actions on this Form
102
+			$this->btnSave = new QButton($this);
103
+			$this->btnSave->Text = QApplication::Translate('Save');
104
+            $this->btnSave->AddAction(new QClickEvent(), new QJavaScriptAction('tinyMCE.triggerSave();'));
105
+			$this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
106
+			$this->btnSave->CausesValidation = $this;
107
+
108
+			$this->btnCancel = new QButton($this);
109
+			$this->btnCancel->Text = QApplication::Translate('Cancel');
110
+			$this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
111
+
112
+			$this->btnDelete = new QButton($this);
113
+			$this->btnDelete->Text = QApplication::Translate('Delete');
114
+			$this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction(QApplication::Translate('Are you SURE you want to DELETE this') . ' ' . QApplication::Translate('ContentItem') . '?'));
115
+			$this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
116
+			$this->btnDelete->Visible = $this->mctContentItem->EditMode;
117
+            
118
+            QApplication::ExecuteJavaScript('tinyMCE.init({
119
+                mode : "textareas",
120
+                theme : "advanced",
121
+                });');
122
+		}
123
+
124
+		// Control AjaxAction Event Handlers
125
+		public function btnSave_Click($strFormId, $strControlId, $strParameter) {
126
+			// Delegate "Save" processing to the ContentItemMetaControl
127
+			$this->mctContentItem->SaveContentItem();
128
+			$this->CloseSelf(true);
129
+		}
130
+
131
+		public function btnDelete_Click($strFormId, $strControlId, $strParameter) {
132
+			// Delegate "Delete" processing to the ContentItemMetaControl
133
+			$this->mctContentItem->DeleteContentItem();
134
+			$this->CloseSelf(true);
135
+		}
136
+
137
+		public function btnCancel_Click($strFormId, $strControlId, $strParameter) {
138
+			$this->CloseSelf(false);
139
+		}
140
+
141
+		// Close Myself and Call ClosePanelMethod Callback
142
+		protected function CloseSelf($blnChangesMade) {
143
+			$strMethod = $this->strClosePanelMethod;
144
+			$this->objForm->$strMethod($blnChangesMade);
145
+		}
146
+	}
147
+?>

+ 62
- 0
admin/ContentItemEditPanel.tpl.php View File

@@ -0,0 +1,62 @@
1
+<?php
2
+	// This is the HTML template include file (.tpl.php) for content_itemEditPanel.
3
+	// Remember that this is a DRAFT.  It is MEANT to be altered/modified.
4
+	// Be sure to move this out of the drafts/dashboard subdirectory before modifying to ensure that subsequent 
5
+	// code re-generations do not overwrite your changes.
6
+?>
7
+	<div id="formControls">
8
+		<?php $_CONTROL->lblId->RenderWithName(); ?>
9
+
10
+		<?php $_CONTROL->txtName->RenderWithName(); ?>
11
+
12
+		<?php $_CONTROL->txtCssclass->RenderWithName(); ?>
13
+
14
+		<?php $_CONTROL->txtTitle->RenderWithName(); ?>
15
+
16
+		<?php $_CONTROL->txtDescription->RenderWithName(); ?>
17
+
18
+		<?php $_CONTROL->txtText->RenderWithName(); ?>
19
+
20
+		<?php $_CONTROL->txtSortOrder->RenderWithName(); ?>
21
+
22
+		<?php $_CONTROL->chkShowTitle->RenderWithName(); ?>
23
+
24
+		<?php $_CONTROL->chkShowDescription->RenderWithName(); ?>
25
+
26
+		<?php $_CONTROL->chkShowCreator->RenderWithName(); ?>
27
+
28
+		<?php $_CONTROL->chkShowCreationDate->RenderWithName(); ?>
29
+
30
+		<?php $_CONTROL->chkShowLastModification->RenderWithName(); ?>
31
+
32
+		<?php $_CONTROL->lblCreatorId->RenderWithName(); ?>
33
+
34
+		<?php $_CONTROL->txtCopyrightNotice->RenderWithName(); ?>
35
+
36
+		<?php $_CONTROL->lblCreationDate->RenderWithName(); ?>
37
+
38
+		<?php $_CONTROL->lblLastModification->RenderWithName(); ?>
39
+
40
+		<?php $_CONTROL->lstPublicPermissions->RenderWithName(); ?>
41
+
42
+		<?php $_CONTROL->lstUserPermissions->RenderWithName(); ?>
43
+
44
+		<?php $_CONTROL->lstGroupPermissions->RenderWithName(); ?>
45
+
46
+		<?php $_CONTROL->lstType->RenderWithName(); ?>
47
+
48
+		<?php $_CONTROL->lstStatus->RenderWithName(); ?>
49
+
50
+		<?php $_CONTROL->lstContentBlocks->RenderWithName(true, "Rows=7"); ?>
51
+
52
+		<?php $_CONTROL->lstContentCategories->RenderWithName(true, "Rows=7"); ?>
53
+
54
+		<?php $_CONTROL->lstUsergroups->RenderWithName(true, "Rows=7"); ?>
55
+
56
+	</div>
57
+
58
+	<div id="formActions">
59
+		<div id="save"><?php $_CONTROL->btnSave->Render(); ?></div>
60
+		<div id="cancel"><?php $_CONTROL->btnCancel->Render(); ?></div>
61
+		<div id="delete"><?php $_CONTROL->btnDelete->Render(); ?></div>
62
+	</div>

+ 110
- 0
admin/ContentItemListPanel.class.php View File

@@ -0,0 +1,110 @@
1
+<?php
2
+	/**
3
+	 * This is the abstract Panel class for the List All functionality
4
+	 * of the ContentItem class.  This code-generated class
5
+	 * contains a datagrid to display an HTML page that can
6
+	 * list a collection of ContentItem objects.  It includes
7
+	 * functionality to perform pagination and sorting on columns.
8
+	 *
9
+	 * To take advantage of some (or all) of these control objects, you
10
+	 * must create a new QPanel which extends this ContentItemListPanelBase
11
+	 * class.
12
+	 *
13
+	 * Any and all changes to this file will be overwritten with any subsequent re-
14
+	 * code generation.
15
+	 * 
16
+	 * @package Quasi
17
+	 * @subpackage Drafts
18
+	 * 
19
+	 */
20
+	class ContentItemListPanel extends QPanel {
21
+		// Local instance of the Meta DataGrid to list ContentItems
22
+		public $dtgContentItems;
23
+
24
+		// Other public QControls in this panel
25
+		public $btnCreateNew;
26
+		public $pxyEdit;
27
+
28
+		// Callback Method Names
29
+		protected $strSetEditPanelMethod;
30
+		protected $strCloseEditPanelMethod;
31
+		
32
+		public function __construct($objParentObject, $strSetEditPanelMethod, $strCloseEditPanelMethod, $strControlId = null) {
33
+			// Call the Parent
34
+			try {
35
+				parent::__construct($objParentObject, $strControlId);
36
+			} catch (QCallerException $objExc) {
37
+				$objExc->IncrementOffset();
38
+				throw $objExc;
39
+			}
40
+
41
+			// Record Method Callbacks
42
+			$this->strSetEditPanelMethod = $strSetEditPanelMethod;
43
+			$this->strCloseEditPanelMethod = $strCloseEditPanelMethod;
44
+
45
+			// Setup the Template
46
+			$this->Template = 'ContentItemListPanel.tpl.php';
47
+
48
+			// Instantiate the Meta DataGrid
49
+			$this->dtgContentItems = new ContentItemDataGrid($this);
50
+
51
+			// Style the DataGrid (if desired)
52
+			$this->dtgContentItems->CssClass = 'datagrid';
53
+			$this->dtgContentItems->AlternateRowStyle->CssClass = 'alternate';
54
+
55
+			// Add Pagination (if desired)
56
+			$this->dtgContentItems->Paginator = new QPaginator($this->dtgContentItems);
57
+			$this->dtgContentItems->ItemsPerPage = 20;
58
+
59
+			// Use the MetaDataGrid functionality to add Columns for this datagrid
60
+
61
+			// Create an Edit Column
62
+			$this->pxyEdit = new QControlProxy($this);
63
+			$this->pxyEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyEdit_Click'));
64
+			$this->dtgContentItems->MetaAddEditProxyColumn($this->pxyEdit, 'Edit', 'Edit');
65
+
66
+			// Create the Other Columns (note that you can use strings for content_item's properties, or you
67
+			// can traverse down QQN::content_item() to display fields that are down the hierarchy)
68
+			$this->dtgContentItems->MetaAddColumn('Id');
69
+			$this->dtgContentItems->MetaAddColumn('Name');
70
+			$this->dtgContentItems->MetaAddColumn('Cssclass');
71
+			$this->dtgContentItems->MetaAddColumn('Title');
72
+			$this->dtgContentItems->MetaAddColumn('Description');
73
+/*			$this->dtgContentItems->MetaAddColumn('Text');
74
+			$this->dtgContentItems->MetaAddColumn('SortOrder');
75
+			$this->dtgContentItems->MetaAddColumn('ShowTitle');
76
+			$this->dtgContentItems->MetaAddColumn('ShowDescription');
77
+			$this->dtgContentItems->MetaAddColumn('ShowCreator');
78
+			$this->dtgContentItems->MetaAddColumn('ShowCreationDate');
79
+			$this->dtgContentItems->MetaAddColumn('ShowLastModification');*/
80
+			$this->dtgContentItems->MetaAddColumn(QQN::ContentItem()->Creator);
81
+//			$this->dtgContentItems->MetaAddColumn('CopyrightNotice');
82
+			$this->dtgContentItems->MetaAddColumn('CreationDate');
83
+			$this->dtgContentItems->MetaAddColumn('LastModification');
84
+/*			$this->dtgContentItems->MetaAddTypeColumn('PublicPermissionsId', 'PermissionType');
85
+			$this->dtgContentItems->MetaAddTypeColumn('UserPermissionsId', 'PermissionType');
86
+			$this->dtgContentItems->MetaAddTypeColumn('GroupPermissionsId', 'PermissionType');*/
87
+			$this->dtgContentItems->MetaAddTypeColumn('TypeId', 'ContentType');
88
+			$this->dtgContentItems->MetaAddTypeColumn('StatusId', 'ContentStatusType');
89
+
90
+			// Setup the Create New button
91
+			$this->btnCreateNew = new QButton($this);
92
+			$this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('ContentItem');
93
+			$this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click'));
94
+		}
95
+
96
+		public function pxyEdit_Click($strFormId, $strControlId, $strParameter) {
97
+			$strParameterArray = explode(',', $strParameter);
98
+			$objEditPanel = new ContentItemEditPanel($this, $this->strCloseEditPanelMethod, $strParameterArray[0]);
99
+
100
+			$strMethodName = $this->strSetEditPanelMethod;
101
+			$this->objForm->$strMethodName($objEditPanel);
102
+		}
103
+
104
+		public function btnCreateNew_Click($strFormId, $strControlId, $strParameter) {
105
+			$objEditPanel = new ContentItemEditPanel($this, $this->strCloseEditPanelMethod, null);
106
+			$strMethodName = $this->strSetEditPanelMethod;
107
+			$this->objForm->$strMethodName($objEditPanel);
108
+		}
109
+	}
110
+?>

+ 8
- 0
admin/ContentItemListPanel.tpl.php View File

@@ -0,0 +1,8 @@
1
+<?php
2
+	// This is the HTML template include file (.tpl.php) for ContentItemListPanel.
3
+	// Remember that this is a DRAFT.  It is MEANT to be altered/modified.
4
+	// Be sure to move this out of the drafts/dashboard directory before modifying to ensure that subsequent 
5
+	// code re-generations do not overwrite your changes.
6
+?>
7
+	<?php $_CONTROL->dtgContentItems->Render(); ?>
8
+	<p><?php $_CONTROL->btnCreateNew->Render(); ?></p>

+ 103
- 0
admin/HtmlMetaTagEditPanel.class.php View File

@@ -0,0 +1,103 @@
1
+<?php
2
+	/**
3
+	 * This is a quick-and-dirty draft QPanel object to do Create, Edit, and Delete functionality
4
+	 * of the HtmlMetaTag class.  It uses the code-generated
5
+	 * HtmlMetaTagMetaControl class, which has meta-methods to help with
6
+	 * easily creating/defining controls to modify the fields of a HtmlMetaTag columns.
7
+	 *
8
+	 * Any display customizations and presentation-tier logic can be implemented
9
+	 * here by overriding existing or implementing new methods, properties and variables.
10
+	 * 
11
+	 * NOTE: This file is overwritten on any code regenerations.  If you want to make
12
+	 * permanent changes, it is STRONGLY RECOMMENDED to move both html_meta_tag_edit.php AND
13
+	 * html_meta_tag_edit.tpl.php out of this Form Drafts directory.
14
+	 *
15
+	 * @package Quasi
16
+	 * @subpackage Drafts
17
+	 */
18
+	class HtmlMetaTagEditPanel extends QPanel {
19
+		// Local instance of the HtmlMetaTagMetaControl
20
+		protected $mctHtmlMetaTag;
21
+
22
+		// Controls for HtmlMetaTag's Data Fields
23
+		public $lblId;
24
+		public $txtName;
25
+		public $txtContent;
26
+		public $txtType;
27
+
28
+		// Other ListBoxes (if applicable) via Unique ReverseReferences and ManyToMany References
29
+		public $lstPages;
30
+
31
+		// Other Controls
32
+		public $btnSave;
33
+		public $btnDelete;
34
+		public $btnCancel;
35
+
36
+		// Callback
37
+		protected $strClosePanelMethod;
38
+
39
+		public function __construct($objParentObject, $strClosePanelMethod, $intId = null, $strControlId = null) {
40
+			// Call the Parent
41
+			try {
42
+				parent::__construct($objParentObject, $strControlId);
43
+			} catch (QCallerException $objExc) {
44
+				$objExc->IncrementOffset();
45
+				throw $objExc;
46
+			}
47
+
48
+			// Setup Callback and Template
49
+			$this->strTemplate = 'HtmlMetaTagEditPanel.tpl.php';
50
+			$this->strClosePanelMethod = $strClosePanelMethod;
51
+
52
+			// Construct the HtmlMetaTagMetaControl
53
+			// MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
54
+			$this->mctHtmlMetaTag = HtmlMetaTagMetaControl::Create($this, $intId);
55
+
56
+			// Call MetaControl's methods to create qcontrols based on HtmlMetaTag's data fields
57
+			$this->lblId = $this->mctHtmlMetaTag->lblId_Create();
58
+			$this->txtName = $this->mctHtmlMetaTag->txtName_Create();
59
+			$this->txtContent = $this->mctHtmlMetaTag->txtContent_Create();
60
+			$this->txtType = $this->mctHtmlMetaTag->txtType_Create();
61
+			$this->lstPages = $this->mctHtmlMetaTag->lstPages_Create();
62
+
63
+			// Create Buttons and Actions on this Form
64
+			$this->btnSave = new QButton($this);
65
+			$this->btnSave->Text = QApplication::Translate('Save');
66
+			$this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
67
+			$this->btnSave->CausesValidation = $this;
68
+
69
+			$this->btnCancel = new QButton($this);
70
+			$this->btnCancel->Text = QApplication::Translate('Cancel');
71
+			$this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
72
+
73
+			$this->btnDelete = new QButton($this);
74
+			$this->btnDelete->Text = QApplication::Translate('Delete');
75
+			$this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction(QApplication::Translate('Are you SURE you want to DELETE this') . ' ' . QApplication::Translate('HtmlMetaTag') . '?'));
76
+			$this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
77
+			$this->btnDelete->Visible = $this->mctHtmlMetaTag->EditMode;
78
+		}
79
+
80
+		// Control AjaxAction Event Handlers
81
+		public function btnSave_Click($strFormId, $strControlId, $strParameter) {
82
+			// Delegate "Save" processing to the HtmlMetaTagMetaControl
83
+			$this->mctHtmlMetaTag->SaveHtmlMetaTag();
84
+			$this->CloseSelf(true);
85
+		}
86
+
87
+		public function btnDelete_Click($strFormId, $strControlId, $strParameter) {
88
+			// Delegate "Delete" processing to the HtmlMetaTagMetaControl
89
+			$this->mctHtmlMetaTag->DeleteHtmlMetaTag();
90
+			$this->CloseSelf(true);
91
+		}
92
+
93
+		public function btnCancel_Click($strFormId, $strControlId, $strParameter) {
94
+			$this->CloseSelf(false);
95
+		}
96
+
97
+		// Close Myself and Call ClosePanelMethod Callback
98
+		protected function CloseSelf($blnChangesMade) {
99
+			$strMethod = $this->strClosePanelMethod;
100
+			$this->objForm->$strMethod($blnChangesMade);
101
+		}
102
+	}
103
+?>

+ 24
- 0
admin/HtmlMetaTagEditPanel.tpl.php View File

@@ -0,0 +1,24 @@
1
+<?php
2
+	// This is the HTML template include file (.tpl.php) for html_meta_tagEditPanel.
3
+	// Remember that this is a DRAFT.  It is MEANT to be altered/modified.
4
+	// Be sure to move this out of the drafts/dashboard subdirectory before modifying to ensure that subsequent 
5
+	// code re-generations do not overwrite your changes.
6
+?>
7
+	<div id="formControls">
8
+		<?php $_CONTROL->lblId->RenderWithName(); ?>
9
+
10
+		<?php $_CONTROL->txtName->RenderWithName(); ?>
11
+
12
+		<?php $_CONTROL->txtContent->RenderWithName(); ?>
13
+
14
+		<?php $_CONTROL->txtType->RenderWithName(); ?>
15
+
16
+		<?php $_CONTROL->lstPages->RenderWithName(true, "Rows=7"); ?>
17
+
18
+	</div>
19
+
20
+	<div id="formActions">
21
+		<div id="save"><?php $_CONTROL->btnSave->Render(); ?></div>
22
+		<div id="cancel"><?php $_CONTROL->btnCancel->Render(); ?></div>
23
+		<div id="delete"><?php $_CONTROL->btnDelete->Render(); ?></div>
24
+	</div>

+ 93
- 0
admin/HtmlMetaTagListPanel.class.php View File

@@ -0,0 +1,93 @@
1
+<?php
2
+	/**
3
+	 * This is the abstract Panel class for the List All functionality
4
+	 * of the HtmlMetaTag class.  This code-generated class
5
+	 * contains a datagrid to display an HTML page that can
6
+	 * list a collection of HtmlMetaTag objects.  It includes
7
+	 * functionality to perform pagination and sorting on columns.
8
+	 *
9
+	 * To take advantage of some (or all) of these control objects, you
10
+	 * must create a new QPanel which extends this HtmlMetaTagListPanelBase
11
+	 * class.
12
+	 *
13
+	 * Any and all changes to this file will be overwritten with any subsequent re-
14
+	 * code generation.
15
+	 * 
16
+	 * @package Quasi
17
+	 * @subpackage Drafts
18
+	 * 
19
+	 */
20
+	class HtmlMetaTagListPanel extends QPanel {
21
+		// Local instance of the Meta DataGrid to list HtmlMetaTags
22
+		public $dtgHtmlMetaTags;
23
+
24
+		// Other public QControls in this panel
25
+		public $btnCreateNew;
26
+		public $pxyEdit;
27
+
28
+		// Callback Method Names
29
+		protected $strSetEditPanelMethod;
30
+		protected $strCloseEditPanelMethod;
31
+		
32
+		public function __construct($objParentObject, $strSetEditPanelMethod, $strCloseEditPanelMethod, $strControlId = null) {
33
+			// Call the Parent
34
+			try {
35
+				parent::__construct($objParentObject, $strControlId);
36
+			} catch (QCallerException $objExc) {
37
+				$objExc->IncrementOffset();
38
+				throw $objExc;
39
+			}
40
+
41
+			// Record Method Callbacks
42
+			$this->strSetEditPanelMethod = $strSetEditPanelMethod;
43
+			$this->strCloseEditPanelMethod = $strCloseEditPanelMethod;
44
+
45
+			// Setup the Template
46
+			$this->Template = 'HtmlMetaTagListPanel.tpl.php';
47
+
48
+			// Instantiate the Meta DataGrid
49
+			$this->dtgHtmlMetaTags = new HtmlMetaTagDataGrid($this);
50
+
51
+			// Style the DataGrid (if desired)
52
+			$this->dtgHtmlMetaTags->CssClass = 'datagrid';
53
+			$this->dtgHtmlMetaTags->AlternateRowStyle->CssClass = 'alternate';
54
+
55
+			// Add Pagination (if desired)
56
+			$this->dtgHtmlMetaTags->Paginator = new QPaginator($this->dtgHtmlMetaTags);
57
+			$this->dtgHtmlMetaTags->ItemsPerPage = 8;
58
+
59
+			// Use the MetaDataGrid functionality to add Columns for this datagrid
60
+
61
+			// Create an Edit Column
62
+			$this->pxyEdit = new QControlProxy($this);
63
+			$this->pxyEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyEdit_Click'));
64
+			$this->dtgHtmlMetaTags->MetaAddEditProxyColumn($this->pxyEdit, 'Edit', 'Edit');
65
+
66
+			// Create the Other Columns (note that you can use strings for html_meta_tag's properties, or you
67
+			// can traverse down QQN::html_meta_tag() to display fields that are down the hierarchy)
68
+			$this->dtgHtmlMetaTags->MetaAddColumn('Id');
69
+			$this->dtgHtmlMetaTags->MetaAddColumn('Name');
70
+			$this->dtgHtmlMetaTags->MetaAddColumn('Content');
71
+			$this->dtgHtmlMetaTags->MetaAddColumn('Type');
72
+
73
+			// Setup the Create New button
74
+			$this->btnCreateNew = new QButton($this);
75
+			$this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('HtmlMetaTag');
76
+			$this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click'));
77
+		}
78
+
79
+		public function pxyEdit_Click($strFormId, $strControlId, $strParameter) {
80
+			$strParameterArray = explode(',', $strParameter);
81
+			$objEditPanel = new HtmlMetaTagEditPanel($this, $this->strCloseEditPanelMethod, $strParameterArray[0]);
82
+
83
+			$strMethodName = $this->strSetEditPanelMethod;
84
+			$this->objForm->$strMethodName($objEditPanel);
85
+		}
86
+
87
+		public function btnCreateNew_Click($strFormId, $strControlId, $strParameter) {
88
+			$objEditPanel = new HtmlMetaTagEditPanel($this, $this->strCloseEditPanelMethod, null);
89
+			$strMethodName = $this->strSetEditPanelMethod;
90
+			$this->objForm->$strMethodName($objEditPanel);
91
+		}
92
+	}
93
+?>

+ 8
- 0
admin/HtmlMetaTagListPanel.tpl.php View File

@@ -0,0 +1,8 @@
1
+<?php
2
+	// This is the HTML template include file (.tpl.php) for HtmlMetaTagListPanel.
3
+	// Remember that this is a DRAFT.  It is MEANT to be altered/modified.
4
+	// Be sure to move this out of the drafts/dashboard directory before modifying to ensure that subsequent 
5
+	// code re-generations do not overwrite your changes.
6
+?>
7
+	<?php $_CONTROL->dtgHtmlMetaTags->Render(); ?>
8
+	<p><?php $_CONTROL->btnCreateNew->Render(); ?></p>

+ 103
- 0
admin/JavaScriptEditPanel.class.php View File

@@ -0,0 +1,103 @@
1
+<?php
2
+	/**
3
+	 * This is a quick-and-dirty draft QPanel object to do Create, Edit, and Delete functionality
4
+	 * of the JavaScript class.  It uses the code-generated
5
+	 * JavaScriptMetaControl class, which has meta-methods to help with
6
+	 * easily creating/defining controls to modify the fields of a JavaScript columns.
7
+	 *
8
+	 * Any display customizations and presentation-tier logic can be implemented
9
+	 * here by overriding existing or implementing new methods, properties and variables.
10
+	 * 
11
+	 * NOTE: This file is overwritten on any code regenerations.  If you want to make
12
+	 * permanent changes, it is STRONGLY RECOMMENDED to move both java_script_edit.php AND
13
+	 * java_script_edit.tpl.php out of this Form Drafts directory.
14
+	 *
15
+	 * @package Quasi
16
+	 * @subpackage Drafts
17
+	 */
18
+	class JavaScriptEditPanel extends QPanel {
19
+		// Local instance of the JavaScriptMetaControl
20
+		protected $mctJavaScript;
21
+
22
+		// Controls for JavaScript's Data Fields
23
+		public $lblId;
24
+		public $txtName;
25
+		public $txtDescription;
26
+		public $txtFilename;
27
+
28
+		// Other ListBoxes (if applicable) via Unique ReverseReferences and ManyToMany References
29
+		public $lstPages;
30
+
31
+		// Other Controls
32
+		public $btnSave;
33
+		public $btnDelete;
34
+		public $btnCancel;
35
+
36
+		// Callback
37
+		protected $strClosePanelMethod;
38
+
39
+		public function __construct($objParentObject, $strClosePanelMethod, $intId = null, $strControlId = null) {
40
+			// Call the Parent
41
+			try {
42
+				parent::__construct($objParentObject, $strControlId);
43
+			} catch (QCallerException $objExc) {
44
+				$objExc->IncrementOffset();
45
+				throw $objExc;
46
+			}
47
+
48
+			// Setup Callback and Template
49
+			$this->strTemplate = 'JavaScriptEditPanel.tpl.php';
50
+			$this->strClosePanelMethod = $strClosePanelMethod;
51
+
52
+			// Construct the JavaScriptMetaControl
53
+			// MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
54
+			$this->mctJavaScript = JavaScriptMetaControl::Create($this, $intId);
55
+
56
+			// Call MetaControl's methods to create qcontrols based on JavaScript's data fields
57
+			$this->lblId = $this->mctJavaScript->lblId_Create();
58
+			$this->txtName = $this->mctJavaScript->txtName_Create();
59
+			$this->txtDescription = $this->mctJavaScript->txtDescription_Create();
60
+			$this->txtFilename = $this->mctJavaScript->txtFilename_Create();
61
+			$this->lstPages = $this->mctJavaScript->lstPages_Create();
62
+
63
+			// Create Buttons and Actions on this Form
64
+			$this->btnSave = new QButton($this);
65
+			$this->btnSave->Text = QApplication::Translate('Save');
66
+			$this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
67
+			$this->btnSave->CausesValidation = $this;
68
+
69
+			$this->btnCancel = new QButton($this);
70
+			$this->btnCancel->Text = QApplication::Translate('Cancel');
71
+			$this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
72
+
73
+			$this->btnDelete = new QButton($this);
74
+			$this->btnDelete->Text = QApplication::Translate('Delete');
75
+			$this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction(QApplication::Translate('Are you SURE you want to DELETE this') . ' ' . QApplication::Translate('JavaScript') . '?'));
76
+			$this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
77
+			$this->btnDelete->Visible = $this->mctJavaScript->EditMode;
78
+		}
79
+
80
+		// Control AjaxAction Event Handlers
81
+		public function btnSave_Click($strFormId, $strControlId, $strParameter) {
82
+			// Delegate "Save" processing to the JavaScriptMetaControl
83
+			$this->mctJavaScript->SaveJavaScript();
84
+			$this->CloseSelf(true);
85
+		}
86
+
87
+		public function btnDelete_Click($strFormId, $strControlId, $strParameter) {
88
+			// Delegate "Delete" processing to the JavaScriptMetaControl
89
+			$this->mctJavaScript->DeleteJavaScript();
90
+			$this->CloseSelf(true);
91
+		}
92
+
93
+		public function btnCancel_Click($strFormId, $strControlId, $strParameter) {
94
+			$this->CloseSelf(false);
95
+		}
96
+
97
+		// Close Myself and Call ClosePanelMethod Callback
98
+		protected function CloseSelf($blnChangesMade) {
99
+			$strMethod = $this->strClosePanelMethod;
100
+			$this->objForm->$strMethod($blnChangesMade);
101
+		}
102
+	}
103
+?>

+ 24
- 0
admin/JavaScriptEditPanel.tpl.php View File

@@ -0,0 +1,24 @@
1
+<?php
2
+	// This is the HTML template include file (.tpl.php) for java_scriptEditPanel.
3
+	// Remember that this is a DRAFT.  It is MEANT to be altered/modified.
4
+	// Be sure to move this out of the drafts/dashboard subdirectory before modifying to ensure that subsequent 
5
+	// code re-generations do not overwrite your changes.
6
+?>
7
+	<div id="formControls">
8
+		<?php $_CONTROL->lblId->RenderWithName(); ?>
9
+
10
+		<?php $_CONTROL->txtName->RenderWithName(); ?>
11
+
12
+		<?php $_CONTROL->txtDescription->RenderWithName(); ?>
13
+
14
+		<?php $_CONTROL->txtFilename->RenderWithName(); ?>
15
+
16
+		<?php $_CONTROL->lstPages->RenderWithName(true, "Rows=7"); ?>
17
+
18
+	</div>
19
+
20
+	<div id="formActions">
21
+		<div id="save"><?php $_CONTROL->btnSave->Render(); ?></div>
22
+		<div id="cancel"><?php $_CONTROL->btnCancel->Render(); ?></div>
23
+		<div id="delete"><?php $_CONTROL->btnDelete->Render(); ?></div>
24
+	</div>

+ 93
- 0
admin/JavaScriptListPanel.class.php View File

@@ -0,0 +1,93 @@
1
+<?php
2
+	/**
3
+	 * This is the abstract Panel class for the List All functionality
4
+	 * of the JavaScript class.  This code-generated class
5
+	 * contains a datagrid to display an HTML page that can
6
+	 * list a collection of JavaScript objects.  It includes
7
+	 * functionality to perform pagination and sorting on columns.
8
+	 *
9
+	 * To take advantage of some (or all) of these control objects, you
10
+	 * must create a new QPanel which extends this JavaScriptListPanelBase
11
+	 * class.
12
+	 *
13
+	 * Any and all changes to this file will be overwritten with any subsequent re-
14
+	 * code generation.
15
+	 * 
16
+	 * @package Quasi
17
+	 * @subpackage Drafts
18
+	 * 
19
+	 */
20
+	class JavaScriptListPanel extends QPanel {
21
+		// Local instance of the Meta DataGrid to list JavaScripts
22
+		public $dtgJavaScripts;
23
+
24
+		// Other public QControls in this panel
25
+		public $btnCreateNew;
26
+		public $pxyEdit;
27
+
28
+		// Callback Method Names
29
+		protected $strSetEditPanelMethod;
30
+		protected $strCloseEditPanelMethod;
31
+		
32
+		public function __construct($objParentObject, $strSetEditPanelMethod, $strCloseEditPanelMethod, $strControlId = null) {
33
+			// Call the Parent
34
+			try {
35
+				parent::__construct($objParentObject, $strControlId);
36
+			} catch (QCallerException $objExc) {
37
+				$objExc->IncrementOffset();
38
+				throw $objExc;
39
+			}
40
+
41
+			// Record Method Callbacks
42
+			$this->strSetEditPanelMethod = $strSetEditPanelMethod;
43
+			$this->strCloseEditPanelMethod = $strCloseEditPanelMethod;
44
+
45
+			// Setup the Template
46
+			$this->Template = 'JavaScriptListPanel.tpl.php';
47
+
48
+			// Instantiate the Meta DataGrid
49
+			$this->dtgJavaScripts = new JavaScriptDataGrid($this);
50
+
51
+			// Style the DataGrid (if desired)
52
+			$this->dtgJavaScripts->CssClass = 'datagrid';
53
+			$this->dtgJavaScripts->AlternateRowStyle->CssClass = 'alternate';
54
+
55
+			// Add Pagination (if desired)
56
+			$this->dtgJavaScripts->Paginator = new QPaginator($this->dtgJavaScripts);
57
+			$this->dtgJavaScripts->ItemsPerPage = 8;
58
+
59
+			// Use the MetaDataGrid functionality to add Columns for this datagrid
60
+
61
+			// Create an Edit Column
62
+			$this->pxyEdit = new QControlProxy($this);
63
+			$this->pxyEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyEdit_Click'));
64
+			$this->dtgJavaScripts->MetaAddEditProxyColumn($this->pxyEdit, 'Edit', 'Edit');
65
+
66
+			// Create the Other Columns (note that you can use strings for java_script's properties, or you
67
+			// can traverse down QQN::java_script() to display fields that are down the hierarchy)
68
+			$this->dtgJavaScripts->MetaAddColumn('Id');
69
+			$this->dtgJavaScripts->MetaAddColumn('Name');
70
+			$this->dtgJavaScripts->MetaAddColumn('Description');
71
+			$this->dtgJavaScripts->MetaAddColumn('Filename');
72
+
73
+			// Setup the Create New button
74
+			$this->btnCreateNew = new QButton($this);
75
+			$this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('JavaScript');
76
+			$this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click'));
77
+		}
78
+
79
+		public function pxyEdit_Click($strFormId, $strControlId, $strParameter) {
80
+			$strParameterArray = explode(',', $strParameter);
81
+			$objEditPanel = new JavaScriptEditPanel($this, $this->strCloseEditPanelMethod, $strParameterArray[0]);
82
+
83
+			$strMethodName = $this->strSetEditPanelMethod;
84
+			$this->objForm->$strMethodName($objEditPanel);
85
+		}
86
+
87
+		public function btnCreateNew_Click($strFormId, $strControlId, $strParameter) {
88
+			$objEditPanel = new JavaScriptEditPanel($this, $this->strCloseEditPanelMethod, null);
89
+			$strMethodName = $this->strSetEditPanelMethod;
90
+			$this->objForm->$strMethodName($objEditPanel);
91
+		}
92
+	}
93
+?>

+ 8
- 0
admin/JavaScriptListPanel.tpl.php View File

@@ -0,0 +1,8 @@
1
+<?php
2
+	// This is the HTML template include file (.tpl.php) for JavaScriptListPanel.
3
+	// Remember that this is a DRAFT.  It is MEANT to be altered/modified.
4
+	// Be sure to move this out of the drafts/dashboard directory before modifying to ensure that subsequent 
5
+	// code re-generations do not overwrite your changes.
6
+?>
7
+	<?php $_CONTROL->dtgJavaScripts->Render(); ?>
8
+	<p><?php $_CONTROL->btnCreateNew->Render(); ?></p>

+ 121
- 0
admin/MenuEditPanel.class.php View File

@@ -0,0 +1,121 @@
1
+<?php
2
+	/**
3
+	 * This is a quick-and-dirty draft QPanel object to do Create, Edit, and Delete functionality
4
+	 * of the Menu class.  It uses the code-generated
5
+	 * MenuMetaControl class, which has meta-methods to help with
6
+	 * easily creating/defining controls to modify the fields of a Menu columns.
7
+	 *
8
+	 * Any display customizations and presentation-tier logic can be implemented
9
+	 * here by overriding existing or implementing new methods, properties and variables.
10
+	 * 
11
+	 * NOTE: This file is overwritten on any code regenerations.  If you want to make
12
+	 * permanent changes, it is STRONGLY RECOMMENDED to move both menu_edit.php AND
13
+	 * menu_edit.tpl.php out of this Form Drafts directory.
14
+	 *
15
+	 * @package Quasi
16
+	 * @subpackage Drafts
17
+	 */
18
+	class MenuEditPanel extends QPanel {
19
+		// Local instance of the MenuMetaControl
20
+		protected $mctMenu;
21
+
22
+		// Controls for Menu's Data Fields
23
+		public $lblId;
24
+		public $txtName;
25
+		public $txtTitle;
26
+		public $txtCssClass;
27
+		public $txtSortOrder;
28
+		public $chkShowTitle;
29
+		public $txtMenuItemId;
30
+		public $lstPublicPermissions;
31
+		public $lstUserPermissions;
32
+		public $lstGroupPermissions;
33
+		public $lstStatus;
34
+		public $lstType;
35
+
36
+		// Other ListBoxes (if applicable) via Unique ReverseReferences and ManyToMany References
37
+		public $lstContentBlocks;
38
+		public $lstMenuItemsAsItem;
39
+
40
+		// Other Controls
41
+		public $btnSave;
42
+		public $btnDelete;
43
+		public $btnCancel;
44
+
45
+		// Callback
46
+		protected $strClosePanelMethod;
47
+
48
+		public function __construct($objParentObject, $strClosePanelMethod, $intId = null, $strControlId = null) {
49
+			// Call the Parent
50
+			try {
51
+				parent::__construct($objParentObject, $strControlId);
52
+			} catch (QCallerException $objExc) {
53
+				$objExc->IncrementOffset();
54
+				throw $objExc;
55
+			}
56
+
57
+			// Setup Callback and Template
58
+			$this->strTemplate = 'MenuEditPanel.tpl.php';
59
+			$this->strClosePanelMethod = $strClosePanelMethod;
60
+
61
+			// Construct the MenuMetaControl
62
+			// MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
63
+			$this->mctMenu = MenuMetaControl::Create($this, $intId);
64
+
65
+			// Call MetaControl's methods to create qcontrols based on Menu's data fields
66
+			$this->lblId = $this->mctMenu->lblId_Create();
67
+			$this->txtName = $this->mctMenu->txtName_Create();
68
+			$this->txtTitle = $this->mctMenu->txtTitle_Create();
69
+			$this->txtCssClass = $this->mctMenu->txtCssClass_Create();
70
+			$this->txtSortOrder = $this->mctMenu->txtSortOrder_Create();
71
+			$this->chkShowTitle = $this->mctMenu->chkShowTitle_Create();
72
+			$this->txtMenuItemId = $this->mctMenu->txtMenuItemId_Create();
73
+			$this->lstPublicPermissions = $this->mctMenu->lstPublicPermissions_Create();
74
+			$this->lstUserPermissions = $this->mctMenu->lstUserPermissions_Create();
75
+			$this->lstGroupPermissions = $this->mctMenu->lstGroupPermissions_Create();
76
+			$this->lstStatus = $this->mctMenu->lstStatus_Create();
77
+			$this->lstType = $this->mctMenu->lstType_Create();
78
+			$this->lstContentBlocks = $this->mctMenu->lstContentBlocks_Create();
79
+			$this->lstMenuItemsAsItem = $this->mctMenu->lstMenuItemsAsItem_Create();
80
+
81
+			// Create Buttons and Actions on this Form
82
+			$this->btnSave = new QButton($this);
83
+			$this->btnSave->Text = QApplication::Translate('Save');
84
+			$this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
85
+			$this->btnSave->CausesValidation = $this;
86
+
87
+			$this->btnCancel = new QButton($this);
88
+			$this->btnCancel->Text = QApplication::Translate('Cancel');
89
+			$this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
90
+
91
+			$this->btnDelete = new QButton($this);
92
+			$this->btnDelete->Text = QApplication::Translate('Delete');
93
+			$this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction(QApplication::Translate('Are you SURE you want to DELETE this') . ' ' . QApplication::Translate('Menu') . '?'));
94
+			$this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
95
+			$this->btnDelete->Visible = $this->mctMenu->EditMode;
96
+		}
97
+
98
+		// Control AjaxAction Event Handlers
99
+		public function btnSave_Click($strFormId, $strControlId, $strParameter) {
100
+			// Delegate "Save" processing to the MenuMetaControl
101
+			$this->mctMenu->SaveMenu();
102
+			$this->CloseSelf(true);
103
+		}
104
+
105
+		public function btnDelete_Click($strFormId, $strControlId, $strParameter) {
106
+			// Delegate "Delete" processing to the MenuMetaControl
107
+			$this->mctMenu->DeleteMenu();
108
+			$this->CloseSelf(true);
109
+		}
110
+
111
+		public function btnCancel_Click($strFormId, $strControlId, $strParameter) {
112
+			$this->CloseSelf(false);
113
+		}
114
+
115
+		// Close Myself and Call ClosePanelMethod Callback
116
+		protected function CloseSelf($blnChangesMade) {
117
+			$strMethod = $this->strClosePanelMethod;
118
+			$this->objForm->$strMethod($blnChangesMade);
119
+		}
120
+	}
121
+?>

+ 42
- 0
admin/MenuEditPanel.tpl.php View File

@@ -0,0 +1,42 @@
1
+<?php
2
+	// This is the HTML template include file (.tpl.php) for menuEditPanel.
3
+	// Remember that this is a DRAFT.  It is MEANT to be altered/modified.
4
+	// Be sure to move this out of the drafts/dashboard subdirectory before modifying to ensure that subsequent 
5
+	// code re-generations do not overwrite your changes.
6
+?>
7
+	<div id="formControls">
8
+		<?php $_CONTROL->lblId->RenderWithName(); ?>
9
+
10
+		<?php $_CONTROL->txtName->RenderWithName(); ?>
11
+
12
+		<?php $_CONTROL->txtTitle->RenderWithName(); ?>
13
+
14
+		<?php $_CONTROL->txtCssClass->RenderWithName(); ?>
15
+
16
+		<?php $_CONTROL->txtSortOrder->RenderWithName(); ?>
17
+
18
+		<?php $_CONTROL->chkShowTitle->RenderWithName(); ?>
19
+
20
+		<?php $_CONTROL->txtMenuItemId->RenderWithName(); ?>
21
+
22
+		<?php $_CONTROL->lstPublicPermissions->RenderWithName(); ?>
23
+
24
+		<?php $_CONTROL->lstUserPermissions->RenderWithName(); ?>
25
+
26
+		<?php $_CONTROL->lstGroupPermissions->RenderWithName(); ?>
27
+
28
+		<?php $_CONTROL->lstStatus->RenderWithName(); ?>
29
+
30
+		<?php $_CONTROL->lstType->RenderWithName(); ?>
31
+
32
+		<?php $_CONTROL->lstContentBlocks->RenderWithName(true, "Rows=7"); ?>
33
+
34
+		<?php $_CONTROL->lstMenuItemsAsItem->RenderWithName(true, "Rows=7"); ?>
35
+
36
+	</div>
37
+
38
+	<div id="formActions">
39
+		<div id="save"><?php $_CONTROL->btnSave->Render(); ?></div>
40
+		<div id="cancel"><?php $_CONTROL->btnCancel->Render(); ?></div>
41
+		<div id="delete"><?php $_CONTROL->btnDelete->Render(); ?></div>
42
+	</div>

+ 123
- 0
admin/MenuItemEditPanel.class.php View File

@@ -0,0 +1,123 @@
1
+<?php
2
+	/**
3
+	 * This is a quick-and-dirty draft QPanel object to do Create, Edit, and Delete functionality
4
+	 * of the MenuItem class.  It uses the code-generated
5
+	 * MenuItemMetaControl class, which has meta-methods to help with
6
+	 * easily creating/defining controls to modify the fields of a MenuItem columns.
7
+	 *
8
+	 * Any display customizations and presentation-tier logic can be implemented
9
+	 * here by overriding existing or implementing new methods, properties and variables.
10
+	 * 
11
+	 * NOTE: This file is overwritten on any code regenerations.  If you want to make
12
+	 * permanent changes, it is STRONGLY RECOMMENDED to move both menu_item_edit.php AND
13
+	 * menu_item_edit.tpl.php out of this Form Drafts directory.
14
+	 *
15
+	 * @package Quasi
16
+	 * @subpackage Drafts
17
+	 */
18
+	class MenuItemEditPanel extends QPanel {
19
+		// Local instance of the MenuItemMetaControl
20
+		protected $mctMenuItem;
21
+
22
+		// Controls for MenuItem's Data Fields
23
+		public $lblId;
24
+		public $txtName;
25
+		public $txtCssClass;
26
+		public $txtLabel;
27
+		public $txtUri;
28
+		public $chkIsLocal;
29
+		public $chkIsSsl;
30
+		public $txtSortOrder;
31
+		public $lstPublicPermissions;
32
+		public $lstUserPermissions;
33
+		public $lstGroupPermissions;
34
+		public $lstStatus;
35
+		public $lstType;
36
+		public $lstPage;
37
+
38
+		// Other ListBoxes (if applicable) via Unique ReverseReferences and ManyToMany References
39
+		public $lstMenus;
40
+
41
+		// Other Controls
42
+		public $btnSave;
43
+		public $btnDelete;
44
+		public $btnCancel;
45
+
46
+		// Callback
47
+		protected $strClosePanelMethod;
48
+
49
+		public function __construct($objParentObject, $strClosePanelMethod, $intId = null, $strControlId = null) {
50
+			// Call the Parent
51
+			try {
52
+				parent::__construct($objParentObject, $strControlId);
53
+			} catch (QCallerException $objExc) {
54
+				$objExc->IncrementOffset();
55
+				throw $objExc;
56
+			}
57
+
58
+			// Setup Callback and Template
59
+			$this->strTemplate = 'MenuItemEditPanel.tpl.php';
60
+			$this->strClosePanelMethod = $strClosePanelMethod;
61
+
62
+			// Construct the MenuItemMetaControl
63
+			// MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
64
+			$this->mctMenuItem = MenuItemMetaControl::Create($this, $intId);
65
+
66
+			// Call MetaControl's methods to create qcontrols based on MenuItem's data fields
67
+			$this