diff options
| -rw-r--r-- | action.php | 70 | ||||
| -rw-r--r-- | build/Makefile | 2 | ||||
| -rw-r--r-- | family.php | 8 | ||||
| -rw-r--r-- | includes/functions/functions_import.php | 1 | ||||
| -rw-r--r-- | individual.php | 8 | ||||
| -rw-r--r-- | library/WT/Controller/Family.php | 48 | ||||
| -rw-r--r-- | library/WT/Controller/Individual.php | 52 | ||||
| -rw-r--r-- | library/WT/Controller/Media.php | 52 | ||||
| -rw-r--r-- | library/WT/Controller/Note.php | 51 | ||||
| -rw-r--r-- | library/WT/Controller/Repository.php | 51 | ||||
| -rw-r--r-- | library/WT/Controller/Source.php | 51 | ||||
| -rw-r--r-- | library/WT/MenuBar.php | 19 | ||||
| -rw-r--r-- | mediaviewer.php | 8 | ||||
| -rw-r--r-- | modules_v3/gedcom_favorites/module.php | 24 | ||||
| -rw-r--r-- | note.php | 8 | ||||
| -rw-r--r-- | repo.php | 8 | ||||
| -rw-r--r-- | source.php | 8 | ||||
| -rw-r--r-- | themes/clouds/header.php | 16 | ||||
| -rw-r--r-- | themes/colors/header.php | 21 | ||||
| -rw-r--r-- | themes/fab/header.php | 7 | ||||
| -rw-r--r-- | themes/minimal/header.php | 12 | ||||
| -rw-r--r-- | themes/webtrees/header.php | 10 | ||||
| -rw-r--r-- | themes/xenea/header.php | 9 |
23 files changed, 201 insertions, 343 deletions
diff --git a/action.php b/action.php new file mode 100644 index 0000000000..956ceb0866 --- /dev/null +++ b/action.php @@ -0,0 +1,70 @@ +<?php +// Perform an action, as an AJAX request. +// +// It is bad design to put actions in GET parameters (because +// reloading the page will execute the action again) or POST +// parameters (because it effectively disables the "back" button). +// +// It also means we must hide such links from search engines, +// which frequently penalize sites that generate different +// content for browsers/robots. +// +// Instead, use an AJAX request, such as +// +// <a href="#" onclick="jQuery.post('action.php',{action='foo',p1='bar'}, function(){location.reload()});">click-me!</a> +// <a href="#" onclick="jQuery.post('action.php',{action='foo',p1='bar'}).success(location.reload()).error(alert('failed'));">click-me!</a> +// +// Most actions will not need separate success() and error(). +// Typically this may occur if an action has already been submitted, or +// the login session has expired. In these cases, reloading the page is +// the correct response for both success/error. +// +// webtrees: Web based Family History software +// Copyright (C) 2011 webtrees development team. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// $Id$ + +define('WT_SCRIPT_NAME', 'action.php'); +require './includes/session.php'; + +header('Content-type: text/html; charset=UTF-8'); + +switch (safe_POST('action')) { +case 'accept-changes': + // Accept all the pending changes for a record + require WT_ROOT.'includes/functions/functions_edit.php'; + $record=WT_GedcomRecord::getInstance(safe_POST_xref('xref')); + if ($record && WT_USER_CAN_ACCEPT && $record->canDisplayDetails() && $record->canEdit()) { + Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->addMessage(/* I18N: %s is the name of a person, source or other record */ WT_I18N::translate('The changes to “%s” have been accepted.', $record->getFullName())); + accept_all_changes($record->getXref(), $record->getGedId()); + } else { + header('HTTP/1.0 406 Not Acceptable'); + } + break; + +case 'reject-changes': + // Reject all the pending changes for a record + require WT_ROOT.'includes/functions/functions_edit.php'; + $record=WT_GedcomRecord::getInstance(safe_POST_xref('xref')); + if ($record && WT_USER_CAN_ACCEPT && $record->canDisplayDetails() && $record->canEdit()) { + Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->addMessage(/* I18N: %s is the name of a person, source or other record */ WT_I18N::translate('The changes to “%s” have been rejected.', $record->getFullName())); + reject_all_changes($record->getXref(), $record->getGedId()); + } else { + header('HTTP/1.0 406 Not Acceptable'); + } + break; +} diff --git a/build/Makefile b/build/Makefile index e9b3b5e952..1781e80e3d 100644 --- a/build/Makefile +++ b/build/Makefile @@ -55,7 +55,7 @@ webtrees: $(PO_DIR) $(MO_DIR) # Embed the SVN version number in the code (for SVN builds only) sed -i "s/define('WT_VERSION_RELEASE', 'svn')/define('WT_VERSION_RELEASE', 'svn$(SVN_VERSION)')/" $@/includes/session.php # Exclude unused Zend Framework components - rm -R $@/library/Zend/{Acl,Amf,Application,Auth,Barcode,Captcha,CodeGenerator,Console,Controller,Config,Crypt,Currency,Date,Db,Debug,Dojo,Dom,Feed,File,Form,Gdata,Http,InfoCard,Json,Layout,Ldap,Log,Mail,Markup,Measure,Memory,Mime,Navigation,Oauth,OpenId,Paginator,Pdf,ProgressBar,Queue,Reflection,Rest,Search,Serializer,Service,Soap,Test,Text,TimeSync,Tool,Uri,Validate,Version,View,Wildfire,XmlRpc}* + rm -R $@/library/Zend/{Acl,Amf,Application,Auth,Barcode,Captcha,CodeGenerator,Console,Config,Crypt,Currency,Date,Db,Debug,Dojo,Dom,Feed,File,Form,Gdata,Http,InfoCard,Json,Layout,Ldap,Log,Mail,Markup,Measure,Memory,Mime,Navigation,Oauth,OpenId,Paginator,Pdf,ProgressBar,Queue,Reflection,Rest,Search,Serializer,Service,Soap,Test,Text,TimeSync,Tool,Uri,Validate,Version,View,Wildfire,XmlRpc}* # Exclude unused locale data rm -f $@/library/Zend/Locale/Data/{aa,ak,am,as,az,be,bg,bn,bo,byn,cch,cop,cy,dz,ee,eo,eu,fil,fur,ga,gaa,gez,gsw,gu,gv,ha,haw,hi,hy,ia,ig,ii,in,is,iu,iw,k,ln,lo,lv,mk,ml,mn,mo,mr,mt,my,nd,ne,no,nso,nr,ny,om,or,pa,ps,rw,sa,se,sh,si,so,sq,ss,st,sw,syr,te,tg,th,ti,tl,tn,to,trv,ts,u,ve,w,x,y,zu}*.xml rm -Rf $@/build diff --git a/family.php b/family.php index 380b295de3..23c22d530d 100644 --- a/family.php +++ b/family.php @@ -39,8 +39,8 @@ if ($controller->family && $controller->family->canDisplayDetails()) { '<p class="ui-state-highlight">', /* I18N: %1$s is "accept", %2$s is "reject". These are links. */ WT_I18N::translate( 'This family has been deleted. You should review the deletion and then %1$s or %2$s it.', - '<a href="' . $controller->family->getHtmlUrl() . '&action=accept">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', - '<a href="' . $controller->family->getHtmlUrl() . '&action=undo">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>' + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'accept-changes\',xref:\''.$controller->family->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'reject-changes\',xref:\''.$controller->family->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>' ), ' ', help_link('pending_changes'), '</p>'; @@ -57,8 +57,8 @@ if ($controller->family && $controller->family->canDisplayDetails()) { '<p class="ui-state-highlight">', /* I18N: %1$s is "accept", %2$s is "reject". These are links. */ WT_I18N::translate( 'This family has been edited. You should review the changes and then %1$s or %2$s them.', - '<a href="' . $controller->family->getHtmlUrl() . '&action=accept">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', - '<a href="' . $controller->family->getHtmlUrl() . '&action=undo">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>' + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'accept-changes\',xref:\''.$controller->family->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'reject-changes\',xref:\''.$controller->family->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>' ), ' ', help_link('pending_changes'), '</p>'; diff --git a/includes/functions/functions_import.php b/includes/functions/functions_import.php index 1aef3dc9e9..1e482e355f 100644 --- a/includes/functions/functions_import.php +++ b/includes/functions/functions_import.php @@ -1173,7 +1173,6 @@ function accept_all_changes($xref, $ged_id) { " WHERE status='pending' AND xref=? AND gedcom_id=?" )->execute(array($xref, $ged_id)); AddToLog("Accepted change {$change->change_id} for {$xref} / {$change->gedcom_name} into database", 'edit'); - //Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->addMessage(WT_I18N::translate('The changes have been accepted.')); } } diff --git a/individual.php b/individual.php index c59f794850..62ce2212b3 100644 --- a/individual.php +++ b/individual.php @@ -45,8 +45,8 @@ if ($controller->indi && $controller->indi->canDisplayDetails()) { '<p class="ui-state-highlight">', /* I18N: %1$s is "accept", %2$s is "reject". These are links. */ WT_I18N::translate( 'This individual has been deleted. You should review the deletion and then %1$s or %2$s it.', - '<a href="' . $controller->indi->getHtmlUrl() . '&action=accept">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', - '<a href="' . $controller->indi->getHtmlUrl() . '&action=undo">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>' + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'accept-changes\',xref:\''.$controller->indi->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'reject-changes\',xref:\''.$controller->indi->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>' ), ' ', help_link('pending_changes'), '</p>'; @@ -63,8 +63,8 @@ if ($controller->indi && $controller->indi->canDisplayDetails()) { '<p class="ui-state-highlight">', /* I18N: %1$s is "accept", %2$s is "reject". These are links. */ WT_I18N::translate( 'This individual has been edited. You should review the changes and then %1$s or %2$s them.', - '<a href="' . $controller->indi->getHtmlUrl() . '&action=accept">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', - '<a href="' . $controller->indi->getHtmlUrl() . '&action=undo">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>' + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'accept-changes\',xref:\''.$controller->indi->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'reject-changes\',xref:\''.$controller->indi->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>' ), ' ', help_link('pending_changes'), '</p>'; diff --git a/library/WT/Controller/Family.php b/library/WT/Controller/Family.php index 0cdbb9e912..8d57931ff5 100644 --- a/library/WT/Controller/Family.php +++ b/library/WT/Controller/Family.php @@ -64,51 +64,6 @@ class WT_Controller_Family extends WT_Controller_Base { $this->famid=$this->family->getXref(); // Correct upper/lower case mismatch - //-- perform the desired action - switch($this->action) { - case 'addfav': - if (WT_USER_ID && !empty($_REQUEST['gid']) && array_key_exists('user_favorites', WT_Module::getActiveModules())) { - $favorite = array( - 'username' => WT_USER_NAME, - 'gid' => $_REQUEST['gid'], - 'type' => 'FAM', - 'file' => WT_GEDCOM, - 'url' => '', - 'note' => '', - 'title' => '' - ); - user_favorites_WT_Module::addFavorite($favorite); - } - unset($_GET['action']); - break; - case 'accept': - if (WT_USER_CAN_ACCEPT) { - accept_all_changes($this->famid, WT_GED_ID); - //-- check if we just deleted the record and redirect to index - $gedrec = find_family_record($this->famid, WT_GED_ID); - if (empty($gedrec)) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH); - exit; - } - $this->family = new WT_Family($gedrec); - } - unset($_GET['action']); - break; - case 'undo': - if (WT_USER_CAN_ACCEPT) { - reject_all_changes($this->famid, WT_GED_ID); - $gedrec = find_family_record($this->famid, WT_GED_ID); - //-- check if we just deleted the record and redirect to index - if (empty($gedrec)) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH); - exit; - } - $this->family = new WT_Family($gedrec); - } - unset($_GET['action']); - break; - } - //-- if the user can edit and there are changes then get the new changes if (WT_USER_CAN_EDIT) { $newrec = find_updated_record($this->famid, WT_GED_ID); @@ -219,9 +174,10 @@ class WT_Controller_Family extends WT_Controller_Base { if (array_key_exists('user_favorites', WT_Module::getActiveModules())) { $submenu = new WT_Menu( /* I18N: Menu option. Add [the current page] to the list of favorites */ WT_I18N::translate('Add to favorites'), - $this->family->getHtmlUrl()."&action=addfav&gid=".$this->getFamilyID(), + '#', 'menu-fam-addfav' ); + $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'".$this->family->getXref()."'},function(){location.reload();})"); $submenu->addIcon('favorites'); $submenu->addClass('submenuitem', 'submenuitem_hover', 'submenu', 'icon_small_fav'); $menu->addSubmenu($submenu); diff --git a/library/WT/Controller/Individual.php b/library/WT/Controller/Individual.php index 512f52713d..ad5d79815c 100644 --- a/library/WT/Controller/Individual.php +++ b/library/WT/Controller/Individual.php @@ -70,51 +70,6 @@ class WT_Controller_Individual extends WT_Controller_Base { $this->pid=$this->indi->getXref(); // Correct upper/lower case mismatch - //-- perform the desired action - switch($this->action) { - case 'addfav': - if (WT_USER_ID && !empty($_REQUEST['gid']) && array_key_exists('user_favorites', WT_Module::getActiveModules())) { - $favorite = array( - 'username' => WT_USER_NAME, - 'gid' => $_REQUEST['gid'], - 'type' => 'INDI', - 'file' => WT_GEDCOM, - 'url' => '', - 'note' => '', - 'title' => '' - ); - user_favorites_WT_Module::addFavorite($favorite); - } - unset($_GET['action']); - break; - case 'accept': - if (WT_USER_CAN_ACCEPT) { - accept_all_changes($this->pid, WT_GED_ID); - //-- check if we just deleted the record and redirect to index - $gedrec = find_person_record($this->pid, WT_GED_ID); - if (empty($gedrec)) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH); - exit; - } - $this->indi = new WT_Person($gedrec); - } - unset($_GET['action']); - break; - case 'undo': - if (WT_USER_CAN_ACCEPT) { - reject_all_changes($this->pid, WT_GED_ID); - $gedrec = find_person_record($this->pid, WT_GED_ID); - //-- check if we just deleted the record and redirect to index - if (empty($gedrec)) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH); - exit; - } - $this->indi = new WT_Person($gedrec); - } - unset($_GET['action']); - break; - } - //-- if the user can edit and there are changes then get the new changes if (WT_USER_CAN_EDIT || WT_USER_CAN_ACCEPT) { $newrec = find_updated_record($this->pid, WT_GED_ID); @@ -463,10 +418,11 @@ class WT_Controller_Individual extends WT_Controller_Base { // add to favorites if (array_key_exists('user_favorites', WT_Module::getActiveModules())) { $submenu = new WT_Menu( - WT_I18N::translate('Add to favorites'), - $this->indi->getHtmlUrl()."&action=addfav&gid=".$this->pid, - 'menu-indi-addfav' + /* I18N: Menu option. Add [the current page] to the list of favorites */ WT_I18N::translate('Add to favorites'), + '#', + 'menu-fam-addfav' ); + $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'".$this->indi->getXref()."'},function(){location.reload();})"); $submenu->addIcon('favorites'); $submenu->addClass('submenuitem', 'submenuitem_hover', 'submenu', 'icon_small_fav'); $menu->addSubmenu($submenu); diff --git a/library/WT/Controller/Media.php b/library/WT/Controller/Media.php index 29efab4ed1..a6be999ce7 100644 --- a/library/WT/Controller/Media.php +++ b/library/WT/Controller/Media.php @@ -96,51 +96,6 @@ class WT_Controller_Media extends WT_Controller_Base { $this->mediaobject->ged_id=WT_GED_ID; // This record is from a file $this->mid=$this->mediaobject->getXref(); // Correct upper/lower case mismatch - - //-- perform the desired action - switch($this->action) { - case 'addfav': - if (WT_USER_ID && !empty($_REQUEST['gid']) && array_key_exists('user_favorites', WT_Module::getActiveModules())) { - $favorite = array( - 'username' => WT_USER_NAME, - 'gid' => $_REQUEST['gid'], - 'type' => 'OBJE', - 'file' => WT_GEDCOM, - 'url' => '', - 'note' => '', - 'title' => '' - ); - user_favorites_WT_Module::addFavorite($favorite); - } - unset($_GET['action']); - break; - case 'accept': - if (WT_USER_CAN_ACCEPT) { - accept_all_changes($this->m_pid, WT_GED_ID); - //-- check if we just deleted the record and redirect to index - $mediarec = find_media_record($this->m_pid, WT_GED_ID); - if (empty($mediarec)) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH); - exit; - } - $this->mediaobject = new WT_Media($mediarec); - } - unset($_GET['action']); - break; - case 'undo': - if (WT_USER_CAN_ACCEPT) { - reject_all_changes($this->m_pid, WT_GED_ID); - $mediarec = find_media_record($this->m_pid, WT_GED_ID); - //-- check if we just deleted the record and redirect to index - if (empty($mediarec)) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH); - exit; - } - $this->mediaobject = new WT_Media($mediarec); - } - unset($_GET['action']); - break; - } } /** @@ -256,10 +211,11 @@ class WT_Controller_Media extends WT_Controller_Base { // add to favorites if (array_key_exists('user_favorites', WT_Module::getActiveModules())) { $submenu = new WT_Menu( - WT_I18N::translate('Add to favorites'), - $this->mediaobject->getHtmlUrl()."&action=addfav&gid=".$this->mid, - 'menu-obje-addfav' + /* I18N: Menu option. Add [the current page] to the list of favorites */ WT_I18N::translate('Add to favorites'), + '#', + 'menu-fam-addfav' ); + $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'".$this->mediaobject->getXref()."'},function(){location.reload();})"); $submenu->addIcon('favorites'); $submenu->addClass('submenuitem', 'submenuitem_hover', 'submenu', 'icon_small_fav'); $menu->addSubmenu($submenu); diff --git a/library/WT/Controller/Note.php b/library/WT/Controller/Note.php index eb54208109..cd94b3710e 100644 --- a/library/WT/Controller/Note.php +++ b/library/WT/Controller/Note.php @@ -57,50 +57,6 @@ class WT_Controller_Note extends WT_Controller_Base { } } - //-- perform the desired action - switch($this->action) { - case 'addfav': - if (WT_USER_ID && !empty($_REQUEST['gid']) && array_key_exists('user_favorites', WT_Module::getActiveModules())) { - $favorite = array( - 'username' => WT_USER_NAME, - 'gid' => $_REQUEST['gid'], - 'type' => 'NOTE', - 'file' => WT_GEDCOM, - 'url' => '', - 'note' => '', - 'title' => '' - ); - user_favorites_WT_Module::addFavorite($favorite); - } - unset($_GET['action']); - break; - case 'accept': - if (WT_USER_CAN_ACCEPT) { - accept_all_changes($this->nid, WT_GED_ID); - $gedrec=find_other_record($this->nid, WT_GED_ID); - $newrec=null; - if ($gedrec===null) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH); - exit; - } - $this->note = new WT_Note($gedrec); - } - unset($_GET['action']); - break; - case 'undo': - if (WT_USER_CAN_ACCEPT) { - reject_all_changes($this->nid, WT_GED_ID); - $gedrec=find_other_record($this->nid, WT_GED_ID); - $newrec=null; - if ($gedrec===null) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH); - exit; - } - } - unset($_GET['action']); - break; - } - $this->note = new WT_Note($gedrec); // If there are pending changes, merge them in. @@ -178,10 +134,11 @@ class WT_Controller_Note extends WT_Controller_Base { // add to favorites if (array_key_exists('user_favorites', WT_Module::getActiveModules())) { $submenu = new WT_Menu( - WT_I18N::translate('Add to favorites'), - $this->note->getHtmlUrl()."&action=addfav&gid=".$this->nid, - 'menu-note-addfav' + /* I18N: Menu option. Add [the current page] to the list of favorites */ WT_I18N::translate('Add to favorites'), + '#', + 'menu-fam-addfav' ); + $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'".$this->note->getXref()."'},function(){location.reload();})"); $submenu->addIcon('favorites'); $submenu->addClass('submenuitem', 'submenuitem_hover', 'submenu', 'icon_small_fav'); $menu->addSubmenu($submenu); diff --git a/library/WT/Controller/Repository.php b/library/WT/Controller/Repository.php index 8922700b6d..c2a70a5d8e 100644 --- a/library/WT/Controller/Repository.php +++ b/library/WT/Controller/Repository.php @@ -57,50 +57,6 @@ class WT_Controller_Repository extends WT_Controller_Base { } } - //-- perform the desired action - switch($this->action) { - case 'addfav': - if (WT_USER_ID && !empty($_REQUEST['gid']) && array_key_exists('user_favorites', WT_Module::getActiveModules())) { - $favorite = array( - 'username' => WT_USER_NAME, - 'gid' => $_REQUEST['gid'], - 'type' => 'REPO', - 'file' => WT_GEDCOM, - 'url' => '', - 'note' => '', - 'title' => '' - ); - user_favorites_WT_Module::addFavorite($favorite); - } - unset($_GET['action']); - break; - case 'accept': - if (WT_USER_CAN_ACCEPT) { - accept_all_changes($this->rid, WT_GED_ID); - $gedrec=find_other_record($this->rid, WT_GED_ID); - $newrec=null; - if ($gedrec===null) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH); - exit; - } - $this->repository = new WT_Repository($gedrec); - } - unset($_GET['action']); - break; - case 'undo': - if (WT_USER_CAN_ACCEPT) { - reject_all_changes($this->rid, WT_GED_ID); - $gedrec=find_other_record($this->rid, WT_GED_ID); - $newrec=null; - if ($gedrec===null) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH); - exit; - } - } - unset($_GET['action']); - break; - } - $this->repository = new WT_Repository($gedrec); // If there are pending changes, merge them in. @@ -178,10 +134,11 @@ class WT_Controller_Repository extends WT_Controller_Base { // add to favorites if (array_key_exists('user_favorites', WT_Module::getActiveModules())) { $submenu = new WT_Menu( - WT_I18N::translate('Add to favorites'), - $this->repository->getHtmlUrl()."&action=addfav&gid=".$this->rid, - 'menu-repo-addfav' + /* I18N: Menu option. Add [the current page] to the list of favorites */ WT_I18N::translate('Add to favorites'), + '#', + 'menu-fam-addfav' ); + $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'".$this->repository->getXref()."'},function(){location.reload();})"); $submenu->addIcon('favorites'); $submenu->addClass('submenuitem', 'submenuitem_hover', 'submenu', 'icon_small_fav'); $menu->addSubmenu($submenu); diff --git a/library/WT/Controller/Source.php b/library/WT/Controller/Source.php index 1f874e38c7..5f9c0ffcd9 100644 --- a/library/WT/Controller/Source.php +++ b/library/WT/Controller/Source.php @@ -57,50 +57,6 @@ class WT_Controller_Source extends WT_Controller_Base { } } - //-- perform the desired action - switch($this->action) { - case 'addfav': - if (WT_USER_ID && !empty($_REQUEST['gid']) && array_key_exists('user_favorites', WT_Module::getActiveModules())) { - $favorite = array( - 'username' => WT_USER_NAME, - 'gid' => $_REQUEST['gid'], - 'type' => 'SOUR', - 'file' => WT_GEDCOM, - 'url' => '', - 'note' => '', - 'title' => '' - ); - user_favorites_WT_Module::addFavorite($favorite); - } - unset($_GET['action']); - break; - case 'accept': - if (WT_USER_CAN_ACCEPT) { - accept_all_changes($this->sid, WT_GED_ID); - $gedrec=find_source_record($this->sid, WT_GED_ID); - $newrec=null; - if ($gedrec===null) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH); - exit; - } - $this->source = new WT_Source($gedrec); - } - unset($_GET['action']); - break; - case 'undo': - if (WT_USER_CAN_ACCEPT) { - reject_all_changes($this->sid, WT_GED_ID); - $gedrec=find_source_record($this->sid, WT_GED_ID); - $newrec=null; - if ($gedrec===null) { - header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH); - exit; - } - } - unset($_GET['action']); - break; - } - $this->source = new WT_Source($gedrec); // If there are pending changes, merge them in. @@ -178,10 +134,11 @@ class WT_Controller_Source extends WT_Controller_Base { // add to favorites if (array_key_exists('user_favorites', WT_Module::getActiveModules())) { $submenu = new WT_Menu( - WT_I18N::translate('Add to favorites'), - $this->source->getHtmlUrl()."&action=addfav&gid=".$this->sid, - 'menu-sour-addfav' + /* I18N: Menu option. Add [the current page] to the list of favorites */ WT_I18N::translate('Add to favorites'), + '#', + 'menu-fam-addfav' ); + $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'".$this->source->getXref()."'},function(){location.reload();})"); $submenu->addIcon('favorites'); $submenu->addClass('submenuitem', 'submenuitem_hover', 'submenu', 'icon_small_fav'); $menu->addSubmenu($submenu); diff --git a/library/WT/MenuBar.php b/library/WT/MenuBar.php index e2072a0a80..7aeca16e14 100644 --- a/library/WT/MenuBar.php +++ b/library/WT/MenuBar.php @@ -742,6 +742,7 @@ class WT_MenuBar { case 'FAM': case 'SOUR': case 'OBJE': + case 'NOTE': $obj=WT_GedcomRecord::getInstance($favorite['gid']); if ($obj && $obj->canDisplayName()) { $submenu=new WT_Menu($obj->getFullName(), $obj->getHtmlUrl()); @@ -754,27 +755,33 @@ class WT_MenuBar { if ($show_user_favs) { if ($controller instanceof WT_Controller_Individual && $controller->indi) { - $submenu=new WT_Menu(WT_I18N::translate('Add to favorites'), $controller->indi->getHtmlUrl().'&action=addfav&gid='.$controller->indi->getXref()); + $submenu=new WT_Menu(WT_I18N::translate('Add to favorites'), '#'); + $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'".$controller->indi->getXref()."'},function(){location.reload();})"); $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover'); $menu->addSubMenu($submenu); } else if ($controller instanceof WT_Controller_Family && $controller->family) { - $submenu=new WT_Menu(WT_I18N::translate('Add to favorites'), $controller->family->getHtmlUrl().'&action=addfav&gid='.$controller->family->getXref()); + $submenu=new WT_Menu(WT_I18N::translate('Add to favorites'), '#'); + $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'".$controller->family->getXref()."'},function(){location.reload();})"); $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover'); $menu->addSubMenu($submenu); } else if ($controller instanceof WT_Controller_Source && $controller->source) { - $submenu=new WT_Menu(WT_I18N::translate('Add to favorites'), $controller->source->getHtmlUrl().'&action=addfav&gid='.$controller->source->getXref()); + $submenu=new WT_Menu(WT_I18N::translate('Add to favorites'), '#'); + $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'".$controller->source->getXref()."'},function(){location.reload();})"); $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover'); $menu->addSubMenu($submenu); } else if ($controller instanceof WT_Controller_Repository && $controller->repository) { - $submenu=new WT_Menu(WT_I18N::translate('Add to favorites'), $controller->repository->getHtmlUrl().'&action=addfav&gid='.$controller->repository->getXref()); + $submenu=new WT_Menu(WT_I18N::translate('Add to favorites'), '#'); + $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'".$controller->repository->getXref()."'},function(){location.reload();})"); $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover'); $menu->addSubMenu($submenu); } else if ($controller instanceof WT_Controller_Media && $controller->mediaobject) { - $submenu=new WT_Menu(WT_I18N::translate('Add to favorites'), $controller->mediaobject->getHtmlUrl().'&action=addfav&gid='.$controller->mediaobject->getXref()); + $submenu=new WT_Menu(WT_I18N::translate('Add to favorites'), '#'); + $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'".$controller->mediaobject->getXref()."'},function(){location.reload();})"); $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover'); $menu->addSubMenu($submenu); } else if ($controller instanceof WT_Controller_Note && $controller->note) { - $submenu=new WT_Menu(WT_I18N::translate('Add to favorites'), $controller->note->getHtmlUrl().'&action=addfav&gid='.$controller->note->getXref()); + $submenu=new WT_Menu(WT_I18N::translate('Add to favorites'), '#'); + $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&mod_action=menu-add-favorite',{xref:'".$controller->note->getXref()."'},function(){location.reload();})"); $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover'); $menu->addSubMenu($submenu); } diff --git a/mediaviewer.php b/mediaviewer.php index 9f051664be..20cf974d29 100644 --- a/mediaviewer.php +++ b/mediaviewer.php @@ -40,8 +40,8 @@ if ($controller->mediaobject && $controller->mediaobject->canDisplayDetails()) { '<p class="ui-state-highlight">', /* I18N: %1$s is "accept", %2$s is "reject". These are links. */ WT_I18N::translate( 'This media object has been deleted. You should review the deletion and then %1$s or %2$s it.', - '<a href="' . $controller->mediaobject->getHtmlUrl() . '&action=accept">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', - '<a href="' . $controller->mediaobject->getHtmlUrl() . '&action=undo">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>' + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'accept-changes\',xref:\''.$controller->mediaobject->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'reject-changes\',xref:\''.$controller->mediaobject->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>' ), ' ', help_link('pending_changes'), '</p>'; @@ -58,8 +58,8 @@ if ($controller->mediaobject && $controller->mediaobject->canDisplayDetails()) { '<p class="ui-state-highlight">', /* I18N: %1$s is "accept", %2$s is "reject". These are links. */ WT_I18N::translate( 'This media object has been edited. You should review the changes and then %1$s or %2$s them.', - '<a href="' . $controller->mediaobject->getHtmlUrl() . '&action=accept">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', - '<a href="' . $controller->mediaobject->getHtmlUrl() . '&action=undo">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>' + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'accept-changes\',xref:\''.$controller->mediaobject->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'reject-changes\',xref:\''.$controller->mediaobject->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>' ), ' ', help_link('pending_changes'), '</p>'; diff --git a/modules_v3/gedcom_favorites/module.php b/modules_v3/gedcom_favorites/module.php index 24e92452e6..9e325b16cf 100644 --- a/modules_v3/gedcom_favorites/module.php +++ b/modules_v3/gedcom_favorites/module.php @@ -292,8 +292,9 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { */ public static function addFavorite($favorite) { // -- make sure a favorite is added - if (empty($favorite['gid']) && empty($favorite['url'])) + if (empty($favorite['gid']) && empty($favorite['url'])) { return false; + } //-- make sure this is not a duplicate entry $sql = "SELECT 1 FROM `##favorites` WHERE"; @@ -339,4 +340,25 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { die($ex); } } + + public function modAction($modAction) { + switch($modAction) { + case 'menu-add-favorite': + // Process the "add to user favorites" menu item on indi/fam/etc. pages + $record=WT_GedcomRecord::getInstance(safe_POST_xref('xref')); + if ($record && $record->canDisplayName()) { + Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->addMessage(/* I18N: %s is the name of a person, source or other record */ WT_I18N::translate('“%s” has been added to your favorites.', $record->getFullName())); + self::addFavorite(array( + 'username'=>WT_USER_NAME, + 'gid' =>$record->getXref(), + 'type' =>$record->getType(), + 'file' =>WT_GEDCOM, + 'url' =>'', + 'note' =>'', + 'title' =>'', + )); + } + break; + } + } } @@ -39,8 +39,8 @@ if ($controller->note && $controller->note->canDisplayDetails()) { '<p class="ui-state-highlight">', /* I18N: %1$s is "accept", %2$s is "reject". These are links. */ WT_I18N::translate( 'This note has been deleted. You should review the deletion and then %1$s or %2$s it.', - '<a href="' . $controller->note->getHtmlUrl() . '&action=accept">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', - '<a href="' . $controller->note->getHtmlUrl() . '&action=undo">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>' + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'accept-changes\',xref:\''.$controller->note->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'reject-changes\',xref:\''.$controller->note->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>' ), ' ', help_link('pending_changes'), '</p>'; @@ -57,8 +57,8 @@ if ($controller->note && $controller->note->canDisplayDetails()) { '<p class="ui-state-highlight">', /* I18N: %1$s is "accept", %2$s is "reject". These are links. */ WT_I18N::translate( 'This note has been edited. You should review the changes and then %1$s or %2$s them.', - '<a href="' . $controller->note->getHtmlUrl() . '&action=accept">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', - '<a href="' . $controller->note->getHtmlUrl() . '&action=undo">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>' + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'accept-changes\',xref:\''.$controller->note->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'reject-changes\',xref:\''.$controller->note->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>' ), ' ', help_link('pending_changes'), '</p>'; @@ -39,8 +39,8 @@ if ($controller->repository && $controller->repository->canDisplayDetails()) { '<p class="ui-state-highlight">', /* I18N: %1$s is "accept", %2$s is "reject". These are links. */ WT_I18N::translate( 'This repository has been deleted. You should review the deletion and then %1$s or %2$s it.', - '<a href="' . $controller->repository->getHtmlUrl() . '&action=accept">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', - '<a href="' . $controller->repository->getHtmlUrl() . '&action=undo">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>' + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'accept-changes\',xref:\''.$controller->repository->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'reject-changes\',xref:\''.$controller->repository->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>' ), ' ', help_link('pending_changes'), '</p>'; @@ -57,8 +57,8 @@ if ($controller->repository && $controller->repository->canDisplayDetails()) { '<p class="ui-state-highlight">', /* I18N: %1$s is "accept", %2$s is "reject". These are links. */ WT_I18N::translate( 'This repository has been edited. You should review the changes and then %1$s or %2$s them.', - '<a href="' . $controller->repository->getHtmlUrl() . '&action=accept">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', - '<a href="' . $controller->repository->getHtmlUrl() . '&action=undo">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>' + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'accept-changes\',xref:\''.$controller->repository->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'reject-changes\',xref:\''.$controller->repository->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>' ), ' ', help_link('pending_changes'), '</p>'; diff --git a/source.php b/source.php index 789285ddd7..b1b3eb4618 100644 --- a/source.php +++ b/source.php @@ -39,8 +39,8 @@ if ($controller->source && $controller->source->canDisplayDetails()) { '<p class="ui-state-highlight">', /* I18N: %1$s is "accept", %2$s is "reject". These are links. */ WT_I18N::translate( 'This source has been deleted. You should review the deletion and then %1$s or %2$s it.', - '<a href="' . $controller->source->getHtmlUrl() . '&action=accept">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', - '<a href="' . $controller->source->getHtmlUrl() . '&action=undo">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>' + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'accept-changes\',xref:\''.$controller->so->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'reject-changes\',xref:\''.$controller->so->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>' ), ' ', help_link('pending_changes'), '</p>'; @@ -57,8 +57,8 @@ if ($controller->source && $controller->source->canDisplayDetails()) { '<p class="ui-state-highlight">', /* I18N: %1$s is "accept", %2$s is "reject". These are links. */ WT_I18N::translate( 'This source has been edited. You should review the changes and then %1$s or %2$s them.', - '<a href="' . $controller->source->getHtmlUrl() . '&action=accept">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', - '<a href="' . $controller->source->getHtmlUrl() . '&action=undo">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>' + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'accept-changes\',xref:\''.$controller->so->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', + '<a href="#" onClick="jQuery.post(\'action.php\',{action:\'reject-changes\',xref:\''.$controller->so->getXref().'\'},function(){location.reload();})">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>' ), ' ', help_link('pending_changes'), '</p>'; diff --git a/themes/clouds/header.php b/themes/clouds/header.php index f044e0c2d8..1b7d989c53 100644 --- a/themes/clouds/header.php +++ b/themes/clouds/header.php @@ -127,9 +127,15 @@ if ($view!='simple') { // Use "simple" headers for popup windows if ($menu) { echo $menu->getMenuAsList(); } - echo '</ul></div></div>'; + echo + '</ul>', + '</div>', // <div id="menu-right"> + '</div>', // <div id="topMenu"> + '<img src="', $WT_IMAGES['hline'], '" width="100%" height="3" alt="" />'; + // Display feedback from asynchronous actions + foreach (Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->getMessages() as $message) { + echo '<p class="ui-state-highlight">', $message, '</p>'; + } + echo '</div>'; // <div id="header"> } -?> -<!-- end menu section --> -<!-- begin content section --> -<div id="content"> +echo '<div id="content">'; diff --git a/themes/colors/header.php b/themes/colors/header.php index 5445ecf7ee..9029ee5841 100644 --- a/themes/colors/header.php +++ b/themes/colors/header.php @@ -141,7 +141,7 @@ if ($view!='simple') { // Use "simple" headers for popup windows // Print the menu bar echo - '<div id="topMenu">', + '<div id="topMenu">', '<ul id="main-menu">'; foreach ($menu_items as $menu) { if ($menu) { @@ -150,14 +150,13 @@ if ($view!='simple') { // Use "simple" headers for popup windows } unset($menu_items, $menu); echo - '</ul>'; - - -echo - '</div>'; // close topMenu + '</ul>', + '</div>', // <div id="topMenu"> + '<img src="', $WT_IMAGES['hline'], '" width="100%" height="3" alt="" />'; + // Display feedback from asynchronous actions + foreach (Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->getMessages() as $message) { + echo '<p class="ui-state-highlight">', $message, '</p>'; + } + echo '</div>'; // <div id="header"> } -// end header section --> -?> -<!-- end menu section --> -<!-- begin content section --> -<div id="content"> +echo '<div id="content">'; diff --git a/themes/fab/header.php b/themes/fab/header.php index fda9948ff0..d63f82cf55 100644 --- a/themes/fab/header.php +++ b/themes/fab/header.php @@ -124,6 +124,11 @@ if ($view!='simple') { // Use "simple" headers for popup windows } } unset($menu_items, $menu); - echo '</ul></div></div>'; + echo '</ul></div>'; + // Display feedback from asynchronous actions + foreach (Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->getMessages() as $message) { + echo '<p class="ui-state-highlight">', $message, '</p>'; + } + echo '</div>'; // <div id="header"> } echo '<div id="content">'; diff --git a/themes/minimal/header.php b/themes/minimal/header.php index f20e71e97e..be12166971 100644 --- a/themes/minimal/header.php +++ b/themes/minimal/header.php @@ -160,8 +160,10 @@ if ($view!='simple') { '</ul>', '</div>', '<img src="', $WT_IMAGES['hline'], '" width="100%" height="3" alt="" />'; -} -?> -<!-- end menu section --> -<!-- begin content section --> -<div id="content"> + // Display feedback from asynchronous actions + foreach (Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->getMessages() as $message) { + echo '<p class="ui-state-highlight">', $message, '</p>'; + } + echo '</div>'; // <div id="header"> +} +echo '<div id="content">'; diff --git a/themes/webtrees/header.php b/themes/webtrees/header.php index a71b7e7f84..249e6093dd 100644 --- a/themes/webtrees/header.php +++ b/themes/webtrees/header.php @@ -120,7 +120,11 @@ if ($view!='simple') { echo '</ul>', // <ul id="main-menu"> '</div>', // <div id="topMenu"> - '<img src="', $WT_IMAGES['hline'], '" width="100%" height="3" alt="" />', - '</div>', // <div id="header"> - '<div id="content">'; + '<img src="', $WT_IMAGES['hline'], '" width="100%" height="3" alt="" />'; + // Display feedback from asynchronous actions + foreach (Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->getMessages() as $message) { + echo '<p class="ui-state-highlight">', $message, '</p>'; + } + echo '</div>'; // <div id="header"> } +echo '<div id="content">'; diff --git a/themes/xenea/header.php b/themes/xenea/header.php index 697edf0f22..1ff780de98 100644 --- a/themes/xenea/header.php +++ b/themes/xenea/header.php @@ -150,6 +150,11 @@ if ($view!='simple') { // Use "simple" headers for popup windows echo '</ul>', // <ul id="main-menu"> '</div>', // <div id="topMenu"> - '<img src="', $WT_IMAGES['hline'], '" width="100%" height="3" alt="" />', - '<div id="content">'; + '<img src="', $WT_IMAGES['hline'], '" width="100%" height="3" alt="" />'; + // Display feedback from asynchronous actions + foreach (Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->getMessages() as $message) { + echo '<p class="ui-state-highlight">', $message, '</p>'; + } + echo '</div>'; // <div id="header"> } +echo '<div id="content">'; |
