zend framework redirector->gotoUrl() with target=_blank - zend-framework

On submitting a form I want to sent my visitor to an external url to do something but hope he will continue browsing my site afterwards. In html I would give him that opportunity with href="http://www.example.com" target="_blank".
But I cannot find how to do that when I do:
$this->_helper->redirector->gotoUrl('http://www.example.com');
within my controller action. Nothing found in Google, documentation nor SO. Is it just not possible?

Not possible. You can't tell the browser what to do in this scenario.

You can achieve that effect with the help of Javascript:
submit the form
on success, open a new tab with the external page with JS
redirect to a new location within your app on the old tab

It is possible now:
$link = new PTA_Link();
$link->setTarget('_blank');

Related

Dirrect way to get content of current open page into main.js file in FireFox add-on sdk

I have one problem with add-on Firefox sdk. I'm searching a way to get content of current working page into main.js file. The application is based on widget that open popup when is clicked. I have one idea. To inject content script into open with sdk/page-worker and this content script using port API (self.port.emit) to trigger event and pass document.body.innerHTML. Like this:
self.port.emit("getCurrentPageHtml", document.body.innerHTML);
And into main.js file:
popupName.port.on("getCurrentPageHtml", function (receivedHtml) {
// handle received html
});
But will be very good idea if there is some direct API and avoid this communication.
I would appreciate any advice and tips.
Best regards.
I answer my own question for the second time today. Pity. Apparently there is no direct way to do this. So we can listen for panel event with popuVar.port.on. After this we can use:
// must be required tab api
// https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/tabs
tabs.activeTab.url
and use page-worker on this url https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/page-worker. After this content script of this page worker will trigger event to get html of page. Another option is just made request to url of current page.

Facebook like button redirection?

I tried to install Facebook Like Button (http://developers.facebook.com/docs/reference/plugins/like/) on my page but after I've put the code (HTML5 version) there is some strange redirect which change address of the page adding "_FB_f2af6423b6fd064xd_action=proxy_ready&data" to it?
Do you have any idea what may cause the problem?
I can install iframe version of like box but some time ago I received an information about similar problem while there was some toolbar installed in the web browser. String in url was different but result the same - error 404.
You can see the problem here: www.keeeper.voyagersblog.com/en/ and properly working page (without like button) here: www.bea.trvblog.com/en/ .
Thank you for help!
Best regards,
Bartek
The problem was that I have my own js EventListener called 'message' and it seems that facebook use the same name.
My event listener is fired by fb script and then my function makes redirect (params are not proper so it goes nowewhere).
When I changed listener name it's ok, it seems that it's fb bug.
Thank you anyway!

Facebook App to Redirect to an external website

I am trying to get an App to redirect to an external website. I have found a company who has done it (See image). If you type in their name "Safarinow" the first result comes up which is an App. When you click the app you get redirected to "http://www.safarinow.com".
Would anyone know how to achieve this?
p.s. I am not actually a developer but rather a Social media manager so I have a limited understanding of coding etc. I have just been asked to find out how to do this for the lazy dev team.
Thanks in advance
That could be done by using Javascript in your application iframe. That javascript can change the top-url like that:
window.top.location = 'http://www.my-website.com/';
You just have to run this code when your website is loaded. For example by using jQuery:
jQuery(window).load(function() { window.top.location = 'http://www.my-website.com/'; });

How To stream.publish Within a Profile Tab

I have successfully setup an iFrame based App using the Javascript SDK, and we are trying to enable it on a Page Tab.
It seems Facebook has changed some things lately, because the app breaks when added to the Page Tab. I even went as far as making sure that all external scripts were included in the main index.php file, and that the body tags were taken out.
No, I'm trying to find out if it is even possible to use methods such as the stream.publish within a Profile Tab at all.
It seems like it isn't. As far as I can tell, you can no longer use any social methods on the Profile Tab.
Here were two related articles on the subject:
insidefacebook.com/2010/08/19/facebook-moving-toward-iframes-over-fbml-for-canvas-apps-and-page-tabs/
-and-
developers.facebook.com/roadmap
If anyone can confirm or deny this, it would be a huge help. The Facebook docs are just all over the place.
Here's a link to the working App Canvas as it stands now: http://apps.facebook.com/votetesting/
I know that on tab pages, you cannot do any JS until the user clicks on something first. Maybe that is the problem.
-Roozbeh

Facebook - serverfbml form action must be within the application's connect url

I am not sure, I am using a pretty standard piece of code for facebook. It sends requests for people regarding my application. All of a sudden I am receiving this error:
serverfbml form action must be within
the application's connect url
Have you been having problems with using either one of these:
fb:serverFbml
fb:request-form
fb:req-choice
fb:multi-friend-selector
thank you!
I don't know if you managed to find a solution yet, but I will tell you what my solution is. The action attribute of your forms should NOT be relative URLs, that is you should give the full URL of the website where the application is hosted:
fb:editor action="http://www.mydomain.com/myapp/index.php?params=1" labelwidth="100"
Use the canvas URL under Facebook Integration section in your application's edit mode.
If your canvas URL looks like this:
http://www.example.com/myfacebookapp/
then, in server fbml form action, the URL MUST be in the same directory of your canvas, like this:
(using the example of
<fb:request-form action="http://www.example.com/myfacebookapp/somepage.html"
Also, if the whole contains blank spaces i.e.
http://www.example.com/myfacebookapp new/
consider eliminate that blanks, or use %20 instead of the blank when you specify the URL canvas on Facebook and when you use that URL in form
<fb:request-form action="http://www.example.com/myfacebookapp%20new/somepage.html"
I solved it finally.
Dont get messed up with all type of setting.
Simply go to your facebook app
click edit app button
now copy Canvas URL
and paste it under
<fb:request-form action="CANVAS URL HERE"
method="POST">
Well, it worked for me.!
Thanks to "tsegaye"
i had the same issue.. i used the canvas url in the summary page and it worked. You can try it out aswell
This is not the solution. If you do this, when user clicks "skip" on the dialog, he would be send to http://www.mydomain.com/myapp/index.php?params=1" instead of your application.
The solution is:
action="http://apps.facebook.com/myapp/" -> this "/" at the end would help.
It could be also any other action inside your app for example:
action="http://apps.facebook.com/myapp/sendRequest"
This solution works if you use friend selectors outside the scope of sending requests. For eg. Selecting friends to collaborate with in your app.
Not an answer but this is what helped me. I have a iframe based application and i tried to use the facebook iframe based friend invite code. In my action, i put the app.facebook.com/myapp/ url which whould be give me this fbml error
serverfbml form action must be within the application's connect url
Also when i pressed "skip" it would take me to a 404 error. The solution was to use the canvas url under facebook integration, as suggested by #tsegaye