You are here

Think in Drupal 7 第1集 目录

g089h515r806 的头像
Submitted by g089h515r806 on 星期一, 2011-09-05 11:45

第一章 Drupal的工作原理... 11

1,什么是Drupal 11

2, drupal的技术堆栈... 11

2.1 PHP. 12

2.2 web服务器... 12

2.3 数据库... 12

2.4操作系统... 12

2.5 HTMLCSSJavaScript 13

3 Drupal文件夹结构... 13

3.1 includes. 13

3.2 misc. 14

3.3 modules. 14

3.4 profiles. 14

3.5 scripts. 14

3.6 sites. 14

3.7 themes... 15

3.8 authorize.php... 15

3.9 cron.php... 15

3.10 index.php... 15

3.11 install.php:... 15

3.12 update.php:... 15

3.13 xmlrpc.php... 15

3.14 robots.txt... 15

4 Drupal核心概念... 16

模块... 16

钩子... 16

主题... 18

节点... 18

区块... 19

菜单... 19

用户... 19

字段与实体... 19

5 Drupal执行流程... 20

5.1 引导指令... 21

5.2 钩子的执行顺序... 23

总结... 24

2  编写自己的模块... 25

创建相关文件... 25

info文件... 26

module文件... 27

创建自己的数据库表结构... 36

创建自己的预处理函数... 39

改进我们的代码... 41

继续改进我们的代码... 43

variable_get与variable_set. 45

贡献我们的代码... 46

总结... 47

3 Drupal 菜单系统... 48

创建一个菜单项... 48

调整菜单项的位置... 51

调整菜单项所属的菜单... 52

不在菜单中显示菜单项... 53

把页面回调放在inc文件中... 53

访问控制... 54

标题的本地化和定制... 56

定义标题回调... 56

菜单嵌套... 58

页面回调参数... 60

将菜单项显示为标签... 63

修改其它模块定义的菜单项... 67

改变其它模块的菜单链接... 69

菜单项中的通配符... 70

基本通配符... 71

通配符和页面回调参数... 72

使用通配符的值... 73

通配符、占位符、参数替换... 75

向加载函数传递额外的参数... 76

特殊的,预定义的加载参数:%map和%index. 77

使用to_arg()函数为通配符构建路径... 77

Hook_menu的键值属性... 78

菜单项的类型... 80

相关的钩子函数... 80

总结... 80

第四章 数据库API 81

一般概念... 81

驱动... 81

连接... 82

查询... 82

语句... 82

数据库配置... 83

连接键... 83

目标... 83

$databases语法... 83

依赖于PDO.. 85

静态查询... 85

前缀化... 86

占位符... 86

占位符数组... 87

查询选项... 88

结果集... 88

存到类中... 90

动态查询... 91

内容结构... 92

概貌... 92

关联... 93

字段... 93

Distinct 94

表达式... 95

排序... 95

随机排序... 96

分组... 96

范围和限制... 96

表排序... 97

条件语句... 97

执行查询... 97

总计查询... 98

调试... 98

扩展器... 98

修改查询... 101

插入查询... 103

紧凑形式... 104

退化形式... 105

多值插入形式... 106

基于选择查询的结果插入... 107

默认值... 108

更新查询... 108

删除查询... 109

合并查询... 110

只是设置它... 110

有条件设置... 111

有限制的更新... 112

优先级... 112

条件语句... 113

概念... 113

API 114

数组运算符... 114

嵌套的条件语句... 115

Null... 115

子查询... 116

示例... 116

编写数据库驱动... 117

PDO.. 117

错误处理... 117

事务... 117

链式... 118

函数和运算符... 120

逻辑运算符... 120

比较运算符... 120

类型操作运算符... 121

字符串函数和运算符... 121

数学函数和运算符... 121

日期/时间函数... 121

聚合函数... 121

总结... 121

5 Schema(模式) API. 122

模块的install文件... 122

创建数据库表... 122

使用Schema(模式)模块... 124

Schema与数据库字段类型之间的映射关系... 125

文本型... 126

Varchar. 126

Char. 126

Text. 127

数字型... 127

Integer. 127

Serial. 127

Float. 128

Numeric. 128

二进位:Blob. 128

相关API函数... 130

维护我们的数据库表... 131

6  Form API. 133

两步表单... 133

创建相关文件... 133

“联系我们”页面... 134

控制表单的外观... 140

添加验证函数和提交函数... 142

确认页面... 144

邮件发送... 149

“致谢”页面... 150

AJAX表单... 151

准备工作... 151

创建相关文件... 152

Ajax表单的三个关键要点... 157

Ajax表单流程分析... 158

表单元素... 161

Actions(动作)... 161

Button(按钮). 161

Checkbox(复选框)... 162

Checkboxes(复选框)... 162

Container(容器)... 163

Date(日期)... 163

fieldset(字段集)... 164

File(文件). 165

hidden(隐藏域)... 165

image_button(图片按钮)... 166

item(条目)... 166

machine_name(机读名字). 167

managed_file(受管理的文件)... 168

markup(标识文本)... 169

password(密码)... 169

password_confirm(带确认的密码)... 170

Radio(单选按钮)... 170

radios(单选按钮)... 171

select(下拉选择框)... 171

submit(提交按钮)... 171

Tableselect(表选择)... 172

text_format(文本格式). 173

textarea(文本域)... 173

textfield(文本字段)... 174

value(值)... 174

vertical_tabs(垂直标签)... 175

weight(重量). 175

呈现API. 176

7 Drupal用户... 177

对象$user. 177

测试用户是否登录了... 179

用户系统的钩子函数... 179

班主任模块... 181

钩子hook_user_view. 185

钩子hook_user_login. 186

钩子hook_username_alter. 187

统一用户登录... 188

与Drupal6站点整合用户... 188

常用解决方案介绍... 191

内置单点登录... 192

总结... 195

8 Drupal区块... 196

什么是区块?... 196

区块配置选项... 197

区块位置... 198

理解区块的呈现... 199

区块的数据库表结构... 200

区块钩子介绍... 202

创建一个区块... 203

钩子hook_block_info. 204

钩子hook_block_configure. 205

钩子hook_block_save. 206

钩子hook_block_view. 207

PHP代码的形式... 208

扩展阅读... 210

Bean. 211

Boxes. 211

Node Blocks. 211

MultiBlock. 211

CCK Blocks. 211

总结... 211

9 Field API. 212

自定义一个字段类型... 212

准备工作... 212

钩子hook_field_info. 213

钩子hook_field_widget_info. 214

钩子hook_field_schema. 215

钩子hook_field_widget_settings_form.. 217

钩子hook_field_widget_form.. 218

钩子hook_element_info. 219

对应表单元素的主题函数... 220

钩子hook_content_is_empty. 221

钩子hook_field_validate. 221

钩子hook_field_presave. 222

钩子hook_field_formatter_info. 224

验证已有的字段... 226

伪字段... 227

为已有字段定制格式器... 228

总结... 234

附录一 数据库表结构... 235

accesslog (统计模块). 235

actions (system(系统)模块). 235

aggregator_category (aggregator(聚合器)模块). 235

aggregator_category_feed (聚合器模块). 235

aggregator_category_item (聚合器模块). 236

aggregator_feed (聚合器模块). 236

aggregator_item (聚合器模块). 236

authmap (用户模块). 237

batch (系统模块). 237

block (区块模块). 237

block_custom (区块模块). 238

block_node_type (节点模块). 238

block_role (区块模块). 239

blocked_ips (系统模块). 239

book (手册模块). 239

cache (系统模块). 239

cache_block (区块模块). 240

cache_bootstrap (系统模块). 240

cache_field (字段模块). 240

cache_filter (过滤器模块). 241

cache_form (系统模块). 241

cache_image (图片模块). 241

cache_menu (系统模块). 242

cache_page (系统模块). 242

cache_path (系统模块). 242

cache_update (更新模块). 243

comment (评论模块). 243

contact (联系模块). 244

date_format_locale (系统模块). 244

date_format_type (系统模块). 244

date_formats (系统模块). 245

field_config (字段模块). 245

field_config_instance (字段模块). 245

field_data_body (field_sql_storage 模块). 246

field_data_comment_body (field_sql_storage 模块). 246

field_data_field_image (field_sql_storage 模块). 247

field_data_field_tags (field_sql_storage 模块). 247

field_data_taxonomy_forums (field_sql_storage 模块). 248

field_revision_body (field_sql_storage 模块). 248

field_revision_comment_body (field_sql_storage 模块). 249

field_revision_field_image (field_sql_storage 模块). 249

field_revision_field_tags (field_sql_storage 模块). 250

field_revision_taxonomy_forums (field_sql_storage 模块). 250

file_managed (系统模块). 250

file_usage (系统模块). 251

filter (过滤器模块). 251

filter_format (过滤器模块). 252

flood (系统模块). 252

forum (论坛模块). 252

forum_index (论坛模块). 252

history (系统模块). 253

image_effects (图片模块). 253

image_styles (图片模块). 253

languages (本地化模块). 254

locales_source (本地化模块). 254

locales_target (本地化模块). 254

menu_custom (菜单模块). 255

menu_links (系统模块). 255

menu_router (系统模块). 257

node (节点模块). 258

node_access (节点模块). 259

node_comment_statistics (评论模块). 259

node_counter (统计模块). 259

node_revision (节点模块). 260

node_type (节点模块). 260

poll (投票模块). 261

poll_choice (投票模块). 261

poll_vote (投票模块). 261

queue (系统模块). 262

rdf_mapping (rdf 模块). 262

registry (系统模块). 262

registry_file (系统模块). 263

role (用户模块). 263

role_permission (用户模块). 263

search_dataset (搜索模块). 263

search_index (搜索模块). 264

search_node_links (搜索模块). 264

search_total (搜索模块). 264

semaphore (系统模块). 264

sequences (系统模块). 265

sessions (系统模块). 265

shortcut_set (shortcut(快捷方式)模块). 265

shortcut_set_users (快捷方式模块). 266

simpletest (simpletest(简单测试)模块). 266

simpletest_test_id (simpletest(简单测试) 模块). 266

system (系统模块). 267

taxonomy_index (分类模块). 267

taxonomy_term_data (分类模块). 268

taxonomy_term_hierarchy (分类模块). 268

taxonomy_vocabulary (分类模块). 268

tracker_node (tracker(追踪器)模块). 269

tracker_user (追踪器模块). 269

trigger_assignments (触发器模块). 269

url_alias (系统模块). 269

users (用户模块). 270

users_roles (用户模块). 270

variable (系统模块). 270

watchdog (dblog(数据库日志)模块). 271

致谢... 272

Zhupou.cn. 274

 

 

Drupal版本: