Created
March 8, 2012 06:48
-
-
Save robyurkowski/1999257 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generates the link to determine where the site bar switch button returns to. | |
def site_bar_switch_link(html_options = {}) | |
if admin? ? admin_switch_link(html_options) : frontend_switch_link(html_options) | |
end | |
def admin_switch_link(html_options = {}) | |
link_to t('.switch_to_your_website', site_bar_translate_locale_args), | |
session[:website_return_to] || refinery.root_path(:locale => (Refinery::I18n.default_frontend_locale if Refinery.i18n_enabled?)), | |
html_options | |
end | |
def frontend_switch_link(html_options = {} | |
link_to t('.switch_to_your_website_editor', site_bar_translate_locale_args), | |
(session[:refinery_return_to].present? ? session[:refinery_return_to] ? refinery.admin_root_path) rescue refinery.admin_root_path, | |
html_options | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment