/** * Create a new Wizard for this action. Caching of this Wizard is handled by * {@link getWizard()} and does not need to be implemented here. * * @return object Wizard * @access public * @since 4/28/05 */ function createWizard() { $harmoni = Harmoni::instance(); $harmoni->request->startNamespace('modify_exhibition'); $harmoni->request->passthrough('exhibition_id'); $idManager = Services::getService("Id"); $repositoryManager = Services::getService("Repository"); $exhibitionRepositoryId = $idManager->getId("edu.middlebury.concerto.exhibition_repository"); $repository = $repositoryManager->getRepository($exhibitionRepositoryId); $asset = $repository->getAsset($idManager->getId(RequestContext::value('exhibition_id'))); // Instantiate the wizard, then add our steps. $wizard = SimpleStepWizard::withDefaultLayout(); // :: Name and Description :: $step = $wizard->addStep("namedescstep", new WizardStep()); $step->setDisplayName(_("Name & Description")); // Create the properties. $displayNameProp = $step->addComponent("display_name", new WTextField()); $displayNameProp->setErrorText("<nobr>" . _("A value for this field is required.") . "</nobr>"); $displayNameProp->setErrorRule(new WECNonZeroRegex("[\\w]+")); $displayNameProp->setValue($asset->getDisplayName()); $descriptionProp = $step->addComponent("description", WTextArea::withRowsAndColumns(5, 30)); $descriptionProp->setValue($asset->getDescription()); // Create the step text ob_start(); print "\n<h2>" . _("Name") . "</h2>"; print "\n" . _("The Name for this <em>Exhibition</em>: "); print "\n<br />[[display_name]]"; print "\n<h2>" . _("Description") . "</h2>"; print "\n" . _("The Description for this <em>Exhibition</em>: "); print "\n<br />[[description]]"; print "\n<div style='width: 400px'> </div>"; $step->setContent(ob_get_contents()); ob_end_clean(); // :: Effective/Expiration Dates :: $step = $wizard->addStep("datestep", new WizardStep()); $step->setDisplayName(_("Effective Dates") . " (" . _("optional") . ")"); // Create the properties. $property = $step->addComponent("effective_date", new WTextField()); $date = $asset->getEffectiveDate(); if (is_object($date)) { $property->setValue($date->asString()); } $property = $step->addComponent("expiration_date", new WTextField()); $date = $asset->getExpirationDate(); if (is_object($date)) { $property->setValue($date->asString()); } // Create the step text ob_start(); print "\n<h2>" . _("Effective Date") . "</h2>"; print "\n" . _("The date that this <em>Exhibition</em> becomes effective: "); print "\n<br />[[effective_date]]"; print "\n<h2>" . _("Expiration Date") . "</h2>"; print "\n" . _("The date that this <em>Exhibition</em> expires: "); print "\n<br />[[expiration_date]]"; $step->setContent(ob_get_contents()); ob_end_clean(); $harmoni->request->endNamespace(); 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. * * @return object Wizard * @access public * @since 4/28/05 */ function createWizard() { $repository = $this->getRepository(); // Instantiate the wizard, then add our steps. $wizard = SimpleStepWizard::withDefaultLayout(); // :: Step One :: $stepOne = $wizard->addStep("namedesc", new WizardStep()); $stepOne->setDisplayName(_("Name & Description")); // Create the properties. $displayNameProp = $stepOne->addComponent("display_name", new WTextField()); $displayNameProp->setErrorRule(new WECNonZeroRegex("[\\w]+")); $displayNameProp->setErrorText(_("A value for this field is required.")); $descriptionProp = $stepOne->addComponent("description", WTextArea::withRowsAndColumns(5, 30)); $formatProp = $stepOne->addComponent("format", new WTextField()); $formatProp->setValue("Plain Text - UTF-8 encoding"); $formatProp->setErrorRule(new WECNonZeroRegex("[\\w]+")); $formatProp->setErrorText(_("A value for this field is required.")); $formatProp->setSize(25); // Create the step text ob_start(); print "\n<h2>" . _("Name") . "</h2>"; print "\n" . _("The Name for this Schema: "); print "\n<br />[[display_name]]"; print "\n<h2>" . _("Description") . "</h2>"; print "\n" . _("The Description for this Schema: "); print "\n<br />[[description]]"; print "\n<h2>" . _("Format") . "</h2>"; print "\n" . _("The format of data that is entered into the fields: "); print "\n<br /><em>" . _("'Plain Text - ASCII encoding', 'XML', etc.") . "</em>"; print "\n<br />[[format]]"; print "\n<div style='width: 400px'> </div>"; $stepOne->setContent(ob_get_contents()); ob_end_clean(); // :: Add Elements :: $elementStep = $wizard->addStep("elementstep", new WizardStep()); $elementStep->setDisplayName(_("Fields")); $multField = $elementStep->addComponent("elements", new WOrderedRepeatableComponentCollection()); $multField->setAddLabel(_("Add New Field")); $multField->setRemoveLabel(_("Remove Field")); $property = $multField->addComponent("display_name", new WTextField()); $property->setErrorRule(new WECNonZeroRegex("[\\w]+")); $property->setErrorText(_("A value for this property is required.")); $property->setSize(20); $property = $multField->addComponent("description", WTextArea::withRowsAndColumns(2, 30)); $property = $multField->addComponent("type", new WSelectList()); $defaultType = new Type("Repository", "edu.middlebury.harmoni", "shortstring"); $property->setValue(urlencode(HarmoniType::typeToString($defaultType, " :: "))); // We are going to assume that all RecordStructures have the same PartStructureTypes // in this Repository. This will allow us to list PartStructureTypes before // the RecordStructure is actually created. $recordStructures = $repository->getRecordStructures(); if (!$recordStructures->hasNext()) { throwError(new Error("No RecordStructures available.", "Concerto")); } $dmpType = new Type("RecordStructures", "edu.middlebury.harmoni", "DataManagerPrimatives", "RecordStructures stored in the Harmoni DataManager."); $orderedTypes = array("Repository :: edu.middlebury.harmoni :: shortstring" => _("Short String ----- text with max-length of 256 characters"), "Repository :: edu.middlebury.harmoni :: string" => _("String ---------- text with unlimited length"), "Repository :: edu.middlebury.harmoni :: datetime" => _("Date [and Time] -- a date or more precise point in time"), "Repository :: edu.middlebury.harmoni :: integer" => _("Integer --------- a whole number: 1, 2, 3, etc"), "Repository :: edu.middlebury.harmoni :: float" => _("Float ----------- a decimal/scientific-notation number"), "Repository :: edu.middlebury.harmoni :: boolean" => _("Boolean --------- true or false (yes/no)"), "Repository :: edu.middlebury.harmoni :: blob" => _("BLOB ----------- Binary Large OBject, for binary data"), "Repository :: edu.middlebury.harmoni :: okitype" => _("O.K.I. Type ------ 'domain :: authority :: keyword' triplet")); $unorderedTypes = array(); while ($recordStructures->hasNext()) { // we want just the datamanager structure types, so just // get the first structure that has Format "DataManagerPrimatives" $tmpRecordStructure = $recordStructures->next(); if ($dmpType->isEqual($tmpRecordStructure->getType())) { $types = $tmpRecordStructure->getPartStructureTypes(); while ($types->hasNext()) { $type = $types->next(); $typeString = $type->asString(" :: "); if (!array_key_exists($typeString, $orderedTypes)) { $unorderedTypes[$typeString] = $typeString; } } break; } } foreach ($orderedTypes as $typeString => $desc) { $property->addOption(urlencode($typeString), $desc); } foreach ($unorderedTypes as $typeString => $desc) { $property->addOption(urlencode($typeString), $desc); } $property = $multField->addComponent("mandatory", new WCheckBox()); $property->setChecked(false); $property->setLabel(_("yes")); $property = $multField->addComponent("repeatable", new WCheckBox()); // $property->setChecked(false); $property->setLabel(_("yes")); // $property =$multField->addComponent( // "populatedbydr", // new WCheckBox()); // $property->setChecked(false); // $property->setLabel(_("yes")); $property = $multField->addComponent("authoritative_values", WTextArea::withRowsAndColumns(10, 40)); // We don't have any PartStructures yet, so we can't get them. ob_start(); print "\n<table border=\"0\">"; print "\n<tr><td>"; print _("DisplayName") . ": "; print "\n</td><td>"; print "[[display_name]]"; print "\n</td></tr>"; print "\n<tr><td>"; print _("Description") . ": "; print "\n</td><td>"; print "[[description]]"; print "\n</td></tr>"; print "\n<tr><td style='color: red;'>"; print _("Type") . "... "; print "\n *</td><td>"; print "[[type]]"; print "\n</td></tr>"; print "\n<tr><td>"; print _("isMandatory? "); print "\n</td><td>"; print "[[mandatory]]"; print "\n</td></tr>"; print "\n<tr><td style='color: red;'>"; print _("isRepeatable? "); print "\n *</td><td>"; print "[[repeatable]]"; print "\n</td></tr>"; // print "\n<tr><td>"; // print _("isPopulatedByRepository? "); // print "\n</td><td>"; // print "[[populatedbydr]]"; // print "\n</td></tr>"; print "\n<tr><td>"; print _("Authoritative Values: "); print "\n</td><td>"; print "[[authoritative_values]]"; print "\n</td></tr>"; print "</table>"; $multField->setElementLayout(ob_get_contents()); ob_end_clean(); ob_start(); print "<h2>" . _("Fields") . "</h2>"; print "\n<p>" . _("Here you can modify the properties of fields and add new fields to the schema.") . "</p>"; print "\n<p>" . _("<strong>Important:</strong> Properties marked with an asterisk (<span style='color: red'>*</span>) can not be changed after the field is created.") . "</p>"; print "[[elements]]"; $elementStep->setContent(ob_get_contents()); ob_end_clean(); return $wizard; }
/** * Virtual Constructor * @param integer $rows * @param integer $cols * @access public * @return ref object * @static */ public static function withRowsAndColumns($rows, $cols, $class = 'HtmlTextArea') { return parent::withRowsAndColumns($rows, $cols, $class); }
/** * Create a new Wizard for this action. Caching of this Wizard is handled by * {@link getWizard()} and does not need to be implemented here. * * @return object Wizard * @access public * @since 4/28/05 */ function createWizard() { // Instantiate the wizard, then add our steps. $wizard = SimpleStepWizard::withDefaultLayout(); // :: Step One :: $stepOne = $wizard->addStep("namedesc", new WizardStep()); $stepOne->setDisplayName(_("Name & Description")); // Create the properties. $displayNameProp = $stepOne->addComponent("display_name", new WTextField()); $displayNameProp->setErrorText(_("A value for this field is required.")); $displayNameProp->setErrorRule(new WECNonZeroRegex("[\\w]+")); $descriptionProp = $stepOne->addComponent("description", WTextArea::withRowsAndColumns(10, 80)); // Create the step text ob_start(); print "\n<h2>" . _("Name") . "</h2>"; print "\n" . _("The Name for this <em>Collection</em>: "); print "\n<br />[[display_name]]"; print "\n<h2>" . _("Description") . "</h2>"; print "\n" . _("The Description for this <em>Collection</em>: "); print "\n<br />[[description]]"; print "\n<div style='width: 400px'> </div>"; $stepOne->setContent(ob_get_contents()); ob_end_clean(); // :: Step Two :: $stepTwo = $wizard->addStep("type", new WizardStep()); $stepTwo->setDisplayName(_("Type")); // Create the properties. $property = $stepTwo->addComponent("type_domain", new WTextField()); $property->setValue(_("Collections")); $property->setErrorRule(new WECNonZeroRegex("[\\w]+")); $property->setErrorText(_("A value for this field is required.")); $property = $stepTwo->addComponent("type_authority", new WTextField()); $property->setValue(_("Concerto")); $property->setErrorRule(new WECNonZeroRegex("[\\w]+")); $property->setErrorText(_("A value for this field is required.")); $property = $stepTwo->addComponent("type_keyword", new WTextField()); $property->setValue(_("Generic Collection")); $property->setErrorRule(new WECNonZeroRegex("[\\w]+")); $property->setErrorText(_("A value for this field is required.")); $property = $stepTwo->addComponent("type_description", WTextArea::withRowsAndColumns(3, 50)); $property->setValue(_("This is a <em>Collection</em> of unspecified type.")); // create the text ob_start(); print "<h2>" . _("Type") . "</h2>"; print "\n" . _("All <em>Collections</em> have an immutable type. This type can be used to catagorize <em>Collections</em>, but is not necessary."); print "\n<table>"; print "\n\t<tr>\n\t\t<td>"; print "<strong>" . _("Domain") . ": </strong>"; print "\n\t\t</td>"; print "\n\t\t<td>"; print "\n[[type_domain]]"; print "\n\t\t</td>\n\t</tr>"; print "\n\t<tr>\n\t\t<td>"; print "<strong>" . _("Authority") . ": </strong>"; print "\n\t\t</td>"; print "\n\t\t<td>"; print "\n[[type_authority]]"; print "\n\t\t</td>\n\t</tr>"; print "\n\t<tr>\n\t\t<td>"; print "<strong>" . _("Keyword") . ": </strong>"; print "\n\t\t</td>"; print "\n\t\t<td>"; print "\n[[type_keyword]]"; print "\n\t\t</td>\n\t</tr>"; print "\n\t<tr>\n\t\t<td>"; print "<strong>" . _("Description") . ": </strong>"; print "\n\t\t</td>"; print "\n\t\t<td>"; print "\n[[type_description]]"; print "\n\t\t</td>\n\t</tr>"; print "\n</table>"; $stepTwo->setContent(ob_get_contents()); ob_end_clean(); 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. * * @return object Wizard * @access public * @since 4/28/05 */ function createWizard() { $idManager = Services::getService("Id"); $setManager = Services::getService("Sets"); $repositoryManager = Services::getService("Repository"); $repository = $repositoryManager->getRepository($idManager->getId("edu.middlebury.concerto.exhibition_repository")); $slideshowAsset = $repository->getAsset($idManager->getId(RequestContext::value('slideshow_id'))); // Instantiate the wizard, then add our steps. // fetch current slideshow slides HERE!!! $wizard = SimpleStepWizard::withDefaultLayout(); // :: Name and Description :: $step = $wizard->addStep("namedescstep", new WizardStep()); $step->setDisplayName(_("Title & Description")); // Create the properties. $displayNameProp = $step->addComponent("display_name", new WTextField()); $displayNameProp->setValue($slideshowAsset->getDisplayName()); $displayNameProp->setErrorText("<nobr>" . _("A value for this field is required.") . "</nobr>"); $displayNameProp->setErrorRule(new WECNonZeroRegex("[\\w]+")); // $displayNameProp->setDefaultValue(_("Default Asset Name")); // $displayNameProp->setErrorString(" <span style='color: #f00'>* "._("The name must not start with a space.")."</span>"); $descriptionProp = $step->addComponent("description", WTextArea::withRowsAndColumns(5, 30)); $descriptionProp->setValue($slideshowAsset->getDescription()); // $descriptionProp->setDefaultValue(_("Default Asset description.")); // Create the step text ob_start(); print "\n<h2>" . _("Title") . "</h2>"; print "\n" . _("The title of this <em>SlideShow</em>: "); print "\n<br />[[display_name]]"; print "\n<h2>" . _("Description") . "</h2>"; print "\n" . _("A description of this <em>SlideShow</em>: "); print "\n<br />[[description]]"; print "\n<div style='width: 400px'> </div>"; $step->setContent(ob_get_contents()); ob_end_clean(); // :: Slides :: $slideStep = $wizard->addStep("slidestep", new WizardStep()); $slideStep->setDisplayName(_("Slides")); $multField = $slideStep->addComponent("slides", new SlideOrderedRepeatableComponentCollection()); $multField->setStartingNumber(0); $multField->setRemoveLabel(_("Remove Slide")); $property = $multField->addComponent("slideId", new AssetComponent()); $property->setParent($multField); $property = $multField->addComponent("title", new WTextField()); $property->setSize(20); $property = $multField->addComponent("caption", WTextArea::withRowsAndColumns(5, 30)); $property = $multField->addComponent("text_position", new WSelectList()); $property->setValue("right"); $property->addOption("right", _("text on right")); $property->addOption("left", _("text on left")); $property->addOption("bottom", _("text on bottom")); $property->addOption("top", _("text on top")); $property->addOption("none", _("no text (media-only)")); $property->addOption("center", _("text centered (no-media)")); $property = $multField->addComponent("show_target_metadata", new WCheckBox()); $property->setChecked(false); $property->setLabel(_("Display metadata from media?")); ob_start(); print "\n<table border=\"0\">"; print "\n<tr><td>"; print _("Title") . ": "; print "\n</td><td>"; print "[[title]]"; print "\n</td></tr>"; print "\n<tr><td>"; print _("Caption") . ": "; print "\n</td><td>"; print "[[caption]]"; print "\n</td></tr>"; print "\n<tr><td>"; print _("Text Position") . ": "; print "\n</td><td>"; print "[[text_position]]"; print "\n</td></tr>"; print "\n<tr><td>"; print "[[show_target_metadata]]"; print "\n</td><td>"; print "\n</td></tr>"; print "</table>"; $multField->setElementLayout(ob_get_contents()); ob_end_clean(); ob_start(); print "<h2>" . _("Slides") . "</h2>"; print "[[slides]]"; $slideStep->setContent(ob_get_contents()); ob_end_clean(); // Add the current assets to the list. $textPositionId = $idManager->getId("Repository::edu.middlebury.concerto.exhibition_repository::edu.middlebury.concerto.slide_record_structure.edu.middlebury.concerto.slide_record_structure.text_position"); $showMetadataId = $idManager->getId("Repository::edu.middlebury.concerto.exhibition_repository::edu.middlebury.concerto.slide_record_structure.edu.middlebury.concerto.slide_record_structure.display_metadata"); $targetId = $idManager->getId("Repository::edu.middlebury.concerto.exhibition_repository::edu.middlebury.concerto.slide_record_structure.edu.middlebury.concerto.slide_record_structure.target_id"); $slideIterator = $slideshowAsset->getAssets(); $slideOrder = $setManager->getPersistentSet($slideshowAsset->getId()); $orderedSlides = array(); $orderlessSlides = array(); while ($slideIterator->hasNext()) { $slideAsset = $slideIterator->next(); $slideId = $slideAsset->getId(); /* // DEBUG $records =$slideAsset->getRecordsByRecordStructure($idManager->getId("Repository::edu.middlebury.concerto.exhibition_repository::edu.middlebury.concerto.slide_record_structure")); $myCrapRecord =$records->next(); require_once(POLYPHONY."/main/library/DataManagerGUI/SimpleRecordPrinter.class.php"); SimpleRecordPrinter::printRecord($myCrapRecord->_record); // END */ $collection = array(); $collection['slideId'] = $slideId; //->getIdString(); $collection['title'] = $slideAsset->getDisplayName(); $collection['caption'] = $slideAsset->getDescription(); $textPositionIterator = $slideAsset->getPartValuesByPartStructure($textPositionId); if ($textPositionIterator->hasNext()) { $textPosition = $textPositionIterator->next(); $collection['text_position'] = $textPosition->asString(); } else { $collection['text_position'] = "right"; } $showMetadataIterator = $slideAsset->getPartValuesByPartStructure($showMetadataId); if ($showMetadataIterator->hasNext()) { $showMetadata = $showMetadataIterator->next(); $collection['show_target_metadata'] = $showMetadata->value(); } else { $collection['show_target_metadata'] = FALSE; } $assetIdIterator = $slideAsset->getPartValuesByPartStructure($targetId); if ($assetIdIterator->hasNext()) { $id = $assetIdIterator->next(); $rule = NonzeroLengthStringValidatorRule::getRule(); if ($rule->check($id->asString())) { $collection['_assetId'] = new HarmoniId($id->asString()); } } if ($slideOrder->isInSet($slideId)) { $orderedSlides[$slideOrder->getPosition($slideId)] = $collection; } else { $orderlessSlides[] = $collection; } } // add them in order ksort($orderedSlides); foreach ($orderedSlides as $slide) { $multField->addValueCollection($slide); } foreach ($orderlessSlides as $slide) { $multField->addValueCollection($slide); } // :: Effective/Expiration Dates :: // $step =$wizard->addStep("datestep", new WizardStep()); // $step->setDisplayName(_("Effective Dates")." ("._("optional").")"); // // // Create the properties. // $property =$step->addComponent("effective_date", new WTextField()); // // $property->setDefaultValue(); // // $property->setErrorString(" <span style='color: #f00'>* "._("The date must be of the form YYYYMMDD, YYYYMM, or YYYY.")."</span>"); // // $property =$step->addComponent("expiration_date", new WTextField()); // // $property->setDefaultValue(); // // $property->setErrorString(" <span style='color: #f00'>* "._("The date must be of the form YYYYMMDD, YYYYMM, or YYYY.")."</span>"); // // // Create the step text // ob_start(); // print "\n<h2>"._("Effective Date")."</h2>"; // print "\n". // _("The date that this <em>Slide-Show</em> becomes effective: "); // print "\n<br />[[effective_date]]"; // // print "\n<h2>"._("Expiration Date")."</h2>"; // print "\n"._("The date that this <em>Slide-Show</em> expires: "); // print "\n<br />[[expiration_date]]"; // $step->setContent(ob_get_contents()); // ob_end_clean(); return $wizard; }
/** * Create the step for adding the title and description * * @return object WizardStep * @access public * @since 5/8/07 */ function getTitleStep() { $component = $this->getSiteComponent(); $step = new WizardStep(); $step->setDisplayName(_("Title & Description")); // Create the step text ob_start(); $property = $step->addComponent("display_name", new WTextField()); $property->setSize(80); if ($component) { $property->setValue($component->getDisplayName()); } $property->setErrorText(_("A value for this field is required.")); $property->setErrorRule(new WECNonZeroRegex("[\\w]+")); print "\n<p><strong>" . _("Title:") . "</strong>"; // print "\n"._("The title of content: "); print "\n<br />[[display_name]]</p>"; $property = $step->addComponent("description", WTextArea::withRowsAndColumns(4, 80)); if ($component) { $property->setValue($component->getDescription()); } print "\n<p><strong>" . _("Description:") . "</strong>"; // print "\n"._("The Description for this content: "); print "\n<br/>[[description]]"; print "</p>"; $step->setContent(ob_get_contents()); ob_end_clean(); return $step; }
/** * Create a new Wizard for this action. Caching of this Wizard is handled by * {@link getWizard()} and does not need to be implemented here. * * @return object Wizard * @access public * @since 4/28/05 */ function createWizard() { $harmoni = Harmoni::instance(); //$courseManager = Services::getService("CourseManagement"); //$canonicalCourseIterator =$courseManager->getCanonicalCourses(); // Instantiate the wizard, then add our steps. $wizard = SimpleStepWizard::withDefaultLayout(); // :: Name and Description :: $step = $wizard->addStep("namedescstep", new WizardStep()); $step->setDisplayName(_("Please choose the name and type for this type:")); // Create the type chooser. $select = new WSelectList(); //$select->addOption('',"Canonical Course Type"); $select->addOption('can', "Canonical Course Type"); $select->addOption('can_stat', "Canonical Course Status Type"); $select->addOption('offer', "Course Offering Type"); $select->addOption('offer_stat', "Course Offering Status Type"); $select->addOption('section', "Course Section Type"); $select->addOption('section_stat', "Course Section Status Type"); $select->addOption('enroll_stat', "Enrollment Status Type"); $select->addOption('grade', "Course Grading Type"); $select->addOption('term', "Term Type"); //$select->setValue(''); $typeProp = $step->addComponent("typetype", $select); //$typeProp->setErrorText("<nobr>"._("A value for this field is required.")."</nobr>"); //$typeProp->setErrorRule(new WECNonZeroRegex("[\\w]+")); // Create the title $titleProp = $step->addComponent("keyword", new WTextField()); $titleProp->setErrorText("<nobr>" . _("A value for this field is required.") . "</nobr>"); $titleProp->setErrorRule(new WECNonZeroRegex("[\\w]+")); // Create the description $descriptionProp = $step->addComponent("description", WTextArea::withRowsAndColumns(10, 30)); // Create the step text ob_start(); print "\n<font size=+2><h2>" . _("Type creator") . "</h2></font>"; print "\n<h2>" . _("Type") . "</h2>"; print "\n" . _("Please choose a type of <em>type</em> to create: "); print "\n<br />[[typetype]]"; print "\n<h2>" . _("Keyword") . "</h2>"; print "\n" . _("The keyword of the <em>type</em>: "); print "\n<br />[[keyword]]"; print "\n<h2>" . _("Description") . "</h2>"; print "\n" . _("The optional description of the <em>type</em>: "); print "\n<br />[[description]]"; print "\n<div style='width: 400px'> </div>"; $step->setContent(ob_get_contents()); ob_end_clean(); 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. * * @return object Wizard * @access public * @since 4/28/05 */ function createWizard() { $idManager = Services::getService("Id"); $repositoryManager = Services::getService("Repository"); $repository = $repositoryManager->getRepository($idManager->getId("edu.middlebury.segue.sites_repository")); // Instantiate the wizard, then add our steps. $wizard = RequiredStepWizard::withDefaultLayout(); // :: Name and Description :: $step = $wizard->addStep("namedescstep", new WizardStep()); $step->setDisplayName(_("Name & Description")); // Create the properties. $displayNameProp = $step->addComponent("display_name", new WTextField()); $displayNameProp->setErrorText("<span style='white-space: nowrap'>" . _("A value for this field is required.") . "</span>"); $displayNameProp->setErrorRule(new WECNonZeroRegex("[\\w]+")); $displayNameProp->setSize(80); $descriptionProp = $step->addComponent("description", WTextArea::withRowsAndColumns(5, 80)); // $descriptionProp->setDefaultValue(_("Default Asset description.")); // Create the step text ob_start(); print "\n<h2>" . _("Name") . "</h2>"; print "\n" . _("The Name for this <em>Site</em>: "); print "\n<br />[[display_name]]"; print "\n<h2>" . _("Description") . "</h2>"; print "\n" . _("The Description for this <em>Site</em>: "); print "\n<br />[[description]]"; print "\n<div style='width: 400px'> </div>"; $step->setContent(ob_get_contents()); ob_end_clean(); // Roles Step. $this->addRolesStep($wizard); // Template $this->addTemplateStep($wizard); // Theme $wizard->addStep("theme", $this->getThemeStep()); $wizard->makeStepRequired('theme'); 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. * * @return object Wizard * @access public * @since 4/28/05 */ function createWizard() { $repository = $this->getRepository(); $repositoryId = $this->getRepositoryId(); $harmoni = Harmoni::instance(); $idManager = Services::getService("Id"); $authZManager = Services::getService("AuthZ"); $returnUrl = $harmoni->request->mkURLWithPassthrough(); $returnUrl->setValue("wizardSkipToStep", "schema"); // Instantiate the wizard, then add our steps. $wizard = SimpleStepWizard::withDefaultLayout(); // :: Step One :: $stepOne = $wizard->addStep("namedesc", new WizardStep()); $stepOne->setDisplayName(_("Name & Description")); // Create the step text ob_start(); $displayNameProp = $stepOne->addComponent("display_name", new WTextField()); $displayNameProp->setValue($repository->getDisplayName()); $displayNameProp->setErrorText(_("A value for this field is required.")); $displayNameProp->setErrorRule(new WECNonZeroRegex("[\\w]+")); print "\n<h2>" . _("Name") . "</h2>"; print "\n" . _("The Name for this <em>Collection</em>: "); print "\n<br />[[display_name]]"; $fieldname = RequestContext::name('description'); $descriptionProp = $stepOne->addComponent("description", WTextArea::withRowsAndColumns(10, 80)); $descriptionProp->setValue($repository->getDescription()); print "\n<h2>" . _("Description") . "</h2>"; print "\n" . _("The Description for this <em>Collection</em>: "); print "\n<br />[[description]]"; print "\n<div style='width: 400px'> </div>"; $stepOne->setContent(ob_get_contents()); ob_end_clean(); // :: Schema Selection :: $selectStep = $wizard->addStep("schema", new WizardStep()); $selectStep->setDisplayName(_("Schema Selection")); // get an iterator of all RecordStructures $recordStructures = $repository->getRecordStructures(); $setManager = Services::getService("Sets"); $set = $setManager->getPersistentSet($repositoryId); ob_start(); print "<h2>" . _("Select Cataloging Schemas") . "</h2>"; print "\n<p>" . _("Select which cataloging schemas you wish to appear during <em>Asset</em> creation and editing. <em>Assets</em> can hold data in any of the schemas, but only the ones selected here will be available when adding new data.") . "</p>"; if ($authZManager->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify_rec_struct"), $repositoryId)) { $fieldname = RequestContext::name('create_schema'); $button = $selectStep->addComponent("_create_schema", WSaveButton::withLabel(_("Save Changes and Create a New Schema"))); print "\n<p>" . _("If none of the schemas listed below fit your needs, please click the button below to save your changes and create a new schema.") . "</p>"; print "\n[[_create_schema]]"; } print "\n<br /><table border='1'>"; print "\n\t<tr>"; print "\n\t<th>" . _("Display Name") . "</th>"; print "\n\t<th>" . _("Description") . "</th>"; print "\n\t<th>" . _("Order/Position") . "</th>"; print "\n\t</tr>"; // Get the number of info structures $numRecordStructures = 0; while ($recordStructures->hasNext()) { $recordStructure = $recordStructures->next(); $numRecordStructures++; } $assetContentStructureId = $idManager->getId("edu.middlebury.harmoni.repository.asset_content"); $recordStructures = $repository->getRecordStructures(); while ($recordStructures->hasNext()) { $recordStructure = $recordStructures->next(); $recordStructureId = $recordStructure->getId(); // Don't list the asset Content structure. if ($recordStructureId->isEqual($assetContentStructureId)) { continue; } // Create the properties. // 'in set' property $fieldname = "schema_" . str_replace(".", "__", $recordStructureId->getIdString()); $property = $selectStep->addComponent($fieldname, new WCheckBox()); if ($set->isInSet($recordStructureId)) { $property->setChecked(true); } else { $property->setChecked(false); } $property->setLabel($recordStructure->getDisplayName()); $property->setStyle("font-weight: 900;"); // Order property $orderFieldName = $fieldname . "_position"; $property = $selectStep->addComponent($orderFieldName, new WSelectList()); if ($set->isInSet($recordStructureId)) { $property->setValue(strval($set->getPosition($recordStructureId) + 1)); } else { $property->setValue(0); } print "\n<tr><td valign='top'>"; print "\n\t[[{$fieldname}]]"; // print "\n\t<strong>".a."</strong>"; $description = HtmlString::withValue($recordStructure->getDescription()); $description->trim(100); // trim to 100 words print "\n</td><td valign='top'>\n\t<div style='font-style: italic'>" . $description->asString() . "</div>"; $harmoni->history->markReturnURL("concerto/collection/edit/" . $repositoryId->getIdString(), $returnUrl); $links = array(); // Schema Details ob_start(); print " <a href='"; print $harmoni->request->quickURL("schema", "view", array("collection_id" => $repositoryId->getIdString(), "recordstructure_id" => $recordStructureId->getIdString(), "__skip_to_step" => 2)); print "'>" . _("Details") . "</a>"; $links[] = ob_get_clean(); // Schema Edit if (method_exists($recordStructure, 'createPartStructure') && (preg_match("/^Repository::.+\$/i", $recordStructureId->getIdString()) && ($authZManager->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify_rec_struct"), $repositoryId) || $authZManager->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify_authority_list"), $repositoryId)) || ($authZManager->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify_rec_struct"), $idManager->getId("edu.middlebury.authorization.root")) || $authZManager->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify_authority_list"), $repositoryId)))) { $harmoni->history->markReturnURL("concerto/schema/edit-return/" . $recordStructureId->getIdString(), $returnUrl); ob_start(); print "<a href='"; print $harmoni->request->quickURL("schema", "edit", array("collection_id" => $repositoryId->getIdString(), "recordstructure_id" => $recordStructureId->getIdString())); print "'>" . _("Edit") . "</a>"; $links[] = ob_get_clean(); } // Schema Copy $authZManager = Services::getService("AuthZ"); $idManager = Services::getService("Id"); if (method_exists($recordStructure, 'createPartStructure') && (preg_match("/^Repository::.+\$/i", $recordStructureId->getIdString()) && $authZManager->isUserAuthorized($idManager->getId("edu.middlebury.authorization.convert_rec_struct"), $repositoryId) || $authZManager->isUserAuthorized($idManager->getId("edu.middlebury.authorization.convert_rec_struct"), $idManager->getId("edu.middlebury.authorization.root")))) { $button = $selectStep->addComponent("duplicate_schema__" . str_replace('.', '_', $recordStructureId->getIdString()), WSaveButton::withLabel(_("Duplicate Schema Only"))); $button->addConfirm(_("Are you sure that you wish to duplicate this Schema?")); $links[] = "[[duplicate_schema__" . str_replace('.', '_', $recordStructureId->getIdString()) . "]]"; if ($authZManager->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify"), $repositoryId)) { $button = $selectStep->addComponent("duplicate_copy_records__" . str_replace('.', '_', $recordStructureId->getIdString()), WSaveButton::withLabel(_("Duplicate Schema and Records"))); $button->addConfirm(_("Are you sure that you wish to duplicate this Schema\\nand all Records that use it?")); $links[] = "[[duplicate_copy_records__" . str_replace('.', '_', $recordStructureId->getIdString()) . "]]"; } $harmoni->history->markReturnURL("concerto/schema/duplicate-return/" . $recordStructureId->getIdString(), $returnUrl); } // Schema Delete $authZManager = Services::getService("AuthZ"); $idManager = Services::getService("Id"); if (method_exists($recordStructure, 'createPartStructure') && (preg_match("/^Repository::.+\$/i", $recordStructureId->getIdString()) && $authZManager->isUserAuthorized($idManager->getId("edu.middlebury.authorization.delete_rec_struct"), $repositoryId) || $authZManager->isUserAuthorized($idManager->getId("edu.middlebury.authorization.delete_rec_struct"), $idManager->getId("edu.middlebury.authorization.root")))) { $button = $selectStep->addComponent("_delete_schema__" . str_replace('.', '_', $recordStructureId->getIdString()), WSaveButton::withLabel(_("Delete"))); $button->addConfirm(_("Are you sure that you wish to delete this Schema\\nand Records in all Assets in this Collection that use it?")); $button->addConfirm(_("This Schema can only be deleted if there are no Records\\nin any other Collection that use it.\\n\\nAre you sure that there are no Records that use this Schema?\\n\\nContinue to delete?")); $harmoni->history->markReturnURL("concerto/schema/delete-return/" . $recordStructureId->getIdString(), $returnUrl); $links[] = "[[_delete_schema__" . str_replace('.', '_', $recordStructureId->getIdString()) . "]]"; } print implode(" | ", $links); print "\n</td><td valign='top'>"; print "\n\t[[{$orderFieldName}]]"; for ($i = 0; $i <= $numRecordStructures; $i++) { // print "\n\t\t<option value='$i' [['$orderFieldname' == '$i'|selected='selected'|]]>".(($i)?$i:"")."</option>"; $property->addOption($i, $i ? $i : ""); } print "\n</td></tr>"; } print "\n</table>"; $selectStep->setContent(ob_get_clean()); 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. * * @return object Wizard * @access public * @since 4/28/05 */ function createWizard() { // Instantiate the wizard, then add our steps. ob_start(); print "<h2>" . _("Create Group") . "</h2>"; print "<b>" . _("Display name") . "</b>: [[display_name]]<br/>"; print "<b>" . _("Description") . " (" . _("optional") . ")" . "</b>: <br/>[[description]] <br/>"; print "<b>" . _("Type") . "</b>: [[type]] (" . _("or use fields below to create a new type") . ")<br/>"; print "<br/>"; print "<b>" . _("Type domain") . "</b>: [[type_domain]]<br/>"; print "<b>" . _("Type authority") . "</b>: [[type_authority]]<br/>"; print "<b>" . _("Type keyword") . "</b>: [[type_keyword]]<br/>"; print "<b>" . _("Type description") . "</b>:<br/> [[type_description]]<br/>"; print "<div align='right'>[[_cancel]]\n[[_save]]</div>"; print "[[members]]"; if (RequestContext::value("agents") && count($list = unserialize(RequestContext::value("agents"))) > 0 && is_array($list)) { // print out a list of agents print "<div>" . _("The group will be created with the following members:") . "<ul>\n"; $agentManager = Services::getService("Agent"); $idManager = Services::getService("Id"); foreach ($list as $idString) { $id = $idManager->getId($idString); if ($agentManager->isGroup($id)) { $agent = $agentManager->getGroup($id); $name = _("Group") . ": " . $agent->getDisplayName(); } else { if ($agentManager->isAgent($id)) { $agent = $agentManager->getAgent($id); $name = _("Agent") . ": " . $agent->getDisplayName(); } } print "<li>{$name}</li>\n"; } print "</ul></div>"; } $wizard = SimpleWizard::withText(ob_get_contents()); ob_end_clean(); // Create the properties. $displayNameProp = $wizard->addComponent("display_name", new WTextField()); $displayNameProp->setErrorText(_("A value for this field is required.")); $displayNameProp->setErrorRule(new WECNonZeroRegex("[\\w]+")); $descriptionProp = $wizard->addComponent("description", WTextArea::withRowsAndColumns(3, 50)); $property = $wizard->addComponent("type", new WSelectList()); $property->addOption("NONE", _("Use Fields Below...")); $agentMgr = Services::getService("Agent"); $types = $agentMgr->getGroupTypes(); while ($types->hasNext()) { $type = $types->next(); $typeKey = urlencode(HarmoniType::typeToString($type)); $property->addOption($typeKey, HarmoniType::typeToString($type)); } $property->setValue("NONE"); $property = $wizard->addComponent("type_domain", new WTextField()); $property->setStartingDisplayText(_("Domain, i.e. 'groups'")); $property = $wizard->addComponent("type_authority", new WTextField()); $property->setStartingDisplayText(_("Authority, i.e. 'edu.middlebury'")); $property = $wizard->addComponent("type_keyword", new WTextField()); $property->setStartingDisplayText(_("Keyword, i.e 'classes")); $property = $wizard->addComponent("type_description", WTextArea::withRowsAndColumns(3, 50)); $wizard->addComponent("_save", WSaveButton::withLabel(_("Create Group"))); $wizard->addComponent("_cancel", new WCancelButton()); $members = $wizard->addComponent("members", new WHiddenField()); if (RequestContext::value("agents")) { // the members of the group to be created. an array of agent ids $members->setValue(RequestContext::value("agents")); } 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. * * @return object Wizard * @access public * @since 4/28/05 */ function createWizard() { $harmoni = Harmoni::instance(); $idManager = Services::getService("Id"); $repositoryManager = Services::getService("Repository"); $repository = $repositoryManager->getRepository($idManager->getId("edu.middlebury.concerto.exhibition_repository")); $exhibitionAsset = $repository->getAsset($idManager->getId(RequestContext::value('exhibition_id'))); // Instantiate the wizard, then add our steps. $wizard = SimpleStepWizard::withDefaultLayout(); // :: Name and Description :: $step = $wizard->addStep("namedescstep", new WizardStep()); $step->setDisplayName(_("Title & Description")); // Create the properties. $displayNameProp = $step->addComponent("display_name", new WTextField()); $displayNameProp->setErrorText("<nobr>" . _("A value for this field is required.") . "</nobr>"); $displayNameProp->setErrorRule(new WECNonZeroRegex("[\\w]+")); // $displayNameProp->setDefaultValue(_("Default Asset Name")); // $displayNameProp->setErrorString(" <span style='color: #f00'>* "._("The name must not start with a space.")."</span>"); $descriptionProp = $step->addComponent("description", WTextArea::withRowsAndColumns(5, 30)); // $descriptionProp->setDefaultValue(_("Default Asset description.")); // Create the step text ob_start(); print "\n<h2>" . _("Title") . "</h2>"; print "\n" . _("The title of this <em>SlideShow</em>: "); print "\n<br />[[display_name]]"; print "\n<h2>" . _("Description") . "</h2>"; print "\n" . _("A description of this <em>SlideShow</em>: "); print "\n<br />[[description]]"; print "\n<div style='width: 400px'> </div>"; $step->setContent(ob_get_contents()); ob_end_clean(); // :: Slides :: $slideStep = $wizard->addStep("slidestep", new WizardStep()); $slideStep->setDisplayName(_("Slides")); $multField = $slideStep->addComponent("slides", new SlideOrderedRepeatableComponentCollection()); $multField->setStartingNumber(0); $multField->setRemoveLabel(_("Remove Slide")); $property = $multField->addComponent("title", new WTextField()); $property->setSize(20); $property = $multField->addComponent("caption", WTextArea::withRowsAndColumns(5, 30)); $property = $multField->addComponent("text_position", new WSelectList()); $property->setValue("right"); $property->addOption("right", _("text on right")); $property->addOption("left", _("text on left")); $property->addOption("bottom", _("text on bottom")); $property->addOption("top", _("text on top")); $property->addOption("none", _("no text (media-only)")); $property->addOption("center", _("text centered (no-media)")); $property = $multField->addComponent("show_target_metadata", new WCheckBox()); $property->setChecked(false); $property->setLabel(_("Display metadata from media?")); ob_start(); print "\n<table border=\"0\">"; print "\n<tr><td>"; print _("Title") . ": "; print "\n</td><td>"; print "[[title]]"; print "\n</td></tr>"; print "\n<tr><td>"; print _("Caption") . ": "; print "\n</td><td>"; print "[[caption]]"; print "\n</td></tr>"; print "\n<tr><td>"; print _("Text Position") . ": "; print "\n</td><td>"; print "[[text_position]]"; print "\n</td></tr>"; print "\n<tr><td>"; print "[[show_target_metadata]]"; print "\n</td><td>"; print "\n</td></tr>"; print "</table>"; $multField->setElementLayout(ob_get_contents()); ob_end_clean(); ob_start(); print "<h2>" . _("Slides") . "</h2>"; print "[[slides]]"; $slideStep->setContent(ob_get_contents()); ob_end_clean(); // :: Effective/Expiration Dates :: // $step =$wizard->addStep("datestep", new WizardStep()); // $step->setDisplayName(_("Effective Dates")." ("._("optional").")"); // // // Create the properties. // $property =$step->addComponent("effective_date", new WTextField()); // // $property->setDefaultValue(); // // $property->setErrorString(" <span style='color: #f00'>* "._("The date must be of the form YYYYMMDD, YYYYMM, or YYYY.")."</span>"); // // $property =$step->addComponent("expiration_date", new WTextField()); // // $property->setDefaultValue(); // // $property->setErrorString(" <span style='color: #f00'>* "._("The date must be of the form YYYYMMDD, YYYYMM, or YYYY.")."</span>"); // // // Create the step text // ob_start(); // print "\n<h2>"._("Effective Date")."</h2>"; // print "\n"._("The date that this <em>Slide-Show</em> becomes effective: "); // print "\n<br />[[effective_date]]"; // // print "\n<h2>"._("Expiration Date")."</h2>"; // print "\n"._("The date that this <em>Slide-Show</em> expires: "); // print "\n<br />[[expiration_date]]"; // $step->setContent(ob_get_contents()); // ob_end_clean(); 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. * * @return object Wizard * @access public * @since 4/28/05 */ function createWizard() { $repository = $this->getRepository(); // Instantiate the wizard, then add our steps. $wizard = SimpleStepWizard::withDefaultLayout(); // :: Name and Description :: $step = $wizard->addStep("namedescstep", new WizardStep()); $step->setDisplayName(_("Name & Description")); // Create the properties. $displayNameProp = $step->addComponent("display_name", new WTextField()); // $displayNameProp->setErrorText("<nobr>"._("A value for this field is required.")."</nobr>"); // $displayNameProp->setErrorRule(new WECNonZeroRegex("[\\w]+")); // $displayNameProp->setDefaultValue(_("Default Asset Name")); // $displayNameProp->setErrorString(" <span style='color: #f00'>* "._("The name must not start with a space.")."</span>"); $descriptionProp = $step->addComponent("description", WTextArea::withRowsAndColumns(5, 30)); // $descriptionProp->setDefaultValue(_("Default Asset description.")); // Create the step text ob_start(); print "\n<h2>" . _("Name") . "</h2>"; print "\n" . _("The Name for this <em>Asset</em>: "); print "\n<br />[[display_name]]"; print "\n<h2>" . _("Description") . "</h2>"; print "\n" . _("The Description for this <em>Asset</em>: "); print "\n<br />[[description]]"; print "\n<div style='width: 400px'> </div>"; $step->setContent(ob_get_contents()); ob_end_clean(); // :: Type Step :: $step = $wizard->addStep("typestep", new WizardStep()); $step->setDisplayName(_("Type" . " (" . _("optional") . ")")); // Create the properties. $selectProperty = $step->addComponent("type", new WSelectOrNew()); // Default Types $defaultTypes = array(); $defaultTypes[] = new Type("Asset Types", "edu.middlebury", "Generic Asset", "This is an <em>Asset</em> of unspecified type."); $defaultTypes[] = new Type("Asset Types", "edu.middlebury", "Image", "Assets of this type represent an image."); $defaultTypes[] = new Type("Asset Types", "edu.middlebury", "Document", "Assets of this type represent an non-image document."); $defaultTypes[] = new Type("Asset Types", "edu.middlebury", "Audio", "Assets of this type represent an audio recording."); $defaultTypes[] = new Type("Asset Types", "edu.middlebury", "Video", "Assets of this type represent an video recording."); $defaultTypes[] = new Type("Asset Types", "edu.middlebury", "Container", "Assets of this type primarily serve as containers to hold other Assets, possibly for organizational purposes. Similar to a 'folder' or 'directory' on a filesystem."); foreach ($defaultTypes as $type) { $typeString = $type->asString(); $typeKey = urlencode($typeString); $selectProperty->addOption($typeKey, $typeString); } // Types in the repository $assetTypes = $repository->getAssetTypes(); while ($assetTypes->hasNext()) { $assetType = $assetTypes->next(); $typeKey = urlencode($assetType->asString()); $selectProperty->addOption($typeKey, $assetType->asString()); } $selectProperty->setValue(urlencode($defaultTypes[0]->asString())); $newTypeProperty = $selectProperty->setNewComponent(new WComponentCollection()); $property = $newTypeProperty->addComponent("type_domain", new WTextField()); $property->setStartingDisplayText(_("e.g. Asset Types")); $property = $newTypeProperty->addComponent("type_authority", new WTextField()); $property->setStartingDisplayText(_("e.g. Concerto")); $property = $newTypeProperty->addComponent("type_keyword", new WTextField()); $property->setStartingDisplayText(_("e.g. Generic Asset")); $property = $newTypeProperty->addComponent("type_description", WTextArea::withRowsAndColumns(5, 30)); $property->setStartingDisplayText(_("e.g. This is an <em>Asset</em> of unspecified type.")); // create the text for the new type property. ob_start(); print "\n<table>"; print "\n\t<tr>\n\t\t<td>"; print "<strong>" . _("Domain") . ": </strong>"; print "\n\t\t</td>"; print "\n\t\t<td>"; print "\n[[type_domain]]"; print "\n\t\t</td>\n\t</tr>"; print "\n\t<tr>\n\t\t<td>"; print "<strong>" . _("Authority") . ": </strong>"; print "\n\t\t</td>"; print "\n\t\t<td>"; print "\n[[type_authority]]"; print "\n\t\t</td>\n\t</tr>"; print "\n\t<tr>\n\t\t<td>"; print "<strong>" . _("Keyword") . ": </strong>"; print "\n\t\t</td>"; print "\n\t\t<td>"; print "\n[[type_keyword]]"; print "\n\t\t</td>\n\t</tr>"; print "\n\t<tr>\n\t\t<td>"; print "<strong>" . _("Description") . ": </strong>"; print "\n\t\t</td>"; print "\n\t\t<td>"; print "\n[[type_description]]"; print "\n\t\t</td>\n\t</tr>"; print "\n</table>"; $newTypeProperty->setContent(ob_get_contents()); ob_end_clean(); // create the text for the step ob_start(); print "<h2>" . _("Type") . "</h2>"; print "\n" . _("All <em>Assets</em> have an immutable type. This type can be used to catagorize <em>Assets</em>, but is not necessary."); print "\n<br />" . _("Select a type here or select <em>* New Value *</em> create a new one:"); print "\n[[type]]"; $step->setContent(ob_get_contents()); ob_end_clean(); // // // :: Content :: // $step =$wizard->addStep("contentstep", new WizardStep()); // $step->setDisplayName(_("Content")." ("._("optional").")"); // // $property =$step->addComponent("content", WTextArea::withRowsAndColumns(20,50)); // // // Create the step text // ob_start(); // print "\n<h2>"._("Content")."</h2>"; // print "\n"._("This is an optional place to put content for this <em>Asset</em>. <br />If you would like more structure, you can create new schemas to hold the <em>Asset's</em> data."); // print "\n<br />[[content]]"; // print "\n<div style='width: 400px'> </div>"; // $step->setContent(ob_get_contents()); // ob_end_clean(); // :: Effective/Expiration Dates :: // $step =$wizard->addStep("datestep", new WizardStep()); // $step->setDisplayName(_("Effective Dates")." ("._("optional").")"); // // // Create the properties. // $property =$step->addComponent("effective_date", new WTextField()); // // $property->setDefaultValue(); // // $property->setErrorString(" <span style='color: #f00'>* "._("The date must be of the form YYYYMMDD, YYYYMM, or YYYY.")."</span>"); // // $property =$step->addComponent("expiration_date", new WTextField()); // // $property->setDefaultValue(); // // $property->setErrorString(" <span style='color: #f00'>* "._("The date must be of the form YYYYMMDD, YYYYMM, or YYYY.")."</span>"); // // // Create the step text // ob_start(); // print "\n<h2>"._("Effective Date")."</h2>"; // print "\n"._("The date that this <em>Asset</em> becomes effective: "); // print "\n<br />[[effective_date]]"; // // print "\n<h2>"._("Expiration Date")."</h2>"; // print "\n"._("The date that this <em>Asset</em> expires: "); // print "\n<br />[[expiration_date]]"; // $step->setContent(ob_get_contents()); // ob_end_clean(); // :: Parent :: $step = $wizard->addStep("parentstep", new WizardStep()); $step->setDisplayName(_("Parent") . " (" . _("optional") . ")"); // Create the properties. $property = $step->addComponent("parent", new WSelectList()); $harmoni = Harmoni::instance(); $property->addOption("NONE", _("None")); $rootAssets = $this->getRootAssets(); while ($rootAssets->hasNext()) { $this->addAssetOption($property, $rootAssets->next()); } if (RequestContext::value('parent')) { $property->setValue(RequestContext::value('parent')); } else { $property->setValue("NONE"); } // Create the step text ob_start(); print "\n<h2>" . _("Parent <em>Asset</em>") . "</h2>"; print "\n" . _("Select one of the <em>Assets</em> below if you wish to make this new asset a child of another asset: "); print "\n<br />[[parent]]"; $step->setContent(ob_get_contents()); ob_end_clean(); return $wizard; }