26 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
27 | * @link https://xpressengine.io
28 | */
29 | class BlogSkin extends GallerySkin
30 | {
31 | protected static $path = 'board/components/Skins/Board/Blog';
32 | }
33 |
--------------------------------------------------------------------------------
/components/Skins/Board/Blog/assets/css/skin.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/components/Skins/Board/Blog/assets/css/skin.css
--------------------------------------------------------------------------------
/components/Skins/Board/Blog/info.php:
--------------------------------------------------------------------------------
1 | [
4 | 'sample_text' => [
5 | '_type' => 'text',
6 | '_section' => '기본설정',
7 | 'label' => '샘플 문구',
8 | 'placeholder' => '샘플용 설정 필드입니다.',
9 | 'description' => '샘플용 설정 필드입니다.',
10 | ],
11 | ],
12 | 'support' => [
13 | 'mobile' => true,
14 | 'desktop' => true
15 | ]
16 | ];
17 |
--------------------------------------------------------------------------------
/components/Skins/Board/Blog/views/setting.blade.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/components/Skins/Board/Blog/views/setting.blade.php
--------------------------------------------------------------------------------
/components/Skins/Board/Common/info.php:
--------------------------------------------------------------------------------
1 | [
5 | // 'sample_text' => [
6 | // '_type' => 'text',
7 | // '_section' => '기본설정',
8 | // 'label' => '샘플 문구',
9 | // 'placeholder' => '샘플용 설정 필드입니다.',
10 | // 'description' => '샘플용 설정 필드입니다.',
11 | // ],
12 | // ],
13 | // 'support' => [
14 | // 'mobile' => true,
15 | // 'desktop' => true
16 | // ]
17 | //];
18 |
--------------------------------------------------------------------------------
/components/Skins/Board/Common/views/_frame.blade.php:
--------------------------------------------------------------------------------
1 | {{ XeFrontend::js('plugins/board/assets/js/board.js')->appendTo('body')->load() }}
2 | {{ XeFrontend::css('plugins/board/assets/css/board.css')->load() }}
3 |
4 |
5 |
6 |
7 | @if ($config->get('topCommonContentOnlyList') === false || request()->segment(2) == '')
8 | {!! xe_trans($config->get('topCommonContent', '')) !!}
9 | @endif
10 |
11 | @section('content')
12 | {!! isset($content) ? $content : '' !!}
13 | @show
14 |
15 |
16 | @if ($config->get('bottomCommonContentOnlyList') === false || request()->segment(2) == '')
17 | {!! xe_trans($config->get('bottomCommonContent', '')) !!}
18 | @endif
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/components/Skins/Board/Common/views/default-pagination.blade.php:
--------------------------------------------------------------------------------
1 | @if ($paginator->hasPages())
2 |
3 | @if($paginator->currentPage() <= 1)
4 |
«
5 | @else
6 |
«
7 | @endif
8 |
9 | @foreach ($elements as $element)
10 | {{-- "Three Dots" Separator --}}
11 | @if (is_string($element))
12 |
{{ $element }}
13 | @endif
14 |
15 | {{-- Array Of Links --}}
16 | @if (is_array($element))
17 | @foreach ($element as $page => $url)
18 | @if ($page == $paginator->currentPage())
19 |
{{ $page }}
20 | @else
21 |
{{ $page }}
22 | @endif
23 | @endforeach
24 | @endif
25 | @endforeach
26 |
27 |
28 | @if(!$paginator->hasMorePages())
29 |
»
30 | @else
31 |
»
32 | @endif
33 |
34 | @endif
35 |
36 |
--------------------------------------------------------------------------------
/components/Skins/Board/Common/views/guestId.blade.php:
--------------------------------------------------------------------------------
1 | {{ XeFrontend::rule('board', $rules) }}
2 |
3 | {!! XeFrontend::css('assets/core/user/auth.css')->load() !!}
4 |
5 |
{{ xe_trans('xe::identification') }}
6 |
25 |
26 |
--------------------------------------------------------------------------------
/components/Skins/Board/Common/views/preview.blade.php:
--------------------------------------------------------------------------------
1 |
2 | @foreach ($skinConfig['formColumns'] as $columnName)
3 | @if($columnName === 'title')
4 |
18 | @elseif($columnName === 'content')
19 |
20 | {{-- @DEPRECATED .xe_content --}}
21 |
22 | {!! compile($config->get('boardId'), $content, $format === Xpressengine\Plugins\Board\Models\Board::FORMAT_HTML) !!}
23 |
24 |
25 | @elseif (($fieldType = XeDynamicField::get($config->get('documentGroup'), $columnName)) != null && isset($dynamicFieldsById[$columnName]) && $dynamicFieldsById[$columnName]->get('use') == true)
26 |
27 | {!! $fieldType->getSkin()->show(request()->all()) !!}
28 |
29 | @endif
30 | @endforeach
31 |
32 | @foreach ($fieldTypes as $dynamicFieldConfig)
33 | @if (in_array($dynamicFieldConfig->get('id'), $skinConfig['formColumns']) === false && ($fieldType = XeDynamicField::getByConfig($dynamicFieldConfig)) != null && $dynamicFieldConfig->get('use') == true)
34 |
35 | {!! $fieldType->getSkin()->show(request()->all()) !!}
36 |
37 | @endif
38 | @endforeach
39 |
40 |
--------------------------------------------------------------------------------
/components/Skins/Board/Common/views/print.blade.php:
--------------------------------------------------------------------------------
1 |
2 | @foreach ($skinConfig['formColumns'] as $columnName)
3 | @if($columnName === 'title')
4 |
27 | @elseif($columnName === 'content')
28 |
29 | {{-- @DEPRECATED .xe_content --}}
30 |
31 | {!! compile($item->instance_id, $item->content, $item->format === Xpressengine\Plugins\Board\Models\Board::FORMAT_HTML) !!}
32 |
33 |
34 | @elseif (($fieldType = XeDynamicField::get($config->get('documentGroup'), $columnName)) != null && isset($dynamicFieldsById[$columnName]) && $dynamicFieldsById[$columnName]->get('use') == true)
35 |
36 | {!! $fieldType->getSkin()->show($item->getAttributes()) !!}
37 |
38 | @endif
39 | @endforeach
40 |
41 | @foreach ($fieldTypes as $dynamicFieldConfig)
42 | @if (in_array($dynamicFieldConfig->get('id'), $skinConfig['formColumns']) === false && ($fieldType = XeDynamicField::getByConfig($dynamicFieldConfig)) != null && $dynamicFieldConfig->get('use') == true)
43 |
44 | {!! $fieldType->getSkin()->show($item->getAttributes()) !!}
45 |
46 | @endif
47 | @endforeach
48 |
49 |
50 |
51 |
56 |
--------------------------------------------------------------------------------
/components/Skins/Board/Common/views/revision.blade.php:
--------------------------------------------------------------------------------
1 | @foreach ($docs as $doc)
2 |
3 | Revision NO : {{ $doc->revisionNo }}
4 | /
5 | Update date : {{ $doc->updated_at }}
6 |
7 |
8 |
9 | @foreach ($formColumns as $columnName)
10 | @if ($columnName == 'title')
11 |
12 |
[{{ $doc->instance_id }}]
14 | {!! $doc->title !!}
15 |
Date: {{$doc->updated_at}}
16 |
17 |
18 | {!! $doc->writer !!}
19 |
20 | @elseif ($columnName == 'content')
21 |
22 | {!! $doc->content !!}
23 |
24 | @elseif (($fieldType = XeDynamicField::get($config->get('documentGroup'), $columnName)) != null)
25 |
26 | {!! $fieldType->getSkin()->show($fieldType->getConfig(), $doc->getAttributes()) !!}
27 |
28 | @endif
29 | @endforeach
30 |
31 | @endforeach
--------------------------------------------------------------------------------
/components/Skins/Board/Common/views/simple-pagination.blade.php:
--------------------------------------------------------------------------------
1 | @if ($paginator->hasPages())
2 |
3 | @if($paginator->currentPage() <= 1)
4 |
«
5 | @else
6 |
«
7 | @endif
8 |
9 |
{{ $paginator->currentPage() }} / {{ $paginator->lastPage() }}
10 |
11 |
12 | @if(!$paginator->hasMorePages())
13 |
»
14 | @else
15 |
»
16 | @endif
17 |
18 | @endif
19 |
20 |
--------------------------------------------------------------------------------
/components/Skins/Board/Common/views/votedModal.blade.php:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/components/Skins/Board/Common/views/votedUserList.blade.php:
--------------------------------------------------------------------------------
1 | @foreach($paginate as $log)
2 | @if($log->user->getId() == Auth::user()->getId())
3 |
4 |
5 |
6 |
7 |
8 |
9 |
{{$log->user->getDisplayName()}}
10 |
11 |
12 |
13 | @else
14 |
15 |
16 |
17 |
18 |
{{$log->user->getDisplayName()}}
19 |
{{$log->created_at}}
20 |
21 |
22 |
23 | @endif
24 | @endforeach
--------------------------------------------------------------------------------
/components/Skins/Board/Common/views/votedUsers.blade.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | @if ($item->assent_count > 10)
14 | {!! xe_trans('board::assentThisPostsOthers', [
15 | 'count'=> sprintf('%s', $urlHandler->get('votedModal', ['option' => $option, 'id' => $item->id]), $item->assent_count - 1),
16 | ]) !!}
17 | @endif
18 |
--------------------------------------------------------------------------------
/components/Skins/Board/Gallery/assets/css/skin.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/components/Skins/Board/Gallery/assets/css/skin.css
--------------------------------------------------------------------------------
/components/Skins/Board/Gallery/info.php:
--------------------------------------------------------------------------------
1 | [
4 | 'sample_text' => [
5 | '_type' => 'text',
6 | '_section' => '기본설정',
7 | 'label' => '샘플 문구',
8 | 'placeholder' => '샘플용 설정 필드입니다.',
9 | 'description' => '샘플용 설정 필드입니다.',
10 | ],
11 | ],
12 | 'support' => [
13 | 'mobile' => true,
14 | 'desktop' => true
15 | ]
16 | ];
17 |
--------------------------------------------------------------------------------
/components/Skins/Board/Gallery/views/setting.blade.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/components/Skins/Board/Gallery/views/setting.blade.php
--------------------------------------------------------------------------------
/components/Skins/Board/Settings/Common/CommonSettingsSkin.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Components\Skins\Board\Settings\Common;
15 |
16 | use Xpressengine\Presenter\Presenter;
17 | use Xpressengine\Skin\AbstractSkin;
18 | use View;
19 | use XePresenter;
20 |
21 | /**
22 | * SettingsSkin
23 | *
24 | * @category Board
25 | * @package Xpressengine\Plugins\Board
26 | * @author XE Developers
27 | * @copyright 2019 Copyright XEHub Corp.
28 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
29 | * @link https://xpressengine.io
30 | */
31 | class CommonSettingsSkin extends AbstractSkin
32 | {
33 | /**
34 | * @var string
35 | */
36 | protected static $skinAlias = 'board/components/Skins/Board/Settings/Common/views';
37 |
38 | /**
39 | * render
40 | *
41 | * @return \Illuminate\View\View
42 | */
43 | public function render()
44 | {
45 | $contentView = View::make(
46 | sprintf('%s.%s', static::$skinAlias, $this->view),
47 | $this->data
48 | );
49 |
50 | $parts = pathinfo($contentView->getPath());
51 | $names = explode('/', $parts['dirname']);
52 | $subPath =array_pop($names);
53 | $active = substr($parts['filename'], 0, stripos($parts['filename'], '.'));
54 | $this->data['_active'] = $active;
55 |
56 | if (XePresenter::getRenderType() == Presenter::RENDER_CONTENT) {
57 | $view = $contentView;
58 | } elseif($subPath === 'global' || $subPath === 'module') {
59 | // wrapped by _frame.blade.php
60 | $this->data['afea'] = 1;
61 | $view = View::make(sprintf('%s.%s._frame', static::$skinAlias, $subPath), $this->data);
62 | $view->content = $contentView->render();
63 | } else {
64 | $view = $contentView;
65 | }
66 |
67 | return $view;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/components/Skins/Board/Settings/Common/views/global/_frame.blade.php:
--------------------------------------------------------------------------------
1 | {{ XeFrontend::js('plugins/board/assets/js/managerSkin.js')->load() }}
2 |
3 | {{-- $_active 는 SettingsSkin 에서 처리됨 --}}
4 |
9 |
10 | {!! $content !!}
--------------------------------------------------------------------------------
/components/Skins/Board/Settings/Common/views/global/index.blade.php:
--------------------------------------------------------------------------------
1 |
2 | Board Manager
3 |
4 |
5 | # |
6 | Board ID |
7 | Name |
8 | Config |
9 |
10 |
11 |
12 | @foreach($configs as $config)
13 |
14 | # |
15 | {{ $config->get('boardId') }} |
16 | {{ $config->get('boardName', '') }} |
17 | config |
18 |
19 | @endforeach
20 |
21 |
22 |
--------------------------------------------------------------------------------
/components/Skins/Board/Settings/Common/views/global/permission.blade.php:
--------------------------------------------------------------------------------
1 | @section('page_title')
2 | {{xe_trans('board::boardDetailConfigures')}}
3 | @endsection
4 |
5 | @section('page_description')
6 | @endsection
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
{{xe_trans('xe::permission')}}
16 |
17 |
18 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/components/Skins/Board/Settings/Common/views/global/toggleMenu.blade.php:
--------------------------------------------------------------------------------
1 | @section('page_title')
2 | {{xe_trans('board::boardDetailConfigures')}}
3 | @endsection
4 |
5 | @section('page_description')
6 | @endsection
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
{{xe_trans('xe::toggleMenu')}}
16 |
17 |
18 |
19 |
20 | {!! $toggleMenuSection !!}
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/components/Skins/Board/Settings/Common/views/module/_frame.blade.php:
--------------------------------------------------------------------------------
1 | {{ XeFrontend::js('plugins/board/assets/js/managerSkin.js')->load() }}
2 |
3 | {{-- $_active 는 SettingsSkin 에서 처리됨 --}}
4 |
13 |
14 | {!! $content !!}
15 |
16 | {{ XeFrontend::js('assets/vendor/jqueryui/jquery-ui.min.js')->load() }}
--------------------------------------------------------------------------------
/components/Skins/Board/Settings/Common/views/module/dynamicField.blade.php:
--------------------------------------------------------------------------------
1 | @section('page_title')
2 | {{xe_trans('board::boardDetailConfigures')}}
3 | @endsection
4 |
5 | @section('page_description')@endsection
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
{{xe_trans('xe::dynamicField')}}
15 |
16 |
17 |
18 |
19 | {!! $dynamicFieldSection !!}
20 |
21 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/components/Skins/Board/Settings/Common/views/module/editor.blade.php:
--------------------------------------------------------------------------------
1 | @section('page_title')
2 | {{xe_trans('board::boardDetailConfigures')}}
3 | @endsection
4 |
5 | @section('page_description')@endsection
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
{{xe_trans('xe::editor')}}
15 |
16 |
17 |
18 |
19 | {!! $editorSection !!}
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/components/Skins/Board/Settings/Common/views/module/permission.blade.php:
--------------------------------------------------------------------------------
1 | @section('page_title')
2 | {{xe_trans('board::boardDetailConfigures')}}
3 | @endsection
4 |
5 | @section('page_description')@endsection
6 |
7 |
8 |
--------------------------------------------------------------------------------
/components/Skins/Board/Settings/Common/views/module/skin.blade.php:
--------------------------------------------------------------------------------
1 | @section('page_title')
2 | {{xe_trans('board::boardDetailConfigures')}}
3 | @endsection
4 |
5 | @section('page_description')@endsection
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
{{xe_trans('xe::skin')}}
15 |
16 |
17 |
18 |
19 | {!! $skinSection !!}
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/components/Skins/Board/Settings/Common/views/module/toggleMenu.blade.php:
--------------------------------------------------------------------------------
1 | @section('page_title')
2 | {{xe_trans('board::boardDetailConfigures')}}
3 | @endsection
4 |
5 | @section('page_description')@endsection
6 |
7 |
8 |
9 |
10 |
11 |
12 |
18 |
19 |
20 | {!! $toggleMenuSection !!}
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/components/Skins/Board/XEDefault/info.php:
--------------------------------------------------------------------------------
1 | 'setting',
5 | 'support' => [
6 | 'mobile' => true,
7 | 'desktop' => true
8 | ]
9 | ];
10 |
--------------------------------------------------------------------------------
/components/Skins/Board/XEDefault/views/_frame.blade.php:
--------------------------------------------------------------------------------
1 | {{ XeFrontend::js('plugins/board/assets/js/board.js')->appendTo('body')->load() }}
2 | {{ XeFrontend::js('assets/core/xe-ui-component/js/xe-page.js')->appendTo('body')->load() }}
3 |
4 | {{ XeFrontend::css('plugins/board/assets/css/new-board-common.css')->load() }}
5 | {{ XeFrontend::css('plugins/board/assets/css/new-board-header.css')->load() }}
6 | {{ XeFrontend::css('plugins/board/assets/css/new-board-footer.css')->load() }}
7 |
8 | {{ expose_trans('board::selectPost') }}
9 | {{ expose_trans('board::selectBoard') }}
10 | {{ expose_trans('board::msgDeleteConfirm') }}
11 |
12 |
13 |
14 | @if ($config->get('topCommonContentOnlyList') === false || request()->segment(2) === '')
15 |
18 | @endif
19 |
20 |
53 | @section('content')
54 | {!! isset($content) ? $content : '' !!}
55 | @show
56 |
57 | @if ($config->get('bottomCommonContentOnlyList') === false || request()->segment(2) === '')
58 |
61 | @endif
62 |
63 |
--------------------------------------------------------------------------------
/components/Skins/Board/XEDefault/views/guestId.blade.php:
--------------------------------------------------------------------------------
1 | {{ XeFrontend::rule('board', $rules) }}
2 |
3 | {!! XeFrontend::css('assets/core/user/auth.css')->load() !!}
4 |
5 |
{{ xe_trans('xe::identification') }}
6 |
25 |
26 |
--------------------------------------------------------------------------------
/components/Skins/Board/XEDefault/views/revision.blade.php:
--------------------------------------------------------------------------------
1 | @foreach ($docs as $doc)
2 |
3 | Revision NO : {{ $doc->revisionNo }}
4 | /
5 | Update date : {{ $doc->updated_at }}
6 |
7 |
8 |
9 | @foreach ($formColumns as $columnName)
10 | @if ($columnName == 'title')
11 |
12 |
[{{ $doc->instance_id }}]
14 | {!! $doc->title !!}
15 |
Date: {{$doc->updated_at}}
16 |
17 |
18 | {!! $doc->writer !!}
19 |
20 | @elseif ($columnName == 'content')
21 |
22 | {!! $doc->content !!}
23 |
24 | @elseif (($fieldType = XeDynamicField::get($config->get('documentGroup'), $columnName)) != null)
25 |
26 | {!! $fieldType->getSkin()->show($fieldType->getConfig(), $doc->getAttributes()) !!}
27 |
28 | @endif
29 | @endforeach
30 |
31 | @endforeach
--------------------------------------------------------------------------------
/components/Skins/Board/XEDefault/views/votedModal.blade.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
17 |
--------------------------------------------------------------------------------
/components/Skins/Board/XEDefault/views/votedUserList.blade.php:
--------------------------------------------------------------------------------
1 | @foreach($paginate as $log)
2 | @if($log->user->getId() == Auth::user()->getId())
3 |
4 |
5 |
6 |
7 |
8 |
9 |
{{$log->user->getDisplayName()}}
10 |
11 |
12 |
13 | @else
14 |
15 |
16 |
17 |
18 |
{{$log->user->getDisplayName()}}
19 |
{{$log->created_at}}
20 |
21 |
22 |
23 | @endif
24 | @endforeach
--------------------------------------------------------------------------------
/components/Skins/Board/XEDefault/views/votedUsers.blade.php:
--------------------------------------------------------------------------------
1 |
11 |
12 | @if ($option === 'assent')
13 | @if ($item->assent_count > 10)
14 | {!! xe_trans('board::assentThisPosts', [
15 | 'count'=> sprintf('%s', $urlHandler->get('votedModal', ['option' => $option, 'id' => $item->id]), $item->assent_count),
16 | ]) !!}
17 | @endif
18 | @elseif ($option === 'dissent')
19 | @if ($item->dissent_count > 10)
20 | {!! xe_trans('board::dissentThisPosts', [
21 | 'count'=> sprintf('%s', $urlHandler->get('votedModal', ['option' => $option, 'id' => $item->id]), $item->dissent_count),
22 | ]) !!}
23 | @endif
24 | @endif
25 |
--------------------------------------------------------------------------------
/components/Skins/Board/XEGallery/assets/img/settingDoubleMobile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/components/Skins/Board/XEGallery/assets/img/settingDoubleMobile.png
--------------------------------------------------------------------------------
/components/Skins/Board/XEGallery/assets/img/settingSingleMobile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/components/Skins/Board/XEGallery/assets/img/settingSingleMobile.png
--------------------------------------------------------------------------------
/components/Skins/Board/XEGallery/info.php:
--------------------------------------------------------------------------------
1 | 'setting',
4 | 'support' => [
5 | 'mobile' => true,
6 | 'desktop' => true
7 | ]
8 | ];
9 |
--------------------------------------------------------------------------------
/components/Skins/Board/XEWebzine/XEWebzine.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2020 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 |
15 | namespace Xpressengine\Plugins\Board\Components\Skins\Board\XEWebzine;
16 |
17 | use Xpressengine\Plugins\Board\Components\Skins\Board\XEGallery\XEGallery;
18 |
19 | /**
20 | * XEWebzine
21 | *
22 | * @category Board
23 | * @package Xpressengine\Plugins\Board
24 | * @author XE Developers
25 | * @copyright 2020 Copyright XEHub Corp.
26 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
27 | * @link https://xpressengine.io
28 | */
29 | class XEWebzine extends XEGallery
30 | {
31 | protected static $path = 'board/components/Skins/Board/XEWebzine';
32 |
33 | public function resolveSetting(array $inputs = [])
34 | {
35 | if (isset($inputs['visibleIndexBlogProfileImage']) === false) {
36 | $inputs['visibleIndexBlogProfileImage'] = '';
37 | }
38 |
39 | if (isset($inputs['visibleIndexBlogDescription']) === false) {
40 | $inputs['visibleIndexBlogDescription'] = '';
41 | }
42 |
43 | return parent::resolveSetting($inputs);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/components/Skins/Board/XEWebzine/info.php:
--------------------------------------------------------------------------------
1 | 'setting',
4 | 'support' => [
5 | 'mobile' => true,
6 | 'desktop' => true
7 | ]
8 | ];
9 |
--------------------------------------------------------------------------------
/components/ToggleMenus/Boards/PrintItem.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Components\ToggleMenus\Boards;
15 |
16 | use Gate;
17 | use Xpressengine\Plugins\Board\Models\Board;
18 | use Xpressengine\Plugins\Board\BoardPermissionHandler;
19 | use Xpressengine\ToggleMenu\AbstractToggleMenu;
20 | use Xpressengine\Permission\Instance;
21 |
22 | /**
23 | * PrintItem
24 | *
25 | * @category Board
26 | * @package Xpressengine\Plugins\Board
27 | * @author XE Developers
28 | * @copyright 2019 Copyright XEHub Corp.
29 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
30 | * @link https://xpressengine.io
31 | */
32 | class PrintItem extends AbstractToggleMenu
33 | {
34 | /**
35 | * get text
36 | *
37 | * @return string
38 | */
39 | public function getText()
40 | {
41 | return xe_trans('board::print');
42 | }
43 |
44 | /**
45 | * get type
46 | *
47 | * @return string
48 | */
49 | public function getType()
50 | {
51 | return static::MENUTYPE_RAW;
52 | }
53 |
54 | /**
55 | * get action url
56 | *
57 | * @return string
58 | */
59 | public function getAction()
60 | {
61 | $doc = Board::find($this->identifier);
62 |
63 | $url = app('xe.board.url')->get('print', ['id' => $this->identifier], $doc->instance_id);
64 |
65 | return ''.$this->getText().'';
66 | }
67 |
68 | /**
69 | * get script
70 | *
71 | * @return null
72 | */
73 | public function getScript()
74 | {
75 | return null;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/components/ToggleMenus/Boards/TrashItem.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Components\ToggleMenus\Boards;
15 |
16 | use Gate;
17 | use Xpressengine\Plugins\Board\Models\Board;
18 | use Xpressengine\Plugins\Board\BoardPermissionHandler;
19 | use Xpressengine\ToggleMenu\AbstractToggleMenu;
20 | use Xpressengine\Permission\Instance;
21 |
22 | /**
23 | * TrashItem
24 | *
25 | * Toggle menu item
26 | * 팝업 메뉴에 휴지통으로 이동 처리
27 | *
28 | * @category Board
29 | * @package Xpressengine\Plugins\Board
30 | * @author XE Developers
31 | * @copyright 2019 Copyright XEHub Corp.
32 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
33 | * @link https://xpressengine.io
34 | */
35 | class TrashItem extends AbstractToggleMenu
36 | {
37 | /**
38 | * check permission
39 | *
40 | * @return bool
41 | */
42 | public function allows()
43 | {
44 | $doc = Board::find($this->identifier);
45 | $configHandler = app('xe.board.config');
46 | $boardPermission = app('xe.board.permission');
47 |
48 | $config = $configHandler->get($doc->instance_id);
49 | $isManger = false;
50 | if ($config !== null) {
51 |
52 | if (Gate::allows(
53 | BoardPermissionHandler::ACTION_MANAGE,
54 | new Instance($boardPermission->name($doc->instance_id))
55 | )) {
56 | $isManger = true;
57 | };
58 | }
59 |
60 | return $isManger;
61 | }
62 |
63 | /**
64 | * get text
65 | *
66 | * @return string
67 | */
68 | public function getText()
69 | {
70 | return xe_trans('xe::moveToTrash');
71 | }
72 |
73 | /**
74 | * get type
75 | *
76 | * @return string
77 | */
78 | public function getType()
79 | {
80 | return static::MENUTYPE_EXEC;
81 | }
82 |
83 | /**
84 | * get action url
85 | *
86 | * @return string
87 | */
88 | public function getAction()
89 | {
90 | $doc = Board::find($this->identifier);
91 |
92 | $url = app('xe.board.url')->get('trash', ['id' => $this->identifier], $doc->instance_id);
93 |
94 | return 'var url = "' . $url . '" + window.location.search;
95 | XE.ajax(url, {
96 | type: "post",
97 | dataType: "json",
98 | data: {
99 | id: "' . $this->identifier . '"
100 | },
101 | success: function (data) {
102 | location.replace(data.links.href);
103 | }
104 | });';
105 | }
106 |
107 | /**
108 | * get script
109 | *
110 | * @return null
111 | */
112 | public function getScript()
113 | {
114 | return null;
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/components/ToggleMenus/Shares/CopyItem.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 |
15 | namespace Xpressengine\Plugins\Board\Components\ToggleMenus\Shares;
16 |
17 | use Xpressengine\ToggleMenu\AbstractToggleMenu;
18 |
19 | /**
20 | * CopyItem
21 | *
22 | * @category Board
23 | * @package Xpressengine\Plugins\Board
24 | * @author XE Developers
25 | * @copyright 2019 Copyright XEHub Corp.
26 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
27 | * @link https://xpressengine.io
28 | */
29 | class CopyItem extends AbstractToggleMenu
30 | {
31 |
32 | /**
33 | * 메뉴에서 보여질 문자열
34 | *
35 | * @return string
36 | */
37 | public function getText()
38 | {
39 | return xe_trans('board::permalink');
40 | }
41 |
42 | /**
43 | * 메뉴의 타입
44 | * 'exec' or 'link' or 'raw' 중에 하나
45 | *
46 | * @return string
47 | */
48 | public function getType()
49 | {
50 | return static::MENUTYPE_RAW;
51 | }
52 |
53 | /**
54 | * 실행되기 위한 js 문자열
55 | * 타입이 'raw' 인 경우에는 html
56 | *
57 | * @return string
58 | */
59 | public function getAction()
60 | {
61 | $url = app('request')->get('url');
62 | return ''
63 | .$this->getText().'';
64 | }
65 |
66 | /**
67 | * 별도의 js 파일을 load 해야 하는 경우 해당 파일의 경로
68 | * 없는 경우 null 반환
69 | *
70 | * @return string|null
71 | */
72 | public function getScript()
73 | {
74 | return null;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/components/ToggleMenus/Shares/FacebookItem.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 |
15 | namespace Xpressengine\Plugins\Board\Components\ToggleMenus\Shares;
16 |
17 | use Xpressengine\ToggleMenu\AbstractToggleMenu;
18 |
19 | /**
20 | * FacebookItem
21 | *
22 | * @category Board
23 | * @package Xpressengine\Plugins\Board
24 | * @author XE Developers
25 | * @copyright 2019 Copyright XEHub Corp.
26 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
27 | * @link https://xpressengine.io
28 | */
29 | class FacebookItem extends AbstractToggleMenu
30 | {
31 |
32 | /**
33 | * 메뉴에서 보여질 문자열
34 | *
35 | * @return string
36 | */
37 | public function getText()
38 | {
39 | return xe_trans('board::facebook');
40 | }
41 |
42 | /**
43 | * 메뉴의 타입
44 | * 'exec' or 'link' or 'raw' 중에 하나
45 | *
46 | * @return string
47 | */
48 | public function getType()
49 | {
50 | return static::MENUTYPE_RAW;
51 | }
52 |
53 | /**
54 | * 실행되기 위한 js 문자열
55 | * 타입이 'raw' 인 경우에는 html
56 | *
57 | * @return string
58 | */
59 | public function getAction()
60 | {
61 | $url = 'http://www.facebook.com/sharer/sharer.php?u=' . urlencode(app('request')->get('url'));
62 | return ''
63 | .$this->getText().'';
64 | }
65 |
66 | /**
67 | * 별도의 js 파일을 load 해야 하는 경우 해당 파일의 경로
68 | * 없는 경우 null 반환
69 | *
70 | * @return string|null
71 | */
72 | public function getScript()
73 | {
74 | return null;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/components/ToggleMenus/Shares/LineItem.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 |
15 | namespace Xpressengine\Plugins\Board\Components\ToggleMenus\Shares;
16 |
17 | use Xpressengine\ToggleMenu\AbstractToggleMenu;
18 |
19 | /**
20 | * LineItem
21 | *
22 | * @category Board
23 | * @package Xpressengine\Plugins\Board
24 | * @author XE Developers
25 | * @copyright 2019 Copyright XEHub Corp.
26 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
27 | * @link https://xpressengine.io
28 | */
29 | class LineItem extends AbstractToggleMenu
30 | {
31 | /**
32 | * 메뉴에서 보여질 문자열
33 | *
34 | * @return string
35 | */
36 | public function getText()
37 | {
38 | return xe_trans('board::line');
39 | }
40 |
41 | /**
42 | * 메뉴의 타입
43 | * 'exec' or 'link' or 'raw' 중에 하나
44 | *
45 | * @return string
46 | */
47 | public function getType()
48 | {
49 | return static::MENUTYPE_RAW;
50 | }
51 |
52 | /**
53 | * 실행되기 위한 js 문자열
54 | * 타입이 'raw' 인 경우에는 html
55 | *
56 | * @return string
57 | */
58 | public function getAction()
59 | {
60 | $url = 'http://line.me/R/msg/text/?title=' . urlencode(app('request')->get('url'));
61 | return ''
62 | .$this->getText().'';
63 | }
64 |
65 | /**
66 | * 별도의 js 파일을 load 해야 하는 경우 해당 파일의 경로
67 | * 없는 경우 null 반환
68 | *
69 | * @return string|null
70 | */
71 | public function getScript()
72 | {
73 | return null;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/components/ToggleMenus/Shares/TwitterItem.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 |
15 | namespace Xpressengine\Plugins\Board\Components\ToggleMenus\Shares;
16 |
17 | use Xpressengine\ToggleMenu\AbstractToggleMenu;
18 |
19 | /**
20 | * TwitterItem
21 | *
22 | * @category Board
23 | * @package Xpressengine\Plugins\Board
24 | * @author XE Developers
25 | * @copyright 2019 Copyright XEHub Corp.
26 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
27 | * @link https://xpressengine.io
28 | */
29 | class TwitterItem extends AbstractToggleMenu
30 | {
31 |
32 | /**
33 | * 메뉴에서 보여질 문자열
34 | *
35 | * @return string
36 | */
37 | public function getText()
38 | {
39 | return xe_trans('board::twitter');
40 | }
41 |
42 | /**
43 | * 메뉴의 타입
44 | * 'exec' or 'link' or 'raw' 중에 하나
45 | *
46 | * @return string
47 | */
48 | public function getType()
49 | {
50 | return static::MENUTYPE_RAW;
51 | }
52 |
53 | /**
54 | * 실행되기 위한 js 문자열
55 | * 타입이 'raw' 인 경우에는 html
56 | *
57 | * @return string
58 | */
59 | public function getAction()
60 | {
61 | $url = 'https://twitter.com/intent/tweet?url=' . urlencode(app('request')->get('url'));
62 | return ''
63 | .$this->getText().'';
64 | }
65 |
66 | /**
67 | * 별도의 js 파일을 load 해야 하는 경우 해당 파일의 경로
68 | * 없는 경우 null 반환
69 | *
70 | * @return string|null
71 | */
72 | public function getScript()
73 | {
74 | return null;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/components/UIObjects/DesignSelect/designSelectItem.blade.php:
--------------------------------------------------------------------------------
1 | @php
2 | use Xpressengine\Plugins\Board\Components\UIObjects\DesignSelect\DesignSelectUIObject;
3 | @endphp
4 |
5 | @if(isset($items) && is_array($items) && count($items))
6 |
16 | @endif
17 |
--------------------------------------------------------------------------------
/components/UIObjects/NewSelect/assets/css/newSelectStyle.css:
--------------------------------------------------------------------------------
1 | @charset "UTF-8";
2 | .new-select {
3 | white-space: normal;
4 | }
5 |
6 | .new-select .xe-dropdown__button .xe-dropdown__button-box {
7 | position: relative;
8 | }
9 |
10 | .new-select .xe-dropdown__button .xe-dropdown--menu {
11 | z-index: 5;
12 | display: none;
13 | border: 1px solid #d4d5dc;
14 | border-radius: 3px;
15 | background: #fff;
16 | position: absolute;
17 | padding: 10px 0;
18 | overflow: hidden;
19 | }
20 |
21 | .new-select .xe-dropdown__button .xe-dropdown__button-box .xe-dropdown__button-text {
22 | background: transparent;
23 | border: none;
24 | margin: 0;
25 | padding: 0;
26 | color: #767676;
27 | font-size: 14px;
28 | }
29 |
30 | .new-select .xe-dropdown__button .xe-dropdown__button-box .xe-dropdown__button-text:after {
31 | display: inline-block;
32 | font-family: xeicon !important;
33 | content: "\e943";
34 | margin-right: 5px;
35 | }
36 |
37 |
38 | .new-select .xe-dropdown__button .xe-dropdown--menu.open {
39 | display: block;
40 | }
41 |
42 | .new-select .xe-dropdown__button .xe-dropdown--menu .xe-dropdown--menu-item {
43 | position: relative;
44 | font-size:14px;
45 | }
46 |
47 | .new-select .xe-dropdown__button .xe-dropdown--menu .xe-dropdown--menu-item.on {
48 | color: #fff;
49 | }
50 |
51 | .new-select .xe-dropdown__button .xe-dropdown--menu .xe-dropdown--menu-item .xe-dropdown--menu-item-link:focus:after {
52 | content:'';
53 | position: absolute;
54 | top: 0;
55 | bottom: 0;
56 | width: 100vw;
57 | background: #f5f5f5;
58 | padding-right: 20px;
59 | left: -100%;
60 | z-index: -1;
61 | }
62 |
63 | .new-select .xe-dropdown__button .xe-dropdown--menu .xe-dropdown--menu-item:hover:after {
64 | content:'';
65 | position: absolute;
66 | top: 0;
67 | bottom: 0;
68 | width: 100vw;
69 | background: #f5f5f5;
70 | padding-right: 20px;
71 | left: -100%;
72 | z-index: -1;
73 | }
74 |
75 | .new-select .xe-dropdown__button .xe-dropdown--menu .xe-dropdown--menu-item.on:after {
76 | content:'';
77 | position: absolute;
78 | top: 0;
79 | bottom: 0;
80 | width: 100vw;
81 | background: #141414;
82 | left: -100%;
83 | z-index: -1;
84 | }
85 |
86 | .new-select .xe-dropdown__button .xe-dropdown--menu .xe-dropdown--menu-item.on:after a{
87 | color: #fff;
88 | }
89 |
90 | .new-select .xe-dropdown__button .xe-dropdown--menu .xe-dropdown--sub-menu {
91 | padding-left: 10px;
92 | }
93 |
94 | .new-select .xe-dropdown__button .xe-dropdown--menu .xe-dropdown--menu-item-link {
95 | text-decoration: none;
96 | color: #141414;
97 | padding: 5px 10px;
98 | display: inline-block;
99 | min-width: 150px;
100 | max-width: 500px;
101 | font-size: 14px;
102 | }
103 |
104 |
105 | .new-select .xe-dropdown__button .xe-dropdown--menu .xe-dropdown--menu-item.on .xe-dropdown--menu-item-link {
106 | color: #fff;
107 | }
108 |
109 | .new-select .xe-dropdown__button .xe-dropdown--menu .xe-dropdown--sub-menu .xe-dropdown--menu-item-link:before {
110 | content: '└ ';
111 | }
112 |
--------------------------------------------------------------------------------
/components/UIObjects/NewSelect/assets/js/newSelect.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 | $('.xe-dropdown--menu-item').on('click', function (e) {
3 | e.preventDefault()
4 |
5 | var $this = $(this)
6 | var $container = $(this).closest('.new-select')
7 | var $parent = $(this).closest('.xe-dropdown__button')
8 | var name = $(this).closest('.xe-dropdown--menu').data('name')
9 | var $nameInput = $container.find('[name=' + name + ']')
10 |
11 | $parent.find('.xe-dropdown--menu-item').removeClass('on')
12 | $this.addClass('on')
13 | $nameInput.val($this.data('value'))
14 | $container.find('button').text($this.text())
15 |
16 | $nameInput.trigger('change')
17 | })
18 | })
19 |
--------------------------------------------------------------------------------
/components/UIObjects/NewSelect/newSelect.blade.php:
--------------------------------------------------------------------------------
1 | @php
2 | use Xpressengine\Plugins\Board\Components\UIObjects\NewSelect\NewSelectUIObject;
3 | @endphp
4 |
5 |
6 |
7 |
24 |
25 |
--------------------------------------------------------------------------------
/components/UIObjects/NewSelect/newSelectItem.blade.php:
--------------------------------------------------------------------------------
1 | @php
2 | use Xpressengine\Plugins\Board\Components\UIObjects\NewSelect\NewSelectUIObject;
3 | @endphp
4 |
5 | @if(isset($items) && is_array($items) && count($items))
6 | @foreach ($items as $item)
7 |
10 |
15 | @endforeach
16 | @endif
--------------------------------------------------------------------------------
/components/UIObjects/NewTitle/NewTitleUIObject.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2020 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 |
15 | namespace Xpressengine\Plugins\Board\Components\UIObjects\NewTitle;
16 |
17 | use View;
18 | use XeFrontend;
19 | use Xpressengine\UIObject\AbstractUIObject;
20 |
21 | /**
22 | * NewTitle
23 | *
24 | * 신규 게시판 스킨에서 게시판 글 등록할 때 slug 지원하는 input box
25 | *
26 | * @category Board
27 | * @package Xpressengine\Plugins\Board
28 | * @author XE Developers
29 | * @copyright 2020 Copyright XEHub Corp.
30 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
31 | * @link https://xpressengine.io
32 | */
33 | class NewTitleUIObject extends AbstractUIObject
34 | {
35 | /**
36 | * @var bool
37 | */
38 | protected static $loaded = false;
39 |
40 | /**
41 | * @var string
42 | */
43 | protected static $id = 'uiobject/board@new_title';
44 |
45 | /**
46 | * render
47 | *
48 | * @return \Illuminate\Contracts\View\View
49 | */
50 | public function render()
51 | {
52 | $args = $this->arguments;
53 |
54 | if (empty($args['id'])) {
55 | $args['id'] = '';
56 | }
57 |
58 | if (empty($args['slug'])) {
59 | $args['slug'] = '';
60 | }
61 |
62 | if (empty($args['slugDomName'])) {
63 | $args['slugDomName'] = 'slug';
64 | }
65 | if (empty($args['titleDomName'])) {
66 | $args['titleDomName'] = 'title';
67 | }
68 |
69 | if (empty($args['titleClassName'])) {
70 | $args['titleClassName'] = 'xe-form-control title';
71 | }
72 |
73 | $args['scriptInit'] = false;
74 | if (self::$loaded === false) {
75 | self::$loaded = true;
76 |
77 | $args['scriptInit'] = true;
78 |
79 | // XeFrontend::js('plugins/board/components/UIObjects/NewTitle/assets/js/newTitle.js')->load();
80 | }
81 |
82 | return View::make('board::components/UIObjects/NewTitle/title', $args)->render();
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/components/UIObjects/Share/ShareUIObject.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Components\UIObjects\Share;
15 |
16 | use App\Facades\XeFrontend;
17 | use Xpressengine\UIObject\AbstractUIObject;
18 | use View;
19 | use Route;
20 | use XeConfig;
21 |
22 | /**
23 | * Share
24 | *
25 | * @category Board
26 | * @package Xpressengine\Plugins\Board
27 | * @author XE Developers
28 | * @copyright 2019 Copyright XEHub Corp.
29 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
30 | * @link https://xpressengine.io
31 | */
32 | class ShareUIObject extends AbstractUIObject
33 | {
34 | protected static $loaded = false;
35 |
36 | protected static $id = 'uiobject/board@share';
37 |
38 | /**
39 | *
40 | */
41 | const CONFIG_NAME = 'uiobject/board@share';
42 |
43 | /**
44 | * boot
45 | *
46 | * @return void
47 | */
48 | public static function boot()
49 | {
50 | self::registerSettingsRoute();
51 | }
52 |
53 | /**
54 | * Register Plugin Manage Route
55 | *
56 | * @return void
57 | */
58 | protected static function registerSettingsRoute()
59 | {
60 | Route::settings(self::getId(), function () {
61 | Route::get(
62 | '/config',
63 | ['as' => 'settings.board.share.config', 'uses' => 'ShareSettingsController@config']
64 | );
65 | }, ['namespace' => 'Xpressengine\Plugins\Board\Controllers']);
66 | }
67 |
68 | /**
69 | * render
70 | *
71 | * @return mixed
72 | */
73 | public function render()
74 | {
75 | if (self::$loaded === false) {
76 | self::$loaded = true;
77 | XeFrontend::js('/plugins/board/components/UIObjects/Share/assets/share.js')->load();
78 | }
79 |
80 | $args = $this->arguments;
81 |
82 | $item = $args['item'];
83 | $url = $args['url'];
84 | $className = (isset($args['className'])) ? $args['className'] : '';
85 |
86 |
87 | return View::make('board::components/UIObjects/Share/share', [
88 | 'url' => $url,
89 | 'item' => $item,
90 | 'className' => $className
91 | ])->render();
92 | }
93 |
94 | /**
95 | * get manage URI
96 | *
97 | * @return string
98 | */
99 | public static function getSettingsURI()
100 | {
101 | return route('settings.board.share.config');
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/components/UIObjects/Share/assets/share.js:
--------------------------------------------------------------------------------
1 | (function ($) {
2 | if (BoardShare == undefined) {
3 | var BoardShare = {
4 | init: function () {
5 | $('body').on('click', '.xe-toggle-menu .share-item', function (event) {
6 | event.preventDefault()
7 |
8 | var $target = $(event.target),
9 | $anchor = $target.closest('a')
10 | if ($anchor.data('type') == 'copy') {
11 | BoardShare.copyToClipboard($anchor.data('url'))
12 | XE.toast('info', 'Complete')
13 | } else {
14 | window.open($anchor.data('url'))
15 | }
16 | })
17 | },
18 | copyToClipboard: function (text) {
19 | if (window.clipboardData && window.clipboardData.setData) {
20 | // IE specific code path to prevent textarea being shown while dialog is visible.
21 | return clipboardData.setData('Text', text)
22 | } else if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
23 | var textarea = document.createElement('textarea')
24 | textarea.textContent = text
25 | textarea.style.position = 'fixed' // Prevent scrolling to bottom of page in MS Edge.
26 | document.body.appendChild(textarea)
27 | textarea.select()
28 | try {
29 | return document.execCommand('copy') // Security exception may be thrown by some browsers.
30 | } catch (ex) {
31 | console.warn('Copy to clipboard failed.', ex)
32 | return false
33 | } finally {
34 | document.body.removeChild(textarea)
35 | }
36 | }
37 | },
38 | searchToObject: function () {
39 | return search.substring(1).split('&').reduce(function (result, value) {
40 | var parts = value.split('=')
41 | if (parts[0]) result[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1])
42 | return result
43 | }, {})
44 | }
45 | }
46 | }
47 |
48 | $(function () {
49 | BoardShare.init()
50 | })
51 | })(window.jQuery)
52 |
--------------------------------------------------------------------------------
/components/UIObjects/Share/setting.blade.php:
--------------------------------------------------------------------------------
1 | @section('page_title')
2 | Share
3 | @endsection
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
{{xe_trans('xe::toggleMenu')}}
13 |
14 |
15 |
16 |
17 | {!! $toggleMenuSection !!}
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/components/UIObjects/Share/share.blade.php:
--------------------------------------------------------------------------------
1 | $item->id, 'type'=>'uiobject/board@share', 'instanceId'=>$item->instance_id, 'url'=>$url]) !!}'
7 | data-side="dropdown-menu-right">
8 |
{{ xe_trans('board::share') }}
9 |
10 |
11 |
23 |
--------------------------------------------------------------------------------
/components/UIObjects/Tag/TagUIObject.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Components\UIObjects\Tag;
15 |
16 | use Xpressengine\UIObject\AbstractUIObject;
17 | use View;
18 | use XePlugin;
19 |
20 | /**
21 | * Tag
22 | *
23 | * 게시판 글 등록할 때 slug 지원하는 input box
24 | *
25 | * @category Board
26 | * @package Xpressengine\Plugins\Board
27 | * @author XE Developers
28 | * @copyright 2019 Copyright XEHub Corp.
29 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
30 | * @link https://xpressengine.io
31 | */
32 | class TagUIObject extends AbstractUIObject
33 | {
34 | /**
35 | * @var bool
36 | */
37 | protected static $loaded = false;
38 |
39 | /**
40 | * @var string
41 | */
42 | protected static $id = 'uiobject/board@tag';
43 |
44 | /**
45 | * render
46 | *
47 | * @return \Illuminate\Contracts\View\View
48 | */
49 | public function render()
50 | {
51 | $args = $this->arguments;
52 |
53 | if (empty($args['tags'])) {
54 | $args['tags'] = [];
55 | }
56 |
57 | $args['strTags'] = '';
58 | if (is_array($args['tags']) && count($args['tags']) > 0) {
59 | $tagWords = [];
60 | foreach ($args['tags'] as $tag) {
61 | $tagWords[] = $tag['word'];
62 | }
63 | $args['strTags'] = sprintf('["%s"]', implode('","', $tagWords));
64 | }
65 |
66 |
67 | if (empty($args['id'])) {
68 | $args['id'] = 'xeBoardTagWrap';
69 | }
70 | if (empty($args['titleDomName'])) {
71 | $args['titleDomName'] = 'Tag';
72 | }
73 |
74 | if (empty($args['class'])) {
75 | $args['class'] = 'xe-select-label __xe-board-tag';
76 | }
77 |
78 | if (empty($args['placeholder'])) {
79 | $args['placeholder'] = xe_trans('board::inputTag');
80 | }
81 |
82 | if (empty($args['url'])) {
83 | $args['url'] = '/editor/hashTag';
84 | }
85 |
86 | $args['scriptInit'] = false;
87 | if (self::$loaded === false) {
88 | self::$loaded = true;
89 |
90 | $args['scriptInit'] = true;
91 | }
92 |
93 | $plugin = XePlugin::getPlugin('board');
94 | return View::make('board::components/UIObjects/Tag/tag', $args)->render();
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/components/UIObjects/Tag/tag.blade.php:
--------------------------------------------------------------------------------
1 | @if ($scriptInit)
2 | {{ XeFrontend::js('plugins/board/assets/js/BoardTags.js')->appendTo('body')->load() }}
3 | @endif
4 |
5 |
6 |
7 |
8 |
9 |
43 |
--------------------------------------------------------------------------------
/components/UIObjects/Title/TitleUIObject.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Components\UIObjects\Title;
15 |
16 | use Xpressengine\UIObject\AbstractUIObject;
17 | use View;
18 | use XePlugin;
19 |
20 | /**
21 | * Title
22 | *
23 | * 게시판 글 등록할 때 slug 지원하는 input box
24 | *
25 | * @category Board
26 | * @package Xpressengine\Plugins\Board
27 | * @author XE Developers
28 | * @copyright 2019 Copyright XEHub Corp.
29 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
30 | * @link https://xpressengine.io
31 | */
32 | class TitleUIObject extends AbstractUIObject
33 | {
34 | /**
35 | * @var bool
36 | */
37 | protected static $loaded = false;
38 |
39 | /**
40 | * @var string
41 | */
42 | protected static $id = 'uiobject/board@title';
43 |
44 | /**
45 | * render
46 | *
47 | * @return \Illuminate\Contracts\View\View
48 | */
49 | public function render()
50 | {
51 | $args = $this->arguments;
52 |
53 | if (empty($args['id'])) {
54 | $args['id'] = '';
55 | }
56 |
57 | if (empty($args['slug'])) {
58 | $args['slug'] = '';
59 | }
60 |
61 | if (empty($args['slugDomName'])) {
62 | $args['slugDomName'] = 'slug';
63 | }
64 | if (empty($args['titleDomName'])) {
65 | $args['titleDomName'] = 'title';
66 | }
67 |
68 | if (empty($args['titleClassName'])) {
69 | $args['titleClassName'] = 'xe-form-control title';
70 | }
71 |
72 | $args['scriptInit'] = false;
73 | if (self::$loaded === false) {
74 | self::$loaded = true;
75 |
76 | $args['scriptInit'] = true;
77 | }
78 |
79 | $plugin = XePlugin::getPlugin('board');
80 | return View::make('board::components/UIObjects/Title/title', $args)->render();
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/components/Widgets/ArticleList/Skins/Basic/BasicCardSkin.php:
--------------------------------------------------------------------------------
1 | [
4 | 'imageWidth' => [
5 | '_type' => 'text',
6 | 'label' => '이미지 너비(width)'
7 | ],
8 | ],
9 | 'support' => [
10 | 'mobile' => true,
11 | 'desktop' => true
12 | ]
13 | ];
14 |
--------------------------------------------------------------------------------
/components/Widgets/ArticleList/Skins/Basic/info-list.php:
--------------------------------------------------------------------------------
1 | [
4 | 'mobile' => true,
5 | 'desktop' => true
6 | ]
7 | ];
8 |
--------------------------------------------------------------------------------
/components/Widgets/ArticleList/Skins/Basic/views/setting.blade.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/components/Widgets/ArticleList/Skins/Basic/views/setting.blade.php
--------------------------------------------------------------------------------
/components/Widgets/ArticleList/Skins/Basic/views/widget-card.blade.php:
--------------------------------------------------------------------------------
1 | {{ app('xe.frontend')->css([
2 | $_skin::asset('css/widget-basic.css')
3 | ])->load() }}
4 |
5 |
50 |
--------------------------------------------------------------------------------
/components/Widgets/ArticleList/Skins/Basic/views/widget-list.blade.php:
--------------------------------------------------------------------------------
1 | {{ app('xe.frontend')->css([
2 | $_skin::asset('css/widget-basic.css')
3 | ])->load() }}
4 |
5 |
44 |
--------------------------------------------------------------------------------
/components/Widgets/ArticleList/Skins/Common/CommonSkin.php:
--------------------------------------------------------------------------------
1 | $args
25 | ]);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/components/Widgets/ArticleList/Skins/Common/views/setting.blade.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/components/Widgets/ArticleList/Skins/Common/views/setting.blade.php
--------------------------------------------------------------------------------
/components/Widgets/ArticleList/Skins/Common/views/widget.blade.php:
--------------------------------------------------------------------------------
1 | {{ XeFrontend::css('plugins/board/assets/css/widget.list.css')->load() }}
2 |
40 |
--------------------------------------------------------------------------------
/components/Widgets/ArticleList/Skins/Gallery/views/setting.blade.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/components/Widgets/ArticleList/Skins/Gallery/views/setting.blade.php
--------------------------------------------------------------------------------
/components/Widgets/ArticleList/Skins/Gallery/views/widget.blade.php:
--------------------------------------------------------------------------------
1 | {{ XeFrontend::css('plugins/board/assets/css/widget.gallery.css')->load() }}
2 |
35 |
--------------------------------------------------------------------------------
/components/Widgets/ArticleList/views/category.blade.php:
--------------------------------------------------------------------------------
1 |
2 | @foreach($category['children'] as $child)
3 | @include('board::components.Widgets.ArticleList.views.category', ['category'=>$child,'depth'=>$depth+1])
4 | @endforeach
5 |
--------------------------------------------------------------------------------
/components/Widgets/ArticleList/views/setting.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
25 |
26 |
27 |
28 |
33 |
34 |
35 | 글 설정
36 |
37 |
38 |
39 |
40 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
68 |
--------------------------------------------------------------------------------
/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/icon.png
--------------------------------------------------------------------------------
/markup/new_skin/layout/_dropdown-order.html:
--------------------------------------------------------------------------------
1 |
19 |
--------------------------------------------------------------------------------
/markup/new_skin/layout/_footer.html:
--------------------------------------------------------------------------------
1 |
12 |
13 |
29 |
30 |
31 |
32 |
45 |
48 |
--------------------------------------------------------------------------------
/markup/new_skin/layout/_pagination.html:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/markup/new_skin/layout/new-board-comment.html:
--------------------------------------------------------------------------------
1 | f
--------------------------------------------------------------------------------
/markup/new_skin/layout/new-board-show.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/markup/new_skin/layout/new-board-show.html
--------------------------------------------------------------------------------
/markup/new_skin/src/layout/_dropdown-order.html:
--------------------------------------------------------------------------------
1 |
19 |
--------------------------------------------------------------------------------
/markup/new_skin/src/layout/_footer.html:
--------------------------------------------------------------------------------
1 |
12 |
13 |
16 |
--------------------------------------------------------------------------------
/markup/new_skin/src/layout/_header.html:
--------------------------------------------------------------------------------
1 |
13 |
14 |
--------------------------------------------------------------------------------
/markup/new_skin/src/layout/_pagination.html:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/markup/new_skin/src/new-board-search.html:
--------------------------------------------------------------------------------
1 |
2 | 웹진형 -
3 |
4 |
5 | 등록된 게시물이 없습니다.
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/markup/sample/@iu.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/markup/sample/@iu.jpg
--------------------------------------------------------------------------------
/markup/sample/markup_test.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function(){
2 |
3 | $(".bd_sorting").on("click", function(e){
4 | $(this).toggleClass("on");
5 | if($(this).hasClass("on")){
6 | $(".board-sorting-area").removeClass("xe-hidden-xs");
7 | $(".board .bd_dimmed").show();
8 | } else{
9 | $(".board-sorting-area").addClass("xe-hidden-xs");
10 | $(".board .bd_dimmed").hide();
11 | }
12 | return false;
13 | });
14 |
15 | $(".bd_manage").on("click", function(e){
16 | $(this).toggleClass("on");
17 | if($(this).hasClass("on")){
18 | $(".bd_manage_detail").show();
19 | } else{
20 | $(".bd_manage_detail").hide();
21 | }
22 | return false;
23 | });
24 |
25 | $(".bd_select").on("click", function(e){
26 | $(this).parent().toggleClass("on");
27 | $(this).toggleClass("on");
28 | return false;
29 | });
30 |
31 | $(".bd_search").on("click", function(e){
32 | $(this).toggleClass("on");
33 |
34 | if($(this).hasClass("on")){
35 | $(".bd_search_area").show();
36 | $(".bd_search_input").focus();
37 | } else{
38 | $(".bd_search_area").hide();
39 | }
40 |
41 | $(".bd_btn_detail").on("click", function(e){
42 | $(this).toggleClass("on");
43 | if($(this).hasClass("on")){
44 | $(".bd_search_detail").show();
45 | } else{
46 | $(".bd_search_detail").hide();
47 | }
48 | return false;
49 | });
50 | return false;
51 | });
52 |
53 | $(".read_header .mb_autohr, .bd_like, .bd_favorite, .bd_btn_file, .bd_share, .bd_more_view, .bd_like_num, .btn_file, .like_num, .like, .share, .reply, .comment_more_view, .author, .mb_autohr, .comment_modify").on("click", function(e){
54 |
55 | $(this).toggleClass("on");
56 | if($(this).hasClass("bd_like_num")){
57 | $(".bd_like_more").toggle();
58 | }
59 |
60 | if($(this).hasClass("like_num")){
61 | $(this).parent().parent().find(".vote_list").toggle();
62 | }
63 |
64 | if($(this).hasClass("reply")){
65 | var el = $(this).parent().parent().find(".comment_action_area");
66 | var el2 = $(this).parent().parent().find(".comment_action_area.modify");
67 | el.toggle();
68 | el2.toggle();
69 | }
70 |
71 | if($(this).hasClass("comment_modify")){
72 | $(this).parent().parent().parent().find(".comment_action_area.modify, .xe_content, .comment_action").toggle();
73 | }
74 |
75 | if($(this).hasClass("temp_save_num")){
76 | $(".temp_save_list").toggle();
77 | }
78 |
79 | return false;
80 | });
81 |
82 | })
83 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "test": "echo \"Error: no test specified\" && exit 1",
5 | "build": "./node_modules/webpack/bin/webpack.js -p",
6 | "watch": "./node_modules/webpack/bin/webpack.js --watch",
7 | "eslint": "./node_modules/eslint/bin/eslint.js ./assets/js/src",
8 | "eslint-fix": "./node_modules/eslint/bin/eslint.js --fix ./assets/js/src"
9 | },
10 | "dependencies": {
11 | "@johmun/vue-tags-input": "^2.1.0",
12 | "copy-webpack-plugin": "^4.6.0",
13 | "gulp": "^4.0.2"
14 | },
15 | "devDependencies": {
16 | "babel-cli": "^6.26.0",
17 | "babel-core": "^6.26.3",
18 | "babel-loader": "^7.1.4",
19 | "babel-preset-env": "^1.6.1",
20 | "babel-register": "^6.26.0",
21 | "eslint": "^4.19.1",
22 | "eslint-config-standard": "^11.0.0",
23 | "eslint-plugin-import": "^2.20.1",
24 | "eslint-plugin-promise": "^3.8.0",
25 | "eslint-plugin-standard": "^3.1.0",
26 | "path": "^0.12.7",
27 | "vue": "^2.6.11",
28 | "vue-html-loader": "^1.2.4",
29 | "vue-loader": "^14.2.4",
30 | "vue-template-compiler": "^2.6.11",
31 | "webpack": "^3.12.0"
32 | },
33 | "eslintConfig": {
34 | "extends": "standard",
35 | "env": {
36 | "browser": true,
37 | "node": true,
38 | "jquery": true
39 | },
40 | "globals": {}
41 | },
42 | "eslintIgnore": [
43 | "./board.js",
44 | "./BoardTags.js",
45 | "tests/"
46 | ]
47 | }
48 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/phpunit.xml
--------------------------------------------------------------------------------
/plugin.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 |
15 | namespace Xpressengine\Plugins\Board;
16 |
17 | use Xpressengine\Plugin\AbstractPlugin;
18 | use Xpressengine\Plugins\Board\Plugin\Database;
19 | use Xpressengine\Plugins\Board\Plugin\Resources;
20 | use Xpressengine\Plugins\Board\Plugin\Update;
21 |
22 | /**
23 | * Plugin
24 | *
25 | * @category Board
26 | * @package Xpressengine\Plugins\Board
27 | */
28 | class Plugin extends AbstractPlugin
29 | {
30 | /**
31 | * boot
32 | *
33 | * @return void
34 | */
35 | public function boot()
36 | {
37 | Resources::bindClasses();
38 | Resources::registerTitleWithSlug();
39 | Resources::registerRecycleBin();
40 | Resources::registerCommands();
41 | Resources::setDefaultSkin();
42 | Resources::interceptDynamicField();
43 | Resources::interceptDeleteCategory();
44 |
45 | Resources::listenCommentRetrievedEvent();
46 | Resources::listenCommentCreateEvent();
47 | }
48 |
49 | /**
50 | * activate
51 | *
52 | * @param null $installedVersion installed version
53 | * @return void
54 | */
55 | public function activate($installedVersion = null)
56 | {
57 | }
58 |
59 | /**install
60 | *
61 | * @return void
62 | */
63 | public function install()
64 | {
65 | Database::create();
66 |
67 | Resources::createDefaultConfig();
68 | Resources::createShareConfig();
69 | Resources::putLang();
70 | }
71 |
72 | /**
73 | * update
74 | *
75 | * @param null $installedVersion install version
76 | * @return void
77 | */
78 | public function update($installedVersion = null)
79 | {
80 | Update::proc($installedVersion);
81 | }
82 |
83 | /**
84 | * check update
85 | *
86 | * @param null $installedVersion
87 | * @return bool
88 | */
89 | public function checkUpdated($installedVersion = NULL)
90 | {
91 | return Update::check($installedVersion);
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/samples/.gitignore:
--------------------------------------------------------------------------------
1 | .gitignore
2 |
--------------------------------------------------------------------------------
/samples/board_flat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/samples/board_flat.png
--------------------------------------------------------------------------------
/src/BoardException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board;
15 |
16 | use Xpressengine\Support\Exceptions\XpressengineException;
17 |
18 | /**
19 | * BoardException
20 | *
21 | * @category Board
22 | * @package Xpressengine\Plugins\Board
23 | * @author XE Developers
24 | * @copyright 2019 Copyright XEHub Corp.
25 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
26 | * @link https://xpressengine.io
27 | */
28 | class BoardException extends XpressengineException
29 | {
30 | }
31 |
--------------------------------------------------------------------------------
/src/Commands/BoardSkinMake.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Commands;
15 |
16 | use App\Console\Commands\SkinMake;
17 |
18 | /**
19 | * BoardSkinMake
20 | *
21 | * @category Board
22 | * @package Xpressengine\Plugins\Board
23 | * @author XE Developers
24 | * @copyright 2019 Copyright XEHub Corp.
25 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
26 | * @link https://xpressengine.io
27 | */
28 | class BoardSkinMake extends SkinMake
29 | {
30 | protected $signature = 'make:board_skin
31 | {plugin : The plugin where the skin will be located}
32 | {name : The name of skin to create}
33 |
34 | {--id= : The identifier of skin. default "@"}
35 | {--path= : The path of skin. Enter the path to under the plugin. ex) SomeDir/SkinDir}
36 | {--class= : The class name of skin. default "Skin"}';
37 |
38 | /**
39 | * The console command description.
40 | *
41 | * @var string
42 | */
43 | protected $description = 'Create a new board skin';
44 |
45 | /**
46 | * get title
47 | *
48 | * @return string
49 | */
50 | protected function getTitleInput()
51 | {
52 | return $this->option('title') ?: studly_case($this->getComponentName()) . ' Board skin';
53 | }
54 |
55 | /**
56 | * get skin target
57 | *
58 | * @return string
59 | */
60 | protected function getSkinTarget()
61 | {
62 | return 'module/board@board';
63 | }
64 |
65 | /**
66 | * makeUsable
67 | *
68 | * @param \ArrayAccess|array $attr attributes
69 | * @return void
70 | * @throws \Exception
71 | */
72 | protected function makeUsable($attr)
73 | {
74 | $plugin = $attr['plugin'];
75 | $path = $plugin->getPath($attr['path']);
76 |
77 | $this->makeSkinClass($attr);
78 |
79 | rename($path.'/info.stub', $path.'/info.php');
80 |
81 | $viewFileNames = [
82 | 'create', 'edit', 'guestId', 'index', 'preview', 'revision', 'setting',
83 | 'show', 'votedModal', 'votedUserList', 'votedUsers',
84 | ];
85 |
86 | $replacePath = $plugin->getId().'/'.$attr['path'];
87 | foreach ($viewFileNames as $fileName) {
88 | $stub = sprintf('%s/views/%s.blade.stub', $path, $fileName);
89 | if (file_exists($stub)) {
90 | $code = $this->files->get($stub);
91 | $code = str_replace('DummyPath', $replacePath, $code);
92 | $this->files->put($stub, $code);
93 |
94 | $rename = sprintf('%s/views/%s.blade.php', $path, $fileName);
95 | rename($stub, $rename);
96 | }
97 | }
98 | }
99 |
100 | /**
101 | * get stub path
102 | *
103 | * @return string
104 | */
105 | protected function getStubPath()
106 | {
107 | return __DIR__.'/stubs/board_skin';
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/src/Commands/stubs/board_skin/assets/css/skin.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xpressengine/plugin-board/9ca47af29e441f1ad16ffcb79bdc0bc349c33d57/src/Commands/stubs/board_skin/assets/css/skin.css
--------------------------------------------------------------------------------
/src/Commands/stubs/board_skin/info.stub:
--------------------------------------------------------------------------------
1 | [
4 | 'sample_text' => [
5 | '_type' => 'text',
6 | '_section' => '기본설정',
7 | 'label' => '샘플 문구',
8 | 'placeholder' => '샘플용 설정 필드입니다.',
9 | 'description' => '샘플용 설정 필드입니다.',
10 | ],
11 | ],
12 | 'support' => [
13 | 'mobile' => true,
14 | 'desktop' => true
15 | ]
16 | ];
17 |
--------------------------------------------------------------------------------
/src/Commands/stubs/board_skin/skin.stub:
--------------------------------------------------------------------------------
1 | load() }}
2 |
3 | {{ XeFrontend::js('plugins/board/assets/js/board.js')->appendTo('body')->load() }}
4 |
5 | {{ XeFrontend::rule('board', $rules) }}
6 |
7 | {!! XeFrontend::css('assets/core/user/auth.css')->load() !!}
8 |
9 |
{{ xe_trans('xe::identification') }}
10 |
29 |
30 |
--------------------------------------------------------------------------------
/src/Commands/stubs/board_skin/views/preview.blade.stub:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 | {!! compile($config->get('boardId'), $content, $format === Xpressengine\Plugins\Board\Models\Board::FORMAT_HTML) !!}
15 |
16 |
--------------------------------------------------------------------------------
/src/Commands/stubs/board_skin/views/setting.blade.stub:
--------------------------------------------------------------------------------
1 | {{-- implement it!! --}}
2 |
3 |
--------------------------------------------------------------------------------
/src/Commands/stubs/board_skin/views/votedModal.blade.stub:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/src/Commands/stubs/board_skin/views/votedUserList.blade.stub:
--------------------------------------------------------------------------------
1 | @foreach($paginate as $log)
2 | @if($log->user->getId() == Auth::user()->getId())
3 |
4 |
5 |
6 |
7 |
8 |
9 |
{{$log->user->getDisplayName()}}
10 |
11 |
12 |
13 | @else
14 |
15 |
16 |
17 |
18 |
{{$log->user->getDisplayName()}}
19 |
{{$log->created_at}}
20 |
21 |
22 |
23 | @endif
24 | @endforeach
25 |
--------------------------------------------------------------------------------
/src/Commands/stubs/board_skin/views/votedUsers.blade.stub:
--------------------------------------------------------------------------------
1 |
2 | @foreach ($logs as $log)
3 | - user->getId() == Auth::user()->getId()) class="on" @endif>
}})
4 | @endforeach
5 |
6 |
7 | @if ($item->assent_count > 10)
8 | {!! xe_trans('board::assentThisPostsOthers', [
9 | 'count'=> sprintf('%s', $urlHandler->get('votedModal', ['option' => $option, 'id' => $item->id]), $item->assent_count - 1),
10 | ]) !!}
11 | @endif
12 |
--------------------------------------------------------------------------------
/src/Controllers/ShareSettingsController.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 |
15 | namespace Xpressengine\Plugins\Board\Controllers;
16 |
17 | use App\Http\Controllers\Controller;
18 | use App\Http\Sections\ToggleMenuSection;
19 | use XePresenter;
20 | use XeConfig;
21 | use Xpressengine\Http\Request;
22 | use Xpressengine\Plugins\Board\Components\UIObjects\Share\ShareUIObject;
23 |
24 | /**
25 | * ShareSettingsController
26 | *
27 | * @category Board
28 | * @package Xpressengine\Plugins\Board
29 | * @author XE Developers
30 | * @copyright 2019 Copyright XEHub Corp.
31 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
32 | * @link https://xpressengine.io
33 | */
34 | class ShareSettingsController extends Controller
35 | {
36 | /**
37 | * config
38 | *
39 | * @return mixed|\Xpressengine\Presenter\Presentable
40 | */
41 | public function config()
42 | {
43 | $toggleMenuSection = new ToggleMenuSection(ShareUIObject::getId());
44 |
45 | return XePresenter::make('board::components/UIObjects/Share/setting', [
46 | 'toggleMenuSection' => $toggleMenuSection,
47 | ]);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/Exceptions/AlreadyExistFavoriteHttpException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Exceptions;
15 |
16 | use Xpressengine\Plugins\Board\HttpBoardException;
17 |
18 | /**
19 | * AlreadyExistFavoriteHttpException
20 | *
21 | * @category Board
22 | * @package Xpressengine\Plugins\Board
23 | * @author XE Developers
24 | * @copyright 2019 Copyright XEHub Corp.
25 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
26 | * @link https://xpressengine.io
27 | */
28 | class AlreadyExistFavoriteHttpException extends HttpBoardException
29 | {
30 | protected $message = 'board::favoriteAlreadyExist';
31 | }
32 |
--------------------------------------------------------------------------------
/src/Exceptions/AlreadyExistInstanceException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Exceptions;
15 |
16 | use Xpressengine\Plugins\Board\BoardException;
17 |
18 | /**
19 | * AlreadyExistsInstanceException
20 | *
21 | * @category Board
22 | * @package Xpressengine\Plugins\Board
23 | * @author XE Developers
24 | * @copyright 2019 Copyright XEHub Corp.
25 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
26 | * @link https://xpressengine.io
27 | */
28 | class AlreadyExistsInstanceException extends BoardException
29 | {
30 | }
31 |
--------------------------------------------------------------------------------
/src/Exceptions/AlreadyUseCategoryHttpException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Exceptions;
15 |
16 | use Illuminate\Http\Response;
17 | use Xpressengine\Plugins\Board\HttpBoardException;
18 |
19 | /**
20 | * AlreadyUseCategoryHttpException
21 | *
22 | * @category Board
23 | * @package Xpressengine\Plugins\Board
24 | * @author XE Developers
25 | * @copyright 2019 Copyright XEHub Corp.
26 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
27 | * @link https://xpressengine.io
28 | */
29 | class AlreadyUseCategoryHttpException extends HttpBoardException
30 | {
31 | /**
32 | * @var string
33 | */
34 | protected $message = 'board::alreadyUseCategory';
35 |
36 | /**
37 | * @var int
38 | */
39 | protected $statusCode = Response::HTTP_NOT_ACCEPTABLE;
40 | }
41 |
--------------------------------------------------------------------------------
/src/Exceptions/CaptchaNotVerifiedException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Exceptions;
15 |
16 | use Xpressengine\Plugins\Board\HttpBoardException;
17 | use Symfony\Component\HttpFoundation\Response;
18 |
19 | /**
20 | * CaptchaNotVerifiedException
21 | *
22 | * @category Board
23 | * @package Xpressengine\Plugins\Board
24 | * @author XE Developers
25 | * @copyright 2019 Copyright XEHub Corp.
26 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
27 | * @link https://xpressengine.io
28 | */
29 | class CaptchaNotVerifiedException extends HttpBoardException
30 | {
31 | protected $message = 'board::CaptchaNotVerified';
32 | protected $statusCode = Response::HTTP_FORBIDDEN;
33 | }
34 |
--------------------------------------------------------------------------------
/src/Exceptions/GuestWrittenSecretDocumentException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Exceptions;
15 |
16 | use Xpressengine\Plugins\Board\HttpBoardException;
17 |
18 | /**
19 | * GuestWrittenSecretDocument
20 | *
21 | * @category Board
22 | * @package Xpressengine\Plugins\Board
23 | * @author XE Developers
24 | * @copyright 2019 Copyright XEHub Corp.
25 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
26 | * @link https://xpressengine.io
27 | */
28 | class GuestWrittenSecretDocumentException extends HttpBoardException
29 | {
30 | }
31 |
--------------------------------------------------------------------------------
/src/Exceptions/HaveNoWritePermissionHttpException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Exceptions;
15 |
16 | use Xpressengine\Plugins\Board\HttpBoardException;
17 | use Symfony\Component\HttpFoundation\Response;
18 |
19 | /**
20 | * HaveNoWritePermissionHttpException
21 | *
22 | * @category Board
23 | * @package Xpressengine\Plugins\Board
24 | * @author XE Developers
25 | * @copyright 2019 Copyright XEHub Corp.
26 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
27 | * @link https://xpressengine.io
28 | */
29 | class HaveNoWritePermissionHttpException extends HttpBoardException
30 | {
31 | protected $message = 'board::HaveNoWritePermission';
32 | }
33 |
--------------------------------------------------------------------------------
/src/Exceptions/InvalidConfigException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Exceptions;
15 |
16 | use Xpressengine\Plugins\Board\BoardException;
17 |
18 | /**
19 | * InvalidConfigException
20 | *
21 | * PHP version 7
22 | *
23 | * @category Board
24 | * @package Xpressengine\Plugins\Board
25 | * @author XE Developers
26 | * @copyright 2019 Copyright XEHub Corp.
27 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
28 | * @link https://xpressengine.io
29 | */
30 | class InvalidConfigException extends BoardException
31 | {
32 | }
33 |
--------------------------------------------------------------------------------
/src/Exceptions/NotFoundConfigHttpException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Exceptions;
15 |
16 | use Xpressengine\Plugins\Board\HttpBoardException;
17 | use Symfony\Component\HttpFoundation\Response;
18 |
19 | /**
20 | * NotFoundConfigHttpException
21 | *
22 | * @category Board
23 | * @package Xpressengine\Plugins\Board
24 | * @author XE Developers
25 | * @copyright 2019 Copyright XEHub Corp.
26 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
27 | * @link https://xpressengine.io
28 | */
29 | class NotFoundConfigHttpException extends HttpBoardException
30 | {
31 | protected $message = 'xe::NotFoundConfig';
32 | }
33 |
--------------------------------------------------------------------------------
/src/Exceptions/NotFoundDocumentException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Exceptions;
15 |
16 | use Xpressengine\Plugins\Board\HttpBoardException;
17 | use Symfony\Component\HttpFoundation\Response;
18 |
19 | /**
20 | * NotFoundDocumentException
21 | *
22 | * @category Board
23 | * @package Xpressengine\Plugins\Board
24 | * @author XE Developers
25 | * @copyright 2019 Copyright XEHub Corp.
26 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
27 | * @link https://xpressengine.io
28 | */
29 | class NotFoundDocumentException extends HttpBoardException
30 | {
31 | protected $statusCode = Response::HTTP_GONE;
32 | protected $message = 'board::notFoundDocument';
33 | }
34 |
--------------------------------------------------------------------------------
/src/Exceptions/NotFoundFavoriteHttpException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Exceptions;
15 |
16 | use Xpressengine\Plugins\Board\HttpBoardException;
17 |
18 | /**
19 | * NotFoundFavoriteHttpException
20 | *
21 | * @category Board
22 | * @package Xpressengine\Plugins\Board
23 | * @author XE Developers
24 | * @copyright 2019 Copyright XEHub Corp.
25 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
26 | * @link https://xpressengine.io
27 | */
28 | class NotFoundFavoriteHttpException extends HttpBoardException
29 | {
30 | protected $message = 'board::notFoundFavorite';
31 | }
32 |
--------------------------------------------------------------------------------
/src/Exceptions/NotMatchedCertifyKeyException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Exceptions;
15 |
16 | use Xpressengine\Plugins\Board\HttpBoardException;
17 | use Symfony\Component\HttpFoundation\Response;
18 |
19 | /**
20 | * NotMatchedCertifyKeyException
21 | *
22 | * @category Board
23 | * @package Xpressengine\Plugins\Board
24 | * @author XE Developers
25 | * @copyright 2019 Copyright XEHub Corp.
26 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
27 | * @link https://xpressengine.io
28 | */
29 | class NotMatchedCertifyKeyException extends HttpBoardException
30 | {
31 | protected $message = 'board::notMatchedCertifyKey';
32 | protected $statusCode = Response::HTTP_UNAUTHORIZED;
33 | }
34 |
--------------------------------------------------------------------------------
/src/Exceptions/RequiredBoardIdException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Exceptions;
15 |
16 | use Xpressengine\Plugins\Board\BoardException;
17 |
18 | /**
19 | * RequiredBoardIdException
20 | *
21 | * PHP version 7
22 | *
23 | * @category Board
24 | * @package Xpressengine\Plugins\Board
25 | * @author XE Developers
26 | * @copyright 2019 Copyright XEHub Corp.
27 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
28 | * @link https://xpressengine.io
29 | */
30 | class RequiredBoardIdException extends BoardException
31 | {
32 | }
33 |
--------------------------------------------------------------------------------
/src/Exceptions/SecretDocumentHttpException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Exceptions;
15 |
16 | use Xpressengine\Plugins\Board\HttpBoardException;
17 | use Symfony\Component\HttpFoundation\Response;
18 |
19 | /**
20 | * SecretDocumentHttpException
21 | *
22 | * @category Board
23 | * @package Xpressengine\Plugins\Board
24 | * @author XE Developers
25 | * @copyright 2019 Copyright XEHub Corp.
26 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
27 | * @link https://xpressengine.io
28 | */
29 | class SecretDocumentHttpException extends HttpBoardException
30 | {
31 | protected $message = 'board::SecretStatePost';
32 | protected $statusCode = Response::HTTP_FORBIDDEN;
33 | }
34 |
--------------------------------------------------------------------------------
/src/GenericBoardSkin.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board;
15 |
16 | use Xpressengine\Skin\GenericSkin;
17 |
18 | /**
19 | * GenericBoardSkin
20 | *
21 | * @category Board
22 | * @package Xpressengine\Plugins\Board
23 | * @author XE Developers
24 | * @copyright 2019 Copyright XEHub Corp.
25 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
26 | * @link https://xpressengine.io
27 | */
28 | class GenericBoardSkin extends GenericSkin
29 | {
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/HttpBoardException.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board;
15 |
16 | use Xpressengine\Support\Exceptions\HttpXpressengineException;
17 |
18 | /**
19 | * HttpBoardException
20 | *
21 | * @category Board
22 | * @package Xpressengine\Plugins\Board
23 | * @author XE Developers
24 | * @copyright 2019 Copyright XEHub Corp.
25 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
26 | * @link https://xpressengine.io
27 | */
28 | class HttpBoardException extends HttpXpressengineException
29 | {
30 | protected $message = 'board::boardError';
31 | }
32 |
--------------------------------------------------------------------------------
/src/Models/BoardCategory.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Models;
15 |
16 | use Xpressengine\Database\Eloquent\DynamicModel;
17 | use Xpressengine\Category\Models\CategoryItem;
18 |
19 | /**
20 | * BoardCategory
21 | *
22 | * @property string target_id
23 | * @property int item_id
24 | *
25 | * @category Board
26 | * @package Xpressengine\Plugins\Board
27 | * @author XE Developers
28 | * @copyright 2019 Copyright XEHub Corp.
29 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
30 | * @link https://xpressengine.io
31 | */
32 | class BoardCategory extends DynamicModel
33 | {
34 | protected $table = 'board_category';
35 |
36 | public $timestamps = false;
37 |
38 | protected $primaryKey = 'target_id';
39 |
40 | protected $fillable = ['target_id', 'item_id'];
41 |
42 | /**
43 | * The "type" of the primary key ID.
44 | *
45 | * @var string
46 | */
47 | protected $keyType = 'string';
48 |
49 | /**
50 | * get category item
51 | *
52 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
53 | */
54 | public function categoryItem()
55 | {
56 | return $this->belongsTo(CategoryItem::class, 'item_id');
57 | }
58 |
59 | /**
60 | * get category item word
61 | *
62 | * @return mixed
63 | */
64 | public function getWord()
65 | {
66 | return $this->categoryItem->word;
67 | }
68 |
69 | /**
70 | * get array
71 | *
72 | * @return array
73 | */
74 | public function toArray()
75 | {
76 | $this->categoryItem;
77 | $this->categoryItem->trans_word = xe_trans($this->categoryItem->word);
78 | $this->categoryItem->trans_description = xe_trans($this->categoryItem->description);
79 |
80 | return parent::toArray();
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/src/Models/BoardData.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Models;
15 |
16 | use Illuminate\Database\Query\JoinClause;
17 | use Xpressengine\Database\Eloquent\Builder;
18 | use Xpressengine\Database\Eloquent\DynamicModel;
19 | use Xpressengine\Http\Request;
20 |
21 | /**
22 | * BoardData
23 | *
24 | * @property string target_id
25 | * @property int allowComment
26 | * @property int useAlarm
27 | * @property int fileCount
28 | *
29 | * @category Board
30 | * @package Xpressengine\Plugins\Board
31 | * @author XE Team (developers)
32 | * @copyright 2019 Copyright XEHub Corp.
33 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
34 | * @link https://xpressengine.io
35 | */
36 | class BoardData extends DynamicModel
37 | {
38 | protected $table = 'board_data';
39 |
40 | public $timestamps = false;
41 |
42 | protected $primaryKey = 'target_id';
43 |
44 | protected $fillable = ['allow_comment', 'use_alarm', 'file_count'];
45 |
46 | public $incrementing = false;
47 |
48 | protected $casts = [
49 | 'allow_comment' => 'int',
50 | 'use_alarm' => 'int',
51 | 'file_count' => 'int',
52 | ];
53 |
54 | /**
55 | * The "type" of the primary key ID.
56 | *
57 | * @var string
58 | */
59 | protected $keyType = 'string';
60 |
61 | /**
62 | * check alarm status
63 | *
64 | * @return bool
65 | */
66 | public function isAlarm()
67 | {
68 | return $this->getAttribute('use_alarm') == 1;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/src/Models/BoardFavorite.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Models;
15 |
16 | use Illuminate\Database\Query\JoinClause;
17 | use Xpressengine\Database\Eloquent\Builder;
18 | use Xpressengine\Database\Eloquent\DynamicModel;
19 | use Xpressengine\Http\Request;
20 |
21 | /**
22 | * BoardData
23 | *
24 | * @property int favorite_id
25 | * @property string target_id
26 | * @property string user_id
27 | *
28 | * @category Board
29 | * @package Xpressengine\Plugins\Board
30 | * @author XE Team (developers)
31 | * @copyright 2019 Copyright XEHub Corp.
32 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
33 | * @link https://xpressengine.io
34 | */
35 | class BoardFavorite extends DynamicModel
36 | {
37 | public $timestamps = false;
38 |
39 | protected $primaryKey = 'favorite_id';
40 |
41 | protected $fillable = ['target_id', 'user_id'];
42 | }
43 |
--------------------------------------------------------------------------------
/src/Models/BoardGalleryThumb.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board\Models;
15 |
16 | use Xpressengine\Database\Eloquent\DynamicModel;
17 | use Xpressengine\Media\Models\Image;
18 | use Xpressengine\Media\Models\Media;
19 | use Xpressengine\Plugins\Board\Components\Modules\BoardModule;
20 |
21 | /**
22 | * BoardGalleryThumb
23 | *
24 | * @category Board
25 | * @package Xpressengine\Plugins\Board
26 | * @author XE Developers
27 | * @copyright 2019 Copyright XEHub Corp.
28 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
29 | * @link https://xpressengine.io
30 | */
31 | class BoardGalleryThumb extends DynamicModel
32 | {
33 | public $timestamps = false;
34 |
35 | public $incrementing = false;
36 |
37 | protected $primaryKey = 'target_id';
38 |
39 | protected $fillable = [
40 | 'target_id',
41 | 'board_thumbnail_file_id',
42 | 'board_thumbnail_external_path',
43 | 'board_thumbnail_path'
44 | ];
45 |
46 | /**
47 | * The "type" of the primary key ID.
48 | *
49 | * @var string
50 | */
51 | protected $keyType = 'string';
52 |
53 | /**
54 | * thumbnail의 실제 url을 반환
55 | *
56 | * @param string $value board_thumbnail_path attribute
57 | *
58 | * @return string
59 | */
60 | public function getBoardThumbnailPathAttribute($value)
61 | {
62 | $thumbnailImage = Image::find($this->board_thumbnail_file_id);
63 | if ($thumbnailImage == null) {
64 | return '';
65 | }
66 |
67 | if ($value !== '') {
68 | $media = \XeMedia::getHandler(Media::TYPE_IMAGE)->getThumbnail(
69 | $thumbnailImage,
70 | BoardModule::THUMBNAIL_TYPE,
71 | 'L'
72 | );
73 |
74 | $value = $media->url();
75 | }
76 |
77 | return $value;
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/src/RecycleBin.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright 2019 Copyright XEHub Corp.
11 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
12 | * @link https://xpressengine.io
13 | */
14 | namespace Xpressengine\Plugins\Board;
15 |
16 | use Xpressengine\Trash\RecycleBinInterface;
17 | use Xpressengine\Plugins\Board\Models\Board;
18 | use Xpressengine\Plugins\Board\Components\Modules\BoardModule;
19 |
20 | /**
21 | * RecycleBin
22 | *
23 | * Core Trash 에서 처리될 휴지통 구현체
24 | *
25 | * @category Board
26 | * @package Xpressengine\Plugins\Board
27 | * @author XE Developers
28 | * @copyright 2019 Copyright XEHub Corp.
29 | * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL
30 | * @link https://xpressengine.io
31 | */
32 | class RecycleBin implements RecycleBinInterface
33 | {
34 |
35 | /**
36 | * 휴지통 이름 반환
37 | *
38 | * @return string
39 | */
40 | public static function name()
41 | {
42 | return 'board';
43 | }
44 |
45 | /**
46 | * 휴지통 비우기 처리할 때 수행해야 할 코드 입력
47 | * TrashManager 에서 휴지통 비우기(clean()) 가 처리될 때 사용
48 | *
49 | * @return void
50 | */
51 | public static function clean()
52 | {
53 | /** @var Handler $handler */
54 | $handler = app('xe.board.handler');
55 | /** @var ConfigHandler $configManager */
56 | $configHandler = app('xe.board.config');
57 | $boards = Board::where('status', 'trash')->where('type', BoardModule::getId())->get();
58 |
59 | $configs = [];
60 | foreach ($boards as $board) {
61 | if (isset($configs[$board->instance_id]) === false) {
62 | $configs[$board->instance_id] = $configHandler->get($board->instance_id);
63 | }
64 |
65 | // 인스턴스 설정 정보를 찾을 수 없을 경우 삭제할 수 없는 문제 있음
66 | if (isset($configs[$board->instance_id]) === true) {
67 | $handler->remove($board, $configs[$board->instance_id]);
68 | }
69 | }
70 | }
71 |
72 | /**
73 | * 휴지통 패키지에서 각 휴지통의 상태를 알 수 있도록 정보를 반환
74 | * 휴지통에 얼마만큼의 정보가 있는지 알려주기 위한 인터페이스
75 | *
76 | * @return string
77 | */
78 | public static function summary()
79 | {
80 | $count = Board::where('status', 'trash')->where('type', BoardModule::getId())->count();
81 |
82 | // todo: translation
83 | return sprintf('휴지통에 %s건의 문서가 있습니다.', $count);
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/webpack.config.babel.js:
--------------------------------------------------------------------------------
1 | import path from 'path'
2 | import webpack from 'webpack'
3 | import CopyWebpackPlugin from 'copy-webpack-plugin'
4 |
5 | export default {
6 | entry: {
7 | 'assets/js/BoardTags': './assets/js/src/BoardTags.js',
8 | 'assets/js/board': './assets/js/src/board.js'
9 | },
10 | output: {
11 | path: path.resolve(__dirname, './'),
12 | filename: '[name].js'
13 | },
14 | plugins: [
15 | new CopyWebpackPlugin([
16 | {
17 | context: path.resolve(__dirname, 'assets/js/src'),
18 | from: '**/*',
19 | to: path.resolve(__dirname, 'assets/js'),
20 | ignore: [
21 | '**/*.jsx',
22 | '**/*.vue',
23 | 'board.js'
24 | ]
25 | }
26 | ])
27 | ],
28 | module: {
29 | loaders: [
30 | {
31 | test: /(\.js)$/,
32 | loader: 'babel-loader',
33 | exclude: /node_modules/,
34 | query: {
35 | cacheDirectory: true
36 | }
37 | }
38 | ]
39 | },
40 | resolve: {
41 | extensions: ['.js', '.jsx'],
42 | alias: {
43 | 'vue$': 'vue/dist/vue.esm.js'
44 | }
45 | },
46 | externals: {
47 | window: 'window'
48 | }
49 | }
50 |
--------------------------------------------------------------------------------