Jump to content

USE operator php

Featured Replies

Posted

Hello,

How to override / delete (using hook) USE operator in a third-party application?

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.

  • Author
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?

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.

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.

  • Author
6 minutes ago, Adriano Faria said:

Not tested.

Thx, will be try

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())

  • Author
37 minutes ago, CodingJungle said:

canReact ()

return FALSE;

This solved the problem! Thank you so much!

 

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.