Blesta Addons Posted July 18, 2014 Report Posted July 18, 2014 we need more event to be implemented in blesta like : Client Edit Profile Client Change Password Client Delete (Before & After action ) Client Profile Tab Fields (dropdown menu) Contact Add | Contact Edit | Contact Delete Client Dashboard Page Load Client Pay Method Client Pay Confirm Admin Dashboard Page Load Daily CronJob (Before & After action ) Invoice Payment Reminder Accept Order Delete Order Pending Order Order Checkout Shopping Cart Checkout Page Show Cart Page Module Create (Before & After action ) Module Suspend (Before & After action ) Module unSuspend (Before & After action ) Module terminate (Before & After action ) Admin/Client Services Tab Fields (rendered) upload Files action Ticket Plugin : Add - reply - close tickets Download Manager Plugin Download (Before & After action ) order plugin every step event (before/after) domaingood, flangefrog, blazedd and 2 others 5 Quote
Blesta Addons Posted August 18, 2014 Author Report Posted August 18, 2014 +1 More , and we need to add the fallowing event , this specially if we want to pass our js/css/php into the global structure file : admin_header admin_on_body_start admin_on_body_load admin_footer client_header client_on_body_start client_on_body_load client_footer this will solve the probleme for changing the structure.pdt file , like the PauloV method . Quote
mrrsm Posted August 18, 2014 Report Posted August 18, 2014 +1 More , and we need to add the fallowing event , this specially if we want to pass our js/css/php into the global structure file : admin_header admin_on_body_start admin_on_body_load admin_footer client_header client_on_body_start client_on_body_load client_footer this will solve the probleme for changing the structure.pdt file , like the PauloV method . I am not sure if these events really fit the same request. It seems like you are looking for display hooks rather then triggered events. Quote
Blesta Addons Posted August 18, 2014 Author Report Posted August 18, 2014 I am not sure if these events really fit the same request. It seems like you are looking for display hooks rather then triggered events. Blesta didn't support hooks now , our only solution is events . Quote
mrrsm Posted August 18, 2014 Report Posted August 18, 2014 Blesta didn't support hooks now , our only solution is events . You may want to request a hook system then. Those events just don't make sense (at least to me). Having the webpage load shouldn't trigger events. Actions that are happening should trigger events. (My wording on this is horrible as it makes sense in my head but I can't seem to put what I am thinking to words) Quote
Blesta Addons Posted August 18, 2014 Author Report Posted August 18, 2014 hhhhh i feel your thinking .... i have the attention to push blesta staff to release this , then we push them to another request (step by step) . but as you told , i will put another request for this , i opt for your support vote for it Quote
Cody Posted August 21, 2014 Report Posted August 21, 2014 See the updated CORE-1371. With this event, plugins are able to inject arbitrary markup into the head, top of the body, and bottom of the body, as well as set variables into the structure that could be used in conjunction with changes to the structure file. You may want to request a hook system then. Those events just don't make sense (at least to me). Having the webpage load shouldn't trigger events. There's really no difference. A hook is simply a poor man's event. By the way, there's already an event that is triggered on every page load: Appcontroller.preAction. CORE-1371 improves on that event. Michael, Blesta Addons and PauloV 3 Quote
Blesta Addons Posted August 21, 2014 Author Report Posted August 21, 2014 See the updated CORE-1371. With this event, plugins are able to inject arbitrary markup into the head, top of the body, and bottom of the body, as well as set variables into the structure that could be used in conjunction with changes to the structure file. There's really no difference. A hook is simply a poor man's event. By the way, there's already an event that is triggered on every page load: Appcontroller.preAction. CORE-1371 improves on that event. as you told , no matter the name who is , who matter is the function that do this as i see it putted to 3.3.0 ... so i think is matter of days . with Appcontroller.preAction i think i have found a bug , but i will do more test to confirm it . Quote
Blesta Addons Posted August 29, 2014 Author Report Posted August 29, 2014 See the updated CORE-1371. With this event, plugins are able to inject arbitrary markup into the head, top of the body, and bottom of the body, as well as set variables into the structure that could be used in conjunction with changes to the structure file. please a sample code to handle the Appcontroller.structure , is this code correct $params = $event->getParams(); // get any set data previoslly , to not overide other plugin data $params['controller'] += "ClientMain"; // this is the controller file name client_main.php $params['action'] += "MyFunction"; // a function inside the appcontroller file set in $params['controller'] $params['portal'] += "client"; // injest the markup in client side structure $event->setParams($params); // send array of new params with old and new data . and how the views file should be to set data in head or body ? Quote
Cody Posted August 29, 2014 Report Posted August 29, 2014 Docs here. $return = $event->getReturnVal(); if (!array_key_exists("head", $return)) $return['head'] = null; if (!array_key_exists("body_start", $return)) $return['body_start'] = null; if (!array_key_exists("body_end", $return)) $return['body_end'] = null; $return['head'] .= "<script>alert('head');</script>" $return['body_start'] .= "<p>Set at top of body</p>"; $return['body_end'] .= "<p>Set at bottom of body</p>"; $event->setReturnVal($return); But now that I think about it more, I'm thinking maybe each section should be an array. So instead you could just do: $return = $event->getReturnVal(); $return['head'][] "<script>alert('head');</script>" $return['body_start'][] "<p>Set at top of body</p>"; $return['body_end'][] "<p>Set at bottom of body</p>"; $event->setReturnVal($return); Which is easier to use, and a little harder to accidentally overwrite other plugin's return values. What do you think? Quote
Blesta Addons Posted August 29, 2014 Author Report Posted August 29, 2014 Docs here. $return = $event->getReturnVal(); if (!array_key_exists("head", $return)) $return['head'] = null; if (!array_key_exists("body_start", $return)) $return['body_start'] = null; if (!array_key_exists("body_end", $return)) $return['body_end'] = null; $return['head'] .= "<script>alert('head');</script>" $return['body_start'] .= "<p>Set at top of body</p>"; $return['body_end'] .= "<p>Set at bottom of body</p>"; $event->setReturnVal($return); But now that I think about it more, I'm thinking maybe each section should be an array. So instead you could just do: $return = $event->getReturnVal(); $return['head'][] "<script>alert('head');</script>" $return['body_start'][] "<p>Set at top of body</p>"; $return['body_end'][] "<p>Set at bottom of body</p>"; $event->setReturnVal($return); Which is easier to use, and a little harder to accidentally overwrite other plugin's return values. What do you think? Let me try this weekend with some freezing plugin , and to see it live in with 2 or 3 plugins . Edit : we can use the controller/view files instead of direct putting data in the function ? Quote
Cody Posted September 2, 2014 Report Posted September 2, 2014 Edit : we can use the controller/view files instead of direct putting data in the function ? Yes. Use file_get_contents(), or if javascript or CSS: "<script src="path/to/the/file.js"></script>" Any thoughts on using array instead of string? $return = $event->getReturnVal(); $return['head'][] "<script>alert('head');</script>" $return['body_start'][] "<p>Set at top of body</p>"; $return['body_end'][] "<p>Set at bottom of body</p>"; $event->setReturnVal($return); The more I think about it, the more I like using the array method (above). Quote
Blesta Addons Posted September 3, 2014 Author Report Posted September 3, 2014 Hello Cody . from my side , array is better , but take note ... we have begin coding of our new plugins , so all now in string mode . changing to array shold be now and release the B2 in the same day, or we will lose time in coding for something will change . what i really preffer is a array with text => html_output order => 1 // make it from 1 to 9 as we can set in wich order the plugin should be ouput , default 5 force => false // froce the output to be in the order set if another plugin is set with the same order , default false EXTRA OPTION php => 'Myplugin.Myfunction" // if set the fallowing php function will be exucuted . that all at the moment for structure event , and i make another push or the other event . Client Edit Profile Client Change Password Client Delete (Before & After action ) Client Profile Tab Fields (dropdown menu) Contact Add | Contact Edit | Contact Delete Client Dashboard Page Load Client Pay Method Client Pay Confirm Admin Dashboard Page Load Daily CronJob (Before & After action ) Invoice Payment Reminder Accept Order Delete Order Pending Order Order Checkout Shopping Cart Checkout Page Show Cart Page Module Create (Before & After action ) Module Suspend (Before & After action ) Module unSuspend (Before & After action ) Module terminate (Before & After action ) Admin/Client Services Tab Fields (rendered) upload Files action Ticket Plugin : Add - reply - close tickets Download Manager Plugin Download (Before & After action ) Quote
gutterboy Posted October 23, 2014 Report Posted October 23, 2014 +1 But my man, don't forget one for "applied fees" Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.