Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
form.php
1 <?php echo "&nbsp;";
2 //$config = FgModule::getConfig();
3 //$cbp = $config['clientBasePath'];
4 
5 //$cs = Yii::app()->getClientScript();
6 /*$cs->registerCoreScript('jquery');
7 $cs->registerScriptFile($cbp.'/assets/js/utils.js');
8 $cs->registerScriptFile($cbp.'/assets/js/config.js');
9 $cs->registerScriptFile($cbp.'/assets/js/form.js');
10 $cs->registerCssFile($cbp.'/assets/css/fg-form.css');
11 */?>
12 
13 <h2><?php echo CHtml::encode($this->model->name); ?></h2>
14 <?php if($errors): ?>
15 <div class="fg-form-errors">
16  <ul>
17 <?php
18 foreach($errors as $inputName => $errs): ?>
19 <?php foreach($errs as $error): ?>
20  <li><?php echo $error; ?></li>
21  <?php endforeach; ?>
22 <?php endforeach; ?>
23  </ul>
24 </div>
25 <?php endif; ?>
26 <?php echo $this->model->html; ?>
27 
28 <script type="text/javascript">
29 jQuery('document').ready(function(){
30 
31 // load form content from session
32 <?php
33  if(count($formdata)):
34  echo "var formdata = ".json_encode($formdata).";";
35 ?>
36 
37 // load previous entered values (multipart)
38 jQuery('div#fg-form form').loadJSON(formdata);
39 <?php
40  endif;
41 ?>
42 
43 // previous/next buttons
44  jQuery('div#fg-form button').click(function(e)
45  {
46  var submit_val = jQuery(this).attr('data-value');
47  jQuery('[name="submitAction"]').val(submit_val);
48  });
49 
50  });
51 
52 // info tooltip
53 jQuery("fg-form .row label a.info").unbind();
54 jQuery("#fg-form .row label a.info").live("mouseover",function(e){
55  e.preventDefault();
56  jQuery(this).css("cursor","default");
57  $(this).tipsy({
58  trigger:" manual"
59  ,gravity:"s"
60  }).tipsy("show");
61  }).live("mouseout",function(){
62  jQuery(this).tipsy("hide");
63  });
64 jQuery("#fg-form .row label a.info").live("click",function(e){e.preventDefault();});
65 </script>