ここの情報は古いです。ご理解頂いた上でお取り扱いください。

source: OpenPNE3/trunk/apps/pc_backend/modules/profile/templates/editSuccess.php @ 10969

Last change on this file since 10969 was 10969, checked in by ebihara, 13 years ago

#3361:added ability to limit value ranges for the date type form inputs

File size: 3.1 KB
Line 
1<?php use_helper('Javascript') ?>
2
3<h2><?php echo __('プロフィール項目追加') ?></h2>
4
5<?php if ($form->hasGlobalErrors()) : ?>
6<ul>
7<?php echo $form->renderGlobalErrors() ?>
8</ul>
9<?php endif; ?>
10
11<?php if ($form->isNew()): ?>
12<form action="<?php echo url_for('profile/edit') ?>" method="post">
13<?php else : ?>
14<form action="<?php echo url_for('profile/edit?id=' . $profile->getId()) ?>" method="post">
15<?php endif; ?>
16<table>
17<tr><th colspan="2">ja_JP 用設定</th></tr>
18<?php echo $form['ja_JP']['caption']->renderRow() ?>
19<?php echo $form['ja_JP']['info']->renderRow() ?>
20</table>
21
22<table id="common">
23<tr><th colspan="2">共通設定</th></tr>
24<?php echo $form['name']->renderRow() ?>
25<?php echo $form['is_required']->renderRow() ?>
26<?php echo $form['is_unique']->renderRow() ?>
27<?php echo $form['is_disp_regist']->renderRow() ?>
28<?php echo $form['is_disp_config']->renderRow() ?>
29<?php echo $form['is_disp_search']->renderRow() ?>
30<?php echo $form['form_type']->renderRow() ?>
31</table>
32
33<?php slot('advanced_settings_text') ?>
34<table id="advanced">
35<?php echo $form['value_type']->renderRow() ?>
36<tr>
37<th><?php echo $form['value_min']->renderLabel() ?><?php echo $form['value_max']->renderLabel() ?></th>
38<td><?php echo $form['value_min']->render() ?><?php echo $form['value_max']->render() ?></td>
39</tr>
40<?php echo $form['value_regexp']->renderRow(array('class' => 'advanced')) ?>
41</table>
42<?php end_slot() ?>
43<?php slot('advanced_settings_date') ?>
44<table id="advanced">
45<tr>
46<th><?php echo $form['value_min']->renderLabel() ?><?php echo $form['value_max']->renderLabel() ?></th>
47<td>
48<ul>
49<li><code>YYYY/MM/DD HH:MM:SS</code> 形式で入力(例:<code>2009/01/01 23:59:21</code>)</li>
50<li>その他、 PHP の <code>strtotime()</code> 関数が解釈することのできる特殊な文字列が利用可能</li>
51</ul>
52<?php echo $form['value_min']->render() ?><?php echo $form['value_max']->render() ?>
53</td>
54</tr>
55</table>
56<?php end_slot() ?>
57
58<?php if ($form->isNew()) : ?>
59<?php include_slot('advanced_settings_text') ?>
60<?php else: ?>
61<?php if ($profile->getFormType() === 'input' || $profile->getFormType() == 'textarea'): ?>
62<?php include_slot('advanced_settings_text') ?>
63<?php elseif ($profile->getFormType() === 'date'): ?>
64<?php include_slot('advanced_settings_date') ?>
65<?php endif; ?>
66<?php endif; ?>
67
68<?php echo $form->renderHiddenFields() ?>
69<input type="submit" value="<?php echo __('追加する') ?>" />
70</form>
71
72<?php echo javascript_tag('
73function changeAdvancedFormByFormType()
74{
75  if (document.getElementById("advanced"))
76  {
77    Element.remove("advanced");
78  }
79
80  var form_type = $F("profile_form_type");
81  if (form_type == "input" || form_type == "textarea")
82  {
83    Insertion.After("common", "'.str_replace(array('"', "\n"), array('\"', ''), get_slot('advanced_settings_text')).'");
84  }
85  else if (form_type == "date")
86  {
87    Insertion.After("common", "'.str_replace(array('"', "\n"), array('\"', ''), get_slot('advanced_settings_date')).'");
88  }
89}
90
91Event.observe(window, "load", function(e){
92  changeAdvancedFormByFormType();
93});
94
95Event.observe("profile_form_type", "change", function(e){
96  changeAdvancedFormByFormType();
97});
98') ?>
Note: See TracBrowser for help on using the repository browser.