Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
_shoppingStep_2.php
1 <?php
2 /**
3  * Gentics Portal.Node PHP
4  * Author & Copyright (c) by Gentics Software GmbH
5  * sales@gentics.com
6  * http://www.gentics.com
7  * Licenses can be found in the LICENSE.txt file in the root-folder of this installation
8  * You must not use this software without a valid license agreement.
9  *
10  */
11 ?>
12 
13 <?php $form = $this->beginWidget('CActiveForm', array(
14  'id'=>'tmp-user-form',
15  'enableAjaxValidation'=>true,
16  'focus'=>array($this->user,'title')
17 )); ?>
18 
19 <p class="note">
20  <?php echo ShoppingcartModule::t('Fields with {required} are required.',array('{required}'=>"<span class='required''>*</span>")); ?>
21 </p>
22 
23 <?php echo $form->errorSummary($this->user); ?>
24 
25 <?php
26 foreach ($this->user->attributes as $fieldName => $fieldValue): ?>
27 <?php $hidden = array("id","user_id","parent_user_id");
28  if(in_array($fieldName,$hidden)){continue;} ?>
29 
30 <?php if($this->user->metadata->tableSchema->columns[$fieldName]->dbType != "date"): ?>
31 
32  <div class="row">
33  <?php echo $form->labelEx($this->user,$fieldName); ?>
34  <?php echo $form->textField($this->user,$fieldName); ?>
35  <?php echo $form->error($this->user,$fieldName); ?>
36  </div>
37 
38  <?php else: ?>
39 
40  <div class="row">
41  <?php echo $form->labelEx($this->user,$fieldName); ?>
42  <?php
43  $format = Yii::app()->locale->getDateFormat();
44 
45  $this->widget('shoppingcart.components.CJuiDatePicker',array(
46  'name'=>'publishDate',
47  'model'=> $this->user,
48  'id'=> "TmpUser_$fieldName",
49  'attribute'=>'birthday',
50  'language'=> LocaleHelper::yiiLocaleToJq(Yii::app()->getLanguage()),
51  'i18nScriptFile' => 'jquery.ui.datepicker-ja.js',
52  // additional javascript options for the date picker plugin
53  'options'=>array(
54  //'dateFormat' => $format,
55  'showOn'=>'focus',
56  'yearRange'=> (date('Y')-100).':'.(date('Y')-18),
57  'defaultDate'=>'-40y',
58  'changeMonth'=>true,
59  'changeYear'=>true,
60  'buttonText'=>'',
61  'dateFormat' => LocaleHelper::yiiFormatToJq($format),
62  ),
63  'htmlOptions'=>array(
64  'style'=>'height:20px;'
65  ),
66  ));
67  ?>
68  <?php echo $form->error($this->user,$fieldName); ?>
69  </div>
70 
71  <?php endif; ?>
72 
73 <?php endforeach; ?>
74 
75 <input type="hidden" name="step" value="<?php echo $this->step ?>">
76 
77 <div class="row controls">
78  <?php echo CHtml::submitButton(ShoppingcartModule::t('Next')); ?>
79 </div>
80 
81 <?php $this->endWidget(); ?>