hello,
iam currently writing a module where users can send messages to other users. now i have a problem. after submitting a form, the forwarding to confirmation page or other doesn't work, the system always does his job and reloads the current page.
for example the ReadMessage page, where a message could be read:
at the bottom of the page you can submit the page with reply, back and delete. by clicking on reply i want to redirect to WriteMessage - doesn't work, he always loads the ReadMessage page with current message.
the variable $redirect is set, so the block
else {
$results['delegate']['view'] = 'message.ReadMessage';
}
will not be reached.
class ReadMessageController extends GalleryController {
function handleRequest($form) {
$redirect = $status = $error = array();
if (isset($form['action']['reply'])) {
$redirect['view'] = 'message.WriteMessage';
} else if (isset($form['action']['back'])) {
$redirect['view'] = 'message.MessageInbox';
} else if (isset($form['action']['delete'])) {
$redirect['view'] = 'message.DeleteMessage';
}
// Prepare our results \\
if (!empty($redirect)) {
$results['return'] = 1;
$results['redirect'] = $redirect;
} else {
$results['delegate']['view'] = 'message.ReadMessage';
}
$results['status'] = $status;
$results['error'] = $error;
return array(null, $results);
}
}
/**
* This view shows the message
*
* @package message
*/
class ReadMessageView extends GalleryView {
/**
* @see GalleryView::loadTemplate
*/
function loadTemplate(&$template, &$form) {
global $gallery;
...
...
...
Posts: 26
set $results['return'] = 0
Posts: 26
does anybody know, if it's possible to delegate to a controller instead of a view, like
$redirect['controller'] = 'message.DeleteMessage';
(doesn't work)
Posts: 26