/**
  * @param DateTimeAttributeKey $source
  * @param CoreAttributeKey $destination
  */
 public function publish(AttributeKey $source, CoreAttributeKey $destination)
 {
     $controller = $destination->getController();
     $data = array();
     $data['akDateDisplayMode'] = $source->getMode();
     $controller->saveKey($data);
 }
 /**
  * @param TopicsAttributeKey $key
  * @param \SimpleXMLElement $element
  *
  * @return bool
  */
 public function loadFromXml(AttributeKey $key, \SimpleXMLElement $element)
 {
     $name = (string) $element->tree['name'];
     $path = (string) $element->tree['path'];
     $key->setTreeName($name);
     $key->setNodePath($path);
 }
 /**
  * @param BooleanAttributeKey $source
  * @param CoreAttributeKey $destination
  */
 public function publish(AttributeKey $source, CoreAttributeKey $destination)
 {
     $controller = $destination->getController();
     $data = array();
     $data['akCheckedByDefault'] = $source->getIsChecked();
     $controller->saveKey($data);
 }
 /**
  * @param TopicsAttributeKey $source
  * @param CoreAttributeKey $destination
  */
 public function publish(AttributeKey $source, CoreAttributeKey $destination)
 {
     $controller = $destination->getController();
     $name = (string) $source->getTreeName();
     $tree = \Concrete\Core\Tree\Type\Topic::getByName($name);
     $node = $tree->getNodeByDisplayPath($source->getNodePath());
     $controller->setNodes($node->getTreeNodeID(), $tree->getTreeID());
 }
 public function loadFromXml(AttributeKey $key, \SimpleXMLElement $element)
 {
     $checked = (string) $element->type['checked'];
     if ($checked == '1') {
         $key->setIsChecked(true);
     } else {
         $key->setIsChecked(false);
     }
 }
 /**
  * @param AddressAttributeKey $source
  * @param CoreAttributeKey $destination
  */
 public function publish(AttributeKey $source, CoreAttributeKey $destination)
 {
     $controller = $destination->getController();
     $data = array();
     $data['akHasCustomCountries'] = $source->getHasCustomCountries();
     $data['akDefaultCountry'] = $source->getDefaultCountry();
     foreach ($source->getCustomCountries() as $country) {
         $data['akCustomCountries'][] = $country;
     }
     $controller->saveKey($data);
 }
 /**
  * @param AddressAttributeKey $key
  * @param \SimpleXMLElement $element
  */
 public function loadFromXml(AttributeKey $key, \SimpleXMLElement $element)
 {
     if ((string) $element->type['custom-countries'] == '1') {
         $key->setHasCustomCountries(true);
     }
     $key->setDefaultCountry((string) $element->type['default-country']);
     $countries = array();
     if (isset($element->type->countries->country)) {
         foreach ($element->type->countries->country as $country) {
             $countries[] = (string) $country;
         }
     }
     $key->setCustomCountries($countries);
 }
 public function publish(AttributeKey $ak, Package $pkg = null)
 {
     /** @var $category UserAttributeKeyCategoryInstance */
     $category = $ak->getCategory();
     $key = UserKey::add($ak->getType(), array('akHandle' => $ak->getHandle(), 'akName' => $ak->getName(), 'akIsInternal' => $ak->getIsInternal(), 'akIsSearchableIndexed' => $ak->getIsIndexed(), 'akIsSearchable' => $ak->getIsSearchable(), 'uakProfileDisplay' => $category->getDisplayedInProfile(), 'uakProfileEdit' => $category->getEditableInProfile(), 'uakProfileEditRequired' => $category->getRequiredInProfile(), 'uakRegisterEdit' => $category->getEditableInRegistration(), 'uakRegisterEditRequired' => $category->getRequiredInRegistration(), 'uakMemberListDisplay' => $category->getDisplayedInMemberList()), $pkg);
     return $key;
 }
 /**
  * @param SelectAttributeKey $source
  * @param CoreAttributeKey $destination
  */
 public function publish(AttributeKey $source, CoreAttributeKey $destination)
 {
     /**
      * @var \Concrete\Attribute\Select\Controller
      */
     $controller = $destination->getController();
     $controller->setAllowedMultipleValues($source->getAllowMultipleValues());
     $controller->setAllowOtherValues($source->getAllowOtherValues());
     $controller->setOptionDisplayOrder($source->getDisplayOrder());
     $options = array();
     foreach ($source->getOptions() as $option) {
         $options[] = $option['value'];
     }
     $controller->setOptions($options);
 }
 public function loadFromXml(AttributeKey $key, \SimpleXMLElement $element)
 {
     $allow_multiple_values = (string) $element->type['allow-multiple-values'];
     $allow_other_values = (string) $element->type['allow-other-values'];
     $key->setDisplayOrder((string) $element->type['display-order']);
     if ($allow_multiple_values == '1') {
         $key->setAllowMultipleValues(true);
     } else {
         $key->setAllowMultipleValues(false);
     }
     if ($allow_other_values == '1') {
         $key->setAllowOtherValues(true);
     } else {
         $key->setAllowOtherValues(false);
     }
     $options = array();
     if (isset($element->type->options)) {
         foreach ($element->type->options->children() as $option) {
             $options[] = array('value' => (string) $option['value'], 'added' => (string) $option['is-end-user-added']);
         }
     }
     $key->setOptions($options);
 }
 public function publish(AttributeKey $ak, Package $pkg = null)
 {
     $key = FileKey::add($ak->getType(), array('akHandle' => $ak->getHandle(), 'akName' => $ak->getName(), 'akIsInternal' => $ak->getIsInternal(), 'akIsSearchableIndexed' => $ak->getIsIndexed(), 'akIsSearchable' => $ak->getIsSearchable()), $pkg);
     return $key;
 }
 /**
  * @param TextAreaAttributeKey $key
  * @param \SimpleXMLElement $element
  *
  * @return bool
  */
 public function loadFromXml(AttributeKey $key, \SimpleXMLElement $element)
 {
     $mode = (string) $element->type['mode'];
     $key->setMode($mode);
 }
 public function loadFromXml(AttributeKey $key, \SimpleXMLElement $element)
 {
     $key->setOptionsXml((string) $element->asXML());
 }