Index: branches/1.0.x/custom/install/.htaccess
===================================================================
diff -u
--- branches/1.0.x/custom/install/.htaccess (revision 0)
+++ branches/1.0.x/custom/install/.htaccess (revision 12743)
@@ -0,0 +1 @@
+deny from all
\ No newline at end of file
Index: branches/1.0.x/custom/install/module_info.xml
===================================================================
diff -u
--- branches/1.0.x/custom/install/module_info.xml (revision 0)
+++ branches/1.0.x/custom/install/module_info.xml (revision 12743)
@@ -0,0 +1,6 @@
+
+
+ Custom
+ Development Kit
+ custom/install/img/icon_development_kit.gif
+
\ No newline at end of file
Index: branches/1.0.x/custom/install/install_data.sql
===================================================================
diff -u
--- branches/1.0.x/custom/install/install_data.sql (revision 0)
+++ branches/1.0.x/custom/install/install_data.sql (revision 12743)
@@ -0,0 +1,19 @@
+# place here only sql queries, that were executed on live AND dev sites !!!
+
+INSERT INTO Permissions VALUES(DEFAULT, 'custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.view', 11, 1, 1, 0);
+
+INSERT INTO Modules VALUES ('Custom', 'custom/', 'custom-sections', DEFAULT, 1, 10, 'custom/', 0, NULL);
+
+
+# ===== SQLs above this line already on LIVE ================================================================================================
+
+# place here only sql queries, that were executed on dev site !!!
+
+
+# ===== SQLs above this line already on DEV ========================================================================================================
+
+# place here only sql queries, that were executed on prod server !!!
Index: branches/1.0.x/custom/install/install_order.txt
===================================================================
diff -u
--- branches/1.0.x/custom/install/install_order.txt (revision 0)
+++ branches/1.0.x/custom/install/install_order.txt (revision 12743)
@@ -0,0 +1 @@
+203
\ No newline at end of file
Index: branches/1.0.x/custom/install/english.lang
===================================================================
diff -u
--- branches/1.0.x/custom/install/english.lang (revision 0)
+++ branches/1.0.x/custom/install/english.lang (revision 12743)
@@ -0,0 +1,19 @@
+
+ m/d/Yg:i Am/d/Yg:i:s A.,utf-82
+
+ R29vZA==
+ UGhvbmU=
+ RGF0YSBmaWxl
+ R29vZA==
+ Q3VzdG9t
+ RGVmYXVsdA==
+ V2lkZ2V0cw==
+ QWRkaW5nIFdpZGdldA==
+ RWRpdGluZyBXaWRnZXQ=
+ Q3VzdG9t
+ TmV3IFdpZGdldA==
+ V2lkZ2V0cw==
+ TmV3IFdpZGdldA==
+
+
+
\ No newline at end of file
Index: branches/1.0.x/custom/install/install_schema.sql
===================================================================
diff -u
--- branches/1.0.x/custom/install/install_schema.sql (revision 0)
+++ branches/1.0.x/custom/install/install_schema.sql (revision 12743)
@@ -0,0 +1,27 @@
+# place here only sql queries, that were executed on live AND dev sites !!!
+
+CREATE TABLE Widgets (
+ WidgetId int(11) NOT NULL AUTO_INCREMENT,
+ Title varchar(255) NOT NULL DEFAULT '',
+ Description text,
+ Email varchar(255) NOT NULL DEFAULT '',
+ `Type` tinyint(4) NOT NULL DEFAULT '1',
+ Phone varchar(50) NOT NULL DEFAULT '',
+ Qty double NOT NULL DEFAULT '0',
+ `Status` tinyint(4) NOT NULL DEFAULT '2',
+ CreatedOn int(11) DEFAULT NULL,
+ Good tinyint(4) NOT NULL DEFAULT '0',
+ BirthTime int(10) unsigned DEFAULT NULL,
+ Image text,
+ `DataFile` text,
+ PRIMARY KEY (WidgetId)
+);
+
+# ===== SQLs above this line already on LIVE ================================================================================================
+
+# place here only sql queries, that were executed on dev site !!!
+
+
+# ===== SQLs above this line already on DEV ========================================================================================================
+
+# place here only sql queries, that were executed on prod server !!!
Index: branches/1.0.x/custom/install/img/.htaccess
===================================================================
diff -u
--- branches/1.0.x/custom/install/img/.htaccess (revision 0)
+++ branches/1.0.x/custom/install/img/.htaccess (revision 12743)
@@ -0,0 +1 @@
+allow from all
\ No newline at end of file
Index: branches/1.0.x/custom/install/img/icon_development_kit.gif
===================================================================
diff -u
Binary files differ
Index: branches/1.0.x/custom/install/upgrades.sql
===================================================================
diff -u
--- branches/1.0.x/custom/install/upgrades.sql (revision 0)
+++ branches/1.0.x/custom/install/upgrades.sql (revision 12743)
@@ -0,0 +1,8 @@
+# ===== v 1.0.0 =====
+
+# ===== v 1.0.1 =====
+UPDATE Modules SET LoadOrder = 10 WHERE `Name` = 'Custom';
+
+# ===== v 1.0.2-B1 =====
+ALTER TABLE Widgets CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL;
+UPDATE Modules SET TemplatePath = 'custom/' WHERE Name = 'Custom';
Index: branches/1.0.x/custom/install.php
===================================================================
diff -u
--- branches/1.0.x/custom/install.php (revision 0)
+++ branches/1.0.x/custom/install.php (revision 12743)
@@ -0,0 +1,33 @@
+toolkit;
+ /* @var $toolkit kInstallToolkit */
+ }
+
+ $application =& kApplication::Instance();
+ $application->Init();
+
+ if ($application->RecallVar('user_id') != -1) {
+ die('restricted access!');
+ }
+
+ $toolkit->RunSQL('/' . $module_folder .'/install/install_schema.sql');
+ $toolkit->RunSQL('/' . $module_folder .'/install/install_data.sql');
+ $toolkit->ImportLanguage('/' . $module_folder .'/install/english');
+
+ $toolkit->finalizeModuleInstall($module_folder, false);
\ No newline at end of file
Index: branches/1.0.x/custom/README
===================================================================
diff -u
--- branches/1.0.x/custom/README (revision 0)
+++ branches/1.0.x/custom/README (revision 12743)
@@ -0,0 +1,179 @@
+INTRODUCTION TO IN-PORTAL
+-------------------------
+
+In-Portal is Open Source object-oriented framework that is developed
+in PHP and provides quick and easy way to build websites and web applications.
+
+In-Portal Framework has modular structure that allows painlessly
+add and extend already existing features via new modules.
+
+In-Portal Community greatly appreciates any type of involvement
+and contributions to the project.
+
+Please visit
+
+ http://www.in-portal.org/contribute.html
+
+to see how You can participate and be a part of In-Portal Community.
+
+
+THIS DEVELOPMENT KIT
+--------------------
+
+This README file provides you with the basic understanding and content
+of provided Development Kit.
+
+Latest version of this Development Kit can be downloaded here
+
+ http://www.in-portal.org
+
+ http://source.in-portal.org/custom/tags
+
+This Development Kit is implemented and called "Custom" so it can be used
+by developers as HOWTO create new modules as well as extend existing
+modules not worrying about upgrading issues in the future.
+
+This module contains samples of the most basic and widely used features
+of In-Portal. While the code might look very simple, though it provides
+a quick and effective way to unlock most powerful capabilities for
+In-Portal customization on many levels.
+
+
+FOLDER STRUCTURE
+----------------
+
+1. All In-Portal modules have the same folder structure, that provides a quick
+access to each aspect of it's functionality. Top folder is the module name
+in a LOWERCASE. It is "custom" for "Custom" module, "in-link" for "In-Link"
+module and so on.
+
+2. Inside there are three (3) main folders:
+
+ * admin_templates/ - templates and resources (images, javascript, etc.),
+ these are used Admin ONLY.
+
+ * units/ - business logic of the module, used on both Front-end and Admin.
+
+ * install/ - contains files used to install the module into existing
+ In-Portal installation.
+
+
+2.1. Content of "admin_templates/" folder.
+
+This folder contains one (1) sub-folder for each Section in Admin console's
+main navigation menu (in left frame). Each such folder should ONLY contain
+templates ("*.tpl" files) used for displaying given Section in the main
+navigation menu in Admin console.
+
+Besides that there are one special purpose folder called "img/".
+This folder contains all kind of images divided by categories (usage).
+Images from each category (usage) are located in special sub-folder
+associated with the given image category.
+
+There are three (3) main folders
+
+ * "icons/" - images, that will be used as Section icons in the
+ main navigation menu next to the actual titles;
+ NOTE one image per one menu Section, but the same image could be used
+ for multiple menu Section.
+
+ * "itemicons/" - images, that will be shown on the left from each
+ row in grid of records (also called list).
+
+ * "toolbar/" - images, that are used to draw buttons on toolbar
+ on module templates that uses toolbar-based interface ONY.
+
+ NOTE that it is not restricted to create any other folders
+ and place images inside them or in the "img/" folder itself.
+
+ NOTE it is also common practice to create a "js/" sub-folder
+ and place all javascript scripts related to the Admin console inside.
+
+
+2.2. Content of "units/" folder
+
+This folder can contain unlimited number of sub-folders.
+
+Each sub-folder should contain "*.php" files with the business logic
+implementation for the given functionality.
+
+Usually there are three (3) files
+
+ - Unit Config - main file, that allows to connect a given Unit into the framework;
+
+ - Event Handler - all code, that will manipulate with the data is located here;
+
+ - Tag Processor - all code, that is used to output the data to a user
+ in any requested form is located here.
+
+ It is NOT permitted to create files in "units/" folder itself, only sub-folder
+ as described above.
+
+ HOWEVER it is not prohibited to place a group of "unit" type folders inside
+ other "unit" type folders to logically divide them into groups.
+ Example, "units/logs/visits/" and "units/logs/summary/" both located inside
+ of "units/logs" folder, but each has it's own Unit Config, Event Handler, Tag Proccesor.
+
+
+2.3. Content of "install/" folder.
+
+This folder contains files used to during the installation which will automaticall install
+
+ * install Language Phrases
+ * install Email Events
+ * apply Database changes (e.g. new tables)
+
+associated with given module.
+
+There are also "upgrades.sql" (required) and "upgades.php" (not required). These files
+allow to maintain module version based on database structure control.
+
+
+3. BASIC UNDERSTANDING AND USAGE
+--------------------------------
+
+Visual part of Admin console consists of tree (3) parts
+
+ * Top - contains website logo, logout link and some other things.
+
+ * Left - contains main navigation menu (list of Sections) and used to control all functionality.
+
+ * Right - main part that show the actual Section and data.
+
+
+3.1 Adding a new Section item
+
+As we know left part of Admin console contains main navigation menu
+so it's crucial to learn add a new Sections.
+
+New menu Sections are added using Unit Config files (desribed above).
+Each unit can have unlimited number of menu Sections (and Sub-Sections)
+at any place inside the main navigation menu.
+
+To add a new section you need to add it to 'Sections' array descrived in Unit Config file
+of corresponding/related Unit, for example open "custom/units/widgets/widgets_config.php"
+
+ 'Sections' => Array (
+ 'custom' => Array (
+ 'parent' => 'in-portal:root',
+ 'icon' => 'custom',
+ 'label' => 'la_title_SampleMenuItem',
+ 'url' => Array ('t' => 'custom/widgets/widget_list', 'pass' => 'm'),
+ 'permissions' => Array ('view', 'add', 'edit', 'delete'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+ ),
+
+
+4. WHAT'S NEXT
+--------------
+
+While we can write thousands of lines in this file we decided
+to put all our knowledge base online using old good Wiki.
+
+Please feel free to read, ask questions and participate in In-Portal Community!
+
+ http://guide.in-portal.org/eng/index.php
+
+ http://www.in-portal.org/contribute.html
Index: branches/1.0.x/custom/admin_templates/img/logo_bg.gif
===================================================================
diff -u
Binary files differ
Index: branches/1.0.x/custom/admin_templates/img/icons/icon46_conf_custom.png
===================================================================
diff -u
Binary files differ
Index: branches/1.0.x/custom/admin_templates/img/icons/icon24_conf_custom.png
===================================================================
diff -u
Binary files differ
Index: branches/1.0.x/custom/admin_templates/img/icons/icon24_custom.png
===================================================================
diff -u
Binary files differ
Index: branches/1.0.x/custom/admin_templates/img/toolbar/dummy
===================================================================
diff -u
--- branches/1.0.x/custom/admin_templates/img/toolbar/dummy (revision 0)
+++ branches/1.0.x/custom/admin_templates/img/toolbar/dummy (revision 12743)
@@ -0,0 +1 @@
\ No newline at end of file
Index: branches/1.0.x/custom/admin_templates/widgets/widget_list.tpl
===================================================================
diff -u
--- branches/1.0.x/custom/admin_templates/widgets/widget_list.tpl (revision 0)
+++ branches/1.0.x/custom/admin_templates/widgets/widget_list.tpl (revision 12743)
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
alt=""/>
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/1.0.x/custom/admin_templates/widgets/widget_edit.tpl
===================================================================
diff -u
--- branches/1.0.x/custom/admin_templates/widgets/widget_edit.tpl (revision 0)
+++ branches/1.0.x/custom/admin_templates/widgets/widget_edit.tpl (revision 12743)
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/1.0.x/custom/units/.htaccess
===================================================================
diff -u
--- branches/1.0.x/custom/units/.htaccess (revision 0)
+++ branches/1.0.x/custom/units/.htaccess (revision 12743)
@@ -0,0 +1 @@
+deny from all
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_link_eh.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_link_eh.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_link_eh.php (revision 12743)
@@ -0,0 +1,188 @@
+ Array ('self' => true),
+
+ # front
+ 'OnCustomEvent2' => Array ('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Permission exceptions
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $skip_permissions_check_events = Array (
+ 'OnAnotherCustomEvent',
+ );
+
+ if ( in_array($event->Name, $skip_permissions_check_events) ) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Updates structure config
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ # 1. Regular Fields from
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields'); #get regular fields
+// $fields['Status']['default'] = 1; #add/edit configuration (make default = 1)
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields); #save fields
+
+ # 2. Virtual Fields from /in-link/units/links/links_config.php
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields'); #get virtual fields
+// $virtual_fields['UserName']['default'] = ''; #add/edit configuration
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); #save virtual fields
+ }
+
+ /**
+ * Sets custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ # identifying event based on special and setting filter
+ if ($event->Special == 'custom-special') {
+// $object->addFilter('primary_filter', '%1$s.Status = ' . STATUS_DISABLED);
+ }
+
+ # identifying event based not admin condition and setting filter
+ if (!$this->Application->isAdminUser) {
+// $object->addFilter('status_filter', '%1$s.Status = ' . STATUS_ACTIVE);
+ }
+ }
+
+ /**
+ * Before new item created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+
+ }
+
+ /**
+ * Before existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+
+ }
+
+ /**
+ * Before item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ parent::OnBeforeItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemLoad(&$event)
+ {
+ parent::OnBeforeItemLoad($event);
+
+
+ }
+
+
+ /**
+ * After new item created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+
+ }
+
+ /**
+ * After existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+
+ }
+
+ /**
+ * After item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_link_tp.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_link_tp.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_link_tp.php (revision 12743)
@@ -0,0 +1,56 @@
+getObject($params);
+ /* @var $object kDBItem */
+
+ $o = '';
+
+ // do some custom stuff here
+ if ( $object->isLoaded() ) {
+ $o = $object->GetField($this->SelectParam($params, 'name,field') ); #field Formatter applied
+
+// $o = $object->GetDBField($this->SelectParam($params, 'name,field') ); #field Formatter NOT applied
+ }
+
+ // in case if no data found
+ if ($o != '') {
+ $this->Application->Parser->DataExists = true;
+ }
+
+ return $o;
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/sections_config.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/sections_config.php (revision 0)
+++ branches/1.0.x/custom/units/sections/sections_config.php (revision 12743)
@@ -0,0 +1,86 @@
+ 'custom-sections',
+
+ 'ConfigPriority' => 2,
+
+ # Event handler class used for HOOKing to existing events (ie. )
+ 'EventHandlerClass' => Array ('class' => 'CustomEventHandler', 'file' => 'custom_eh.php', 'build_event' => 'OnBuild'),
+
+ # Defined to draw new sections (if any) in left nav. tree, normally each unit has it's own Tag Processor
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+
+ # Extend/override already existing classes (ie. Event Handlers, Tag Processors, Helpers)
+ 'RegisterClasses' => Array (
+
+ # extend default User core/units/users/users_tag_processor.php / users_event_handler.php
+// Array ('pseudo' => 'u_TagProcessor', 'class' => 'EUserTagProcessor', 'file' => 'e_user_tp.php'),
+// Array ('pseudo' => 'u_EventHandler', 'class' => 'EUserEventHandler', 'file' => 'e_user_eh.php'),
+
+ # extend default Product classes /in-commerce/units/products/products_tag_processor.php / products_event_handler.php
+// Array ('pseudo' => 'p_TagProcessor', 'class' => 'EProductTagProcessor', 'file' => 'e_product_tp.php'),
+// Array ('pseudo' => 'p_EventHandler', 'class' => 'EProductEventHandler', 'file' => 'e_product_eh.php'),
+
+ # extend default Link /in-link/units/links/link_tag_processor.php / links_event_handler.php
+// Array ('pseudo' => 'l_TagProcessor', 'class' => 'ELinkTagProcessor', 'file' => 'e_link_tp.php'),
+// Array ('pseudo' => 'l_EventHandler', 'class' => 'ELinkEventHandler', 'file' => 'e_link_eh.php'),
+
+ ),
+
+ # Replace/substiture any admin default templates with custom ones
+ 'ReplacementTemplates' => Array (
+ # replace default image block with custom template
+// 'incs/image_blocks' => 'custom/incs/image_blocks',
+
+ # replace default edit link template
+// 'in-links/links/links_edit' => 'custom/links/links_edit',
+
+ # replace default edit category template
+// 'categories/categories_edit' => 'custom/categories/categories_edit',
+ ),
+
+ # Hooks to events that may call any other events
+ 'Hooks' => Array (
+
+ # hook to category OnAfterConfigRead event called to customize category configuration settings
+ /*Array (
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'c',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array ('OnAfterConfigRead'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '*',
+ 'DoEvent' => 'OnModifyCategoriesConfig',
+ ),*/
+ ),
+
+ 'PermSection' => Array ('main' => 'custom', 'email' => 'custom:configuration_email'),
+
+ # New sections in left navigation
+ /*'Sections' => Array (
+ 'custom' => Array (
+ 'parent' => 'in-portal:root',
+ 'icon' => 'conf_custom',
+ 'label' => 'la_title_Custom',
+ 'url' => Array ('t' => 'index', 'pass' => 'm'),
+ 'permissions' => Array ('view'),
+ 'priority' => 2.4,
+ 'container' => true,
+ 'type' => stTREE,
+ ),
+
+ ),*/
+
+ );
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_user_tp.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_user_tp.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_user_tp.php (revision 12743)
@@ -0,0 +1,38 @@
+getObject();
+ /* @var $object kDBItem */
+
+ $ret = '';
+ $newline = '
';
+
+ if ($object->isLoaded()) {
+ $ret = $object->GetField('Street') ? $object->GetField('Street') . $newline : '';
+ $ret .= $object->GetField('Street2') ? $object->GetField('Street2') . $newline : '';
+ $ret .= $object->GetField('City') ? $object->GetField('City') . ', ' : '';
+ $ret .= $object->GetField('State') ? $object->GetField('State') . ' ' : '';
+ $ret .= $object->GetField('Zip') ? $object->GetField('Zip') . $newline : '';
+ $ret .= $object->GetField('Country');
+ }
+
+ return $ret;
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_user_eh.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_user_eh.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_user_eh.php (revision 12743)
@@ -0,0 +1,188 @@
+ Array ('self' => true),
+
+ # front
+ 'OnCustomEvent2' => Array ('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Permission exceptions
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $skip_permissions_check_events = Array (
+ 'OnAnotherCustomEvent',
+ );
+
+ if ( in_array($event->Name, $skip_permissions_check_events) ) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Updates structure config
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ # 1. Regular Fields from /core/units/users/users_config.php
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields'); #get regular fields
+// $fields['Status']['default'] = 1; #add/edit configuration (make default = 1)
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields); #save regular fields
+
+ # 2. Virtual Fields from /core/units/users/users_config.php
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields'); #get virtual fields
+// $virtual_fields['FullName']['default'] = ''; #add/edit configuration
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); #save virtual fields
+ }
+
+ /**
+ * Sets custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ # identifying event based on special and setting filter
+ if ( $event->Special == 'custom-special' ) {
+// $object->addFilter('primary_filter', '%1$s.Status = ' . STATUS_DISABLED);
+ }
+
+ # identifying event based not admin condition and setting filter
+ if (!$this->Application->isAdminUser) {
+// $object->addFilter('status_filter', '%1$s.Status = ' . STATUS_ACTIVE);
+ }
+ }
+
+ /**
+ * Before new item created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+
+ }
+
+ /**
+ * Before existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+
+ }
+
+ /**
+ * Before item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ parent::OnBeforeItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemLoad(&$event)
+ {
+ parent::OnBeforeItemLoad($event);
+
+
+ }
+
+
+ /**
+ * After new item created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+
+ }
+
+ /**
+ * After existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+
+ }
+
+ /**
+ * After item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/custom_eh.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/custom_eh.php (revision 0)
+++ branches/1.0.x/custom/units/sections/custom_eh.php (revision 12743)
@@ -0,0 +1,39 @@
+Conn =& $this->Application->GetADODBConnection();
+ }
+
+ /**
+ * [HOOK] Modify config stored in "categories_config.php" without extending CategoriesEventHandler class
+ *
+ * @param kEvent $event
+ */
+ function OnModifyCategoriesConfig(&$event)
+ {
+ # get Fields configuration from /core/units/categories/categories_config.php
+ $fields = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'Fields');
+
+ # set configuration fields
+ $this->Application->setUnitOption($event->MasterEvent->Prefix, 'Fields', $fields);
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_product_tp.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_product_tp.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_product_tp.php (revision 12743)
@@ -0,0 +1,28 @@
+ Array ('self' => true),
+
+ # front
+ 'OnCustomEvent2' => Array ('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Permission exceptions
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $skip_permissions_check_events = Array (
+ 'OnAnotherCustomEvent',
+ );
+
+ if ( in_array($event->Name, $skip_permissions_check_events) ) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Updates structure config
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ # 1. Regular Fields from /in-commerce/units/products/products_config.php
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields'); #get regular fields
+// $fields['Status']['default'] = 1; #add/edit field configuration (make default = 1)
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields); #save regular fields
+
+
+ # 2. Virtual Fields from /in-commerce/units/products/products_config.php
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields'); #get virtual fields
+// $virtual_fields['Qty']['default'] = 1; #add/edit field configuration
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); # save virtual fields
+ }
+
+ /**
+ * Sets custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ # identifying event based on special and setting filter
+ if ( $event->Special == 'custom-special' ) {
+// $object->addFilter('primary_filter', '%1$s.Status = '.STATUS_DISABLED);
+ }
+
+ # identifying event based not admin condition and setting filter
+ if (!$this->Application->isAdminUser) {
+// $object->addFilter('status_filter', '%1$s.Status = '.STATUS_ACTIVE);
+ }
+ }
+
+ /**
+ * Before new item created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+
+ }
+
+ /**
+ * Before existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+
+ }
+
+ /**
+ * Before item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ parent::OnBeforeItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemLoad(&$event)
+ {
+ parent::OnBeforeItemLoad($event);
+
+
+ }
+
+
+ /**
+ * After new item created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+
+ }
+
+ /**
+ * After existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+
+ }
+
+ /**
+ * After item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/helpers/sample_helper.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/helpers/sample_helper.php (revision 0)
+++ branches/1.0.x/custom/units/helpers/sample_helper.php (revision 12743)
@@ -0,0 +1,14 @@
+ 'custom-helpers',
+
+ 'EventHandlerClass' => Array ('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+
+ 'RegisterClasses' => Array (
+ Array ('pseudo' => 'SampleHelper', 'class' => 'SampleHelper', 'file' => 'sample_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'),
+ ),
+ );
\ No newline at end of file
Index: branches/1.0.x/custom/units/widgets/widgets_config.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/widgets/widgets_config.php (revision 0)
+++ branches/1.0.x/custom/units/widgets/widgets_config.php (revision 12743)
@@ -0,0 +1,191 @@
+ 'widget',
+
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file'=> '', 'build_event' => 'OnListBuild'),
+
+ 'EventHandlerClass' => Array ('class' => 'WidgetEventHandler', 'file' => 'widget_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'WidgetTagProcessor', 'file' => 'widget_tp.php', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'RewriteListener' => 'WidgetRewriteListener',
+
+ 'IDField' => 'WidgetId',
+
+ 'StatusField' => Array ('Status'),
+
+ 'TableName' => TABLE_PREFIX.'Widgets',
+
+ /*
+ 'ForeignKey' => 'ParentId', // field title in TableName, linking record to a parent
+ 'ParentTableKey' => 'ParentId', // id (or other key) field title in parent's table
+ 'ParentPrefix' => 'parent',
+ 'AutoDelete' => true, // delete these items when parent is being deleted
+ 'AutoClone' => true, // clone these items when parent is being cloned
+ */
+
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array ('widget' => '!la_title_AddingWidget!'),
+ 'edit_status_labels' => Array ('widget' => '!la_title_EditingWidget!'),
+ 'new_titlefield' => Array ('widget' => '!la_title_NewWidget!'),
+ ),
+
+ 'widget_list' => Array (
+ 'prefixes' => Array ('widget_List'), 'format' => '#section_label#',
+ 'toolbar_buttons' => Array ('new_item', 'edit', 'delete', 'approve', 'decline', 'export', 'import', 'view', 'dbl-click',),
+ ),
+
+ 'widget_edit' => Array (
+ 'prefixes' => Array ('widget'), 'format' => '#widget_status# - #widget_titlefield#',
+ 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+ ),
+ ),
+
+ 'PermSection' => Array('main' => 'custom:widgets'),
+
+ 'Sections' => Array (
+ 'custom:widgets' => Array (
+ 'parent' => 'custom',
+ 'icon' => 'custom',
+ 'label' => 'la_tab_Widgets',
+ 'url' => Array ('t' => 'custom/widgets/widget_list', 'pass' => 'm'),
+ 'permissions' => Array ('view', 'add', 'edit', 'delete'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'TitleField' => 'Title', // field, used in bluebar when editing existing item
+
+ // Use %1$s for local table name with prefix, %2$s for calculated fields
+ 'ListSQLs' => Array ( // key - special, value - list select sql
+ '' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+ ),
+
+ 'ItemSQLs' => Array (
+ '' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ // 'ForcedSorting' => Array ('Priority' => 'desc'),
+ 'Sorting' => Array ('Title' => 'asc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'WidgetId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Title' => Array ('type' => 'string', 'not_null' => '1', 'default' => '', 'required' => true, 'max_len' => 255),
+ 'Description' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
+ 'Email' => Array(
+ 'type' => 'string', 'formatter' => 'kFormatter',
+ 'regexp'=> '/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i',
+ 'sample_value' => 'email@domain.com',
+ 'not_null' => 1, 'default' => '',
+ 'error_msgs' => Array ('invalid_format' => '!la_invalid_email!')
+ ),
+ 'Type' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1,
+ 'options' => Array (
+ 1 => 'la_opt_Default',
+ 2 => 'la_opt_Custom',
+ ),
+ 'not_null' => 1,
+ 'default' => 1,
+ 'required' => 1,
+ ),
+ 'Phone' => Array (
+ 'type' => 'string', 'formatter' => 'kFormatter',
+ 'default' => '', 'using_fck' => 1, 'not_null' => 1),
+ 'Qty' => Array ('type' => 'double', 'required' => 0, 'not_null' => 1, 'default' => 0),
+ 'Status' => Array (
+ 'type' => 'int', 'formatter' => 'kOptionsFormatter',
+ 'options' => array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'),
+ 'use_phrases' => 1, 'not_null' => 1, 'default' => 2,
+ ),
+ 'CreatedOn' => Array (
+ 'type' => 'int', 'formatter' => 'kDateFormatter',
+ 'time_format' => '', 'input_time_format' => '', 'default'=>'#NOW#', 'default' => NULL),
+
+ 'Good' => Array (
+ 'type' => 'int', 'formatter' => 'kOptionsFormatter',
+ 'options' => Array(1 => 'la_Yes', 0 => 'la_No'),
+ 'use_phrases' => 1, 'not_null' => 1, 'default' => 0
+ ),
+ 'BirthTime' => Array (
+ 'type' => 'int', 'formatter' => 'kDateFormatter',
+ 'date_format' => '', 'input_date_format' => '',
+ 'default' => null
+ ),
+ 'Image' => Array(
+ 'type' => 'string', 'formatter' => 'kUploadFormatter',
+ 'max_size' => MAX_UPLOAD_SIZE, // in Bytes !
+ 'file_types' => '*.jpg;*.gif;*.png', 'files_description'=>'!la_hint_ImageFiles!',
+ 'upload_dir' => '/system/user_files/', // relative to project's home
+ 'as_image' => true, 'thumb_width' => 100, 'thumb_height' => 100,
+ 'multiple' => false, // false or max number of files - will be stored as serialized array of paths
+ 'direct_links' => false, // use direct file urls or send files through wrapper (requires mod_mime_magic)
+ 'required' => 1, 'default' => null
+ ),
+ 'DataFile' => Array(
+ 'type' => 'string', 'formatter'=>'kUploadFormatter',
+ 'max_size' => MAX_UPLOAD_SIZE, // in Bytes !
+ 'file_types' => '*.*',
+ 'files_description' => '!la_hint_AllFiles!',
+ 'upload_dir' => '/system/user_files/', // relative to project's home
+ 'as_image' => false,
+ 'multiple' => 5, // false or max number of files - will be stored as serialized array of paths
+ 'direct_links' => true, // use direct file urls or send files through wrapper (requires mod_mime_magic)
+ 'default' => null
+ ),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ // 'Icons' => Array ('default' => 'icon16_custom.gif'),
+ 'Fields' => Array (
+ 'WidgetId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
+ 'Title' => Array ('title' => 'la_col_Name', 'data_block' => 'grid_delete_td'),
+ 'Image' => Array ('title' => 'la_col_Image', 'data_block' => 'grid_image_td'),
+ 'Type' => Array ('title' => 'la_col_Type', 'filter_block' => 'grid_options_filter'),
+ 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter'),
+ 'Good' => Array ('title' => 'la_col_Good'),
+ 'Qty' => Array ('title' => 'la_col_Qty', 'header_block' => 'grid_column_title_no_sorting', 'filter_block' => 'grid_float_range_filter'),
+ 'Email' => Array ('title' => 'la_col_Email'),
+ 'Phone' => Array ('title' => 'la_col_Phone'),
+ 'CreatedOn' => Array ('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter'),
+ 'Description' => Array ('title' => 'la_col_Description'),
+ // 'BirthTime' => Array ('title' => 'la_col_BirthTime', 'filter_block' => 'grid_date_range_filter'),
+ ),
+ ),
+ ),
+
+ 'ConfigMapping' => Array (
+ 'PerPage' => 'Comm_Perpage_Widgets',
+ 'ShortListPerPage' => 'Comm_Perpage_Widgets_Short',
+ ),
+ );
Index: branches/1.0.x/custom/units/widgets/widget_tp.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/widgets/widget_tp.php (revision 0)
+++ branches/1.0.x/custom/units/widgets/widget_tp.php (revision 12743)
@@ -0,0 +1,22 @@
+ Array ('self' => true),
+ 'OnCustomEvent' => Array ('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Permission exceptions
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $skip_permissions_check_events = Array (
+ 'OnAnotherCustomEvent',
+ );
+
+ if (in_array($event->Name, $skip_permissions_check_events)) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Set custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function OnCustomEvent(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ }
+
+ /**
+ * Set custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ # identifying event based on special and setting filter
+ if ($event->Special == 'custom-special') {
+// $object->addFilter('primary_filter', '%1$s.Status = '.STATUS_DISABLED);
+ }
+ }
+
+ /**
+ * Before new item created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+ }
+
+ /**
+ * Before existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+ }
+
+ /**
+ * Before item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ parent::OnBeforeItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemLoad(&$event)
+ {
+ parent::OnBeforeItemLoad($event);
+
+
+ }
+
+
+ /**
+ * After new item created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+
+ }
+
+ /**
+ * After existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+
+ }
+
+ /**
+ * After item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+
+ }
+
+ /**
+ * Builds/parses widget part of url
+ *
+ * @param int $rewrite_mode Mode in what rewrite listener was called. Possbile two modes: REWRITE_MODE_BUILD, REWRITE_MODE_PARSE.
+ * @param string $prefix Prefix, that listener uses for system integration
+ * @param Array $params Params, that are used for url building or created during url parsing.
+ * @param Array $url_parts Url parts to parse (only for parsing).
+ * @param bool $keep_events Keep event names in resulting url (only for building).
+ * @return bool Return true to continue to next listener; return false (when building) not to rewrite given prefix; return false (when parsing) to stop processing at this listener.
+ */
+ function WidgetRewriteListener($rewrite_mode = REWRITE_MODE_BUILD, $prefix, &$params, &$url_parts, $keep_events = false)
+ {
+ if ($rewrite_mode == REWRITE_MODE_BUILD) {
+ if ($params['t'] == 'widgets/widget_detail') {
+ // this is default template for this prefix, so don't add it to resulting url
+ $params['pass_template'] = false;
+ }
+
+ $mod_rewrite_helper =& $this->Application->recallObject('ModRewriteHelper');
+ /* @var $mod_rewrite_helper kModRewriteHelper */
+
+ $processed_params = $mod_rewrite_helper->getProcessedParams($prefix, $params, $keep_events);
+
+ if ($processed_params === false) {
+ return '';
+ }
+
+ $ret = Array ('', '');
+
+ if ($processed_params[$prefix . '_id'] > 0) {
+ // add id
+ $sql = 'SELECT Title
+ FROM ' . TABLE_PREFIX . 'Widgets
+ WHERE WidgetId = ' . $processed_params[$prefix . '_id'];
+ $ret[0] .= 'widgets/' . $this->Conn->GetOne($sql) . '/';
+ } elseif ($processed_params[$prefix . '_Page'] > 1) {
+ // add page, only when ID is missing
+ $ret[1] .= $processed_params[$prefix . '_Page'] . '/';
+ }
+
+ $ret[0] = rtrim($ret[0], '/');
+ $ret[1] = rtrim($ret[1], '/');
+
+ return array_map('mb_strtolower', $ret);
+ }
+
+ if ($rewrite_mode == REWRITE_MODE_PARSE) {
+ if ($url_parts[0] == 'widgets') {
+ $sql = 'SELECT WidgetId
+ FROM ' . TABLE_PREFIX . 'Widgets
+ WHERE Title = ' . $this->Conn->qstr($url_parts[1]);
+ $id = $this->Conn->GetOne($sql);
+ $to_parse = $url_parts;
+
+ if ($id > 0) {
+ // id found
+ $params[$prefix . '_id'] = $id;
+ $to_parse = array_slice($to_parse, 2); // cut off first two parts - "widgets/"
+ $params['pass'][] = $prefix; // otherwise this prefix won't passed when pass="all" parameter used
+ }
+
+ $template = implode('/', $to_parse);
+
+ if ($template) {
+ // let others guess what template is
+ return true;
+ }
+
+ // template missing -> set default
+ $params['t'] = 'widgets/widget_detail';
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/install/.htaccess
===================================================================
diff -u
--- branches/1.0.x/custom/install/.htaccess (revision 0)
+++ branches/1.0.x/custom/install/.htaccess (revision 12743)
@@ -0,0 +1 @@
+deny from all
\ No newline at end of file
Index: branches/1.0.x/custom/install/module_info.xml
===================================================================
diff -u
--- branches/1.0.x/custom/install/module_info.xml (revision 0)
+++ branches/1.0.x/custom/install/module_info.xml (revision 12743)
@@ -0,0 +1,6 @@
+
+
+ Custom
+ Development Kit
+ custom/install/img/icon_development_kit.gif
+
\ No newline at end of file
Index: branches/1.0.x/custom/install/install_data.sql
===================================================================
diff -u
--- branches/1.0.x/custom/install/install_data.sql (revision 0)
+++ branches/1.0.x/custom/install/install_data.sql (revision 12743)
@@ -0,0 +1,19 @@
+# place here only sql queries, that were executed on live AND dev sites !!!
+
+INSERT INTO Permissions VALUES(DEFAULT, 'custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.view', 11, 1, 1, 0);
+
+INSERT INTO Modules VALUES ('Custom', 'custom/', 'custom-sections', DEFAULT, 1, 10, 'custom/', 0, NULL);
+
+
+# ===== SQLs above this line already on LIVE ================================================================================================
+
+# place here only sql queries, that were executed on dev site !!!
+
+
+# ===== SQLs above this line already on DEV ========================================================================================================
+
+# place here only sql queries, that were executed on prod server !!!
Index: branches/1.0.x/custom/install/install_order.txt
===================================================================
diff -u
--- branches/1.0.x/custom/install/install_order.txt (revision 0)
+++ branches/1.0.x/custom/install/install_order.txt (revision 12743)
@@ -0,0 +1 @@
+203
\ No newline at end of file
Index: branches/1.0.x/custom/install/english.lang
===================================================================
diff -u
--- branches/1.0.x/custom/install/english.lang (revision 0)
+++ branches/1.0.x/custom/install/english.lang (revision 12743)
@@ -0,0 +1,19 @@
+
+ m/d/Yg:i Am/d/Yg:i:s A.,utf-82
+
+ R29vZA==
+ UGhvbmU=
+ RGF0YSBmaWxl
+ R29vZA==
+ Q3VzdG9t
+ RGVmYXVsdA==
+ V2lkZ2V0cw==
+ QWRkaW5nIFdpZGdldA==
+ RWRpdGluZyBXaWRnZXQ=
+ Q3VzdG9t
+ TmV3IFdpZGdldA==
+ V2lkZ2V0cw==
+ TmV3IFdpZGdldA==
+
+
+
\ No newline at end of file
Index: branches/1.0.x/custom/install/install_schema.sql
===================================================================
diff -u
--- branches/1.0.x/custom/install/install_schema.sql (revision 0)
+++ branches/1.0.x/custom/install/install_schema.sql (revision 12743)
@@ -0,0 +1,27 @@
+# place here only sql queries, that were executed on live AND dev sites !!!
+
+CREATE TABLE Widgets (
+ WidgetId int(11) NOT NULL AUTO_INCREMENT,
+ Title varchar(255) NOT NULL DEFAULT '',
+ Description text,
+ Email varchar(255) NOT NULL DEFAULT '',
+ `Type` tinyint(4) NOT NULL DEFAULT '1',
+ Phone varchar(50) NOT NULL DEFAULT '',
+ Qty double NOT NULL DEFAULT '0',
+ `Status` tinyint(4) NOT NULL DEFAULT '2',
+ CreatedOn int(11) DEFAULT NULL,
+ Good tinyint(4) NOT NULL DEFAULT '0',
+ BirthTime int(10) unsigned DEFAULT NULL,
+ Image text,
+ `DataFile` text,
+ PRIMARY KEY (WidgetId)
+);
+
+# ===== SQLs above this line already on LIVE ================================================================================================
+
+# place here only sql queries, that were executed on dev site !!!
+
+
+# ===== SQLs above this line already on DEV ========================================================================================================
+
+# place here only sql queries, that were executed on prod server !!!
Index: branches/1.0.x/custom/install/img/.htaccess
===================================================================
diff -u
--- branches/1.0.x/custom/install/img/.htaccess (revision 0)
+++ branches/1.0.x/custom/install/img/.htaccess (revision 12743)
@@ -0,0 +1 @@
+allow from all
\ No newline at end of file
Index: branches/1.0.x/custom/install/img/icon_development_kit.gif
===================================================================
diff -u
Binary files differ
Index: branches/1.0.x/custom/install/upgrades.sql
===================================================================
diff -u
--- branches/1.0.x/custom/install/upgrades.sql (revision 0)
+++ branches/1.0.x/custom/install/upgrades.sql (revision 12743)
@@ -0,0 +1,8 @@
+# ===== v 1.0.0 =====
+
+# ===== v 1.0.1 =====
+UPDATE Modules SET LoadOrder = 10 WHERE `Name` = 'Custom';
+
+# ===== v 1.0.2-B1 =====
+ALTER TABLE Widgets CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL;
+UPDATE Modules SET TemplatePath = 'custom/' WHERE Name = 'Custom';
Index: branches/1.0.x/custom/install.php
===================================================================
diff -u
--- branches/1.0.x/custom/install.php (revision 0)
+++ branches/1.0.x/custom/install.php (revision 12743)
@@ -0,0 +1,33 @@
+toolkit;
+ /* @var $toolkit kInstallToolkit */
+ }
+
+ $application =& kApplication::Instance();
+ $application->Init();
+
+ if ($application->RecallVar('user_id') != -1) {
+ die('restricted access!');
+ }
+
+ $toolkit->RunSQL('/' . $module_folder .'/install/install_schema.sql');
+ $toolkit->RunSQL('/' . $module_folder .'/install/install_data.sql');
+ $toolkit->ImportLanguage('/' . $module_folder .'/install/english');
+
+ $toolkit->finalizeModuleInstall($module_folder, false);
\ No newline at end of file
Index: branches/1.0.x/custom/README
===================================================================
diff -u
--- branches/1.0.x/custom/README (revision 0)
+++ branches/1.0.x/custom/README (revision 12743)
@@ -0,0 +1,179 @@
+INTRODUCTION TO IN-PORTAL
+-------------------------
+
+In-Portal is Open Source object-oriented framework that is developed
+in PHP and provides quick and easy way to build websites and web applications.
+
+In-Portal Framework has modular structure that allows painlessly
+add and extend already existing features via new modules.
+
+In-Portal Community greatly appreciates any type of involvement
+and contributions to the project.
+
+Please visit
+
+ http://www.in-portal.org/contribute.html
+
+to see how You can participate and be a part of In-Portal Community.
+
+
+THIS DEVELOPMENT KIT
+--------------------
+
+This README file provides you with the basic understanding and content
+of provided Development Kit.
+
+Latest version of this Development Kit can be downloaded here
+
+ http://www.in-portal.org
+
+ http://source.in-portal.org/custom/tags
+
+This Development Kit is implemented and called "Custom" so it can be used
+by developers as HOWTO create new modules as well as extend existing
+modules not worrying about upgrading issues in the future.
+
+This module contains samples of the most basic and widely used features
+of In-Portal. While the code might look very simple, though it provides
+a quick and effective way to unlock most powerful capabilities for
+In-Portal customization on many levels.
+
+
+FOLDER STRUCTURE
+----------------
+
+1. All In-Portal modules have the same folder structure, that provides a quick
+access to each aspect of it's functionality. Top folder is the module name
+in a LOWERCASE. It is "custom" for "Custom" module, "in-link" for "In-Link"
+module and so on.
+
+2. Inside there are three (3) main folders:
+
+ * admin_templates/ - templates and resources (images, javascript, etc.),
+ these are used Admin ONLY.
+
+ * units/ - business logic of the module, used on both Front-end and Admin.
+
+ * install/ - contains files used to install the module into existing
+ In-Portal installation.
+
+
+2.1. Content of "admin_templates/" folder.
+
+This folder contains one (1) sub-folder for each Section in Admin console's
+main navigation menu (in left frame). Each such folder should ONLY contain
+templates ("*.tpl" files) used for displaying given Section in the main
+navigation menu in Admin console.
+
+Besides that there are one special purpose folder called "img/".
+This folder contains all kind of images divided by categories (usage).
+Images from each category (usage) are located in special sub-folder
+associated with the given image category.
+
+There are three (3) main folders
+
+ * "icons/" - images, that will be used as Section icons in the
+ main navigation menu next to the actual titles;
+ NOTE one image per one menu Section, but the same image could be used
+ for multiple menu Section.
+
+ * "itemicons/" - images, that will be shown on the left from each
+ row in grid of records (also called list).
+
+ * "toolbar/" - images, that are used to draw buttons on toolbar
+ on module templates that uses toolbar-based interface ONY.
+
+ NOTE that it is not restricted to create any other folders
+ and place images inside them or in the "img/" folder itself.
+
+ NOTE it is also common practice to create a "js/" sub-folder
+ and place all javascript scripts related to the Admin console inside.
+
+
+2.2. Content of "units/" folder
+
+This folder can contain unlimited number of sub-folders.
+
+Each sub-folder should contain "*.php" files with the business logic
+implementation for the given functionality.
+
+Usually there are three (3) files
+
+ - Unit Config - main file, that allows to connect a given Unit into the framework;
+
+ - Event Handler - all code, that will manipulate with the data is located here;
+
+ - Tag Processor - all code, that is used to output the data to a user
+ in any requested form is located here.
+
+ It is NOT permitted to create files in "units/" folder itself, only sub-folder
+ as described above.
+
+ HOWEVER it is not prohibited to place a group of "unit" type folders inside
+ other "unit" type folders to logically divide them into groups.
+ Example, "units/logs/visits/" and "units/logs/summary/" both located inside
+ of "units/logs" folder, but each has it's own Unit Config, Event Handler, Tag Proccesor.
+
+
+2.3. Content of "install/" folder.
+
+This folder contains files used to during the installation which will automaticall install
+
+ * install Language Phrases
+ * install Email Events
+ * apply Database changes (e.g. new tables)
+
+associated with given module.
+
+There are also "upgrades.sql" (required) and "upgades.php" (not required). These files
+allow to maintain module version based on database structure control.
+
+
+3. BASIC UNDERSTANDING AND USAGE
+--------------------------------
+
+Visual part of Admin console consists of tree (3) parts
+
+ * Top - contains website logo, logout link and some other things.
+
+ * Left - contains main navigation menu (list of Sections) and used to control all functionality.
+
+ * Right - main part that show the actual Section and data.
+
+
+3.1 Adding a new Section item
+
+As we know left part of Admin console contains main navigation menu
+so it's crucial to learn add a new Sections.
+
+New menu Sections are added using Unit Config files (desribed above).
+Each unit can have unlimited number of menu Sections (and Sub-Sections)
+at any place inside the main navigation menu.
+
+To add a new section you need to add it to 'Sections' array descrived in Unit Config file
+of corresponding/related Unit, for example open "custom/units/widgets/widgets_config.php"
+
+ 'Sections' => Array (
+ 'custom' => Array (
+ 'parent' => 'in-portal:root',
+ 'icon' => 'custom',
+ 'label' => 'la_title_SampleMenuItem',
+ 'url' => Array ('t' => 'custom/widgets/widget_list', 'pass' => 'm'),
+ 'permissions' => Array ('view', 'add', 'edit', 'delete'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+ ),
+
+
+4. WHAT'S NEXT
+--------------
+
+While we can write thousands of lines in this file we decided
+to put all our knowledge base online using old good Wiki.
+
+Please feel free to read, ask questions and participate in In-Portal Community!
+
+ http://guide.in-portal.org/eng/index.php
+
+ http://www.in-portal.org/contribute.html
Index: branches/1.0.x/custom/admin_templates/img/logo_bg.gif
===================================================================
diff -u
Binary files differ
Index: branches/1.0.x/custom/admin_templates/img/icons/icon24_conf_custom.png
===================================================================
diff -u
Binary files differ
Index: branches/1.0.x/custom/admin_templates/img/icons/icon24_custom.png
===================================================================
diff -u
Binary files differ
Index: branches/1.0.x/custom/admin_templates/img/toolbar/dummy
===================================================================
diff -u
--- branches/1.0.x/custom/admin_templates/img/toolbar/dummy (revision 0)
+++ branches/1.0.x/custom/admin_templates/img/toolbar/dummy (revision 12743)
@@ -0,0 +1 @@
\ No newline at end of file
Index: branches/1.0.x/custom/admin_templates/widgets/widget_list.tpl
===================================================================
diff -u
--- branches/1.0.x/custom/admin_templates/widgets/widget_list.tpl (revision 0)
+++ branches/1.0.x/custom/admin_templates/widgets/widget_list.tpl (revision 12743)
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
alt=""/>
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/1.0.x/custom/admin_templates/widgets/widget_edit.tpl
===================================================================
diff -u
--- branches/1.0.x/custom/admin_templates/widgets/widget_edit.tpl (revision 0)
+++ branches/1.0.x/custom/admin_templates/widgets/widget_edit.tpl (revision 12743)
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/1.0.x/custom/units/.htaccess
===================================================================
diff -u
--- branches/1.0.x/custom/units/.htaccess (revision 0)
+++ branches/1.0.x/custom/units/.htaccess (revision 12743)
@@ -0,0 +1 @@
+deny from all
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_link_eh.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_link_eh.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_link_eh.php (revision 12743)
@@ -0,0 +1,188 @@
+ Array ('self' => true),
+
+ # front
+ 'OnCustomEvent2' => Array ('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Permission exceptions
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $skip_permissions_check_events = Array (
+ 'OnAnotherCustomEvent',
+ );
+
+ if ( in_array($event->Name, $skip_permissions_check_events) ) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Updates structure config
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ # 1. Regular Fields from
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields'); #get regular fields
+// $fields['Status']['default'] = 1; #add/edit configuration (make default = 1)
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields); #save fields
+
+ # 2. Virtual Fields from /in-link/units/links/links_config.php
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields'); #get virtual fields
+// $virtual_fields['UserName']['default'] = ''; #add/edit configuration
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); #save virtual fields
+ }
+
+ /**
+ * Sets custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ # identifying event based on special and setting filter
+ if ($event->Special == 'custom-special') {
+// $object->addFilter('primary_filter', '%1$s.Status = ' . STATUS_DISABLED);
+ }
+
+ # identifying event based not admin condition and setting filter
+ if (!$this->Application->isAdminUser) {
+// $object->addFilter('status_filter', '%1$s.Status = ' . STATUS_ACTIVE);
+ }
+ }
+
+ /**
+ * Before new item created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+
+ }
+
+ /**
+ * Before existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+
+ }
+
+ /**
+ * Before item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ parent::OnBeforeItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemLoad(&$event)
+ {
+ parent::OnBeforeItemLoad($event);
+
+
+ }
+
+
+ /**
+ * After new item created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+
+ }
+
+ /**
+ * After existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+
+ }
+
+ /**
+ * After item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_link_tp.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_link_tp.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_link_tp.php (revision 12743)
@@ -0,0 +1,56 @@
+getObject($params);
+ /* @var $object kDBItem */
+
+ $o = '';
+
+ // do some custom stuff here
+ if ( $object->isLoaded() ) {
+ $o = $object->GetField($this->SelectParam($params, 'name,field') ); #field Formatter applied
+
+// $o = $object->GetDBField($this->SelectParam($params, 'name,field') ); #field Formatter NOT applied
+ }
+
+ // in case if no data found
+ if ($o != '') {
+ $this->Application->Parser->DataExists = true;
+ }
+
+ return $o;
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/sections_config.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/sections_config.php (revision 0)
+++ branches/1.0.x/custom/units/sections/sections_config.php (revision 12743)
@@ -0,0 +1,86 @@
+ 'custom-sections',
+
+ 'ConfigPriority' => 2,
+
+ # Event handler class used for HOOKing to existing events (ie. )
+ 'EventHandlerClass' => Array ('class' => 'CustomEventHandler', 'file' => 'custom_eh.php', 'build_event' => 'OnBuild'),
+
+ # Defined to draw new sections (if any) in left nav. tree, normally each unit has it's own Tag Processor
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+
+ # Extend/override already existing classes (ie. Event Handlers, Tag Processors, Helpers)
+ 'RegisterClasses' => Array (
+
+ # extend default User core/units/users/users_tag_processor.php / users_event_handler.php
+// Array ('pseudo' => 'u_TagProcessor', 'class' => 'EUserTagProcessor', 'file' => 'e_user_tp.php'),
+// Array ('pseudo' => 'u_EventHandler', 'class' => 'EUserEventHandler', 'file' => 'e_user_eh.php'),
+
+ # extend default Product classes /in-commerce/units/products/products_tag_processor.php / products_event_handler.php
+// Array ('pseudo' => 'p_TagProcessor', 'class' => 'EProductTagProcessor', 'file' => 'e_product_tp.php'),
+// Array ('pseudo' => 'p_EventHandler', 'class' => 'EProductEventHandler', 'file' => 'e_product_eh.php'),
+
+ # extend default Link /in-link/units/links/link_tag_processor.php / links_event_handler.php
+// Array ('pseudo' => 'l_TagProcessor', 'class' => 'ELinkTagProcessor', 'file' => 'e_link_tp.php'),
+// Array ('pseudo' => 'l_EventHandler', 'class' => 'ELinkEventHandler', 'file' => 'e_link_eh.php'),
+
+ ),
+
+ # Replace/substiture any admin default templates with custom ones
+ 'ReplacementTemplates' => Array (
+ # replace default image block with custom template
+// 'incs/image_blocks' => 'custom/incs/image_blocks',
+
+ # replace default edit link template
+// 'in-links/links/links_edit' => 'custom/links/links_edit',
+
+ # replace default edit category template
+// 'categories/categories_edit' => 'custom/categories/categories_edit',
+ ),
+
+ # Hooks to events that may call any other events
+ 'Hooks' => Array (
+
+ # hook to category OnAfterConfigRead event called to customize category configuration settings
+ /*Array (
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'c',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array ('OnAfterConfigRead'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '*',
+ 'DoEvent' => 'OnModifyCategoriesConfig',
+ ),*/
+ ),
+
+ 'PermSection' => Array ('main' => 'custom', 'email' => 'custom:configuration_email'),
+
+ # New sections in left navigation
+ /*'Sections' => Array (
+ 'custom' => Array (
+ 'parent' => 'in-portal:root',
+ 'icon' => 'conf_custom',
+ 'label' => 'la_title_Custom',
+ 'url' => Array ('t' => 'index', 'pass' => 'm'),
+ 'permissions' => Array ('view'),
+ 'priority' => 2.4,
+ 'container' => true,
+ 'type' => stTREE,
+ ),
+
+ ),*/
+
+ );
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_user_tp.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_user_tp.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_user_tp.php (revision 12743)
@@ -0,0 +1,38 @@
+getObject();
+ /* @var $object kDBItem */
+
+ $ret = '';
+ $newline = '
';
+
+ if ($object->isLoaded()) {
+ $ret = $object->GetField('Street') ? $object->GetField('Street') . $newline : '';
+ $ret .= $object->GetField('Street2') ? $object->GetField('Street2') . $newline : '';
+ $ret .= $object->GetField('City') ? $object->GetField('City') . ', ' : '';
+ $ret .= $object->GetField('State') ? $object->GetField('State') . ' ' : '';
+ $ret .= $object->GetField('Zip') ? $object->GetField('Zip') . $newline : '';
+ $ret .= $object->GetField('Country');
+ }
+
+ return $ret;
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_user_eh.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_user_eh.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_user_eh.php (revision 12743)
@@ -0,0 +1,188 @@
+ Array ('self' => true),
+
+ # front
+ 'OnCustomEvent2' => Array ('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Permission exceptions
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $skip_permissions_check_events = Array (
+ 'OnAnotherCustomEvent',
+ );
+
+ if ( in_array($event->Name, $skip_permissions_check_events) ) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Updates structure config
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ # 1. Regular Fields from /core/units/users/users_config.php
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields'); #get regular fields
+// $fields['Status']['default'] = 1; #add/edit configuration (make default = 1)
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields); #save regular fields
+
+ # 2. Virtual Fields from /core/units/users/users_config.php
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields'); #get virtual fields
+// $virtual_fields['FullName']['default'] = ''; #add/edit configuration
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); #save virtual fields
+ }
+
+ /**
+ * Sets custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ # identifying event based on special and setting filter
+ if ( $event->Special == 'custom-special' ) {
+// $object->addFilter('primary_filter', '%1$s.Status = ' . STATUS_DISABLED);
+ }
+
+ # identifying event based not admin condition and setting filter
+ if (!$this->Application->isAdminUser) {
+// $object->addFilter('status_filter', '%1$s.Status = ' . STATUS_ACTIVE);
+ }
+ }
+
+ /**
+ * Before new item created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+
+ }
+
+ /**
+ * Before existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+
+ }
+
+ /**
+ * Before item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ parent::OnBeforeItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemLoad(&$event)
+ {
+ parent::OnBeforeItemLoad($event);
+
+
+ }
+
+
+ /**
+ * After new item created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+
+ }
+
+ /**
+ * After existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+
+ }
+
+ /**
+ * After item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/custom_eh.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/custom_eh.php (revision 0)
+++ branches/1.0.x/custom/units/sections/custom_eh.php (revision 12743)
@@ -0,0 +1,39 @@
+Conn =& $this->Application->GetADODBConnection();
+ }
+
+ /**
+ * [HOOK] Modify config stored in "categories_config.php" without extending CategoriesEventHandler class
+ *
+ * @param kEvent $event
+ */
+ function OnModifyCategoriesConfig(&$event)
+ {
+ # get Fields configuration from /core/units/categories/categories_config.php
+ $fields = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'Fields');
+
+ # set configuration fields
+ $this->Application->setUnitOption($event->MasterEvent->Prefix, 'Fields', $fields);
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_product_tp.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_product_tp.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_product_tp.php (revision 12743)
@@ -0,0 +1,28 @@
+ Array ('self' => true),
+
+ # front
+ 'OnCustomEvent2' => Array ('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Permission exceptions
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $skip_permissions_check_events = Array (
+ 'OnAnotherCustomEvent',
+ );
+
+ if ( in_array($event->Name, $skip_permissions_check_events) ) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Updates structure config
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ # 1. Regular Fields from /in-commerce/units/products/products_config.php
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields'); #get regular fields
+// $fields['Status']['default'] = 1; #add/edit field configuration (make default = 1)
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields); #save regular fields
+
+
+ # 2. Virtual Fields from /in-commerce/units/products/products_config.php
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields'); #get virtual fields
+// $virtual_fields['Qty']['default'] = 1; #add/edit field configuration
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); # save virtual fields
+ }
+
+ /**
+ * Sets custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ # identifying event based on special and setting filter
+ if ( $event->Special == 'custom-special' ) {
+// $object->addFilter('primary_filter', '%1$s.Status = '.STATUS_DISABLED);
+ }
+
+ # identifying event based not admin condition and setting filter
+ if (!$this->Application->isAdminUser) {
+// $object->addFilter('status_filter', '%1$s.Status = '.STATUS_ACTIVE);
+ }
+ }
+
+ /**
+ * Before new item created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+
+ }
+
+ /**
+ * Before existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+
+ }
+
+ /**
+ * Before item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ parent::OnBeforeItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemLoad(&$event)
+ {
+ parent::OnBeforeItemLoad($event);
+
+
+ }
+
+
+ /**
+ * After new item created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+
+ }
+
+ /**
+ * After existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+
+ }
+
+ /**
+ * After item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/helpers/sample_helper.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/helpers/sample_helper.php (revision 0)
+++ branches/1.0.x/custom/units/helpers/sample_helper.php (revision 12743)
@@ -0,0 +1,14 @@
+ 'custom-helpers',
+
+ 'EventHandlerClass' => Array ('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+
+ 'RegisterClasses' => Array (
+ Array ('pseudo' => 'SampleHelper', 'class' => 'SampleHelper', 'file' => 'sample_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'),
+ ),
+ );
\ No newline at end of file
Index: branches/1.0.x/custom/units/widgets/widgets_config.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/widgets/widgets_config.php (revision 0)
+++ branches/1.0.x/custom/units/widgets/widgets_config.php (revision 12743)
@@ -0,0 +1,191 @@
+ 'widget',
+
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file'=> '', 'build_event' => 'OnListBuild'),
+
+ 'EventHandlerClass' => Array ('class' => 'WidgetEventHandler', 'file' => 'widget_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'WidgetTagProcessor', 'file' => 'widget_tp.php', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'RewriteListener' => 'WidgetRewriteListener',
+
+ 'IDField' => 'WidgetId',
+
+ 'StatusField' => Array ('Status'),
+
+ 'TableName' => TABLE_PREFIX.'Widgets',
+
+ /*
+ 'ForeignKey' => 'ParentId', // field title in TableName, linking record to a parent
+ 'ParentTableKey' => 'ParentId', // id (or other key) field title in parent's table
+ 'ParentPrefix' => 'parent',
+ 'AutoDelete' => true, // delete these items when parent is being deleted
+ 'AutoClone' => true, // clone these items when parent is being cloned
+ */
+
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array ('widget' => '!la_title_AddingWidget!'),
+ 'edit_status_labels' => Array ('widget' => '!la_title_EditingWidget!'),
+ 'new_titlefield' => Array ('widget' => '!la_title_NewWidget!'),
+ ),
+
+ 'widget_list' => Array (
+ 'prefixes' => Array ('widget_List'), 'format' => '#section_label#',
+ 'toolbar_buttons' => Array ('new_item', 'edit', 'delete', 'approve', 'decline', 'export', 'import', 'view', 'dbl-click',),
+ ),
+
+ 'widget_edit' => Array (
+ 'prefixes' => Array ('widget'), 'format' => '#widget_status# - #widget_titlefield#',
+ 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+ ),
+ ),
+
+ 'PermSection' => Array('main' => 'custom:widgets'),
+
+ 'Sections' => Array (
+ 'custom:widgets' => Array (
+ 'parent' => 'custom',
+ 'icon' => 'custom',
+ 'label' => 'la_tab_Widgets',
+ 'url' => Array ('t' => 'custom/widgets/widget_list', 'pass' => 'm'),
+ 'permissions' => Array ('view', 'add', 'edit', 'delete'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'TitleField' => 'Title', // field, used in bluebar when editing existing item
+
+ // Use %1$s for local table name with prefix, %2$s for calculated fields
+ 'ListSQLs' => Array ( // key - special, value - list select sql
+ '' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+ ),
+
+ 'ItemSQLs' => Array (
+ '' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ // 'ForcedSorting' => Array ('Priority' => 'desc'),
+ 'Sorting' => Array ('Title' => 'asc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'WidgetId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Title' => Array ('type' => 'string', 'not_null' => '1', 'default' => '', 'required' => true, 'max_len' => 255),
+ 'Description' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
+ 'Email' => Array(
+ 'type' => 'string', 'formatter' => 'kFormatter',
+ 'regexp'=> '/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i',
+ 'sample_value' => 'email@domain.com',
+ 'not_null' => 1, 'default' => '',
+ 'error_msgs' => Array ('invalid_format' => '!la_invalid_email!')
+ ),
+ 'Type' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1,
+ 'options' => Array (
+ 1 => 'la_opt_Default',
+ 2 => 'la_opt_Custom',
+ ),
+ 'not_null' => 1,
+ 'default' => 1,
+ 'required' => 1,
+ ),
+ 'Phone' => Array (
+ 'type' => 'string', 'formatter' => 'kFormatter',
+ 'default' => '', 'using_fck' => 1, 'not_null' => 1),
+ 'Qty' => Array ('type' => 'double', 'required' => 0, 'not_null' => 1, 'default' => 0),
+ 'Status' => Array (
+ 'type' => 'int', 'formatter' => 'kOptionsFormatter',
+ 'options' => array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'),
+ 'use_phrases' => 1, 'not_null' => 1, 'default' => 2,
+ ),
+ 'CreatedOn' => Array (
+ 'type' => 'int', 'formatter' => 'kDateFormatter',
+ 'time_format' => '', 'input_time_format' => '', 'default'=>'#NOW#', 'default' => NULL),
+
+ 'Good' => Array (
+ 'type' => 'int', 'formatter' => 'kOptionsFormatter',
+ 'options' => Array(1 => 'la_Yes', 0 => 'la_No'),
+ 'use_phrases' => 1, 'not_null' => 1, 'default' => 0
+ ),
+ 'BirthTime' => Array (
+ 'type' => 'int', 'formatter' => 'kDateFormatter',
+ 'date_format' => '', 'input_date_format' => '',
+ 'default' => null
+ ),
+ 'Image' => Array(
+ 'type' => 'string', 'formatter' => 'kUploadFormatter',
+ 'max_size' => MAX_UPLOAD_SIZE, // in Bytes !
+ 'file_types' => '*.jpg;*.gif;*.png', 'files_description'=>'!la_hint_ImageFiles!',
+ 'upload_dir' => '/system/user_files/', // relative to project's home
+ 'as_image' => true, 'thumb_width' => 100, 'thumb_height' => 100,
+ 'multiple' => false, // false or max number of files - will be stored as serialized array of paths
+ 'direct_links' => false, // use direct file urls or send files through wrapper (requires mod_mime_magic)
+ 'required' => 1, 'default' => null
+ ),
+ 'DataFile' => Array(
+ 'type' => 'string', 'formatter'=>'kUploadFormatter',
+ 'max_size' => MAX_UPLOAD_SIZE, // in Bytes !
+ 'file_types' => '*.*',
+ 'files_description' => '!la_hint_AllFiles!',
+ 'upload_dir' => '/system/user_files/', // relative to project's home
+ 'as_image' => false,
+ 'multiple' => 5, // false or max number of files - will be stored as serialized array of paths
+ 'direct_links' => true, // use direct file urls or send files through wrapper (requires mod_mime_magic)
+ 'default' => null
+ ),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ // 'Icons' => Array ('default' => 'icon16_custom.gif'),
+ 'Fields' => Array (
+ 'WidgetId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
+ 'Title' => Array ('title' => 'la_col_Name', 'data_block' => 'grid_delete_td'),
+ 'Image' => Array ('title' => 'la_col_Image', 'data_block' => 'grid_image_td'),
+ 'Type' => Array ('title' => 'la_col_Type', 'filter_block' => 'grid_options_filter'),
+ 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter'),
+ 'Good' => Array ('title' => 'la_col_Good'),
+ 'Qty' => Array ('title' => 'la_col_Qty', 'header_block' => 'grid_column_title_no_sorting', 'filter_block' => 'grid_float_range_filter'),
+ 'Email' => Array ('title' => 'la_col_Email'),
+ 'Phone' => Array ('title' => 'la_col_Phone'),
+ 'CreatedOn' => Array ('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter'),
+ 'Description' => Array ('title' => 'la_col_Description'),
+ // 'BirthTime' => Array ('title' => 'la_col_BirthTime', 'filter_block' => 'grid_date_range_filter'),
+ ),
+ ),
+ ),
+
+ 'ConfigMapping' => Array (
+ 'PerPage' => 'Comm_Perpage_Widgets',
+ 'ShortListPerPage' => 'Comm_Perpage_Widgets_Short',
+ ),
+ );
Index: branches/1.0.x/custom/units/widgets/widget_tp.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/widgets/widget_tp.php (revision 0)
+++ branches/1.0.x/custom/units/widgets/widget_tp.php (revision 12743)
@@ -0,0 +1,22 @@
+ Array ('self' => true),
+ 'OnCustomEvent' => Array ('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Permission exceptions
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $skip_permissions_check_events = Array (
+ 'OnAnotherCustomEvent',
+ );
+
+ if (in_array($event->Name, $skip_permissions_check_events)) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Set custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function OnCustomEvent(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ }
+
+ /**
+ * Set custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ # identifying event based on special and setting filter
+ if ($event->Special == 'custom-special') {
+// $object->addFilter('primary_filter', '%1$s.Status = '.STATUS_DISABLED);
+ }
+ }
+
+ /**
+ * Before new item created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+ }
+
+ /**
+ * Before existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+ }
+
+ /**
+ * Before item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ parent::OnBeforeItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemLoad(&$event)
+ {
+ parent::OnBeforeItemLoad($event);
+
+
+ }
+
+
+ /**
+ * After new item created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+
+ }
+
+ /**
+ * After existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+
+ }
+
+ /**
+ * After item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+
+ }
+
+ /**
+ * Builds/parses widget part of url
+ *
+ * @param int $rewrite_mode Mode in what rewrite listener was called. Possbile two modes: REWRITE_MODE_BUILD, REWRITE_MODE_PARSE.
+ * @param string $prefix Prefix, that listener uses for system integration
+ * @param Array $params Params, that are used for url building or created during url parsing.
+ * @param Array $url_parts Url parts to parse (only for parsing).
+ * @param bool $keep_events Keep event names in resulting url (only for building).
+ * @return bool Return true to continue to next listener; return false (when building) not to rewrite given prefix; return false (when parsing) to stop processing at this listener.
+ */
+ function WidgetRewriteListener($rewrite_mode = REWRITE_MODE_BUILD, $prefix, &$params, &$url_parts, $keep_events = false)
+ {
+ if ($rewrite_mode == REWRITE_MODE_BUILD) {
+ if ($params['t'] == 'widgets/widget_detail') {
+ // this is default template for this prefix, so don't add it to resulting url
+ $params['pass_template'] = false;
+ }
+
+ $mod_rewrite_helper =& $this->Application->recallObject('ModRewriteHelper');
+ /* @var $mod_rewrite_helper kModRewriteHelper */
+
+ $processed_params = $mod_rewrite_helper->getProcessedParams($prefix, $params, $keep_events);
+
+ if ($processed_params === false) {
+ return '';
+ }
+
+ $ret = Array ('', '');
+
+ if ($processed_params[$prefix . '_id'] > 0) {
+ // add id
+ $sql = 'SELECT Title
+ FROM ' . TABLE_PREFIX . 'Widgets
+ WHERE WidgetId = ' . $processed_params[$prefix . '_id'];
+ $ret[0] .= 'widgets/' . $this->Conn->GetOne($sql) . '/';
+ } elseif ($processed_params[$prefix . '_Page'] > 1) {
+ // add page, only when ID is missing
+ $ret[1] .= $processed_params[$prefix . '_Page'] . '/';
+ }
+
+ $ret[0] = rtrim($ret[0], '/');
+ $ret[1] = rtrim($ret[1], '/');
+
+ return array_map('mb_strtolower', $ret);
+ }
+
+ if ($rewrite_mode == REWRITE_MODE_PARSE) {
+ if ($url_parts[0] == 'widgets') {
+ $sql = 'SELECT WidgetId
+ FROM ' . TABLE_PREFIX . 'Widgets
+ WHERE Title = ' . $this->Conn->qstr($url_parts[1]);
+ $id = $this->Conn->GetOne($sql);
+ $to_parse = $url_parts;
+
+ if ($id > 0) {
+ // id found
+ $params[$prefix . '_id'] = $id;
+ $to_parse = array_slice($to_parse, 2); // cut off first two parts - "widgets/"
+ $params['pass'][] = $prefix; // otherwise this prefix won't passed when pass="all" parameter used
+ }
+
+ $template = implode('/', $to_parse);
+
+ if ($template) {
+ // let others guess what template is
+ return true;
+ }
+
+ // template missing -> set default
+ $params['t'] = 'widgets/widget_detail';
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/install/install_data.sql
===================================================================
diff -u
--- branches/1.0.x/custom/install/install_data.sql (revision 0)
+++ branches/1.0.x/custom/install/install_data.sql (revision 12743)
@@ -0,0 +1,19 @@
+# place here only sql queries, that were executed on live AND dev sites !!!
+
+INSERT INTO Permissions VALUES(DEFAULT, 'custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.view', 11, 1, 1, 0);
+
+INSERT INTO Modules VALUES ('Custom', 'custom/', 'custom-sections', DEFAULT, 1, 10, 'custom/', 0, NULL);
+
+
+# ===== SQLs above this line already on LIVE ================================================================================================
+
+# place here only sql queries, that were executed on dev site !!!
+
+
+# ===== SQLs above this line already on DEV ========================================================================================================
+
+# place here only sql queries, that were executed on prod server !!!
Index: branches/1.0.x/custom/install/install_order.txt
===================================================================
diff -u
--- branches/1.0.x/custom/install/install_order.txt (revision 0)
+++ branches/1.0.x/custom/install/install_order.txt (revision 12743)
@@ -0,0 +1 @@
+203
\ No newline at end of file
Index: branches/1.0.x/custom/install/english.lang
===================================================================
diff -u
--- branches/1.0.x/custom/install/english.lang (revision 0)
+++ branches/1.0.x/custom/install/english.lang (revision 12743)
@@ -0,0 +1,19 @@
+
+ m/d/Yg:i Am/d/Yg:i:s A.,utf-82
+
+ R29vZA==
+ UGhvbmU=
+ RGF0YSBmaWxl
+ R29vZA==
+ Q3VzdG9t
+ RGVmYXVsdA==
+ V2lkZ2V0cw==
+ QWRkaW5nIFdpZGdldA==
+ RWRpdGluZyBXaWRnZXQ=
+ Q3VzdG9t
+ TmV3IFdpZGdldA==
+ V2lkZ2V0cw==
+ TmV3IFdpZGdldA==
+
+
+
\ No newline at end of file
Index: branches/1.0.x/custom/install/install_schema.sql
===================================================================
diff -u
--- branches/1.0.x/custom/install/install_schema.sql (revision 0)
+++ branches/1.0.x/custom/install/install_schema.sql (revision 12743)
@@ -0,0 +1,27 @@
+# place here only sql queries, that were executed on live AND dev sites !!!
+
+CREATE TABLE Widgets (
+ WidgetId int(11) NOT NULL AUTO_INCREMENT,
+ Title varchar(255) NOT NULL DEFAULT '',
+ Description text,
+ Email varchar(255) NOT NULL DEFAULT '',
+ `Type` tinyint(4) NOT NULL DEFAULT '1',
+ Phone varchar(50) NOT NULL DEFAULT '',
+ Qty double NOT NULL DEFAULT '0',
+ `Status` tinyint(4) NOT NULL DEFAULT '2',
+ CreatedOn int(11) DEFAULT NULL,
+ Good tinyint(4) NOT NULL DEFAULT '0',
+ BirthTime int(10) unsigned DEFAULT NULL,
+ Image text,
+ `DataFile` text,
+ PRIMARY KEY (WidgetId)
+);
+
+# ===== SQLs above this line already on LIVE ================================================================================================
+
+# place here only sql queries, that were executed on dev site !!!
+
+
+# ===== SQLs above this line already on DEV ========================================================================================================
+
+# place here only sql queries, that were executed on prod server !!!
Index: branches/1.0.x/custom/install/upgrades.sql
===================================================================
diff -u
--- branches/1.0.x/custom/install/upgrades.sql (revision 0)
+++ branches/1.0.x/custom/install/upgrades.sql (revision 12743)
@@ -0,0 +1,8 @@
+# ===== v 1.0.0 =====
+
+# ===== v 1.0.1 =====
+UPDATE Modules SET LoadOrder = 10 WHERE `Name` = 'Custom';
+
+# ===== v 1.0.2-B1 =====
+ALTER TABLE Widgets CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL;
+UPDATE Modules SET TemplatePath = 'custom/' WHERE Name = 'Custom';
Index: branches/1.0.x/custom/install.php
===================================================================
diff -u
--- branches/1.0.x/custom/install.php (revision 0)
+++ branches/1.0.x/custom/install.php (revision 12743)
@@ -0,0 +1,33 @@
+toolkit;
+ /* @var $toolkit kInstallToolkit */
+ }
+
+ $application =& kApplication::Instance();
+ $application->Init();
+
+ if ($application->RecallVar('user_id') != -1) {
+ die('restricted access!');
+ }
+
+ $toolkit->RunSQL('/' . $module_folder .'/install/install_schema.sql');
+ $toolkit->RunSQL('/' . $module_folder .'/install/install_data.sql');
+ $toolkit->ImportLanguage('/' . $module_folder .'/install/english');
+
+ $toolkit->finalizeModuleInstall($module_folder, false);
\ No newline at end of file
Index: branches/1.0.x/custom/README
===================================================================
diff -u
--- branches/1.0.x/custom/README (revision 0)
+++ branches/1.0.x/custom/README (revision 12743)
@@ -0,0 +1,179 @@
+INTRODUCTION TO IN-PORTAL
+-------------------------
+
+In-Portal is Open Source object-oriented framework that is developed
+in PHP and provides quick and easy way to build websites and web applications.
+
+In-Portal Framework has modular structure that allows painlessly
+add and extend already existing features via new modules.
+
+In-Portal Community greatly appreciates any type of involvement
+and contributions to the project.
+
+Please visit
+
+ http://www.in-portal.org/contribute.html
+
+to see how You can participate and be a part of In-Portal Community.
+
+
+THIS DEVELOPMENT KIT
+--------------------
+
+This README file provides you with the basic understanding and content
+of provided Development Kit.
+
+Latest version of this Development Kit can be downloaded here
+
+ http://www.in-portal.org
+
+ http://source.in-portal.org/custom/tags
+
+This Development Kit is implemented and called "Custom" so it can be used
+by developers as HOWTO create new modules as well as extend existing
+modules not worrying about upgrading issues in the future.
+
+This module contains samples of the most basic and widely used features
+of In-Portal. While the code might look very simple, though it provides
+a quick and effective way to unlock most powerful capabilities for
+In-Portal customization on many levels.
+
+
+FOLDER STRUCTURE
+----------------
+
+1. All In-Portal modules have the same folder structure, that provides a quick
+access to each aspect of it's functionality. Top folder is the module name
+in a LOWERCASE. It is "custom" for "Custom" module, "in-link" for "In-Link"
+module and so on.
+
+2. Inside there are three (3) main folders:
+
+ * admin_templates/ - templates and resources (images, javascript, etc.),
+ these are used Admin ONLY.
+
+ * units/ - business logic of the module, used on both Front-end and Admin.
+
+ * install/ - contains files used to install the module into existing
+ In-Portal installation.
+
+
+2.1. Content of "admin_templates/" folder.
+
+This folder contains one (1) sub-folder for each Section in Admin console's
+main navigation menu (in left frame). Each such folder should ONLY contain
+templates ("*.tpl" files) used for displaying given Section in the main
+navigation menu in Admin console.
+
+Besides that there are one special purpose folder called "img/".
+This folder contains all kind of images divided by categories (usage).
+Images from each category (usage) are located in special sub-folder
+associated with the given image category.
+
+There are three (3) main folders
+
+ * "icons/" - images, that will be used as Section icons in the
+ main navigation menu next to the actual titles;
+ NOTE one image per one menu Section, but the same image could be used
+ for multiple menu Section.
+
+ * "itemicons/" - images, that will be shown on the left from each
+ row in grid of records (also called list).
+
+ * "toolbar/" - images, that are used to draw buttons on toolbar
+ on module templates that uses toolbar-based interface ONY.
+
+ NOTE that it is not restricted to create any other folders
+ and place images inside them or in the "img/" folder itself.
+
+ NOTE it is also common practice to create a "js/" sub-folder
+ and place all javascript scripts related to the Admin console inside.
+
+
+2.2. Content of "units/" folder
+
+This folder can contain unlimited number of sub-folders.
+
+Each sub-folder should contain "*.php" files with the business logic
+implementation for the given functionality.
+
+Usually there are three (3) files
+
+ - Unit Config - main file, that allows to connect a given Unit into the framework;
+
+ - Event Handler - all code, that will manipulate with the data is located here;
+
+ - Tag Processor - all code, that is used to output the data to a user
+ in any requested form is located here.
+
+ It is NOT permitted to create files in "units/" folder itself, only sub-folder
+ as described above.
+
+ HOWEVER it is not prohibited to place a group of "unit" type folders inside
+ other "unit" type folders to logically divide them into groups.
+ Example, "units/logs/visits/" and "units/logs/summary/" both located inside
+ of "units/logs" folder, but each has it's own Unit Config, Event Handler, Tag Proccesor.
+
+
+2.3. Content of "install/" folder.
+
+This folder contains files used to during the installation which will automaticall install
+
+ * install Language Phrases
+ * install Email Events
+ * apply Database changes (e.g. new tables)
+
+associated with given module.
+
+There are also "upgrades.sql" (required) and "upgades.php" (not required). These files
+allow to maintain module version based on database structure control.
+
+
+3. BASIC UNDERSTANDING AND USAGE
+--------------------------------
+
+Visual part of Admin console consists of tree (3) parts
+
+ * Top - contains website logo, logout link and some other things.
+
+ * Left - contains main navigation menu (list of Sections) and used to control all functionality.
+
+ * Right - main part that show the actual Section and data.
+
+
+3.1 Adding a new Section item
+
+As we know left part of Admin console contains main navigation menu
+so it's crucial to learn add a new Sections.
+
+New menu Sections are added using Unit Config files (desribed above).
+Each unit can have unlimited number of menu Sections (and Sub-Sections)
+at any place inside the main navigation menu.
+
+To add a new section you need to add it to 'Sections' array descrived in Unit Config file
+of corresponding/related Unit, for example open "custom/units/widgets/widgets_config.php"
+
+ 'Sections' => Array (
+ 'custom' => Array (
+ 'parent' => 'in-portal:root',
+ 'icon' => 'custom',
+ 'label' => 'la_title_SampleMenuItem',
+ 'url' => Array ('t' => 'custom/widgets/widget_list', 'pass' => 'm'),
+ 'permissions' => Array ('view', 'add', 'edit', 'delete'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+ ),
+
+
+4. WHAT'S NEXT
+--------------
+
+While we can write thousands of lines in this file we decided
+to put all our knowledge base online using old good Wiki.
+
+Please feel free to read, ask questions and participate in In-Portal Community!
+
+ http://guide.in-portal.org/eng/index.php
+
+ http://www.in-portal.org/contribute.html
Index: branches/1.0.x/custom/admin_templates/img/logo_bg.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/custom/admin_templates/img/itemicons/dummy
===================================================================
diff -u
--- branches/RC/custom/admin_templates/img/itemicons/dummy (revision 0)
+++ branches/RC/custom/admin_templates/img/itemicons/dummy (revision 12743)
@@ -0,0 +1 @@
\ No newline at end of file
Index: branches/RC/custom/admin_templates/img/icons/icon24_custom.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/custom/admin_templates/img/icons/icon46_list_custom.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/custom/admin_templates/img/icons/icon46_custom.gif
===================================================================
diff -u
Binary files differ
Index: branches/1.0.x/custom/admin_templates/img/toolbar/dummy
===================================================================
diff -u
--- branches/1.0.x/custom/admin_templates/img/toolbar/dummy (revision 0)
+++ branches/1.0.x/custom/admin_templates/img/toolbar/dummy (revision 12743)
@@ -0,0 +1 @@
\ No newline at end of file
Index: branches/1.0.x/custom/admin_templates/widgets/widget_list.tpl
===================================================================
diff -u
--- branches/1.0.x/custom/admin_templates/widgets/widget_list.tpl (revision 0)
+++ branches/1.0.x/custom/admin_templates/widgets/widget_list.tpl (revision 12743)
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
alt=""/>
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/1.0.x/custom/admin_templates/widgets/widget_edit.tpl
===================================================================
diff -u
--- branches/1.0.x/custom/admin_templates/widgets/widget_edit.tpl (revision 0)
+++ branches/1.0.x/custom/admin_templates/widgets/widget_edit.tpl (revision 12743)
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_link_eh.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_link_eh.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_link_eh.php (revision 12743)
@@ -0,0 +1,188 @@
+ Array ('self' => true),
+
+ # front
+ 'OnCustomEvent2' => Array ('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Permission exceptions
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $skip_permissions_check_events = Array (
+ 'OnAnotherCustomEvent',
+ );
+
+ if ( in_array($event->Name, $skip_permissions_check_events) ) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Updates structure config
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ # 1. Regular Fields from
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields'); #get regular fields
+// $fields['Status']['default'] = 1; #add/edit configuration (make default = 1)
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields); #save fields
+
+ # 2. Virtual Fields from /in-link/units/links/links_config.php
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields'); #get virtual fields
+// $virtual_fields['UserName']['default'] = ''; #add/edit configuration
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); #save virtual fields
+ }
+
+ /**
+ * Sets custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ # identifying event based on special and setting filter
+ if ($event->Special == 'custom-special') {
+// $object->addFilter('primary_filter', '%1$s.Status = ' . STATUS_DISABLED);
+ }
+
+ # identifying event based not admin condition and setting filter
+ if (!$this->Application->isAdminUser) {
+// $object->addFilter('status_filter', '%1$s.Status = ' . STATUS_ACTIVE);
+ }
+ }
+
+ /**
+ * Before new item created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+
+ }
+
+ /**
+ * Before existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+
+ }
+
+ /**
+ * Before item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ parent::OnBeforeItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemLoad(&$event)
+ {
+ parent::OnBeforeItemLoad($event);
+
+
+ }
+
+
+ /**
+ * After new item created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+
+ }
+
+ /**
+ * After existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+
+ }
+
+ /**
+ * After item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_link_tp.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_link_tp.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_link_tp.php (revision 12743)
@@ -0,0 +1,56 @@
+getObject($params);
+ /* @var $object kDBItem */
+
+ $o = '';
+
+ // do some custom stuff here
+ if ( $object->isLoaded() ) {
+ $o = $object->GetField($this->SelectParam($params, 'name,field') ); #field Formatter applied
+
+// $o = $object->GetDBField($this->SelectParam($params, 'name,field') ); #field Formatter NOT applied
+ }
+
+ // in case if no data found
+ if ($o != '') {
+ $this->Application->Parser->DataExists = true;
+ }
+
+ return $o;
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/sections_config.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/sections_config.php (revision 0)
+++ branches/1.0.x/custom/units/sections/sections_config.php (revision 12743)
@@ -0,0 +1,86 @@
+ 'custom-sections',
+
+ 'ConfigPriority' => 2,
+
+ # Event handler class used for HOOKing to existing events (ie. )
+ 'EventHandlerClass' => Array ('class' => 'CustomEventHandler', 'file' => 'custom_eh.php', 'build_event' => 'OnBuild'),
+
+ # Defined to draw new sections (if any) in left nav. tree, normally each unit has it's own Tag Processor
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+
+ # Extend/override already existing classes (ie. Event Handlers, Tag Processors, Helpers)
+ 'RegisterClasses' => Array (
+
+ # extend default User core/units/users/users_tag_processor.php / users_event_handler.php
+// Array ('pseudo' => 'u_TagProcessor', 'class' => 'EUserTagProcessor', 'file' => 'e_user_tp.php'),
+// Array ('pseudo' => 'u_EventHandler', 'class' => 'EUserEventHandler', 'file' => 'e_user_eh.php'),
+
+ # extend default Product classes /in-commerce/units/products/products_tag_processor.php / products_event_handler.php
+// Array ('pseudo' => 'p_TagProcessor', 'class' => 'EProductTagProcessor', 'file' => 'e_product_tp.php'),
+// Array ('pseudo' => 'p_EventHandler', 'class' => 'EProductEventHandler', 'file' => 'e_product_eh.php'),
+
+ # extend default Link /in-link/units/links/link_tag_processor.php / links_event_handler.php
+// Array ('pseudo' => 'l_TagProcessor', 'class' => 'ELinkTagProcessor', 'file' => 'e_link_tp.php'),
+// Array ('pseudo' => 'l_EventHandler', 'class' => 'ELinkEventHandler', 'file' => 'e_link_eh.php'),
+
+ ),
+
+ # Replace/substiture any admin default templates with custom ones
+ 'ReplacementTemplates' => Array (
+ # replace default image block with custom template
+// 'incs/image_blocks' => 'custom/incs/image_blocks',
+
+ # replace default edit link template
+// 'in-links/links/links_edit' => 'custom/links/links_edit',
+
+ # replace default edit category template
+// 'categories/categories_edit' => 'custom/categories/categories_edit',
+ ),
+
+ # Hooks to events that may call any other events
+ 'Hooks' => Array (
+
+ # hook to category OnAfterConfigRead event called to customize category configuration settings
+ /*Array (
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'c',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array ('OnAfterConfigRead'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '*',
+ 'DoEvent' => 'OnModifyCategoriesConfig',
+ ),*/
+ ),
+
+ 'PermSection' => Array ('main' => 'custom', 'email' => 'custom:configuration_email'),
+
+ # New sections in left navigation
+ /*'Sections' => Array (
+ 'custom' => Array (
+ 'parent' => 'in-portal:root',
+ 'icon' => 'conf_custom',
+ 'label' => 'la_title_Custom',
+ 'url' => Array ('t' => 'index', 'pass' => 'm'),
+ 'permissions' => Array ('view'),
+ 'priority' => 2.4,
+ 'container' => true,
+ 'type' => stTREE,
+ ),
+
+ ),*/
+
+ );
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_user_tp.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_user_tp.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_user_tp.php (revision 12743)
@@ -0,0 +1,38 @@
+getObject();
+ /* @var $object kDBItem */
+
+ $ret = '';
+ $newline = '
';
+
+ if ($object->isLoaded()) {
+ $ret = $object->GetField('Street') ? $object->GetField('Street') . $newline : '';
+ $ret .= $object->GetField('Street2') ? $object->GetField('Street2') . $newline : '';
+ $ret .= $object->GetField('City') ? $object->GetField('City') . ', ' : '';
+ $ret .= $object->GetField('State') ? $object->GetField('State') . ' ' : '';
+ $ret .= $object->GetField('Zip') ? $object->GetField('Zip') . $newline : '';
+ $ret .= $object->GetField('Country');
+ }
+
+ return $ret;
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_user_eh.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_user_eh.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_user_eh.php (revision 12743)
@@ -0,0 +1,188 @@
+ Array ('self' => true),
+
+ # front
+ 'OnCustomEvent2' => Array ('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Permission exceptions
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $skip_permissions_check_events = Array (
+ 'OnAnotherCustomEvent',
+ );
+
+ if ( in_array($event->Name, $skip_permissions_check_events) ) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Updates structure config
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ # 1. Regular Fields from /core/units/users/users_config.php
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields'); #get regular fields
+// $fields['Status']['default'] = 1; #add/edit configuration (make default = 1)
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields); #save regular fields
+
+ # 2. Virtual Fields from /core/units/users/users_config.php
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields'); #get virtual fields
+// $virtual_fields['FullName']['default'] = ''; #add/edit configuration
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); #save virtual fields
+ }
+
+ /**
+ * Sets custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ # identifying event based on special and setting filter
+ if ( $event->Special == 'custom-special' ) {
+// $object->addFilter('primary_filter', '%1$s.Status = ' . STATUS_DISABLED);
+ }
+
+ # identifying event based not admin condition and setting filter
+ if (!$this->Application->isAdminUser) {
+// $object->addFilter('status_filter', '%1$s.Status = ' . STATUS_ACTIVE);
+ }
+ }
+
+ /**
+ * Before new item created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+
+ }
+
+ /**
+ * Before existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+
+ }
+
+ /**
+ * Before item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ parent::OnBeforeItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemLoad(&$event)
+ {
+ parent::OnBeforeItemLoad($event);
+
+
+ }
+
+
+ /**
+ * After new item created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+
+ }
+
+ /**
+ * After existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+
+ }
+
+ /**
+ * After item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/custom_eh.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/custom_eh.php (revision 0)
+++ branches/1.0.x/custom/units/sections/custom_eh.php (revision 12743)
@@ -0,0 +1,39 @@
+Conn =& $this->Application->GetADODBConnection();
+ }
+
+ /**
+ * [HOOK] Modify config stored in "categories_config.php" without extending CategoriesEventHandler class
+ *
+ * @param kEvent $event
+ */
+ function OnModifyCategoriesConfig(&$event)
+ {
+ # get Fields configuration from /core/units/categories/categories_config.php
+ $fields = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'Fields');
+
+ # set configuration fields
+ $this->Application->setUnitOption($event->MasterEvent->Prefix, 'Fields', $fields);
+ }
+
+ }
\ No newline at end of file
Index: branches/1.0.x/custom/units/sections/e_product_tp.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/sections/e_product_tp.php (revision 0)
+++ branches/1.0.x/custom/units/sections/e_product_tp.php (revision 12743)
@@ -0,0 +1,28 @@
+ Array ('self' => true),
+
+ # front
+ 'OnCustomEvent2' => Array ('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Permission exceptions
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $skip_permissions_check_events = Array (
+ 'OnAnotherCustomEvent',
+ );
+
+ if ( in_array($event->Name, $skip_permissions_check_events) ) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Updates structure config
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ # 1. Regular Fields from /in-commerce/units/products/products_config.php
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields'); #get regular fields
+// $fields['Status']['default'] = 1; #add/edit field configuration (make default = 1)
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields); #save regular fields
+
+
+ # 2. Virtual Fields from /in-commerce/units/products/products_config.php
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields'); #get virtual fields
+// $virtual_fields['Qty']['default'] = 1; #add/edit field configuration
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); # save virtual fields
+ }
+
+ /**
+ * Sets custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ # identifying event based on special and setting filter
+ if ( $event->Special == 'custom-special' ) {
+// $object->addFilter('primary_filter', '%1$s.Status = '.STATUS_DISABLED);
+ }
+
+ # identifying event based not admin condition and setting filter
+ if (!$this->Application->isAdminUser) {
+// $object->addFilter('status_filter', '%1$s.Status = '.STATUS_ACTIVE);
+ }
+ }
+
+ /**
+ * Before new item created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+
+ }
+
+ /**
+ * Before existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+
+ }
+
+ /**
+ * Before item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ parent::OnBeforeItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemLoad(&$event)
+ {
+ parent::OnBeforeItemLoad($event);
+
+
+ }
+
+
+ /**
+ * After new item created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+
+ }
+
+ /**
+ * After existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+
+ }
+
+ /**
+ * After item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+
+ }
+
+ }
\ No newline at end of file
Index: branches/RC/custom/units/site_configs/search_logs_search-log.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/search_logs_search-log.php (revision 0)
+++ branches/RC/custom/units/site_configs/search_logs_search-log.php (revision 12743)
@@ -0,0 +1,48 @@
+ Array ('refresh', 'clear_selected', 'reset', 'export', 'view', 'dbl-click'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'SearchLogId', 'Keyword', 'Indices', 'SearchType'*/
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /*'SearchLogId', 'Keyword', 'Indices', 'SearchType'*/
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// currently not in user
+// 'Default' => Array ('SearchLogId', 'Keyword', 'Indices', 'SearchType'),
+ );
\ No newline at end of file
Index: branches/RC/custom/units/site_configs/files_l-file.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/files_l-file.php (revision 0)
+++ branches/RC/custom/units/site_configs/files_l-file.php (revision 12743)
@@ -0,0 +1,7 @@
+UnitConfigReader->getPrefixFile('custom-sections') ) . '/../site_configs/';
+
+ // include site config settings from main "file" prefix
+ include('files_file.php');
Index: branches/RC/custom/units/site_configs/form_fields_formflds.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/form_fields_formflds.php (revision 0)
+++ branches/RC/custom/units/site_configs/form_fields_formflds.php (revision 12743)
@@ -0,0 +1,34 @@
+ Array ('FormFieldId', 'FieldName', 'FieldLabel', 'Priority', 'ElementType', 'Required', 'DisplayInGrid'),
+ );
Index: branches/RC/custom/units/site_configs/mailing_lists_mailing-list.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/mailing_lists_mailing-list.php (revision 0)
+++ branches/RC/custom/units/site_configs/mailing_lists_mailing-list.php (revision 12743)
@@ -0,0 +1,55 @@
+ Array ('new_item', 'view_item', 'delete', 'cancel', 'view', 'dbl-click'),
+
+// "General" tab during adding/editing
+// 'mailing_list_edit' => Array ('select', 'cancel', 'prev', 'next'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'MailingId', 'PortalUserId', 'To', 'ToParsed', 'Subject', 'MessageText', 'MessageHtml', 'Status',
+ 'EmailsQueued', 'EmailsSent', 'EmailsTotal'*/
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /*'MailingId', */ 'PortalUserId', 'To', /*'ToParsed', 'Subject', 'MessageText', 'MessageHtml', 'Status',
+ 'EmailsQueued', 'EmailsSent', 'EmailsTotal'*/
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// currently not in user
+// 'Default' => Array ('MailingId', 'Subject', 'MessageText', 'MessageHtml', 'Status', 'EmailsQueued', 'EmailsSent', 'EmailsTotal'),
+ );
\ No newline at end of file
Index: branches/RC/custom/units/site_configs/forms_form.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/forms_form.php (revision 0)
+++ branches/RC/custom/units/site_configs/forms_form.php (revision 12743)
@@ -0,0 +1,58 @@
+ Array ('new_form', 'edit', 'delete', 'view', 'dbl-click'),
+
+// editing form
+// 'forms_edit' => Array ('select', 'cancel', 'prev', 'next'),
+
+// edit list of fields when adding/editing form
+// 'forms_edit_fields' => Array ('select', 'cancel', 'prev', 'next', 'new_item', 'edit', 'delete', 'move_up', 'move_down', 'view', 'dbl-click'),
+
+// edit form field when adding/editing form
+// 'form_field_edit' => Array ('select', 'cancel'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /* 'FormId', 'Title', 'Description', */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /* 'FormId',*/ 'Title', /* 'Description', */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+// tabs during form editing
+// 'Default' => Array ('general', 'fields'),
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// list of forms
+// 'Default' => Array ('FormId', 'Title'),
+ );
Index: branches/RC/custom/units/site_configs/relationship_c-rel.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/relationship_c-rel.php (revision 0)
+++ branches/RC/custom/units/site_configs/relationship_c-rel.php (revision 12743)
@@ -0,0 +1,7 @@
+UnitConfigReader->getPrefixFile('custom-sections') ) . '/../site_configs/';
+
+ // include site config settings from main "rel" prefix
+ include('relationship_rel.php');
Index: branches/RC/custom/units/site_configs/email_logs_email-log.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/email_logs_email-log.php (revision 0)
+++ branches/RC/custom/units/site_configs/email_logs_email-log.php (revision 12743)
@@ -0,0 +1,43 @@
+ Array ('refresh', 'reset', 'view'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'EmailLogId', 'fromuser', 'addressto', 'subject', 'timestamp', 'event', 'EventParams'*/
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /*'EmailLogId', 'fromuser', 'addressto', 'subject', 'timestamp', 'event', 'EventParams'*/
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// currently not in user
+// 'Default' => Array ('EmailLogId', 'fromuser', 'addressto', 'subject', 'timestamp', 'event'),
+ );
\ No newline at end of file
Index: branches/RC/custom/units/site_configs/user_groups_g-ug.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/user_groups_g-ug.php (revision 0)
+++ branches/RC/custom/units/site_configs/user_groups_g-ug.php (revision 12743)
@@ -0,0 +1,49 @@
+User relations (ie. selecting group when adding/editing Group) */
+
+ // section removal
+ $remove_sections = Array (
+// no separate tree section defined for this
+ );
+
+ // sections shown with debug on
+ $debug_only_sections = Array (
+// no separate tree section defined for this
+ );
+
+ // toolbar buttons
+ $remove_buttons = Array (
+// no buttons defined here - see users_u.php
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /* 'PortalUserId', 'GroupId', 'MembershipExpires', 'PrimaryGroup', 'ExpirationReminderSent', */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+// 'UserName', 'UserLogin',
+ );
+
+ // fields to make required
+ $required_fields = Array (
+/* 'PortalUserId', 'GroupId', 'MembershipExpires', 'PrimaryGroup', 'ExpirationReminderSent', */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+// 'UserName', 'UserLogin',
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+// no tabs defined here
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// 'GroupUsers' => Array ('PortalUserId', 'UserName', 'UserLogin', 'PrimaryGroup', 'MembershipExpires'),
+
+ );
Index: branches/RC/custom/units/site_configs/stop_words_stop-word.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/stop_words_stop-word.php (revision 0)
+++ branches/RC/custom/units/site_configs/stop_words_stop-word.php (revision 12743)
@@ -0,0 +1,50 @@
+ Array ('new_item', 'edit', 'delete', 'view', 'dbl-click'),
+
+// General" tab during adding/editing
+// 'stop_word_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'StopWordId', 'StopWord'*/
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// 'Default' => Array ('StopWordId', 'StopWord'),
+ );
Index: branches/RC/custom/units/site_configs/links_l.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/links_l.php (revision 0)
+++ branches/RC/custom/units/site_configs/links_l.php (revision 12743)
@@ -0,0 +1,123 @@
+ Array (),
+
+// "General" tab during link adding/editing
+// 'links_edit' => Array ('select', 'cancel', 'prev', 'next'),
+
+// "Images" tab during link adding/editing
+// 'links_images' => Array ('select', 'cancel', 'prev', 'next', 'new_image', 'edit', 'delete', 'move_up', 'move_down', 'primary_image', 'view', 'dbl-click'),
+
+// "Categories" tab during link adding/editing
+// 'links_categories' => Array ('select', 'cancel', 'prev', 'next', 'new_cat', 'delete', 'primary_cat',),
+
+// "Relations" tab during link adding/editing
+// 'links_relations' => Array ('select', 'cancel', 'prev', 'next', 'new_relation', 'edit', 'delete', 'approve', 'decline', 'view', 'dbl-click'),
+
+// "Custom" tab during user/admin adding/editing
+// 'links_custom' => Array ('select', 'cancel', 'prev', 'next'),
+
+// "Files" tab
+// 'links_files' => Array ('select', 'cancel', 'prev', 'next', 'new_file', 'edit', 'delete', 'view', 'dbl-click'),
+
+// "Reviews" tab during admin adding/editing AND separate password change form for non-"root" users (in top frame)
+// 'links_reviews' => Array ('select', 'cancel', 'prev', 'next', 'new_review', 'edit', 'delete', 'approve', 'decline', 'move_up', 'move_down', 'view', 'dbl-click'),
+
+// edit iamge
+// 'images_edit' => Array ('select', 'cancel'),
+
+// edit file
+// 'file_edit' => Array ('select', 'cancel'),
+
+// user/admin group membership editing (used on "Groups" tab during user/admin adding/editing)
+// 'reviews_edit' => Array ('select', 'cancel'),
+
+// user image adding/editing (used on "Images" tab during user adding/editing)
+// 'relations_edit' => Array ('select', 'cancel'),
+
+// duplicate links
+// 'duplicate_links' => Array ('view_item', 'view', 'dbl-click'),
+
+// duplicate links -> view duplicates of the link
+// 'duplicate_links_view' => Array ('cancel', 'edit', 'delete', 'merge_links', 'view', 'dbl-click'),
+
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /* 'LinkId', 'Name', 'AutomaticFilename', 'Description', 'Url', 'CreatedOn', 'Modified', 'Expire',
+ 'Hits', 'CachedRating', 'CachedVotesQty', 'CachedReviewsQty', 'CreatedById', 'ModifiedById' , 'Priority', 'Status', 'EditorPick',
+ 'ResourceId', 'HotItem', 'PopItem', 'NewItem', 'OrgId', 'CustomTemplate', 'MetaKeywords', 'MetaDescription', 'ReciprocalLinkFound', */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+ /*'UserName', 'DupeCount', 'ListingTypeId', 'MoreCategories', 'CategoryId', 'ExportFormat', 'ExportFilename',
+ 'FieldsSeparatedBy', 'FieldsEnclosedBy', 'LineEndings', 'LineEndingsInside', 'IncludeFieldTitles', 'ExportColumns',
+ 'AvailableColumns', 'CategoryFormat', 'CategorySeparator', 'IsBaseCategory', 'FieldTitles', 'ImportSource',
+ 'ImportFilename', 'ImportLocalFilename', 'CheckDuplicatesMethod', 'ReplaceDuplicates', 'DuplicateCheckFields',
+ 'SkipFirstRow', 'ThumbnailImage', 'FullImage', 'ImageAlt', 'Filename', 'CachedNavbar', 'ParentPath',
+ 'SameImages', 'LocalThumb', 'ThumbPath', 'ThumbUrl', 'LocalImage', 'LocalPath', 'FullUrl', */
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /* 'LinkId', */ 'Name', /* 'AutomaticFilename', 'Description',*/ 'Url', /*'CreatedOn', 'Modified', 'Expire',
+ 'Hits', 'CachedRating', 'CachedVotesQty', 'CachedReviewsQty', 'CreatedById', 'ModifiedById' , 'Priority', 'Status', 'EditorPick',
+ 'ResourceId', 'HotItem', 'PopItem', 'NewItem', 'OrgId', 'CustomTemplate', 'MetaKeywords', 'MetaDescription', 'ReciprocalLinkFound', */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+ /*'UserName', 'DupeCount', 'ListingTypeId', 'MoreCategories', 'CategoryId', 'ExportFormat', 'ExportFilename',
+ 'FieldsSeparatedBy', 'FieldsEnclosedBy', 'LineEndings', 'LineEndingsInside', 'IncludeFieldTitles', 'ExportColumns',
+ 'AvailableColumns', 'CategoryFormat', 'CategorySeparator', 'IsBaseCategory', 'FieldTitles', 'ImportSource',
+ 'ImportFilename', 'ImportLocalFilename', 'CheckDuplicatesMethod', 'ReplaceDuplicates', 'DuplicateCheckFields',
+ 'SkipFirstRow', 'ThumbnailImage', 'FullImage', 'ImageAlt', 'Filename', 'CachedNavbar', 'ParentPath',
+ 'SameImages', 'LocalThumb', 'ThumbPath', 'ThumbUrl', 'LocalImage', 'LocalPath', 'FullUrl', */
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+// tabs during link adding/editing
+// 'Default' => Array ('general', 'categories', 'relations', 'images', 'files', 'reviews', 'custom'),
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// default grid
+// 'Default' => Array ('LinkId', 'Name', 'Url', 'Description', 'CreatedOn', 'Modified', 'Hits', 'CachedRating', 'CachedVotesQty', 'CachedReviewsQty'),
+
+// link radio selector grid
+// 'Radio' => Array ('LinkId', 'Name', 'Url', 'Description', 'CreatedOn', 'Modified', 'Hits', 'CachedRating', 'CachedVotesQty', 'CachedReviewsQty'),
+
+// duplicate links grid
+// 'Duplicates' => Array ('Name', 'Url', 'DupeCount'),
+ );
Index: branches/RC/custom/units/site_configs/selectors_selectors.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/selectors_selectors.php (revision 0)
+++ branches/RC/custom/units/site_configs/selectors_selectors.php (revision 12743)
@@ -0,0 +1,47 @@
+ Array ('Name', 'SelectorName', 'Description', ),
+// 'BlockStyles' => Array ('Name', 'SelectorName', 'Description', 'ParentId', ),
+ );
Index: branches/RC/custom/units/site_configs/translator_trans.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/translator_trans.php (revision 0)
+++ branches/RC/custom/units/site_configs/translator_trans.php (revision 12743)
@@ -0,0 +1,42 @@
+ Array ('select', 'cancel'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+// no fields
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+ /*'Original', 'Language', 'SwitchLanguage', 'Translation'*/
+ );
+
+ // fields to make required
+ $required_fields = Array (
+// no fields
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+ /*'Original', 'Language', 'SwitchLanguage', 'Translation'*/
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+// no tabs
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// no grids/columns
+ );
Index: branches/RC/custom/units/site_configs/visits_visits.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/visits_visits.php (revision 0)
+++ branches/RC/custom/units/site_configs/visits_visits.php (revision 12743)
@@ -0,0 +1,45 @@
+ Array ('search', 'search_reset', 'refresh', 'reset', 'export', 'view'),
+
+// list of visits when In-Commerce installed; section: Visits
+ 'visits.incommerce_list' => Array ('search', 'search_reset', 'refresh', 'reset', 'export', 'view'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'VisitId', 'VisitDate', 'Referer', 'IPAddress', 'LastName', 'PortalUserId'*/
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+ /*'UserName', 'AffiliateUser', 'AffiliatePortalUserId', 'OrderTotalAmount', 'OrderTotalAmountSum', 'OrderAffiliateCommission',
+ 'OrderAffiliateCommissionSum', 'OrderId'*/
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// NO In-Commerce installed
+// 'Default' => Array ('VisitDate', 'IPAddress', 'Referer', 'UserName'),
+
+// In-Commerce IS installed
+// 'visitsincommerce' => Array ('VisitDate', 'IPAddress', 'Referer', 'UserName', 'OrderTotalAmountSum', 'OrderAffiliateCommissionSum'),
+ );
Index: branches/RC/custom/units/site_configs/images_l-img.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/images_l-img.php (revision 0)
+++ branches/RC/custom/units/site_configs/images_l-img.php (revision 12743)
@@ -0,0 +1,7 @@
+UnitConfigReader->getPrefixFile('custom-sections') ) . '/../site_configs/';
+
+ // include site config settings from main "img" prefix
+ include('images_img.php');
Index: branches/RC/custom/units/site_configs/spelling_dictionary_spelling-dictionary.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/spelling_dictionary_spelling-dictionary.php (revision 0)
+++ branches/RC/custom/units/site_configs/spelling_dictionary_spelling-dictionary.php (revision 12743)
@@ -0,0 +1,50 @@
+ Array ('new_spelling_dictionary', 'edit', 'delete', 'export', 'view', 'dbl-click'),
+
+// General tab during adding/editing
+// 'spelling_dictionary_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'SpellingDictionaryId', 'MisspelledWord', 'SuggestedCorrection'*/
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /*'SpellingDictionaryId',*/ 'MisspelledWord', 'SuggestedCorrection',
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// 'Default' => Array ('SpellingDictionaryId', 'MisspelledWord', 'SuggestedCorrection'),
+ );
Index: branches/RC/custom/units/site_configs/related_searches_search.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/related_searches_search.php (revision 0)
+++ branches/RC/custom/units/site_configs/related_searches_search.php (revision 12743)
@@ -0,0 +1,43 @@
+ Array ('RelatedSearchId', 'Keyword', 'Enabled'),
+ );
\ No newline at end of file
Index: branches/RC/custom/units/site_configs/reviews_rev.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/reviews_rev.php (revision 0)
+++ branches/RC/custom/units/site_configs/reviews_rev.php (revision 12743)
@@ -0,0 +1,51 @@
+ Array ('edit', 'delete', 'approve', 'decline', 'view', 'dbl-click'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /* 'ReviewId', 'CreatedOn', 'ReviewText', 'Rating', 'IPAddress', 'ItemId', 'CreatedById', 'ItemType',
+ 'Priority', 'Status', 'TextFormat', 'Module', */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+// 'ReviewedBy', 'CatalogItemName', 'CatalogItemId', 'CatalogItemCategory',
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /* 'ReviewId', 'CreatedOn',*/ 'ReviewText', /*'Rating', 'IPAddress', 'ItemId', 'CreatedById', 'ItemType',
+ 'Priority', 'Status', 'TextFormat', 'Module', */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+// 'ReviewedBy', 'CatalogItemName', 'CatalogItemId', 'CatalogItemCategory',
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+// no tabs defined here
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// 'Default' => Array ('ReviewId', 'ReviewText', 'ReviewedBy', 'CreatedOn', 'Status', 'Rating'),
+// 'ReviewsSection' => Array ('ReviewId', 'ReviewText', 'ReviewedBy', 'CreatedOn', 'Status', 'Rating'),
+ );
Index: branches/RC/custom/units/site_configs/change_logs_change-log.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/change_logs_change-log.php (revision 0)
+++ branches/RC/custom/units/site_configs/change_logs_change-log.php (revision 12743)
@@ -0,0 +1,36 @@
+ Array ('view_item', 'view'),
+
+// view changed records
+// 'change_log_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'ChangeLogId', 'PortalUserId', 'SessionLogId', 'Action', 'OccuredOn', 'Prefix', 'ItemId', 'Changes', 'MasterPrefix', 'MasterId',*/
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /*'ChangeLogId', 'PortalUserId', 'SessionLogId', 'Action', 'OccuredOn', 'Prefix', 'ItemId', 'Changes', 'MasterPrefix', 'MasterId',*/
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// currently not in user
+// 'Default' => Array ('ChangeLogId', 'PortalUserId', 'UserLogin', 'UserFirstName', 'UserLastName', 'SessionLogId', 'Action', 'OccuredOn', 'MasterPrefix', 'MasterId', 'Prefix', 'ItemId', 'Changes'),
+ );
\ No newline at end of file
Index: branches/RC/custom/units/site_configs/skins_skin.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/skins_skin.php (revision 0)
+++ branches/RC/custom/units/site_configs/skins_skin.php (revision 12743)
@@ -0,0 +1,50 @@
+ Array ('new_item', 'edit', 'delete', 'primary_theme', 'clone', 'view', 'dbl-click'),
+
+// General" tab during adding/editing
+// 'skin_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'SkinId', 'Name', 'CSS', 'Logo', 'LogoBottom', 'LogoLogin', 'Options', 'LastCompiled', 'IsPrimary' */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /*'SkinId', */'Name', /*'CSS', 'Logo', 'LogoBottom', 'LogoLogin', 'Options', 'LastCompiled', 'IsPrimary' */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// 'Default' => Array ('SkinId', 'Name', 'IsPrimary'),
+ );
Index: branches/RC/custom/units/site_configs/themes_theme.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/themes_theme.php (revision 0)
+++ branches/RC/custom/units/site_configs/themes_theme.php (revision 12743)
@@ -0,0 +1,58 @@
+ Array ('new_theme', 'edit', 'delete', 'primary_theme', 'rescan_themes', 'view', 'dbl-click'),
+
+// "General" tab during adding/editing
+// 'themes_edit_general' => Array ('select', 'cancel', 'prev', 'next'),
+
+// "Files" tab during adding/editing
+// 'themes_edit_files' => Array ('select', 'cancel', 'prev', 'next', 'delete', 'view', 'dbl-click'),
+
+// "Edit File"
+// 'theme_file_edit' => Array ('select', 'cancel', 'reset_edit'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'ThemeId', 'Name', 'Enabled', 'Description', 'PrimaryTheme', 'CacheTimeout', 'StylesheetId',*/
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+ /*'StyleName', 'LastCompiled'*/
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /*'ThemeId',*/ 'Name', /*'Enabled', 'Description', 'PrimaryTheme', 'CacheTimeout', 'StylesheetId'*/
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+ /*'StyleName', 'LastCompiled'*/
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+// tabs during editing
+// 'Default' => Array ('general', 'files'),
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// currently not in user
+// 'Default' => Array ('ThemeId', 'Name', 'Description', 'Enabled', 'PrimaryTheme'),
+ );
Index: branches/RC/custom/units/site_configs/related_searches_c-search.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/related_searches_c-search.php (revision 0)
+++ branches/RC/custom/units/site_configs/related_searches_c-search.php (revision 12743)
@@ -0,0 +1,7 @@
+UnitConfigReader->getPrefixFile('custom-sections') ) . '/../site_configs/';
+
+ // include site config settings from main "search" prefix
+ include('related_searches_search.php');
\ No newline at end of file
Index: branches/RC/custom/units/site_configs/relationship_rel.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/relationship_rel.php (revision 0)
+++ branches/RC/custom/units/site_configs/relationship_rel.php (revision 12743)
@@ -0,0 +1,46 @@
+ Array ('RelationshipId', 'ItemName', 'ItemType', 'Type', 'Enabled'),
+ );
Index: branches/RC/custom/units/site_configs/session_logs_session-log.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/session_logs_session-log.php (revision 0)
+++ branches/RC/custom/units/site_configs/session_logs_session-log.php (revision 12743)
@@ -0,0 +1,49 @@
+ Array ('view', 'dbl-click'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'SessionLogId', 'PortalUserId', 'SessionId', 'Status', 'SessionStart', 'SessionEnd', 'IP', 'AffectedItems',*/
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+ /*'Duration', */
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /*'SessionLogId', 'PortalUserId', 'SessionId', 'Status', 'SessionStart', 'SessionEnd', 'IP', 'AffectedItems',*/
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+ /*'Duration', */
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// currently not in user
+ 'Default' => Array (/* 'SessionLogId', 'PortalUserId', 'SessionId', 'Status', 'SessionStart', 'SessionEnd'
+, 'IP', 'Duration', 'AffectedItems', */),
+ );
\ No newline at end of file
Index: branches/RC/custom/units/site_configs/form_submissions_formsubs.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/form_submissions_formsubs.php (revision 0)
+++ branches/RC/custom/units/site_configs/form_submissions_formsubs.php (revision 12743)
@@ -0,0 +1,41 @@
+ Array ('edit', 'delete', 'dbl-click'),
+
+// editing form
+// 'formsubs_view' => Array ('cancel', 'prev', 'next'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /* 'FormSubmissionId', 'FormId', 'SubmissionTime', */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /* 'FormSubmissionId', 'FormId', 'SubmissionTime', */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// submission columns
+// 'Default' => Array ('FormSubmissionId', 'SubmissionTime'),
+ );
Index: branches/RC/custom/units/site_configs/modules_mod.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/modules_mod.php (revision 0)
+++ branches/RC/custom/units/site_configs/modules_mod.php (revision 12743)
@@ -0,0 +1,48 @@
+ Array ('approve', 'deny', 'view'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'Name', 'Path', 'Var', 'Version', 'Loaded', 'LoadOrder', 'TemplatePath', 'RootCat', 'BuildDate'*/
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /*'Name', 'Path', 'Var', 'Version', 'Loaded', 'LoadOrder', 'TemplatePath', 'RootCat', 'BuildDate'*/
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// currently not in user
+// 'Default' => Array ('Name', 'Version', 'Loaded'),
+ );
\ No newline at end of file
Index: branches/RC/custom/units/site_configs/reviews_l-rev.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/reviews_l-rev.php (revision 0)
+++ branches/RC/custom/units/site_configs/reviews_l-rev.php (revision 12743)
@@ -0,0 +1,7 @@
+UnitConfigReader->getPrefixFile('custom-sections') ) . '/../site_configs/';
+
+ // include site config settings from main "rev" prefix
+ include('reviews_rev.php');
Index: branches/RC/custom/units/site_configs/relationship_l-rel.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/relationship_l-rel.php (revision 0)
+++ branches/RC/custom/units/site_configs/relationship_l-rel.php (revision 12743)
@@ -0,0 +1,7 @@
+UnitConfigReader->getPrefixFile('custom-sections') ) . '/../site_configs/';
+
+ // include site config settings from main "rel" prefix
+ include('relationship_rel.php');
Index: branches/RC/custom/units/site_configs/agents_agent.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/agents_agent.php (revision 0)
+++ branches/RC/custom/units/site_configs/agents_agent.php (revision 12743)
@@ -0,0 +1,49 @@
+ Array ('new_agent', 'edit', 'delete', 'approve', 'decline', 'cancel', 'view', 'dbl-click'),
+
+// edit agent
+// 'agent_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /* 'AgentId', 'AgentName', 'AgentType', 'Status', 'Event', 'RunInterval', 'RunMode', 'LastRunOn',
+ 'LastRunStatus', 'NextRunOn', 'RunTime', */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /* 'AgentId', 'AgentName', 'AgentType', 'Status', 'Event', 'RunInterval', 'RunMode', 'LastRunOn',
+ 'LastRunStatus', 'NextRunOn', 'RunTime', */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array ( );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// currently not in user
+// 'Default' => Array ( 'AgentId', 'AgentName', 'AgentType', 'Status', 'Event', 'RunInterval', 'RunMode', 'LastRunOn', 'LastRunStatus', 'NextRunOn', ),
+ );
\ No newline at end of file
Index: branches/RC/custom/units/site_configs/languages_lang.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/languages_lang.php (revision 0)
+++ branches/RC/custom/units/site_configs/languages_lang.php (revision 12743)
@@ -0,0 +1,18 @@
+ Array ('FileId', 'FileName', 'Status'),
+ );
Index: branches/RC/custom/units/site_configs/phrases_phrases.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/phrases_phrases.php (revision 0)
+++ branches/RC/custom/units/site_configs/phrases_phrases.php (revision 12743)
@@ -0,0 +1,34 @@
+ Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+
+// single phrase list
+// 'phrases_list_st' => ('new_item', 'edit', 'delete', 'view', 'dbl-click'),
+
+// edit phrase
+// 'phrase_edit_single' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// default grid
+// 'Default' => Array ('Phrase', 'Translation', 'PrimaryTranslation', 'PhraseType', 'LastChanged', 'Module'),
+
+// single list of phrases
+// 'Phrases' => Array ('PhraseId', 'Phrase', 'Translation', 'PackName', 'PhraseType', 'LastChanged', 'Module'),
+ );
+
Index: branches/RC/custom/units/site_configs/admin_admin.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/admin_admin.php (revision 0)
+++ branches/RC/custom/units/site_configs/admin_admin.php (revision 12743)
@@ -0,0 +1,6 @@
+ Array ('ImageId', 'Name', 'AltName', 'Url', 'Enabled', 'Preview'),
+ );
Index: branches/RC/custom/units/site_configs/theme_files_theme-file.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/theme_files_theme-file.php (revision 0)
+++ branches/RC/custom/units/site_configs/theme_files_theme-file.php (revision 12743)
@@ -0,0 +1,43 @@
+ Array ('FileId', 'FilePath', 'FileName', 'Description'),
+ );
Index: branches/RC/custom/units/site_configs/categories_c.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/categories_c.php (revision 0)
+++ branches/RC/custom/units/site_configs/categories_c.php (revision 12743)
@@ -0,0 +1,82 @@
+ Array (/*'select', 'cancel', 'upcat', 'homecat', 'new_cat', 'new_link', 'new_article', 'new_topic', 'new_item', 'edit', 'delete',*/ 'approve', 'decline', /*'cut', 'copy', 'paste', 'move_up', 'move_down',*/ 'rebuild_cache', /*'view', 'dbl-click',*/ ),
+
+ 'advanced_view' => Array (/*'select', 'cancel', 'new_cat', 'edit', 'delete',*/ 'approve', 'decline', /*'view', 'dbl-click' */),
+
+// 'categories_relations' => Array ('select', 'cancel', 'prev', 'next', 'new_relation', 'edit', 'delete', 'approve', 'decline', 'view', 'dbl-click'),
+// 'categories_propertiries' => Array ('select', 'cancel', 'prev', 'next'),
+
+// 'categories_permissions' => Array ('select', 'cancel', 'prev', 'next'),
+
+// 'categories_images' => Array ('select', 'cancel', 'prev', 'next', 'new_image', 'edit', 'delete', 'move_up', 'move_down', 'primary_image', 'view', 'dbl-click'),
+
+// 'reviews' => Array ('edit', 'delete', 'approve', 'decline', 'view', 'dbl-click'),
+
+// 'categories_related_searches' => Array ('new_related_search', 'edit', 'delete', 'move_up', 'move_down', 'approve', 'decline', 'view', 'dbl-click'),
+
+// 'related_searches_edit' => Array ('select', 'cancel'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ 'CategoryId', /*'Type',*/ 'SymLinkCategoryId', /*'ParentId', 'Name', 'Filename', 'AutomaticFilename',*/
+ 'Description', 'CreatedOn', 'EditorsPick', 'Status', /*'Priority', 'MetaKeywords', 'CachedDescendantCatsQty',
+ 'CachedNavbar', 'CreatedById', 'ResourceId', 'ParentPath', 'TreeLeft', 'TreeRight', 'NamedParentPath',
+ 'MetaDescription', 'HotItem',*/ 'NewItem', /*'PopItem', 'Modified', 'ModifiedById', 'CachedTemplate',
+ 'Template',*/ 'UseExternalUrl', 'ExternalUrl', 'UseMenuIconUrl', 'MenuIconUrl', 'Title', 'MenuTitle',
+ /*'MetaTitle', 'IndexTools', 'IsIndex', 'IsMenu', 'IsSystem',*/ 'FormId', 'FormSubmittedTemplate',
+ /*'Translated', 'FriendlyURL', 'ThemeId'*/
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+ /*'CurrentSort', 'IsNew', 'OldPriority', 'SameImages', 'LocalThumb', 'ThumbPath', 'ThumbUrl',
+ 'LocalImage', 'LocalPath', 'FullUrl'*/
+ );
+
+ $debug_only_fields = Array (
+ 'Filename', 'AutomaticFilename', 'IsIndex',
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ 'ParentId', 'Name', 'Filename', 'CreatedOn', 'Priority',
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+ 'Default' => Array (/*'general', */'properties', 'relations', 'related_searches', 'images', 'permissions', 'custom', ),
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+ 'Default' => Array (/*'CategoryId', 'Name', 'Modified', 'Template', 'IsMenu', 'IsSystem',*/ 'Priority'),
+ 'DefaultShowAll' => Array (/*'CategoryId', 'Name', 'Modified', 'Template', 'IsMenu', 'IsSystem', 'Priority', 'CachedNavbar'*/),
+ 'Radio' => Array (/*'CategoryId', 'Name', 'Modified', 'Template', 'IsMenu', 'IsSystem',*/ 'Priority'),
+ 'RadioShowALl' => Array (/*'CategoryId', 'Name', 'Modified', 'Template', 'IsMenu', 'IsSystem', 'Priority', 'CachedNavbar'*/),
+ 'Structure' => Array (/*'CategoryId', 'Name', 'Modified', 'Template', 'IsMenu', 'Path', 'IsSystem',*/ 'Priority'),
+ );
\ No newline at end of file
Index: branches/RC/custom/units/site_configs/email_messages_emailmessages.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/email_messages_emailmessages.php (revision 0)
+++ branches/RC/custom/units/site_configs/email_messages_emailmessages.php (revision 12743)
@@ -0,0 +1,54 @@
+ Array ('edit', 'view', 'dbl-click'),
+
+// edit email body direct
+// 'email_messages_edit_direct' => Array ('select', 'cancel', 'reset_edit'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'EmailMessageId', 'Template',*/ 'MessageType', /*'LanguageId', 'EventId', 'Subject' */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+ 'Headers',/* 'Body', 'ReplacementTags', 'Description', 'Module', 'Type', 'MassSubject', 'MassAttachment',
+ 'MassHtmlMessage', 'MassTextMessage', */
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /*'EmailMessageId', 'Template', 'MessageType', 'LanguageId', 'EventId', 'Subject' */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+ /* 'Headers', 'Body', 'ReplacementTags', 'Description', 'Module', 'Type', 'MassSubject', 'MassAttachment',
+ 'MassHtmlMessage', 'MassTextMessage', */
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// currently not in user
+// 'Default' => Array ('Subject', 'Description', 'Type', ),
+// 'Emails' => Array ('EventId', 'Subject', 'Description', 'Type', 'LanguageId', ),
+ );
\ No newline at end of file
Index: branches/RC/custom/units/site_configs/ban_rules_ban-rule.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/ban_rules_ban-rule.php (revision 0)
+++ branches/RC/custom/units/site_configs/ban_rules_ban-rule.php (revision 12743)
@@ -0,0 +1,51 @@
+ Array ('new_item', 'edit', 'delete', 'view', 'dbl-click'),
+
+// edit email body direct
+// 'ban_rule_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /* 'RuleId', 'RuleType', 'MessageType', 'LanguageId', 'ItemVerb', 'ItemValue', 'ItemType', 'Priority',
+ 'Status', 'ErrorTag', */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /* 'RuleId', 'RuleType', 'MessageType', 'LanguageId', 'ItemVerb',*/ 'ItemValue', /*'ItemType', 'Priority',
+ 'Status', 'ErrorTag', */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// currently not in user
+// 'Default' => Array ('RuleId', 'RuleType', 'ItemField', 'ItemVerb', 'ItemValue', 'Status', ),
+ );
\ No newline at end of file
Index: branches/RC/custom/units/site_configs/user_groups_u-ug.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/user_groups_u-ug.php (revision 0)
+++ branches/RC/custom/units/site_configs/user_groups_u-ug.php (revision 12743)
@@ -0,0 +1,49 @@
+Group relations (ie. selecting group when adding/editing user) */
+
+ // section removal
+ $remove_sections = Array (
+// no separate tree section defined for this
+ );
+
+ // sections shown with debug on
+ $debug_only_sections = Array (
+// no separate tree section defined for this
+ );
+
+ // toolbar buttons
+ $remove_buttons = Array (
+// no buttons defined here - see users_u.php
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /* 'PortalUserId', 'GroupId', 'MembershipExpires', 'PrimaryGroup', 'ExpirationReminderSent', */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+// 'GroupName', 'GroupDescription',
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /* 'PortalUserId', 'GroupId', 'MembershipExpires', 'PrimaryGroup', 'ExpirationReminderSent', */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+// 'GroupName', 'GroupDescription',
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+// no tabs defined here
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// 'Default' => Array ('GroupId', 'GroupName', 'GroupDescription', 'PrimaryGroup', 'MembershipExpires'),
+
+ );
Index: branches/RC/custom/units/site_configs/groups_g.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/groups_g.php (revision 0)
+++ branches/RC/custom/units/site_configs/groups_g.php (revision 12743)
@@ -0,0 +1,75 @@
+ Array ('new_group', 'edit', 'delete', 'e-mail', 'view', 'dbl-click'),
+
+// "Select Group" on Groups tab when adding/editing User
+// 'groups_edit' => Array ('select', 'cancel', 'prev', 'next'),
+
+// edit users when adding/editing group
+// 'groups_edit_users' => Array ('select', 'cancel', 'prev', 'next', 'usertogroup', 'delete', 'view'),
+
+// edit permission on permissions tab when adding/editing group
+// 'groups_edit_permissions' => Array ('select', 'cancel', 'prev', 'next'),
+
+// edit advanced permissions on permissions tab when adding/editing group
+// 'groups_edit_additional_permissions' => Array ('select', 'cancel'),
+
+// select group when adding/editing user
+// 'select_group' => Array ('select', 'cancel', 'view'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'GroupId', 'Name', 'Description', 'CreatedOn','System', 'Personal', 'Enabled', 'ResourceId',*/
+ 'FrontRegistration',
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+ /* 'UserCount', */
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /* 'GroupId', */ 'Name', /* 'Description', 'CreatedOn','System', 'Personal', 'Enabled', 'ResourceId',
+ 'FrontRegistration', */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+ /* 'UserCount', */
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+// tabs during groups editing
+// 'Default' => Array ('general', 'users', 'permissions'),
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// list of groups
+// 'Default' => Array ('GroupId', 'Name', 'UserCount', 'FrontRegistration'),
+
+// do we need this?
+// 'UserGroups' => Array ('GroupId', 'Name'),
+
+// list of groups with radio type list
+// 'Radio' => Array ('GroupId', 'Name', 'Description'),
+
+// list of groups on add group to user page (when editing user)
+// 'GroupSelector' => Array ('GroupId', 'Name', 'Description'),
+ );
Index: branches/RC/custom/units/site_configs/thesaurus_thesaurus.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/thesaurus_thesaurus.php (revision 0)
+++ branches/RC/custom/units/site_configs/thesaurus_thesaurus.php (revision 12743)
@@ -0,0 +1,50 @@
+ Array ('new_item', 'edit', 'delete', 'export', 'view'),
+
+// "General" tab during thesaurus term adding/editing
+// 'thesaurus_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'ThesaurusId', 'SearchTerm', 'ThesaurusTerm', 'ThesaurusType'*/
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /*'ThesaurusId', */ 'SearchTerm', 'ThesaurusTerm', /*'ThesaurusType'*/
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// 'Default' => Array ('ThesaurusId', 'SearchTerm', 'ThesaurusTerm', 'ThesaurusType',),
+ );
Index: branches/RC/custom/units/site_configs/sections_core-sections.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/sections_core-sections.php (revision 0)
+++ branches/RC/custom/units/site_configs/sections_core-sections.php (revision 12743)
@@ -0,0 +1,17 @@
+ Array ('new_style', 'edit', 'delete', 'approve', 'decline', 'clone', 'view', 'dbl-click'),
+
+// General" tab during adding/editing
+// 'stylesheets_edit' => Array ('select', 'cancel', 'prev', 'next'),
+
+// list of base styles
+// 'base_styles' => Array ('select', 'cancel', 'prev', 'next', 'new_selector', 'edit', 'delete', 'clone', 'view', 'dbl-click'),
+
+// base style edit
+// 'base_style_edit' => Array('select', 'cancel'),
+
+// list of block styles
+// 'block_styles' => Array ('select', 'cancel', 'prev', 'next', 'new_selector', 'edit', 'delete', 'clone', 'reset_to_base', 'view', 'dbl-click'),
+
+// block style edit
+// 'block_style_edit' => Array('select', 'cancel', 'reset_to_base'),
+
+// style editor
+// 'style_edit' => Array('select', 'cancel', 'reset_to_base'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /*'StylesheetId', 'Name', 'Description', 'AdvancedCSS', 'LastCompiled', 'Enabled' */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /*'StylesheetId',*/ 'Name',/* 'Description', 'AdvancedCSS', 'LastCompiled', 'Enabled' */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+// 'general', 'block_styles', 'base_styles',
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// 'Default' => Array ('Name', 'Description', 'Enabled', 'LastCompiled'),
+ );
Index: branches/RC/custom/units/site_configs/users_u.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/users_u.php (revision 0)
+++ branches/RC/custom/units/site_configs/users_u.php (revision 12743)
@@ -0,0 +1,119 @@
+ Users
+// 'users_list' => Array ('new_user', 'edit', 'delete', 'approve', 'decline', 'e-mail', 'export', 'view', 'dbl-click'),
+
+// "General" tab during user adding/editing
+// 'users_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+
+// "Images" tab during user adding/editing
+// 'user_edit_images' => Array ('select', 'cancel', 'prev', 'next', 'new_image', 'edit', 'delete', 'move_up', 'move_down', 'primary_image', 'view', 'dbl-click'),
+
+// "Groups" tab during user/admin adding/editing
+// 'user_edit_groups' => Array ('select', 'cancel', 'prev', 'next', 'usertogroup', 'edit', 'delete', 'primary_group', 'view', 'dbl-click'),
+
+// "Items" tab during user/admin adding/editing
+// 'user_edit_items' => Array ('select', 'cancel', 'prev', 'next', 'edit', 'delete', 'view', 'dbl-click'),
+
+// "Custom" tab during user/admin adding/editing
+// 'user_edit_custom' => Array ('select', 'cancel', 'prev', 'next'),
+
+// list of administrators; section: Users Managements -> Administrators
+// 'admins_list' => Array ('new_user', 'edit', 'delete', 'clone', 'refresh', 'view', 'dbl-click'),
+
+// "General" tab during admin adding/editing AND separate password change form for non-"root" users (in top frame)
+// 'admins_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+
+// 'regular_users_list' => Array (), // not used
+
+// separate password change form for "root" user (in top frame)
+// 'root_edit' => Array ('select', 'cancel'),
+
+// user/admin group membership editing (used on "Groups" tab during user/admin adding/editing)
+// 'user_edit_group' => Array ('select', 'cancel'),
+
+// user image adding/editing (used on "Images" tab during user adding/editing)
+// 'user_image_edit' => Array ('select', 'cancel'),
+
+// user selector
+// 'user_select' => Array ('select', 'cancel', 'view', 'dbl-click'),
+
+// user selector when adding/editing user group
+// 'group_user_select' => Array ('select', 'cancel', 'view', 'dbl-click'),
+
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /* 'PortalUserId', 'Login', 'Password', 'FirstName','LastName', 'Company', 'Email', 'CreatedOn',
+ 'Phone', 'Fax', 'Street', 'Street2', 'City', 'State' , 'Zip', 'Country', 'ResourceId', 'Status',
+ 'Modified', 'dob', 'tz', 'ip', 'IsBanned', 'PassResetTime', 'PwResetConfirm', 'PwRequestTime',
+ 'MinPwResetDelay', */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+ /*'ValidateLogin', 'SubscribeEmail', 'PrimaryGroup', 'RootPassword', 'FullName', 'UserGroup'*/
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /*'PortalUserId',*/ 'Login', /*'Password', 'FirstName', 'LastName', 'Company', 'Email', 'CreatedOn',
+ 'Phone', 'Fax', 'Street', 'Street2', 'City', 'State' , 'Zip', 'Country', 'ResourceId', 'Status',
+ 'Modified', 'dob', 'tz', 'ip', 'IsBanned', 'PassResetTime', 'PwResetConfirm', 'PwRequestTime',
+ 'MinPwResetDelay'*/
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+ /*'ValidateLogin', 'SubscribeEmail', 'PrimaryGroup', 'RootPassword', 'FullName', 'UserGroup'*/
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+// tabs during user editing, when In-Portal module is enabled
+// 'Default' => Array ('general', 'groups', 'images', 'items', 'custom'),
+
+// tabs during user editing, when In-Portal module isn't enabled
+// 'RegularUsers' => Array ('general', 'groups'),
+
+// tabs during admin editing
+// 'Admins' => Array ('general', 'groups'),
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// currently not in user
+// 'Default' => Array ('Login', 'LastName', 'FirstName', 'Email', 'PrimaryGroup', 'CreatedOn'),
+
+// user selector
+// 'UserSelector' => Array ('Login', 'LastName', 'FirstName', 'Email', 'PrimaryGroup', 'CreatedOn'),
+
+// admins list; section: Users Management -> Administrators
+// 'Admins' => Array ('PortalUserId', 'Login', 'FirstName', 'LastName', 'Email'),
+
+// users list; section: Users Management -> Users
+// 'RegularUsers' => Array ('PortalUserId', 'Login', 'FirstName', 'LastName', 'Email', 'Status'),
+ );
Index: branches/RC/custom/units/site_configs/images_u-img.php
===================================================================
diff -u
--- branches/RC/custom/units/site_configs/images_u-img.php (revision 0)
+++ branches/RC/custom/units/site_configs/images_u-img.php (revision 12743)
@@ -0,0 +1,7 @@
+UnitConfigReader->getPrefixFile('custom-sections') ) . '/../site_configs/';
+
+ // include site config settings from main "img" prefix
+ include('images_img.php');
Index: branches/1.0.x/custom/units/helpers/sample_helper.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/helpers/sample_helper.php (revision 0)
+++ branches/1.0.x/custom/units/helpers/sample_helper.php (revision 12743)
@@ -0,0 +1,14 @@
+ 'custom-helpers',
+
+ 'EventHandlerClass' => Array ('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+
+ 'RegisterClasses' => Array (
+ Array ('pseudo' => 'SampleHelper', 'class' => 'SampleHelper', 'file' => 'sample_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'),
+ ),
+ );
\ No newline at end of file
Index: branches/1.0.x/custom/units/widgets/widgets_config.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/widgets/widgets_config.php (revision 0)
+++ branches/1.0.x/custom/units/widgets/widgets_config.php (revision 12743)
@@ -0,0 +1,191 @@
+ 'widget',
+
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file'=> '', 'build_event' => 'OnListBuild'),
+
+ 'EventHandlerClass' => Array ('class' => 'WidgetEventHandler', 'file' => 'widget_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'WidgetTagProcessor', 'file' => 'widget_tp.php', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'RewriteListener' => 'WidgetRewriteListener',
+
+ 'IDField' => 'WidgetId',
+
+ 'StatusField' => Array ('Status'),
+
+ 'TableName' => TABLE_PREFIX.'Widgets',
+
+ /*
+ 'ForeignKey' => 'ParentId', // field title in TableName, linking record to a parent
+ 'ParentTableKey' => 'ParentId', // id (or other key) field title in parent's table
+ 'ParentPrefix' => 'parent',
+ 'AutoDelete' => true, // delete these items when parent is being deleted
+ 'AutoClone' => true, // clone these items when parent is being cloned
+ */
+
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array ('widget' => '!la_title_AddingWidget!'),
+ 'edit_status_labels' => Array ('widget' => '!la_title_EditingWidget!'),
+ 'new_titlefield' => Array ('widget' => '!la_title_NewWidget!'),
+ ),
+
+ 'widget_list' => Array (
+ 'prefixes' => Array ('widget_List'), 'format' => '#section_label#',
+ 'toolbar_buttons' => Array ('new_item', 'edit', 'delete', 'approve', 'decline', 'export', 'import', 'view', 'dbl-click',),
+ ),
+
+ 'widget_edit' => Array (
+ 'prefixes' => Array ('widget'), 'format' => '#widget_status# - #widget_titlefield#',
+ 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+ ),
+ ),
+
+ 'PermSection' => Array('main' => 'custom:widgets'),
+
+ 'Sections' => Array (
+ 'custom:widgets' => Array (
+ 'parent' => 'custom',
+ 'icon' => 'custom',
+ 'label' => 'la_tab_Widgets',
+ 'url' => Array ('t' => 'custom/widgets/widget_list', 'pass' => 'm'),
+ 'permissions' => Array ('view', 'add', 'edit', 'delete'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'TitleField' => 'Title', // field, used in bluebar when editing existing item
+
+ // Use %1$s for local table name with prefix, %2$s for calculated fields
+ 'ListSQLs' => Array ( // key - special, value - list select sql
+ '' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+ ),
+
+ 'ItemSQLs' => Array (
+ '' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ // 'ForcedSorting' => Array ('Priority' => 'desc'),
+ 'Sorting' => Array ('Title' => 'asc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'WidgetId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Title' => Array ('type' => 'string', 'not_null' => '1', 'default' => '', 'required' => true, 'max_len' => 255),
+ 'Description' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
+ 'Email' => Array(
+ 'type' => 'string', 'formatter' => 'kFormatter',
+ 'regexp'=> '/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i',
+ 'sample_value' => 'email@domain.com',
+ 'not_null' => 1, 'default' => '',
+ 'error_msgs' => Array ('invalid_format' => '!la_invalid_email!')
+ ),
+ 'Type' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1,
+ 'options' => Array (
+ 1 => 'la_opt_Default',
+ 2 => 'la_opt_Custom',
+ ),
+ 'not_null' => 1,
+ 'default' => 1,
+ 'required' => 1,
+ ),
+ 'Phone' => Array (
+ 'type' => 'string', 'formatter' => 'kFormatter',
+ 'default' => '', 'using_fck' => 1, 'not_null' => 1),
+ 'Qty' => Array ('type' => 'double', 'required' => 0, 'not_null' => 1, 'default' => 0),
+ 'Status' => Array (
+ 'type' => 'int', 'formatter' => 'kOptionsFormatter',
+ 'options' => array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'),
+ 'use_phrases' => 1, 'not_null' => 1, 'default' => 2,
+ ),
+ 'CreatedOn' => Array (
+ 'type' => 'int', 'formatter' => 'kDateFormatter',
+ 'time_format' => '', 'input_time_format' => '', 'default'=>'#NOW#', 'default' => NULL),
+
+ 'Good' => Array (
+ 'type' => 'int', 'formatter' => 'kOptionsFormatter',
+ 'options' => Array(1 => 'la_Yes', 0 => 'la_No'),
+ 'use_phrases' => 1, 'not_null' => 1, 'default' => 0
+ ),
+ 'BirthTime' => Array (
+ 'type' => 'int', 'formatter' => 'kDateFormatter',
+ 'date_format' => '', 'input_date_format' => '',
+ 'default' => null
+ ),
+ 'Image' => Array(
+ 'type' => 'string', 'formatter' => 'kUploadFormatter',
+ 'max_size' => MAX_UPLOAD_SIZE, // in Bytes !
+ 'file_types' => '*.jpg;*.gif;*.png', 'files_description'=>'!la_hint_ImageFiles!',
+ 'upload_dir' => '/system/user_files/', // relative to project's home
+ 'as_image' => true, 'thumb_width' => 100, 'thumb_height' => 100,
+ 'multiple' => false, // false or max number of files - will be stored as serialized array of paths
+ 'direct_links' => false, // use direct file urls or send files through wrapper (requires mod_mime_magic)
+ 'required' => 1, 'default' => null
+ ),
+ 'DataFile' => Array(
+ 'type' => 'string', 'formatter'=>'kUploadFormatter',
+ 'max_size' => MAX_UPLOAD_SIZE, // in Bytes !
+ 'file_types' => '*.*',
+ 'files_description' => '!la_hint_AllFiles!',
+ 'upload_dir' => '/system/user_files/', // relative to project's home
+ 'as_image' => false,
+ 'multiple' => 5, // false or max number of files - will be stored as serialized array of paths
+ 'direct_links' => true, // use direct file urls or send files through wrapper (requires mod_mime_magic)
+ 'default' => null
+ ),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ // 'Icons' => Array ('default' => 'icon16_custom.gif'),
+ 'Fields' => Array (
+ 'WidgetId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
+ 'Title' => Array ('title' => 'la_col_Name', 'data_block' => 'grid_delete_td'),
+ 'Image' => Array ('title' => 'la_col_Image', 'data_block' => 'grid_image_td'),
+ 'Type' => Array ('title' => 'la_col_Type', 'filter_block' => 'grid_options_filter'),
+ 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter'),
+ 'Good' => Array ('title' => 'la_col_Good'),
+ 'Qty' => Array ('title' => 'la_col_Qty', 'header_block' => 'grid_column_title_no_sorting', 'filter_block' => 'grid_float_range_filter'),
+ 'Email' => Array ('title' => 'la_col_Email'),
+ 'Phone' => Array ('title' => 'la_col_Phone'),
+ 'CreatedOn' => Array ('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter'),
+ 'Description' => Array ('title' => 'la_col_Description'),
+ // 'BirthTime' => Array ('title' => 'la_col_BirthTime', 'filter_block' => 'grid_date_range_filter'),
+ ),
+ ),
+ ),
+
+ 'ConfigMapping' => Array (
+ 'PerPage' => 'Comm_Perpage_Widgets',
+ 'ShortListPerPage' => 'Comm_Perpage_Widgets_Short',
+ ),
+ );
Index: branches/1.0.x/custom/units/widgets/widget_tp.php
===================================================================
diff -u
--- branches/1.0.x/custom/units/widgets/widget_tp.php (revision 0)
+++ branches/1.0.x/custom/units/widgets/widget_tp.php (revision 12743)
@@ -0,0 +1,22 @@
+ Array ('self' => true),
+ 'OnCustomEvent' => Array ('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Permission exceptions
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $skip_permissions_check_events = Array (
+ 'OnAnotherCustomEvent',
+ );
+
+ if (in_array($event->Name, $skip_permissions_check_events)) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Set custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function OnCustomEvent(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ }
+
+ /**
+ * Set custom query for the list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ # identifying event based on special and setting filter
+ if ($event->Special == 'custom-special') {
+// $object->addFilter('primary_filter', '%1$s.Status = '.STATUS_DISABLED);
+ }
+ }
+
+ /**
+ * Before new item created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+ }
+
+ /**
+ * Before existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+ }
+
+ /**
+ * Before item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ parent::OnBeforeItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemLoad(&$event)
+ {
+ parent::OnBeforeItemLoad($event);
+
+
+ }
+
+
+ /**
+ * After new item created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+
+ }
+
+ /**
+ * After existing item updated
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+
+ }
+
+ /**
+ * After item deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+
+ }
+
+ /**
+ * After item loaded
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+
+ }
+
+ /**
+ * Builds/parses widget part of url
+ *
+ * @param int $rewrite_mode Mode in what rewrite listener was called. Possbile two modes: REWRITE_MODE_BUILD, REWRITE_MODE_PARSE.
+ * @param string $prefix Prefix, that listener uses for system integration
+ * @param Array $params Params, that are used for url building or created during url parsing.
+ * @param Array $url_parts Url parts to parse (only for parsing).
+ * @param bool $keep_events Keep event names in resulting url (only for building).
+ * @return bool Return true to continue to next listener; return false (when building) not to rewrite given prefix; return false (when parsing) to stop processing at this listener.
+ */
+ function WidgetRewriteListener($rewrite_mode = REWRITE_MODE_BUILD, $prefix, &$params, &$url_parts, $keep_events = false)
+ {
+ if ($rewrite_mode == REWRITE_MODE_BUILD) {
+ if ($params['t'] == 'widgets/widget_detail') {
+ // this is default template for this prefix, so don't add it to resulting url
+ $params['pass_template'] = false;
+ }
+
+ $mod_rewrite_helper =& $this->Application->recallObject('ModRewriteHelper');
+ /* @var $mod_rewrite_helper kModRewriteHelper */
+
+ $processed_params = $mod_rewrite_helper->getProcessedParams($prefix, $params, $keep_events);
+
+ if ($processed_params === false) {
+ return '';
+ }
+
+ $ret = Array ('', '');
+
+ if ($processed_params[$prefix . '_id'] > 0) {
+ // add id
+ $sql = 'SELECT Title
+ FROM ' . TABLE_PREFIX . 'Widgets
+ WHERE WidgetId = ' . $processed_params[$prefix . '_id'];
+ $ret[0] .= 'widgets/' . $this->Conn->GetOne($sql) . '/';
+ } elseif ($processed_params[$prefix . '_Page'] > 1) {
+ // add page, only when ID is missing
+ $ret[1] .= $processed_params[$prefix . '_Page'] . '/';
+ }
+
+ $ret[0] = rtrim($ret[0], '/');
+ $ret[1] = rtrim($ret[1], '/');
+
+ return array_map('mb_strtolower', $ret);
+ }
+
+ if ($rewrite_mode == REWRITE_MODE_PARSE) {
+ if ($url_parts[0] == 'widgets') {
+ $sql = 'SELECT WidgetId
+ FROM ' . TABLE_PREFIX . 'Widgets
+ WHERE Title = ' . $this->Conn->qstr($url_parts[1]);
+ $id = $this->Conn->GetOne($sql);
+ $to_parse = $url_parts;
+
+ if ($id > 0) {
+ // id found
+ $params[$prefix . '_id'] = $id;
+ $to_parse = array_slice($to_parse, 2); // cut off first two parts - "widgets/"
+ $params['pass'][] = $prefix; // otherwise this prefix won't passed when pass="all" parameter used
+ }
+
+ $template = implode('/', $to_parse);
+
+ if ($template) {
+ // let others guess what template is
+ return true;
+ }
+
+ // template missing -> set default
+ $params['t'] = 'widgets/widget_detail';
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
\ No newline at end of file
Index: branches/RC/themes/test_theme/index.tpl
===================================================================
diff -u
--- branches/RC/themes/test_theme/index.tpl (revision 0)
+++ branches/RC/themes/test_theme/index.tpl (revision 12743)
@@ -0,0 +1 @@
+
Index: branches/RC/sample.htaccess
===================================================================
diff -u
--- branches/RC/sample.htaccess (revision 0)
+++ branches/RC/sample.htaccess (revision 12743)
@@ -0,0 +1,9 @@
+#Options +FollowSymLinks
+RewriteEngine On
+
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME}/ !-f
+RewriteCond %{REQUEST_FILENAME}/index.php !-f
+RewriteCond %{REQUEST_FILENAME}/index.html !-f
+RewriteCond %{REQUEST_URI} !\.(gif|jpg|png|js|css|ico|swf)$ [NC]
+RewriteRule ^(.*) index.php?rewrite=on&_mod_rw_url_=$1 [QSA]
Index: branches/RC/admin/index.php
===================================================================
diff -u
--- branches/RC/admin/index.php (revision 0)
+++ branches/RC/admin/index.php (revision 12743)
@@ -0,0 +1,21 @@
+Init();
+$application->Run();
+$application->Done();
+
+$end = getmicrotime();
+
+function getmicrotime()
+{
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+}
+
+?>
\ No newline at end of file
Index: branches/RC/index.php
===================================================================
diff -u
--- branches/RC/index.php (revision 0)
+++ branches/RC/index.php (revision 12743)
@@ -0,0 +1,19 @@
+Init();
+$application->Run();
+$application->Done();
+
+$end = getmicrotime();
+
+function getmicrotime()
+{
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+}
+?>
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.1.1.2/custom/install/install_data.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.1.1.2/custom/install/install_data.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.1.1.1.2/custom/install/install_data.sql (revision 12743)
@@ -0,0 +1 @@
+INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('Custom', 'custom/', 'custom', '0.0.0', 1, 2, '', 0, '0');
Index: branches/unlabeled/unlabeled-1.1.1.1.2/custom/install/install_schema.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.1.1.2/custom/install/install_schema.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.1.1.1.2/custom/install/install_schema.sql (revision 12743)
@@ -0,0 +1,13 @@
+CREATE TABLE Tests (
+ `TestId` int(11) NOT NULL auto_increment,
+ `Title` varchar(255) NOT NULL default '',
+ `Description` text,
+ `Email` varchar(255) NOT NULL default '',
+ `Type` tinyint(4) NOT NULL default '1',
+ `Phone` varchar(50) NOT NULL default '',
+ `Qty` double NOT NULL default '0',
+ `Status` tinyint(4) NOT NULL default '2',
+ `CreatedOn` int(11) NOT NULL default '0',
+ `Good` tinyint(4) NOT NULL default '0',
+ PRIMARY KEY (`TestId`)
+)
Index: branches/unlabeled/unlabeled-1.1.1.1.2/custom/admin_templates/tests/test_edit.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.1.1.2/custom/admin_templates/tests/test_edit.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.1.1.2/custom/admin_templates/tests/test_edit.tpl (revision 12743)
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/unlabeled/unlabeled-1.1.1.1.2/custom/admin_templates/tests/test_list.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.1.1.2/custom/admin_templates/tests/test_list.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.1.1.2/custom/admin_templates/tests/test_list.tpl (revision 12743)
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.1.1.2/custom/units/test/test_config.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.1.1.2/custom/units/test/test_config.php (revision 0)
+++ branches/unlabeled/unlabeled-1.1.1.1.2/custom/units/test/test_config.php (revision 12743)
@@ -0,0 +1,175 @@
+ 'test',
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'TestEventHandler','file'=>'test_eh.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
+
+ 'AutoLoad' => true,
+ 'Hooks' => Array(
+ ),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+ 'IDField' => 'TestId',
+ 'StatusField' => Array('Status'),
+ 'TableName' => TABLE_PREFIX.'Tests',
+
+/*
+ 'ForeignKey' => 'ParentId', // field title in TableName, linking record to a parent
+ 'ParentTableKey' => 'ParentId', // id (or other key) field title in parent's table
+ 'ParentPrefix' => 'parent',
+ 'AutoDelete' => true, // delete these items when parent is being deleted
+ 'AutoClone' => true, // clone these items when parent is being cloned
+*/
+
+ 'TitlePresets' => Array(
+ 'default' => Array(
+ 'new_status_labels' => Array('test'=>'!la_title_AddingTest!'),
+ 'edit_status_labels' => Array('test'=>'!la_title_EditingTest!'),
+ 'new_titlefield' => Array('test'=>''),
+ ),
+
+ 'test_list'=>Array(
+ 'prefixes' => Array('test_List'),
+ 'format' => '!la_title_Tests! (#test_recordcount#)',
+ ),
+
+ 'test_edit'=>Array(
+ 'prefixes' => Array('test'),
+ 'format' => '#test_status# #test_titlefield#',
+ ),
+ ),
+
+ 'PermSection' => Array('main' => 'custom:tests'),
+
+ // don't forget to add corresponding permissions to install script
+ // INSERT INTO Permissions VALUES (0, 'custom:custom.view', 11, 1, 1, 0);
+ // INSERT INTO Permissions VALUES (0, 'custom:tests.view', 11, 1, 1, 0), (0, 'custom:tests.add', 11, 1, 1, 0), (0, 'custom:tests.edit', 11, 1, 1, 0), (0, 'custom:tests.delete', 11, 1, 1, 0);
+ 'Sections' => Array(
+
+ 'custom' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'custom:custom',
+ 'label' => 'la_title_Custom',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 1.95,
+ 'type' => stTREE,
+ ),
+
+ 'custom:tests' => Array(
+ 'parent' => 'custom',
+ 'icon' => 'custom:tests',
+ 'label' => 'la_tab_Tests',
+ 'url' => Array('t' => 'custom/tests/test_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'TitleField' => 'Title', // field, used in bluebar when editing existing item
+
+ // Use %1$s for local table name with prefix, %2$s for calculated fields
+ 'ListSQLs' => Array( // key - special, value - list select sql
+ '' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+ ),
+ 'ItemSQLs' => Array(
+ '' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+ ),
+ 'ListSortings' => Array(
+ '' => Array(
+// 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('Title' => 'asc'),
+ )
+ ),
+ 'Fields' => Array(
+ 'TestId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Title' => Array('type' => 'string','not_null' => '1','default' => '', 'required'=>true,'max_len'=>255),
+ 'Description' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Email' => Array(
+ 'type' => 'string', 'formatter'=>'kFormatter',
+ 'regexp'=>'/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/',
+ 'sample_value' => 'email@domain.com',
+ 'not_null' => 1, 'default' => '',
+ 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!')
+ ),
+ 'Type' => array('type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1,
+ 'options'=> array(
+ 1=>'la_default_type',
+ 2=>'la_some_type',
+ 3=>'la_another_type',
+ ),
+ 'not_null' => 1,
+ 'default' => 1,
+ 'required' => 1,
+ ),
+ 'Phone' => Array('type' => 'string','default' => '','not_null' => 1),
+ 'Qty' => array('type'=>'double','required'=>0,'not_null' => 1, 'default' => 0),
+ 'Status' => Array(
+ 'type' => 'int', 'formatter' => 'kOptionsFormatter',
+ 'options' => array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'),
+ 'use_phrases' => 1, 'not_null' => 1, 'default' => 2
+ ),
+ 'CreatedOn' => Array('formatter' => 'kDateFormatter', 'default'=>'#NOW#', 'not_null' => true),
+ 'Good' => Array(
+ 'type' => 'int', 'formatter' => 'kOptionsFormatter',
+ 'options' => Array(1 => 'la_Yes', 0 => 'la_No'),
+ 'use_phrases' => 1, 'not_null' => 1, 'default' => 0
+ ),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_test.gif'),
+ 'Fields' => Array(
+ 'TestId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td' ),
+ 'Title' => Array( 'title'=>'la_col_TestName'),
+ 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter'),
+ 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
+ 'Good' => Array( 'title'=>'la_col_Good'),
+ 'Qty' => Array( 'title'=>'la_col_Qty', 'filter_block' => 'grid_float_range_filter'),
+ 'Email' => Array( 'title'=>'la_col_Email'),
+ 'Phone' => Array( 'title'=>'la_col_Phone'),
+ 'CreatedOn' => Array( 'title'=>'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter'),
+ ),
+ ),
+ ),
+
+ 'ConfigMapping' => Array(
+ 'PerPage' => 'Comm_Perpage_Tests',
+ 'ShortListPerPage' => 'Comm_Perpage_Tests_Short',
+ ),
+);
+
+/*
+
+Don't forget to:
+
+- Add table create statement to install_schema.sql
+ CREATE TABLE Tests (
+ `TestId` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+ `Title` VARCHAR( 255 ) NOT NULL ,
+ `Description` TEXT NULL ,
+ `Email` VARCHAR( 255 ) NOT NULL ,
+ `Type` TINYINT NOT NULL ,
+ `Phone` VARCHAR( 50 ) NOT NULL ,
+ `Qty` DOUBLE NOT NULL ,
+ `Status` TINYINT NOT NULL ,
+ `CreatedOn` INT NOT NULL ,
+ `Good` TINYINT NOT NULL
+ )
+
+- Add permissions for admin gorup to install script (see 'Sections' key above)
+
+
+*/
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.1.1.2/themes/test_theme/index.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.1.1.2/themes/test_theme/index.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.1.1.2/themes/test_theme/index.tpl (revision 12743)
@@ -0,0 +1 @@
+
Index: branches/unlabeled/unlabeled-1.6.2/custom/units/test/test_config.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.6.2/custom/units/test/test_config.php (revision 0)
+++ branches/unlabeled/unlabeled-1.6.2/custom/units/test/test_config.php (revision 12743)
@@ -0,0 +1,203 @@
+ 'test',
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'TestEventHandler','file'=>'test_eh.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
+
+ 'AutoLoad' => true,
+ 'Hooks' => Array(
+ ),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+ 'IDField' => 'TestId',
+ 'StatusField' => Array('Status'),
+ 'TableName' => TABLE_PREFIX.'Tests',
+
+/*
+ 'ForeignKey' => 'ParentId', // field title in TableName, linking record to a parent
+ 'ParentTableKey' => 'ParentId', // id (or other key) field title in parent's table
+ 'ParentPrefix' => 'parent',
+ 'AutoDelete' => true, // delete these items when parent is being deleted
+ 'AutoClone' => true, // clone these items when parent is being cloned
+*/
+
+ 'TitlePresets' => Array(
+ 'default' => Array(
+ 'new_status_labels' => Array('test'=>'!la_title_AddingTest!'),
+ 'edit_status_labels' => Array('test'=>'!la_title_EditingTest!'),
+ 'new_titlefield' => Array('test'=>''),
+ ),
+
+ 'test_list'=>Array(
+ 'prefixes' => Array('test_List'),
+ 'format' => '!la_title_Tests! (#test_recordcount#)',
+ ),
+
+ 'test_edit'=>Array(
+ 'prefixes' => Array('test'),
+ 'format' => '#test_status# #test_titlefield#',
+ ),
+ ),
+
+ 'PermSection' => Array('main' => 'custom:tests'),
+
+ // don't forget to add corresponding permissions to install script
+ // INSERT INTO Permissions VALUES (0, 'custom:custom.view', 11, 1, 1, 0);
+ // INSERT INTO Permissions VALUES (0, 'custom:tests.view', 11, 1, 1, 0), (0, 'custom:tests.add', 11, 1, 1, 0), (0, 'custom:tests.edit', 11, 1, 1, 0), (0, 'custom:tests.delete', 11, 1, 1, 0);
+ 'Sections' => Array(
+
+ 'custom' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'custom:custom',
+ 'label' => 'la_title_Custom',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 1.95,
+ 'type' => stTREE,
+ ),
+
+ 'custom:tests' => Array(
+ 'parent' => 'custom',
+ 'icon' => 'custom:tests',
+ 'label' => 'la_tab_Tests',
+ 'url' => Array('t' => 'custom/tests/test_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'TitleField' => 'LastName', // field, used in bluebar when editing existing item
+
+ // Use %1$s for local table name with prefix, %2$s for calculated fields
+ 'ListSQLs' => Array( // key - special, value - list select sql
+ '' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+ ),
+ 'ItemSQLs' => Array(
+ '' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+ ),
+ 'ListSortings' => Array(
+ '' => Array(
+// 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('Title' => 'asc'),
+ )
+ ),
+ 'Fields' => Array(
+ 'TestId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Title' => Array('type' => 'string','not_null' => '1','default' => '', 'required'=>true,'max_len'=>255),
+ 'Description' => Array('type' => 'string', 'default' => null),
+ 'Email' => Array(
+ 'type' => 'string', 'formatter'=>'kFormatter',
+ 'regexp'=>'/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/',
+ 'sample_value' => 'email@domain.com',
+ 'not_null' => 1, 'default' => '',
+ 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!')
+ ),
+ 'Type' => array('type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1,
+ 'options'=> array(
+ 1=>'la_default_type',
+ 2=>'la_some_type',
+ 3=>'la_another_type',
+ ),
+ 'not_null' => 1,
+ 'default' => 1,
+ 'required' => 1,
+ ),
+ 'Phone' => Array('type' => 'string','default' => '','not_null' => 1),
+ 'Qty' => array('type'=>'double','required'=>0,'not_null' => 1, 'default' => 0),
+ 'Status' => Array(
+ 'type' => 'int', 'formatter' => 'kOptionsFormatter',
+ 'options' => array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'),
+ 'use_phrases' => 1, 'not_null' => 1, 'default' => 2
+ ),
+ 'CreatedOn' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'time_format' => '', 'input_time_format' => '', 'default'=>'#NOW#', 'not_null' => true),
+ 'Good' => Array(
+ 'type' => 'int', 'formatter' => 'kOptionsFormatter',
+ 'options' => Array(1 => 'la_Yes', 0 => 'la_No'),
+ 'use_phrases' => 1, 'not_null' => 1, 'default' => 0
+ ),
+ 'BirthTime' => Array(
+ 'type' => 'int', 'formatter' => 'kDateFormatter',
+ 'date_format' => '', 'input_date_format' => '',
+ 'default' => null
+ ),
+ 'Image' => Array(
+ 'type'=>'string', 'formatter'=>'kUploadFormatter',
+ 'max_size'=>MAX_UPLOAD_SIZE, // in Bytes !
+ 'file_types'=>'*.jpg;*.gif;*.png', 'files_description'=>'!la_ImageFiles!',
+ 'upload_dir'=>'/system/user_files/', // relative to project's home
+ 'as_image'=>true, 'thumb_width'=>100, 'thumb_height'=>100,
+ 'multiple'=>false, // false or max number of files - will be stored as serialized array of paths
+ 'direct_links'=>false, // use direct file urls or send files through wrapper (requires mod_mime_magic)
+ ),
+ 'DataFile' => Array(
+ 'type'=>'string', 'formatter'=>'kUploadFormatter',
+ 'max_size'=>MAX_UPLOAD_SIZE, // in Bytes !
+ 'file_types'=>'*.*',
+ 'files_description'=>'!la_AllFiles!',
+ 'upload_dir'=>'/system/user_files/', // relative to project's home
+ 'as_image'=>false,
+ 'multiple'=>2, // false or max number of files - will be stored as serialized array of paths
+ 'direct_links'=>true, // use direct file urls or send files through wrapper (requires mod_mime_magic)
+ ),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_test.gif'),
+ 'Fields' => Array(
+ 'TestId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'width'=>50 ),
+ 'Title' => Array( 'title'=>'la_col_TestName', 'width'=>100),
+ 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter'),
+ 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
+ 'Good' => Array( 'title'=>'la_col_Good'),
+ 'Qty' => Array( 'title'=>'la_col_Qty', 'filter_block' => 'grid_float_range_filter'),
+ 'Email' => Array( 'title'=>'la_col_Email', 'width'=>70),
+ 'Phone' => Array( 'title'=>'la_col_Phone', 'width'=>80),
+ 'CreatedOn' => Array( 'title'=>'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'filter_width'=>60, 'width'=>110),
+ 'FirstName' => Array('title' => 'la_col_FirstName', 'width'=>100),
+ 'LastName' => Array('title' => 'la_col_LastName', 'width'=>100),
+ 'IdentityNr' => Array('title' => 'la_col_IdentityNr', 'width'=>80),
+ //'BirthTime' => Array ('title' => 'la_col_BirthTime', 'filter_block' => 'grid_date_range_filter'),
+ ),
+ ),
+ ),
+
+ 'ConfigMapping' => Array(
+ 'PerPage' => 'Comm_Perpage_Tests',
+ 'ShortListPerPage' => 'Comm_Perpage_Tests_Short',
+ ),
+);
+
+/*
+
+Don't forget to:
+
+- Add table create statement to install_schema.sql
+ CREATE TABLE Tests (
+ `TestId` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+ `Title` VARCHAR( 255 ) NOT NULL ,
+ `Description` TEXT NULL ,
+ `Email` VARCHAR( 255 ) NOT NULL ,
+ `Type` TINYINT NOT NULL ,
+ `Phone` VARCHAR( 50 ) NOT NULL ,
+ `Qty` DOUBLE NOT NULL ,
+ `Status` TINYINT NOT NULL ,
+ `CreatedOn` INT NOT NULL ,
+ `Good` TINYINT NOT NULL
+)
+
+- Add permissions for admin gorup to install script (see 'Sections' key above)
+
+
+*/
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/custom/install/upgrades.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/custom/install/upgrades.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/custom/install/upgrades.sql (revision 12743)
@@ -0,0 +1,3 @@
+# ===== v 4.1.0 =====
+ALTER TABLE Tests ADD `Image` text;
+ALTER TABLE Tests ADD `DataFile` text;
Index: branches/unlabeled/unlabeled-1.1.2/custom/admin_templates/img/icons/icon46_help.gif
===================================================================
diff -u
Binary files differ
Index: branches/unlabeled/unlabeled-1.3.2/custom/install/install_schema.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.3.2/custom/install/install_schema.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.3.2/custom/install/install_schema.sql (revision 12743)
@@ -0,0 +1,16 @@
+CREATE TABLE Tests (
+ TestId int(11) NOT NULL auto_increment,
+ Title varchar(255) NOT NULL default '',
+ Description text,
+ Email varchar(255) NOT NULL default '',
+ `Type` tinyint(4) NOT NULL default '1',
+ Phone varchar(50) NOT NULL default '',
+ Qty double NOT NULL default '0',
+ `Status` tinyint(4) NOT NULL default '2',
+ CreatedOn int(11) NOT NULL default '0',
+ Good tinyint(4) NOT NULL default '0',
+ BirthTime int(10) unsigned default NULL,
+ `Image` text,
+ `DataFile` text,
+ PRIMARY KEY (TestId)
+);
Index: branches/unlabeled/unlabeled-1.3.2/custom/admin_templates/tests/test_edit.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.3.2/custom/admin_templates/tests/test_edit.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.3.2/custom/admin_templates/tests/test_edit.tpl (revision 12743)
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/1.0.x/custom/install/install_data.sql
===================================================================
diff -u
--- branches/1.0.x/custom/install/install_data.sql (revision 0)
+++ branches/1.0.x/custom/install/install_data.sql (revision 12743)
@@ -0,0 +1,19 @@
+# place here only sql queries, that were executed on live AND dev sites !!!
+
+INSERT INTO Permissions VALUES(DEFAULT, 'custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.view', 11, 1, 1, 0);
+
+INSERT INTO Modules VALUES ('Custom', 'custom/', 'custom-sections', DEFAULT, 1, 10, 'custom/', 0, NULL);
+
+
+# ===== SQLs above this line already on LIVE ================================================================================================
+
+# place here only sql queries, that were executed on dev site !!!
+
+
+# ===== SQLs above this line already on DEV ========================================================================================================
+
+# place here only sql queries, that were executed on prod server !!!
Index: branches/1.0.x/custom/install/english.lang
===================================================================
diff -u
--- branches/1.0.x/custom/install/english.lang (revision 0)
+++ branches/1.0.x/custom/install/english.lang (revision 12743)
@@ -0,0 +1,19 @@
+
+ m/d/Yg:i Am/d/Yg:i:s A.,utf-82
+
+ R29vZA==
+ UGhvbmU=
+ RGF0YSBmaWxl
+ R29vZA==
+ Q3VzdG9t
+ RGVmYXVsdA==
+ V2lkZ2V0cw==
+ QWRkaW5nIFdpZGdldA==
+ RWRpdGluZyBXaWRnZXQ=
+ Q3VzdG9t
+ TmV3IFdpZGdldA==
+ V2lkZ2V0cw==
+ TmV3IFdpZGdldA==
+
+
+
\ No newline at end of file
Index: branches/1.0.x/custom/install/install_schema.sql
===================================================================
diff -u
--- branches/1.0.x/custom/install/install_schema.sql (revision 0)
+++ branches/1.0.x/custom/install/install_schema.sql (revision 12743)
@@ -0,0 +1,27 @@
+# place here only sql queries, that were executed on live AND dev sites !!!
+
+CREATE TABLE Widgets (
+ WidgetId int(11) NOT NULL AUTO_INCREMENT,
+ Title varchar(255) NOT NULL DEFAULT '',
+ Description text,
+ Email varchar(255) NOT NULL DEFAULT '',
+ `Type` tinyint(4) NOT NULL DEFAULT '1',
+ Phone varchar(50) NOT NULL DEFAULT '',
+ Qty double NOT NULL DEFAULT '0',
+ `Status` tinyint(4) NOT NULL DEFAULT '2',
+ CreatedOn int(11) DEFAULT NULL,
+ Good tinyint(4) NOT NULL DEFAULT '0',
+ BirthTime int(10) unsigned DEFAULT NULL,
+ Image text,
+ `DataFile` text,
+ PRIMARY KEY (WidgetId)
+);
+
+# ===== SQLs above this line already on LIVE ================================================================================================
+
+# place here only sql queries, that were executed on dev site !!!
+
+
+# ===== SQLs above this line already on DEV ========================================================================================================
+
+# place here only sql queries, that were executed on prod server !!!
Index: branches/1.0.x/custom/install/upgrades.sql
===================================================================
diff -u
--- branches/1.0.x/custom/install/upgrades.sql (revision 0)
+++ branches/1.0.x/custom/install/upgrades.sql (revision 12743)
@@ -0,0 +1,8 @@
+# ===== v 1.0.0 =====
+
+# ===== v 1.0.1 =====
+UPDATE Modules SET LoadOrder = 10 WHERE `Name` = 'Custom';
+
+# ===== v 1.0.2-B1 =====
+ALTER TABLE Widgets CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL;
+UPDATE Modules SET TemplatePath = 'custom/' WHERE Name = 'Custom';
Index: branches/1.0.x/custom/install.php
===================================================================
diff -u
--- branches/1.0.x/custom/install.php (revision 0)
+++ branches/1.0.x/custom/install.php (revision 12743)
@@ -0,0 +1,33 @@
+toolkit;
+ /* @var $toolkit kInstallToolkit */
+ }
+
+ $application =& kApplication::Instance();
+ $application->Init();
+
+ if ($application->RecallVar('user_id') != -1) {
+ die('restricted access!');
+ }
+
+ $toolkit->RunSQL('/' . $module_folder .'/install/install_schema.sql');
+ $toolkit->RunSQL('/' . $module_folder .'/install/install_data.sql');
+ $toolkit->ImportLanguage('/' . $module_folder .'/install/english');
+
+ $toolkit->finalizeModuleInstall($module_folder, false);
\ No newline at end of file
Index: trunk/custom/admin_templates/tests/test_edit.tpl
===================================================================
diff -u
--- trunk/custom/admin_templates/tests/test_edit.tpl (revision 0)
+++ trunk/custom/admin_templates/tests/test_edit.tpl (revision 12743)
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/custom/admin_templates/tests/test_list.tpl
===================================================================
diff -u
--- trunk/custom/admin_templates/tests/test_list.tpl (revision 0)
+++ trunk/custom/admin_templates/tests/test_list.tpl (revision 12743)
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/custom/units/test/test_eh.php
===================================================================
diff -u
--- trunk/custom/units/test/test_eh.php (revision 0)
+++ trunk/custom/units/test/test_eh.php (revision 12743)
@@ -0,0 +1,5 @@
+ 'test',
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'TestEventHandler','file'=>'test_eh.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
+
+ 'AutoLoad' => true,
+ 'Hooks' => Array(
+ ),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+ 'IDField' => 'TestId',
+ 'StatusField' => Array('Status'),
+ 'TableName' => TABLE_PREFIX.'Tests',
+
+/*
+ 'ForeignKey' => 'ParentId', // field title in TableName, linking record to a parent
+ 'ParentTableKey' => 'ParentId', // id (or other key) field title in parent's table
+ 'ParentPrefix' => 'parent',
+ 'AutoDelete' => true, // delete these items when parent is being deleted
+ 'AutoClone' => true, // clone these items when parent is being cloned
+*/
+
+ 'TitlePresets' => Array(
+ 'default' => Array(
+ 'new_status_labels' => Array('test'=>'!la_title_AddingTest!'),
+ 'edit_status_labels' => Array('test'=>'!la_title_EditingTest!'),
+ 'new_titlefield' => Array('test'=>''),
+ ),
+
+ 'test_list'=>Array(
+ 'prefixes' => Array('test_List'),
+ 'format' => '!la_title_Tests! (#test_recordcount#)',
+ ),
+
+ 'test_edit'=>Array(
+ 'prefixes' => Array('test'),
+ 'format' => '#test_status# #test_titlefield#',
+ ),
+ ),
+
+ 'PermSection' => Array('main' => 'custom:tests'),
+
+ // don't forget to add corresponding permissions to install script
+ // INSERT INTO Permissions VALUES (0, 'custom:custom.view', 11, 1, 1, 0);
+ // INSERT INTO Permissions VALUES (0, 'custom:tests.view', 11, 1, 1, 0), (0, 'custom:tests.add', 11, 1, 1, 0), (0, 'custom:tests.edit', 11, 1, 1, 0), (0, 'custom:tests.delete', 11, 1, 1, 0);
+ 'Sections' => Array(
+
+ 'custom' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'custom:custom',
+ 'label' => 'la_title_Custom',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 1.95,
+ 'type' => stTREE,
+ ),
+
+ 'custom:tests' => Array(
+ 'parent' => 'custom',
+ 'icon' => 'custom:tests',
+ 'label' => 'la_tab_Tests',
+ 'url' => Array('t' => 'custom/tests/test_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'TitleField' => 'LastName', // field, used in bluebar when editing existing item
+
+ // Use %1$s for local table name with prefix, %2$s for calculated fields
+ 'ListSQLs' => Array( // key - special, value - list select sql
+ '' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+ ),
+ 'ItemSQLs' => Array(
+ '' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+ ),
+ 'ListSortings' => Array(
+ '' => Array(
+// 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('Title' => 'asc'),
+ )
+ ),
+ 'Fields' => Array(
+ 'TestId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Title' => Array('type' => 'string','not_null' => '1','default' => '', 'required'=>true,'max_len'=>255),
+ 'Description' => Array('type' => 'string', 'default' => null),
+ 'Email' => Array(
+ 'type' => 'string', 'formatter'=>'kFormatter',
+ 'regexp'=>'/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/',
+ 'sample_value' => 'email@domain.com',
+ 'not_null' => 1, 'default' => '',
+ 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!')
+ ),
+ 'Type' => array('type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1,
+ 'options'=> array(
+ 1=>'la_default_type',
+ 2=>'la_some_type',
+ 3=>'la_another_type',
+ ),
+ 'not_null' => 1,
+ 'default' => 1,
+ 'required' => 1,
+ ),
+ 'Phone' => Array('type' => 'string','default' => '','not_null' => 1),
+ 'Qty' => array('type'=>'double','required'=>0,'not_null' => 1, 'default' => 0),
+ 'Status' => Array(
+ 'type' => 'int', 'formatter' => 'kOptionsFormatter',
+ 'options' => array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'),
+ 'use_phrases' => 1, 'not_null' => 1, 'default' => 2
+ ),
+ 'CreatedOn' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'time_format' => '', 'input_time_format' => '', 'default'=>'#NOW#', 'not_null' => true),
+ 'Good' => Array(
+ 'type' => 'int', 'formatter' => 'kOptionsFormatter',
+ 'options' => Array(1 => 'la_Yes', 0 => 'la_No'),
+ 'use_phrases' => 1, 'not_null' => 1, 'default' => 0
+ ),
+ 'BirthTime' => Array(
+ 'type' => 'int', 'formatter' => 'kDateFormatter',
+ 'date_format' => '', 'input_date_format' => '',
+ 'default' => null
+ ),
+ 'Image' => Array(
+ 'type'=>'string', 'formatter'=>'kUploadFormatter',
+ 'max_size'=>MAX_UPLOAD_SIZE, // in Bytes !
+ 'file_types'=>'*.jpg;*.gif;*.png', 'files_description'=>'!la_ImageFiles!',
+ 'upload_dir'=>'/system/user_files/', // relative to project's home
+ 'as_image'=>true, 'thumb_width'=>100, 'thumb_height'=>100,
+ 'multiple'=>false, // false or max number of files - will be stored as serialized array of paths
+ 'direct_links'=>false, // use direct file urls or send files through wrapper (requires mod_mime_magic)
+ ),
+ 'DataFile' => Array(
+ 'type'=>'string', 'formatter'=>'kUploadFormatter',
+ 'max_size'=>MAX_UPLOAD_SIZE, // in Bytes !
+ 'file_types'=>'*.*',
+ 'files_description'=>'!la_AllFiles!',
+ 'upload_dir'=>'/system/user_files/', // relative to project's home
+ 'as_image'=>false,
+ 'multiple'=>2, // false or max number of files - will be stored as serialized array of paths
+ 'direct_links'=>true, // use direct file urls or send files through wrapper (requires mod_mime_magic)
+ ),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_test.gif'),
+ 'Fields' => Array(
+ 'TestId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'width'=>50 ),
+ 'Title' => Array( 'title'=>'la_col_TestName', 'width'=>100),
+ 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter'),
+ 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
+ 'Good' => Array( 'title'=>'la_col_Good'),
+ 'Qty' => Array( 'title'=>'la_col_Qty', 'filter_block' => 'grid_float_range_filter'),
+ 'Email' => Array( 'title'=>'la_col_Email', 'width'=>70),
+ 'Phone' => Array( 'title'=>'la_col_Phone', 'width'=>80),
+ 'CreatedOn' => Array( 'title'=>'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'filter_width'=>60, 'width'=>110),
+ 'FirstName' => Array('title' => 'la_col_FirstName', 'width'=>100),
+ 'LastName' => Array('title' => 'la_col_LastName', 'width'=>100),
+ 'IdentityNr' => Array('title' => 'la_col_IdentityNr', 'width'=>80),
+ //'BirthTime' => Array ('title' => 'la_col_BirthTime', 'filter_block' => 'grid_date_range_filter'),
+ ),
+ ),
+ ),
+
+ 'ConfigMapping' => Array(
+ 'PerPage' => 'Comm_Perpage_Tests',
+ 'ShortListPerPage' => 'Comm_Perpage_Tests_Short',
+ ),
+);
+
+/*
+
+Don't forget to:
+
+- Add table create statement to install_schema.sql
+ CREATE TABLE Tests (
+ `TestId` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+ `Title` VARCHAR( 255 ) NOT NULL ,
+ `Description` TEXT NULL ,
+ `Email` VARCHAR( 255 ) NOT NULL ,
+ `Type` TINYINT NOT NULL ,
+ `Phone` VARCHAR( 50 ) NOT NULL ,
+ `Qty` DOUBLE NOT NULL ,
+ `Status` TINYINT NOT NULL ,
+ `CreatedOn` INT NOT NULL ,
+ `Good` TINYINT NOT NULL
+)
+
+- Add permissions for admin gorup to install script (see 'Sections' key above)
+
+
+*/
\ No newline at end of file
Index: branches/RC/themes/test_theme/index.tpl
===================================================================
diff -u
--- branches/RC/themes/test_theme/index.tpl (revision 0)
+++ branches/RC/themes/test_theme/index.tpl (revision 12743)
@@ -0,0 +1 @@
+
Index: branches/RC/sample.htaccess
===================================================================
diff -u
--- branches/RC/sample.htaccess (revision 0)
+++ branches/RC/sample.htaccess (revision 12743)
@@ -0,0 +1,9 @@
+#Options +FollowSymLinks
+RewriteEngine On
+
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME}/ !-f
+RewriteCond %{REQUEST_FILENAME}/index.php !-f
+RewriteCond %{REQUEST_FILENAME}/index.html !-f
+RewriteCond %{REQUEST_URI} !\.(gif|jpg|png|js|css|ico|swf)$ [NC]
+RewriteRule ^(.*) index.php?rewrite=on&_mod_rw_url_=$1 [QSA]
Index: branches/RC/admin/index.php
===================================================================
diff -u
--- branches/RC/admin/index.php (revision 0)
+++ branches/RC/admin/index.php (revision 12743)
@@ -0,0 +1,21 @@
+Init();
+$application->Run();
+$application->Done();
+
+$end = getmicrotime();
+
+function getmicrotime()
+{
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+}
+
+?>
\ No newline at end of file
Index: branches/RC/index.php
===================================================================
diff -u
--- branches/RC/index.php (revision 0)
+++ branches/RC/index.php (revision 12743)
@@ -0,0 +1,19 @@
+Init();
+$application->Run();
+$application->Done();
+
+$end = getmicrotime();
+
+function getmicrotime()
+{
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+}
+?>
\ No newline at end of file