Page 1 of 1

Hide module from Extensions > Module List

Posted: Sat Mar 26, 2016 10:24 am
by impairedspook
Hi all,

I am trying to hide/remove the "Affiliates" module from the module list in admin. The only way I have found so far is to go to admin/controller/module and rename affiliate.php to affiliate.php_. This then removes it from my module list without deleting any files however I was wondering if there was a way to do this using VQMod instead?

I would rather try to limit how many core files I edit without using VQMod and was thinking there may be another way to do this?

Any help is appreciated.

Cheers

Re: Hide module from Extensions > Module List

Posted: Sat Mar 26, 2016 11:51 am
by ocart777
admin/controller/extension/module.php
search for

Code: Select all

$files = glob(DIR_APPLICATION . 'controller/module/*.php');
replace with

Code: Select all

$files = preg_grep("/(?=.*affiliate).*/", glob(DIR_APPLICATION . 'controller/module/*.php'), PREG_GREP_INVERT);
it is better to use vqmod for this so you don't have to edit the core file directly
if you want to hide some other module eg banner, add "|(?=.*banner)" after the "(?=.*affiliate)".
the operator | is used to check if affiliate or banner is there, the same as "xor"

PREG_GREP_INVERT, invert the return value

Re: Hide module from Extensions > Module List

Posted: Sat Mar 26, 2016 12:01 pm
by impairedspook
Awesome thanks ocart777, however it seems to remove "account" and "affiliate". Mind you at least I know where I am looking now :)

If you can spot what is off that would be good otherwise I will have a play around and see if I can get it sorted.

Appreciate the help!

UPDATE: Seems that if I change [!affiliate] to [!account] i will still lose both. Must be the A's :)

Re: Hide module from Extensions > Module List

Posted: Sat Mar 26, 2016 3:19 pm
by ocart777
i've update my previous post. please check it out

Re: Hide module from Extensions > Module List

Posted: Sat Mar 26, 2016 8:01 pm
by impairedspook
Thanks ocart777, That did the trick :) Appreciate the help!