2015-12-28
@param string $name
@param string $value
@param string|null|Phrase $label [optional]
@return Hidden
553010
protected function hidden($name, $value, $label = null) {
		$result = $this->field($name, Hidden::class, $label, ['value' => $value]);
		$result->setAfterElementHtml($label);
		return $result;
	}
260228
public function hidden($name = null, $value = null, $attr = null)
    {
        return $this->createInput('hidden', $name, $value, $attr);
    }
1344989
protected function doSelect($value, $label)
    {
        if ($this->selected) {
            if (is_array($this->selected) && count($this->selected) > 0) {
                $result = array_search($value, $this->selected);

                if ($result !== false) {
                    unset($this->selected[$result]);

                    return 'selected="selected"';
                }
            } elseif ($this->selected instanceof Closure) {
                call_user_func_array($this->selected, [$this, $value, $label]);
                $attrs = $this->renderAttr($this->optionAttr);
                $this->optionAttr = null;
                return $attrs;
            } else {
                if ($this->selected == $value) {
                    $this->selected = null;

                    return 'selected="selected"';
                }
            }
        }
    }
384065
public function withImageAndAltText(string $name, string $label)
    {
        $this->contentGroup->images[$name] = ['name' => $name, 'label' => $label, 'alt_text' => true, 'order' => $this->order++];

        return $this;
    }
1114595
protected final function add_jumpto($name, $label=null, $selected=LESSON_NEXTPAGE) {
        $title = get_string("jump", "lesson");
        if ($label === null) {
            $label = $title;
        }
        if (is_int($name)) {
            $name = "jumpto[$name]";
        }
        $this->_form->addElement('select', $name, $label, $this->_customdata['jumpto']);
        $this->_form->setDefault($name, $selected);
        $this->_form->addHelpButton($name, 'jumps', 'lesson');
    }
1119876
protected function display_category_form_checkbox($name, $value, $label) {
        debugging('display_category_form_checkbox() is deprecated, ' .
                'please use \core_question\bank\search\condition instead.', DEBUG_DEVELOPER);
        echo '<div><input type="hidden" id="' . $name . '_off" name="' . $name . '" value="0" />';
        echo '<input type="checkbox" id="' . $name . '_on" name="' . $name . '" value="1"';
        if ($value) {
            echo ' checked="checked"';
        }
        echo ' onchange="getElementById(\'displayoptions\').submit(); return true;" />';
        echo '<label for="' . $name . '_on">' . $label . '</label>';
        echo "</div>\n";
    }
908150
public static function buildLabel($name, $label = '', $required = false)
        {
            $out = '';

            if (!empty($label)) {
                $class = 'control-label';
                $requiredLabel = '.req';
                $requiredSuffix = '<span class="required"><i class="icon-asterisk"></i></span>';
                $requiredPrefix = '';
                $requiredClass = 'labelrequired';

                if (false !== $required) {
                    $label = $requiredPrefix . $label . $requiredSuffix;
                    $class .= ' ' . $requiredClass;
                }

                $out .= static::label($name, $label, array('class' => $class));
            }

            return $out;
        }
243529
protected function getTranslatedLabel($value, $label)
    {
        $translationConfiguration = $this->arguments['translate'];

        $translateBy = isset($translationConfiguration['by']) ? $translationConfiguration['by'] : 'id';
        $sourceName = isset($translationConfiguration['source']) ? $translationConfiguration['source'] : 'Main';
        $request = $this->controllerContext->getRequest();
        $packageKey = null;
        if (isset($translationConfiguration['package'])) {
            $packageKey = $translationConfiguration['package'];
        } elseif ($request instanceof ActionRequest) {
            $packageKey = $request->getControllerPackageKey();
        }
        $prefix = isset($translationConfiguration['prefix']) ? $translationConfiguration['prefix'] : '';

        if (isset($translationConfiguration['locale'])) {
            try {
                $localeObject = new Locale($translationConfiguration['locale']);
            } catch (InvalidLocaleIdentifierException $e) {
                throw new ViewHelper\Exception('"' . $translationConfiguration['locale'] . '" is not a valid locale identifier.', 1330013193);
            }
        } else {
            $localeObject = null;
        }

        switch ($translateBy) {
            case 'label':
                $label =  isset($translationConfiguration['using']) && $translationConfiguration['using'] === 'value' ? $value : $label;
                return $this->translator->translateByOriginalLabel($label, array(), null, $localeObject, $sourceName, $packageKey);
            case 'id':
                $id =  $prefix . (isset($translationConfiguration['using']) && $translationConfiguration['using'] === 'label' ? $label : $value);
                $translation = $this->translator->translateById($id, array(), null, $localeObject, $sourceName, $packageKey);
                return ($translation !== null) ? $translation : $label;
            default:
                throw new ViewHelper\Exception('You can only request to translate by "label" or by "id", but asked for "' . $translateBy . '" in your SelectViewHelper tag.', 1340050647);
        }
    }
