/**
  * Apply the description changes
  * 
  * @param SiteComponent $siteComponent
  * @return void
  * @access public
  * @since 1/16/07
  */
 function applyWidth($siteComponent)
 {
     if (!is_null(RequestContext::value('width')) && RequestContext::value('width') !== $siteComponent->getWidth()) {
         if (preg_match('/([0-9]+)\\s*(px|%|em)/i', RequestContext::value('width'), $matches)) {
             $siteComponent->updateWidth($matches[1] . strtolower($matches[2]));
         } else {
             $siteComponent->updateWidth('');
         }
     }
 }
 /**
  * Print width controls
  * 
  * @param SiteComponent $siteComponent
  * @return void
  * @access public
  * @since 4/17/06
  */
 function printWidth($siteComponent, $step)
 {
     $property = $step->addComponent('width', new WTextField());
     $property->setValue($siteComponent->getWidth());
     $property->setSize(6);
     $property->setErrorRule(new WECRegex("^([0-9]+(px|%))?\$"));
     $property->setErrorText(_("Must be blank or in either pixel or percent form; e.g. '150px', 200px', '100%', '50%', etc."));
     print "<div style='font-weight: bold;'>" . _('Maximum Width Guideline: ');
     print "[[width]]";
     print "</div>";
     print "<div style='font-size: smaller;'>" . _("If desired, enter a width in either pixel or percent form; e.g. '150px', 200px', '100%', '50%', etc.<br/><strong>Note:</strong> This width is a guideline and is not guarenteed to be enforced. Content will fill the page, using this guideline where possible. Content inside of this container may stretch it beyond the specified width.") . "</div>";
 }
Ejemplo n.º 3
0
 /**
  * Print width controls
  * 
  * @param SiteComponent $siteComponent
  * @return void
  * @access public
  * @since 4/17/06
  */
 function printWidth($siteComponent)
 {
     print "\n\t\t\t\t<tr><td class='ui2_settingborder'>";
     print "\n\t\t\t\t<div class='ui2_settingtitle'>";
     print _('Width: ') . "\n\t\t\t\t</div>";
     print "\n\t\t\t\t</td><td  class='ui2_settingborder' colspan='2'>";
     print "<input type='text' size='6' class='ui2_field' ";
     print " name='" . RequestContext::name('width') . "'";
     $authZ = Services::getService("AuthZ");
     $idManager = Services::getService("Id");
     if (!$authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify"), $siteComponent->getQualifierId())) {
         print " readonly='readonly'";
     }
     print " value='" . $siteComponent->getWidth() . "'/>";
     print "\n\t\t\t\t</td></tr>";
     print "\n\t\t\t\t<tr><td colspan='2' style='width: 500px;'>";
     print "<span class='ui2_text_smaller'>";
     print _("If desired, enter a width in either pixel or percent form; e.g. '150px', 200px', '100%', '50%', etc. <strong>Note:</strong> This width is a guideline and is not guarenteed to be enforced. Content will fill the page, using this guideline where possible. Content inside of this container may stretch it beyond the specified width.");
     print "</span>";
     print "\n\t\t\t\t</td></tr>";
 }