本文整理汇总了PHP中Wizard::makeStepRequired方法的典型用法代码示例。如果您正苦于以下问题:PHP Wizard::makeStepRequired方法的具体用法?PHP Wizard::makeStepRequired怎么用?PHP Wizard::makeStepRequired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wizard
的用法示例。
在下文中一共展示了Wizard::makeStepRequired方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addSiteAdminStep
/**
* Add any additional site admins to a multi-select.
*
* @param object Wizard $wizard
* @return void
* @access protected
* @since 1/28/08
*/
protected function addSiteAdminStep(Wizard $wizard)
{
/*********************************************************
* Owner step if multiple owners
*********************************************************/
$step = new WizardStep();
$step->setDisplayName(_("Choose Admins"));
$property = $step->addComponent("admins", new WMultiCheckList());
$agentMgr = Services::getService("Agent");
$i = 0;
$owners = $this->getOwners();
foreach ($owners as $ownerId) {
$i++;
$owner = $agentMgr->getAgent($ownerId);
$property->addOption($ownerId->getIdString(), htmlspecialchars($owner->getDisplayName()));
$property->setValue($ownerId->getIdString());
}
$property->setSize($i);
// Create the step text
ob_start();
print "\n<h2>" . _("Choose Site Admins") . "</h2>";
print "\n<p>" . _("The following users are listed as owners of this placeholder. Keep them selected if you would like them be administrators of this site or de-select them if they should not be administrators of this site. Any choice made now can be changed later through the 'Permissions' screen for the site.");
print "\n<br />[[admins]]</p>";
print "\n<div style='width: 400px'> </div>";
$step->setContent(ob_get_contents());
ob_end_clean();
if ($i) {
$step = $wizard->addStep("owners", $step);
$wizard->makeStepRequired('owners');
}
}
示例2: addTemplateStep
/**
* Add the Template step to the wizard
*
* @param object Wizard $wizard
* @return void
* @access protected
* @since 6/10/08
*/
protected function addTemplateStep(Wizard $wizard)
{
ob_start();
$step = new WizardStep();
$step->setDisplayName(_("Choose Template"));
print "\n<h2>" . _("Choose Template") . "</h2>";
print "\n<p>" . _("Templates are site 'starting points'. Each template provides you with a different starting set of sections and pages to help you get started. These pages can be renamed or deleted and new pages can always be added.") . "</p>";
$property = $step->addComponent('template', new WRadioList());
$templateMgr = Segue_Templates_TemplateManager::instance();
$templates = $templateMgr->getTemplates();
if (!count($templates)) {
throw new OperationFailedException("No templates available.");
}
$property->setValue($templates[0]->getIdString());
foreach ($templates as $template) {
ob_start();
try {
$thumb = $template->getThumbnail();
$harmoni = Harmoni::instance();
$url = $harmoni->request->quickUrl('templates', 'template_thumbnail', array('template' => $template->getIdString()));
print "\n\t<img src='" . $url . "' style='float: left; width: 200px; margin-right: 10px;' alt='" . _('Template thumbnail') . "' ";
print " onclick=\"";
print "var templatePreview = window.open('{$url}', 'template_preview', 'toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=500'); ";
print "templatePreview.focus();";
print "\" ";
print "/>";
} catch (UnimplementedException $e) {
print "\n\t<div style='font-style: italic'>" . _("Thumbnail not available.") . "</div>";
} catch (OperationFailedException $e) {
// print "\n\t<div style='font-style: italic'>"._("Thumbnail not available.")."</div>";
}
print "\n\t<p>" . $template->getDescription() . "</p>";
print "\n\t<div style='clear: both;'> </div>";
$property->addOption($template->getIdString(), "<strong>" . $template->getDisplayName() . "</strong>", ob_get_clean());
}
print '[[template]]';
$step->setContent(ob_get_contents());
ob_end_clean();
$step = $wizard->addStep("template_step", $step);
$wizard->makeStepRequired('template_step');
}