function loadHead() { $dom = \shgysk8zer0\DOM\HTML::getInstance(); $url = \shgysk8zer0\Core\URL::getInstance(); unset($url->path, $url->query, $url->fragment, $url->user, $url->pass); $frag = $dom->createDocumentFragment(); $frag('title', 'Ad Insertion'); $frag('link', null, ['rel' => 'icon', 'href' => 'favicon.svg', 'type' => 'image/svg+xml', 'sizes' => 'any']); $frag('link', null, ['rel' => 'stylesheet', 'href' => 'stylesheets/styles/styles.css', 'media' => 'all']); $frag('link', null, ['rel' => 'prefetch', 'href' => 'images/icons.svg', 'type' => 'image/svg+xml']); $frag('base', null, ['href' => $url]); $frag('script', null, ['type' => 'application/javascript', 'src' => 'scripts/custom.js', 'defer' => true]); $frag('meta', null, ['name' => 'description', 'content' => 'An ad insertion form for the Kern Valley Sun']); return $frag; }
public static function useIcon($id, array $attrs = array(), $path = "images/icons.svg") { static $url = null; if (is_null($url)) { $url = clone \shgysk8zer0\Core\URL::getInstance(); unset($url->query, $url->user, $url->pass, $url->fragment); } $url->path = $path; $url->fragment = $id; $attrs['xmlns:xlink'] = self::USE_NS; $svg = new self($attrs); $use = $svg->documentElement->appendChild($svg->createElement('use')); $use->{'xlink:href'} = $url; return $svg->documentElement; }
function buildForm() { $form = \shgysk8zer0\DOM\HTML::getInstance()->createElement('form'); $form->name = basename(__FILE__, '.php'); $form->method = 'POST'; $form->action = \shgysk8zer0\Core\URL::getInstance(); $form->append('label', 'Email', ['for' => "{$form->name}[user]"]); $form->append('input', null, ['type' => 'email', 'name' => "{$form->name}[user]", 'id' => "{$form->name}[user]", 'placeholder' => '*****@*****.**', 'required' => '']); $form->append('br'); $form->append('label', 'Password', ['for' => "{$form->name}[password]"]); $form->append('input', null, ['type' => 'password', 'name' => "{$form->name}[password]", 'id' => "{$form->name}[password]", 'placeholder' => '************', 'required' => '']); $form->append('hr'); $form->append('button', null, ['type' => 'submit', 'title' => 'Submit'])->import(\shgysk8zer0\DOM\SVG::useIcon('check', ['height' => 30, 'width' => 30])); $form->append('button', null, ['type' => 'reset', 'title' => 'Reset'])->import(\shgysk8zer0\DOM\SVG::useIcon('x', ['height' => 30, 'width' => 30])); return $form; }