• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP JFormFieldText类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testGetInput

	/**
	 * Test the getInput method.
	 *
	 * @return void
	 */
	public function testGetInput()
	{
		$form = new JFormInspector('form1');

		$this->assertThat(
			$form->load('<form><field name="text" type="text" /></form>'),
			$this->isTrue(),
			'Line:' . __LINE__ . ' XML string should load successfully.'
		);

		$field = new JFormFieldText($form);

		$this->assertThat(
			$field->setup($form->getXml()->field, 'value'),
			$this->isTrue(),
			'Line:' . __LINE__ . ' The setup method should return true.'
		);

		$this->assertThat(
			strlen($field->input),
			$this->greaterThan(0),
			'Line:' . __LINE__ . ' The getInput method should return something without error.'
		);

		// TODO: Should check all the attributes have come in properly.
	}
开发者ID:realityking,项目名称:joomla-platform,代码行数:31,代码来源:JFormFieldTextTest.php


示例2: testSetupMaxlength

 /**
  * Tests maxLength attribute setup by JFormFieldText::setup method
  *
  * @covers JFormField::setup
  * @covers JFormField::__get
  *
  * @return void
  */
 public function testSetupMaxlength()
 {
     $field = new JFormFieldText();
     $element = simplexml_load_string('<field name="myName" type="text" maxlength="60" />');
     $this->assertThat($field->setup($element, ''), $this->isTrue(), 'Line:' . __LINE__ . ' The setup method should return true if successful.');
     $this->assertThat($field->maxLength, $this->equalTo(60), 'Line:' . __LINE__ . ' The property should be computed from the XML.');
 }
开发者ID:shoffmann52,项目名称:install-from-web-server,代码行数:15,代码来源:JFormFieldTextTest.php


示例3: getInput

 /**
  * Method to get the field input markup.
  *
  * @return  string  The field input markup.
  *
  * @since   11.1
  */
 protected function getInput()
 {
     $html = array();
     $thisid = $this->id;
     $values = $this->value;
     $class = $this->class;
     $languages = JLanguageHelper::getLanguages();
     foreach ($languages as $lang) {
         $language = new JLanguage($lang->lang_code);
         $this->class = $class . ($language->isRTL() ? ' rtl' : ' ltr');
         $this->element['label'] = $lang->title;
         $this->name = 'jform[' . $this->fieldname . '][' . $lang->lang_code . ']';
         $this->id = $thisid . '_' . $lang->lang_code;
         $this->value = array_key_exists($lang->lang_code, $values) ? $values[$lang->lang_code] : '';
         $html[] = '<div class="control-group">';
         $html[] = '<div class="control-label">';
         $html[] = parent::getLabel();
         $html[] = '</div>';
         $html[] = '<div class="controls">';
         $html[] = parent::getInput();
         $html[] = '</div>';
         $html[] = '</div>';
     }
     return implode($html);
 }
开发者ID:smhnaji,项目名称:sdnet,代码行数:32,代码来源:multilang.php


示例4: getInput

 protected function getInput()
 {
     if (file_exists(JPATH_ROOT . '/components/com_acymailing/acymailing.php')) {
         JHtml::_('behavior.modal');
         $this->element['class'] .= ($this->element['class'] ? ' ' : '') . 'input-medium';
         $link = 'index.php?option=com_acymailing&amp;tmpl=component&amp;ctrl=chooselist&amp;task=' . $this->id . '&amp;values=' . $this->value . '&amp;control=';
         if (version_compare(JVERSION, '3.0.0') == -1) {
             $html = '<div class="fltlft">';
             $html .= parent::getInput();
             $html .= '</div><div class="button2-left"><div class="blank">';
             $html .= '<a class="modal hasTip" id="link' . $this->id . '" title="::' . JText::_('MOD_PWEBCONTACT_ACYMAILING_SELECT_LISTS') . '"';
             $html .= ' href="' . $link . '" rel="{handler:\'iframe\',size:{x:650,y:375}}">';
             $html .= JText::_('MOD_PWEBCONTACT_ACYMAILING_SELECT');
             $html .= '</a>';
             $html .= '</div></div>';
         } else {
             $html = '<div class="input-append">';
             $html .= parent::getInput();
             $html .= '<a class="btn modal hasTip" id="link' . $this->id . '" title="::' . JText::_('MOD_PWEBCONTACT_ACYMAILING_SELECT_LISTS') . '"';
             $html .= ' href="' . $link . '" rel="{handler:\'iframe\',size:{x:650,y:375}}">';
             $html .= '<i class="icon-list-view"></i>';
             $html .= '</a>';
             $html .= '</div>';
         }
     } else {
         $html = '<span class="badge badge-warning">' . JText::_('MOD_PWEBCONTACT_ACYMAILING_NOT_INSTALLED') . '</span>';
         if (version_compare(JVERSION, '3.0.0') == -1) {
             $html = '<div class="fltlft">' . $htm . '</div>';
         }
     }
     return $html;
 }
