|
|
|
Messages ABOVE component heading
|
|
Date: 2008/08/10 13:03
|
By: vilo
|
Status:
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 13 |   | |
|
Guys, I love your instant messenger. It works seamlessly with Community Builder and it's easily customizable... except for one little part for which I am pulling my hair out trying to get around. Messages like "Reply sent and original message moved to trash" are ABOVE the component heading using uddeJSEFredirect to send the message to mosRedirect. It completely breaks the visual design. To keep things consistent, component header should be always on the TOP of the page. No message should appear above it. The way uddeIM 1.2 is done, anytime there is message like "Message sent" the whole component header moves down and message appears above it.
Worst, I don't see any way around it without rewriting the whole logic of how pages are submitted. Would you know of any way how to get around this problem? Is there a way to move post-action messages BELOW the component header? (Maybe to the empty space to the right of the menu icons?)
Any help would be much appreciated. I know that each of us has limited time, but if there is solution to this problem, please be so kind and let me know.
thank you
|
|
The administrator has disabled public write access. |
|
|
|
Re:Messages ABOVE component heading
|
|
Date: 2008/08/10 19:41
|
By: slabbi
|
Status:
|
|
|
Karma: 69  
|
|
Moderator  | Posts: 1172 |   | |
|
The only way to fix this for your template is to remove the text manually.
Maybe you can change the uddeJSEFredirect function, so that no text is passed to mosRedirect. uddeIM Development CB Language Workgroup CB 3rd Party Developer
|
|
The administrator has disabled public write access. |
|
|
|
|
Re:Messages ABOVE component heading
|
|
Date: 2008/08/10 21:56
|
By: vilo
|
Status:
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 13 |   | |
|
slabbi wrote: The only way to fix this for your template is to remove the text manually.
Maybe you can change the uddeJSEFredirect function, so that no text is passed to mosRedirect.
Thanks for the quick reply.
This is what I ended up doing and it wasn't that difficult.
in "components/com_uddeim/includes.php" I altered two functions, uddeJredirect and uddeJSEFredirect as follows
FROM:
| Code: |
function uddeJredirect($url, $msg='') {
global $mainframe;
$redirecturl = $url;
if ( class_exists('JRoute') ) {
$mainframe->redirect( $redirecturl, JText::_($msg) );
}
mosRedirect( $redirecturl, $msg );
}
function uddeJSEFredirect($url, $msg='') {
global $mainframe;
if ( class_exists('JRoute') ) {
$redirecturl = JRoute::_($url, false);
$mainframe->redirect( $redirecturl, JText::_($msg) );
}
$redirecturl = sefRelToAbs($url);
mosRedirect( $redirecturl, $msg);
}
|
TO:
| Code: |
function uddeJredirect($url, $msg='') {
global $mainframe;
$redirecturl = $url;
if ( class_exists('JRoute') ) {
$mainframe->redirect( $redirecturl, JText::_($msg) );
}
//added
if (trim( $redirecturl )) {
if (strpos( $url, '?' )) {
$redirecturl .= '&nomosmsg=' . $msg ;
} else {
$redirecturl .= '?nomosmsg=' . $msg ;
}
}
//added end
//mosRedirect( $redirecturl, $msg );//org
mosRedirect( $redirecturl);//changed
}
function uddeJSEFredirect($url, $msg='') {
global $mainframe;
if ( class_exists('JRoute') ) {
$redirecturl = JRoute::_($url, false);
$mainframe->redirect( $redirecturl, JText::_($msg) );
}
$redirecturl = sefRelToAbs($url);
//added
if (trim( $redirecturl )) {
if (strpos( $url, '?' )) {
$redirecturl .= '&nomosmsg=' . $msg ;
} else {
$redirecturl .= '?nomosmsg=' . $msg ;
}
}
//added end
//mosRedirect( $redirecturl, $msg);//org
mosRedirect( $redirecturl);//changed
}
|
and then added at the bottom of the function print_uddemenu in the same includes.php file this snippet to display the message within the menu
As you see I added some table formating too for nicely displaying the message on the right side. Top of this table is not shown in the snippet.
>> I tried to post that snippet here for 20 times but joomlaboard is generating error with that snipped and is not letting me to submit this post. It seems that any attempt to use GET var will kill the message, even if I put it in the code tags.<<
The whole difference was not sending $msg from uddeJredirect and uddeJSEFredirect to mosRedirect, and rather append to url our own message in "nomosmsg" and then getting it after submission from GET "nomosmsg".
It wasn't that hard after all. Thanks again.
Post edited by: vilo, at: 2008/08/10 22:09
|
|
The administrator has disabled public write access. |
|
|
|
Re:Messages ABOVE component heading
|
|
Date: 2008/08/10 22:19
|
By: slabbi
|
Status:
|
|
|
Karma: 69  
|
|
Moderator  | Posts: 1172 |   | |
|
Be careful: Your code is NOT safe against XSS attacks and maybe other attacks! Please do not use _GET to receive the text! uddeIM Development CB Language Workgroup CB 3rd Party Developer
|
|
The administrator has disabled public write access. |
|
|
|
|
Re:Messages ABOVE component heading
|
|
Date: 2008/08/24 02:11
|
By: vilo
|
Status:
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 13 |   | |
|
slabbi wrote: Be careful: Your code is NOT safe against XSS attacks and maybe other attacks! Please do not use _GET to receive the text!
Thanks for pointing that out. I changed it to:
| Code: | echo stripslashes( strval( mosGetParam( $ _GET, 'nomosmsg', '' ) ) );
|
|
|
The administrator has disabled public write access. |
|
|