member_config.ymlというファイル全部の中でisRegistがtrueとなるものがフォームとして表示される.
opAuthMailAddressPluginを無効にするとこの「秘密の質問」が消えるのは,その項目を含むmember_config.ymlファイルを持っているのがopAUthMailAddressPluginconfig/member_config.yml だから.
lib/form/opAuthRegisterForm.class.php内でMemberForm,MemberProfileForm,MemberConfigFormなどのフォームを表示することを決定する.
この中で「秘密の質問」の表示を行なっているのはlib/form/doctrine/MemberConfigForm.class.phpである.
($this->isNew && $value['isRegist'])がtrueとなるときMemberConfigWidgetとして追加される.
48 public function generateConfigWidgets()
49 {
50 foreach ($this->memberConfigSettings as $key => $value) {
51 if ($this->isNew && $value['IsRegist'] || !$this->isNew && $value['IsConfig']) {
52 $this->setMemberConfigWidget($key);
53 }
54 }
55
56 if ('mobile_frontend' === sfConfig::get('sf_app'))
57 {
58 $this->appendMobileInputMode();
59 }
60 }
sfConfig::get('openpne_member_config')によって OpenPNE に存在する member_config.yml ファイルすべてを取得する.
93 public function setMemberConfigSettings()
94 {
95 $categories = sfConfig::get('openpne_member_category');
96 $configs = sfConfig::get('openpne_member_config');
97 //var_dump($configs);
98
99 if (!$this->category) {
100 $this->memberConfigSettings = $configs;
101 return true;
102 }
103
104 foreach ($categories[$this->category] as $value)
105 {
106 $this->memberConfigSettings[$value] = $configs[$value];
107 }
108 }
member_config.ymlのリスト
./lib/config/config/member_config.yml
./plugins/opDiaryPlugin/config/member_config.yml
./plugins/opAuthMailAddressPlugin/config/member_config.yml
./plugins/opBlogPlugin/config/member_config.yml
IsRegistがtrueとなるmember_config.ymlの設定
./lib/config/config/member_config.yml
36 age_public_flag:
37 Name: "age_public_flag"
38 Caption: "Public Flag for Age"
39 FormType: "select"
40 ValueType: "integer"
41 IsRegist: true
42 IsConfig: true
43 IsRequired: true
44 IsUnique: false
45 IsConfirm: false
46 Default: 3
47 Choices:
48 4: "All Users on the Web"
49 1: "All Members"
50 2: "%my_friend%"
51 3: "Private"
87 password:
88 _attributes:
89 caption: "Password Configuration"
90 enable_pc: true
91 enable_mobile: true
92 password:
93 Name: "password"
94 Caption: "Password"
95 Info: "Password must be 6-12 characters."
96 FormType: "password"
97 ValueType: "password"
98 IsRegist: true
99 IsConfig: true
100 IsUnique: false
101 IsRequired: true
102 IsConfirm: true
./plugins/opAuthMailAddressPlugin/config/member_config.yml
secretQuestion:
_attributes:
caption: "Secret Question Configuration"
enable_pc: true
enable_mobile: true
secret_question:
Name: "secret_question"
Caption: "Secret Question"
FormType: "select"
ValueType: "integer"
IsRegist: true
IsConfig: true
IsUnique: false
IsRequired: true
IsConfirm: false
Choices:
1 : "What is your father's / mother's former name?"
2 : "What is last 5 digits of your driving license number?"
3 : "What is your first crush's name?"
4 : "What is your finished elementary school?"
5 : "What is region name of your domicile of origin?"
secret_answer:
Name: "secret_answer"
Caption: "Answer for Secret Question"
FormType: "password"
ValueType: "text"
IsRegist: true
IsConfig: true
IsUnique: false
IsRequired: true
IsConfirm: false