/** * Print direction controls * * @param SiteComponent $siteComponent * @return void * @access public * @since 4/17/06 */ function printDirection($siteComponent) { print "\n\t\t\t\t<tr><td class='ui2_settingborder'>"; print "\n\t\t\t\t<div class='ui2_settingtitle'>"; print "\n\t\t\t\t\t" . _('Flow: ') . "\n\t\t\t\t</div>"; print "\n\t\t\t\t</td><td class='ui2_settingborder' colspan='2'>"; print "\n\t\t\t\t\t<select class='ui2_field' name='" . RequestContext::name('direction') . "'"; $authZ = Services::getService("AuthZ"); $idManager = Services::getService("Id"); if (!$authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify"), $siteComponent->getQualifierId())) { print " readonly='readonly'"; } print ">"; $directions = array("Left-Right/Top-Bottom" => _("Left-Right/Top-Bottom"), "Top-Bottom/Left-Right" => _("Top-Bottom/Left-Right"), "Right-Left/Top-Bottom" => _("Right-Left/Top-Bottom"), "Top-Bottom/Right-Left" => _("Top-Bottom/Right-Left")); foreach ($directions as $direction => $label) { print "\n\t\t\t\t\t\t<option value='" . $direction . "'"; print $direction == $siteComponent->getDirection() ? " selected='selected'" : ""; print ">"; print $label; print "</option>"; } print "\n\t\t\t\t\t</select>"; // print "\n\t\t\t\t</div>"; print "\n\t\t\t\t</td></tr>"; }
/** * Print rows/columns controls * * @param SiteComponent $siteComponent * @return void * @access public * @since 4/17/06 */ function applyDirection($siteComponent) { $directions = array("Left-Right/Top-Bottom" => _("Left-Right/Top-Bottom"), "Top-Bottom/Left-Right" => _("Top-Bottom/Left-Right"), "Right-Left/Top-Bottom" => _("Right-Left/Top-Bottom"), "Top-Bottom/Right-Left" => _("Top-Bottom/Right-Left"), "Left-Right/Bottom-Top" => _("Left-Right/Bottom-Top"), "Bottom-Top/Left-Right" => _("Bottom-Top/Left-Right"), "Right-Left/Bottom-Top" => _("Right-Left/Bottom-Top"), "Bottom-Top/Right-Left" => _("Bottom-Top/Right-Left")); if (RequestContext::value('direction') && in_array(RequestContext::value('direction'), array_keys($directions)) && RequestContext::value('direction') != $siteComponent->getDirection()) { $siteComponent->updateDirection(RequestContext::value('direction')); } }
/** * Print direction controls * * @param SiteComponent $siteComponent * @return void * @access public * @since 5/13/07 */ function printDirection($siteComponent, $step) { $property = $step->addComponent('direction', new WSelectList()); $property->setValue($siteComponent->getDirection()); $directions = array("Left-Right/Top-Bottom" => _("Left-Right/Top-Bottom"), "Top-Bottom/Left-Right" => _("Top-Bottom/Left-Right"), "Right-Left/Top-Bottom" => _("Right-Left/Top-Bottom"), "Top-Bottom/Right-Left" => _("Top-Bottom/Right-Left")); foreach ($directions as $direction => $label) { $property->addOption($direction, $label); } print "\n\t\t\t\t<p style='white-space: nowrap; font-weight: bold;'>"; print "\n\t\t\t\t\t" . _('Index Direction: ') . "[[direction]]"; print "\n\t\t\t\t</p>"; }