Beispiel #1
0
 /**
  * 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 1/28/08
  */
 public function createWizard()
 {
     // Instantiate the wizard, then add our steps.
     $wizard = RequiredStepWizard::withDefaultLayout();
     $step = $wizard->addStep("mode", new WizardStep());
     $step->setDisplayName(_("Import Mode"));
     ob_start();
     $property = $step->addComponent('slotname', new WTextField());
     $property->setValue($this->getSlot()->getShortname());
     $property->setEnabled(false, true);
     print "\n<p>";
     print "\n\t" . _("The site backup file uploaded will be imported into the following placeholder:");
     print "\n\t<br/>[[slotname]]\n</p>";
     $property = $step->addComponent('backup_file', new WFileUploadField());
     $wizard->backupFile = $property;
     // Save a reference for later use.
     print "\n<p>";
     print "\n\t" . _("Please choose a Segue backup file to import:");
     print "\n\t<br/>[[backup_file]]\n</p>";
     $property = $step->addComponent('comments', new WCheckbox());
     $property->setValue(true);
     print "\n<p>[[comments]] ";
     print "\n\t" . _("Import discussions?");
     print "\n\t\n</p>";
     $property = $step->addComponent('roles', new WCheckbox());
     $property->setValue(true);
     print "\n<p>[[roles]] ";
     print "\n\t" . _("Import roles/permissions?");
     print "\n\t\n</p>";
     $property = $step->addComponent('trust', new WSelectList());
     $property->addOption('all', _('Trust both'));
     $property->addOption('time_only', _('Trust timestamps, but not agents'));
     $property->addOption('none', _('Do not trust timestamps or agents'));
     $property->setValue('all');
     print "\n<p>";
     print "\n\t" . _("Trust Level:");
     print "\n\t [[trust]]";
     print "\n\t<br/>";
     print _("This option sets whether or not to trust the agents and timestamps listed in the backup file. If this file may have been maliciously changed to alter the history recorded in it, use one of the lower trust settings to force the agent or timestamp to be those of the current agent/time at the moment of import.");
     print "\n</p>";
     $step->setContent(ob_get_clean());
     // Site Admins.
     $this->addSiteAdminStep($wizard);
     return $wizard;
 }
Beispiel #2
0
 /**
  * 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 &amp; 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'> &nbsp; </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;
 }