Anonymous | Login | Signup for a new account | 2024-03-29 00:48 CDT |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
Dependency Graph | [ View Issue ] [ Relation Graph ] [ Vertical ] | |||
|
||||
|
Viewing Issue Simple Details | |||||
ID | Category | Type | Reproducibility | Date Submitted | Last Update |
0000397 | [In-Portal CMS] Data Management | task | always | 2009-10-17 07:00 | 2012-07-25 05:33 |
Reporter | alex | View Status | public | ||
Assigned To | alex | ||||
Priority | normal | Resolution | fixed | ||
Status | closed | ||||
Summary | 0000397: Ability to work with main event from OnBefore/OnAfter type events called from kDBItem class | ||||
Description |
There are two type of events: 1. external events - events, that could be called from outside of the script, by specifying their name in url 2. internal events - events, that are called by internal subroutines only and in most cases are indirectly related to external event being called. For example OnCreate event is pure external and it allows to create record in database based on form data form request. On the other hand OnBeforeItemCreate is pure internal event, that is called before attempt is made to create database record. This internal event is indirectly called from OnCreate event by calling kDBItem::Create method. All seems normal at first glance, but in fact it's not. There is no way to access OnCreate event $event object from OnBeforeItemCreate event. One of purposes of such type of access is to change redirect parameters or main event. For example in case of TestField value is equals to 5 we want to redirect user to non-default template after record is successful created. |
||||
Additional Information |
How I see implementation: 1. add 2 methods to kDBItem class: setReferrerEvent(&$event) and removeReferrerEvent() 2. when event of any type is called from kDBItem class (via raiseEvent method), then we set it's MasterEvent attribute to referrer event in case if any was set before. 3. from OnBeforeItemCreate event OnCreate event will be accessed via $event->MasterEvent. |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
Web Development by Intechnic In-Portal Open Source CMS |