/** * Return the a {@link WizardComponent} to allow editing of your * plugin in the Wizard. * * @return object WizardComponent * @access public * @since 5/8/07 */ function getWizardComponent() { $wrapper = new WComponentCollection(); $harmoni = Harmoni::instance(); ob_start(); $property = $wrapper->addComponent('comment', new WTextField()); $property->setSize(80); $property->setStartingDisplayText(_("Add a comment about your changes here.")); $property = $wrapper->addComponent('content', HtmlTextArea::withRowsAndColumns(20, 80)); $property->setValue($this->applyEditorSafeTextTemplates($this->cleanHTML($this->untokenizeLocalUrls($this->getContent())))); $property->chooseEditor('fck'); $fckArea = $property->getEditor('fck'); $fckArea->setOption('ToolbarSet', 'ContentBlock'); $fckArea->setConfigOption('CustomConfigurationsPath', MYPATH . '/javascript/fck_custom_config.js'); $fckArea->setConfigOption('ImageBrowserWindowWidth', '700'); $fckArea->setConfigOption('ImageBrowserWindowHeight', '600'); $fckTextArea = $property->getEditor('fck'); $harmoni->request->startNamespace('media'); $fckTextArea->enableFileBrowsingAtUrl($harmoni->request->quickURL('media', 'filebrowser', array('node' => $this->getId()))); $harmoni->request->endNamespace(); $writeJsCallback = "function (htmlString) { " . "edInsertContent(this.form.elements['[[fieldname:]]'], htmlString); " . "}"; $property->addPostHtml('none', "<br/>" . Segue_MediaLibrary::getMediaButtons($this->getId(), $writeJsCallback)); $writeJsCallback = "function (htmlString) { " . "var oEditor = FCKeditorAPI.GetInstance('[[fieldname:]]'); " . "oEditor.InsertHtml(htmlString); " . "}"; $property->addPostHtml('fck', "<br/>" . Segue_MediaLibrary::getMediaButtons($this->getId(), $writeJsCallback)); print "[[content]]"; print $this->getWikiHelp(); $property = $wrapper->addComponent('abstractLength', new WTextField()); $property->setSize(3); $property->setValue($this->getRawDescription()); print "\n\t<br/>"; print _("Abstract to [[abstractLength]] words. (Enter '0' for no abstract)"); print "\n\t<br/>"; print "\n\t<br/>"; print "[[comment]]"; $wrapper->setContent(ob_get_clean()); return $wrapper; }
/** * Returns a block of XHTML-valid code that contains markup for this specific * component. * @param string $fieldName The field name to use when outputting form data or * similar parameters/information. * @access public * @return string */ function getMarkup($fieldName) { ob_start(); foreach ($this->getChildren() as $childName => $child) { print "\n\t<div>[[" . $childName . "]] </div>"; } $this->setContent(ob_get_clean()); return parent::getMarkup($fieldName); }
/** * Return the a {@link WizardComponent} to allow editing of your * plugin in the Wizard. * * @return object WizardComponent * @access public * @since 5/8/07 */ public function getWizardComponent() { $wrapper = new WComponentCollection(); ob_start(); $group = $this->getNode()->getMembersGroup(); $subgroups = $group->getGroups(false); $hiddenGroups = $this->getMembersHiddenGroups(); $harmoni = Harmoni::instance(); $harmoni->request->startNamespace(null); $membersUrl = SiteDispatcher::quickURL('agent', 'modify_members', array('returnModule' => $this->getLocalModule(), 'returnAction' => $this->getLocalAction())); $rolesUrl = SiteDispatcher::quickURL('roles', 'modify', array('agent' => $group->getId()->getIdString(), 'returnModule' => $this->getLocalModule(), 'returnAction' => $this->getLocalAction())); $harmoni->request->endNamespace(); print "\n<p class='participation_ext_link'><a href='" . $membersUrl . "'>" . _("Add/Edit Site-Members »") . "</a></p>"; print "\n<p class='participation_ext_link'><a href='" . $rolesUrl . "'>" . _("View/Edit Roles of Site-Members »") . "</a></p>"; if ($subgroups->hasNext()) { print "\n<h4>" . _("Show members of following groups:") . "</h4>"; while ($subgroups->hasNext()) { $subgroup = $subgroups->next(); $propertyId = md5($subgroup->getId()->getIdString()); $property = $wrapper->addComponent($propertyId, WCheckBox::withLabel($subgroup->getDisplayName())); if (!in_array($subgroup->getId()->getIdString(), $hiddenGroups)) { $property->setChecked(true); } print "\n\n[[" . $propertyId . "]]<br/>"; } } $wrapper->setContent(ob_get_clean()); return $wrapper; }