This topic is locked

Hide search field on adv_search_panel

4/7/2010 9:29:48 AM
PHPRunner General questions
N
n_ack author

Using "old"-search one can show/hide search fields by declaring a BeforeShowSearch() event:

$xt->assign("SearchFieldName_fieldblock",$_SESSION["AccessLevel"]==ACCESS_LEVEL_ADMINGROUP);


This setting however does not affect/is not propagated to the adv_search_panel.
What is the equivalent/workaround for toggling a field's visibility on adv_search_panel based on AccessLevel?

N
n_ack author 4/7/2010



Using "old"-search one can show/hide search fields by declaring a BeforeShowSearch() event:

$xt->assign("SearchFieldName_fieldblock",$_SESSION["AccessLevel"]==ACCESS_LEVEL_ADMINGROUP);


This setting however does not affect/is not propagated to the adv_search_panel.
What is the equivalent/workaround for toggling a field's visibility on adv_search_panel based on AccessLevel?


A templatevar {$addSearchControl_FieldName_attrs} exists in template tablename_search_panel.htm , unfortunately there are no events for search_panel, so how to do the following? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=49044&image=1&table=forumreplies' class='bbc_emoticon' alt=':blink:' />

$xt->assign("addSearchControl_Client_Name_attrs",false);// won't work;

N
n_ack author 4/7/2010



A templatevar {$addSearchControl_FieldName_attrs} exists in template tablename_search_panel.htm , unfortunately there are no events for search_panel, so how to do the following? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=49045&image=1&table=forumreplies' class='bbc_emoticon' alt=':blink:' />

$xt->assign("addSearchControl_Client_Name_attrs",false);// won't work;



editing class file searchpanelsimple.php restricts the use of the field for normal users. Editing core files is far from an ideal solution. What's more, the fieldname is still shown in the combo where you can add a search field to the panel. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=49045&image=2&table=forumreplies' class='bbc_emoticon' alt=':angry:' />

// display templ

if ($_SESSION["AccessLevel"]<>ACCESS_LEVEL_ADMINGROUP) $xt->assign("addSearchControl_Client_Name_attrs",false); //inserted this line

$xt->display($this->pageObj->shortTableName."_search_panel.htm");


Suggestions?