示例#1
0
 /**
  * <ul>
  * <li>By default the option is <i>OFF</i></li>
  * <li>The output when option is <i>ON</i> is this parameter name</li>
  * <li>The output when option is <i>OFF</i> is empty string</li>
  * <li>The parameter is not required</li>
  * </ul>  
  * @param string $name The parameter name, case insensitive
  * @throws \MWException When $name not set
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->default_value = false;
     $this->output_on = $name;
     $this->output_off = '';
 }
示例#2
0
 /**
  * <ul>
  * <li>The default value is 0</li>
  * <li>No minimal value</li>
  * <li>No maximal value</li>
  * <li>The parameter is not required</li>
  * </ul>  
  * @param string $name The parameter name, case insensitive
  * @throws \MWException When $name not set
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->default_value = 0;
     $this->min = null;
     $this->max = null;
 }
示例#3
0
 /**
  * <ul>
  * <li>The default value is the empty string</li>
  * <li>HTML content is escaped for output.</li>
  * <li>No validation of the content of the value</li>
  * <li>Minimal length is 0 (accepts empty string)</li>
  * <li>Maximal length is 1024</li>
  * <li>The parameter is not required</li>
  * </ul>
  * 
  * @param string $name The parameter name, case insensitive
  * @throws \MWException When $name not set
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->escape_mode = 'html';
     $this->validate_type = 'all';
     // validates everything
     $this->min_length = 0;
     // accepts empty string
     $this->max_length = 1024;
 }
示例#4
0
 /**
  * Constructor.
  * 
  * @since 0.4
  * 
  * @param string $name
  * @param string $delimiter
  * @param mixed $type
  * @param mixed $default Use null for no default (which makes the parameter required)
  * @param array $aliases
  * @param array $criteria
  */
 public function __construct($name, $delimiter = ListParameter::DEFAULT_DELIMITER, $type = Parameter::TYPE_STRING, $default = null, array $aliases = array(), array $criteria = array())
 {
     $itemCriteria = array();
     $listCriteria = array();
     $this->cleanCriteria($criteria);
     foreach ($criteria as $criterion) {
         if ($criterion->isForLists()) {
             $listCriteria[] = $criterion;
         } else {
             $itemCriteria[] = $criterion;
         }
     }
     $this->listCriteria = $listCriteria;
     parent::__construct($name, $type, $default, $aliases, $itemCriteria);
     $this->delimiter = $delimiter;
 }
 /**
  * @see ParameterTemplateParameterInterface::__construct()
  * @param integer $parameter_id
  */
 function __construct($parameter_id)
 {
     parent::__construct($parameter_id);
 }
 public function __construct(Parameter $parameter)
 {
     parent::__construct($parameter->getName(), $parameter->isRequired());
     $this->parameter = $parameter;
 }
示例#7
0
 /**
  * <ul>
  * <li>The default value is boolean <i>false</i></li>
  * <li>The parameter is not required</li>
  * </ul>  
  * @param string $name The parameter name, case insensitive
  * @throws \MWException When $name not set
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->default_value = false;
 }
示例#8
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     parent::__construct(array('required' => true, 'format' => true));
 }
 public function __construct($name, $class, $required = true)
 {
     parent::__construct($name, $required);
     $this->class = $class;
 }
示例#10
0
 /**
  * This parameter is a container for several sub-parameters.
  * Only one of these can be set by user (the XOR condition)
  * 
  * Typical usage is for a "float" parameter, that contains options
  * "right" and "left". See Vimeo widget for example.
  * 
  * <ul>
  * <li>The default value is the empty string</li>
  * <li>No default sub-parameter</li>
  * <li>The parameter is not required</li>
  * </ul>
  * 
  * @param string $name The parameter name, case insensitive
  * @throws \MWException If $name not set
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->parameters = array();
     $this->default_parameter = null;
 }