示例#1
0
 /**
  * Create the wizard
  * 
  * @return object Wizard
  * @access public
  * @since 11/14/07
  */
 public function createWizard()
 {
     // Instantiate the wizard, then add our steps.
     $wizard = SingleStepWizard::withText("<div>\n" . "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n" . "<tr>\n" . "<td align='left' width='50%'>\n" . "[[save_and_choose]]\n" . "<br/>[[cancel_and_choose]]\n" . "</td>\n" . "<td align='right' width='50%'>\n" . "[[_save]]\n" . "<br/>[[_cancel]]\n" . "</td></tr></table>" . "</div>\n" . "<hr/>\n" . "<div>\n" . "[[_steps]]" . "</div>\n");
     $wizard->addComponent("choose_user", new ButtonPressedListener("edu.middlebury.segue.choose_user"));
     $button = $wizard->addComponent("save_and_choose", WSaveButton::withLabel("<< " . _("Save and Choose User")));
     $button->addEvent("edu.middlebury.segue.choose_user");
     $button = $wizard->addComponent("cancel_and_choose", WCancelButton::withLabel("<< " . _("Cancel and Choose User")));
     $button->addEvent("edu.middlebury.segue.choose_user");
     $step = $wizard->addStep("permissions", new WizardStep());
     $step->addComponent("perms_table", $this->getPermissionsMatrix());
     $agent = $this->getAgent();
     if ($agent->isGroup()) {
         $type = _("group");
     } else {
         $type = _("user");
     }
     $title = str_replace("%1", $type, str_replace("%2", $agent->getDisplayName(), _("Roles for %1 '%2'")));
     ob_start();
     print "\n<h2>" . $title . "</h2>";
     print "\n<p>";
     print _("Roles are additive -- this means that you can add additional roles (but not remove them) for child-nodes.");
     print "\n</p>\n";
     print "\n<p>";
     print _("Note: Segue 2 does not currently support role-effective dates.");
     print "\n</p>\n";
     print "\n<p>";
     print _("Tip: Hold down the <em>SHIFT</em> key while clicking to revoke roles from child-nodes.");
     print "\n</p>\n";
     print "[[perms_table]]";
     $step->setContent(ob_get_clean());
     return $wizard;
 }
 /**
  * Virtual constructor for a custom label
  * 
  * @param string $label
  * @return object WSaveButton
  * @access public
  * @static
  * @since 7/27/05
  */
 static function withLabel($label)
 {
     $button = new WCancelButton();
     $button->setLabel($label);
     return $button;
 }