开发者ID:smart-one,项目名称:3kita,代码行数:32,代码来源:pwebacymailinglists.php


示例5: getInput

 /**
  * Method to get the field input markup for Compositions Nutrients.
  *
  * @return  string  The field input markup.
  */
 protected function getInput()
 {
     $html = array();
     $thisid = $this->id;
     $values = $this->value;
     // Start the Compositions Nutrients field output.
     $html[] = '<fieldset id="' . $thisid . '" class="nutrients"><span></span>';
     // Get the field options.
     $options = $this->getOptions();
     // Build the nutrients field output.
     foreach ($options as $option) {
         $this->element['label'] = JText::_($option->text);
         $this->name = 'jform[' . $this->fieldname . '][' . $option->index . ']';
         $this->id = $thisid . '_' . $option->index;
         $this->value = array_key_exists($option->index, $values) ? $values[$option->index] : '';
         $html[] = '<div class="input-prepend span3">';
         $html[] = '<span class="add-on">';
         $html[] = parent::getLabel();
         $html[] = '</span>';
         $html[] = parent::getInput();
         $html[] = '</div>';
     }
     // End the Compositions Nutrients field output.
     $html[] = '</fieldset>';
     return implode($html);
 }
开发者ID:smhnaji,项目名称:sdnet,代码行数:31,代码来源:compositionsnutrients.php


示例6: getInput

 /**
  * Method to get the field input markup.
  *
  * @return  string	The field input markup.
  *
  * @since   1.6
  */
 protected function getInput()
 {
     // Get the client id.
     $clientId = $this->element['client_id'];
     if (!isset($clientId)) {
         $clientName = $this->element['client'];
         if (isset($clientName)) {
             $client = JApplicationHelper::getClientInfo($clientName, true);
             $clientId = $client->id;
         }
     }
     if (!isset($clientId) && $this->form instanceof JForm) {
         $clientId = $this->form->getValue('client_id');
     }
     $clientId = (int) $clientId;
     // Load the modal behavior script.
     JHtml::_('behavior.modal', 'a.modal');
     // Build the script.
     $script = array();
     $script[] = '	function jSelectPosition_' . $this->id . '(name) {';
     $script[] = '		document.id("' . $this->id . '").value = name;';
     $script[] = '		SqueezeBox.close();';
     $script[] = '	}';
     // Add the script to the document head.
     JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
     // Setup variables for display.
     $html = array();
     $link = 'index.php?option=com_modules&view=positions&layout=modal&tmpl=component&function=jSelectPosition_' . $this->id . '&amp;client_id=' . $clientId;
     // The current user display field.
     $html[] = '<div class="input-append">';
     $html[] = parent::getInput() . '<a class="btn modal" title="' . JText::_('COM_MODULES_CHANGE_POSITION_TITLE') . '"  href="' . $link . '" rel="{handler: \'iframe\', size: {x: 800, y: 450}}">' . '<i class="icon-screenshot"></i> ' . JText::_('COM_MODULES_CHANGE_POSITION_BUTTON') . '</a>';
     $html[] = '</div>';
     return implode("\n", $html);
 }
开发者ID:interfaceslivres,项目名称:ccmd-ufpb,代码行数:41,代码来源:moduleposition.php


