当前位置: 首页>>代码示例>>PHP>>正文


PHP FormElement类代码示例

本文整理汇总了PHP中FormElement的典型用法代码示例。如果您正苦于以下问题:PHP FormElement类的具体用法?PHP FormElement怎么用?PHP FormElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FormElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: form

 public function form()
 {
     $text = new FormElement("textarea", "q_post");
     $t = new Theme();
     $text->addClasses("actualite_area_text");
     return $t->process_form_elements($text);
 }
开发者ID:decima,项目名称:M2-platine,代码行数:7,代码来源:QRender.php

示例2: coupleWith

 function coupleWith(FormElement $component, $url, $filter_column = null, $empty_value = '')
 {
     $this->setAttribute('rel', $component->getId());
     $this->setAttribute('data-url', UrlHelper::get($url));
     $this->filter_column = $filter_column;
     $this->related = $component;
     $this->empty_value = $empty_value;
 }
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:8,代码来源:coupleddropdown.input.php

示例3: submitEditFormElementDescData

function submitEditFormElementDescData($moduleCompId, $elementId)
{
    $myElement = new FormElement();
    $myElement->fromHtmlForm();
    $updateQuery = $myElement->toMysqlUpdateQuery($moduleCompId);
    if (mysql_query($updateQuery)) {
        return true;
    } else {
        return false;
    }
}
开发者ID:ksb1712,项目名称:pragyan,代码行数:11,代码来源:editformelement.php

示例4: _selectElements

 /**
  * Return an array with the elements according to the parameters
  *
  * @param int $id
  * @param int $langId
  * @param string $type
  *
  * @return array
  */
 protected function _selectElements($id, $all = false)
 {
     $oElem = new FormElement();
     $oElemType = new FormElementType();
     $select = $oElem->select()->setIntegrityCheck(false)->from($oElem->getName())->joinInner($oElemType->getName(), 'FET_ID = FE_TypeID', 'FET_Title');
     if (!$all) {
         $select->where('FE_ID = ?', $id);
     } else {
         $select->where('FE_SectionID = ?', $id);
     }
     $select->order('FE_Seq ASC');
     $elements = $oElem->fetchAll($select)->toArray();
     return $elements;
 }
开发者ID:anunay,项目名称:stentors,代码行数:23,代码来源:FormElementObject.php

示例5: smarty_function_add_form_element

/**
 * Render and add a form element to both the PHP session and HTML output.
 *
 * @experimental
 * @param array  $params  Associative (and/or indexed) array of smarty parameters passed in from the template
 * @param Smarty $smarty  Parent Smarty template object
 *
 * @return string
 * @throws SmartyException
 */
function smarty_function_add_form_element($params, $smarty){

	if(!isset($params['form'])){
		$form = null;
	}
	elseif($params['form'] instanceof Form){
		$form = $params['form'];
	}
	elseif($params['form'] instanceof \Core\ListingTable\Table){
		$form = $params['form']->getEditForm();
	}
	else{
		throw new SmartyException('Unsupported value provided for "form", please ensure it is either a valid Form object or omitted completely!');
	}

	$type = isset($params['type']) ? $params['type'] : 'text';

	$element = FormElement::Factory($type, $params);

	if($form){
		$form->addElement($element);
	}

	// Assign or render?
	if(isset($params['assign'])){
		$smarty->assign($params['assign'], $element->render());
	}
	else{
		echo $element->render();
	}
}
开发者ID:nicholasryan,项目名称:CorePlus,代码行数:41,代码来源:function.add_form_element.php

