[comment]: # translation:outdated

[comment]: # ({63f61bee-1c702cf9})
# module.get

[comment]: # ({/63f61bee-1c702cf9})

[comment]: # ({88be7749-55f8403c})
### Opis

`integer/array module.get(object parameters)`

Ta metoda umożliwia pobieranie modułów zgodnie z podanymi parametrami.

::: noteclassic
Ta metoda jest dostępna wyłącznie dla użytkownika typu *Super admin*.
Uprawnienia do wywoływania tej metody mogą zostać cofnięte w ustawieniach roli użytkownika.
Więcej informacji można znaleźć w [Rolach użytkowników](/manual/web_interface/frontend_sections/users/user_roles).
:::

[comment]: # ({/88be7749-55f8403c})

[comment]: # ({79220f05-c81b6507})
### Parametry

`(object)` Parametry definiujące żądane dane wyjściowe.

Metoda obsługuje następujące parametry.

|Parametr|[Typ](/manual/api/reference_commentary#data-types)|Opis|
|--|--|------|
|moduleids|ID/array|Zwraca tylko moduły o podanych identyfikatorach.|
|sortfield|string/array|Sortuje wynik według podanych właściwości.<br><br>Możliwe wartości: `moduleid`, `relative_path`.|
|countOutput|boolean|Te parametry są opisane w [komentarzu referencyjnym](/manual/api/reference_commentary#common-get-method-parameters).|
|excludeSearch|boolean|^|
|filter|object|^|
|limit|integer|^|
|output|query|^|
|preservekeys|boolean|^|
|search|object|^|
|searchByAny|boolean|^|
|searchWildcardsEnabled|boolean|^|
|sortorder|string/array|^|
|startSearch|boolean|^|

[comment]: # ({/79220f05-c81b6507})

[comment]: # ({07ca11ca-46698515})
### Zwracane wartości

`(integer/array)` Zwraca:

-   tablicę obiektów;
-   liczbę pobranych obiektów, jeśli użyto parametru `countOutput`.

[comment]: # ({/07ca11ca-46698515})

[comment]: # ({b41637d2-0d9fe9e7})
### Przykłady

[comment]: # ({/b41637d2-0d9fe9e7})

[comment]: # ({b4a4b966-8cbe68b4})
#### Pobieranie modułu według ID

Pobierz wszystkie dane o modułach „1”, „2” i „25”.

[Żądanie](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "module.get",
    "params": {
        "output": "extend",
        "moduleids": [
            "1",
            "2",
            "25"
        ]
    },
    "id": 1
}
```

Odpowiedź:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "moduleid": "1",
            "id": "actionlog",
            "relative_path": "widgets/actionlog",
            "status": "1",
            "config": []
        },
        {
            "moduleid": "2",
            "id": "clock",
            "relative_path": "widgets/clock",
            "status": "1",
            "config": []
        },
        {
            "moduleid": "25",
            "id": "example",
            "relative_path": "modules/example_module",
            "status": "1",
            "config": []
        }
    ],
    "id": 1
}
```

[comment]: # ({/b4a4b966-8cbe68b4})

[comment]: # ({393f0c8a-77300f42})
### Zobacz także

-   [Moduł](object#module)
-   [Widget pulpitu](/manual/api/reference/dashboard/object#dashboard-widget)
-   [Moduły frontend](/manual/extensions/frontendmodules)

[comment]: # ({/393f0c8a-77300f42})

[comment]: # ({397c2807-c9c85790})
### Źródło

CModule::get() w *ui/include/classes/api/services/CModule.php*.

[comment]: # ({/397c2807-c9c85790})
