Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
_users_table.php
1 
2 <div class="form">
3 <?php
4  echo CHtml::form('','post');
5  set_time_limit ( 300 );
6  ?>
7 
8  <div class="row controls">
9  <?php if($importFile->isExist() && ($importFile->getRowsCount() > 0))
10  echo CHtml::submitButton('Validate',array('name'=>'submit_validate')); ?>
11 
12  <?php if($importFile->isExist() && ($importFile->getRowsCount() > 0))
13  echo CHtml::submitButton('Import',array('name'=>'submit_import')); ?>
14 
15  <?php if($importFile->isExist() && ($importFile->getRowsCount() > 0)):
16  echo CHtml::checkBox(UserModule::t('enable_override'),isset($_POST['enable_override'])?true:false); ?>
17  <span>
18  <?php echo UserModule::t('Overwrite existing users'); ?>
19  </span>
20  <?php endif; ?>
21  </div>
22 
23 
24 <?php if($importFile->getRowsCount() > 0): ?>
25 <table class="items import">
26  <tr>
27  <?php
28  /*
29  * User table headers
30  */
31  foreach($importFile->getUserFieldNames() as $fieldName){ ?>
32  <th><?php echo CHtml::activeLabel(new User(),$fieldName); ?></th>
33  <?php
34  } //foreach($userFieldNames as $fieldName)
35  ?>
36  <?php
37  /*
38  * Profile table headers
39  */
40  foreach($importFile->getProfileFieldNames() as $fieldName){ ?>
41  <th><?php echo CHtml::activeLabel(new Profile(),$fieldName); ?></th>
42  <?php
43  } //foreach ($profilesFieldNames as $fieldName)
44  ?>
45 
46  <th><?php echo UserModule::t('Import status'); ?></th>
47  </tr>
48  <?php
49  $importFile->valid = null;
50 
51  foreach($importFile->getCsvFile() as $index => $csv_row){
52 
53  echo $this->renderImportTableRow($importFile, $index, $csv_row);
54 
55  }
56  //Post a validation result
57  echo CHtml::hiddenField('valid', $importFile->valid);
58 
59  if(isset($importFile->file)){
60  echo CHtml::hiddenField('csvImportFile_realname', $importFile->file);
61  echo CHtml::hiddenField('csvImportFile_hashname', $importFile->hashname);
62  }
63  ?>
64 </table>
65 
66 <?php else: ?>
67  <div class="row controls">
68  <h2><?php
69  if($importFile->isExist()){
70  echo UserModule::t('Upload a csv file first (There is sample on the right)');
71  }
72  ?></h2>
73  </div>
74 <?php endif; ?>
75 
76 <?php echo CHtml::endForm(); ?>
77 </div><!-- form -->
78 
79 <style type="text/css">
80  .items.import .errorMessage{
81  color: #b3696c;
82  }
83  .items.import .okMessage{
84  color: #8fa442;
85  }
86  .items.import .alertMessage{
87  color: #f15a23;
88  }
89 
90 </style>