/**
  * @param string $label
  *        	The label of the element
  * @param Customweb_Form_Control_IControl $control
  *        	The control of the element.
  * @param string $description
  *        	[optional] The description of the elment.
  * @param boolean $globalScope
  *        	[optional] Can the value be set per store?
  * @param boolean $inherited
  *        	[optional] Are values inherited?
  */
 public function __construct(Customweb_Form_Control_IControl $control, $description = '', $globalScope = true, $inherited = false)
 {
     $this->control = $control;
     $this->elementId = $control->getControlId() . '-element';
     $this->description = $description;
     $this->intention = Customweb_Form_Intention_Factory::getNullIntention();
     if (!$control instanceof Customweb_Form_Control_IEditableControl) {
         $this->globalScope = false;
     } else {
         $this->globalScope = (bool) $globalScope;
     }
     $this->inherited = (bool) $inherited;
 }
 /**
  * This method returns the control id or an empty string.
  *
  * @param Customweb_Form_Control_IControl $control
  * @return string
  */
 protected static function getControlId($control)
 {
     if ($control === null) {
         return '';
     } else {
         return $control->getControlId();
     }
 }
 /**
  * @param Customweb_Form_Control_IControl $control
  *        	The control of the element.
  */
 public function __construct(Customweb_Form_Control_IControl $control)
 {
     $this->control = $control;
     $this->elementId = $control->getControlId() . '-element';
     $this->intention = Customweb_Form_Intention_Factory::getNullIntention();
 }
Esempio n. 4
0
 public function renderOptionPrefix(Customweb_Form_Control_IControl $control, $optionKey)
 {
     return '<div class="' . $this->getCssClassPrefix() . $this->getOptionCssClass() . '" id="' . $control->getControlId() . '-' . $optionKey . '-key">';
 }
 public function renderControlPrefix(Customweb_Form_Control_IControl $control, $controlTypeClass)
 {
     $classes = $this->getCssClassPrefix() . $this->getControlCssClass() . ' ' . $this->getCssClassPrefix() . $controlTypeClass;
     if ($control instanceof Customweb_Form_Control_SingleCheckbox || $control instanceof Customweb_Form_Control_MultiCheckbox || $control instanceof Customweb_Form_Control_Radio) {
         $classes .= ' control';
     }
     return '<div class="' . $classes . '" id="' . $control->getControlId() . '-wrapper">';
 }