/** * Get the script text * * @return string */ protected function getScriptText() { $url = $this->buildCompatibleUrl(); $entryName = $this->entry->getName(); $link = Builder::escapeText($entryName . $url . "="); return "\ndeclare Value = TextLib::URLEncode(Entry.Value);\nOpenLink({$link}^Value, CMlScript::LinkType::Goto);\n"; }
/** * Create the hidden Entry * * @return Entry */ protected function createEntry() { $entry = new Entry(); $entry->setVisible(false)->setName($this->name); $this->setEntry($entry); return $entry; }
public function testRenderWithAutoComplete() { $domDocument = new \DOMDocument(); $entry = new Entry("test.auto.entry"); $entry->clearAlign()->setName("test-get-name")->setAutoComplete(true); $domElement = $entry->render($domDocument); $domDocument->appendChild($domElement); $this->assertEquals("<?xml version=\"1.0\"?>\n<entry id=\"test.auto.entry\" name=\"test-get-name\" default=\"test-get-value\"/>\n", $domDocument->saveXML()); }
/** * Set the hidden Entry * * @api * @param Entry $entry Hidden Entry * @return static */ public function setEntry(Entry $entry) { $entry->checkId(); $this->entry = $entry; return $this; }