第一章 Drupal的工作原理
1,什么是Drupal
2, drupal的技术堆栈
2.1 PHP
2.2 web服务器
2.3 数据库
2.4操作系统
2.5 HTML,CSS,JavaScript
3 Drupal文件夹结构
3.1 includes
3.2 misc
3.3 modules
3.4 profiles
3.5 scripts
3.6 sites
3.7 themes:
3.8 authorize.php:
3.9 cron.php:
3.10 index.php:
3.11 install.php:
3.12 update.php:
3.13 xmlrpc.php:
3.14 robots.txt:
4 Drupal核心概念
模块
钩子
主题
节点
区块
菜单
用户
字段与实体
5 Drupal执行流程
5.1 引导指令
5.2 钩子的执行顺序
总结
第2章 编写自己的模块
创建相关文件
info文件
module文件
创建自己的数据库表结构
创建自己的预处理函数
改进我们的代码
继续改进我们的代码
variable_get与variable_set
贡献我们的代码
总结
第3章 Drupal 菜单系统
创建一个菜单项
调整菜单项的位置
调整菜单项所属的菜单
不在菜单中显示菜单项
把页面回调放在inc文件中
访问控制
标题的本地化和定制
定义标题回调
菜单嵌套
页面回调参数
将菜单项显示为标签
修改其它模块定义的菜单项
改变其它模块的菜单链接
菜单项中的通配符
基本通配符
通配符和页面回调参数
使用通配符的值
通配符、占位符、参数替换
向加载函数传递额外的参数
特殊的,预定义的加载参数:%map和%index
使用to_arg()函数为通配符构建路径
Hook_menu的键值属性
菜单项的类型
相关的钩子函数
总结
第四章 数据库API
一般概念
驱动
连接
查询
语句
数据库配置
连接键
目标
$databases语法
依赖于PDO
静态查询
前缀化
占位符
占位符数组
查询选项
结果集
存到类中
动态查询
内容结构
概貌
关联
字段
Distinct
表达式
排序
随机排序
分组
范围和限制
表排序
条件语句
执行查询
总计查询
调试
扩展器
修改查询
插入查询
紧凑形式
退化形式
多值插入形式
基于选择查询的结果插入
默认值
更新查询
删除查询
合并查询
只是设置它
有条件设置
有限制的更新
优先级
条件语句
概念
API
数组运算符
嵌套的条件语句
Null值
子查询
示例
编写数据库驱动
PDO
错误处理
事务
链式
函数和运算符
逻辑运算符
比较运算符
类型操作运算符
字符串函数和运算符
数学函数和运算符
日期/时间函数
聚合函数
总结
第5章 Schema(模式) API
模块的install文件
创建数据库表
使用Schema(模式)模块
Schema与数据库字段类型之间的映射关系
文本型
Varchar
Char
Text
数字型
Integer
Serial
Float
Numeric
二进位:Blob
相关API函数
维护我们的数据库表
第6章 Form API
两步表单
创建相关文件
“联系我们”页面
控制表单的外观
添加验证函数和提交函数
确认页面
邮件发送
“致谢”页面
AJAX表单
准备工作
创建相关文件
Ajax表单的三个关键要点
Ajax表单流程分析
表单元素
Actions(动作)
Button(按钮)
Checkbox(复选框)
Checkboxes(复选框)
Container(容器)
Date(日期)
fieldset(字段集)
File(文件)
hidden(隐藏域)
image_button(图片按钮)
item(条目)
machine_name(机读名字)
managed_file(受管理的文件)
markup(标识文本)
password(密码)
password_confirm(带确认的密码)
Radio(单选按钮)
radios(单选按钮)
select(下拉选择框)
submit(提交按钮)
Tableselect(表选择)
text_format(文本格式)
textarea(文本域)
textfield(文本字段)
value(值)
vertical_tabs(垂直标签)
weight(重量)
呈现API
第7章 Drupal用户
对象$user
测试用户是否登录了
用户系统的钩子函数
班主任模块
钩子hook_user_view
钩子hook_user_login
钩子hook_username_alter
统一用户登录
与Drupal6站点整合用户
常用解决方案介绍
内置单点登录
总结
第8章 Drupal区块
什么是区块?
区块配置选项
区块位置
理解区块的呈现
区块的数据库表结构
区块钩子介绍
创建一个区块
钩子hook_block_info
钩子hook_block_configure
钩子hook_block_save
钩子hook_block_view
PHP代码的形式
扩展阅读
Bean
Boxes
Node Blocks
MultiBlock
CCK Blocks
总结
第9章 Field API
自定义一个字段类型
准备工作
钩子hook_field_info
钩子hook_field_widget_info
钩子hook_field_schema
钩子hook_field_widget_settings_form
钩子hook_field_widget_form
钩子hook_element_info
对应表单元素的主题函数
钩子hook_content_is_empty
钩子hook_field_validate
钩子hook_field_presave
钩子hook_field_formatter_info
验证已有的字段
伪字段
为已有字段定制格式器
总结
附录一 数据库表结构
accesslog (统计模块)
actions (system(系统)模块)
aggregator_category (aggregator(聚合器)模块)
aggregator_category_feed (聚合器模块)
aggregator_category_item (聚合器模块)
aggregator_feed (聚合器模块)
aggregator_item (聚合器模块)
authmap (用户模块)
batch (系统模块)
block (区块模块)
block_custom (区块模块)
block_node_type (节点模块)
block_role (区块模块)
blocked_ips (系统模块)
book (手册模块)
cache (系统模块)
cache_block (区块模块)
cache_bootstrap (系统模块)
cache_field (字段模块)
cache_filter (过滤器模块)
cache_form (系统模块)
cache_image (图片模块)
cache_menu (系统模块)
cache_page (系统模块)
cache_path (系统模块)
cache_update (更新模块)
comment (评论模块)
contact (联系模块)
date_format_locale (系统模块)
date_format_type (系统模块)
date_formats (系统模块)
field_config (字段模块)
field_config_instance (字段模块)
field_data_body (field_sql_storage 模块)
field_data_comment_body (field_sql_storage 模块)
field_data_field_image (field_sql_storage 模块)
field_data_field_tags (field_sql_storage 模块)
field_data_taxonomy_forums (field_sql_storage 模块)
field_revision_body (field_sql_storage 模块)
field_revision_comment_body (field_sql_storage 模块)
field_revision_field_image (field_sql_storage 模块)
field_revision_field_tags (field_sql_storage 模块)
field_revision_taxonomy_forums (field_sql_storage 模块)
file_managed (系统模块)
file_usage (系统模块)
filter (过滤器模块)
filter_format (过滤器模块)
flood (系统模块)
forum (论坛模块)
forum_index (论坛模块)
history (系统模块)
image_effects (图片模块)
image_styles (图片模块)
languages (本地化模块)
locales_source (本地化模块)
locales_target (本地化模块)
menu_custom (菜单模块)
menu_links (系统模块)
menu_router (系统模块)
node (节点模块)
node_access (节点模块)
node_comment_statistics (评论模块)
node_counter (统计模块)
node_revision (节点模块)
node_type (节点模块)
poll (投票模块)
poll_choice (投票模块)
poll_vote (投票模块)
queue (系统模块)
rdf_mapping (rdf 模块)
registry (系统模块)
registry_file (系统模块)
role (用户模块)
role_permission (用户模块)
search_dataset (搜索模块)
search_index (搜索模块)
search_node_links (搜索模块)
search_total (搜索模块)
semaphore (系统模块)
sequences (系统模块)
sessions (系统模块)
shortcut_set (shortcut(快捷方式)模块)
shortcut_set_users (快捷方式模块)
simpletest (simpletest(简单测试)模块)
simpletest_test_id (simpletest(简单测试) 模块)
system (系统模块)
taxonomy_index (分类模块)
taxonomy_term_data (分类模块)
taxonomy_term_hierarchy (分类模块)
taxonomy_vocabulary (分类模块)
tracker_node (tracker(追踪器)模块)
tracker_user (追踪器模块)
trigger_assignments (触发器模块)
url_alias (系统模块)
users (用户模块)
users_roles (用户模块)
variable (系统模块)
watchdog (dblog(数据库日志)模块)
致谢
Zhupou.cn