Module | PortalHelper
In: | app/helpers/portal_helper.rb

ポータルのヘルパーを与える。

### Methods

group_table jump layout_box link_to_config_close link_to_portlet_config portlet_table

### Public Instance methods

group_table(members, portlets, size)

ポートレットのグループの一覧を返す。

[Source]

        # File app/helpers/portal_helper.rb, line 57
    57:   def group_table(members, portlets, size)
    58:     @groups.map do |group|
    59:       if group.fit?(size)
    60:         x = link_to_remote(h(group.name), {
    61:                              :url => {:action => "portlettable_members", :group_id => group.id},
    62:                              :update => members,
    63:                              :complete => "Sortable.create('#{members}', {onUpdate: function(container){}, dropOnEmpty: true, containment: ['#{members}', '#{portlets}'], constraint: false})",
    64:                            }, {
    65: #                             :id => "portlettable_group_#{group.id}",
    66:                              :class => "portlettable_group"
    67:                            })
    68:         "<li>#{x}</li>"
    69:       end
    70:     end.join
    71:   end

jump(portlet)

ポートレットから各画面に遷移するリンクを返す。

[Source]

        # File app/helpers/portal_helper.rb, line 4
     4:   def jump(portlet)
     5:     menu = portlet.portlettable
     6:     html_options = {
     7:       :class => "link_m reloadable_link button",
     8:     }
     9:     if menu.respond_to?(:with_ajax?) && menu.with_ajax?
    10:       html_options[:onclick] = "return onMenu(#{menu.id})"
    11:       link_to h(s_("Portal|Jump")), menu.url_options, html_options
    12:     else
    13:       link_to h(s_("Portal|Jump")), {:controller => "menu", :action => "index"}, html_options
    14:     end
    15:   end

layout_box()

ポータルのレイアウトを設定する部品を返す。

[Source]

        # File app/helpers/portal_helper.rb, line 33
    33:   def layout_box
    34:     onclick = "if (this.checked) {\nnew Ajax.Request('\#{url_for(:action => \"update_pattern\")}?pattern=' + this.value, {\nonSuccess: function() {\ndocument.getElementsByClassName('portal_config_pane').each(function(x) {\nv = x.id.match(/^portal_config_pane_([abc])$/);\nnew Ajax.Updater(x, '\#{url_for(:action => \"pane\")}?pane=' + v[1], {\nevalScripts: true\n});\n})\n}\n});\n}\n"
    35:     Portal::LABEL_PATTERN.map do |label, pattern|
    36:       radio_button_tag_with_label("foo", pattern, label, (pattern == @portal.pattern), {
    37:                                     :onclick => onclick
    38:                                   })
    39:     end.join
    40:   end

link_to_config_close(x)

ポータルの設定を閉じるリンクを返す。

[Source]

        # File app/helpers/portal_helper.rb, line 25
    25:   def link_to_config_close(x)
    26:     link_to_remote(h(s_("button|Close")), {
    27:                      :update => "view_m",
    28:                      :url => {:action => "index", :id => @portal.id}
    29:                    }, {:class => "button"})
    30:   end

link_to_portlet_config(portlet)

ポートレットの設定へのリンクを返す。

[Source]

        # File app/helpers/portal_helper.rb, line 18
    18:   def link_to_portlet_config(portlet)
    19:     link_to_view_motion(h(s_("Portal|Config")), "pconfig", portlet.id,
    20:                         {}, {:action => "portlet_config", :id => @portal.id, :portlet_id => portlet.id},
    21:                         :class => "button")
    22:   end

portlet_table(pane)

グループごとのポートレットの一覧を返す。

[Source]

        # File app/helpers/portal_helper.rb, line 74
    74:   def portlet_table(pane)
    75:     i = Portal::POSITION[pane] - 1
    76:     return unless @current_panes[i]
    77:     @current_panes[i].portlets.map do |portlet|
    78:       content_tag(:li, h(portlet.title), :id => "portlet_#{portlet.id}")
    79:     end.join
    80:   end

[Validate]