render($asset); $result['url'] = $url; return $result; } static function plugins() { static $result = array(); if (!empty($result)) { return $result; } /* * We make sure we load them from most specialized to less specialized. * The first that provides a value for a field wins. */ $protocols = array( 'oembed', 'og', 'image', 'media', 'rss', 'google_map', 'google_document', 'google_document_viewer', 'google_widget', 'mediaserver', 'scratch', 'page'); foreach ($protocols as $protocol) { $file = "asset_{$protocol}_renderer.class.php"; require_once dirname(__FILE__) . '/protocol/' . $file; $class = "asset_{$protocol}_renderer"; $class = explode('_', $class); $class = array_map('ucfirst', $class); $class = implode($class); $result[] = new $class(); } return $result; } /** * Renderer function. Take a http asset as input and return an array containing * various properties: metadata, html snippet, etc. * * @param HttpResource $asset * @return array */ public function render($asset) { $result = array(); return $result; } }