Hook 시스템

@import "/jcms/css/style0813Drupal.css";

Allow modules to interact with the Drupal core.

Drupal's module system is based on the concept of "hooks". A hook is a PHP function that is named foo_bar(), where "foo" is the name of the module (whose filename is thus foo.module) and "bar" is the name of the hook. Each hook has a defined set of parameters and a specified result type.

To extend Drupal, a module need simply implement a hook. When Drupal wishes to allow intervention from modules, it determines which modules implement a hook and call that hook in all enabled modules that implement it.

The available hooks to implement are explained here in the Hooks section of the developer documentation. The string "hook" is used as a placeholder for the module name is the hook definitions. For example, if the module file is called example.module, then hook_help() as implemented by that module would be defined as example_help().

Functions

custom_url_rewrite_inbounddeveloper/hooks/core.phpcustom_url_rewrite_inbound는 후크가 아니고 세팅에 추가할 수 있는 펑션임. php는 들어온 리퀘스트를 변경하며 드루팔 패스를 맵핑. 이 함수는 모듈이 로드되거나 메뉴시스템이 초기화되고 변경되기 전에 불려진다.
custom_url_rewrite_outbounddeveloper/hooks/core.phpcustom_url_rewrite_outbound 는 후크가 아니고 세팅에 추가할 수 있는 펑션임. php는 드루팔에 의해 만들어진 모든 링크를 변경. 이 함수는 url()에 의해 불려짐. (페이지마다 100회 이상)
hook_accessdeveloper/hooks/node.php접근 제한 정의
hook_actions_deletedeveloper/hooks/core.php액션 삭제 후 실행되는 코드
hook_blockdeveloper/hooks/core.php블록 또는 블록 세트 선언
hook_bootdeveloper/hooks/core.php셋업 작업 수행(hook_init 참조)
hook_commentdeveloper/hooks/core.php코멘트에 대해 적용
hook_crondeveloper/hooks/core.php주기적인 액션 수행
hook_db_rewrite_sqldeveloper/hooks/core.php데이터베이스 쿼리 재사용, 보통 접근 컨트롤용으로
hook_deletedeveloper/hooks/node.php노드 삭제에 반응
hook_disabledeveloper/hooks/install.php모듈이 비활성되기 전에 필요한 액션들
hook_elementsdeveloper/hooks/core.php모듈이 그들의 폼 요소 타입을 선언하거나 그들의 기본 값들을 정해주게 허용
hook_enabledeveloper/hooks/install.php모듈이 활성화 된 후에 필요한 액션들
hook_exitdeveloper/hooks/core.php작업을 정리(삭제)
hook_file_downloaddeveloper/hooks/core.php프라이빗한 파일 다운로드의 접근 조절과  HTTP헤더 부여
hook_filterdeveloper/hooks/core.php컨텐트 필터 정의
hook_filter_tipsdeveloper/hooks/core.php필터 사용하기 위한 팁 제공
hook_flush_cachesdeveloper/hooks/core.php정리될 캐쉬 테이블의 리스트 추가
hook_footerdeveloper/hooks/core.php끝 HTML 삽입
hook_formdeveloper/hooks/node.php노드 편집 폼 표시
hook_formsdeveloper/hooks/core.php빌더 함수들의 form_ids 맵핑
hook_form_alterdeveloper/hooks/core.php폼이 생성되기 전에 변경 수행
hook_helpdeveloper/hooks/core.php온라인 유저 도움말 제공
hook_hook_infodeveloper/hooks/core.phpExpose a list of triggers (events) that your module is allowing users to assign actions to.
hook_initdeveloper/hooks/core.php셋업 작업 수행(hook_boot 참조)
hook_insertdeveloper/hooks/node.php노드 삽입에 반응
hook_installdeveloper/hooks/install.php데이터베이스 스키마의 기존 버전과 그 외의 다른 셋업 작업 인스톨
hook_linkdeveloper/hooks/core.php내부 드루팔 링크 정의
hook_link_alterdeveloper/hooks/core.php노드의 링크가 생성되기 전에 수행되는 변경. 이 후크의 주요 사용도는 다른 모듈의 추가/삭제이다.
hook_loaddeveloper/hooks/node.phpnode-type-specific 정보의 로드
hook_localedeveloper/hooks/core.php번역되어질 텍스트 그룹을 정의할 모듈의 허용
hook_maildeveloper/hooks/core.php파라미터에 기초한 메시지의 준비. 자세한 정보는 drupal_mail 참조
hook_mail_alterdeveloper/hooks/core.php드루팔에 의해 보내지는 이메일의 양식 변경. 사이트 푸터를 모든 외부로 나가는 이메일에 추가하는데 사용할수 있다; 추가적인 헤더 필드의 추가/어떤 방법으로던지 보내진 메일의 수정. 나가는 이메일의 HTML라이징도 가능함. See also...
hook_menudeveloper/hooks/core.php메뉴 아이템과 페이지 콜백의 정의
hook_menu_alterdeveloper/hooks/core.phphook_menu 발동 후 {menu_router}테이블로 저장되어지는 데이터 변경
hook_menu_link_alterdeveloper/hooks/core.phpmenu_link_save()에 의해 {menu_ links }테이블로 저장되어지는 데이터 변경
hook_nodeapideveloper/hooks/core.php다른 모듈에 의해 정의되어진 노드들에 작용
hook_node_access_recordsdeveloper/hooks/core.php데이터베이스에 쓰여질(쓰기) 노드의 퍼미션 세팅
hook_node_grantsdeveloper/hooks/core.php유저가 갖고 있는 퍼미션을 노드 억세스 시스템에 알림
hook_node_infodeveloper/hooks/node.phpDefine module-provided node types.
hook_node_operationsdeveloper/hooks/core.php노드 오퍼레이션 무리에 추가
hook_node_typedeveloper/hooks/node.php노드 타입 변경에 작용
hook_permdeveloper/hooks/core.php유저 권한 정의
hook_pingdeveloper/hooks/core.php다른 서버로 핑
hook_preparedeveloper/hooks/node.php이 후크는 노드 모듈에 의해 사용되어짐. 로드후, 추가/수정 폼에 노드가 보여지기 전에 불려짐 (It is called after load but before the node is shown on the add/edit form.)
hook_profile_alterdeveloper/hooks/core.php렌더링되기전의 수정 프로파일 아이템 수행. 생략/추가/재정렬/재분류 등
hook_requirementsdeveloper/hooks/install.php인스톨 요구사항의 체크와 상태 보고
hook_schemadeveloper/hooks/install.php데이터베이스 스키마의 현재 버전 정의
hook_searchdeveloper/hooks/core.php커스텀 검색 루틴 정의
hook_search_preprocessdeveloper/hooks/core.php검색 인덱스를 위한 텍스트 예비처리
hook_system_info_alterdeveloper/hooks/core.php모듈과 theme .info 파일로부터의 파싱된 정보 변경
hook_taxonomydeveloper/hooks/core.php텍사노미 변경에 적용
hook_term_pathdeveloper/hooks/core.phpAllows modules to provide an alternative path for the terms it manages.
hook_themedeveloper/hooks/core.php테마 모듈의 등록
hook_theme_registry_alterdeveloper/hooks/core.phphook_theme()로부터 되돌아온 테마 레지스트리 정보의 변경
hook_translated_menu_link_alterdeveloper/hooks/core.php번역후, 렌더링 전 메뉴 링크의 변경
hook_uninstalldeveloper/hooks/install.php테이블 또는 모듈이 세팅한 값들의 제거
hook_updatedeveloper/hooks/node.php노드 업데이트
hook_update_indexdeveloper/hooks/core.php이 모듈을 위한 드루팔의 풀 텍스트 인덱스 업데이트
hook_update_Ndeveloper/hooks/install.php싱글 업데이트 수행. For each patch which requires a database change add a new hook_update_N() which will be called by update.php.
hook_userdeveloper/hooks/core.php유저 계정 액션의 실행
hook_user_operationsdeveloper/hooks/core.php유저 동작 추가
hook_validatedeveloper/hooks/node.php노드 편집 폼의 검증
hook_viewdeveloper/hooks/node.php노드 표시
hook_watchdogdeveloper/hooks/core.php이벤트 메세지의 로그
hook_xmlrpcdeveloper/hooks/core.phpRegister XML-RPC callbacks.
module_hookincludes/module.inc모듈이 후크를 실행할지 결정
module_implementsincludes/module.inc후크를 실행하는 모듈의 결정
module_invokeincludes/module.inc특정 모듈의 후크 호출
module_invoke_allincludes/module.inc실행되어진 모든 가능한 모듈의 호출

댓글 쓰기

이 필드의 내용은 비밀로 유지되며, 공개되지 않습니다.