示例7: getInput

    protected function getInput()
    {
        $html = array();
        $direct = $this->form->getValue('direct_alias', 'params', false);
        $absent = $this->form->getValue('absent_alias', 'params', false);
        JFactory::getDocument()->addScriptDeclaration('
			function toggleDirectAlias(button) {
				var direct = document.getElementById("jform_params_direct_alias");
				direct.value = 1 - direct.value;
				button.value = (direct.value > 0) ? "' . JText::_('PLG_SYSTEM_DIRECT_ALIAS_DIRECT') . '" : "' . JText::_('PLG_SYSTEM_DIRECT_ALIAS_RELATIVE') . '";
			}
			function toggleAbsentAlias(button) {
				var absent = document.getElementById("jform_params_absent_alias");
				absent.value = 1 - absent.value;
				button.value = (absent.value > 0) ? "' . JText::_('PLG_SYSTEM_DIRECT_ALIAS_ABSENT') . '" : "' . JText::_('PLG_SYSTEM_DIRECT_ALIAS_PRESENT') . '";
			}
		');
        if (version_compare(JVERSION, '3.2', 'ge')) {
            $html[] = '<div class="input-append">';
            $html[] = parent::getInput();
            $html[] = '<input type="button" onclick="toggleDirectAlias(this)" value="' . JText::_($direct ? 'PLG_SYSTEM_DIRECT_ALIAS_DIRECT' : 'PLG_SYSTEM_DIRECT_ALIAS_RELATIVE') . '" class="btn hasTooltip" title="<b>' . JText::_('PLG_SYSTEM_DIRECT_ALIAS_DIRECT_TIP_TITLE') . '</b><br/><br/>' . JText::_('PLG_SYSTEM_DIRECT_ALIAS_DIRECT_TIP_DESC') . '" style="cursor:pointer" data-placement="bottom" />';
            $html[] = '<input type="button" onclick="toggleAbsentAlias(this)" value="' . JText::_($absent ? 'PLG_SYSTEM_DIRECT_ALIAS_ABSENT' : 'PLG_SYSTEM_DIRECT_ALIAS_PRESENT') . '" class="btn hasTooltip" title="<b>' . JText::_('PLG_SYSTEM_DIRECT_ALIAS_ABSENT_TIP_TITLE') . '</b><br/><br/>' . JText::_('PLG_SYSTEM_DIRECT_ALIAS_ABSENT_TIP_DESC') . '" style="cursor:pointer" data-placement="bottom" />';
            $html[] = '</div>';
        } else {
            $html[] = parent::getInput();
            $html[] = '<input type="button" onclick="toggleDirectAlias(this)" value="' . JText::_($direct ? 'PLG_SYSTEM_DIRECT_ALIAS_DIRECT' : 'PLG_SYSTEM_DIRECT_ALIAS_RELATIVE') . '" class="button hasTip" title="' . JText::_('PLG_SYSTEM_DIRECT_ALIAS_DIRECT_TIP_TITLE') . '::' . JText::_('PLG_SYSTEM_DIRECT_ALIAS_DIRECT_TIP_DESC') . '" style="cursor:pointer" />';
            $html[] = '<input type="button" onclick="toggleAbsentAlias(this)" value="' . JText::_($absent ? 'PLG_SYSTEM_DIRECT_ALIAS_ABSENT' : 'PLG_SYSTEM_DIRECT_ALIAS_PRESENT') . '" class="button hasTip" title="' . JText::_('PLG_SYSTEM_DIRECT_ALIAS_ABSENT_TIP_TITLE') . '::' . JText::_('PLG_SYSTEM_DIRECT_ALIAS_ABSENT_TIP_DESC') . '" style="cursor:pointer" />';
        }
        return implode("\n", $html);
    }
开发者ID:thumbs-up-sign,项目名称:TuVanDuAn,代码行数:30,代码来源:directaliasfield.php


示例8: getInput

 function getInput()
 {
     $config = JComponentHelper::getParams('com_fabrik');
     if ($config->get('fbConf_wysiwyg_label', '0') == '0') {
         return parent::getInput();
     }
     // Initialize some field attributes.
     $rows = (int) $this->element['rows'];
     $cols = (int) $this->element['cols'];
     $height = (string) $this->element['height'] ? (string) $this->element['height'] : '250';
     $width = (string) $this->element['width'] ? (string) $this->element['width'] : '100%';
     $assetField = $this->element['asset_field'] ? (string) $this->element['asset_field'] : 'asset_id';
     $authorField = $this->element['created_by_field'] ? (string) $this->element['created_by_field'] : 'created_by';
     $asset = $this->form->getValue($assetField) ? $this->form->getValue($assetField) : (string) $this->element['asset_id'];
     // Build the buttons array.
     $buttons = (string) $this->element['buttons'];
     if ($buttons == 'true' || $buttons == 'yes' || $buttons == '1') {
         $buttons = true;
     } elseif ($buttons == 'false' || $buttons == 'no' || $buttons == '0') {
         $buttons = false;
     } else {
         $buttons = explode(',', $buttons);
     }
     $hide = (string) $this->element['hide'] ? explode(',', (string) $this->element['hide']) : array();
     // Get an editor object.
     $editor = $this->getEditor();
     return $editor->display($this->name, htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8'), $width, $height, $cols, $rows, $buttons ? is_array($buttons) ? array_merge($buttons, $hide) : $hide : false, $this->id, $asset, $this->form->getValue($authorField));
 }
开发者ID:romuland,项目名称:khparts,代码行数:28,代码来源:textorwysiwyg.php


示例9: getInput

    protected function getInput()
    {
        $size = $this->element['size'];
        $doc = JFactory::getDocument();
        $doc->addScriptDeclaration('if(typeof jQuery!=="undefined")
jQuery(document).ready(function($){
	$("#pwebcontact_paste_' . $this->id . '").click(function(e){
		e.preventDefault();
		var s = prompt("' . JText::_('MOD_PWEBCONTACT_ADWORDS_SCRIPT_PASTE') . '");
		if(s){
			var u = s.match(/<img[^>]* src=["]([^"]+)"/i);
			if (u && typeof u[1] != "undefined") document.getElementById("' . $this->id . '").value = u[1].replace(new RegExp("&amp;", "gi"), "&");
		}
	});
});');
        if (version_compare(JVERSION, '3.0.0') == -1) {
            $html = '<div class="fltlft">';
            $html .= parent::getInput();
            $html .= '</div><div class="button2-left"><div class="blank">';
            $html .= '<a id="pwebcontact_paste_' . $this->id . '" href="#">';
            $html .= JText::_('MOD_PWEBCONTACT_PASTE_BUTTON');
            $html .= '</a>';
            $html .= '</div></div>';
        } else {
            $html = '<div class="input-append">';
            $html .= parent::getInput();
            $html .= '<a class="btn" id="pwebcontact_paste_' . $this->id . '" href="#">';
            $html .= JText::_('MOD_PWEBCONTACT_PASTE_BUTTON');
            $html .= '</a>';
            $html .= '</div>';
        }
        return $html;
    }
开发者ID:smart-one,项目名称:3kita,代码行数:33,代码来源:pwebadwords.php


示例10: getInput

    /**
     * Method to get the field input markup.
     *
     * @return	string	The field input markup.
     * @since	1.6
     */
    protected function getInput()
    {
        $price = $this->form->getValue('price');
        $html = "";
        if (is_array($price)) {
            foreach ($price as $wday => $priceOfWeekDay) {
                $html .= '
					<div class="input-prepend prependtop">
						<span class="add-on">' . JText::_($wday) . '</span>
						<input class="align-right input-mini" name="jform[price][' . $wday . ']" value="' . $priceOfWeekDay . '">
					</div>
				';
            }
            $html .= '
				<p class="help-block">
					Switch back to <a id="sr-switch-simple-tariff" href="">Simple Tariff</a>
					or use <a id="sr-switch-complexed-tariff" href="">Complex Tariff</a>
				</p>
			';
        } else {
            $html .= parent::getInput();
            $html .= '
				<p class="help-block">
					For more flexible tariff, you can try <a id="sr-switch-advanced-tariff" href="">Advanced Tariff</a>
					or <a id="sr-switch-complexed-tariff" href="">Complex Tariff</a>
				</p>
			';
        }
        return $html;
    }
开发者ID:prox91,项目名称:joomla-dev,代码行数:36,代码来源:price.php


示例11:

 function __construct($form = null)
 {
     // Must load admin language files
     $lang = JFactory::getLanguage();
     $lang->load("com_jevents", JPATH_ADMINISTRATOR);
     parent::__construct($form);
 }
开发者ID:pguilford,项目名称:vcomcc,代码行数:7,代码来源:jevfilters.php


示例12: getInput

 public function getInput()
 {
     $doc = JFactory::getDocument();
     $db = JFactory::getDbo();
     // jQuery UI JS
     $doc->addScript(JURI::root(true) . '/administrator/components/com_rsmembership/assets/js/ui/core.js');
     $doc->addScript(JURI::root(true) . '/administrator/components/com_rsmembership/assets/js/ui/widget.js');
     $doc->addScript(JURI::root(true) . '/administrator/components/com_rsmembership/assets/js/ui/mouse.js');
     $doc->addScript(JURI::root(true) . '/administrator/components/com_rsmembership/assets/js/ui/slider.js');
     $doc->addScript(JURI::root(true) . '/administrator/components/com_rsmembership/assets/js/ui/datepicker.js');
     $doc->addScript(JURI::root(true) . '/administrator/components/com_rsmembership/assets/js/ui/timepicker.js');
     // & CSS
     $doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsmembership/assets/css/ui/jquery.ui.all.css');
     $doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsmembership/assets/css/ui/jquery.ui.timepicker.css');
     // Initialize
     $doc->addScriptDeclaration("jQuery(document).ready(function(\$){\r\n\t\t\t\$('#" . $this->id . "').datetimepicker({\r\n\t\t\t\tchangeMonth: true,\r\n\t\t\t\tchangeYear: true,\r\n\t\t\t\tdateFormat: 'yy-mm-dd',\r\n\t\t\t\ttimeFormat: 'HH:mm:ss'\r\n\t\t\t});\r\n\t\t\r\n\t\t\t\$('#" . $this->id . "_img').click(function(){\r\n\t\t\t\t\$('#" . $this->id . "').datetimepicker('show');\r\n\t\t\t});\r\n\r\n\t\t});");
     if ($this->value == $db->getNullDate()) {
         $this->value = '';
     } else {
         $this->value = JHtml::_('date', $this->value, 'Y-m-d H:i:s');
     }
     $html[] = '<div class="input-append">';
     $html[] = parent::getInput();
     $html[] = '<span id="' . $this->id . '_img" class="add-on rsme_pointer"><i class="icon-calendar"></i></span>';
     $html[] = '</div>';
     return implode("\n", $html);
 }
开发者ID:JozefAB,项目名称:qk,代码行数:27,代码来源:date.php


示例13: getInput

 protected function getInput()
 {
     //ConditionalHelperAsset::load('conditional.js');
     $this->class = !empty($this->class) ? $this->class . ' hp_conditional' : 'hp_conditional';
     return parent::getInput();
     $conditionalOn = $this->conditionalOn;
 }
开发者ID:carcam,项目名称:lib_fields,代码行数:7,代码来源:text.php


示例14: getInput

 /**
  * Method to get the field input markup.
  *
  * @return  string  The field input markup.
  */
 protected function getInput()
 {
     $input = parent::getInput();
     $params = JComponentHelper::getParams('com_jea');
     $surface_measure = $params->get('surface_measure', 'm²');
     return $input . ' <span class="input-suffix">' . $surface_measure . '</span>';
 }
开发者ID:Cloudum,项目名称:com_jea,代码行数:12,代码来源:surface.php


示例15: setup

 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $this->element = $element;
     $element['label'] = $this->prepareText($element['label']);
     $element['description'] = $this->prepareText($element['description']);
     $element['translateDescription'] = false;
     return parent::setup($element, $value, $group);
 }
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:8,代码来源:text.php


示例16: getInput

 protected function getInput()
 {
     $html = parent::getInput();
     $example = (string) $this->element['example'];
     if (!empty($example)) {
         $html = str_replace('/>', ' placeholder="' . JText::_($example) . '"/>', $html);
     }
     return $html;
 }
开发者ID:chaudhary4k4,项目名称:modernstore,代码行数:9,代码来源:djtext.php


示例17: setup

 public function setup(&$element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     $this->element['class'] = $this->element['class'] . ' color';
     if ($this->element['name'] != 'title_color' and $this->element['name'] != 'date_color') {
         $this->element['onchange'] = 'document.getElementById(\'jform_params_calendar_style\').value=\'custom\'';
     }
     return $return;
 }
开发者ID:ankaau,项目名称:GathBandhan,代码行数:9,代码来源:color.php


示例18: __get

 /**
  * Method to get certain otherwise inaccessible properties from the form field object.
  *
  * @param   string  $name  The property name for which to the the value.
  *
  * @return  mixed  The property value or null.
  *
  */
 public function __get($name)
 {
     switch ($name) {
         case 'element':
             return $this->{$name};
             break;
     }
     $value = parent::__get($name);
     return $value;
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:18,代码来源:shlibpluginlink.php


示例19: getInput

 public function getInput()
 {
     $domain = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
     if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\\-]{1,63}\\.[a-z\\.]{2,6})$/i', $domain, $regs)) {
         $domain = $regs['domain'];
     }
     $value = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8');
     $this->value = !empty($value) ? $value : $domain;
     return parent::getInput();
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:10,代码来源:domain.php


示例20: getInput

 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     $input = parent::getInput();
     if (strpos($input, "placeholder") === false) {
         $placeholder = $this->element['placeholder'] ? ' placeholder="' . htmlspecialchars(JText::_($this->element['placeholder'])) . '"' : '';
         $input = str_replace("/>", " {$placeholder} />", $input);
     }
     JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php");
     JEVHelper::ConditionalFields($this->element, $this->form->getName());
     return $input;
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:17,代码来源:jeveventtext.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP JFormHelper类代码示例发布时间:2022-05-23
下一篇:
PHP JFormFieldList类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap