Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Delegate Request - Search Form
Hi,
I'm trying to override the search query for users and allow extensions to override it also and I'm not sure of the best approach - so any advice, ideas welcome.
For example, I want to extend the user search, to search any user labels that have been set. Also I want to edit the PreDefined Attributes Add-on to be able to extend the Users query - so that it will search any extra data as well. I dont really want to have an extra radio option on the search form for users and attributes..
I'm not sure how best to approach this - as ideally any extensions should know nothing about the rest of the user search and any extensions that modifiy it - so passing the sqlbuilder back and forth might remove any dependancies and add flexibilty?
Alternatively, is there another way to override the search control with out hacking the core? The actual function that does the search for users is in the UserManager class - so simply hacking that would be easy - but it would be nice to do it the Vanilla way and not break when the core gets updated in future.
Any ideas, thoughts?
Ross
0
This discussion has been closed.
Comments
Alternately, you can completely override core vanilla classes using the ObjectFactory if worse comes to worse.
$s->AddSelect('Icon', 'r', 'RoleIcon'); $this->DelegateParameters['SqlBuilder'] = &$s; $this->CallDelegate('PreDefineSearch'); $s->DefineSearch();
I have another request for adding extra information to the discussion list on the index page:
discussion.php line 46:
$this->DelegateParameters['DiscussionList'] = &$DiscussionList; $this->DelegateParameters['DiscussionID'] = $Discussion->DiscussionID; $this->CallDelegate('extendDiscussionList');
Regards,
Ross
$this->DelegateParameters['Discussion'] = &$Discussion; $this->DelegateParameters['DiscussionList'] = &$DiscussionList; $this->CallDelegate('PostDiscussionOptionsRender');
I don't see anything offhand that would keep this from working, will see if I can figure it out.
$Context->AddToDelegate('DiscussionGrid', 'PostDiscussionOptionsRender', 'YourFunctionName'); $Context->AddToDelegate('SearchForm', 'PostDiscussionOptionsRender', 'YourFunctionName');