Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global component import #974

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .markdownlint-cli2.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ config.MD033 = {
"Lib",
"Lang",
"DbAccessPHP",
"SettingsPHP",
"LocalLib",
]
};

Expand Down
2 changes: 1 addition & 1 deletion docs/apis/commonfiles/db-tasks.php/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tags:
description: A description of the plugin scheduled task configuration file
---

import { LanguageProperty, Since } from '@site/src/components';
import { LanguageProperty } from '@site/src/components';

If a plugin wants to configure scheduled task, two items are required:

Expand Down
2 changes: 1 addition & 1 deletion docs/apis/commonfiles/tag.php/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tags:
description: A description of the library tag.php file, describing what plugins have tags where their callbacks are located.
---

import { LanguageProperty, Since } from '@site/src/components';
import { LanguageProperty } from '@site/src/components';

:::note
There are more options such as specifying the default value for "Standard tags", having a fixed collection or excluding from search.
Expand Down
2 changes: 1 addition & 1 deletion docs/apis/commonfiles/version.php/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tags:
description: A description of the plugin version.php file, describing the various features
---

import { LanguageProperty, Since } from '@site/src/components';
import { LanguageProperty, } from '@site/src/components';

Every plugin must have a `version.php` file located in the root directory of that plugin.

Expand Down
4 changes: 2 additions & 2 deletions docs/apis/core/activitycompletion/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ tags:
- API
---

import { Since } from '@site/src/components';

:::note

