public function attributeDecoder($event, $attr) { switch ($attr) { case 'handlers': return nxcSocialNetworksPublishHandler::fetchList($event->attribute('id')); case 'available_handler_names': if (count(self::$handlerNames) === 0) { $types = nxcSocialNetworksPublishHandler::getTypes(); foreach ($types as $type => $handlerClass) { try { $handler = new $handlerClass(array()); self::$handlerNames[$type] = $handler->attribute('name'); unset($handler); } catch (Exception $e) { } } } return self::$handlerNames; case 'available_shorten_handler_names': if (count(self::$shortenHandlerNames) === 0) { $types = nxcSocialNetworksLinkShortenHandler::getHandlers(); foreach ($types as $type => $shortenHandlerClass) { try { $shortenHandler = new $shortenHandlerClass(array()); self::$shortenHandlerNames[$type] = $shortenHandler->name; unset($shortenHandler); } catch (Exception $e) { } } } return self::$shortenHandlerNames; case 'available_message_handler_names': if (count(self::$messageHandlerNames) === 0) { $types = nxcSocialNetworksMessageHandler::getHandlers(); foreach ($types as $type => $messageHandlerClass) { try { $messageHandler = new $messageHandlerClass(array()); self::$messageHandlerNames[$type] = $messageHandler->name; unset($messageHandler); } catch (Exception $e) { } } } return self::$messageHandlerNames; case 'contentclass_attribute_list': if (count(self::$classAttributes) === 0) { $classAttributes = eZContentClassAttribute::fetchList(true, array('data_type' => array(array(eZStringType::DATA_TYPE_STRING, eZTextType::DATA_TYPE_STRING)))); // Sorting class attributes $sort = array(); $attrIDs = array(); foreach ($classAttributes as $attribute) { $class = eZContentClass::fetch($attribute->attribute('contentclass_id')); $sort[$attribute->attribute('id')] = $class->attribute('name') . $attribute->attribute('name'); $attrIDs[$attribute->attribute('id')] = $attribute; } asort($sort); self::$classAttributes = array(); foreach ($sort as $id => $sortString) { self::$classAttributes[$id] = $attrIDs[$id]; } } return self::$classAttributes; case 'affected_class_ids': return unserialize($event->attribute('data_text1')); default: return null; } }