Removing filter bar

Discussion in 'Customization & add-ons' started by csongor_simsay, Sep 14, 2016.

Thread Status:
Not open for further replies.
  1. csongor_simsay

    csongor_simsay aMember Pro Customer

    Joined:
    Dec 10, 2013
    Messages:
    26
    Hi guys,
    Is there a way to remove the filter bar from the subuser menu? I attached a screenshot, what I mean.
    thanks

    Attached Files:

  2. ccwjames

    ccwjames Member

    Joined:
    Sep 11, 2014
    Messages:
    430
    any why would you want to remove it? its used to search users when you have loads by name or product
  3. csongor_simsay

    csongor_simsay aMember Pro Customer

    Joined:
    Dec 10, 2013
    Messages:
    26
    in my system, there can be max 10 subusers, so it's useless to search. I want to remove from the user template not from the system admin.
  4. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    1,670
    @csongor_simsay you need to have PHP 7.

    Edit file site.php
    http://www.amember.com/docs/Site.php_file
    and put the following code:
    PHP:
    Am_Di::getInstance()->hook->add('gridSubusersUserInitGrid', function(Am_Event_Grid $e) {
        
    $e->getGrid()->setFilter(new class implements Am_Grid_Filter_Interface {
            function 
    initFilter(Am_Grid_ReadOnly $grid) {}
            function 
    getVariablesList() {}
            function 
    isFiltered() {}
            function 
    renderFilter() {}
            function 
    renderStatic() {}
        });
    });
  5. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    1,670
    Here is solution for PHP 5.3:
    PHP:
    Am_Di::getInstance()->hook->add('gridSubusersUserOnRenderContent', function(Am_Event_Grid $e) {
        
    $e->setArg(0preg_replace('/<!-- start filter-wrap -->.*?<!-- end filter-wrap -->/s'''$e->getArg(0)));
    });
  6. csongor_simsay

    csongor_simsay aMember Pro Customer

    Joined:
    Dec 10, 2013
    Messages:
    26
    Thanks!
    caesar likes this.
Thread Status:
Not open for further replies.

Share This Page