-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.php
More file actions
145 lines (139 loc) · 4.57 KB
/
Copy pathplugin.php
File metadata and controls
145 lines (139 loc) · 4.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
namespace Plugins\Sirsoft\DaumPostcode;
use App\Extension\AbstractPlugin;
/**
* Daum 우편번호 서비스 플러그인
*
* Daum 우편번호 검색 API를 통한 주소 검색 기능을 제공합니다.
*/
class Plugin extends AbstractPlugin
{
/**
* 플러그인 메타데이터 반환
*
* @return array 메타데이터
*/
public function getMetadata(): array
{
return [
'author' => 'Sirsoft',
'license' => 'MIT',
'homepage' => 'https://sir.kr',
'keywords' => ['postcode', 'address', 'daum', 'korea'],
];
}
/**
* 플러그인 설정 스키마 반환
*
* @return array 설정 스키마
*/
public function getSettingsSchema(): array
{
return [
'display_mode' => [
'type' => 'enum',
'options' => ['popup', 'layer'],
'default' => 'layer',
'label' => [
'ko' => '표시 방식',
'en' => 'Display Mode',
],
'hint' => [
'ko' => '주소 검색 창을 표시하는 방식을 선택합니다.',
'en' => 'Select how to display the address search window.',
],
'required' => false,
],
'popup_width' => [
'type' => 'integer',
'default' => 500,
'label' => [
'ko' => '팝업 너비 (px)',
'en' => 'Popup Width (px)',
],
'hint' => [
'ko' => '팝업 모드에서 사용되는 창 너비입니다.',
'en' => 'Window width used in popup mode.',
],
'required' => false,
],
'popup_height' => [
'type' => 'integer',
'default' => 600,
'label' => [
'ko' => '팝업 높이 (px)',
'en' => 'Popup Height (px)',
],
'hint' => [
'ko' => '팝업 모드에서 사용되는 창 높이입니다.',
'en' => 'Window height used in popup mode.',
],
'required' => false,
],
'theme_color' => [
'type' => 'string',
'default' => '#1D4ED8',
'label' => [
'ko' => '테마 색상',
'en' => 'Theme Color',
],
'hint' => [
'ko' => '우편번호 검색 창의 테마 색상입니다. (예: #1D4ED8)',
'en' => 'Theme color for the postcode search window. (e.g., #1D4ED8)',
],
'required' => false,
],
];
}
/**
* 플러그인 설정 기본값 반환
*
* @return array 기본 설정값
*/
public function getConfigValues(): array
{
return [
'display_mode' => 'layer',
'popup_width' => 500,
'popup_height' => 600,
'theme_color' => '#1D4ED8',
];
}
/**
* 플러그인이 제공하는 훅 정보 반환
*
* @return array 훅 정의 배열
*/
public function getHooks(): array
{
return [
[
'name' => 'sirsoft-daum_postcode.address.selected',
'type' => 'action',
'description' => [
'ko' => '주소 선택 완료 시 실행되는 액션 훅',
'en' => 'Action hook executed when address selection is complete',
],
'parameters' => [
'zonecode' => 'string - 우편번호',
'address' => 'string - 기본 주소',
'roadAddress' => 'string - 도로명 주소',
'jibunAddress' => 'string - 지번 주소',
'buildingName' => 'string - 건물명',
],
],
[
'name' => 'sirsoft-daum_postcode.filter_address_data',
'type' => 'filter',
'description' => [
'ko' => '선택된 주소 데이터를 필터링하는 훅',
'en' => 'Filter hook to modify selected address data',
],
'parameters' => [
'data' => 'array - 주소 데이터',
],
'return' => 'array - 필터링된 주소 데이터',
],
];
}
}