/** * Adds a radio option to this list. * @param string $value The short value that represents the displayed text. * @param string $displayText The text to show to the end user. * @access public * @return void */ function addOption($value, $displayText) { $name = strval(count($this->_optionValues)); $this->_optionValues[$name] = $value; $newChild = new WCheckBox(); $newChild->setLabel($displayText); $this->addComponent($name, $newChild); }
/** * Create a new Wizard for this action. Caching of this Wizard is handled by * {@link getWizard()} and does not need to be implemented here. * @access public * @since 7/18/05 */ function createWizard() { $wizard = SimpleWizard::withText("<table border='0' style='margin-top:20px' >\n" . "\n<tr><td><h3>" . _("File type:") . "</h3></td></tr>" . "\n<tr><td>" . _("The type of file to be imported: ") . "</td>" . "\n<td>[[file_type]]</td></tr>" . "\n<tr><td>" . _("Is this file an archive? ") . "</td>" . "\n<td>[[is_archived]]</td></tr>" . "\n<tr><td><h3>" . _("Import type:") . "</h3></td></tr>" . "\n<tr><td>" . _("The type of import to execute: ") . "</td>" . "\n<td>[[import_type]]</td></tr>" . "\n<tr><td><h3>" . _("File:") . "</h3></td></tr>" . "\n<tr><td>" . _("The file to be imported: ") . "</td>" . "\n<td>[[filename]]</td>" . "<tr>\n" . "<td align='left'>\n" . "[[_cancel]]" . "</td>\n" . "<td align='right'>\n" . "[[_save]]" . "</td></tr></table>"); $select = $wizard->addComponent("file_type", new WSelectList()); // $select->addOption("Tab-Delimited", "Tab-Delimited"); $select->addOption("XML", "XML"); // $select->addOption("Exif", "Exif"); // $select->setValue("Tab-Delimited"); $archive = $wizard->addComponent("is_archived", WCheckBox::withLabel("is Archived")); $type = $wizard->addComponent("import_type", new WSelectList()); // $type->addOption("update", "update"); // need exceptions for nodes not existing $type->addOption("insert", "insert"); //$type->addOption("replace", "replace"); $fileField = $wizard->addComponent("filename", new WFileUploadField()); $save = $wizard->addComponent("_save", WSaveButton::withLabel("Import")); $cancel = $wizard->addComponent("_cancel", new WCancelButton()); //$fileField->setErrorText("<nobr>"._("A value for this field is required.")."</nobr>"); //$fileField->setErrorRule(new WECNonZeroRegex("[\\w]+")); return $wizard; }
/** * Create a new Wizard for this action. Caching of this Wizard is handled by * {@link getWizard()} and does not need to be implemented here. * @access public * @since 7/18/05 */ function createWizard() { $harmoni = Harmoni::Instance(); $wizard = SimpleWizard::withText("<table border='0' style='margin-top:20px' >\n" . "\n<tr><td><h3>" . _("Source data type:") . "</h3></td>" . "\n<td style='font-size: small;'>" . "* Please see the <strong>Help</strong> below for more information." . "</td></tr>" . "\n<tr><td>" . _("The format of data to be imported: ") . "</td>" . "\n<td>[[file_type]]</td></tr>" . "\n<tr><td>" . _("Is this file a Zip/GZip/BZip/Tar archive?<br/>If checked, the archive will be decompressed and all files in it will be imported.") . "</td>" . "\n<td>[[is_archived]]</td></tr>" . "\n<tr><td><h3>" . _("Import type:") . "</h3></td></tr>" . "\n<tr><td>" . _("The type of import to execute: ") . "</td>" . "\n<td>[[import_type]]</td></tr>" . "\n<tr><td><h3>" . _("File:") . "</h3></td></tr>" . "\n<tr><td>" . _("The Zip/GZip/BZip/Tar/XML achive file or a single file to be imported: ") . "</td>" . "\n<td>[[filename]]</td></tr>" . "\n<tr><td><h3>" . _("Parent Asset:") . "</h3></td></tr>" . "\n<tr><td>" . _("If specified, all Assets imported will be placed below this parent. ") . "</td>" . "\n<td>[[parent]]</td></tr>" . "<tr>\n" . "<td align='left'>\n" . "[[_cancel]]" . "</td>\n" . "<td align='right'>\n" . "[[_save]]" . "</td></tr></table>"); $select = $wizard->addComponent("file_type", new WSelectList()); $select->addOption("XML", "XML"); $select->addOption("Tab-Delimited", "Tab-Delimited"); $select->addOption("Exif", "Exif"); $select->addOption("FilesOnly", "Files Only (no metadata)"); $select->setValue("FilesOnly"); $archive = $wizard->addComponent("is_archived", WCheckBox::withLabel("is Archived")); $archive->setChecked(true); $type = $wizard->addComponent("import_type", new WSelectList()); // $type->addOption("update", "update"); // need exceptions for nodes not existing $type->addOption("insert", "insert"); //$type->addOption("replace", "replace"); $fileField = $wizard->addComponent("filename", new WFileUploadField()); $parent = $wizard->addComponent("parent", new WSelectList()); $parent->addOption("", "none"); $rootAssets = $this->getRootAssets(); while ($rootAssets->hasNext()) { $this->addAssetOption($parent, $rootAssets->next()); } if (RequestContext::value('parent')) { $parent->setValue(RequestContext::value('parent')); } $save = $wizard->addComponent("_save", WSaveButton::withLabel("Import")); $cancel = $wizard->addComponent("_cancel", new WCancelButton()); //$fileField->setErrorText("<nobr>"._("A value for this field is required.")."</nobr>"); //$fileField->setErrorRule(new WECNonZeroRegex("[\\w]+")); return $wizard; }
/** * 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; }