Cheshir Posted December 20, 2017 Share Posted December 20, 2017 Hello, How to override / delete (using hook) USE operator in a third-party application? Link to comment Share on other sites More sharing options...
CodingJungle Posted December 20, 2017 Share 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. Link to comment Share on other sites More sharing options...
Cheshir Posted December 20, 2017 Author Share 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? Link to comment Share on other sites More sharing options...
CodingJungle Posted December 20, 2017 Share 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. Link to comment Share on other sites More sharing options...
Adriano Faria Posted December 20, 2017 Share 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. Link to comment Share on other sites More sharing options...
Cheshir Posted December 20, 2017 Author Share Posted December 20, 2017 6 minutes ago, Adriano Faria said: Not tested. Thx, will be try Link to comment Share on other sites More sharing options...
CodingJungle Posted December 20, 2017 Share 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()) Link to comment Share on other sites More sharing options...
Cheshir Posted December 20, 2017 Author Share Posted December 20, 2017 37 minutes ago, CodingJungle said: canReact () return FALSE; This solved the problem! Thank you so much! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.