25
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Redmine PluginのViewの拡張ポイント(View hook)がどこにあるか?を列挙する

Posted at

これは何?

RedmineのPluginでは、Hookと呼ばれる既存のRedmineへの拡張ポイントを定義できる。
Hookは、Controller hooks、Helper hooks、Model hooksの4種類ある。
詳しくは、公式Wiki参照ください。

今回は、View hooksのみに着目して拡張ポイントがどこにあるかを解説する。

拡張ポイントの一覧

公式Wikiによると45箇所ある。一覧にある「:"view_custom_fields_form_{@custom_field.type.to_s.underscore}"」を除いた44箇所がどこにあるか列挙してみた。画像では44箇所すべて網羅できていないかも・・・。そして黒文字にしてしまったので、見づらい。

Redmine1.png
Redmine2.png
Redmine3.png
Redmine4.png
Redmine5.png
Redmine6.png
Redmine7.png
Redmine8.png
Redmine9.png
Redmine10.png
Redmine11.png
Redmine12.png

試したコード

FooHook

class FooHook < Redmine::Hook::ViewListener
  def view_account_left_bottom(context={})
    html = ''
    html << '<p><b>view_account_left_bottom</b></p>'
    return html
  end


  def view_account_right_bottom(context={})
    html = ''
    html << '<p><b>view_account_right_bottom</b></p>'
    return html
  end


  def view_account_login_top(context={})
    html = ''
    html << '<p><b>view_account_login_top</b></p>'
    return html
  end


  def view_account_login_bottom(context={})
    html = ''
    html << '<p><b>view_account_login_bottom</b></p>'
    return html
  end


  def view_custom_fields_form_upper_box(context={})
    html = ''
    html << '<p><b>view_custom_fields_form_upper_box</b></p>'
    return html
  end


  def view_issue_statuses_form(context={})
    html = ''
    html << '<p><b>view_issue_statuses_form</b></p>'
    return html
  end


  def view_issues_bulk_edit_details_bottom(context={})
    html = ''
    html << '<p><b>view_issues_bulk_edit_details_bottom</b></p>'
    return html
  end


  def view_issues_edit_notes_bottomAppends(context={})
    html = ''
    html << '<p><b>view_issues_edit_notes_bottomAppends</b></p>'
    return html
  end


  def view_issues_form_details_bottom(context={})
    html = ''
    html << '<p><b>view_issues_form_details_bottom</b></p>'
    return html
  end


  def view_issues_history_journal_bottom(context={})
    html = ''
    html << '<p><b>view_issues_history_journal_bottom</b></p>'
    return html
  end


  def view_issues_show_details_bottom(context={})
    html = ''
    html << '<p><b>view_issues_show_details_bottom</b></p>'
    return html
  end


  def view_issues_sidebar_issues_bottom(context={})
    html = ''
    html << '<p><b>view_issues_sidebar_issues_bottom</b></p>'
    return html
  end


  def view_issues_sidebar_planning_bottom(context={})
    html = ''
    html << '<p><b>view_issues_sidebar_planning_bottom</b></p>'
    return html
  end


  def view_issues_sidebar_queries_bottom(context={})
    html = ''
    html << '<p><b>view_issues_sidebar_queries_bottom</b></p>'
    return html
  end


  def view_issues_context_menu_start(context={})
    html = ''
    html << '<p><b>view_issues_context_menu_start</b></p>'
    return html
  end


  def view_issues_context_menu_end(context={})
    html = ''
    html << '<p><b>view_issues_context_menu_end</b></p>'
    return html
  end


  def view_issues_new_top(context={})
    html = ''
    html << '<p><b>view_issues_new_top</b></p>'
    return html
  end


  def view_issues_show_description_bottom(context={})
    html = ''
    html << '<p><b>view_issues_show_description_bottom</b></p>'
    return html
  end


  def view_issues_move_bottom(context={})
    html = ''
    html << '<p><b>view_issues_move_bottom</b></p>'
    return html
  end


  def view_journals_notes_form_after_notes(context={})
    html = ''
    html << '<p><b>view_journals_notes_form_after_notes</b></p>'
    return html
  end


  def view_journals_update_rjs_bottom(context={})
    html = ''
    html << '<p><b>view_journals_update_rjs_bottom</b></p>'
    return html
  end


  def view_layouts_base_body_bottom(context={})
    html = ''
    html << '<p><b>view_layouts_base_body_bottom</b></p>'
    return html
  end


  def view_layouts_base_content(context={})
    html = ''
    html << '<p><b>view_layouts_base_content</b></p>'
    return html
  end


  def view_layouts_base_html_head(context={})
    html = ''
    html << '<p><b>view_layouts_base_html_head</b></p>'
    return html
  end


  def view_layouts_base_sidebar(context={})
    html = ''
    html << '<p><b>view_layouts_base_sidebar</b></p>'
    return html
  end


  def view_my_account(context={})
    html = ''
    html << '<p><b>view_my_account</b></p>'
    return html
  end


  def view_my_account_contextual(context={})
    html = ''
    html << '<p><b>view_my_account_contextual</b></p>'
    return html
  end


  def view_projects_form(context={})
    html = ''
    html << '<p><b>view_projects_form</b></p>'
    return html
  end


  def view_projects_roadmap_version_bottom(context={})
    html = ''
    html << '<p><b>view_projects_roadmap_version_bottom</b></p>'
    return html
  end


  def view_projects_settings_members_table_header(context={})
    html = ''
    html << '<p><b>view_projects_settings_members_table_header</b></p>'
    return html
  end


  def view_projects_settings_members_table_row(context={})
    html = ''
    html << '<p><b>view_projects_settings_members_table_row</b></p>'
    return html
  end


  def view_projects_show_left(context={})
    html = ''
    html << '<p><b>view_projects_show_left</b></p>'
    return html
  end


  def view_projects_show_right(context={})
    html = ''
    html << '<p><b>view_projects_show_right</b></p>'
    return html
  end


  def view_projects_show_sidebar_bottom(context={})
    html = ''
    html << '<p><b>view_projects_show_sidebar_bottom</b></p>'
    return html
  end


  def view_repositories_show_contextual(context={})
    html = ''
    html << '<p><b>view_repositories_show_contextual</b></p>'
    return html
  end


  def view_timelog_edit_form_bottom(context={})
    html = ''
    html << '<p><b>view_timelog_edit_form_bottom</b></p>'
    return html
  end


  def view_settings_general_form(context={})
    html = ''
    html << '<p><b>view_settings_general_form</b></p>'
    return html
  end


  def view_users_memberships_table_header(context={})
    html = ''
    html << '<p><b>view_users_memberships_table_header</b></p>'
    return html
  end


  def view_users_memberships_table_row(context={})
    html = ''
    html << '<p><b>view_users_memberships_table_row</b></p>'
    return html
  end


  def view_users_form(context={})
    html = ''
    html << '<p><b>view_users_form</b></p>'
    return html
  end


  def view_versions_show_bottom(context={})
    html = ''
    html << '<p><b>view_versions_show_bottom</b></p>'
    return html
  end


  def view_versions_show_contextual(context={})
    html = ''
    html << '<p><b>view_versions_show_contextual</b></p>'
    return html
  end


  def view_welcome_index_left(context={})
    html = ''
    html << '<p><b>view_welcome_index_left</b></p>'
    return html
  end


  def view_welcome_index_right(context={})
    html = ''
    html << '<p><b>view_welcome_index_right</b></p>'
    return html
  end
end

25
23
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
25
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?