public function publish(CollectionKey $ak, Page $page, AttributeValue $value)
 {
     $inspector = \Core::make('import/value_inspector');
     $result = $inspector->inspect($value->getValue());
     $content = $result->getReplacedContent();
     $page->setAttribute($ak->getAttributeKeyHandle(), $content);
 }
 public function publish(CollectionKey $ak, Page $page, AttributeValue $value)
 {
     $links = $value->getValue();
     $r = array();
     foreach ($links as $link) {
         $r[$link['service']] = $link['detail'];
     }
     $page->setAttribute($ak->getAttributeKeyHandle(), $r);
 }
 public function publish(CollectionKey $ak, Page $page, AttributeValue $value)
 {
     $inspector = \Core::make('import/value_inspector');
     $result = $inspector->inspect($value->getValue());
     $items = $result->getMatchedItems();
     if (isset($items[0]) && $items[0] instanceof FileItem) {
         $file = $items[0]->getContentObject();
         $page->setAttribute($ak->getAttributeKeyHandle(), $file);
     }
 }
 /**
  * @param CollectionKey $ak
  * @param Page $page
  * @param AddressAttributeValue $address
  */
 public function publish(CollectionKey $ak, Page $page, AttributeValue $address)
 {
     $value = new Value();
     $value->address1 = $address->getAddress1();
     $value->address2 = $address->getAddress2();
     $value->address3 = $address->getAddress3();
     $value->city = $address->getCity();
     $value->country = $address->getCountry();
     $value->state_province = $address->getStateProvince();
     $value->postal_code = $address->getPostalCode();
     $page->setAttribute($ak->getAttributeKeyHandle(), $value);
 }
 public function publishToPage(Page $c, $data, $controls)
 {
     // the data for this actually doesn't come from $data. Attributes have their own way of gettin data.
     $ak = $this->getAttributeKeyObject();
     if (is_object($ak)) {
         $controller = $ak->getController();
         $value = $controller->createAttributeValueFromRequest();
         $c->setAttribute($ak, $value);
     }
 }
 public function publish(CollectionKey $ak, Page $page, AttributeValue $value)
 {
     $node = simplexml_load_string($value->getValue());
     $page->setAttribute($ak->getAttributeKeyHandle(), $ak->getController()->importValue($node));
 }
Example #7
0
 public function setAttribute($ak, $value)
 {
     return parent::setAttribute($ak, $value);
 }