From 777734243401d64ffde78ae30f058016d285bd4d Mon Sep 17 00:00:00 2001 From: argiepiano Date: Sun, 22 May 2022 21:54:40 -0600 Subject: [PATCH 1/8] Issue #102. Provide demo group and group content. --- ...mment.comment_node_group.comment_body.json | 33 ++ ...mment_node_group_content.comment_body.json | 33 ++ .../field.instance.node.group.body.json | 44 +++ ...ield.instance.node.group_content.body.json | 44 +++ og_demo/config/layout.layout.groups.json | 288 ++++++++++++++++++ og_demo/config/node.type.group.json | 50 +++ og_demo/config/node.type.group_content.json | 50 +++ .../config/views.view.og_content_demo.json | 175 +++++++++++ og_demo/config/views.view.og_groups_demo.json | 176 +++++++++++ og_demo/og_demo.info | 9 + og_demo/og_demo.install | 121 ++++++++ og_demo/og_demo.module | 1 + 12 files changed, 1024 insertions(+) create mode 100644 og_demo/config/field.instance.comment.comment_node_group.comment_body.json create mode 100644 og_demo/config/field.instance.comment.comment_node_group_content.comment_body.json create mode 100644 og_demo/config/field.instance.node.group.body.json create mode 100644 og_demo/config/field.instance.node.group_content.body.json create mode 100644 og_demo/config/layout.layout.groups.json create mode 100644 og_demo/config/node.type.group.json create mode 100644 og_demo/config/node.type.group_content.json create mode 100644 og_demo/config/views.view.og_content_demo.json create mode 100644 og_demo/config/views.view.og_groups_demo.json create mode 100644 og_demo/og_demo.info create mode 100644 og_demo/og_demo.install create mode 100644 og_demo/og_demo.module diff --git a/og_demo/config/field.instance.comment.comment_node_group.comment_body.json b/og_demo/config/field.instance.comment.comment_node_group.comment_body.json new file mode 100644 index 00000000..aa284abf --- /dev/null +++ b/og_demo/config/field.instance.comment.comment_node_group.comment_body.json @@ -0,0 +1,33 @@ +{ + "_config_name": "field.instance.comment.comment_node_group.comment_body", + "field_name": "comment_body", + "label": "Comment", + "entity_type": "comment", + "bundle": "comment_node_group", + "settings": { + "text_processing": 1, + "user_register_form": false + }, + "required": true, + "display": { + "default": { + "label": "hidden", + "type": "text_default", + "weight": 0, + "settings": [], + "module": "text" + } + }, + "description": "", + "deleted": 1, + "default_value": null, + "default_value_function": null, + "widget": { + "type": "text_textarea", + "settings": { + "rows": 5 + }, + "weight": 0, + "module": "text" + } +} diff --git a/og_demo/config/field.instance.comment.comment_node_group_content.comment_body.json b/og_demo/config/field.instance.comment.comment_node_group_content.comment_body.json new file mode 100644 index 00000000..f28ed60f --- /dev/null +++ b/og_demo/config/field.instance.comment.comment_node_group_content.comment_body.json @@ -0,0 +1,33 @@ +{ + "_config_name": "field.instance.comment.comment_node_group_content.comment_body", + "field_name": "comment_body", + "label": "Comment", + "entity_type": "comment", + "bundle": "comment_node_group_content", + "settings": { + "text_processing": 1, + "user_register_form": false + }, + "required": true, + "display": { + "default": { + "label": "hidden", + "type": "text_default", + "weight": 0, + "settings": [], + "module": "text" + } + }, + "description": "", + "deleted": 0, + "default_value": null, + "default_value_function": null, + "widget": { + "type": "text_textarea", + "settings": { + "rows": 5 + }, + "weight": 0, + "module": "text" + } +} diff --git a/og_demo/config/field.instance.node.group.body.json b/og_demo/config/field.instance.node.group.body.json new file mode 100644 index 00000000..41eb1995 --- /dev/null +++ b/og_demo/config/field.instance.node.group.body.json @@ -0,0 +1,44 @@ +{ + "_config_name": "field.instance.node.group.body", + "field_name": "body", + "entity_type": "node", + "bundle": "group", + "label": "Body", + "widget": { + "type": "text_textarea_with_summary", + "settings": { + "rows": 10, + "summary_rows": 5 + }, + "weight": 1, + "module": "text" + }, + "settings": { + "display_summary": true, + "text_processing": 1, + "user_register_form": false + }, + "display": { + "default": { + "label": "hidden", + "type": "text_default", + "settings": [], + "module": "text", + "weight": 1 + }, + "teaser": { + "label": "hidden", + "type": "text_summary_or_trimmed", + "settings": { + "trim_length": 600 + }, + "module": "text", + "weight": 1 + } + }, + "description": "", + "required": 0, + "deleted": 0, + "default_value": null, + "default_value_function": null +} diff --git a/og_demo/config/field.instance.node.group_content.body.json b/og_demo/config/field.instance.node.group_content.body.json new file mode 100644 index 00000000..49771a55 --- /dev/null +++ b/og_demo/config/field.instance.node.group_content.body.json @@ -0,0 +1,44 @@ +{ + "_config_name": "field.instance.node.group_content.body", + "field_name": "body", + "entity_type": "node", + "bundle": "group_content", + "label": "Body", + "widget": { + "type": "text_textarea_with_summary", + "settings": { + "rows": 10, + "summary_rows": 5 + }, + "weight": -3, + "module": "text" + }, + "settings": { + "display_summary": true, + "text_processing": 1, + "user_register_form": false + }, + "display": { + "default": { + "label": "hidden", + "type": "text_default", + "settings": [], + "module": "text", + "weight": 1 + }, + "teaser": { + "label": "hidden", + "type": "text_summary_or_trimmed", + "settings": { + "trim_length": 600 + }, + "module": "text", + "weight": 1 + } + }, + "description": "", + "required": 0, + "deleted": 0, + "default_value": null, + "default_value_function": null +} diff --git a/og_demo/config/layout.layout.groups.json b/og_demo/config/layout.layout.groups.json new file mode 100644 index 00000000..dd8368e1 --- /dev/null +++ b/og_demo/config/layout.layout.groups.json @@ -0,0 +1,288 @@ +{ + "_config_name": "layout.layout.groups", + "path": "node/%", + "name": "groups", + "title": "Groups", + "description": null, + "renderer_name": "standard", + "module": null, + "weight": 0, + "storage": 1, + "layout_template": "moscone_flipped", + "disabled": false, + "settings": { + "title": "", + "title_display": "default", + "title_block": null + }, + "positions": { + "header": [ + "10b99618-7f18-4552-8601-1d9e3f0966ab", + "f61dff87-2ade-4fce-9c4e-78b8c0104438" + ], + "top": [ + "92337cc8-2d88-46a5-9501-1ca974967249", + "25c6d0be-f5cd-4ba6-b500-0e53cb5446bc" + ], + "content": [ + "59ffb3af-86a4-4444-8202-2ccab27e10bf", + "5d2958ef-a8ac-4bd1-a805-5d8b8d4b4780" + ], + "sidebar": [ + "f3d44959-abc1-4a31-8000-f939cefedfa1" + ], + "bottom": [], + "footer": [ + "1c6d1805-0528-48f8-bd07-7d9efdedf1b4" + ], + "title": [] + }, + "contexts": [], + "relationships": [], + "content": { + "10b99618-7f18-4552-8601-1d9e3f0966ab": { + "plugin": "system:header", + "data": { + "status": 1, + "module": "system", + "delta": "header", + "settings": { + "title_display": "default", + "title": "", + "style": "default", + "block_settings": { + "menu": "user-menu", + "logo": 1, + "site_name": 1, + "site_slogan": 1 + }, + "contexts": [] + }, + "uuid": "10b99618-7f18-4552-8601-1d9e3f0966ab", + "style": { + "plugin": "default", + "data": { + "settings": { + "classes": "" + } + } + } + } + }, + "f61dff87-2ade-4fce-9c4e-78b8c0104438": { + "plugin": "system:main-menu", + "data": { + "status": 1, + "module": "system", + "delta": "main-menu", + "settings": { + "title_display": "none", + "title": "", + "style": "default", + "block_settings": { + "style": "dropdown", + "level": 1, + "depth": 0 + }, + "contexts": [] + }, + "uuid": "f61dff87-2ade-4fce-9c4e-78b8c0104438", + "style": { + "plugin": "default", + "data": { + "settings": { + "classes": "" + } + } + } + } + }, + "92337cc8-2d88-46a5-9501-1ca974967249": { + "plugin": "system:breadcrumb", + "data": { + "status": 1, + "module": "system", + "delta": "breadcrumb", + "settings": { + "title_display": "default", + "title": "", + "style": "default", + "block_settings": [], + "contexts": [] + }, + "uuid": "92337cc8-2d88-46a5-9501-1ca974967249", + "style": { + "plugin": "default", + "data": { + "settings": { + "classes": "" + } + } + } + } + }, + "25c6d0be-f5cd-4ba6-b500-0e53cb5446bc": { + "plugin": "system:page_components:title_combo", + "data": { + "status": 1, + "module": "system", + "delta": "page_components", + "settings": { + "title_display": "default", + "title": "", + "style": "default", + "block_settings": [], + "contexts": [], + "title_tag": "h1", + "title_classes": "page-title", + "tab-type": "both", + "tab_type": "both" + }, + "uuid": "25c6d0be-f5cd-4ba6-b500-0e53cb5446bc", + "style": { + "plugin": "default", + "data": { + "settings": { + "classes": "" + } + } + } + } + }, + "59ffb3af-86a4-4444-8202-2ccab27e10bf": { + "plugin": "system:main", + "data": { + "status": 1, + "module": "system", + "delta": "main", + "settings": { + "title_display": "default", + "title": "", + "style": "default", + "block_settings": [], + "contexts": [] + }, + "uuid": "59ffb3af-86a4-4444-8202-2ccab27e10bf", + "style": { + "plugin": "default", + "data": { + "settings": { + "classes": "" + } + } + } + } + }, + "5d2958ef-a8ac-4bd1-a805-5d8b8d4b4780": { + "plugin": "views:og_content_demo-block_1", + "data": { + "status": 1, + "module": "views", + "delta": "og_content_demo-block_1", + "settings": { + "link_to_view": 0, + "more_link": false, + "use_pager": true, + "pager_id": 0, + "items_per_page": 10, + "offset": 0, + "path": null, + "fields_override": null, + "title_display": "default", + "title": "", + "style": "default", + "block_settings": [], + "contexts": [], + "allowed": [], + "path_override": false, + "exposed": [], + "admin_label": "", + "admin_description": "" + }, + "uuid": "5d2958ef-a8ac-4bd1-a805-5d8b8d4b4780", + "style": { + "plugin": "default", + "data": { + "settings": { + "classes": "" + } + } + } + } + }, + "f3d44959-abc1-4a31-8000-f939cefedfa1": { + "plugin": "views:og_groups_demo-block", + "data": { + "status": 1, + "module": "views", + "delta": "og_groups_demo-block", + "settings": { + "link_to_view": 0, + "more_link": false, + "use_pager": false, + "pager_id": 0, + "items_per_page": "10", + "offset": 0, + "path": "groups", + "fields_override": null, + "title_display": "custom", + "title": "All Groups", + "style": "default", + "block_settings": [], + "contexts": [], + "allowed": [], + "path_override": false, + "exposed": [], + "admin_label": "", + "admin_description": "" + }, + "uuid": "f3d44959-abc1-4a31-8000-f939cefedfa1", + "style": { + "plugin": "default", + "data": { + "settings": { + "classes": "" + } + } + } + } + }, + "1c6d1805-0528-48f8-bd07-7d9efdedf1b4": { + "plugin": "system:powered-by", + "data": { + "status": 1, + "module": "system", + "delta": "powered-by", + "settings": { + "title_display": "default", + "title": "", + "style": "default", + "block_settings": [], + "contexts": [] + }, + "uuid": "1c6d1805-0528-48f8-bd07-7d9efdedf1b4", + "style": { + "plugin": "default", + "data": { + "settings": { + "classes": "" + } + } + } + } + } + }, + "conditions": [ + { + "plugin": "node_type", + "data": { + "settings": { + "bundles": [ + "group" + ], + "load_condition_nojs": "Load condition" + } + } + } + ] +} diff --git a/og_demo/config/node.type.group.json b/og_demo/config/node.type.group.json new file mode 100644 index 00000000..5a02454f --- /dev/null +++ b/og_demo/config/node.type.group.json @@ -0,0 +1,50 @@ +{ + "_config_name": "node.type.group", + "type": "group", + "name": "Group", + "base": "node_content", + "module": "node", + "node_preview": "1", + "description": "Use to create groups. ", + "help": "", + "modified": true, + "disabled": false, + "has_title": true, + "title_label": "Title", + "settings": { + "comment_enabled": false, + "comment_default": "1", + "comment_per_page": "50", + "comment_mode": 1, + "comment_anonymous": 0, + "comment_subject_field": 0, + "comment_user_picture": true, + "comment_form_location": 1, + "comment_preview": "1", + "comment_close_enabled": 0, + "comment_close_days": "14", + "menu_default": 0, + "menu_options": { + "main-menu": "main-menu", + "user-menu": 0, + "management": 0 + }, + "menu_parent": "main-menu:0", + "status_default": 1, + "scheduling_enabled": 1, + "promote_enabled": 1, + "promote_default": 0, + "sticky_enabled": 1, + "sticky_default": 0, + "revision_enabled": 1, + "revision_default": 0, + "node_preview": "1", + "node_submitted": 0, + "node_submitted_format": "[node:created:medium] by [node:author]", + "node_user_picture": true, + "hidden_path": 0, + "language": 0, + "node_permissions": true + }, + "orig_type": "group" +} diff --git a/og_demo/config/node.type.group_content.json b/og_demo/config/node.type.group_content.json new file mode 100644 index 00000000..c2a629f2 --- /dev/null +++ b/og_demo/config/node.type.group_content.json @@ -0,0 +1,50 @@ +{ + "_config_name": "node.type.group_content", + "type": "group_content", + "name": "Group Content", + "base": "node_content", + "module": "node", + "node_preview": "1", + "description": "Use for content you would like connected to groups. ", + "help": "", + "modified": true, + "disabled": false, + "has_title": true, + "title_label": "Title", + "settings": { + "comment_enabled": false, + "comment_default": "1", + "comment_per_page": "50", + "comment_mode": 1, + "comment_anonymous": 0, + "comment_subject_field": 0, + "comment_user_picture": true, + "comment_form_location": 1, + "comment_preview": "1", + "comment_close_enabled": 0, + "comment_close_days": "14", + "menu_default": 0, + "menu_options": { + "user-menu": 0, + "management": 0, + "main-menu": 0 + }, + "menu_parent": "main-menu:0", + "status_default": 1, + "scheduling_enabled": 1, + "promote_enabled": 1, + "promote_default": 0, + "sticky_enabled": 1, + "sticky_default": 0, + "revision_enabled": 1, + "revision_default": 0, + "node_preview": "1", + "node_submitted": 0, + "node_submitted_format": "[node:created:medium] by [node:author]", + "node_user_picture": true, + "hidden_path": 0, + "language": 0, + "node_permissions": true + }, + "orig_type": "group_content" +} diff --git a/og_demo/config/views.view.og_content_demo.json b/og_demo/config/views.view.og_content_demo.json new file mode 100644 index 00000000..7cda626a --- /dev/null +++ b/og_demo/config/views.view.og_content_demo.json @@ -0,0 +1,175 @@ +{ + "_config_name": "views.view.og_content_demo", + "name": "og_content_demo", + "description": "Show all content (nodes) of a group.", + "tag": "og", + "disabled": false, + "base_table": "node", + "human_name": "OG content (demo)", + "core": "1", + "display": { + "default": { + "display_title": "Defaults", + "display_plugin": "default", + "display_options": { + "query": { + "type": "views_query", + "options": { + "query_comment": false + } + }, + "access": { + "type": "none" + }, + "cache": { + "type": "none" + }, + "exposed_form": { + "type": "basic" + }, + "pager": { + "type": "full" + }, + "style_plugin": "default", + "row_plugin": "node", + "row_options": { + "links": 1, + "comments": 0 + }, + "empty": { + "area": { + "id": "area", + "table": "views", + "field": "area", + "empty": false, + "content": "There is no content in this group." + } + }, + "relationships": { + "og_membership_rel": { + "id": "og_membership_rel", + "table": "node", + "field": "og_membership_rel", + "required": 0 + } + }, + "sorts": { + "created": { + "id": "created", + "table": "node", + "field": "created", + "order": "DESC" + } + }, + "arguments": { + "gid": { + "id": "gid", + "table": "og_membership", + "field": "gid", + "relationship": "og_membership_rel", + "group_type": "group", + "ui_name": "", + "default_action": "default", + "exception": { + "value": "all", + "title_enable": 0, + "title": "All" + }, + "title_enable": 0, + "title": "", + "breadcrumb_enable": 0, + "breadcrumb": "", + "default_argument_type": "og_context", + "default_argument_options": { + "group_type": "node", + "check_access": "1" + }, + "default_argument_skip_url": 0, + "summary_options": { + "base_path": "", + "count": "1", + "items_per_page": "25", + "override": 0 + }, + "summary": { + "sort_order": "asc", + "number_of_records": "0", + "format": "default_summary" + }, + "specify_validation": 1, + "validate": { + "type": "og", + "fail": "not found" + }, + "validate_options": { + "group_type": "node" + }, + "break_phrase": 0, + "not": 0 + } + }, + "filters": { + "status": { + "id": "status", + "table": "node", + "field": "status", + "value": "1" + }, + "group_type": { + "id": "group_type", + "table": "og_membership", + "field": "group_type", + "relationship": "none", + "group_type": "group", + "ui_name": "", + "operator": "in", + "value": { + "node": "node" + }, + "group": "1", + "exposed": false, + "expose": { + "operator_id": false, + "label": "", + "description": "", + "use_operator": false, + "operator": "", + "identifier": "", + "required": false, + "remember": false, + "multiple": false, + "remember_roles": { + "authenticated": "authenticated" + }, + "reduce": false + }, + "is_grouped": false, + "group_info": { + "label": "", + "description": "", + "identifier": "", + "optional": true, + "widget": "select", + "multiple": false, + "remember": 0, + "default_group": "All", + "default_group_multiple": [], + "group_items": [] + } + } + }, + "title": "" + } + }, + "block_1": { + "display_title": "Block", + "display_plugin": "block", + "display_options": { + "query": { + "type": "views_query", + "options": [] + } + } + } + } +} diff --git a/og_demo/config/views.view.og_groups_demo.json b/og_demo/config/views.view.og_groups_demo.json new file mode 100644 index 00000000..9eebd859 --- /dev/null +++ b/og_demo/config/views.view.og_groups_demo.json @@ -0,0 +1,176 @@ +{ + "_config_name": "views.view.og_groups_demo", + "name": "og_groups_demo", + "description": "All groups (nodes)", + "module": "og", + "storage": 2, + "tag": "og", + "disabled": false, + "base_table": "node", + "human_name": "OG groups", + "core": "1", + "display": { + "default": { + "display_title": "Master", + "display_plugin": "default", + "display_options": { + "query": { + "type": "views_query", + "options": [] + }, + "access": { + "type": "perm", + "perm": "access content" + }, + "cache": { + "type": "none" + }, + "exposed_form": { + "type": "basic" + }, + "pager": { + "type": "some", + "options": { + "items_per_page": "10", + "offset": "0" + } + }, + "style_plugin": "default", + "row_plugin": "fields", + "fields": { + "title": { + "id": "title", + "table": "node", + "field": "title", + "label": "", + "alter": { + "alter_text": 0, + "make_link": 0, + "absolute": 0, + "trim": 0, + "word_boundary": 0, + "ellipsis": 0, + "strip_tags": 0, + "html": 0 + }, + "hide_empty": 0, + "empty_zero": 0, + "link_to_node": 1 + } + }, + "filters": { + "status": { + "value": 1, + "table": "node", + "field": "status", + "id": "status", + "expose": { + "operator": false + }, + "group": 1 + }, + "group_group_value": { + "id": "group_group_value", + "table": "field_data_group_group", + "field": "group_group_value", + "relationship": "none", + "group_type": "group", + "ui_name": "", + "operator": "or", + "value": { + "1": "1" + }, + "group": "1", + "exposed": false, + "expose": { + "operator_id": false, + "label": "", + "description": "", + "use_operator": false, + "operator": "", + "identifier": "", + "required": false, + "remember": false, + "multiple": false, + "remember_roles": { + "authenticated": "authenticated" + }, + "reduce": false + }, + "is_grouped": false, + "group_info": { + "label": "", + "description": "", + "identifier": "", + "optional": true, + "widget": "select", + "multiple": false, + "remember": 0, + "default_group": "All", + "default_group_multiple": [], + "group_items": [] + }, + "reduce_duplicates": 0 + } + }, + "sorts": { + "created": { + "id": "created", + "table": "node", + "field": "created", + "order": "DESC" + } + }, + "title": "", + "filter_groups": { + "operator": "AND", + "groups": { + "1": "AND" + } + }, + "style_options": { + "grouping": [], + "row_class": "", + "default_row_class": 1, + "row_class_special": 1 + } + } + }, + "block": { + "display_title": "Block", + "display_plugin": "block", + "display_options": { + "query": { + "type": "views_query", + "options": [] + }, + "field": { + "title": { + "link_to_node": 1 + } + }, + "display_description": "" + } + }, + "page_1": { + "display_title": "Page", + "display_plugin": "page", + "display_options": { + "query": { + "type": "views_query", + "options": [] + }, + "path": "groups", + "menu": { + "type": "normal", + "title": "Groups", + "description": "", + "name": "main-menu", + "weight": "0", + "context": 0, + "context_only_inline": 0 + } + } + } + } +} diff --git a/og_demo/og_demo.info b/og_demo/og_demo.info new file mode 100644 index 00000000..4774a5a2 --- /dev/null +++ b/og_demo/og_demo.info @@ -0,0 +1,9 @@ +name = Organic groups demo +description = "Add some demo content to get started." +package = "Organic groups" +backdrop = 1.x +type = module + +dependencies[] = og +dependencies[] = og_context +dependencies[] = og_ui diff --git a/og_demo/og_demo.install b/og_demo/og_demo.install new file mode 100644 index 00000000..35c6b6ea --- /dev/null +++ b/og_demo/og_demo.install @@ -0,0 +1,121 @@ + array( + 'title' => st('Theme Developers'), + 'body' => st('