777138
public static function HiddenField( $name, $value )
	{
		$attributes	= array(
			'id'		=> $name,
			'type'		=> "hidden",
			'name'		=> $name,
			'value'		=> $value,
		);
		return UI_HTML_Tag::create( "input", NULL, $attributes );
	}
62690
public function hidden($name, $value = null, $options = [])
    {
        return $this->form->hidden($name, $value, $options);
    }
622597
protected static function field_hidden( $name, $value = null, $options = null ) {

		$form_field_type = self::$field_type;

		ob_start();

		pods_view( PODS_DIR . 'ui/fields/_hidden.php', compact( array_keys( get_defined_vars() ) ) );

		$output = ob_get_clean();

		return apply_filters( 'pods_form_ui_field_hidden', $output, $name, $value, $options );
	}
1133591
protected function getFieldValue($value, $name)
    {
        if (!is_null($value)) {
            $modelVariable = $this->getSingularVariable($this->modelName);
            return sprintf("(!isset(\$%s->%s) ? '%s' : null)", $modelVariable, $name, $value);
        }
        return 'null';
    }
743075
public static function hidden($name, $value, array $attributes = array())
    {
        $node = new Node\Hidden();

        if (!is_null($name)) {
            $attributes['name'] = $name;
        }

        if (!is_null($value)) {
            $attributes['value'] = $value;
        }

        return $node->render($attributes);
    }
1124396
protected function getSuggestedMessageTemplate($name, $withLabel)
    {
        $noLabelMessage = is_string($name) && isset($this->errorMessages[$name]) ? $this->errorMessages[$name] : null;
        if ($withLabel) {
            return is_string($name) && isset($this->labeledErrorMessages[$name]) ?
                $this->labeledErrorMessages[$name] :
                $noLabelMessage;
        }

        return $noLabelMessage;
    }
148587
public static function label( $name, $label, $help = '', $options = null ) {

		if ( is_array( $label ) || is_object( $label ) ) {
			$options = $label;
			$label   = $options['label'];

			if ( empty( $label ) ) {
				$label = ucwords( str_replace( '_', ' ', $name ) );
			}

			$help = $options['help'];
		} else {
			$options = self::options( null, $options );
		}

		$label = apply_filters( 'pods_form_ui_label_text', $label, $name, $help, $options );
		$help  = apply_filters( 'pods_form_ui_label_help', $help, $name, $label, $options );

		ob_start();

		$name_clean      = self::clean( $name );
		$name_more_clean = self::clean( $name, true );

		$type                = 'label';
		$attributes          = array();
		$attributes['class'] = 'pods-form-ui-' . $type . ' pods-form-ui-' . $type . '-' . $name_more_clean;
		$attributes['for']   = ( false === strpos( $name_clean, 'pods-form-ui-' ) ? 'pods-form-ui-' : '' ) . $name_clean;
		$attributes          = self::merge_attributes( $attributes, $name, $type, $options, false );

		pods_view( PODS_DIR . 'ui/fields/_label.php', compact( array_keys( get_defined_vars() ) ) );

		$output = ob_get_clean();

		return apply_filters( "pods_form_ui_{$type}", $output, $name, $label, $help, $attributes, $options );
	}
1305120
public function hiddenInput($name, $value = null, $htmlOptions = array())
    {
        return $this->input($name, 'hidden', $value, $htmlOptions);
    }
259813
public function relation($name, $label, $builder = null)
    {
        if (is_null($builder)) {
            $builder = $label;
            $label = '';
        }

        return $this->addRelation($name, $builder, $label);
    }