コード例 #1
0
 /**
  * @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);
 }
コード例 #2
0
 /**
  * @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);
 }
コード例 #3
0
 /**
  * @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);
 }
コード例 #4
0
 /**
  * @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());
 }
コード例 #5
0
 public function loadFromXml(AttributeKey $key, \SimpleXMLElement $element)
 {
     $checked = (string) $element->type['checked'];
     if ($checked == '1') {
         $key->setIsChecked(true);
     } else {
         $key->setIsChecked(false);
     }
 }
コード例 #6
0
 /**
  * @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);
 }
コード例 #7
0
 /**
  * @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);
 }
コード例 #8
0
 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;
 }
コード例 #9
0
 /**
  * @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);
 }
コード例 #10
0
 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);
 }
コード例 #11
0
 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;
 }
コード例 #12
0
 /**
  * @param TextAreaAttributeKey $key
  * @param \SimpleXMLElement $element
  *
  * @return bool
  */
 public function loadFromXml(AttributeKey $key, \SimpleXMLElement $element)
 {
     $mode = (string) $element->type['mode'];
     $key->setMode($mode);
 }
コード例 #13
0
 public function loadFromXml(AttributeKey $key, \SimpleXMLElement $element)
 {
     $key->setOptionsXml((string) $element->asXML());
 }