Zend_Dojo-Form-Elements.xml 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <!-- EN-Revision: 15851 -->
  4. <sect2 id="zend.dojo.form.elements">
  5. <title>Dijitに特有のフォーム要素</title>
  6. <para>
  7. ビュー・ヘルパーが提供される各々のフォームdijitには、
  8. 対応する<classname>Zend_Form</classname>要素があります。
  9. dijitパラメータを操作するための以下のメソッドがそれらすべてにあります:
  10. </para>
  11. <itemizedlist>
  12. <listitem><para>
  13. <code>setDijitParam($key, $value)</code>:
  14. dijitパラメータを一つセットします。
  15. dijitパラメータがすでに存在すれば、上書きされます。
  16. </para></listitem>
  17. <listitem><para>
  18. <code>setDijitParams(array $params)</code>:
  19. 一度にいくつかのdijitパラメータをセットします。
  20. 渡されたパラメータにマッチする既存のパラメータは上書きされます。
  21. </para></listitem>
  22. <listitem><para>
  23. <code>hasDijitParam($key)</code>:
  24. 与えられたdijitパラメータが定義されたか存在している場合はtrueを返します。
  25. それ以外はfalseを返します。
  26. </para></listitem>
  27. <listitem><para>
  28. <code>getDijitParam($key)</code>:
  29. 与えられたdijitパラメータを返します。
  30. 利用できない場合は null値を返します。
  31. </para></listitem>
  32. <listitem><para>
  33. <code>getDijitParams()</code>:
  34. dijitパラメータを全て返します。
  35. </para></listitem>
  36. <listitem><para>
  37. <code>removeDijitParam($key)</code>:
  38. 与えられたdijitパラメータを除去します。
  39. </para></listitem>
  40. <listitem><para>
  41. <code>clearDijitParams()</code>:
  42. 現行定義されたdijitパラメータを全て消去します。
  43. </para></listitem>
  44. </itemizedlist>
  45. <para>
  46. Dijitパラメータは、<code>dijitParams</code> public プロパティに保存されます。
  47. このように、あなたは単にこのプロパティを要素の上に置くことによって、
  48. 既存のフォーム要素をdijit使用可能にすることができます;
  49. あなたは、単にパラメータを操作するのを容易にするために、
  50. 上記のアクセッサを持っていません。
  51. </para>
  52. <para>
  53. その上、dijitに特有の要素は以下に該当するデコレーターの独特な一覧を実装します:
  54. </para>
  55. <programlisting language="php"><![CDATA[
  56. $element->addDecorator('DijitElement')
  57. ->addDecorator('Errors')
  58. ->addDecorator('HtmlTag', array('tag' => 'dd'))
  59. ->addDecorator('Label', array('tag' => 'dt'));
  60. ]]></programlisting>
  61. <para>
  62. 実質的に、Dijit要素が、標準的なViewHelperデコレーターの代わりに使われます。
  63. </para>
  64. <para>
  65. 最後に、ベースDijit要素により、
  66. 確実にDojoビュー・ヘルパー・パスがビューの上に置かれることになります。
  67. </para>
  68. <para>
  69. Dijit要素、DijitMultiの変化は<code>Multi</code> abstract フォーム要素の機能を提供します。
  70. そして、開発者が 'multiOptions' を指定できるようにします。
  71. - 一般的に select の option またはラジオ のoptionです。
  72. </para>
  73. <para>
  74. 以下のdijit要素は、標準的なZend Framework配布において出荷されます。
  75. </para>
  76. <sect3 id="zend.dojo.form.elements.button">
  77. <title>ボタン</title>
  78. <para>
  79. <link linkend="zend.form.standardElements.button">標準的なボタン要素</link>に
  80. 由来していないので、
  81. 同じ機能を実装して、ドロップインの代わりとして使うことができます。
  82. 以下の機能が公開されます:
  83. </para>
  84. <itemizedlist>
  85. <listitem><para>
  86. 名前が提供されないならば、
  87. <code>getLabel()</code>はボタン・ラベルとして要素名を利用します。
  88. さらに、翻訳メッセージにマッチした翻訳アダプターが利用できれば、
  89. それは名前を翻訳します。
  90. </para></listitem>
  91. <listitem><para>
  92. <code>isChecked()</code>は、
  93. 提出される値がラベルにマッチするかどうか決定します;
  94. もしマッチするなら、それはtrueを返します。
  95. これは、フォームが提出されたとき、どのボタンが使われたかについて決定することに役立ちます。
  96. </para></listitem>
  97. </itemizedlist>
  98. <para>
  99. さらに、デコレーターの<code>DijitElement</code>及び
  100. <code>DtDdWrapper</code>だけがボタン要素のために使われます。
  101. </para>
  102. <example id="zend.dojo.form.elements.button.example">
  103. <title>ボタンdijit要素の使用例</title>
  104. <programlisting language="php"><![CDATA[
  105. $form->addElement(
  106. 'Button',
  107. 'foo',
  108. array(
  109. 'label' => 'Button Label',
  110. )
  111. );
  112. ]]></programlisting>
  113. </example>
  114. </sect3>
  115. <sect3 id="zend.dojo.form.elements.checkBox">
  116. <title>チェックボックス</title>
  117. <para>
  118. <link linkend="zend.form.standardElements.checkbox">標準的なチェックボックス要素</link>
  119. に由来していないので、
  120. それは同じ機能を実装します。
  121. これは、以下のメソッドが公開されることを意味します
  122. </para>
  123. <itemizedlist>
  124. <listitem><para>
  125. <code>setCheckedValue($value)</code>:
  126. 要素がチェックされたときに使う値を設定します。
  127. </para></listitem>
  128. <listitem><para>
  129. <code>getCheckedValue()</code>:
  130. チェックされたときに要素で使う値を取得します。
  131. </para></listitem>
  132. <listitem><para>
  133. <code>setUncheckedValue($value)</code>:
  134. チェックされていないときに要素で使う値を設定します。
  135. </para></listitem>
  136. <listitem><para>
  137. <code>getUncheckedValue()</code>:
  138. チェックされていないときに要素で使う値を取得します。
  139. </para></listitem>
  140. <listitem><para>
  141. <code>setChecked($flag)</code>:
  142. 要素をチェック済みにするか否か設定します。
  143. </para></listitem>
  144. <listitem><para>
  145. <code>isChecked()</code>:
  146. 要素が現在チェック済みか判断します。
  147. </para></listitem>
  148. </itemizedlist>
  149. <example id="zend.dojo.form.elements.checkBox.example">
  150. <title>チェックボックスdijit要素の使用例</title>
  151. <programlisting language="php"><![CDATA[
  152. $form->addElement(
  153. 'CheckBox',
  154. 'foo',
  155. array(
  156. 'label' => 'A check box',
  157. 'checkedValue' => 'foo',
  158. 'uncheckedValue' => 'bar',
  159. 'checked' => true,
  160. )
  161. );
  162. ]]></programlisting>
  163. </example>
  164. </sect3>
  165. <sect3 id="zend.dojo.form.elements.comboBox">
  166. <title>コンボボックス及びフィルタリング選択</title>
  167. <para>
  168. コンボボックス
  169. <link linkend="zend.dojo.view.dijit.form">dijitビュー・ヘルパー・文書</link>
  170. にみられるように、コンボボックスは選択とテキスト入力の混合です。
  171. そして、自動補完及び、提示された選択肢の代わりを指定できるようにします。
  172. フィルタリング選択は同じことですが、任意の入力を許しません。
  173. </para>
  174. <note>
  175. <title>ラベル値を返すコンボボックス</title>
  176. <para>
  177. コンボボックスはラベル値を返します。
  178. 期待に反するオプション値は返しません。
  179. この理由から、コンボボックスは<code>InArray</code>バリデーターを自動登録しません。
  180. (FilteringSelectsがそうするけれども)
  181. </para>
  182. </note>
  183. <para>
  184. コンボボックスとフィルタリング選択フォーム要素は、
  185. dojo.dataデータ・ストア(使用された場合)を指定することだけでなく、
  186. 選ばれた選択肢を調べて、セットするためにアクセッサとミューテーターを提供します。
  187. それらはDijitMultiから拡張します。
  188. そして、それは<code>setMultiOptions()</code>及び<code>setMultiOption()</code>メソッドによって
  189. 選ばれた選択肢を指定することができます。
  190. さらに、以下のメソッドを利用できます:
  191. </para>
  192. <itemizedlist>
  193. <listitem><para>
  194. <code>getStoreInfo()</code>:
  195. 現行で設定されているデータストア情報を全て取得します。
  196. 現行で設定されたデータがなければ、空の配列を返します。
  197. </para></listitem>
  198. <listitem><para>
  199. <code>setStoreId($identifier)</code>:
  200. ストアの識別変数を設定します。
  201. (通常、Dojoで 'jsId' 属性によって言及されます)
  202. これは、有効なjavascript変数の名前でなければなりません。
  203. </para></listitem>
  204. <listitem><para>
  205. <code>getStoreId()</code>:
  206. ストアの識別変数名を取得します。
  207. </para></listitem>
  208. <listitem><para>
  209. <code>setStoreType($dojoType)</code>:
  210. 使用するデータストアクラスを設定します;
  211. 例えば "dojo.data.ItemFileReadStore"
  212. </para></listitem>
  213. <listitem><para>
  214. <code>getStoreType()</code>:
  215. 使用するdojoデータストアクラスを取得します。
  216. </para></listitem>
  217. <listitem><para>
  218. <code>setStoreParams(array $params)</code>:
  219. データ・ストア・オブジェクトを構成するために使われるパラメータをいずれも設定します。
  220. 例えば、 dojo.data.ItemFileReadStore データストアでは
  221. dojo.dataオブジェクトを返す場所を指す 'url' パラメータを期待します。
  222. </para></listitem>
  223. <listitem><para>
  224. <code>getStoreParams()</code>:
  225. 現行で設定されているデータストアパラメータをいずれも取得します;
  226. もしなければ、空の配列を返します。
  227. </para></listitem>
  228. <listitem><para>
  229. <code>setAutocomplete($flag)</code>:
  230. ユーザーが要素から離れるとき、選ばれた項目が使われるかどうかを示します。
  231. </para></listitem>
  232. <listitem><para>
  233. <code>getAutocomplete()</code>:
  234. 自動補完フラグの値を取得します。
  235. </para></listitem>
  236. </itemizedlist>
  237. <para>
  238. dojo.dataストアが要素で登録されなければ、
  239. 登録された選択肢の配列のキーを検証する<code>InArray</code>バリデーターを
  240. この要素はデフォルトで登録します。
  241. <code>setRegisterInArrayValidator(false)</code>を呼び出すことでも、
  242. <code>registerInArrayValidator</code>設定キーにfalse値を渡すことでも、
  243. このふるまいを抑制することができます。
  244. </para>
  245. <example id="zend.dojo.form.elements.comboBox.selectExample">
  246. <title>コンボボックスdijit要素を選択肢入力として使う</title>
  247. <programlisting language="php"><![CDATA[
  248. $form->addElement(
  249. 'ComboBox',
  250. 'foo',
  251. array(
  252. 'label' => 'ComboBox (select)',
  253. 'value' => 'blue',
  254. 'autocomplete' => false,
  255. 'multiOptions' => array(
  256. 'red' => 'Rouge',
  257. 'blue' => 'Bleu',
  258. 'white' => 'Blanc',
  259. 'orange' => 'Orange',
  260. 'black' => 'Noir',
  261. 'green' => 'Vert',
  262. ),
  263. )
  264. );
  265. ]]></programlisting>
  266. </example>
  267. <example id="zend.dojo.form.elements.comboBox.datastoreExample">
  268. <title>コンボボックスdijit要素をデータ・ストアと一緒に使う</title>
  269. <programlisting language="php"><![CDATA[
  270. $form->addElement(
  271. 'ComboBox',
  272. 'foo',
  273. array(
  274. 'label' => 'ComboBox (datastore)',
  275. 'storeId' => 'stateStore',
  276. 'storeType' => 'dojo.data.ItemFileReadStore',
  277. 'storeParams' => array(
  278. 'url' => '/js/states.txt',
  279. ),
  280. 'dijitParams' => array(
  281. 'searchAttr' => 'name',
  282. ),
  283. )
  284. );
  285. ]]></programlisting>
  286. </example>
  287. <para>
  288. 前述の例は<code>ComboBox</code>の代わりに
  289. <code>FilteringSelect</code>を使用します。
  290. </para>
  291. </sect3>
  292. <sect3 id="zend.dojo.form.elements.currencyTextBox">
  293. <title>通貨テキストボックス</title>
  294. <para>
  295. 通貨テキストボックスは、主に通貨入力をサポートするためにあります。
  296. 通貨はローカライズされるかもしれず、小数も非小数もサポートできます。
  297. </para>
  298. <para>
  299. 内部的には、通貨テキストボックスは
  300. <link linkend="zend.dojo.form.elements.numberTextBox">数値テキストボックス</link>や
  301. <link linkend="zend.dojo.form.elements.validationTextBox">検証テキストボックス</link>および
  302. <link linkend="zend.dojo.form.elements.textBox">テキストボックス</link>に由来します;
  303. それらのクラスのメソッドが全て利用可能です。
  304. さらに、下記の制約メソッドを使用できます:
  305. </para>
  306. <itemizedlist>
  307. <listitem><para>
  308. <code>setCurrency($currency)</code>:
  309. 使用する通貨種類を設定します;
  310. <ulink url="http://en.wikipedia.org/wiki/ISO_4217">ISO-4217</ulink>
  311. 仕様に従うでしょう。
  312. </para></listitem>
  313. <listitem><para>
  314. <code>getCurrency()</code>:現行の通貨種類を取得します。
  315. </para></listitem>
  316. <listitem><para>
  317. <code>setSymbol($symbol)</code>: 3文字からなる<ulink
  318. url="http://en.wikipedia.org/wiki/ISO_4217">ISO-4217</ulink>
  319. 通貨記号を設定します。
  320. </para></listitem>
  321. <listitem><para>
  322. <code>getSymbol()</code>:
  323. 現行の通貨記号を取得します。
  324. </para></listitem>
  325. <listitem><para>
  326. <code>setFractional($flag)</code>:
  327. 通貨で小数を許すかどうか設定します。
  328. </para></listitem>
  329. <listitem><para>
  330. <code>getFractional()</code>:
  331. 小数フラグの状態を取得します。
  332. </para></listitem>
  333. </itemizedlist>
  334. <example id="zend.dojo.form.elements.currencyTextBox.example">
  335. <title>通貨テキストボックスdijit要素の使用例</title>
  336. <programlisting language="php"><![CDATA[
  337. $form->addElement(
  338. 'CurrencyTextBox',
  339. 'foo',
  340. array(
  341. 'label' => 'Currency:',
  342. 'required' => true,
  343. 'currency' => 'USD',
  344. 'invalidMessage' => 'Invalid amount. ' .
  345. 'Include dollar sign, commas, and cents.',
  346. 'fractional' => false,
  347. )
  348. );
  349. ]]></programlisting>
  350. </example>
  351. </sect3>
  352. <sect3 id="zend.dojo.form.elements.dateTextBox">
  353. <title>日付テキストボックス</title>
  354. <para>
  355. 日付テキストボックスは、
  356. カレンダー・ドロップダウンで日付(クライアント側日付確認とフォーマッティングだけでなく)
  357. を選ぶために提供します。
  358. </para>
  359. <para>
  360. 内部的に、日付テキストボックスは
  361. <link linkend="zend.dojo.form.elements.validationTextBox">検証テキストボックス</link>
  362. および<link linkend="zend.dojo.form.elements.textBox">テキストボックス</link>
  363. に由来します;
  364. それらのクラスのメソッドが全て利用可能です。さらに、
  365. 個別の制約を設定するために下記のメソッドを使用できます:
  366. </para>
  367. <itemizedlist>
  368. <listitem><para>
  369. <code>setAmPm($flag)</code>及び<code>getAmPm()</code>:
  370. 時刻でAM/PM 文字列を使うかどうか
  371. </para></listitem>
  372. <listitem><para>
  373. <code>setStrict($flag)</code>及び<code>getStrict()</code>:
  374. 入力を確認した時にマッチする厳しい正規表現を使うかどうか。
  375. デフォルトはfalseですが、空白文字やいくつかの省略形を許します。
  376. </para></listitem>
  377. <listitem><para>
  378. <code>setLocale($locale)</code>及び<code>getLocale()</code>:
  379. 指定した要素で使うロケールを設定または取得します。
  380. </para></listitem>
  381. <listitem><para>
  382. <code>setDatePattern($pattern)</code>及び
  383. <code>getDatePattern()</code>:
  384. 日付をフォーマットする<ulink
  385. url="http://www.unicode.org/reports/tr35/#Date_Format_Patterns">
  386. unicode 日付形式パターン</ulink>を提示または取得します。
  387. </para></listitem>
  388. <listitem><para>
  389. <code>setFormatLength($formatLength)</code>及び
  390. <code>getFormatLength()</code>:
  391. 使用する形式の長さの種類を提示または取得します;
  392. "long"、"short"、"medium"または"full"のどれか一つです。
  393. </para></listitem>
  394. <listitem><para>
  395. <code>setSelector($selector)</code>及び
  396. <code>getSelector()</code>:
  397. セレクタのスタイルを提示または取得します;
  398. "date" や "time" のどちらかでしょう。
  399. </para></listitem>
  400. </itemizedlist>
  401. <example id="zend.dojo.form.elements.dateTextBox.example">
  402. <title>日付テキストボックスdijit要素の使用例</title>
  403. <programlisting language="php"><![CDATA[
  404. $form->addElement(
  405. 'DateTextBox',
  406. 'foo',
  407. array(
  408. 'label' => 'Date:',
  409. 'required' => true,
  410. 'invalidMessage' => 'Invalid date specified.',
  411. 'formatLength' => 'long',
  412. )
  413. );
  414. ]]></programlisting>
  415. </example>
  416. </sect3>
  417. <sect3 id="zend.dojo.form.elements.editor">
  418. <title>エディタ</title>
  419. <para>
  420. エディタはリッチなHTML内容を作成して、
  421. 編集するために利用できるWYSIWYGエディタを提供します。
  422. dijit.Editorはプラグイン可能で、
  423. 必要に応じてカスタム・プラグインで拡張されるかもしれません;
  424. 詳しくは<ulink
  425. url="http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/advanced-editing-and-display/editor-rich-text">
  426. dijit.Editorドキュメント</ulink>をご覧下さい。
  427. </para>
  428. <para>
  429. エディタ・フォーム要素は、
  430. 下記のいくつかのアクセッサとミューテーターを
  431. いろいろなdijitパラメータを操作するために提供します:
  432. </para>
  433. <itemizedlist>
  434. <listitem>
  435. <para>
  436. <emphasis>captureEvents</emphasis>は、
  437. 編集エリア自体と連携するイベントです。
  438. 捕獲したイベントを操作するために以下のアクセッサとミューテーターを利用できます:
  439. </para>
  440. <itemizedlist>
  441. <listitem><para><code>addCaptureEvent($event)</code></para></listitem>
  442. <listitem><para><code>addCaptureEvents(array $events)</code></para></listitem>
  443. <listitem><para><code>setCaptureEvents(array $events)</code></para></listitem>
  444. <listitem><para><code>getCaptureEvents()</code></para></listitem>
  445. <listitem><para><code>hasCaptureEvent($event)</code></para></listitem>
  446. <listitem><para><code>removeCaptureEvent($event)</code></para></listitem>
  447. <listitem><para><code>clearCaptureEvents()</code></para></listitem>
  448. </itemizedlist>
  449. </listitem>
  450. <listitem>
  451. <para>
  452. <emphasis>events</emphasis>は、
  453. onClickやonKeyUpなどのような標準的なDOMイベントです。
  454. イベントを操作するために以下のアクセッサとミューテーターを利用できます:
  455. </para>
  456. <itemizedlist>
  457. <listitem><para><code>addEvent($event)</code></para></listitem>
  458. <listitem><para><code>addEvents(array $events)</code></para></listitem>
  459. <listitem><para><code>setEvents(array $events)</code></para></listitem>
  460. <listitem><para><code>getEvents()</code></para></listitem>
  461. <listitem><para><code>hasEvent($event)</code></para></listitem>
  462. <listitem><para><code>removeEvent($event)</code></para></listitem>
  463. <listitem><para><code>clearEvents()</code></para></listitem>
  464. </itemizedlist>
  465. </listitem>
  466. <listitem>
  467. <para>
  468. <emphasis>plugins</emphasis>はエディターにツールバーのための追加のツールや、
  469. 許可する追加スタイルなどの機能を加えます。
  470. プラグインを操作するために以下のアクセッサとミューテーターを利用できます:
  471. </para>
  472. <itemizedlist>
  473. <listitem><para><code>addPlugin($plugin)</code></para></listitem>
  474. <listitem><para><code>addPlugins(array $plugins)</code></para></listitem>
  475. <listitem><para><code>setPlugins(array $plugins)</code></para></listitem>
  476. <listitem><para><code>getPlugins()</code></para></listitem>
  477. <listitem><para><code>hasPlugin($plugin)</code></para></listitem>
  478. <listitem><para><code>removePlugin($plugin)</code></para></listitem>
  479. <listitem><para><code>clearPlugins()</code></para></listitem>
  480. </itemizedlist>
  481. </listitem>
  482. <listitem>
  483. <para>
  484. <emphasis>editActionInterval</emphasis>は、
  485. アンドゥ操作のためにイベントをまとめるために使われます。
  486. デフォルトでこの値は3秒です。
  487. <code>setEditActionInterval($interval)</code>メソッドが値を設定するために使われるかもしれません。
  488. 一方で、<code>getEditActionInterval()</code>が値を取得します。
  489. </para>
  490. </listitem>
  491. <listitem>
  492. <para>
  493. <emphasis>focusOnLoad</emphasis>は、
  494. ページが読み込まれたとき、
  495. この指定のエディタがフォーカスを受けるかどうか判断するために使われます。
  496. デフォルトでこれはfalseです。
  497. メソッド<code>setFocusOnLoad($flag)</code>が値を設定するために使われるかもしれません。
  498. 一方で、<code>getFocusOnLoad()</code>が値を取得します。
  499. </para>
  500. </listitem>
  501. <listitem>
  502. <para>
  503. <emphasis>height</emphasis>はエディターの高さを指定します;
  504. デフォルトでこれは300pxです。
  505. メソッド<code>setHeight($height)</code>が値を設定するために使われるかもしれません。
  506. 一方で、<code>getHeight()</code>が値を取得します。
  507. </para>
  508. </listitem>
  509. <listitem>
  510. <para>
  511. <emphasis>inheritWidth</emphasis>は、
  512. エディタが親コンテナの幅と単純にデフォルトの100%幅のどちらを使うか決定するために使われます。
  513. デフォルトでこれはfalseです。
  514. (すなわち、画面の幅一杯を満たします)
  515. メソッド<code>setInheritWidth($flag)</code>が値を設定するために使われるかもしれません。
  516. 一方で、<code>getInheritWidth()</code>が値を取得します。
  517. </para>
  518. </listitem>
  519. <listitem>
  520. <para>
  521. <emphasis>minHeight</emphasis>はエディターの高さの最小値を設定します;
  522. デフォルトでこれは1emです。
  523. メソッド<code>setMinHeight($height)</code>が値を設定するために使われるかもしれません。
  524. 一方で、<code>getMinHeight()</code>が値を取得します。
  525. </para>
  526. </listitem>
  527. <listitem>
  528. <para>
  529. <emphasis>styleSheets</emphasis>は、
  530. どの追加CSSスタイルシートがエディタの表示に影響を及ぼすために使われるか示します。
  531. デフォルトでは何も登録されず、それはページ・スタイルを継承します。
  532. エディタ・スタイルシートを操作するために以下のアクセッサとミューテーターを利用できます:
  533. </para>
  534. <itemizedlist>
  535. <listitem><para><code>addStyleSheet($styleSheet)</code></para></listitem>
  536. <listitem>
  537. <para><code>addStyleSheets(array $styleSheets)</code></para>
  538. </listitem>
  539. <listitem>
  540. <para><code>setStyleSheets(array $styleSheets)</code></para>
  541. </listitem>
  542. <listitem><para><code>getStyleSheets()</code></para></listitem>
  543. <listitem><para><code>hasStyleSheet($styleSheet)</code></para></listitem>
  544. <listitem><para><code>removeStyleSheet($styleSheet)</code></para></listitem>
  545. <listitem><para><code>clearStyleSheets()</code></para></listitem>
  546. </itemizedlist>
  547. </listitem>
  548. </itemizedlist>
  549. <example id="zend.dojo.form.elements.editor.example">
  550. <title>エディタdijit要素の使用例</title>
  551. <programlisting language="php"><![CDATA[
  552. $form->addElement('editor', 'content', array(
  553. 'plugins' => array('undo', '|', 'bold', 'italic'),
  554. 'editActionInterval' => 2,
  555. 'focusOnLoad' => true,
  556. 'height' => '250px',
  557. 'inheritWidth' => true,
  558. 'styleSheets' => array('/js/custom/editor.css'),
  559. ));
  560. ]]></programlisting>
  561. </example>
  562. </sect3>
  563. <sect3 id="zend.dojo.form.elements.horizontalSlider">
  564. <title>水平スライダー</title>
  565. <para>
  566. 水平スライダーは、
  567. ある範囲で数値を選択するためのスライダーUI部品を提供します。
  568. 内部的には、それはフォームによって送信されるhidden要素の値をセットします。
  569. </para>
  570. <para>
  571. 水平スライダーは、<link
  572. linkend="zend.dojo.form.elements.slider">抽象的なスライダーdijit要素</link>に由来します。
  573. さらに、スライダー・ルールとルール・ラベルをセットして設定するための、
  574. いろいろなメソッドがあります。
  575. </para>
  576. <itemizedlist>
  577. <listitem>
  578. <para>
  579. <code>setTopDecorationDijit($dijit)</code>及び
  580. <code>setBottomDecorationDijit($dijit)</code>:
  581. スライダーのトップかボトムで使うdijitの名前をセットします。
  582. これは、接頭辞 "dijit.form." を含んではいけません。
  583. むしろ final 名だけ
  584. - "HorizontalRule" または "HorizontalRuleLabels" のうちの1つ -
  585. を含まなければなりません。
  586. </para>
  587. </listitem>
  588. <listitem>
  589. <para>
  590. <code>setTopDecorationContainer($container)</code>及び
  591. <code>setBottomDecorationContainer($container)</code>:
  592. ルールのコンテナ要素のために使用する名前を指定します;
  593. 例えば、'topRule' や 'topContainer'など。
  594. </para>
  595. </listitem>
  596. <listitem>
  597. <para>
  598. <code>setTopDecorationLabels(array $labels)</code>及び
  599. <code>setBottomDecorationLabels(array $labels)</code>:
  600. RuleLabels dijit型のうちの1つで使用するラベルをセットします。
  601. これらは、インデックスを付けられた配列でなければなりません;
  602. 与えられたラベル位置(例えば始めまたは終わり)をスキップするために、
  603. 一つの空の場所を指定します。
  604. </para>
  605. </listitem>
  606. <listitem>
  607. <para>
  608. <code>setTopDecorationParams(array $params)</code>及び
  609. <code>setBottomDecorationParams(array $params)</code>:
  610. 与えられたルール、
  611. またはRuleLabels dijitを構成するときに使うdijitパラメータです。
  612. </para>
  613. </listitem>
  614. <listitem>
  615. <para>
  616. <code>setTopDecorationAttribs(array $attribs)</code>及び
  617. <code>setBottomDecorationAttribs(array $attribs)</code>:
  618. 与えられたルールまたはRuleLabels HTML要素コンテナのために指定するHTML属性です。
  619. </para>
  620. </listitem>
  621. <listitem>
  622. <para>
  623. <code>getTopDecoration()</code>及び
  624. <code>getBottomDecoration()</code>:
  625. 上記のミューテーターによって提示されたように、
  626. 与えられたルールまたはRuleLabels定義のためにすべてのメタデータを取得します。
  627. </para>
  628. </listitem>
  629. </itemizedlist>
  630. <example id="zend.dojo.form.elements.horizontalSlider.example">
  631. <title>水平スライダーdijit要素使用例</title>
  632. <para>
  633. <!-- TODO -->
  634. The following will create a horizontal slider selection with
  635. integer values ranging from -10 to 10. The top will have labels
  636. at the 20%, 40%, 60%, and 80% marks. The botton will have rules
  637. at 0, 50%, and 100%. Each time the value is changed, the hidden
  638. element storing the value will be updated.
  639. </para>
  640. <programlisting language="php"><![CDATA[
  641. $form->addElement(
  642. 'HorizontalSlider',
  643. 'horizontal',
  644. array(
  645. 'label' => 'HorizontalSlider',
  646. 'value' => 5,
  647. 'minimum' => -10,
  648. 'maximum' => 10,
  649. 'discreteValues' => 11,
  650. 'intermediateChanges' => true,
  651. 'showButtons' => true,
  652. 'topDecorationDijit' => 'HorizontalRuleLabels',
  653. 'topDecorationContainer' => 'topContainer',
  654. 'topDecorationLabels' => array(
  655. ' ',
  656. '20%',
  657. '40%',
  658. '60%',
  659. '80%',
  660. ' ',
  661. ),
  662. 'topDecorationParams' => array(
  663. 'container' => array(
  664. 'style' => 'height:1.2em; font-size=75%;color:gray;',
  665. ),
  666. 'list' => array(
  667. 'style' => 'height:1em; font-size=75%;color:gray;',
  668. ),
  669. ),
  670. 'bottomDecorationDijit' => 'HorizontalRule',
  671. 'bottomDecorationContainer' => 'bottomContainer',
  672. 'bottomDecorationLabels' => array(
  673. '0%',
  674. '50%',
  675. '100%',
  676. ),
  677. 'bottomDecorationParams' => array(
  678. 'list' => array(
  679. 'style' => 'height:1em; font-size=75%;color:gray;',
  680. ),
  681. ),
  682. )
  683. );
  684. ]]></programlisting>
  685. </example>
  686. </sect3>
  687. <sect3 id="zend.dojo.form.elements.numberSpinner">
  688. <title>NumberSpinner</title>
  689. <para>
  690. A number spinner is a text element for entering numeric values; it
  691. also includes elements for incrementing and decrementing the value
  692. by a set amount.
  693. </para>
  694. <para>
  695. The following methods are available:
  696. </para>
  697. <itemizedlist>
  698. <listitem><para>
  699. <code>setDefaultTimeout($timeout)</code>及び
  700. <code>getDefaultTimeout()</code>: set and retrieve the default
  701. timeout, in milliseconds, between when the button is held
  702. pressed and the value is changed.
  703. </para></listitem>
  704. <listitem><para>
  705. <code>setTimeoutChangeRate($rate)</code>及び
  706. <code>getTimeoutChangeRate()</code>: set and retrieve the
  707. rate, in milliseconds, at which changes will be made when a
  708. button is held pressed.
  709. </para></listitem>
  710. <listitem><para>
  711. <code>setLargeDelta($delta)</code>及び
  712. <code>getLargeDelta()</code>: set and retrieve the amount by
  713. which the numeric value should change when a button is held
  714. pressed.
  715. </para></listitem>
  716. <listitem><para>
  717. <code>setSmallDelta($delta)</code>及び
  718. <code>getSmallDelta()</code>: set and retrieve the delta by
  719. which the number should change when a button is pressed once.
  720. </para></listitem>
  721. <listitem><para>
  722. <code>setIntermediateChanges($flag)</code>及び
  723. <code>getIntermediateChanges()</code>: set and retrieve the
  724. flag indicating whether or not each value change should be
  725. shown when a button is held pressed.
  726. </para></listitem>
  727. <listitem><para>
  728. <code>setRangeMessage($message)</code>及び
  729. <code>getRangeMessage()</code>: set and retrieve the message
  730. indicating the range of values available.
  731. </para></listitem>
  732. <listitem><para>
  733. <code>setMin($value)</code>及び<code>getMin()</code>: set and
  734. retrieve the minimum value possible.
  735. </para></listitem>
  736. <listitem><para>
  737. <code>setMax($value)</code>及び<code>getMax()</code>: set and
  738. retrieve the maximum value possible.
  739. </para></listitem>
  740. </itemizedlist>
  741. <example id="zend.dojo.form.elements.numberSpinner.example">
  742. <title>NumberSpinner dijit要素の使用例</title>
  743. <programlisting language="php"><![CDATA[
  744. $form->addElement(
  745. 'NumberSpinner',
  746. 'foo',
  747. array(
  748. 'value' => '7',
  749. 'label' => 'NumberSpinner',
  750. 'smallDelta' => 5,
  751. 'largeDelta' => 25,
  752. 'defaultTimeout' => 500,
  753. 'timeoutChangeRate' => 100,
  754. 'min' => 9,
  755. 'max' => 1550,
  756. 'places' => 0,
  757. 'maxlength' => 20,
  758. )
  759. );
  760. ]]></programlisting>
  761. </example>
  762. </sect3>
  763. <sect3 id="zend.dojo.form.elements.numberTextBox">
  764. <title>NumberTextBox</title>
  765. <para>
  766. A number text box is a text element for entering numeric values;
  767. unlike NumberSpinner, numbers are entered manually. Validations and
  768. constraints can be provided to ensure the number stays in a
  769. particular range or format.
  770. </para>
  771. <para>
  772. Internally, NumberTextBox derives from <link
  773. linkend="zend.dojo.form.elements.validationTextBox">ValidationTextBox</link>
  774. and <link linkend="zend.dojo.form.elements.textBox">TextBox</link>;
  775. それらのクラスのメソッドが全て利用可能です。さらに、
  776. 個別の制約を設定するために下記のメソッドを使用できます:
  777. </para>
  778. <itemizedlist>
  779. <listitem><para>
  780. <code>setLocale($locale)</code>及び<code>getLocale()</code>:
  781. specify and retrieve a specific or alternate locale to use with
  782. this dijit.
  783. </para></listitem>
  784. <listitem><para>
  785. <code>setPattern($pattern)</code>及び
  786. <code>getPattern()</code>: set and retrieve a <ulink
  787. url="http://www.unicode.org/reports/tr35/#Number_Format_Patterns">number
  788. pattern format</ulink> to use to format the number.
  789. </para></listitem>
  790. <listitem><para>
  791. <code>setType($type)</code>及び<code>getType()</code>: set and
  792. retrieve the numeric format type to use (should be one of
  793. 'decimal', 'percent', or 'currency').
  794. </para></listitem>
  795. <listitem><para>
  796. <code>setPlaces($places)</code>及び<code>getPlaces()</code>:
  797. set and retrieve the number of decimal places to support.
  798. </para></listitem>
  799. <listitem><para>
  800. <code>setStrict($flag)</code>及び<code>getStrict()</code>: set
  801. and retrieve the value of the strict flag, which indicates how
  802. much leniency is allowed in relation to whitespace and
  803. non-numeric characters.
  804. </para></listitem>
  805. </itemizedlist>
  806. <example id="zend.dojo.form.elements.numberTextBox.example">
  807. <title>数値テキストボックスdijit要素の使用例</title>
  808. <programlisting language="php"><![CDATA[
  809. $form->addElement(
  810. 'NumberTextBox',
  811. 'elevation',
  812. array(
  813. 'label' => 'NumberTextBox',
  814. 'required' => true,
  815. 'invalidMessage' => 'Invalid elevation.',
  816. 'places' => 0,
  817. 'constraints' => array(
  818. 'min' => -20000,
  819. 'max' => 20000,
  820. ),
  821. )
  822. );
  823. ]]></programlisting>
  824. </example>
  825. </sect3>
  826. <sect3 id="zend.dojo.form.elements.passwordTextBox">
  827. <title>PasswordTextBox</title>
  828. <para>
  829. PasswordTextBox is simply a ValidationTextBox that is tied to a
  830. password input; its sole purpose is to allow for a dijit-themed text
  831. entry for passwords that also provides client-side validation.
  832. </para>
  833. <para>
  834. Internally, NumberTextBox derives from <link
  835. linkend="zend.dojo.form.elements.validationTextBox">ValidationTextBox</link>
  836. and <link linkend="zend.dojo.form.elements.textBox">TextBox</link>;
  837. それらのクラスのメソッドが全て利用可能です。
  838. </para>
  839. <example id="zend.dojo.form.elements.passwordTextBox.example">
  840. <title>パスワードテキストボックスの使用例</title>
  841. <programlisting language="php"><![CDATA[
  842. $form->addElement(
  843. 'PasswordTextBox',
  844. 'password',
  845. array(
  846. 'label' => 'Password',
  847. 'required' => true,
  848. 'trim' => true,
  849. 'lowercase' => true,
  850. 'regExp' => '^[a-z0-9]{6,}$',
  851. 'invalidMessage' => 'Invalid password; ' .
  852. 'must be at least 6 alphanumeric characters',
  853. )
  854. );
  855. ]]></programlisting>
  856. </example>
  857. </sect3>
  858. <sect3 id="zend.dojo.form.elements.radioButton">
  859. <title>RadioButton</title>
  860. <para>
  861. RadioButton wraps standard radio input elements to provide a
  862. consistent look and feel with other dojo dijits.
  863. </para>
  864. <para>
  865. RadioButton extends from DijitMulti, which
  866. allows you to specify select options via the
  867. <code>setMultiOptions()</code>及び<code>setMultiOption()</code>
  868. methods.
  869. </para>
  870. <para>
  871. By default, this element registers an <code>InArray</code> validator
  872. which validates against the array keys of registered options. You
  873. can disable this behavior by either calling
  874. <code>setRegisterInArrayValidator(false)</code>, or by passing a
  875. false value to the <code>registerInArrayValidator</code>
  876. configuration key.
  877. </para>
  878. <example id="zend.dojo.form.elements.radioButton.example">
  879. <title>ラジオボタンdijit要素の使用例</title>
  880. <programlisting language="php"><![CDATA[
  881. $form->addElement(
  882. 'RadioButton',
  883. 'foo',
  884. array(
  885. 'label' => 'RadioButton',
  886. 'multiOptions' => array(
  887. 'foo' => 'Foo',
  888. 'bar' => 'Bar',
  889. 'baz' => 'Baz',
  890. ),
  891. 'value' => 'bar',
  892. )
  893. );
  894. ]]></programlisting>
  895. </example>
  896. </sect3>
  897. <sect3 id="zend.dojo.form.elements.simpletextarea">
  898. <title>シンプルテキストエリア</title>
  899. <para>
  900. SimpleTextarea acts primarily like a standard HTML textarea. However, it
  901. does not support either the rows or cols settings. Instead, the
  902. textarea width should be specified using standard CSS measurements.
  903. Unlike Textarea, it will not grow automatically
  904. </para>
  905. <example id="zend.dojo.form.elements.simpletextarea.example">
  906. <title>シンプルテキストエリアdijit要素の使用例</title>
  907. <programlisting language="php"><![CDATA[
  908. $form->addElement(
  909. 'SimpleTextarea',
  910. 'simpletextarea',
  911. array(
  912. 'label' => 'SimpleTextarea',
  913. 'required' => true,
  914. 'style' => 'width: 80em; height: 25em;',
  915. )
  916. );
  917. ]]></programlisting>
  918. </example>
  919. </sect3>
  920. <sect3 id="zend.dojo.form.elements.slider">
  921. <title>Slider abstract element</title>
  922. <para>
  923. Slider is an abstract element from which
  924. <link linkend="zend.dojo.form.elements.horizontalSlider">HorizontalSlider</link>
  925. and
  926. <link linkend="zend.dojo.form.elements.verticalSlider">VerticalSlider</link>
  927. both derive. It exposes a number of common methods for configuring
  928. your sliders, including:
  929. </para>
  930. <itemizedlist>
  931. <listitem><para>
  932. <code>setClickSelect($flag)</code>及び
  933. <code>getClickSelect()</code>: set and retrieve the flag
  934. indicating whether or not clicking the slider changes the
  935. value.
  936. </para></listitem>
  937. <listitem><para>
  938. <code>setIntermediateChanges($flag)</code>及び
  939. <code>getIntermediateChanges()</code>: set and retrieve the
  940. flag indicating whether or not the dijit will send a
  941. notification on each slider change event.
  942. </para></listitem>
  943. <listitem><para>
  944. <code>setShowButtons($flag)</code>及び
  945. <code>getShowButtons()</code>: set and retrieve the flag
  946. indicating whether or not buttons on either end will be
  947. displayed; if so, the user can click on these to change the
  948. value of the slider.
  949. </para></listitem>
  950. <listitem><para>
  951. <code>setDiscreteValues($value)</code>及び
  952. <code>getDiscreteValues()</code>: set and retrieve the number
  953. of discrete values represented by the slider.
  954. </para></listitem>
  955. <listitem><para>
  956. <code>setMaximum($value)</code>及び<code>getMaximum()</code>:
  957. スライダーの最大値を設定します。
  958. </para></listitem>
  959. <listitem><para>
  960. <code>setMinimum($value)</code>及び<code>getMinimum()</code>:
  961. スライダーの最小値を設定します。
  962. </para></listitem>
  963. <listitem><para>
  964. <code>setPageIncrement($value)</code>及び
  965. <code>getPageIncrement()</code>: set the amount by which the
  966. slider will change on keyboard events.
  967. </para></listitem>
  968. </itemizedlist>
  969. <para>
  970. Example usage is provided with each concrete extending class.
  971. </para>
  972. </sect3>
  973. <sect3 id="zend.dojo.form.elements.submitButton">
  974. <title>SubmitButton</title>
  975. <para>
  976. While there is no Dijit named SubmitButton, we include one here to
  977. provide a button dijit capable of submitting a form without
  978. requiring any additional javascript bindings. It works exactly like
  979. the <link linkend="zend.dojo.form.elements.button">Button
  980. dijit</link>.
  981. </para>
  982. <example id="zend.dojo.form.elements.submitButton.example">
  983. <title>サブミットボタンdijit要素の使用例</title>
  984. <programlisting language="php"><![CDATA[
  985. $form->addElement(
  986. 'SubmitButton',
  987. 'foo',
  988. array(
  989. 'required' => false,
  990. 'ignore' => true,
  991. 'label' => 'Submit Button!',
  992. )
  993. );
  994. ]]></programlisting>
  995. </example>
  996. </sect3>
  997. <sect3 id="zend.dojo.form.elements.textBox">
  998. <title>TextBox</title>
  999. <para>
  1000. TextBox is included primarily to provide a text input with
  1001. consistent look-and-feel to the other dijits. However, it also
  1002. includes some minor filtering and validation capabilities,
  1003. represented in the following methods:
  1004. </para>
  1005. <itemizedlist>
  1006. <listitem><para>
  1007. <code>setLowercase($flag)</code>及び
  1008. <code>getLowercase()</code>: set and retrieve the flag
  1009. indicating whether or not input should be cast to lowercase.
  1010. </para></listitem>
  1011. <listitem><para>
  1012. <code>setPropercase($flag)</code>及び
  1013. <code>getPropercase()</code>: set and retrieve the flag
  1014. indicating whether or not the input should be cast to Proper
  1015. Case.
  1016. </para></listitem>
  1017. <listitem><para>
  1018. <code>setUppercase($flag)</code>及び<code>getUppercase()</code>: set and retrieve
  1019. the flag indicating whether or not the input should be cast to UPPERCASE.
  1020. </para></listitem>
  1021. <listitem><para>
  1022. <code>setTrim($flag)</code>及び<code>getTrim()</code>: set and
  1023. retrieve the flag indicating whether or not leading or trailing
  1024. whitespace should be stripped.
  1025. </para></listitem>
  1026. <listitem><para>
  1027. <code>setMaxLength($length)</code>及び
  1028. <code>getMaxLength()</code>: set and retrieve the maximum
  1029. length of input.
  1030. </para></listitem>
  1031. </itemizedlist>
  1032. <example id="zend.dojo.form.elements.textBox.example">
  1033. <title>テキストボックスdijit要素の使用例</title>
  1034. <programlisting language="php"><![CDATA[
  1035. $form->addElement(
  1036. 'TextBox',
  1037. 'foo',
  1038. array(
  1039. 'value' => 'some text',
  1040. 'label' => 'TextBox',
  1041. 'trim' => true,
  1042. 'propercase' => true,
  1043. )
  1044. );
  1045. ]]></programlisting>
  1046. </example>
  1047. </sect3>
  1048. <sect3 id="zend.dojo.form.elements.textarea">
  1049. <title>Textarea</title>
  1050. <para>
  1051. Textarea acts primarily like a standard HTML textarea. However, it
  1052. does not support either the rows or cols settings. Instead, the
  1053. textarea width should be specified using standard CSS measurements;
  1054. rows should be omitted entirely. The textarea will then grow
  1055. vertically as text is added to it.
  1056. </para>
  1057. <example id="zend.dojo.form.elements.textarea.example">
  1058. <title>テキストエリアdijit要素の使用例</title>
  1059. <programlisting language="php"><![CDATA[
  1060. $form->addElement(
  1061. 'Textarea',
  1062. 'textarea',
  1063. array(
  1064. 'label' => 'Textarea',
  1065. 'required' => true,
  1066. 'style' => 'width: 200px;',
  1067. )
  1068. );
  1069. ]]></programlisting>
  1070. </example>
  1071. </sect3>
  1072. <sect3 id="zend.dojo.form.elements.timeTextBox">
  1073. <title>TimeTextBox</title>
  1074. <para>
  1075. TimeTextBox is a text input that provides a drop-down for selecting
  1076. a time. The drop-down may be configured to show a certain window of
  1077. time, with specified increments.
  1078. </para>
  1079. <para>
  1080. Internally, TimeTextBox derives from <link
  1081. linkend="zend.dojo.form.elements.dateTextBox">DateTextBox</link>,
  1082. <link
  1083. linkend="zend.dojo.form.elements.validationTextBox">ValidationTextBox</link>
  1084. and <link linkend="zend.dojo.form.elements.textBox">TextBox</link>;
  1085. それらのクラスのメソッドが全て利用可能です。さらに、
  1086. 個別の制約を設定するために下記のメソッドを使用できます:
  1087. </para>
  1088. <itemizedlist>
  1089. <listitem><para>
  1090. <code>setTimePattern($pattern)</code>及び
  1091. <code>getTimePattern()</code>: set and retrieve the <ulink
  1092. url="http://www.unicode.org/reports/tr35/#Date_Format_Patterns">unicode
  1093. time format pattern</ulink> for formatting the time.
  1094. </para></listitem>
  1095. <listitem><para>
  1096. <code>setClickableIncrement($format)</code>及び
  1097. <code>getClickableIncrement()</code>: set the <ulink
  1098. url="http://en.wikipedia.org/wiki/ISO_8601">ISO-8601</ulink>
  1099. string representing the amount by which every clickable element
  1100. in the time picker increases.
  1101. </para></listitem>
  1102. <listitem><para>
  1103. <code>setVisibleIncrement($format)</code>及び
  1104. <code>getVisibleIncrement()</code>: set the increment visible
  1105. in the time chooser; must follow ISO-8601 formats.
  1106. </para></listitem>
  1107. <listitem><para>
  1108. <code>setVisibleRange($format)</code>及び
  1109. <code>getVisibleRange()</code>: set and retrieve the range of
  1110. time visible in the time chooser at any given moment; must
  1111. follow ISO-8601 formats.
  1112. </para></listitem>
  1113. </itemizedlist>
  1114. <example id="zend.dojo.form.elements.timeTextBox.example">
  1115. <title>時刻テキストボックスdijit要素の使用例</title>
  1116. <para>
  1117. The following will create a TimeTextBox that displays 2 hours
  1118. at a time, with increments of 10 minutes.
  1119. </para>
  1120. <programlisting language="php"><![CDATA[
  1121. $form->addElement(
  1122. 'TimeTextBox',
  1123. 'foo',
  1124. array(
  1125. 'label' => 'TimeTextBox',
  1126. 'required' => true,
  1127. 'visibleRange' => 'T04:00:00',
  1128. 'visibleIncrement' => 'T00:10:00',
  1129. 'clickableIncrement' => 'T00:10:00',
  1130. )
  1131. );
  1132. ]]></programlisting>
  1133. </example>
  1134. </sect3>
  1135. <sect3 id="zend.dojo.form.elements.validationTextBox">
  1136. <title>ValidationTextBox</title>
  1137. <para>
  1138. ValidationTextBox provides the ability to add validations and constraints to a text
  1139. input. Internally, it derives from <link
  1140. linkend="zend.dojo.form.elements.textBox">TextBox</link>, and adds the following
  1141. accessors and mutators for manipulating dijit parameters:
  1142. </para>
  1143. <itemizedlist>
  1144. <listitem><para>
  1145. <code>setInvalidMessage($message)</code>及び
  1146. <code>getInvalidMessage()</code>: set and retrieve the tooltip
  1147. message to display when the value does not validate.
  1148. </para></listitem>
  1149. <listitem><para>
  1150. <code>setPromptMessage($message)</code>及び
  1151. <code>getPromptMessage()</code>: set and retrieve the tooltip
  1152. message to display for element usage.
  1153. </para></listitem>
  1154. <listitem><para>
  1155. <code>setRegExp($regexp)</code>及び<code>getRegExp()</code>:
  1156. set and retrieve the regular expression to use for validating
  1157. the element. The regular expression does not need boundaries
  1158. (unlike PHP's preg* family of functions).
  1159. </para></listitem>
  1160. <listitem><para>
  1161. <code>setConstraint($key, $value)</code>及び
  1162. <code>getConstraint($key)</code>: set and retrieve additional
  1163. constraints to use when validating the element; used primarily
  1164. with subclasses. Constraints are stored in the 'constraints'
  1165. key of the dijit parameters.
  1166. </para></listitem>
  1167. <listitem><para>
  1168. <code>setConstraints(array $constraints)</code>及び
  1169. <code>getConstraints()</code>: set and retrieve individual
  1170. constraints to use when validating the element; used primarily
  1171. with subclasses.
  1172. </para></listitem>
  1173. <listitem><para>
  1174. <code>hasConstraint($key)</code>: test whether a given
  1175. constraint exists.
  1176. </para></listitem>
  1177. <listitem><para>
  1178. <code>removeConstraint($key)</code>及び
  1179. <code>clearConstraints()</code>: remove an individual or all
  1180. constraints for the element.
  1181. </para></listitem>
  1182. </itemizedlist>
  1183. <example id="zend.dojo.form.elements.validationTextBox.example">
  1184. <title>ValidationTextBox dijit要素の使用例</title>
  1185. <para>
  1186. The following will create a ValidationTextBox that requires a
  1187. single string consisting solely of word characters (i.e., no
  1188. spaces, most punctuation is invalid).
  1189. </para>
  1190. <programlisting language="php"><![CDATA[
  1191. $form->addElement(
  1192. 'ValidationTextBox',
  1193. 'foo',
  1194. array(
  1195. 'label' => 'ValidationTextBox',
  1196. 'required' => true,
  1197. 'regExp' => '[\w]+',
  1198. 'invalidMessage' => 'Invalid non-space text.',
  1199. )
  1200. );
  1201. ]]></programlisting>
  1202. </example>
  1203. </sect3>
  1204. <sect3 id="zend.dojo.form.elements.verticalSlider">
  1205. <title>VerticalSlider</title>
  1206. <para>
  1207. VerticalSlider is the sibling of <link
  1208. linkend="zend.dojo.form.elements.horizontalSlider">HorizontalSlider</link>,
  1209. and operates in every way like that element. The only real
  1210. difference is that the 'top*' and 'bottom*' methods are replaced by
  1211. 'left*' and 'right*', and instead of using HorizontalRule and
  1212. HorizontalRuleLabels, VerticalRule and VerticalRuleLabels should be
  1213. used.
  1214. </para>
  1215. <example id="zend.dojo.form.elements.verticalSlider.example">
  1216. <title>VerticalSlider dijit要素の使用例</title>
  1217. <para>
  1218. The following will create a vertical slider selection with
  1219. integer values ranging from -10 to 10. The left will have labels
  1220. at the 20%, 40%, 60%, and 80% marks. The right will have rules
  1221. at 0, 50%, and 100%. Each time the value is changed, the hidden
  1222. element storing the value will be updated.
  1223. </para>
  1224. <programlisting language="php"><![CDATA[
  1225. $form->addElement(
  1226. 'VerticalSlider',
  1227. 'foo',
  1228. array(
  1229. 'label' => 'VerticalSlider',
  1230. 'value' => 5,
  1231. 'style' => 'height: 200px; width: 3em;',
  1232. 'minimum' => -10,
  1233. 'maximum' => 10,
  1234. 'discreteValues' => 11,
  1235. 'intermediateChanges' => true,
  1236. 'showButtons' => true,
  1237. 'leftDecorationDijit' => 'VerticalRuleLabels',
  1238. 'leftDecorationContainer' => 'leftContainer',
  1239. 'leftDecorationLabels' => array(
  1240. ' ',
  1241. '20%',
  1242. '40%',
  1243. '60%',
  1244. '80%',
  1245. ' ',
  1246. ),
  1247. 'rightDecorationDijit' => 'VerticalRule',
  1248. 'rightDecorationContainer' => 'rightContainer',
  1249. 'rightDecorationLabels' => array(
  1250. '0%',
  1251. '50%',
  1252. '100%',
  1253. ),
  1254. )
  1255. );
  1256. ]]></programlisting>
  1257. </example>
  1258. </sect3>
  1259. </sect2>
  1260. <!--
  1261. vim:se ts=4 sw=4 et:
  1262. -->