This topic is locked

Disable button

8/12/2010 3:57:41 AM
PHPRunner General questions
W
wpl author

Hi,
how would I disable a button that was inserted in Visual Editor of PHPRunner 5.2 ('insert button') based on $_SESSION["UserID"]? I am thinking of something like $xt->assign("xxxxx_link",false) in the "Before Display" event for the standard buttons.
Any clue?
wpl

W
wpl author 8/12/2010



Hi,
here is a helpful post:

http://www.asprunner.com/forums/topic/6196-how-to-hide-controls-on-addedit-pages/


Ann,
thanks for refreshing my mind - I did this before, just forgot how ;-)
wpl

W
wpl author 8/13/2010



Hi,
here is a helpful post:

http://www.asprunner.com/forums/topic/6196-how-to-hide-controls-on-addedit-pages/


Ann,
sorry, but I have to come back to this issue because I can't get it to work. When I insert a button in Visual Editor, no $link (like $printselectedlink) is generated that could be disabled by $xt(assign...). I would have to modify the template what I would like to avoid. Any other possibility?
wpl

A
ann 8/13/2010

Hi,
proceed to the HTML mode on the Visual Editor tab, find the following code:

<INPUT id=New_Button1 class=button value=New_Button1 type=button typeid="ib">



and replace it with the {$custom_button}.

Then fill it in the Before display event on the Events tab:

if ($_SESSION["UserID"]="admin"){

$xt->assign("custom_button","<INPUT id=New_Button1 class=button value=New_Button6 type=button typeid=\"ib\">");

}
W
wpl author 8/13/2010



Hi,
proceed to the HTML mode on the Visual Editor tab, find the following code:

<INPUT id=New_Button1 class=button value=New_Button1 type=button typeid="ib">



and replace it with the {$custom_button}.

Then fill it in the Before display event on the Events tab:

if ($_SESSION["UserID"]="admin"){

$xt->assign("custom_button","<INPUT id=New_Button1 class=button value=New_Button6 type=button typeid=\"ib\">");

}



Ann,
thanks for your efforts. But that's similar to what I am doing right now, except for the fact that I am doing the whole stuff manually (no 'insert button', but insert everthing as HTML). Just thought I could find a solution that will not be gone after a page reset.
Regards
wpl