示例6: renderInput

 /**
  * @see FormElement::renderInput()
  *
  * @param array $params
  * @return string
  */
 public function renderInput($params = null)
 {
     parent::renderInput($params);
     $output = '<div class="color_input"><input type="text" id="colorh_' . $this->getId() . '" name="' . $this->getName() . '" ' . ($this->getValue() !== null ? '" value="' . $this->getValue() . '"' : '') . ' />' . '&nbsp;<input type="button" class="color_button" id="color_' . $this->getId() . '" style="background:' . ($this->getValue() !== null ? $this->getValue() : '') . '" />
     <div style="display:none;"><div id="colorcont_' . $this->getId() . '"></div></div></div>';
     $varName = rand(10, 100000);
     $js = "var callback" . $varName . " = function(color){\n            \$('#colorh_" . $this->getId() . "').attr('value', color);\n            \$('#color_" . $this->getId() . "').css({backgroundColor:color});\n            window.colorPickers['" . $this->getId() . "'].close();\n        };\n        new ColorPicker(\$('#colorcont_" . $this->getId() . "'), callback" . $varName . ", '" . $this->getValue() . "');\n        \$('#color_" . $this->getId() . "').click(\n            function(){\n                if( !window.colorPickers )\n                {\n                    window.colorPickers = {};\n                }\n                window.colorPickers['" . $this->getId() . "'] = new OW_FloatBox({\$contents:\$('#colorcont_" . $this->getId() . "'), \$title:'Color Picker'});\n            }\n        );";
     OW::getDocument()->addOnloadScript($js);
     return $output;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:16,代码来源:form_fields.php

示例7: renderInput

 /**
  * @see FormElement::renderInput()
  *
  * @param array $params
  * @return string
  */
 public function renderInput($params = null)
 {
     parent::renderInput($params);
     $deleteLabel = OW::getLanguage()->text('base', 'delete');
     $markup = '<div class="ow_avatar_field">';
     $markup .= UTIL_HtmlTag::generateTag('input', $this->attributes);
     $markup .= '<div class="ow_avatar_field_preview" style="display: none;"><img src="" alt="" /><span title="' . $deleteLabel . '"></span></div>';
     $markup .= '<input type="hidden" name="" value="" class="ow_avatar_field_value" />';
     $markup .= '</div>';
     return $markup;
 }
开发者ID:hardikamutech,项目名称:hammu,代码行数:17,代码来源:avatar_field.php

示例8: set

	public function set($key, $value) {
		if ($key == 'options') {
			// The options need to be an array, (hence the plural use)
			if (!is_array($value)) return false;

			// if every key in this is an int, transpose the value over to the key instead.
			// This allows for having an option with a different title and value.
			// (and cheating, not actually checking every key)
			if (isset($value[0]) && isset($value[sizeof($value) - 1])) {
				foreach ($value as $k => $v) {
					unset($value[$k]);
					$value[$v] = $v;
				}
			}

			// Please note, this system CANNOT call the parent function, because its default behaviour is to
			// remap any int-based array to value/value pairs.  Since that logic is already handled here, there
			// is no need to perform it again, (of which it performs incorrectly)...
			$this->_attributes[$key] = $value;
			return true;
			//return parent::set($key, $value);
		}
		else {
			parent::set($key, $value);
		}
	}
开发者ID:nicholasryan,项目名称:CorePlus,代码行数:26,代码来源:FormCheckboxesInput.class.php

示例9: renderAttributes

  public function renderAttributes()
  {
    $this->_processAttributes();

    if (!$this->path)
    {
      $action_path = $_SERVER['PHP_SELF'];

      if($node_id = Limb :: toolkit()->getRequest()->get('node_id'))
        $action_path .= '?node_id=' . $node_id;
    }
    else
      $action_path = $this->path;

    if (strpos($action_path, '?') === false)
      $action_path .= '?';
    else
      $action_path .= '&';

    if($this->action)
      $action_path .= 'action=' . $this->action;

    if ((bool)$this->reload_parent)
    {
      $action_path .= '&reload_parent=1';
    }

    $this->attributes['onclick'] = $this->onclick;
    $this->attributes['onclick'] .= "submitForm(this.form, '{$action_path}')";

    parent :: renderAttributes();

    unset($this->attributes['onclick']);
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:34,代码来源:GridButtonComponent.class.php

示例10: __construct

	public function  __construct($atts = null) {
		parent::__construct($atts);

		// Some defaults
		$this->_attributes['class'] = 'formelement formpasswordinput';
		$this->_validattributes     = array('accesskey', 'autocomplete', 'dir', 'disabled', 'id', 'lang', 'name', 'required', 'size', 'tabindex', 'width', 'height', 'value', 'style');
	}
开发者ID:nicholasryan,项目名称:CorePlus,代码行数:7,代码来源:FormPasswordInput.class.php

示例11: __construct

	public function  __construct($atts = null) {
		parent::__construct($atts);

		// Some defaults
		$this->_attributes['class'] = 'formelement formcheckboxinput';
		$this->_validattributes     = array('accesskey', 'checked', 'dir', 'disabled', 'id', 'lang', 'name', 'required', 'tabindex', 'style', 'value');
	}
开发者ID:nicholasryan,项目名称:CorePlus,代码行数:7,代码来源:FormCheckboxInput.class.php

示例12: toHtml

 /**
  * Return html rendering for the element label
  * $arr_return['label'] - array or string of form element lable 
  * $arr_return['html'] -  array or string of form element 
  *
  * @return  Array  $arr_return
  * 
  */
 function toHtml()
 {
     $arr_return = parent::toHtml();
     $arr_return['html'] = '';
     $arr_checkboxes = array();
     $arr_checkboxes = $this->getAttribute('checkboxes');
     $arr_checked = array();
     $arr_checked = $this->getAttribute('checked');
     $string = '';
     $id = $this->getAttribute('id');
     if (is_array($arr_checkboxes)) {
         foreach ($arr_checkboxes as $key => $value) {
             $encode_key = str_replace(' ', '_', $key);
             $string = '<input {attr_name=attr_value} {extra_attr} id="' . "{$id}_{$encode_key}" . '" value="' . $key . '" ';
             if (is_array($arr_checked)) {
                 $string .= in_array($key, $arr_checked) ? 'checked ' : '';
             }
             $string .= '%id|checked|checkboxes|separator% />';
             $string .= $value != '' ? '<label for="{attr_id}_' . $encode_key . '">' . $value . '</label>' : '';
             $string .= $this->arr_attr['separator'] . "\n";
             if ($this->return_type == 'string') {
                 $arr_return['html'] .= $string;
             } else {
                 $arr_return['html'][] = $string;
             }
         }
     }
     return $arr_return;
 }
开发者ID:BackupTheBerlios,项目名称:openology-svn,代码行数:37,代码来源:FormCheckbox.php

示例13:

 function __toString()
 {
     //Allows children to write this attribute first
     if ($this->getAttribute('value') === false) {
         $this->setAttribute("value", $this->getRawValue());
     }
     return parent::__toString();
 }
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:8,代码来源:forminput.base.php

示例14: __construct

 public function __construct($atts = null)
 {
     parent::__construct($atts);
     // Some defaults
     $this->_attributes['class'] = 'formelement formwysiwyginput tinymce';
     $this->_attributes['rows'] = '25';
     // Note, I'm taking the required flag out from here; tinymce doesn't support it.
     $this->_validattributes = array('accesskey', 'dir', 'disabled', 'id', 'lang', 'name', 'readonly', 'tabindex', 'rows', 'cols', 'style', 'class');
 }
开发者ID:nicholasryan,项目名称:CorePlus,代码行数:9,代码来源:TinyMCEFormElement.class.php

示例15: Display

 function Display()
 {
     $html = $this->_loadTemplate();
     $html = str_replace("#LABEL#", $this->label, $html);
     $html = str_replace("#NOMBRE#", $this->nombre, $html);
     $html = str_replace("#ID#", $this->id, $html);
     $html = str_replace("#SELECTED_VALUE#", $this->selected_value, $html);
     $html = str_replace("#OPTIONS#", parent::Display(), $html);
     return $html;
 }
开发者ID:vallejos,项目名称:samples,代码行数:10,代码来源:select.php


注:本文中的FormElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。