moving egw_openWindowCentered() to egw(window).openPopup()

This commit is contained in:
Ralf Becker 2014-12-01 10:45:24 +00:00
parent fa0a10a840
commit 8a9657541d
3 changed files with 6 additions and 6 deletions

View File

@ -452,7 +452,7 @@
<button statustext="download this contact as vCard file" label="vCard" id="button[vcard]" image="vcard" background_image="1"/> <button statustext="download this contact as vCard file" label="vCard" id="button[vcard]" image="vcard" background_image="1"/>
<button accesskey="s" label="Save" id="button[save]" class="button_save" image="save" background_image="1"/> <button accesskey="s" label="Save" id="button[save]" class="button_save" image="save" background_image="1"/>
<button label="Apply" id="button[apply]" class="button_apply" image="apply" background_image="1"/> <button label="Apply" id="button[apply]" class="button_apply" image="apply" background_image="1"/>
<button label="Cancel" id="button[cancel]" class="button_cancel" onclick="if($cont[view] || false) return true; self.close(); return false;" image="cancel" background_image="1"/> <button label="Cancel" id="button[cancel]" class="button_cancel" onclick="if($cont[view] || false) return true; window.close(); return false;" image="cancel" background_image="1"/>
<checkbox statustext="Apply changes to all members, whose fields have the same previous content" label="change all organisation members" id="change_org" span="all"/> <checkbox statustext="Apply changes to all members, whose fields have the same previous content" label="change all organisation members" id="change_org" span="all"/>
<button align="right" label="Delete" id="button[delete]" class="button_delete" onclick="et2_dialog.confirm(widget,'Do you really want to delete this contact?','Delete')" tabindex="25" image="delete" background_image="1"/> <button align="right" label="Delete" id="button[delete]" class="button_delete" onclick="et2_dialog.confirm(widget,'Do you really want to delete this contact?','Delete')" tabindex="25" image="delete" background_image="1"/>
</hbox> </hbox>

View File

@ -1981,7 +1981,7 @@ class etemplate extends boetemplate
if ($extra_link_popup && (($extra_link_popup = $this->expand_name($extra_link_popup,$show_c,$show_row,$content['.c'],$content['.row'],$content)))) if ($extra_link_popup && (($extra_link_popup = $this->expand_name($extra_link_popup,$show_c,$show_row,$content['.c'],$content['.row'],$content))))
{ {
list($w,$h) = explode('x',$extra_link_popup); list($w,$h) = explode('x',$extra_link_popup);
$options .= ' onclick="window.open(this,this.target,\'width='.(int)$w.',height='.(int)$h.',location=no,menubar=no,toolbar=no,scrollbars=yes,status=yes\'); return false;"'; $options .= ' onclick="egw(window).openPopup(this,'.(int)$w.','.(int)$h.',this.target); return false;"';
} }
if ($extra_link_title) if ($extra_link_title)
{ {
@ -2146,7 +2146,7 @@ class etemplate extends boetemplate
* - form::name('name') returns expanded name/id taking into account the name at that point of the template hierarchy * - form::name('name') returns expanded name/id taking into account the name at that point of the template hierarchy
* - egw::lang('Message ...') translate the message * - egw::lang('Message ...') translate the message
* - confirm('message') translates 'message' and adds a '?' if not present * - confirm('message') translates 'message' and adds a '?' if not present
* - window.open() replaces it with egw_openWindowCentered2() * - window.open() replaces it with egw(window).openPopup()
* - xajax_doXMLHTTP('etemplate. replace ajax calls in widgets with special handler not requiring etemplate run rights * - xajax_doXMLHTTP('etemplate. replace ajax calls in widgets with special handler not requiring etemplate run rights
* *
* @param string $on onclick, onchange, ... action * @param string $on onclick, onchange, ... action
@ -2197,10 +2197,10 @@ class etemplate extends boetemplate
$on = str_replace($matches[0],'confirm(\''.str_replace("'","\\'",$question).'\')',$on); $on = str_replace($matches[0],'confirm(\''.str_replace("'","\\'",$question).'\')',$on);
} }
// replace window.open() with EGw's egw_openWindowCentered2() // replace window.open() with EGw's egw(window).openPopup()
if (strpos($on,'window.open(') !== false && preg_match("/window.open\('(.*)','(.*)','dependent=yes,width=([^,]*),height=([^,]*),scrollbars=yes,status=(.*)'\)/",$on,$matches)) if (strpos($on,'window.open(') !== false && preg_match("/window.open\('(.*)','(.*)','dependent=yes,width=([^,]*),height=([^,]*),scrollbars=yes,status=(.*)'\)/",$on,$matches))
{ {
$on = str_replace($matches[0], "egw_openWindowCentered2('$matches[1]', '$matches[2]', $matches[3], $matches[4], '$matches[5]')", $on); $on = str_replace($matches[0], "egw(window).openPopup('$matches[1]', $matches[3], $matches[4], '$matches[2]', false, false, '$matches[5]')", $on);
} }
// replace window.close() with EGw's egw.close() // replace window.close() with EGw's egw.close()

View File

@ -920,7 +920,7 @@ function etemplate2_handle_load(_type, _response)
{ {
alert(data['window-close']); alert(data['window-close']);
} }
window.close(); egw.close();
return true; return true;
} }