tailieunhanh - Drupal 7 Module Development phần 10

có thể được tự động áp dụng các yếu tố trên một trang. Điều này được thực hiện bằng cách áp dụng các lớp học sử dụng ajax để một yếu tố trên một trang. Một điển hình sẽ được sử dụng để áp dụng các lớp ajax sử dụng một liên kết trong một trang để kích hoạt một hành động AJAX. | Installation Profiles The install task system The Drupal installer is task based. Tasks consist of steps to collect information and act on it. For example three of the core tasks are to collect the database configuration details write the database configuration to the file and install the modules. Drupal core provides a set of default tasks for the installer to run that an installation profile can add to or alter. The two hooks that provide access to the install tasks are hook_install_tasks This allows the profile to add tasks at the end of the default tasks hook_install_tasks_alter This allows the profile to alter all the tasks including those provided as defaults by the installer For the first step of the installer an installation profile is selected. This step cannot be altered by an installation profile. Choosing an install task or using hook_install Since profiles operate as a module they can have a .install file containing a hook_install which will be called when the profile is installed. This leaves two choices of where to perform configuration tasks. There are two main differences between these two types of tasks The profile hook_install is run before custom install tasks and the site configuration form. Tasks in the installer can have forms utilize the Batch API and more. hook_install can only run as a callback in a single page load. For complete documentation regarding hook_install visit the API documentation at http api function hook_ install 7. Anatomy of an install task There are five properties to describe each task step to the installer. hook_install_tasks describes each step to the installer as a keyed array. The key is a unique name to a callback function that executes the task. The properties of each item describing the task are as follows 348 Chapter 12 display_name A human readable name to display for this task. This is used in the user interface to inform a user as to the step they are on. di splay tells the .

TỪ KHÓA LIÊN QUAN