This repository was archived by the owner on Jun 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.php
More file actions
121 lines (103 loc) · 3.44 KB
/
plugin.php
File metadata and controls
121 lines (103 loc) · 3.44 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
<?php
namespace Xpressengine\Plugins\ImageResizer;
use XeFrontend;
use XePresenter;
use Route;
use Xpressengine\Http\Request;
use Xpressengine\Plugin\AbstractPlugin;
class Plugin extends AbstractPlugin
{
/**
* 이 메소드는 활성화(activate) 된 플러그인이 부트될 때 항상 실행됩니다.
*
* @return void
*/
public function boot()
{
$this->route();
}
protected function route()
{
Route::fixed(
$this->getId(),
function () {
Route::get(
'/popup/create',
[
'as' => 'image_resize_tool::popup',
'uses' => function (Request $request) {
$title = '이미지 리사이즈, 편집 에디터툴';
// set browser title
XeFrontend::title($title);
//header, footer 제거
\XeTheme::selectBlankTheme();
XeFrontend::css([
asset('assets/vendor/bootstrap/css/bootstrap.min.css'),
$this->asset('assets/vendor/jquery-ui.css'),
$this->asset('assets/vendor/cropper.min.css'),
])->appendTo('head')->load();
XeFrontend::js([
$this->asset('assets/vendor/jquery-ui.js'),
$this->asset('assets/vendor/cropper.min.js'),
$this->asset('assets/ImageResizer.js'),
])->appendTo('body')->load();
// output
return XePresenter::make('image_resize_tool::views.popup');
}
]
);
}
);
}
/**
* 플러그인이 활성화될 때 실행할 코드를 여기에 작성한다.
*
* @param string|null $installedVersion 현재 XpressEngine에 설치된 플러그인의 버전정보
*
* @return void
*/
public function activate($installedVersion = null)
{
// implement code
}
/**
* 플러그인을 설치한다. 플러그인이 설치될 때 실행할 코드를 여기에 작성한다
*
* @return void
*/
public function install()
{
// implement code
}
/**
* 해당 플러그인이 설치된 상태라면 true, 설치되어있지 않다면 false를 반환한다.
* 이 메소드를 구현하지 않았다면 기본적으로 설치된 상태(true)를 반환한다.
*
* @return boolean 플러그인의 설치 유무
*/
public function checkInstalled()
{
// implement code
return parent::checkInstalled();
}
/**
* 플러그인을 업데이트한다.
*
* @return void
*/
public function update()
{
// implement code
}
/**
* 해당 플러그인이 최신 상태로 업데이트가 된 상태라면 true, 업데이트가 필요한 상태라면 false를 반환함.
* 이 메소드를 구현하지 않았다면 기본적으로 최신업데이트 상태임(true)을 반환함.
*
* @return boolean 플러그인의 설치 유무,
*/
public function checkUpdated()
{
// implement code
return parent::checkUpdated();
}
}