Commit graph

105 commits

Author SHA1 Message Date
Kijin Sung
9a83e71bff Allow adding error message and sprintf() variables using setError()
xpressengine/xe-core#2181 적용시 에러 반환 문법을 단순화하기 위한 조치

기존 방식: return new Object(-1, '에러메시지');
XE 제안 방식: return class_exists('BaseObject') ? new BaseObject(-1, '에러메시지') : new Object('에러메시지');
라이믹스 방식: return $this->setError('에러메시지');

기존의 setError() 메소드가 에러 코드만 받을 수 있어서 호환성 보장에 도움이 안 되므로
에러 코드와 에러 메시지를 동시에 넣을 수 있도록 개선하고,
에러 코드를 넣지 않고 에러 메시지만 지정해도 자동으로 -1 에러 코드가 들어가도록 하였음.
(첫 번째 인자가 정수인지 아닌지에 따라 판단함.)

setError(), setMessage(), setMessageType() 등 기존에 무의미한 반환값을 가지던 메소스들 모두
$this를 반환하도록 함으로써 액션이나 트리거 등의 반환값으로 유효하도록 하고,
원할 경우 method chaining까지 사용할 수 있음.

또한 에러메시지에 변수를 넣어야 할 경우
return new Object(-1, sprintf(Context::getLang('error_msg'), $var1, $var2));
이렇게 복잡해지는 문제도 해결하기 위해
setError()에 추가로 넣은 인자는 모두 자동으로 sprintf() 처리를 거치도록 함.
예: return $this->setError('error_msg', $var1, $var2);

즉, 아래와 같은 호출 형태가 모두 유효함.

  - $this->setError(-1);
  - $this->setError(-1, 'error_msg');
  - $this->setError(-1, 'error_msg', $var1, $var2);
  - $this->setError('error_msg');
  - $this->setError('error_msg', $var1, $var2);

단, 이 커밋 이후 신규 작성하는 코어 클래스나 서드파티 자료에서만 사용할 수 있음.
기존 버전과의 호환성을 유지하기를 원하는 서드파티 자료는 XE에서 제안한 삼항식을 사용해야 함.
2017-11-27 16:33:33 +09:00
Kijin Sung
02d73f3905 Fix incorrect fallback to site default skin 2017-07-01 21:52:36 +09:00
Kijin Sung
7904304dc3 Support /USE_RESPONSIVE/ as a valid mobile skin option 2017-07-01 20:25:41 +09:00
conory
8f26b925cf 접근 권한이 걸려 있을 경우 로그인 및 회원 가입이 안되는 문제 수정
https://www.xetown.com/qna/574534
2017-04-26 16:11:43 +09:00
conory
ddc7d31661 코드 정리 2017-04-10 14:58:31 +09:00
conory
3298946a5e 잘못된 동작 수정 2017-04-08 22:41:01 +09:00
conory
5ad0ee91a5 *-managers 정규식 구체화 2017-04-08 20:12:17 +09:00
conory
1d4437135c 승인 권한 (grant) 구분자 변경 2017-04-08 18:10:30 +09:00
conory
f224a4aea0 <action>에 퍼미션 속성 추가
승인 권한 (grant)도 퍼미션 체크를 할 수 있도록 추가
2017-04-07 14:55:33 +09:00
conory
5bdd0091ec 모듈이름 정규식으로 개선 2017-03-29 16:25:05 +09:00
conory
74d1b221d9 특정 모듈의 매니저를 지정할 수 있도록 개선 2017-03-29 15:33:44 +09:00
conory
cd2760c4f5 check_var 속성 기본값 제거
'all-managers', 'same-managers'  퍼미션 타입 추가
코드 정리
2017-03-29 12:54:27 +09:00
conory
da36bc5633 srl 공백 처리 2017-03-21 21:22:59 +09:00
conory
e03d8e7333 관리자 페이지는 root를 기본 퍼미션으로... 2017-03-21 17:49:06 +09:00
conory
a6d45dedae type module 오류 수정 2017-03-20 00:08:34 +09:00
conory
d5e39ad897 check_type 모듈 추가 지원 file, module 2017-03-19 23:54:07 +09:00
conory
83d6fe89a3 root 퍼미션을 걸 경우 최고 관리자만 쓸 수 있도록 변경 2017-03-18 21:10:03 +09:00
conory
cda2dd8fa7 배열 자동 인식 2017-03-18 18:27:22 +09:00
conory
9ec088b4db 문서, 댓글의 srl에 대한 퍼미션 체크도 지원 2017-03-18 13:26:39 +09:00
conory
adfcead452 잘못된 변수 2017-03-17 23:50:13 +09:00
conory
85afc04949 잘못된 parameter 수정 2017-03-17 23:27:31 +09:00
conory
a258a3cec8 현재 모듈이 아닌 특정 모듈의 유저 권한을 체크하는 <permission> 옵션 추가 2017-03-17 22:52:25 +09:00
conory
3f33194f94 setModuleInfo 정리 2017-03-17 20:48:39 +09:00
Kijin Sung
03866c7777 Populate an empty SessionHelper object if not logged in 2017-02-10 21:26:38 +09:00
Kijin Sung
45e930f04c Populate 'user' property of every module instance with current user info 2017-02-10 21:08:05 +09:00
conory
de0b09f4e3 최종단계에서 Set http status message 2016-04-19 17:10:15 +09:00
conory
0cb9958319 stop()사용시에도 http status code 적용 2016-04-19 16:02:42 +09:00
conory
f930ec74f8 시스템 에러 메세지를 출력할 경우 403 HTTP 코드로 설정 2016-04-18 23:43:04 +09:00
Kijin Sung
1b372375a4 Always set redirect_url if a module calls setRedirectUrl() 2016-03-02 10:10:10 +09:00
Kijin Sung
27cfa4aeba Redirect to short URL after insertDocument, insertComment, etc. 2016-03-02 10:03:48 +09:00
Kijin Sung
47bca4f2ca Replace debugPrint() and handleError() with new system 2016-02-12 16:43:19 +09:00
Kijin Sung
82da535ec6 Prevent addons from overwriting important variables with nonsense 2016-02-10 16:34:55 +09:00
conory
994812947b 잘못된 parameter 2015-12-20 21:14:26 +09:00
CONORY
de0c54ff37 Merge pull request #3 from kijin/php7
PHP7 호환성 개선
2015-12-18 14:15:15 +09:00
Kijin Sung
6473115ed3 Fix incompatible signatures of inherited methods 2015-12-08 14:07:42 +09:00
whantae jiwhantae ji
b350ec5451 모바일에서도 api를 사용할 수 있도록 변경
jQuery.exec_json, jQuery.exec_xml 사용시 모바일에선 결과가 다른 문제 수정
mothos -> mothods 오타 수정
2015-07-13 11:21:50 +09:00
ngleader
bc4d74e9f6 [NOISSUE] remove php close tag, change lower case to upper case 2014-12-06 11:45:42 +09:00
bnu
25ca3e1d14 #278 debug 환경 개선.
- query 목록에 query id와 파일 및 메소드명 표시
- 실행 중 중단 시 중단 시점의 파일과 메소드명 표시
2014-01-10 03:39:07 +09:00
bnu
904340c649 Revert "NOISSUE, Adding the magic class value. a module can get a MVC object of module by special member value like $this->o{ModuleName}{Type} in each Module Class extended ModuleObject Class."
This reverts commit de30ecfb39.
2013-12-19 15:29:28 +09:00
bnu
e9dacc6cdf substr_compare()에서 문제를 일으킬 수 있는 부분 보완. 2013-11-27 15:16:26 +09:00
bnu
4d9e68b9e4 substr_compare() 사용에 대한 보완 2013-11-27 14:18:09 +09:00
ngleader
de30ecfb39 NOISSUE, Adding the magic class value. a module can get a MVC object of module by special member value like $this->o{ModuleName}{Type} in each Module Class extended ModuleObject Class.
eg) $oDocumentModel = $this->oDocumentModel; instead of $oDocumentModel = getModel('document');
$oDocumentAdminController = $this->oDocumentAdminController; instead of $oDocumentAdminController = getAdminController('document');
2013-11-22 08:08:58 +09:00
bnu
932862be1f #64 서버 내 경로를 절대경로로 변경 2013-11-23 11:59:49 +09:00
khongchi
5693e340fe issue 3645, php5 대응, 함수 대체
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@13202 201d5d3c-b55e-5fd7-737f-ddc643e51545
2013-11-13 01:40:53 +00:00
akasima
bce0a0b6d4 copyright add to php files
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@13186 201d5d3c-b55e-5fd7-737f-ddc643e51545
2013-11-08 05:52:51 +00:00
ngleader
dbc18a4f99 change author
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@13180 201d5d3c-b55e-5fd7-737f-ddc643e51545
2013-11-07 02:42:42 +00:00
misol
f70ce644ce Close Connection when there is no connection value.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@13161 201d5d3c-b55e-5fd7-737f-ddc643e51545
2013-09-25 15:29:32 +00:00
devjin
d77530f883 issue 2800
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12704 201d5d3c-b55e-5fd7-737f-ddc643e51545
2013-02-05 07:39:05 +00:00
flyskyko
2383b8d711 issue 2119. supporting php 5.4. module classes.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12691 201d5d3c-b55e-5fd7-737f-ddc643e51545
2013-02-05 02:17:43 +00:00
devjin
819b53c4ce issue 2653 set skin info when used site default skin.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12071 201d5d3c-b55e-5fd7-737f-ddc643e51545
2012-11-03 09:28:19 +00:00