/** * @param SimpleXMLElement $xml * @return Metadata * @throws InvalidGPXException */ public static function fromXML(SimpleXMLElement $xml) { $metadata = new Metadata(); if (!empty($xml->name)) { $metadata->setName((string) $xml->name[0]); } if (!empty($xml->desc)) { $metadata->setDescription((string) $xml->desc[0]); } if (!empty($xml->author)) { $metadata->setAuthor(Person::fromXML($xml->author[0])); } if (!empty($xml->copyright)) { $metadata->setCopyright(Copyright::fromXML($xml->copyright[0])); } if (!empty($xml->link)) { $links = []; foreach ($xml->link as $link) { array_push($links, Link::fromXML($link)); } $metadata->setLinks($links); } if (!empty($xml->time)) { $metadata->setTime(strtotime((string) $xml->time[0])); } if (!empty($xml->keywords)) { $metadata->setKeywords((string) $xml->keywords[0]); } if (!empty($xml->bounds)) { $metadata->setBounds(Bounds::fromXML($xml->bounds0[0])); } if (!empty($xml->extensions)) { $metadata->setExtensions(Extensions::fromXML($xml->extensions[0])); } return $metadata; }
<?php Search::view(); ?> <?php LatestUpdates::ul("class: 'r10 gray-tr'"); ?> <?php Archive::ul("class: 'r10 gray-tr'"); ?> <?php Tags::cloud('id: tagcloud, weight: 1'); ?> </aside> <footer> <?php Copyright::view(); ?> </footer> </div> <?php Template::foot(); ?> </body> </html>
* * Copyright * * @category Plugins * @package Copyright * @version 1.0.0 * @since 1.0.0 * @author George Ornbo <*****@*****.**> * @see {@link http://github.com/shapeshed/copyright.ee_addon/} * @license {@link http://opensource.org/licenses/bsd-license.php} */ /** * Plugin information used by ExpressionEngine * @global array $plugin_info */ $plugin_info = array('pi_name' => 'Copyright', 'pi_version' => '1.0.0', 'pi_author' => 'George Ornbo', 'pi_author_url' => 'http://shapeshed.com/', 'pi_description' => 'Prints a copyright notice', 'pi_usage' => Copyright::usage()); class Copyright { /** * Data sent back to calling function * @access public * @var string */ public $return_data = ""; /** * The start year for the notice. * Set to a default of the current year in __construct * @access public * @see __construct * @var string */