hi.
i want to have create button in user popup.
i have 2 solution for this
1.my first solution is:
act such as accounts module (edite popup_picker.html and popupdefs )
a -> in popup.defs add this code:
b->then create 'UserFormBase.phpPHP Code:'create' =>
array('formBase' => 'UserFormBase.php',
'formBaseClass' => 'UserFormBase',
'getFormBodyParams' => array('','','UsersSave'),
'createButton' =>'create users'// $mod_strings['LNK_NEW_User']
),
c->.and in Popup_picker.html add this code
PHP Code:<p>
<div id='addformlink'>{CREATEBUTTON}</div>
<div id='addform' style='display:none;position:relative;z-index:2;left:0px;top:0px;'>
<form name="UserSave" onsubmit="return check_form('UserSave');" method="post" action="index.php">
{ADDFORMHEADER}
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td>
<input type="hidden" name="module" value="{MODULE_NAME}" />
<input type="hidden" name="action" value="Popup" />
<input type="hidden" name="doAction" value="save" />
<input type="hidden" name="query" value="true" />
{ADDFORM}
</td></tr>
</table></td></tr></table>
</form>
</div>
</p>
2.my second solution is
create a new button in Popup_picker.html that in onclick attribute call a javascript my function .
PHP Code:<input type="button" name="btn_create_new" class="button" onclick="open_new_user()"
value="new user from EditView"/></td>
but, I don't know in second solution why this new window don't show for me.PHP Code:<script type="text/javascript">
{
function open_new_user() {
URL="index.php?module=Users&action=EditView&return_module=Users&return_action=DetailView";
windowName = 'new user';
windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
win = window.open(URL, windowName, windowFeatures);
if(window.focus) {
// put the focus on the popup if the browser supports the focus() method
win.focus();
}
}
}
</script>
any one have any solution for my problem?
best regards.


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks