Beispiel #1
0
 /**
  * Process admin interface of this object
  *
  * @return void
  */
 public function processAdminUI()
 {
     //  is_visible
     $name = "profile_" . $this->getId() . "_is_visible";
     if (!empty($_REQUEST[$name]) && $_REQUEST[$name] == 'on') {
         $this->setVisible(true);
     } else {
         $this->setVisible(false);
     }
     $template = $this->getTemplate();
     // Aggregate the fields UI
     $profileFields = $this->getFields();
     foreach ($template->getFields() as $templateField) {
         if (!empty($profileFields[$templateField->getId()])) {
             //We already have a real field instanciated
             $field = $profileFields[$templateField->getId()];
             $field->processAdminUI();
         } else {
             //Create a new fielreate a new field (if appropriate)
             $name = "profile_template_field_{$templateField->getId()}_field_future_id";
             $futureProfileFieldId = $_REQUEST[$name];
             if (ProfileField::processNewUI($futureProfileFieldId, true) == true) {
                 ProfileField::createNewObject($this, $templateField, $futureProfileFieldId);
                 ProfileField::processNewUI($futureProfileFieldId, false);
             }
         }
     }
 }