This group is for folks working on new themes for Backdrop CMS.

'), + ), + 'documentation' => array( + 'title' => st('Documentation'), + 'body' => st('

A place for folks to coordinate efforts at improving Backdrop CMS documentation.

'), + ), + 'core_development' => array( + 'title' => st('Core Development'), + 'body' => st('

Join this group for the latest information about core development priorities.

'), + ), + ); + + foreach ($groups as $group_id => $info) { + $group = new Node( + array( + 'title' => $info['title'], + 'body' => array( + LANGUAGE_NONE => array( + array( + 'value' => $info['body'], + 'format' => 'filtered_html', + ), + ), + ), + 'uid' => 1, + 'status' => 1, + 'promote' => 0, + 'type' => 'group', + ) + ); + node_save($group); + $groups[$group_id]['nid'] = $group->nid; + } + + $group_content = array( + array( + 'title' => st('Refence Module in Core'), + 'body' => st('

Move the Entity Reference contrib module into core. It has been refactored to remove any external dependencies. Entity Reference is the most obvious candidate based on the following advantages:

  1. It has the highest install count.
  2. It has the most flexible API and number of extending modules.
  3. It is a proven solution and includes an upgrade path for D7 Entity Reference users.
  4. '), + 'group' => 'core_development', + ), + array( + 'title' => st('What is a theme?'), + 'body' => st('

    A theme is a collection of files which define the presentation layer of a Backdrop site. The theme determines the appearance of a site. You can also create one or more "sub-themes" or variations on a theme. Only the .info file is required, but most themes and sub-themes will use other files as well.

    On the surface, sub-themes behave just like any other theme. The only difference is that they inherit the resources from their parent themes. To create one, a "base theme" entry inside the .info file is needed. From there it will inherit the resources from its parent theme. There can be multiple levels of inheritance; i.e., a sub-theme can declare another sub-theme as its base. There are no hard set limits to this.

    '), + 'group' => 'theme_developers', + ), + array( + 'title' => st('Contribute to Documentation'), + 'body' => st('

    You can help the Backdrop community by contributing to the documentation on this site. Documentation of code is created by the API module from docblock comments within the code, so changes to code documentation are made by submitting a pull request as you would make for any other code change.

    '), + 'group' => 'documentation', + ), + array( + 'title' => st('The Backdrop CMS User Guide'), + 'body' => st('

    The User Guide is a detailed "How-To" for practically everything you need to know to create, customize, and manage a Backdrop website and is intended for people who may be new to content management systems in general and to the Backdrop CMS in particular.

    '), + 'group' => 'documentation', + ), + array( + 'title' => st('Core Developers'), + 'body' => st('

    Core developers should fight the urge to refactor, because small changes in core may result in large changes for contrib. Each major change will be weighed carefully against the principles of the project to determine if the improvements it offers are worth the cost of that change. If a decision is not immediately clear, the issue should be escalated to the Project Management Committee.

    '), + 'group' => 'core_development', + ), + array( + 'title' => st('Layouts'), + 'body' => st('

    The most important consideration when converting themes to Backdrop is the concept that your theme is no longer responsible for the layout of a site. This is because of the introduction of Layout module, Backdrop drag and drop page layout builder.

    Layout module now provides ten responsive layout templates including a multi-region stacked layout similar to what was provided in the Bartik theme for Drupal 7.

    In the Layouts interface, blocks are provided to place the site header, main navigation, search box, and so on. All these elements can be rearranged by dragging and dropping these blocks into the regions provided by the layout template.

    Porting a theme mainly now consists of the application of the old themes style to the new theme. Once this is understood, the conversion itself should be reasonably straightforward.

    '), + 'group' => 'theme_developers', + ), + ); + + foreach ($group_content as $info) { + $content = new Node( + array( + 'title' => $info['title'], + 'body' => array( + LANGUAGE_NONE => array( + array( + 'value' => $info['body'], + 'format' => 'filtered_html', + ), + ), + ), + 'og_group_ref' => array( + LANGUAGE_NONE => array( + array( + 'target_id' => $groups[$info['group']]['nid'], + ), + ), + ), + 'uid' => 1, + 'status' => 1, + 'promote' => 0, + 'type' => 'group_content', + ) + ); + node_save($content); + } + + // Update the menu router information. + menu_rebuild(); + +} diff --git a/og_demo/og_demo.module b/og_demo/og_demo.module new file mode 100644 index 00000000..b3d9bbc7 --- /dev/null +++ b/og_demo/og_demo.module @@ -0,0 +1 @@ + Date: Mon, 23 May 2022 15:22:21 -0500 Subject: [PATCH 2/8] Hiding one group from public --- og_demo/og_demo.install | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/og_demo/og_demo.install b/og_demo/og_demo.install index 35c6b6ea..7e32fb48 100644 --- a/og_demo/og_demo.install +++ b/og_demo/og_demo.install @@ -8,6 +8,9 @@ function og_demo_install() { // Create the field group_group for the content type group and set roles. og_create_field(OG_GROUP_FIELD, 'node', 'group'); + // Create the field group_access to set public/private access on groups. + og_create_field(OG_ACCESS_FIELD, 'node', 'group'); + // Create the field og_group_ref for the content type group_content and set // default roles. $og_field = og_fields_info(OG_AUDIENCE_FIELD); @@ -21,14 +24,17 @@ function og_demo_install() { 'theme_developers' => array( 'title' => st('Theme Developers'), 'body' => st('

    This group is for folks working on new themes for Backdrop CMS.

    '), + 'private' => '0', ), 'documentation' => array( 'title' => st('Documentation'), 'body' => st('

    A place for folks to coordinate efforts at improving Backdrop CMS documentation.

    '), + 'private' => '0', ), 'core_development' => array( 'title' => st('Core Development'), 'body' => st('

    Join this group for the latest information about core development priorities.

    '), + 'private' => '1', ), ); @@ -44,6 +50,13 @@ function og_demo_install() { ), ), ), + 'group_access' => array( + LANGUAGE_NONE => array( + array( + 'value' => $info['private'], + ), + ), + ), 'uid' => 1, 'status' => 1, 'promote' => 0, @@ -118,4 +131,6 @@ function og_demo_install() { // Update the menu router information. menu_rebuild(); + // Rebuild permissions + node_access_rebuild(); } From bf1ab68c108122e745dadfdc4a829033775ac042 Mon Sep 17 00:00:00 2001 From: "Tim Erickson (@stpaultim)" Date: Mon, 23 May 2022 15:45:18 -0500 Subject: [PATCH 3/8] Adding a Readme --- og_demo/README.md | 89 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 og_demo/README.md diff --git a/og_demo/README.md b/og_demo/README.md new file mode 100644 index 00000000..b931ba34 --- /dev/null +++ b/og_demo/README.md @@ -0,0 +1,89 @@ +# Organic Groups (OG) + +The Organic Groups module (also referred to as the `og` module), provides users +the ability to create, manage, and delete their own 'groups' on a site. +Each group can have members, and maintains a group home page which individual +group members may post into. Posts can be sent to multiple groups (i.e. cross- +posted), and individual posts (referred as 'group content') may be shared with +members, or non-members where necessary. Group membership can be open, closed +or moderated. + +## Dependencies + +- Entity Plus +- Entity UI +- Entity Reference +- _Core: Entity_ +- _Core Field: Text_ +- _Core Field: Text_ +- _Core Field: List_ +- _Core Field: Options_ + +## Installation + + - Install this module and its dependencies using the official + [Backdrop CMS instructions](https://backdropcms.org/guide/modules) + +## Configuration and Usage + + - [Installation and Configuration Guide](https://github.com/backdrop-contrib/og/wiki/1.-Installation-and-Configuration-Guide) + - [Organic Groups Terms, Definitions](https://github.com/backdrop-contrib/og/wiki/2.-Organic-Groups-Terms,-Definitions) + - [For Developers and Site Builders](https://github.com/backdrop-contrib/og/wiki/3.-For-Developers-and-Site-Builders) + +## Upgrading Organic Groups from Drupal 7 + +If you are upgrading an existing Organic Groups installation from Drupal 7 (or upgrading a Drupal 7 module that requires Organic Groups), there are some steps you can (should) take to ensure that your upgraded installation is fully enabled at the end of the process. + +#### Stub Modules + +Backdrop Organic Groups relies on two modules that don't exist in Drupal: + +- Entity UI (`entity_ui`), needed for the Backdrop version of Organic Groups; +- Entity Plus (`entity_plus`), also needed for the Backdrop version of Organic Groups. + +When the Backdrop version of `update.php` runs, if those modules are not present and enabled, then the update will disable all of the Backdrop modules that depend on them, which includes Organic Groups, plus any further modules that depend on Organic Groups. + +So the solution is to install "stub" modules in the Drupal installation prior to generating the database from which the Backdrop upgrade will take place. + +#### Upgrade Process + +Assuming you are following [the official upgrade instructions](https://backdropcms.org/upgrade-from-drupal) or something similar [like this](https://packweb.eu/blog/migrating-drupal-7-backdrop-cms), do the following: + +1. Download and unzip these two modules, which are Drupal "stub" modules: + - [entity_plus.zip](https://github.com/backdrop-contrib/rules/wiki/files/entity_plus.zip) + - [entity_ui.zip](https://github.com/backdrop-contrib/rules/wiki/files/entity_ui.zip) + +2. In Step 2, "Prepare your Drupal site for upgrade", prior to substep 9 ("Make a second backup...calling it backdrop-ready.sql"), + + - Install those two modules into `sites/all/modules` of your Drupal installation; + - Enable those two modules. (They don't do anything. This just makes your database know that they exist, or rather, that they will be forthcoming.) + +3. Continue with substep 9: make your second backup of the database to be used for Backdrop, e.g., backdrop-ready.sql. + +4. Once you have made that second backup, you can uninstall and remove the two stub modules from your Drupal installation. + +5. Continue with the rest of the migration/upgrade process. + +Of course, make sure that you've already installed the Backdrop versions of Organic Groups, Entity Plus, and Entity UI in your Backdrop contrib folder prior to running `update.php`, or all of the above will be for naught. + +## Issues + +- Bugs and Feature requests should be reported in the + [Issue Queue](https://github.com/backdrop-contrib/og/issues) + +## Current Maintainers + + - [Laryn Kragt Bakker](https://github.com/laryn) - [CEDC.org](https://cedc.org) + - [Alejandro Cremaschi](https://github.com/argiepiano) + - Co-maintainers and collaborators are welcome. + +## Credits + +- Ported to Backdrop CMS by [Laryn Kragt Bakker](https://github.com/laryn) - [CEDC.org](https://cedc.org). +- Organic groups for Drupal 5 and 6 authored by Moshe Weitzman +- Current Drupal project maintainer and Drupal 7 author is Amitai Burstein (Amitaibu), gizra.com + +## License + +This project is GPL v2 software. See the LICENSE.txt file in this directory for +complete text. From f30aff286813cf1d4be5f8d2f553d4e03969a540 Mon Sep 17 00:00:00 2001 From: "Tim Erickson (@stpaultim)" Date: Mon, 23 May 2022 15:50:01 -0500 Subject: [PATCH 4/8] Trying a second time to replace old README with new one --- og_demo/README.md | 115 +++++++++++----------------------------------- 1 file changed, 26 insertions(+), 89 deletions(-) diff --git a/og_demo/README.md b/og_demo/README.md index b931ba34..e9e56d23 100644 --- a/og_demo/README.md +++ b/og_demo/README.md @@ -1,89 +1,26 @@ -# Organic Groups (OG) - -The Organic Groups module (also referred to as the `og` module), provides users -the ability to create, manage, and delete their own 'groups' on a site. -Each group can have members, and maintains a group home page which individual -group members may post into. Posts can be sent to multiple groups (i.e. cross- -posted), and individual posts (referred as 'group content') may be shared with -members, or non-members where necessary. Group membership can be open, closed -or moderated. - -## Dependencies - -- Entity Plus -- Entity UI -- Entity Reference -- _Core: Entity_ -- _Core Field: Text_ -- _Core Field: Text_ -- _Core Field: List_ -- _Core Field: Options_ - -## Installation - - - Install this module and its dependencies using the official - [Backdrop CMS instructions](https://backdropcms.org/guide/modules) - -## Configuration and Usage - - - [Installation and Configuration Guide](https://github.com/backdrop-contrib/og/wiki/1.-Installation-and-Configuration-Guide) - - [Organic Groups Terms, Definitions](https://github.com/backdrop-contrib/og/wiki/2.-Organic-Groups-Terms,-Definitions) - - [For Developers and Site Builders](https://github.com/backdrop-contrib/og/wiki/3.-For-Developers-and-Site-Builders) - -## Upgrading Organic Groups from Drupal 7 - -If you are upgrading an existing Organic Groups installation from Drupal 7 (or upgrading a Drupal 7 module that requires Organic Groups), there are some steps you can (should) take to ensure that your upgraded installation is fully enabled at the end of the process. - -#### Stub Modules - -Backdrop Organic Groups relies on two modules that don't exist in Drupal: - -- Entity UI (`entity_ui`), needed for the Backdrop version of Organic Groups; -- Entity Plus (`entity_plus`), also needed for the Backdrop version of Organic Groups. - -When the Backdrop version of `update.php` runs, if those modules are not present and enabled, then the update will disable all of the Backdrop modules that depend on them, which includes Organic Groups, plus any further modules that depend on Organic Groups. - -So the solution is to install "stub" modules in the Drupal installation prior to generating the database from which the Backdrop upgrade will take place. - -#### Upgrade Process - -Assuming you are following [the official upgrade instructions](https://backdropcms.org/upgrade-from-drupal) or something similar [like this](https://packweb.eu/blog/migrating-drupal-7-backdrop-cms), do the following: - -1. Download and unzip these two modules, which are Drupal "stub" modules: - - [entity_plus.zip](https://github.com/backdrop-contrib/rules/wiki/files/entity_plus.zip) - - [entity_ui.zip](https://github.com/backdrop-contrib/rules/wiki/files/entity_ui.zip) - -2. In Step 2, "Prepare your Drupal site for upgrade", prior to substep 9 ("Make a second backup...calling it backdrop-ready.sql"), - - - Install those two modules into `sites/all/modules` of your Drupal installation; - - Enable those two modules. (They don't do anything. This just makes your database know that they exist, or rather, that they will be forthcoming.) - -3. Continue with substep 9: make your second backup of the database to be used for Backdrop, e.g., backdrop-ready.sql. - -4. Once you have made that second backup, you can uninstall and remove the two stub modules from your Drupal installation. - -5. Continue with the rest of the migration/upgrade process. - -Of course, make sure that you've already installed the Backdrop versions of Organic Groups, Entity Plus, and Entity UI in your Backdrop contrib folder prior to running `update.php`, or all of the above will be for naught. - -## Issues - -- Bugs and Feature requests should be reported in the - [Issue Queue](https://github.com/backdrop-contrib/og/issues) - -## Current Maintainers - - - [Laryn Kragt Bakker](https://github.com/laryn) - [CEDC.org](https://cedc.org) - - [Alejandro Cremaschi](https://github.com/argiepiano) - - Co-maintainers and collaborators are welcome. - -## Credits - -- Ported to Backdrop CMS by [Laryn Kragt Bakker](https://github.com/laryn) - [CEDC.org](https://cedc.org). -- Organic groups for Drupal 5 and 6 authored by Moshe Weitzman -- Current Drupal project maintainer and Drupal 7 author is Amitai Burstein (Amitaibu), gizra.com - -## License - -This project is GPL v2 software. See the LICENSE.txt file in this directory for -complete text. +# Organic Groups Demo Content + +This is an optional module that will provide some default content to help you get +started or to help you evaluate this module. + +If you enable this module and decide you do not want to use it, you will need to +delete the configuration and content manually. + +This modules does the following: + +1) Adds a content type called Group and adds the following OG fields. + - Group (allows this content type to be used a group for OG) + - Group Visibility (allows visibility configuration for each group) +2) Adds a content type called Group Content and adds the following OG field + - Group Audience (allows site admin to assign content of this type to + specific groups) +3) Adds three Groups + - Theme Developers (Public) + - Documentation (Public) + - Core Development (Private) +4) Adds six pices of Group Content and assigns two pieces to each group +5) Adds two views to help display the demo content + - OG Content Demo + - OG Groups Demo +6) Adds a layout 'Groups' that is set for use by all Groups with blocks to display + the above listed views. From cea76258d7fc2b95e8758bf8a9758fa89e6044fb Mon Sep 17 00:00:00 2001 From: "Tim Erickson (@stpaultim)" Date: Mon, 23 May 2022 15:56:36 -0500 Subject: [PATCH 5/8] Tweaks to README --- og_demo/README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/og_demo/README.md b/og_demo/README.md index e9e56d23..16e5c0f0 100644 --- a/og_demo/README.md +++ b/og_demo/README.md @@ -8,19 +8,19 @@ delete the configuration and content manually. This modules does the following: -1) Adds a content type called Group and adds the following OG fields. - - Group (allows this content type to be used a group for OG) - - Group Visibility (allows visibility configuration for each group) -2) Adds a content type called Group Content and adds the following OG field - - Group Audience (allows site admin to assign content of this type to - specific groups) -3) Adds three Groups - - Theme Developers (Public) - - Documentation (Public) - - Core Development (Private) -4) Adds six pices of Group Content and assigns two pieces to each group -5) Adds two views to help display the demo content - - OG Content Demo - - OG Groups Demo -6) Adds a layout 'Groups' that is set for use by all Groups with blocks to display +1. Adds a content type called Group and adds the following OG fields. + - Group (allows this content type to be used a group for OG) + - Group Visibility (allows visibility configuration for each group) +2. Adds a content type called Group Content and adds the following OG field + - Group Audience (allows site admin to assign content of this type to + specific groups) +3. Adds three Groups + - Theme Developers (Public) + - Documentation (Public) + - Core Development (Private) +4. Adds six pices of Group Content and assigns two pieces to each group +5. Adds two views to help display the demo content + - OG Content Demo + - OG Groups Demo +6. Adds a layout 'Groups' that is set for use by all Groups with blocks to display the above listed views. From 5369cc5d42977a8efe15c5c3fe617089df26a2d5 Mon Sep 17 00:00:00 2001 From: "Tim Erickson (@stpaultim)" Date: Mon, 23 May 2022 15:59:02 -0500 Subject: [PATCH 6/8] Tweaks to README --- og_demo/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/og_demo/README.md b/og_demo/README.md index 16e5c0f0..d9e745b7 100644 --- a/og_demo/README.md +++ b/og_demo/README.md @@ -1,25 +1,25 @@ # Organic Groups Demo Content This is an optional module that will provide some default content to help you get -started or to help you evaluate this module. +started or to help you evaluate Organic Groups. If you enable this module and decide you do not want to use it, you will need to delete the configuration and content manually. This modules does the following: -1. Adds a content type called Group and adds the following OG fields. +1. Adds a content type called Group and adds the following OG fields: - Group (allows this content type to be used a group for OG) - Group Visibility (allows visibility configuration for each group) -2. Adds a content type called Group Content and adds the following OG field +2. Adds a content type called Group Content and adds the following OG field: - Group Audience (allows site admin to assign content of this type to specific groups) -3. Adds three Groups +3. Adds three Groups: - Theme Developers (Public) - Documentation (Public) - Core Development (Private) -4. Adds six pices of Group Content and assigns two pieces to each group -5. Adds two views to help display the demo content +4. Adds six pieces of Group Content and assigns two pieces to each group +5. Adds two views to help display the demo content: - OG Content Demo - OG Groups Demo 6. Adds a layout 'Groups' that is set for use by all Groups with blocks to display From 465bf206b81a09667c234443b8c11a8ea79e8170 Mon Sep 17 00:00:00 2001 From: argiepiano Date: Mon, 23 May 2022 20:23:25 -0600 Subject: [PATCH 7/8] Add view title --- og_demo/config/views.view.og_groups_demo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/og_demo/config/views.view.og_groups_demo.json b/og_demo/config/views.view.og_groups_demo.json index 9eebd859..9270a6f6 100644 --- a/og_demo/config/views.view.og_groups_demo.json +++ b/og_demo/config/views.view.og_groups_demo.json @@ -121,7 +121,7 @@ "order": "DESC" } }, - "title": "", + "title": "Groups", "filter_groups": { "operator": "AND", "groups": { From 2cf772c680c70e3a876d05a2270b733a9420f325 Mon Sep 17 00:00:00 2001 From: argiepiano Date: Mon, 23 May 2022 20:32:27 -0600 Subject: [PATCH 8/8] Add file description and docblock --- og_demo/og_demo.info | 4 ++-- og_demo/og_demo.install | 8 ++++++++ og_demo/og_demo.module | 5 +++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/og_demo/og_demo.info b/og_demo/og_demo.info index 4774a5a2..6fb78979 100644 --- a/og_demo/og_demo.info +++ b/og_demo/og_demo.info @@ -1,5 +1,5 @@ -name = Organic groups demo -description = "Add some demo content to get started." +name = Organic groups example +description = "Organic Groups example groups and group content to get started." package = "Organic groups" backdrop = 1.x type = module diff --git a/og_demo/og_demo.install b/og_demo/og_demo.install index 7e32fb48..cdffb27a 100644 --- a/og_demo/og_demo.install +++ b/og_demo/og_demo.install @@ -1,5 +1,13 @@