Browse Source

First real import, reoganized and renamed, etc ..

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

+ 20
- 8
LICENCE View File

@@ -1,4 +1,17 @@
1 1
 Tuesday, November 08, 2011
2
+Erik Winn <sidewalksoftware@gmail.com>
3
+
4
+This notice applies to all files and software in Quinta CMS unless otherwise
5
+specified. If you have received this bundled with QCodo please see the 
6
+QCodo licence for the terms that apply to the QCodo Framework.
7
+
8
+Files under www/assets/ for TinyMCE and FPDF are released under
9
+their respective licences - please see the licence files in those directories
10
+for the terms that apply.
11
+    
12
+  ---------------------------------------------------------------------------------------------
13
+    The following is the statement of terms which applies to Quinta CMS:
14
+    
2 15
 This is free and unencumbered software released into the public domain.
3 16
 
4 17
 Anyone is free to copy, modify, publish, use, compile, sell, or
@@ -7,19 +20,18 @@ binary, for any purpose, commercial or non-commercial, and by any
7 20
 means.
8 21
 
9 22
 In jurisdictions that recognize copyright laws, the author or authors
10
-of this software dedicate any and all copyright interest in the
11
-software to the public domain. We make this dedication for the benefit
12
-of the public at large and to the detriment of our heirs and
13
-successors. We intend this dedication to be an overt act of
14
-relinquishment in perpetuity of all present and future rights to this
15
-software under copyright law.
23
+of this software dedicate any and all copyright interest in the software 
24
+to the public domain. We make this dedication for the benefit of the 
25
+public at large and to the detriment of our heirs and successors. We 
26
+intend this dedication to be an overt act of relinquishment in perpetuity 
27
+of all present and future rights to this software under copyright law.
16 28
 
17 29
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 30
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 31
 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 32
 IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 33
 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
-OTHER DEALINGS IN THE SOFTWARE.
34
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
35
+THEREOF OR ANY OTHER DEALINGS WITH OR IN THE SOFTWARE.
24 36
 
25 37
 For more information, please refer to <http://unlicense.org/>

+ 1
- 1
README View File

@@ -1,4 +1,4 @@
1 1
 Tuesday, November 08, 2011:
2 2
 
3 3
 This is a radical reworking of an old CMS (QuasiCMS) - there is quite alot here
4
-but it is not, as of this writing functional. Check later ..
4
+but it is not, as of this writing functional. Soon.

+ 69
- 0
cli/settings/codegen.xml View File

