{"id":20974498,"url":"https://github.com/koala-framework/kwc-policy","last_synced_at":"2025-05-14T12:32:07.308Z","repository":{"id":57007870,"uuid":"132120241","full_name":"koala-framework/kwc-policy","owner":"koala-framework","description":"Notification Box package that displays information/news/agreements and stores the 'time of click' in a cookie","archived":false,"fork":false,"pushed_at":"2018-11-06T12:53:29.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"1.0","last_synced_at":"2025-04-19T08:17:21.348Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koala-framework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-04T09:37:31.000Z","updated_at":"2018-09-07T07:24:22.000Z","dependencies_parsed_at":"2022-08-21T13:10:47.857Z","dependency_job_id":null,"html_url":"https://github.com/koala-framework/kwc-policy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koala-framework%2Fkwc-policy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koala-framework%2Fkwc-policy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koala-framework%2Fkwc-policy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koala-framework%2Fkwc-policy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koala-framework","download_url":"https://codeload.github.com/koala-framework/kwc-policy/tar.gz/refs/heads/1.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254142460,"owners_count":22021534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T04:29:46.340Z","updated_at":"2025-05-14T12:32:06.987Z","avatar_url":"https://github.com/koala-framework.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kwc-notification-box\n\n## Notification Box\nProvides a Popup which ca be used to show changes for website users. Disappears when a user closes the box or after 30 days.\n\nHas to be included as a box and made editable:\n```\n$ret['generators']['notificationBox'] = array(\n    'class' =\u003e 'Kwf_Component_Generator_Box_Static',\n    'component' =\u003e 'KwcPolicy_Kwc_NotificationBox_Component',\n    'inherit' =\u003e true,\n    'unique' =\u003e true,\n);\n$ret['editComponents'][] = 'notificationBox';\n```\n\n## Policy Text\nProvides a component which can be used to assign a centralized text with a link to the policy page.\n\nHas to be included in the Root-Component (no box!) and made editable:\n```\n$ret['generators']['policyText'] = array(\n    'class' =\u003e 'Kwf_Component_Generator_Static',\n    'component' =\u003e 'KwcPolicy_Kwc_PolicyText_Component',\n);\n$ret['editComponents'][] = 'policyText';\n```\n\n* Usage in a non-Frontend-Form-Component:\n    In getTemplateVars() just call the following:\n    ```\n    $ret['policyText'] = KwcPolicy_Kwc_PolicyText_Component::getPolicyText($this-\u003egetData(), $renderer);\n    ```\n* Usage in a Field of a Frontend-Form-Component:\n    1. Add the field where the text should appear as usual when defining the frontend form but leave the text empty:\n        ```\n        $this-\u003eadd(new Kwf_Form_Field_Checkbox('terms_and_conditions'))\n            -\u003esetAllowBlank(false)\n            -\u003esetHideLabel(true);\n        ```\n    2. In getTemplateVars() before calling parent you have to set the Text:\n        ```\n        $policyText = KwcPolicy_Kwc_PolicyText_Component::getPolicyText($this-\u003egetData(), $renderer);\n        $this-\u003egetForm()-\u003efields-\u003egetByName('terms_and_conditions')\n            -\u003esetBoxLabel($policyText);\n        ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoala-framework%2Fkwc-policy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoala-framework%2Fkwc-policy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoala-framework%2Fkwc-policy/lists"}