/** * Handles the input specific for one attribute from the class edit interface. * * @param mixed $http Class eZHTTPTool. * @param string $base Seems to be always 'ContentClassAttribute'. * @param mixed $classAttribute Class eZContentClassAttribute. * * @return void */ public function fetchClassAttributeHTTPInput($http, $base, $classAttribute) { $form = ymcDatatypeForm::getInstance('ymcDatatypeInstantMessengerClassForm', $classAttribute->attribute('id')); if (!is_array($form->cache)) { return FALSE; } foreach ($form->cache as $field => $data) { $classAttribute->setAttribute($field, $data); } return TRUE; }
/** * Stores the object attribute input in the $contentObjectAttribute. * * The ymcDatatypeDateTime object instantiated in * validateObjectAttributeHTTPInput is reused. * * @param mixed $http Class eZHTTPTool. * @param string $base Seems to be always 'ContentObjectAttribute'. * @param mixed $attribute Class eZContentObjectAttribute. * * @return boolean Whether to save the changes to the db or not. */ public function fetchObjectAttributeHTTPInput($http, $base, $attribute) { $form = ymcDatatypeForm::getInstance('ymcDatatypeDateTimeObjectForm', $attribute->attribute('id')); if (NULL === $form->cache) { return false; } $attribute->setAttribute('data_text', (string) $form->cache); return true; }
/** * Stores the object attribute input in the $contentObjectAttribute. * * @param mixed $http Class eZHTTPTool. * @param string $base Seems to be always 'ContentObjectAttribute'. * @param mixed $contentObjectAttribute Class eZContentObjectAttribute. * * @return boolean Whether to save the changes to the db or not. */ public function fetchObjectAttributeHTTPInput($http, $base, $contentObjectAttribute) { $classContent = $contentObjectAttribute->contentClassAttribute()->content(); if ($classContent['is_node_placement']) { $httpInputName = 'ymcActiveNodeAssignmentsPool'; $form = new ezcInputForm(INPUT_POST, array('ymcActiveNodeAssignmentsPool' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string', NULL, FILTER_REQUIRE_ARRAY))); } else { $httpInputName = 'selected_array'; $form = ymcDatatypeForm::getInstance('ymcDatatypeEnhancedSelectionObjectForm', $contentObjectAttribute->attribute('id')); } $data = NULL; if ($form->hasValidData($httpInputName)) { $data = implode(self::OPTIONS_SERIALIZATION_DELIMITER, $form->{$httpInputName}); } elseif ($classContent['is_multiselect']) { $data = ''; } if (NULL === $data) { return FALSE; } else { $contentObjectAttribute->setAttribute('data_text', $data); return TRUE; } }