Sha256: 2b073c2257b664bb8664d12e4a1a3db89e6c5450750a2da303726f9fc3d3a6be

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

module Refinery
  module Helpers
    module SiteBarHelper

      # Generates the link to determine where the site bar switch button returns to.
      def site_bar_switch_link
        link_to_if(admin?, t('.switch_to_your_website'),
                  (if session.keys.include?(:website_return_to) and session[:website_return_to].present?
                    session[:website_return_to]
                   else
                    root_url(:only_path => true)
                   end)) do
          link_to t('.switch_to_your_website_editor'),
                  (if session.keys.include?(:refinery_return_to) and session[:refinery_return_to].present?
                    session[:refinery_return_to]
                   elsif defined?(@page) and @page.present? and !@page.home?
                     edit_admin_page_url(@page, :only_path => true)
                   else
                     (request.fullpath.to_s == '/') ? admin_root_url(:only_path => true) : "/admin#{request.request_uri}/edit"
                   end rescue admin_root_url(:only_path => true))
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
refinerycms-0.9.8.4 vendor/refinerycms/core/lib/refinery/helpers/site_bar_helper.rb
refinerycms-0.9.8.3 vendor/refinerycms/core/lib/refinery/helpers/site_bar_helper.rb
refinerycms-0.9.8.2 vendor/refinerycms/core/lib/refinery/helpers/site_bar_helper.rb
refinerycms-0.9.8.1 vendor/refinerycms/core/lib/refinery/helpers/site_bar_helper.rb