예제 #1
0
 /**
  * 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'> &nbsp; </div>";
     $step->setContent(ob_get_contents());
     ob_end_clean();
     if ($i) {
         $step = $wizard->addStep("owners", $step);
         $wizard->makeStepRequired('owners');
     }
 }
예제 #2
0
 /**
  * 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;'> &nbsp; </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');
 }