#*
-- Required Parameters:
--   * formname   - determines the form in which the textfield is has to be set

-- Optional Parameters:
--   * spaceOnly   - determines wheter the page popup can only choose from pages within the current space
--   * spaceNameField   - name of the field, defining the space it should look in

*#

#parse("/template/notable/text.vm")
#if($parameters.spaceOnly == true)
    #if($parameters.spaceNameField)
        <a href="#" onClick="window.open('$req.contextPath/users/spacepagepicker.action?pageId=${page.id}&currentspace=' + document.getElementById('$parameters.spaceNameField').value + '&formname=$parameters.formname&fieldname=$parameters.name&mode=history','link_inserter', 'width=620, height=400, resizable, scrollbars=yes'); return false;" title="Choose Page"  tabindex="diabled"><img src="$staticResourceUrlPrefix/images/icons/document_zoom_in_16.gif" width="16" height="16" border="0"  tabindex="diabled" align="absmiddle"></a>
    #else
        <a href="#" onClick="window.open('$req.contextPath/users/spacepagepicker.action?pageId=${page.id}&currentspace=$generalUtil.htmlEscapeQuotes($space.key)&formname=$parameters.formname&fieldname=$parameters.name&mode=history','link_inserter', 'width=620, height=400, resizable, scrollbars=yes'); return false;" title="Choose Page"  tabindex="diabled"><img src="$staticResourceUrlPrefix/images/icons/document_zoom_in_16.gif" width="16" height="16" border="0"  tabindex="diabled" align="absmiddle"></a>
    #end
#else
    <a href="#" onClick="window.open('$req.contextPath/users/pagepicker.action?pageId=${page.id}&currentspace=$generalUtil.htmlEscapeQuotes($space.key)&formname=$parameters.formname&fieldname=$parameters.name&mode=history','link_inserter', 'width=620, height=400, resizable, scrollbars=yes'); return false;" title="Choose Page"  tabindex="diabled"><img src="$staticResourceUrlPrefix/images/icons/document_zoom_in_16.gif" width="16" height="16" border="0"  tabindex="diabled" align="absmiddle"></a>
#end
