<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimHei;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimHei;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Times New Roman";}
h2
        {margin-top:13.0pt;
        margin-right:0cm;
        margin-bottom:13.0pt;
        margin-left:0cm;
        text-align:justify;
        text-justify:inter-ideograph;
        text-indent:0cm;
        line-height:173%;
        page-break-after:avoid;
        mso-list:l0 level2 lfo1;
        font-size:16.0pt;
        font-family:Arial;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.3, li.3, div.3
        {margin-top:18.0pt;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        text-indent:0cm;
        page-break-after:avoid;
        mso-list:l0 level2 lfo1;
        border:none;
        padding:0cm;
        font-size:14.0pt;
        font-family:Arial;
        font-weight:bold;}
span.EmailStyle18
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
/* Page Definitions */
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;
        layout-grid:15.6pt;}
div.Section1
        {page:Section1;}
/* List Definitions */
@list l0
        {mso-list-id:-5;
        mso-list-template-ids:-1309137922;}
@list l0:level1
        {mso-level-tab-stop:18.0pt;
        mso-level-number-position:left;
        margin-left:0cm;
        text-indent:0cm;
        font-family:Arial;}
@list l0:level2
        {mso-level-style-link:"\6807\9898 2";
        mso-level-text:"%1\.%2";
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        margin-left:0cm;
        text-indent:0cm;
        font-family:Arial;}
@list l0:level3
        {mso-level-text:"%1\.%2\.%3";
        mso-level-tab-stop:54.0pt;
        mso-level-number-position:left;
        margin-left:0cm;
        text-indent:0cm;
        font-family:Arial;}
@list l0:level4
        {mso-level-text:"%1\.%2\.%3\.%4";
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        margin-left:0cm;
        text-indent:0cm;
        font-family:Arial;}
@list l0:level5
        {mso-level-text:"%1\.%2\.%3\.%4\.%5";
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        margin-left:0cm;
        text-indent:0cm;
        font-family:Arial;}
@list l0:level6
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6";
        mso-level-tab-stop:90.0pt;
        mso-level-number-position:left;
        margin-left:0cm;
        text-indent:0cm;
        font-family:Arial;}
@list l0:level7
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7";
        mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        margin-left:0cm;
        text-indent:0cm;
        font-family:Arial;}
@list l0:level8
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8";
        mso-level-tab-stop:126.0pt;
        mso-level-number-position:left;
        margin-left:0cm;
        text-indent:0cm;
        font-family:Arial;}
@list l0:level9
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.%9";
        mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        margin-left:0cm;
        text-indent:0cm;
        font-family:Arial;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'>
<div class=Section1 style='layout-grid:15.6pt'>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>Hi all,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>I’ve just created my own block module, and a
configuration form for it. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>Now I just wonder whether it is possible to add my own
validation function before Drupal save the block configuration? <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>I tried to add the code like:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>$form[#validate][] = ‘my_validation_function_name’;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>But it seems it doesn’t help.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>So the question is whether Drupal support to do this
during the configuration of block. If so, then how I can achieve this?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>Thanks in advance.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>travis<o:p></o:p></span></font></p>
</div>
</body>
</html>