@@ -0,0 +1,69 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<codegen>
3
+<!--
4
+	This XML file defines the settings used when running the Code Generator.
5
+	When running CodeGen, you must specify a CodeGenSettings XML file like
6
+	this one to use.  Feel free to copy, modify, etc.
7
+-->
8
+	<!-- General CodeGen Settings -->
9
+	<name application="Quinta CMS"/>
10
+	<templateEscape begin="&lt;%" end="%&gt;"/>
11
+
12
+	<!-- Define Data Sources (e.g. Databases, Services, etc.) -->
13
+	<dataSources>
14
+
15
+		<database index="1">
16
+			<!-- Append Prefixes/Suffixes to the Following Code Generated Items -->
17
+			<className prefix="" suffix=""/>
18
+			<associatedObjectName prefix="" suffix=""/>
19
+
20
+			<!-- Table Type Identifiers - Used to Classify Tables in your Data Model -->
21
+			<typeTableIdentifier suffix="_type"/>
22
+			<associationTableIdentifier suffix="_assn"/>
23
+
24
+			<!-- Other -->
25
+			<stripFromTableName prefix=""/>
26
+
27
+			<!-- Specific Tables to Exclude or Include in the CodeGen process -->
28
+			<!--
29
+					* "include" is used to override any "exclude" patterns or lists
30
+					* "list" should be a  comma-separated list of table names
31
+					* "pattern" is a regexp pattern
32
+				So for example, if you only want to codegen any table prefixed with "qc_",
33
+				you should set an excludeTables pattern to exclude all, or "[0-9a-zA-Z_]*".
34
+				And then you should set an includeTables pattern of "^qc_[0-9a-zA-Z_]*".
35
+			-->
36
+			<excludeTables pattern="" list=""/>
37
+			<includeTables pattern="" list=""/>
38
+
39
+			<!-- Support for "Beta 2" version of Manual Queries and Hard Coded Column Names -->
40
+			<manualQuery support="false"/>
41
+
42
+			<!-- Virtual Foreign Key Relationships -->
43
+			<!--
44
+				There are two ways to define relationships.  To signify a virtual FK
45
+				relationship (for example, on foo.bar_id which would key to bar.id)
46
+				you can:
47
+
48
+				A) Simply define the relationship in the <relationships/> tag using
49
+				   the following format:
50
+					foo.bar_id => bar.id
51
+					bar.other_id => other.id
52
+					(with one relationship per line)
53
+				   Note that because the relationships data uses a ">" symbol, proper
54
+				   XML rules dictate that the content of the relationships script must
55
+				   be escaped with <![CDATA[ and ]]> tags.
56
+
57
+				B) You can define the relationships in totally separate relationships
58
+				   script file by using the <relationshipsScript/> tag, where you can
59
+				   specify a filepath and a format.  Format can either be:
60
+					qcodo - follows the same "foo.bar_id => bar.id" as above
61
+					sql - parses the script, looking for SQL-based ALTER TABLE statments like:
62
+				    	ALTER TABLE foo ADD CONSTRAINT blah FOREIGN KEY (bar_id) REFERENCES bar (id);
63
+			-->
64
+			<relationships><![CDATA[
65
+			]]></relationships>
66
+			<relationshipsScript filepath="" format="sql"/>
67
+		</database>
68
+	</dataSources>
69
+</codegen>

+ 1759
- 0
database/quinta.sql
File diff suppressed because it is too large
View File


+ 76
- 0
database/relationships.txt View File

@@ -0,0 +1,76 @@
1
+  authorize_net_transaction.order_id => order.id
2
+
3
+  account.type_id => account_type.id
4
+  account.status_id => account_status_type.id
5
+
6
+  address.zone_id => zone_type.id
7
+  address.country_id => country_type.id
8
+  address.type_id => address_type.id
9
+
10
+  product.status_id => product_status_type.id
11
+  product.type_id => product_type.id
12
+
13
+  product_image.size_type => image_size_type.id
14
+
15
+  order.status_id => order_status_type.id
16
+  order.type_id => order_type.id
17
+  order.shipping_method_id => shipping_method.id
18
+  order.payment_method_id => payment_method.id
19
+  
20
+  order_change.type_id => order_change_type.id
21
+
22
+  order_status_history.status_id => order_status_type.id
23
+
24
+  order_item.status_id => order_item_status_type.id
25
+  
26
+  payment_method.payment_type_id => payment_type.id
27
+
28
+  tracking_number.order_id => order.id
29
+  
30
+  paypal_transaction.payment_method_id => payment_method.id
31
+
32
+  content_block.parent_content_block_id => content_block.id
33
+  content_block.location_id => block_location_type.id
34
+  
35
+  content_category.parent_content_category_id => content_category.id
36
+
37
+  content_category.public_permissions_id => permission_type.id
38
+  content_category.user_permissions_id => permission_type.id
39
+  content_category.group_permissions_id => permission_type.id
40
+  
41
+  product_category.parent_product_category_id => product_category.id
42
+  product_category.public_permissions_id => permission_type.id
43
+  product_category.user_permissions_id => permission_type.id
44
+  product_category.group_permissions_id => permission_type.id
45
+
46
+  content_item.creator_id => person.id
47
+  content_item.type_id => content_type.id
48
+  content_item.status_id => content_status_type.id
49
+  content_item.public_permissions_id => permission_type.id
50
+  content_item.user_permissions_id => permission_type.id
51
+  content_item.group_permissions_id => permission_type.id
52
+
53
+  module.public_permissions_id => permission_type.id
54
+  module.user_permissions_id => permission_type.id
55
+  module.group_permissions_id => permission_type.id
56
+  module.content_block_id => content_block.id
57
+
58
+  page.doc_type_id => page_doc_type.id
59
+  page.type_id => page_type.id
60
+  page.status_id => page_status_type.id
61
+  page.public_permissions_id => permission_type.id
62
+  page.user_permissions_id => permission_type.id
63
+  page.group_permissions_id => permission_type.id
64
+
65
+  menu_item.type_id => menu_item_type.id
66
+  menu_item.status_id => menu_status_type.id
67
+  menu_item.public_permissions_id => permission_type.id
68
+  menu_item.user_permissions_id => permission_type.id
69
+  menu_item.group_permissions_id => permission_type.id
70
+
71
+  menu.type_id => menu_type.id
72
+  menu.status_id => menu_status_type.id
73
+  menu.public_permissions_id => permission_type.id
74
+  menu.user_permissions_id => permission_type.id
75
+  menu.group_permissions_id => permission_type.id
76
+

+ 71
- 0
includes/QApplication.class.php View File

@@ -0,0 +1,71 @@
1
+<?php
2
+	/**
3
+	 * The Application class is an abstract class that statically provides
4
+	 * information and global utilities for the entire web application.
5
+	 *
6
+	 * Custom constants for this webapp, as well as global variables and global
7
+	 * methods should be declared in this abstract class (declared statically).
8
+	 *
9
+	 * This Application class should extend from the ApplicationBase class in
10
+	 * the framework.
11
+	 */
12
+	abstract class QApplication extends QApplicationBase {
13
+		/**
14
+		 * This is called by the PHP5 Autoloader.  This method overrides the
15
+		 * one in ApplicationBase.
16
+		 *
17
+		 * @return void
18
+		 */
19
+		public static function Autoload($strClassName) {
20
+			// First use the Qcodo Autoloader
21
+			if (!parent::Autoload($strClassName)) {
22
+				// NOTE: Run any custom autoloading functionality (if any) here...
23
+			}
24
+		}
25
+
26
+		/**
27
+		 * Method will setup Internationalization.
28
+		 * NOTE: This method has been INTENTIONALLY left incomplete.
29
+		 * @return void
30
+		 */
31
+		public static function InitializeI18n() {
32
+			if (isset($_SESSION)) {
33
+				if (array_key_exists('country_code', $_SESSION))
34
+					QApplication::$CountryCode = $_SESSION['country_code'];
35
+				if (array_key_exists('language_code', $_SESSION))
36
+					QApplication::$LanguageCode = $_SESSION['language_code'];
37
+			}
38
+
39
+			/*
40
+			 * NOTE: This is where you would implement code to do Language Setting discovery, as well, for example:
41
+			 *   Checking against $_GET['language_code']
42
+			 *   checking against session (example provided below)
43
+			 *   Checking the URL
44
+			 *   etc.
45
+			 * Options to do this are left to the developer.
46
+			 */
47
+
48
+			// Initialize I18n if QApplication::$LanguageCode is set
49
+			if (QApplication::$LanguageCode)
50
+				QI18n::Initialize();
51
+
52
+			// Otherwise, you could optionally run with some defaults
53
+			else {
54
+				// QApplication::$CountryCode = 'us';
55
+				// QApplication::$LanguageCode = 'en';
56
+				// QI18n::Initialize();
57
+			}
58
+		}
59
+
60
+		////////////////////////////
61
+		// QApplication Customizations (e.g. EncodingType, Disallowing PHP Session, etc.)
62
+		////////////////////////////
63
+		// public static $EncodingType = 'ISO-8859-1';
64
+		// public static $EnableSession = false;
65
+
66
+		////////////////////////////
67
+		// Additional Static Methods
68
+		////////////////////////////
69
+		// NOTE: Define any other custom global WebApplication functions (if any) here...
70
+	}
71
+?>

+ 77
- 0
includes/configuration.inc.php View File

@@ -0,0 +1,77 @@
1
+<?php
2
+	// This is the "recommended" version of configuration.inc.php, without any comments, and restructured in a way
3
+	// that should make sense for most pro-users of Qcodo.
4
+
5
+	// While it is recommended (for ease of code readability) to use this version of configuration.inc.php-dist,
6
+	// the configuration.inc.php-full version could potentially be more useful for newer users of Qcodo as it has
7
+	// comments inline within the file.
8
+
9
+	// To use, simply rename or copy this file to includes/configuration.inc.php, and begin making modifications
10
+	// to the configuration constants as it makes sense for your PHP and docroot installation.
11
+
12
+	define('SERVER_INSTANCE', 'dev');
13
+
14
+	switch (SERVER_INSTANCE) {
15
+		case 'dev':
16
+			define ('__DOCROOT__', '/var/www');
17
+			define ('__VIRTUAL_DIRECTORY__', '');
18
+			define ('__SUBDIRECTORY__', '/quinta');
19
+
20
+			define('DB_CONNECTION_1', serialize(array(
21
+				'adapter' => 'MySqli5',
22
+				'server' => 'localhost',
23
+				'port' => null,
24
+				'database' => 'quintacms',
25
+				'username' => 'root',
26
+				'password' => '',
27
+				'profiling' => false)));
28
+			break;
29
+
30
+		case 'test':
31
+			break;
32
+
33
+		case 'stage':
34
+			break;
35
+
36
+		case 'prod':
37
+			break;
38
+	}
39
+
40
+	define('ALLOW_REMOTE_ADMIN', false);
41
+	define ('__URL_REWRITE__', 'none');
42
+
43
+	define ('__DEVTOOLS_CLI__', __DOCROOT__ . __SUBDIRECTORY__ . '/../cli');
44
+	define ('__INCLUDES__', __DOCROOT__ .  __SUBDIRECTORY__ . '/../includes');
45
+	define ('__QCODO__', __INCLUDES__ . '/qcodo');
46
+	define ('__QCODO_CORE__', __INCLUDES__ . '/qcodo/_core');
47
+	define ('__DATA_CLASSES__', __INCLUDES__ . '/data_classes');
48
+	define ('__DATAGEN_CLASSES__', __INCLUDES__ . '/data_classes/generated');
49
+	define ('__DATA_META_CONTROLS__', __INCLUDES__ . '/data_meta_controls');
50
+	define ('__DATAGEN_META_CONTROLS__', __INCLUDES__ . '/data_meta_controls/generated');
51
+
52
+	define('__ERROR_LOG__', __DOCROOT__ . '/../error_log');
53
+	define('__QCODO_LOG__', __DOCROOT__ . '/../log');
54
+	define('__TEST_CASES__', __DOCROOT__ . '/../tests');
55
+
56
+	define ('__FORM_DRAFTS__', __SUBDIRECTORY__ . '/drafts');
57
+	define ('__PANEL_DRAFTS__', __SUBDIRECTORY__ . '/drafts/dashboard');
58
+
59
+	// Examples and Devtools are deprecated as of 0.4.0, but these constants are still here to
60
+	// support any QPM packages that may still want to use them
61
+	define ('__DEVTOOLS__', null);
62
+	define ('__EXAMPLES__', null);
63
+
64
+	define ('__JS_ASSETS__', __SUBDIRECTORY__ . '/assets/js');
65
+	define ('__CSS_ASSETS__', __SUBDIRECTORY__ . '/assets/css');
66
+	define ('__IMAGE_ASSETS__', __SUBDIRECTORY__ . '/assets/images');
67
+	define ('__PHP_ASSETS__', __SUBDIRECTORY__ . '/assets/php');
68
+
69
+	if (!ini_get('date.timezone'))
70
+		date_default_timezone_set('America/Los_Angeles');
71
+
72
+	define('ERROR_LOG_FLAG', false);
73
+//	define('ERROR_FRIENDLY_PAGE_PATH', '/absolute/path/to/friendly_error_page.html');
74
+//	define('ERROR_FRIENDLY_AJAX_MESSAGE', 'Oops!  An error has occurred.\r\n\r\nThe error was logged, and we will take a look into this right away.');
75
+
76
+	define('QCODO_LOG_LEVEL', 6);
77
+?>

