- フィルタを一貫してプラグインから取得するように変更
- フォームヘルパの動作を改善
-- 1つのテンプレートに 複数 {form} が指定されたときに、submitされたformに対してのみ補正処理が働くように改善 この場合、{form name=...} 属性の指定が必須。
+-- 1つのテンプレートに 複数 {form} が置かれた場合に、それぞれのフォームの配列を区別するようにした
*** bug fix
{
if ($repeat) {
// {form}: ブロック内部に進む前の処理
+
+ // 配列指定のフォームヘルパ用カウンタをリセットする
+ $c =& Ethna_Controller::getInstance();
+ $view =& $c->getView();
+ $view->resetFormCounter();
// {form default=... }
if (isset($params['default']) === false) {
// 指定なしのときは $form を使う
// 1テンプレートに複数 {form} を指定する場合は、
// default を指定することが必要
- $c =& Ethna_Controller::getInstance();
$af =& $c->getActionForm();
- // c.f. http://smarty.php.net/manual/en/plugins.block.functions.php
+ // c.f. http://smarty.net/manual/en/plugins.block.functions.php
$smarty->_tag_stack[count($smarty->_tag_stack)-1][1]['default']
=& $af->getArray(false);
}
return null;
}
- // ethna_action
+ // {form ethna_action=... }
if (isset($params['ethna_action'])) {
$ethna_action = $params['ethna_action'];
unset($params['ethna_action']);
$content = $hidden . $content;
}
- // name
+ // {form name=... }
// 指定された場合は、submitされた {form}を識別する
// id をhiddenタグで指定する
$name = $params['name'];
/** @var string 遷移先テンプレートファイル名 */
var $forward_path;
+ /** @var boolean 配列フォームを呼んだカウンタをリセットするか否か */
+ var $reset_counter = false;
+
/**#@-*/
// {{{ Ethna_ViewClass
/**
* helperアクションフォームオブジェクトを設定する
*
+ * @param string $action アクション名
* @access public
*/
function addActionFormHelper($action)
}
// }}}
+ // {{{ resetFormCounter
+ /**
+ * フォームヘルパ用、内部フォームカウンタをリセットする
+ *
+ * @access public
+ */
+ function resetFormCounter()
+ {
+ $this->reset_counter = true;
+ }
+ // }}}
+
// {{{ getFormName
/**
* 指定されたフォーム項目に対応するフォーム名(w/ レンダリング)を取得する
// 配列フォームが何回呼ばれたかを保存するカウンタ
if (isset($def['type']) && is_array($def['type'])) {
static $form_counter = array();
+ if ($this->reset_counter) {
+ $form_counter = array();
+ $this->reset_counter = false;
+ }
+
if (isset($form_counter[$action]) === false) {
$form_counter[$action] = array();
}