small fixes

This commit is contained in:
Steffen Schröder 2014-04-27 16:31:46 +02:00
parent 483d673e5f
commit 7a6566691c
3 changed files with 10 additions and 6 deletions

View File

@ -273,11 +273,13 @@ class ManiaLink {
$stylesheetXml = $this->stylesheet->render($domDocument); $stylesheetXml = $this->stylesheet->render($domDocument);
$maniaLink->appendChild($stylesheetXml); $maniaLink->appendChild($stylesheetXml);
} }
if ($this->script) {
if ($this->script->needsRendering()) { if ($this->script->needsRendering()) {
$scriptXml = $this->script->render($domDocument); $scriptXml = $this->script->render($domDocument);
$maniaLink->appendChild($scriptXml); $maniaLink->appendChild($scriptXml);
} }
$this->script->resetGenericScriptLabels(); $this->script->resetGenericScriptLabels();
}
if ($isChild) { if ($isChild) {
return $maniaLink; return $maniaLink;
} }

View File

@ -180,6 +180,9 @@ class Paging extends ScriptFeature {
* @see \FML\Script\Features\ScriptFeature::prepare() * @see \FML\Script\Features\ScriptFeature::prepare()
*/ */
public function prepare(Script $script) { public function prepare(Script $script) {
if (!$this->pages) {
return $this;
}
$script->setScriptInclude(ScriptInclude::TEXTLIB); $script->setScriptInclude(ScriptInclude::TEXTLIB);
$currentPageVariable = self::VAR_CURRENT_PAGE; $currentPageVariable = self::VAR_CURRENT_PAGE;
@ -270,6 +273,7 @@ Void {$updatePageFunction}(Text _PagingId, Text _PageLabelId, Integer _BrowseAct
protected function getMinPage() { protected function getMinPage() {
$minPageNumber = null; $minPageNumber = null;
$minPage = null; $minPage = null;
var_dump($this->pages);
foreach ($this->pages as $page) { foreach ($this->pages as $page) {
$pageNumber = $page->getPageNumber(); $pageNumber = $page->getPageNumber();
if ($minPageNumber === null || $pageNumber < $minPageNumber) { if ($minPageNumber === null || $pageNumber < $minPageNumber) {

View File

@ -60,8 +60,6 @@ class PluginInstallMenu implements CallbackListener, ConfiguratorMenu, Manialink
*/ */
public function getMenu($width, $height, Script $script) { public function getMenu($width, $height, Script $script) {
$paging = new Paging(); $paging = new Paging();
$script->addFeature($paging);
$paging = new Paging();
$script->addFeature($paging); $script->addFeature($paging);
$frame = new Frame(); $frame = new Frame();