There are changes to the completion API introduced in **Moodle 3.11** to be incorporated to this page. Please refer to [Student activity completion](https://docs.moodle.org/dev/Student_activity_completion) for details.

:::

Activities do not need to be changed to support conditional availability, but they do need changing to support the completion system.
Expand Down
6 changes: 0 additions & 6 deletions docs/apis/core/clock/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ tags:
description: Fetching the current time
---

import {
Since,
ValidExample,
InvalidExample,
} from '@site/src/components';

<Since version="4.4" issueNumber="MDL-80838" />

Moodle supports use of a [PSR-20](https://php-fig.org/psr/psr20/) compatible Clock interface, which should be accessed using Dependency Injection.
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/core/customfields/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ tags:
- Custom field
---

import { Since } from '@site/src/components';

<Since versions={["3.7"]} issueNumber="MDL-57898" />

## Custom fields API overview
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/core/deprecation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ tags:

<!-- markdownlint-disable no-inline-html -->

import { Since } from '@site/src/components';

<Since version="4.4" issueNumbers="MDL-80005" />

When deprecating a code feature, it is often desirable to include a reasonable amount of information, and to provide a consistent deprecation message.
Expand Down
8 changes: 0 additions & 8 deletions docs/apis/core/di/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ tags:
description: The use of PSR-11 compatible Dependency Injection in Moodle
---

import {
Since,
ValidExample,
InvalidExample,
Tabs,
TabItem,
} from '@site/src/components';

<Since version="4.4" issueNumber="MDL-80072" />

Moodle supports the use of [PSR-11](https://www.php-fig.org/psr/psr-11/) compatible Dependency Injection, accessed using the `\core\di` class, which internally makes use of [PHP-DI](https://php-di.org).
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/core/dml/ddl.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ tags:
- core
---

import { Since, ValidExample, InvalidExample } from '@site/src/components';

<Since version="2.0" />

In this page you'll access to the available functions under Moodle to be able to handle DB structures (tables, fields, indexes...).
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/core/dml/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ tags:
- core_dml
---

import { Since, ValidExample, InvalidExample } from '@site/src/components';

This page describes the functions available to access data in the Moodle database. You should **exclusively** use these functions in order to retrieve or modify database content because these functions provide a high level of abstraction and guarantee that your database manipulation will work against different RDBMSes.

Where possible, tricks and examples will be documented here in order to make developers' lives a bit easier. Of course, feel free to clarify, complete and add more information to this documentation. It will be welcome, absolutely!
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/core/hooks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ tags:
- core
---

import { Since, ValidExample, Tabs, TabItem } from '@site/src/components';

<Since version="4.3" issueNumber="MDL-74954" />

This page describes the Hooks API which is a replacement for some of the lib.php based one-to-many
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/core/message/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ tags:
- Messaging
---

import { Since } from '@site/src/components';

## What is this document?

This document describes how to make use of the Moodle Messaging API to send messages to Moodle users.
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/core/user/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ Please note that, in many cases, more specific APIs may be more appropriate, for

:::

import { Since } from '@site/src/components';

## User field display

The [User fields](https://docs.moodle.org/dev/User_fields) class is mainly used when displaying tables of data about users. It indicates which extra fields (e.g. email) should be displayed in the current context based on the permissions of the current user. It also provides ways to get the necessary data from a query, and to obtain other generally-useful fields for user names and pictures.
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/plugintypes/antivirus/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ description: Integrate your preferred Antivirus tool to with Moodle to automatic
<!-- cspell:ignore scanmyfile -->
<!-- cspell:ignore clamav -->

import { Since } from '@site/src/components';

<Since
version="3.1"
issueNumber="MDL-50886"
Expand Down
1 change: 0 additions & 1 deletion docs/apis/plugintypes/assign/feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ toc_max_heading_level: 4
description: Assign feedback plugins allow you to define different ways that a teacher can provide feedback to their students.
---

import { Since } from '@site/src/components';
import {
SettingsPHP,
LocalLib,
Expand Down
1 change: 0 additions & 1 deletion docs/apis/plugintypes/assign/submission.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ toc_max_heading_level: 4
description: Assign submission plugins allow you to define different ways for a student to submit their work
---

import { Since } from '@site/src/components';
import {
SettingsPHP,
LocalLib,
Expand Down
3 changes: 0 additions & 3 deletions docs/apis/plugintypes/atto/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ title: Atto
tags: []
---


import { Since } from '@site/src/components';

<Since versions={["2.7"]} issueNumber="MDL-43841" />

Atto is a JavaScript text editor built specifically for Moodle. It is the default text editor in Moodle from 2.7 onwards, and is implemented as a standard Moodle [text editor plugin](https://docs.moodle.org/dev/Editors). Most of the code is written in JavaScript using YUI modules.
Expand Down
5 changes: 0 additions & 5 deletions docs/apis/plugintypes/blocks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ import {
DbAccessPHP,
} from '../../_files';
import { ComponentFileSummary } from '../../../_utils';
import {
CodeBlock,
Tabs,
TabItem
} from '@site/src/components';

Block plugins allow you to show supplemental information, and features, within different parts of Moodle.

Expand Down
1 change: 0 additions & 1 deletion docs/apis/plugintypes/enrol/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ tags:
<!-- cspell:ignore timeend -->
<!-- cspell:ignore unenrolment -->

import { CodeBlock } from '@site/src/components';
import {
Lang,
Lib,
Expand Down
5 changes: 0 additions & 5 deletions docs/apis/plugintypes/filter/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ tags:
<!-- cspell:ignore localconfig -->
<!-- cspell:ignore filterlocalsettings -->

import {
Since,
CodeBlock
} from '@site/src/components';

import {
DbAccessPHP,
Lang,
Expand Down
3 changes: 0 additions & 3 deletions docs/apis/plugintypes/format/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ tags:
<!-- cspell:ignore cmitem -->
<!-- cspell:ignore controlmenu -->

import { CodeBlock, Since } from '@site/src/components';
import { getExample } from '@site/src/moodleBridge';
import { ComponentFileSummary } from '../../../_utils';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import {
Lang,
Lib,
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/plugintypes/qbank/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ description: Question bank plugins allow you to extend the functionality of the
documentationDraft: true
---

import { Since } from '@site/src/components';

<Since
version="4.0"
issueNumber="MDL-70329"
Expand Down
6 changes: 0 additions & 6 deletions docs/apis/plugintypes/repository/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ import {
VersionPHP,
} from '../../_files';

import {
CodeBlock,
Tabs,
TabItem
} from '@site/src/components';

Repository plugin allow Moodle to bring contents into Moodle from external repositories.

### Prerequisites
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/subsystems/access.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ tags:

<!-- cspell:ignore NEWMODULE -->

import AcademyLink from '@site/src/components/AcademyLink';

The Access API gives you functions so you can determine what the current user is allowed to do. It also allows plugins to extend Moodle with new capabilities.

## Overview
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/subsystems/analytics/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ tags:
- API
---

import { Since } from '@site/src/components';

<!-- cspell:ignore analysables -->

The Moodle Analytics API allows Moodle site managers to define _prediction models_ that combine _indicators_ and a _target_.
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/subsystems/external/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ For a component named `local_groupmanager` located in `local/groupmanager` which

:::

import { Since } from '@site/src/components';

A service definition:

- _must_ extend the `\core_external\external_api` class
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/subsystems/external/writing-a-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ The [naming convention](https://moodledev.io/general/development/policies/naming

:::

import { CodeBlock, ValidExample, InvalidExample } from '@site/src/components';

Per the Moodle naming convention for web services the name of the function should be:

```
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/subsystems/form/advanced/advanced-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ tags:
- Advanced
---

import { ValidExample, InvalidExample } from '@site/src/components';

Form elements can be marked as 'advanced'. This has the effect that they are hidden initially.

To control whether an element is advanced, you can use the `setAdvanced` method on the MoodleQuickForm instance and set a specific element as being advanced, for example:
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/subsystems/form/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ The `add_action_buttons` function is defined on `moodlform` class, and not a par

### add_sticky_action_buttons()

import { Since } from '@site/src/components';

<Since version="4.3" />

This method calls `add_action_buttons()` internally and makes 'action' buttons sticky.
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/subsystems/task/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Good uses for tasks include:

In general any operation that takes more than a few seconds might be a candidate for a task.

import { Since } from '@site/src/components';

## Benefits

- Better user experience (give the user feedback immediately, that their task has been queued)
Expand Down
8 changes: 0 additions & 8 deletions docs/devupdate.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ tags:

<!-- markdownlint-disable no-inline-html -->

import {
Since,
ValidExample,
InvalidExample,
Tabs,
TabItem,
} from '@site/src/components';

This page highlights the important changes that are coming in Moodle 4.4 for developers.

## Core changes
Expand Down
6 changes: 0 additions & 6 deletions docs/guides/bs5migration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ tags:

<!-- markdownlint-disable no-inline-html -->

import {
Since,
ValidExample,
InvalidExample,
} from '@site/src/components';

Bootstrap 5 has evolved with new features, improvements, and changes in its latest version, and along with this some breaking changes also come, which need to be addressed in the migration process.

:::info
Expand Down
2 changes: 0 additions & 2 deletions docs/guides/javascript/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: JavaScript
---

import { Since, CodeBlock, TabItem, Tabs } from '@site/src/components';

Moodle makes heavy use of JavaScript to improve the experience for its users.

All new JavaScript in Moodle should use the ES2015+ module format, which is
Expand Down
2 changes: 0 additions & 2 deletions docs/guides/javascript/jquery/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ tags:
description: A description of how and when to use jQuery in Moodle
---

import { DeprecatedSince, TabItem, Tabs } from '@site/src/components';

<DeprecatedSince versions={["3.8"]} />

The use of jQuery in new code is strongly discouraged and is not generally accepted in core. Specific exceptions to this rule are made on a case-by-case basis, generally when interfacing with legacy code which expects to be passed a jQuery object.
Expand Down
2 changes: 0 additions & 2 deletions docs/guides/javascript/modal/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ tags:

<Since version="3.2" />

import { CodeBlock, CodeExample, InvalidExample, ValidExample, Since, DeprecatedSince } from '@site/src/components';

The use of modal modules provides a simplified developer experience for creating modal dialogues within Moodle.

The module attempts to ensure that all accessibility requirements are met, including applying the correct aria roles, focus control, aria hiding background elements, and locking keyboard navigation.
Expand Down
2 changes: 0 additions & 2 deletions docs/guides/javascript/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ From Moodle versions 2.9 to 3.8, Moodle supported JavaScript modules written usi

For information on the development toolchain, see our [documentation on how to install and use NodeJS and Grunt](/general/development/tools/nodejs#grunt).

import { Since } from '@site/src/components';

### Development mode

<Since version="3.8" />
Expand Down
2 changes: 0 additions & 2 deletions docs/guides/javascript/reactive/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ tags:
<!-- cspell:ignore METHODNAME -->
<!-- cspell:ignore DATAID -->

import { Since, TabItem, Tabs, ValidExample, InvalidExample } from '@site/src/components';

<Since versions={[ 4.0 ]} />

Third-party plugin developers are free to use any framework they want to implement reactive interfaces like React, Angular or Vue. However, for now Moodle does not provide any of them and all core developments are framework independent.
Expand Down
2 changes: 0 additions & 2 deletions docs/guides/javascript/yui/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ tags:
- YUI
---

import DeprecatedSince from '@site/src/components/DeprecatedSince';

<DeprecatedSince versions={["2.9"]} />

:::caution
Expand Down
2 changes: 0 additions & 2 deletions docs/guides/javascript/yui/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ tags:
- YUI
---

import DeprecatedSince from '@site/src/components/DeprecatedSince';

<DeprecatedSince versions={["2.9"]} />

:::caution
Expand Down
Loading
Loading