public function setTitleForProject(Project $project) { $config = $project->getConfiguration(); $title = $config->get('project.title', 'Psc - CMS'); $title .= ' ' . $config->get('version'); $this->setTitle(HTML::tag('title', HTML::esc($title))); }
public function testConstructors_String_HTMLInterface() { $html = HTML::tag('form', HTML::tag('input'))->addClass('main'); $htmlPage = new \Psc\HTML\Page(); $this->assertInstanceOf($this->c, new jQuery('form.main', $html)); $this->assertInstanceOf($this->c, new jQuery('form.main', $htmlPage)); }
public static function load($cssFile, $media = 'all') { if (empty($media)) { $media = 'all'; } return HTML::tag('link', NULL, array('rel' => 'stylesheet', 'media' => $media, 'type' => 'text/css', 'href' => $cssFile))->setOption('selfClosing', TRUE); }
public function html() { $lis = array(); foreach ($this->content as $li) { $lis[] = \Psc\HTML\HTML::tag('li', $this->wrapText($li, $inline = TRUE)->convert()); } return \Psc\HTML\HTML::tag('ul', $lis, array('class' => 'roll')); }
public function testWTFBug() { $content = NULL; $divcontent = \Psc\UI\Form::group('Sounds', $content, \Psc\UI\Form::GROUP_COLLAPSIBLE); $tagggggg = \Psc\HTML\HTML::tag('div', $divcontent); //$tagggggg->debug = TRUE; $tagggggg->chain(new \Psc\JS\Code("pling")); ob_start(); print $tagggggg->html(); ob_end_clean(); }
/** * Returns a Script-Tag for a script file */ public static function load($jsFile) { return HTML::tag('script', NULL, array('type' => 'text/javascript', 'src' => $jsFile))->setOption('br.closeTag', TRUE); }
public function getInnerHTML() { return HTML::tag('span', (object) array('date' => $this->datePicker->getInnerHTML(), 'time' => $this->timeField->getInnerHTML())); }
protected function expectJooseBridgeDefaults() { $this->jooseBridge->expects($this->once())->method('link')->with($this->isInstanceOf('Psc\\HTML\\Tag'))->will($this->returnSelf()); $this->jooseBridge->expects($this->once())->method('html')->will($this->returnValue(\Psc\HTML\HTML::tag('a', 'the html'))); }
public function html() { $img = \Psc\HTML\HTML::tag('img', NULL, array('src' => $this->getHTMLUrl(), 'alt' => $this->getLabel())); if (isset($this->align)) { $img->addClass('align' . $this->align); } return $img; }
public static function replaceLinksMarkup($text) { $link = function ($url, $label) { // label is already escaped if (Preg::match($url, '~^([a-zA-Z0-9]+://|www\\.)~')) { return HTML::tag('a', $label, array('href' => $url, 'class' => 'external', 'target' => '_blank')); } else { return HTML::tag('a', $label, array('href' => $url, 'class' => 'internal')); } }; $openLink = preg_quote('[['); $closeLink = preg_quote(']]'); $sepLink = preg_quote('|'); // [[http://www.google.com|This Link points to google]] $text = \Psc\Preg::replace_callback($text, '/' . $openLink . '(.*?)' . $sepLink . '(.*?)' . $closeLink . '/', function ($match) use($link) { return $link($match[1], $match[2]); }); // [[http://www.google.com]] $text = \Psc\Preg::replace_callback($text, '/' . $openLink . '(.*?)' . $closeLink . '/', function ($match) use($link) { return $link($match[1], $match[1]); }); return $text; }
protected function doInit() { $this->html = \Psc\HTML\HTML::tag('div'); parent::doInit(); }
protected function walkHeadline($headline) { return HTML::tag('h1', HTML::tag('img', NULL, array('src' => $headline->getImage())), array('id' => 'headline')); }
/** * Gibt Informationen für die Fehler die angezeigt werden sollen, für das JavaScript zurück * * @return HTMLTag|NULL */ public function html() { $html = NULL; if (count($this->jsonArray) > 0) { $content = json_encode($this->jsonArray, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP); $html = HTML::tag('div', $content, array('id' => $this->getJsonId()))->setStyle('display', 'none'); } return $html; }