public function wrapHTML($componentContent) { $this->html = $wrapper = parent::wrapHTML($componentContent); if (($snippet = $this->getJavaScript($wrapper)) instanceof \Psc\JS\Snippet) { $snippet = clone $snippet; $snippet->setVar(Snippet::VAR_NAME_SELF, \Psc\JS\jQuery::getClassSelector($wrapper)); $wrapper->getContent()->js = $snippet->html(); } return $wrapper; }
protected function doInit() { // das zuerst machen, da das html von f::inputSet bei html() schon gemorphed wird $widget = $this->getAutoCompleteWidget(); $widgetSelector = \Psc\JS\jQuery::getClassSelector($widget); $content = NULL; $content .= f::inputSet(f::input($widget, $this->getHint()))->setStyle('width', '90%')->html(); // gilt für alle // ist auch in ajax.dialog.add.speakers $content .= f::hint($this->getExplanation()); $this->html = f::group($this->getLabel(), $content, f::GROUP_COLLAPSIBLE)->setStyle('width', '80%'); $this->constructParams['widget'] = new \Psc\JS\Code($widgetSelector); $this->constructParams['delay'] = $this->getAutoCompleteDelay(); $this->constructParams['minLength'] = $this->getAutoCompleteMinLength(); $this->constructParams['url'] = $this->getAutoCompleteURL(); $this->constructParams['maxResults'] = $this->getMaxResults(); if ($this->getAutoCompleteBody() != NULL) { $this->constructParams['body'] = $this->getAutoCompleteBody(); } $this->constructParams['eventManager'] = new \Psc\JS\Code('main.getEventManager()'); $this->autoLoad(); }
public function getFormular() { $pane = new SplitPane(70); $pane->setLeftContent($container = Form::group('Navigation', NULL)); $container->getContent()->div->setStyle('min-height', '600px'); $container->addClass('\\Psc\\navigation'); $pane->setRightContent($this->getFormDocumentation()); $panelButtons = new PanelButtons(array('save', 'reload'), $this->getTranslationContainer()); $form = new \Psc\CMS\Form(NULL, '/entities/navigation-node/' . $this->context, 'post'); $form->setHTTPHeader('X-Psc-Cms-Request-Method', 'PUT'); $form->setContent('buttons', $panelButtons)->setContent('pane', $pane); $main = $form->html(); $main->addClass('\\Psc\\navigation-container'); $main->addClass('\\Psc\\serializable'); $snippet = JooseSnippet::create('Psc.UI.Navigation', array('widget' => JooseSnippet::expr(\Psc\JS\jQuery::getClassSelector($main)), 'flat' => $this->getFlat(), 'uiController' => JooseSnippet::expr('main.getUIController()'), 'languages' => (array) $this->container->getLanguages())); $main->templateAppend($snippet->html()); return $main; }
public function getJooseSelector(\Psc\HTML\Tag $tag = NULL) { return new \Psc\JS\Code(\Psc\JS\jQuery::getClassSelector($tag ?: $this->html)); }