+ 234
- 0
includes/quinta/Quinta.class.php View File

@@ -0,0 +1,234 @@
1
+<?php
2
+
3
+if (!defined('QUINTA.CLASS.PHP')){
4
+define('QUINTA.CLASS.PHP',1);
5
+
6
+	/**
7
+	 * Include Quinta configurations - this assumes that this config file is in the same directory, you
8
+	 * can adjust this here if you prefer to put either somewhere else.
9
+	 */
10
+	require(dirname(__FILE__) . '/quinta_config.php');
11
+
12
+	/**
13
+	 * Include to pull in the QCodo framework and configuration - this also runs
14
+	 * QApplication.class.php ..
15
+	 */
16
+	require(__QCODO_ROOT__  . '/includes/prepend.inc.php');
17
+	
18
+	/**
19
+	 * The Quinta class is an abstract class that statically provides global
20
+	 * information and global utilities for the entire CMS application. Since
21
+	 * it inherits QApplication, it also provides the connection to the QCodo
22
+	 * framework.
23
+	 *
24
+	 * Custom constants for Quinta CMS, as well as global variables and global
25
+	 * methods are declared statically here. Additional initializations for the CMS
26
+	 * should also be here - but remember, QApplication has already been initialized
27
+	 * in prepend.inc.php so do not use parent::
28
+	 *
29
+	 * This may also be used to override QApplication (eg. for BrowserType ..)
30
+	 *
31
+	 *@todo  move things from IndexPage to here ..
32
+	 *@package Quinta
33
+	 * @subpackage Classes
34
+	 */
35
+	abstract class Quinta extends QApplication
36
+	{
37
+		/**
38
+		 *  @var string IsSsl true if $_SERVER['HTTPS'] is set, indicating the request was secure
39
+		 */
40
+		public static $IsSsl = false;
41
+		/**
42
+		 *  @var string ServerName contains $_SERVER['SERVER_NAME']
43
+		 */
44
+		public static $ServerName;
45
+		/**
46
+		 *  @var string ServerPort contains $_SERVER['SERVER_PORT'], the port webserver listens on
47
+		 */
48
+		public static $ServerPort;
49
+
50
+		/**
51
+		*  @var array QuintaClasses - a map array of classes to filenames used by the autoloader.
52
+		*/
53
+		public static $QuintaClasses = array();
54
+		
55
+		/**
56
+		 *  @var array QuintaIncludePaths - a map array of paths to be searched by the autoloader.
57
+		 */
58
+		public static $QuintaIncludePaths = array(
59
+			__QUINTA_LOCAL_CONTROLLERS__,
60
+			__QUINTA_LOCAL_MODULES__,
61
+			__QUINTA_LOCAL_MODELS__,
62
+			__QUINTA_LOCAL_METACONTROLS__,
63
+			__QUINTA_CONTRIB_CONTROLLERS__,
64
+			__QUINTA_CONTRIB_MODULES__,
65
+			__QUINTA_CONTRIB_MODELS__,
66
+			__QUINTA_CONTRIB_METACONTROLS__,
67
+			__QUINTA_CORE_CONTROLLERS__,
68
+			__QUINTA_CORE_MODULES__,
69
+			__QUINTA_CORE_MODELS__,
70
+			__QUINTA_CORE_METACONTROLS__,
71
+			__QUINTA_CORE_UTILITIES__,
72
+			);
73
+
74
+
75
+		public static  $SupportEmailLink;
76
+
77
+		/**
78
+		 * Initialize Quinta data, setting autoloader data, servername and other misc ..
79
+		 */
80
+		public static function Init()
81
+		{
82
+			spl_autoload_register(array('Quinta', 'Autoload'), true, true);
83
+			// set the Form state handler to use SESSION ..
84
+			QForm::$FormStateHandler = 'QSessionFormStateHandler';
85
+			Quinta::$ServerName = $_SERVER['SERVER_NAME'];
86
+			Quinta::$ServerPort = $_SERVER['SERVER_PORT'];
87
+			Quinta::$SupportEmailLink = ' <a href="mailto:' . STORE_EMAIL_ADDRESS . '">' . STORE_EMAIL_ADDRESS . '</a> ';
88
+
89
+			$strSsl =  array_key_exists( 'HTTPS', $_SERVER) ? $_SERVER['HTTPS'] : '';
90
+			if(!empty($strSsl))
91
+				Quinta::$IsSsl = true;
92
+							
93
+			///@todo make me international ..
94
+			setlocale(LC_MONETARY, 'en_US');
95
+			
96
+			//load an array of filenames for quick autoloading
97
+			/// @todo change this to just look on demand ..see Autoload
98
+			foreach( self::$QuintaIncludePaths as $strPath){
99
+				if (is_dir($strPath)){
100
+					if ($dh = opendir($strPath)){
101
+						while (($strFileName = readdir($dh)) !== false){
102
+							$pos = strrpos( $strFileName, '.class.php' );
103
+							if(false === $pos || true == strpos( $strFileName , '~' ) )
104
+								continue;
105
+							$strClassName = substr( $strFileName, 0, $pos );
106
+							if( ! array_key_exists(strtolower($strClassName), self::$QuintaClasses) )
107
+								self::$QuintaClasses[strtolower($strClassName)] = $strPath . '/' . $strFileName;
108
+						}
109
+						closedir($dh);
110
+					}
111
+				}
112
+			}
113
+		}
114
+
115
+		/**
116
+		 * This is called by the PHP5 Autoloader.  This method overrides the
117
+		 * one in QApplication - if Quinta fails to load the class, we attempt
118
+		 * to load it from QApplication classes here
119
+		 * @todo change this to just look on demand ..
120
+		 * @return void
121
+		 */
122
+		public static function Autoload($strClassName){
123
+			//some Qcodo generated QQ classes go in the same file as the ORM class ..
124
+			$aryQcodoPrefixes = array(
125
+							'QQNode',
126
+							);
127
+			//work around for QCodo classes in same file ..
128
+			foreach($aryQcodoPrefixes as $strPrefix)
129
+				if( false !== strpos( $strClassName, $strPrefix ) )
130
+					$strClassName = substr( $strClassName, strlen( $strPrefix ) );
131
+			
132
+			// first check Quinta directories ..
133
+			if(array_key_exists(strtolower($strClassName), Quinta::$QuintaClasses) )
134
+			{
135
+				require_once(Quinta::$QuintaClasses[strtolower($strClassName)]);
136
+				return true;
137
+			}
138
+			// Otherwise use the Qcodo Autoloader
139
+			if (parent::Autoload($strClassName))
140
+				return true;
141
+			return false;
142
+		}
143
+
144
+		/**
145
+		 * This will redirect the user to a new web location.  This can be a relative or absolute web path, or it
146
+		 * can be an entire URL. This overrides the QApplication::Redirect to work for offsite redirects and to
147
+		 * support browsers like Opera and Safari that do not accept document.location assigns.
148
+		 *
149
+		 *  - any string starting with / is assumed to be local.
150
+		 *  - any string with http:// or https:// is assumed to be offsite.
151
+		 *
152
+		 *@todo - support SEO friendly URLS .. and ssl (buggy, needs time ..)
153
+		 *
154
+		 *@param string strLocation - the URL to which the user is redirected
155
+		 * @return void
156
+		 */
157
+		public static function Redirect($strLocation, $blnUseSsl=false)
158
+		{
159
+		   //ob_clean();
160
+		   $strProtocol = '';
161
+			
162
+			if($blnUseSsl)
163
+				$strProtocol =  'https://';
164
+			else    
165
+				$strProtocol =  'http://';
166
+				
167
+			if( false !== strpos( $strLocation, 'http://' ) || false !== strpos( $strLocation, 'https://' ) ){
168
+
169
+				/* candidate:
170
+				if (!headers_sent())
171
+				{
172
+					header('Location: '. $strLocation );
173
+				} else {
174
+					$strOutPut = '<script type="text/javascript">window.location.href="'. $strLocation . '";</script>';
175
+					$strOutPut .= '<noscript><meta http-equiv="refresh" content="0;url=' . $strLocation . '" /></noscript>';
176
+					_p($strOutPut);
177
+					exit;
178
+				}
179
+*/
180
+				ob_clean();
181
+				header('Location: ' . $strLocation);
182
+				if( Quinta::IsBrowser(QBrowserType::InternetExplorer ) )
183
+					header('Connection: close');
184
+			}elseif( Quinta::IsBrowser( QBrowserType::Opera) || Quinta::IsBrowser( QBrowserType::Safari) ){
185
+				//these two do not support document.location redirects ..??
186
+				ob_clean();
187
+//                header('Location: ' . $strProtocol  . Quinta::$ServerName . $strLocation);
188
+				header('Location: ' . $strLocation);
189
+			}else
190
+				parent::Redirect($strLocation);
191
+			exit;
192
+		}
193
+		
194
+		/**
195
+		* Quinta access control
196
+		* Note: this is only a sketch of an idea, in the event of a real access control you will be notified ..
197
+		* ie. THIS DOES NOTHING YET. And it will definitely change.
198
+		*@todo  implement access control
199
+		*/
200
+		public static function CheckAccess($aryAllowGroups){
201
+			return false;
202
+			if(sizeof($aryAllowGroups) == 0)
203
+				return true;
204
+			$blnLoggedIn = false;
205
+			$objAccount = null;
206
+			$objPerson = null;
207
+			$aryUsergroups = array();
208
+
209
+			$blnAllow = false;
210
+
211
+			if( isset($_SESSION) && isset($_SESSION['AccountLogin']) )
212
+			{
213
+				$objAccount = unserialize($_SESSION['AccountLogin']);
214
+				if( $objAccount instanceof Account )
215
+				{
216
+					$blnLoggedIn = true;
217
+					$objPerson = $objAccount->Person;
218
+				}
219
+			}
220
+			if($blnLoggedIn && $objPerson)
221
+				$aryUsergroups = $objPerson->GetUsergroupArray();
222
+			foreach( $aryUsergroups as $objGroup )
223
+				if(in_array($aryAllowGroups, $objGroup->Name ))
224
+					$blnAllow = true;
225
+			return $blnAllow;
226
+		}
227
+		
228
+	}//end class
229
+
230
+	//now initialize Quinta data
231
+	Quinta::Init();
232
+}//end define
233
+   
234
+?>

+ 204
- 0
includes/quinta/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 Quinta
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
includes/quinta/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
includes/quinta/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 Quinta
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
includes/quinta/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
includes/quinta/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 Quinta
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
includes/quinta/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
includes/quinta/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 Quinta
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
includes/quinta/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
includes/quinta/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 Quinta
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
includes/quinta/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
includes/quinta/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 Quinta
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
includes/quinta/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
includes/quinta/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 Quinta
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
includes/quinta/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
includes/quinta/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 Quinta
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
includes/quinta/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
includes/quinta/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 Quinta
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
includes/quinta/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
includes/quinta/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 Quinta
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
includes/quinta/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
includes/quinta/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 Quinta
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
includes/quinta/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
includes/quinta/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