Exemplo n.º 1
0
 function getPropertyVariablesToAssign()
 {
     $form = new SJB_Form($this->child);
     $form_fields = $form->getFormFieldsInfo();
     $propertyVariables = parent::getPropertyVariablesToAssign();
     $properties = $this->child->getProperties();
     $propertyVariables['value'] = array();
     foreach ($properties as $name => $property) {
         $variablesToAssign = $property->getPropertyVariablesToAssign();
         $form_fields[$name]['hidden'] = $variablesToAssign['hidden'];
         if ($variablesToAssign['value'] === '') {
             continue;
         } else {
             if (empty($variablesToAssign['value']) && !empty($variablesToAssign['profile_field_as_dv'])) {
                 $propertyVariables['value'][$name] = $variablesToAssign['profile_field_as_dv'];
             } else {
                 if (empty($variablesToAssign['value']) && !empty($variablesToAssign['default_value'])) {
                     $propertyVariables['value'][$name] = $variablesToAssign['default_value'];
                 } else {
                     $propertyVariables['value'][$name] = $variablesToAssign['value'];
                 }
             }
         }
     }
     $newPropertyVariables = array('form_fields' => $form_fields, 'caption' => $this->property_info['caption'], 'parentID' => $this->property_info['id'], 'useAutocomplete' => $this->property_info['use_autocomplete'], 'type' => $this->property_info['type'], 'isClassifieds' => $this->property_info['is_classifieds'], 'enable_search_by_radius' => $this->property_info['enable_search_by_radius']);
     $propertyVariables = array_merge($newPropertyVariables, $propertyVariables);
     return $propertyVariables;
 }
Exemplo n.º 2
0
 function getPropertyVariablesToAssign()
 {
     $form = new SJB_Form($this->complex);
     $form_fields = $form->getFormFieldsInfo();
     $propertyVariables = parent::getPropertyVariablesToAssign();
     $complexElements = array(1 => '');
     $newPropertyVariables = array('form_fields' => $form_fields, 'caption' => $this->property_info['caption'], 'complexElements' => $complexElements);
     $propertyVariables = array_merge($newPropertyVariables, $propertyVariables);
     if (!empty($propertyVariables['value'])) {
         if (is_string($propertyVariables['value'])) {
             $propertyVariables['value'] = unserialize($propertyVariables['value']);
         }
         if (is_array($propertyVariables['value'])) {
             foreach ($propertyVariables['value'] as $complexElement) {
                 if (is_array($complexElement)) {
                     foreach ($complexElement as $key => $val) {
                         if (!isset($complexElements[$key])) {
                             $complexElements[$key] = '';
                         }
                     }
                 }
             }
         }
         $propertyVariables['complexElements'] = $complexElements;
     }
     return $propertyVariables;
 }
Exemplo n.º 3
0
 function getPropertyVariablesToAssign()
 {
     $values = parent::getPropertyVariablesToAssign();
     if ($this->convertToDBDate && !is_array($this->property_info['value'])) {
         $values['mysql_date'] = SJB_I18N::getInstance()->getInput('date', $this->property_info['value']);
     }
     return $values;
 }
Exemplo n.º 4
0
 function getPropertyVariablesToAssign()
 {
     $propertyVariables = parent::getPropertyVariablesToAssign();
     $gallery = new SJB_ListingGallery();
     $gallery->setListingSID($this->object_sid);
     $pictures_info = $gallery->getPicturesInfo();
     $newPropertyVariables = array('pictures' => $pictures_info, 'number_of_pictures' => count($pictures_info));
     return array_merge($newPropertyVariables, $propertyVariables);
 }
Exemplo n.º 5
0
 function getPropertyVariablesToAssign()
 {
     $propertyVariables = parent::getPropertyVariablesToAssign();
     $profileFieldAsDv = SJB_Array::get($propertyVariables, 'profile_field_as_dv');
     if ($profileFieldAsDv && !isset($this->property_info['parentID'])) {
         $fieldValue = SJB_UserProfileFieldManager::getListItemValueBySID($profileFieldAsDv);
         if ($fieldValue) {
             $listingListItemSID = SJB_ListingFieldManager::getListItemSIDByValue($fieldValue, SJB_Array::get($this->property_info, 'sid'));
             $propertyVariables['profile_field_as_dv'] = $listingListItemSID;
         }
     }
     $defaultValue = SJB_Array::get($propertyVariables, 'default_value');
     if ($defaultValue == 'default_country') {
         $propertyVariables['default_value'] = SJB_Settings::getSettingByName('default_country');
     }
     $propertyVariables['hidden'] = $this->property_info['hidden'];
     $newPropertyVariables = array('list_values' => $this->list_values, 'caption' => $this->property_info['caption'], 'sort_by_alphabet' => $this->property_info['sort_by_alphabet']);
     return array_merge($newPropertyVariables, $propertyVariables);
 }
Exemplo n.º 6
0
 function getPropertyVariablesToAssign()
 {
     $propertyVariables = parent::getPropertyVariablesToAssign();
     $propertyVariables['choiceLimit'] = SJB_Array::get($this->property_info, 'choiceLimit');
     $displayListValues = array();
     $listValues = array();
     foreach ($this->list_values as $key => $list_values) {
         $displayListValues[$list_values['id']] = $list_values['caption'];
         $listValues[$key]['id'] = $list_values['id'];
         $listValues[$key]['caption'] = $list_values['caption'];
     }
     $arrValues = array('value' => $this->property_info['value'], 'default_value' => $this->property_info['default_value'], 'profile_field_as_dv' => $this->property_info['profile_field_as_dv']);
     $value = array();
     foreach ($arrValues as $valueID => $arrValue) {
         if (is_array($arrValue)) {
             $value[$valueID] = $this->cleanRemovedItems($arrValue, $displayListValues);
         } else {
             $itemSIDs = explode(',', $arrValue);
             $value[$valueID] = $this->cleanRemovedItems($itemSIDs, $displayListValues);
         }
     }
     $newPropertyVariables = array('value' => $value['value'], 'display_list_values' => $displayListValues, 'default_value' => $value['default_value'], 'profile_field_as_dv' => $value['profile_field_as_dv'], 'list_values' => $listValues, 'caption' => $this->property_info['caption'], 'no_first_option' => $this->property_info['no_first_option'], 'comment' => $this->property_info['comment'], 'sort_by_alphabet' => $this->property_info['sort_by_alphabet']);
     return array_merge($propertyVariables, $newPropertyVariables);
 }
Exemplo n.º 7
0
 function getPropertyVariablesToAssign()
 {
     $propertyVariables = parent::getPropertyVariablesToAssign();
     $newPropertyVariables = array('minimum' => $this->minimum, 'maximum' => $this->maximum);
     return array_merge($newPropertyVariables, $propertyVariables);
 }
Exemplo n.º 8
0
 function getPropertyVariablesToAssign()
 {
     return parent::getPropertyVariablesToAssign();
 }
Exemplo n.º 9
0
 function getPropertyVariablesToAssign()
 {
     $propertyVariables = parent::getPropertyVariablesToAssign();
     $newPropertyVariables = array('caption' => $this->property_info['caption'], 'comment' => SJB_Array::get($this->property_info, 'comment', ''));
     return array_merge($newPropertyVariables, $propertyVariables);
 }