fml fix
This commit is contained in:
parent
d57cebc23f
commit
283f6d8fcd
@ -1,269 +1,269 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace FML\Script;
|
namespace FML\Script;
|
||||||
|
|
||||||
use FML\Controls\Control;
|
use FML\Controls\Control;
|
||||||
use FML\Types\Scriptable;
|
use FML\Types\Scriptable;
|
||||||
use FML\Controls\Label;
|
use FML\Controls\Label;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class representing the ManiaLink Script
|
* Class representing the ManiaLink Script
|
||||||
*
|
*
|
||||||
* @author steeffeen
|
* @author steeffeen
|
||||||
*/
|
*/
|
||||||
class Script {
|
class Script {
|
||||||
/**
|
/**
|
||||||
* Constants
|
* Constants
|
||||||
*/
|
*/
|
||||||
const CLASS_TOOLTIPS = "FML_Tooltips";
|
const CLASS_TOOLTIPS = "FML_Tooltips";
|
||||||
const CLASS_MENU = "FML_Menu";
|
const CLASS_MENU = "FML_Menu";
|
||||||
const CLASS_MENUBUTTON = "FML_MenuButton";
|
const CLASS_MENUBUTTON = "FML_MenuButton";
|
||||||
const CLASS_PAGE = "FML_Page";
|
const CLASS_PAGE = "FML_Page";
|
||||||
const CLASS_PAGER = "FML_Pager";
|
const CLASS_PAGER = "FML_Pager";
|
||||||
const CLASS_PAGELABEL = "FML_PageLabel";
|
const CLASS_PAGELABEL = "FML_PageLabel";
|
||||||
const CLASS_PROFILE = "FML_Profile";
|
const CLASS_PROFILE = "FML_Profile";
|
||||||
const CLASS_MAPINFO = "FML_MapInfo";
|
const CLASS_MAPINFO = "FML_MapInfo";
|
||||||
const LABEL_ONINIT = "OnInit";
|
const LABEL_ONINIT = "OnInit";
|
||||||
const LABEL_LOOP = "Loop";
|
const LABEL_LOOP = "Loop";
|
||||||
const LABEL_ENTRYSUBMIT = "EntrySubmit";
|
const LABEL_ENTRYSUBMIT = "EntrySubmit";
|
||||||
const LABEL_KEYPRESS = "KeyPress";
|
const LABEL_KEYPRESS = "KeyPress";
|
||||||
const LABEL_MOUSECLICK = "MouseClick";
|
const LABEL_MOUSECLICK = "MouseClick";
|
||||||
const LABEL_MOUSEOUT = "MouseOut";
|
const LABEL_MOUSEOUT = "MouseOut";
|
||||||
const LABEL_MOUSEOVER = "MouseOver";
|
const LABEL_MOUSEOVER = "MouseOver";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Protected Properties
|
* Protected Properties
|
||||||
*/
|
*/
|
||||||
protected $tagName = 'script';
|
protected $tagName = 'script';
|
||||||
protected $includes = array();
|
protected $includes = array();
|
||||||
protected $tooltips = false;
|
protected $tooltips = false;
|
||||||
protected $menus = false;
|
protected $menus = false;
|
||||||
protected $pages = false;
|
protected $pages = false;
|
||||||
protected $profile = false;
|
protected $profile = false;
|
||||||
protected $mapInfo = false;
|
protected $mapInfo = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an Include to the Script
|
* Add an Include to the Script
|
||||||
*
|
*
|
||||||
* @param string $namespace
|
* @param string $namespace
|
||||||
* @param string $file
|
* @param string $file
|
||||||
* @return \FML\Script\Script
|
* @return \FML\Script\Script
|
||||||
*/
|
*/
|
||||||
public function addInclude($namespace, $file) {
|
public function addInclude($namespace, $file) {
|
||||||
$this->includes[$namespace] = $file;
|
$this->includes[$namespace] = $file;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a Tooltip Behavior
|
* Add a Tooltip Behavior
|
||||||
*
|
*
|
||||||
* @param Control $hoverControl
|
* @param Control $hoverControl
|
||||||
* @param Control $tooltipControl
|
* @param Control $tooltipControl
|
||||||
* @return \FML\Script\Script
|
* @return \FML\Script\Script
|
||||||
*/
|
*/
|
||||||
public function addTooltip(Control $hoverControl, Control $tooltipControl) {
|
public function addTooltip(Control $hoverControl, Control $tooltipControl) {
|
||||||
if (!($hoverControl instanceof Scriptable)) {
|
if (!($hoverControl instanceof Scriptable)) {
|
||||||
trigger_error('Scriptable Control needed as HoverControl for Tooltips!');
|
trigger_error('Scriptable Control needed as HoverControl for Tooltips!');
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
$tooltipControl->checkId();
|
$tooltipControl->checkId();
|
||||||
$tooltipControl->setVisible(false);
|
$tooltipControl->setVisible(false);
|
||||||
$hoverControl->setScriptEvents(true);
|
$hoverControl->setScriptEvents(true);
|
||||||
$hoverControl->addClass(self::CLASS_TOOLTIPS);
|
$hoverControl->addClass(self::CLASS_TOOLTIPS);
|
||||||
$hoverControl->addClass($tooltipControl->getId());
|
$hoverControl->addClass($tooltipControl->getId());
|
||||||
$this->tooltips = true;
|
$this->tooltips = true;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a Menu Behavior
|
* Add a Menu Behavior
|
||||||
*
|
*
|
||||||
* @param Control $clickControl
|
* @param Control $clickControl
|
||||||
* @param Control $menuControl
|
* @param Control $menuControl
|
||||||
* @param string $menuId
|
* @param string $menuId
|
||||||
* @return \FML\Script\Script
|
* @return \FML\Script\Script
|
||||||
*/
|
*/
|
||||||
public function addMenu(Control $clickControl, Control $menuControl, $menuId = null) {
|
public function addMenu(Control $clickControl, Control $menuControl, $menuId = null) {
|
||||||
if (!($clickControl instanceof Scriptable)) {
|
if (!($clickControl instanceof Scriptable)) {
|
||||||
trigger_error('Scriptable Control needed as ClickControl for Menus!');
|
trigger_error('Scriptable Control needed as ClickControl for Menus!');
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
if (!$menuId) $menuId = '_';
|
if (!$menuId) $menuId = '_';
|
||||||
$menuControl->checkId();
|
$menuControl->checkId();
|
||||||
$menuControl->addClass(self::CLASS_MENU);
|
$menuControl->addClass(self::CLASS_MENU);
|
||||||
$menuControl->addClass($menuId);
|
$menuControl->addClass($menuId);
|
||||||
$clickControl->setScriptEvents(true);
|
$clickControl->setScriptEvents(true);
|
||||||
$clickControl->addClass(self::CLASS_MENUBUTTON);
|
$clickControl->addClass(self::CLASS_MENUBUTTON);
|
||||||
$clickControl->addClass($menuId . '-' . $menuControl->getId());
|
$clickControl->addClass($menuId . '-' . $menuControl->getId());
|
||||||
$this->addInclude('TextLib', 'TextLib');
|
$this->addInclude('TextLib', 'TextLib');
|
||||||
$this->menus = true;
|
$this->menus = true;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a Page for a Paging Behavior
|
* Add a Page for a Paging Behavior
|
||||||
*
|
*
|
||||||
* @param Control $pageControl
|
* @param Control $pageControl
|
||||||
* @param int $pageNumber
|
* @param int $pageNumber
|
||||||
* @param string $pagesId
|
* @param string $pagesId
|
||||||
* @return \FML\Script\Script
|
* @return \FML\Script\Script
|
||||||
*/
|
*/
|
||||||
public function addPage(Control $pageControl, $pageNumber, $pagesId = null) {
|
public function addPage(Control $pageControl, $pageNumber, $pagesId = null) {
|
||||||
$pageNumber = (int) $pageNumber;
|
$pageNumber = (int) $pageNumber;
|
||||||
if (!$pagesId) $pagesId = '_';
|
if (!$pagesId) $pagesId = '_';
|
||||||
$pageControl->addClass(self::CLASS_PAGE);
|
$pageControl->addClass(self::CLASS_PAGE);
|
||||||
$pageControl->addClass($pagesId);
|
$pageControl->addClass($pagesId);
|
||||||
$pageControl->addClass(self::CLASS_PAGE . '-P' . $pageNumber);
|
$pageControl->addClass(self::CLASS_PAGE . '-P' . $pageNumber);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a Pager Button for a Paging Behavior
|
* Add a Pager Button for a Paging Behavior
|
||||||
*
|
*
|
||||||
* @param Control $pagerControl
|
* @param Control $pagerControl
|
||||||
* @param int $pagingAction
|
* @param int $pagingAction
|
||||||
* @param string $pagesId
|
* @param string $pagesId
|
||||||
* @return \FML\Script\Script
|
* @return \FML\Script\Script
|
||||||
*/
|
*/
|
||||||
public function addPager(Control $pagerControl, $pagingAction, $pagesId = null) {
|
public function addPager(Control $pagerControl, $pagingAction, $pagesId = null) {
|
||||||
if (!($pagerControl instanceof Scriptable)) {
|
if (!($pagerControl instanceof Scriptable)) {
|
||||||
trigger_error('Scriptable Control needed as PagerControl for Pages!');
|
trigger_error('Scriptable Control needed as PagerControl for Pages!');
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
$pagingAction = (int) $pagingAction;
|
$pagingAction = (int) $pagingAction;
|
||||||
if (!$pagesId) $pagesId = '_';
|
if (!$pagesId) $pagesId = '_';
|
||||||
$pagerControl->setScriptEvents(true);
|
$pagerControl->setScriptEvents(true);
|
||||||
$pagerControl->addClass(self::CLASS_PAGER);
|
$pagerControl->addClass(self::CLASS_PAGER);
|
||||||
$pagerControl->addClass(self::CLASS_PAGER . '-I' . $pagesId);
|
$pagerControl->addClass(self::CLASS_PAGER . '-I' . $pagesId);
|
||||||
$pagerControl->addClass(self::CLASS_PAGER . '-A' . $pagingAction);
|
$pagerControl->addClass(self::CLASS_PAGER . '-A' . $pagingAction);
|
||||||
$this->addInclude('TextLib', 'TextLib');
|
$this->addInclude('TextLib', 'TextLib');
|
||||||
$this->pages = true;
|
$this->pages = true;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a Label that shows the current Page Number
|
* Add a Label that shows the current Page Number
|
||||||
*
|
*
|
||||||
* @param Label $pageLabel
|
* @param Label $pageLabel
|
||||||
* @param string $pagesId
|
* @param string $pagesId
|
||||||
* @return \FML\Script\Script
|
* @return \FML\Script\Script
|
||||||
*/
|
*/
|
||||||
public function addPageLabel(Label $pageLabel, $pagesId = null) {
|
public function addPageLabel(Label $pageLabel, $pagesId = null) {
|
||||||
if (!$pagesId) $pagesId = '_';
|
if (!$pagesId) $pagesId = '_';
|
||||||
$pageLabel->addClass(self::CLASS_PAGELABEL);
|
$pageLabel->addClass(self::CLASS_PAGELABEL);
|
||||||
$pageLabel->addClass($pagesId);
|
$pageLabel->addClass($pagesId);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a Button Behavior that will open the Built-In Player Profile
|
* Add a Button Behavior that will open the Built-In Player Profile
|
||||||
*
|
*
|
||||||
* @param Control $profileControl
|
* @param Control $profileControl
|
||||||
* @param string $playerLogin
|
* @param string $playerLogin
|
||||||
* @return \FML\Script\Script
|
* @return \FML\Script\Script
|
||||||
*/
|
*/
|
||||||
public function addProfileButton(Control $profileControl, $playerLogin) {
|
public function addProfileButton(Control $profileControl, $playerLogin) {
|
||||||
if (!($profileControl instanceof Scriptable)) {
|
if (!($profileControl instanceof Scriptable)) {
|
||||||
trigger_error('Scriptable Control needed as ClickControl for Profiles!');
|
trigger_error('Scriptable Control needed as ClickControl for Profiles!');
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
$profileControl->setScriptEvents(true);
|
$profileControl->setScriptEvents(true);
|
||||||
$profileControl->addClass(self::CLASS_PROFILE);
|
$profileControl->addClass(self::CLASS_PROFILE);
|
||||||
if ($playerLogin) {
|
if ($playerLogin) {
|
||||||
$profileControl->addClass(self::CLASS_PROFILE . '-' . $playerLogin);
|
$profileControl->addClass(self::CLASS_PROFILE . '-' . $playerLogin);
|
||||||
}
|
}
|
||||||
$this->profile = true;
|
$this->profile = true;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a Button Behavior that will open the Built-In Map Info
|
* Add a Button Behavior that will open the Built-In Map Info
|
||||||
*
|
*
|
||||||
* @param Control $mapInfoControl
|
* @param Control $mapInfoControl
|
||||||
* @return \FML\Script\Script
|
* @return \FML\Script\Script
|
||||||
*/
|
*/
|
||||||
public function addMapInfoButton(Control $mapInfoControl) {
|
public function addMapInfoButton(Control $mapInfoControl) {
|
||||||
if (!($mapInfoControl instanceof Scriptable)) {
|
if (!($mapInfoControl instanceof Scriptable)) {
|
||||||
trigger_error('Scriptable Control needed as ClickControl for Map Info!');
|
trigger_error('Scriptable Control needed as ClickControl for Map Info!');
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
$mapInfoControl->setScriptEvents(true);
|
$mapInfoControl->setScriptEvents(true);
|
||||||
$mapInfoControl->addClass(self::CLASS_MAPINFO);
|
$mapInfoControl->addClass(self::CLASS_MAPINFO);
|
||||||
$this->mapInfo = true;
|
$this->mapInfo = true;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the Script XML Tag
|
* Create the Script XML Tag
|
||||||
*
|
*
|
||||||
* @param \DOMDocument $domDocument
|
* @param \DOMDocument $domDocument
|
||||||
* @return \DOMElement
|
* @return \DOMElement
|
||||||
*/
|
*/
|
||||||
public function render(\DOMDocument $domDocument) {
|
public function render(\DOMDocument $domDocument) {
|
||||||
$scriptXml = $domDocument->createElement($this->tagName);
|
$scriptXml = $domDocument->createElement($this->tagName);
|
||||||
$scriptText = $this->buildScriptText();
|
$scriptText = $this->buildScriptText();
|
||||||
$scriptComment = $domDocument->createComment($scriptText);
|
$scriptComment = $domDocument->createComment($scriptText);
|
||||||
$scriptXml->appendChild($scriptComment);
|
$scriptXml->appendChild($scriptComment);
|
||||||
return $scriptXml;
|
return $scriptXml;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the complete Script Text
|
* Build the complete Script Text
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function buildScriptText() {
|
private function buildScriptText() {
|
||||||
$scriptText = "";
|
$scriptText = "";
|
||||||
$scriptText .= $this->getHeaderComment();
|
$scriptText .= $this->getHeaderComment();
|
||||||
$scriptText .= $this->getIncludes();
|
$scriptText .= $this->getIncludes();
|
||||||
if ($this->tooltips) {
|
if ($this->tooltips) {
|
||||||
$scriptText .= $this->getTooltipLabels();
|
$scriptText .= $this->getTooltipLabels();
|
||||||
}
|
}
|
||||||
if ($this->menus) {
|
if ($this->menus) {
|
||||||
$scriptText .= $this->getMenuLabels();
|
$scriptText .= $this->getMenuLabels();
|
||||||
}
|
}
|
||||||
if ($this->pages) {
|
if ($this->pages) {
|
||||||
$scriptText .= $this->getPagesLabels();
|
$scriptText .= $this->getPagesLabels();
|
||||||
}
|
}
|
||||||
if ($this->profile) {
|
if ($this->profile) {
|
||||||
$scriptText .= $this->getProfileLabels();
|
$scriptText .= $this->getProfileLabels();
|
||||||
}
|
}
|
||||||
if ($this->mapInfo) {
|
if ($this->mapInfo) {
|
||||||
$scriptText .= $this->getMapInfoLabels();
|
$scriptText .= $this->getMapInfoLabels();
|
||||||
}
|
}
|
||||||
$scriptText .= $this->getMainFunction();
|
$scriptText .= $this->getMainFunction();
|
||||||
return $scriptText;
|
return $scriptText;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Header Comment
|
* Get the Header Comment
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function getHeaderComment() {
|
private function getHeaderComment() {
|
||||||
$headerComment = file_get_contents(__DIR__ . '/Parts/Header.txt');
|
$headerComment = file_get_contents(__DIR__ . '/Parts/Header.txt');
|
||||||
return $headerComment;
|
return $headerComment;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Includes
|
* Get the Includes
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function getIncludes() {
|
private function getIncludes() {
|
||||||
$includesText = PHP_EOL;
|
$includesText = PHP_EOL;
|
||||||
foreach ($this->includes as $namespace => $file) {
|
foreach ($this->includes as $namespace => $file) {
|
||||||
$includesText .= "#Include \"{$file}\" as {$namespace}" . PHP_EOL;
|
$includesText .= "#Include \"{$file}\" as {$namespace}" . PHP_EOL;
|
||||||
}
|
}
|
||||||
return $includesText;
|
return $includesText;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Tooltip Labels
|
* Get the Tooltip Labels
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function getTooltipLabels() {
|
private function getTooltipLabels() {
|
||||||
$mouseOverScript = "
|
$mouseOverScript = "
|
||||||
if (Event.Control.HasClass(\"" . self::CLASS_TOOLTIPS . "\")) {
|
if (Event.Control.HasClass(\"" . self::CLASS_TOOLTIPS . "\")) {
|
||||||
foreach (ControlClass in Event.Control.ControlClasses) {
|
foreach (ControlClass in Event.Control.ControlClasses) {
|
||||||
@ -271,7 +271,7 @@ if (Event.Control.HasClass(\"" . self::CLASS_TOOLTIPS . "\")) {
|
|||||||
if (TooltipControl == Null) continue;
|
if (TooltipControl == Null) continue;
|
||||||
TooltipControl.Show();
|
TooltipControl.Show();
|
||||||
}
|
}
|
||||||
}";
|
}";
|
||||||
$mouseOutScript = "
|
$mouseOutScript = "
|
||||||
if (Event.Control.HasClass(\"" . self::CLASS_TOOLTIPS . "\")) {
|
if (Event.Control.HasClass(\"" . self::CLASS_TOOLTIPS . "\")) {
|
||||||
foreach (ControlClass in Event.Control.ControlClasses) {
|
foreach (ControlClass in Event.Control.ControlClasses) {
|
||||||
@ -279,18 +279,18 @@ if (Event.Control.HasClass(\"" . self::CLASS_TOOLTIPS . "\")) {
|
|||||||
if (TooltipControl == Null) continue;
|
if (TooltipControl == Null) continue;
|
||||||
TooltipControl.Hide();
|
TooltipControl.Hide();
|
||||||
}
|
}
|
||||||
}";
|
}";
|
||||||
$tooltipsLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSEOVER, $mouseOverScript);
|
$tooltipsLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSEOVER, $mouseOverScript);
|
||||||
$tooltipsLabels .= Builder::getLabelImplementationBlock(self::LABEL_MOUSEOUT, $mouseOutScript);
|
$tooltipsLabels .= Builder::getLabelImplementationBlock(self::LABEL_MOUSEOUT, $mouseOutScript);
|
||||||
return $tooltipsLabels;
|
return $tooltipsLabels;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Menu Labels
|
* Get the Menu Labels
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function getMenuLabels() {
|
private function getMenuLabels() {
|
||||||
$mouseClickScript = "
|
$mouseClickScript = "
|
||||||
if (Event.Control.HasClass(\"" . self::CLASS_MENUBUTTON . "\")) {
|
if (Event.Control.HasClass(\"" . self::CLASS_MENUBUTTON . "\")) {
|
||||||
declare Text MenuIdClass;
|
declare Text MenuIdClass;
|
||||||
@ -305,25 +305,25 @@ if (Event.Control.HasClass(\"" . self::CLASS_MENUBUTTON . "\")) {
|
|||||||
Page.GetClassChildren(MenuIdClass, Page.MainFrame, True);
|
Page.GetClassChildren(MenuIdClass, Page.MainFrame, True);
|
||||||
foreach (MenuControl in Page.GetClassChildren_Result) {
|
foreach (MenuControl in Page.GetClassChildren_Result) {
|
||||||
if (!MenuControl.HasClass(\"" . self::CLASS_MENU . "\")) continue;
|
if (!MenuControl.HasClass(\"" . self::CLASS_MENU . "\")) continue;
|
||||||
if (MenuControlId != MenuControl.Id) {
|
if (MenuControlId != MenuControl.ControlId) {
|
||||||
MenuControl.Hide();
|
MenuControl.Hide();
|
||||||
} else {
|
} else {
|
||||||
MenuControl.Show();
|
MenuControl.Show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}";
|
}";
|
||||||
$menuLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $mouseClickScript);
|
$menuLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $mouseClickScript);
|
||||||
return $menuLabels;
|
return $menuLabels;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Pages Labels
|
* Get the Pages Labels
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function getPagesLabels() {
|
private function getPagesLabels() {
|
||||||
$pagesNumberPrefix = self::CLASS_PAGE . '-P';
|
$pagesNumberPrefix = self::CLASS_PAGE . '-P';
|
||||||
$pagesNumberPrefixLength = strlen($pagesNumberPrefix);
|
$pagesNumberPrefixLength = strlen($pagesNumberPrefix);
|
||||||
$pagesScript = "
|
$pagesScript = "
|
||||||
if (Event.Control.HasClass(\"" . self::CLASS_PAGER . "\")) {
|
if (Event.Control.HasClass(\"" . self::CLASS_PAGER . "\")) {
|
||||||
declare Text PagesId;
|
declare Text PagesId;
|
||||||
@ -386,23 +386,23 @@ if (Event.Control.HasClass(\"" . self::CLASS_PAGER . "\")) {
|
|||||||
PageControl.Show();
|
PageControl.Show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Page.GetClassChildren(\"".self::CLASS_PAGELABEL."\", Page.MainFrame, True);
|
Page.GetClassChildren(\"" . self::CLASS_PAGELABEL . "\", Page.MainFrame, True);
|
||||||
foreach (PageControl in Page.GetClassChildren_Result) {
|
foreach (PageControl in Page.GetClassChildren_Result) {
|
||||||
if (!PageControl.HasClass(PagesId)) continue;
|
if (!PageControl.HasClass(PagesId)) continue;
|
||||||
declare PageLabel <=> (PageControl as CMlLabel);
|
declare PageLabel <=> (PageControl as CMlLabel);
|
||||||
PageLabel.Value = (FML_PageNumber[PagesId]+1)^\"/\"^(FML_MaxPageNumber[PagesId]+1);
|
PageLabel.Value = (FML_PageNumber[PagesId]+1)^\"/\"^(FML_MaxPageNumber[PagesId]+1);
|
||||||
}
|
}
|
||||||
}";
|
}";
|
||||||
$pagesLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $pagesScript);
|
$pagesLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $pagesScript);
|
||||||
return $pagesLabels;
|
return $pagesLabels;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Profile Labels
|
* Get the Profile Labels
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function getProfileLabels() {
|
private function getProfileLabels() {
|
||||||
$profileScript = "
|
$profileScript = "
|
||||||
if (Event.Control.HasClass(\"" . self::CLASS_PROFILE . "\") {
|
if (Event.Control.HasClass(\"" . self::CLASS_PROFILE . "\") {
|
||||||
declare Login = LocalUser.Login;
|
declare Login = LocalUser.Login;
|
||||||
@ -414,32 +414,32 @@ if (Event.Control.HasClass(\"" . self::CLASS_PROFILE . "\") {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ShowProfile(Login);
|
ShowProfile(Login);
|
||||||
}";
|
}";
|
||||||
$profileLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $profileScript);
|
$profileLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $profileScript);
|
||||||
return $profileLabels;
|
return $profileLabels;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Map Info Labels
|
* Get the Map Info Labels
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function getMapInfoLabels() {
|
private function getMapInfoLabels() {
|
||||||
$mapInfoScript = "
|
$mapInfoScript = "
|
||||||
if (Event.Control.HasClass(\"" . self::CLASS_MAPINFO . "\") {
|
if (Event.Control.HasClass(\"" . self::CLASS_MAPINFO . "\") {
|
||||||
ShowCurChallengeCard();
|
ShowCurChallengeCard();
|
||||||
}";
|
}";
|
||||||
$mapInfoLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $mapInfoScript);
|
$mapInfoLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $mapInfoScript);
|
||||||
return $mapInfoLabels;
|
return $mapInfoLabels;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Main Function
|
* Get the Main Function
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function getMainFunction() {
|
private function getMainFunction() {
|
||||||
$mainFunction = file_get_contents(__DIR__ . '/Parts/Main.txt');
|
$mainFunction = file_get_contents(__DIR__ . '/Parts/Main.txt');
|
||||||
return $mainFunction;
|
return $mainFunction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user