Commit baaadcf0 authored by Michael Herold's avatar Michael Herold
Browse files

Releases v0.5.0

parent f4b78b02
v0.5.0-unreleased
v0.5.0
- Fixes missing generation of global gettext .mo-files.
This fixes missing l10n in top bar also.
- Removes static css files and adds generation to Makefile
......
......@@ -21,7 +21,7 @@ namespace hemio\edentata;
use hemio\form;
use hemio\html;
$document = new form\Document(new html\String(_('Edentata Login')));
$document = new form\Document(new html\Str(_('Edentata Login')));
$document->getHtml()->getHead()->setBaseUrl($config['base_url']);
$document->getHtml()->getHead()->addJsFile('static/js/login.js');
......
......@@ -102,7 +102,7 @@ if (!$activeModuleName)
try {
# doc
$title = new html\String('Edentata');
$title = new html\Str('Edentata');
$doc = new form\Document($title);
$doc->getHtml()->getHead()->addCssFile('static/design/style.css');
$doc->getHtml()->setAttribute('lang', $i10n->getLang());
......@@ -181,7 +181,7 @@ try {
}
$span = new html\Span;
$span[] = new html\String(_('User').': '.$_SERVER['PHP_AUTH_USER']);
$span[] = new html\Str(_('User').': '.$_SERVER['PHP_AUTH_USER']);
$header->addChild($span);
$header[] = new gui\Link(
......@@ -210,7 +210,7 @@ try {
$aSettings = new html\A;
$aSettings->addCssClass('popover');
$aSettings[] = new html\String(_('Act as Deputy'));
$aSettings[] = new html\Str(_('Act as Deputy'));
$aSettings->setAttribute('href', $request->getUrl().'#');
$header[] = $aSettings;
......@@ -219,12 +219,12 @@ try {
$aSupport = new html\A;
$aSupport->setAttribute('href', $config['support_url']);
$aSupport[] = new html\String(_('Support'));
$aSupport[] = new html\Str(_('Support'));
$header[] = $aSupport;
$aLogout = new html\A;
$aLogout->setAttribute('href', '?auth=logout');
$aLogout[] = new html\String(_('Logout'));
$aLogout[] = new html\Str(_('Logout'));
$header[] = $aLogout;
if ($request->get('deputy'))
......@@ -257,7 +257,7 @@ try {
$a = $list->addLinkEntry(
$request->deriveModule($moduleId)
, new html\String($loadedModule->getName())
, new html\Str($loadedModule->getName())
);
if ($moduleId === $request->module)
......
<?php
/*
* Copyright (C) 2014 Michael Herold <quabla@hemio.de>
*
......@@ -21,39 +20,45 @@
/**
* Unit test utils for html
*/
class Helpers extends PHPUnit_Framework_TestCase {
class Helpers extends PHPUnit_Framework_TestCase
{
/**
*
*
* @param hemio\html\Interface_\HtmlCode $objHtml
* @param string $strFile
*/
protected function _assertEqualsXmlFile(hemio\html\Interface_\HtmlCode $objHtml, $strFile) {
$path = __DIR__ . DIRECTORY_SEPARATOR . $strFile;
protected function _assertEqualsXmlFile(hemio\html\Interface_\HtmlCode $objHtml,
$strFile)
{
$path = __DIR__.DIRECTORY_SEPARATOR.$strFile;
$actual = new DOMDocument;
$actual = new DOMDocument;
$actualString = (string) $objHtml;
$actual->loadXML($actualString);
if (!file_exists($path))
file_put_contents($path, /*'NEW-AUTOGENERATED' .*/ PHP_EOL . $actualString);
file_put_contents($path, /* 'NEW-AUTOGENERATED' . */
PHP_EOL.$actualString);
$expected = new DOMDocument;
$expected->load($path);
$this->assertEqualXMLStructure($expected->documentElement, $actual->documentElement, true);
$this->assertEqualXMLStructure($expected->documentElement,
$actual->documentElement, true);
$this->assertEquals($this->toXml($expected), $this->toXml($actual));
}
private function toXml(DOMDocument $obj) {
private function toXml(DOMDocument $obj)
{
$obj->normalizeDocument();
return str_replace(PHP_EOL, '', str_replace(' ', '', $obj->saveHTML()));
}
public static function getDocumentBody() {
return (new hemio\html\Document(new hemio\html\String('Title')))->getHtml()->getBody();
public static function getDocumentBody()
{
return (new hemio\html\Document(new hemio\html\Str('Title')))->getHtml()->getBody();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment