Exemplo n.º 1
0
 public function generateDBUpdateForInstallation()
 {
     $tpl = new ilTemplate(dirname(__FILE__) . '/templates/dbupdate.txt', true, true);
     $ar = $this->getAr();
     $tpl->setVariable('TABLE_NAME', $ar->getConnectorContainerName());
     $tpl->setVariable('TABLE_NAME2', $ar->getConnectorContainerName());
     $tpl->setVariable('TABLE_NAME3', $ar->getConnectorContainerName());
     $tpl->setVariable('STEP', $this->getStep());
     $tpl->setVariable('PRIMARY', $this->getAr()->getArFieldList()->getPrimaryFieldName());
     foreach ($this->getAr()->getArFieldList()->getFields() as $field) {
         $tpl->touchBlock('field');
         $tpl->setVariable('FIELD_NAME', $field->getName());
         foreach ($field->getAttributesForConnector() as $name => $value) {
             $tpl->setCurrentBlock('attribute');
             $tpl->setVariable('NAME', arFieldList::mapKey($name));
             $tpl->setVariable('VALUE', $value);
             $tpl->parseCurrentBlock();
         }
     }
     if ($this->getAr()->getArFieldList()->getPrimaryField()->getFieldType() == arField::FIELD_TYPE_INTEGER) {
         $tpl->setCurrentBlock('attribute');
         $tpl->setVariable('TABLE_NAME4', $ar->getConnectorContainerName());
         $tpl->parseCurrentBlock();
     }
     header('Content-type: application/x-httpd-php');
     header("Content-Disposition: attachment; filename=\"dbupdate.php\"");
     echo $tpl->get();
     exit;
 }
Exemplo n.º 2
0
 /**
  * @return array
  */
 public function getAttributesForDescription()
 {
     $return = array();
     foreach (arFieldList::getAllowedDescriptionFields() as $field_name) {
         if ($this->{$field_name} and self::isAllowedAttribute($this->getFieldType(), $field_name)) {
             $return[arFieldList::mapKey($field_name)] = $this->{$field_name};
         }
     }
     return $return;
 }