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);
$maniaLink->appendChild($stylesheetXml);
}
if ($this->script) {
if ($this->script->needsRendering()) {
$scriptXml = $this->script->render($domDocument);
$maniaLink->appendChild($scriptXml);
}
$this->script->resetGenericScriptLabels();
}
if ($isChild) {
return $maniaLink;
}

View File

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

View File

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