Cheshir Posted December 20, 2017 Posted December 20, 2017 Hello, How to override / delete (using hook) USE operator in a third-party application?
CodingJungle Posted December 20, 2017 Posted December 20, 2017 you can't afaik (if you are talking about for traits) but if you are talking about for importing, the child class will not inherit them as they exist outside of the class.
Cheshir Posted December 20, 2017 Author Posted December 20, 2017 5 minutes ago, CodingJungle said: if you are talking about for traits I will say differently, I need to disable Reactions in Classifieds application (only), which uses USE in Advert.php file (use \IPS\Content\Reactable;), can this be done using a plugin / hook?
CodingJungle Posted December 20, 2017 Posted December 20, 2017 Just now, Cheshir said: I will say differently, I need to disable Reactions in Classifieds application (only), which uses USE in Advert.php file (use \IPS\Content\Reactable;), can this be done using a plugin / hook? no you can not.
Adriano Faria Posted December 20, 2017 Posted December 20, 2017 You can probably extend \IPS\Content\Controller methods react() (for the advert) and _react() (for comments and reviews) to return FALSE. You just need to remember to check if you are in app Classifieds, module Adverts and controller view. That will make reactions to not appear there, which will probably do what you want. Not tested.
Cheshir Posted December 20, 2017 Author Posted December 20, 2017 6 minutes ago, Adriano Faria said: Not tested. Thx, will be try
CodingJungle Posted December 20, 2017 Posted December 20, 2017 20 minutes ago, Adriano Faria said: You can probably extend \IPS\Content\Controller methods react() (for the advert) and _react() (for comments and reviews) to return FALSE. You just need to remember to check if you are in app Classifieds, module Adverts and controller view. That will make reactions to not appear there, which will probably do what you want. Not tested. those are both return void methods, all that would do is prevent the react being record (at best). if the point is not to show the react/reputation, i would hook into the Adverts (and its Review and Comment, if it has them) class and override the canRate() method and just have it return false, that way the react widget wont even display. sorry, canReact() (not canRate())
Cheshir Posted December 20, 2017 Author Posted December 20, 2017 37 minutes ago, CodingJungle said: canReact () return FALSE; This solved the problem! Thank you so much!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.