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


PHP JStringPunycode::urlToUTF8方法代码示例

本文整理汇总了PHP中JStringPunycode::urlToUTF8方法的典型用法代码示例。如果您正苦于以下问题:PHP JStringPunycode::urlToUTF8方法的具体用法?PHP JStringPunycode::urlToUTF8怎么用?PHP JStringPunycode::urlToUTF8使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JStringPunycode的用法示例。


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

示例1: getInput

 /**
  * Method to get the field input markup.
  *
  * @return  string  The field input markup.
  *
  * @since   3.1.2 (CMS)
  */
 protected function getInput()
 {
     // Translate placeholder text
     $hint = $this->translateHint ? JText::_($this->hint) : $this->hint;
     // Initialize some field attributes.
     $size = !empty($this->size) ? ' size="' . $this->size . '"' : '';
     $maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : '';
     $class = !empty($this->class) ? ' class="' . $this->class . '"' : '';
     $readonly = $this->readonly ? ' readonly' : '';
     $disabled = $this->disabled ? ' disabled' : '';
     $required = $this->required ? ' required aria-required="true"' : '';
     $hint = strlen($hint) ? ' placeholder="' . $hint . '"' : '';
     $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $this->autocomplete . '"';
     $autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete;
     $autofocus = $this->autofocus ? ' autofocus' : '';
     $spellcheck = $this->spellcheck ? '' : ' spellcheck="false"';
     // Note that the input type "url" is suitable only for external URLs, so if internal URLs are allowed
     // we have to use the input type "text" instead.
     $inputType = $this->element['relative'] ? 'type="text"' : 'type="url"';
     // Initialize JavaScript field attributes.
     $onchange = !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : '';
     // Including fallback code for HTML5 non supported browsers.
     JHtml::_('jquery.framework');
     JHtml::_('script', 'system/html5fallback.js', false, true);
     return '<input ' . $inputType . ' name="' . $this->name . '"' . $class . ' id="' . $this->id . '" value="' . htmlspecialchars(JStringPunycode::urlToUTF8($this->value), ENT_COMPAT, 'UTF-8') . '"' . $size . $disabled . $readonly . $hint . $autocomplete . $autofocus . $spellcheck . $onchange . $maxLength . $required . ' />';
 }
开发者ID:adjaika,项目名称:J3Base,代码行数:33,代码来源:url.php

示例2: getInput

 /**
  * Method to get the field input markup.
  *
  * @return  string  The field input markup.
  *
  * @since   3.1.2 (CMS)
  */
 protected function getInput()
 {
     // Translate placeholder text
     $hint = $this->translateHint ? JText::_($this->hint) : $this->hint;
     // Initialize some field attributes.
     $size = !empty($this->size) ? ' size="' . $this->size . '"' : '';
     $maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : '';
     $class = !empty($this->class) ? ' class="' . $this->class . '"' : '';
     $readonly = $this->readonly ? ' readonly' : '';
     $disabled = $this->disabled ? ' disabled' : '';
     $required = $this->required ? ' required aria-required="true"' : '';
     $hint = $hint ? ' placeholder="' . $hint . '"' : '';
     $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $this->autocomplete . '"';
     $autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete;
     $autofocus = $this->autofocus ? ' autofocus' : '';
     $spellcheck = $this->spellcheck ? '' : ' spellcheck="false"';
     // Initialize JavaScript field attributes.
     $onchange = !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : '';
     // Including fallback code for HTML5 non supported browsers.
     JHtml::_('jquery.framework');
     JHtml::_('script', 'system/html5fallback.js', false, true);
     // Uris should never include <>" see see http://www.ietf.org/rfc/rfc1738.txt.
     $this->value = str_replace(array('<', '>', '"'), '', $this->value);
     return '<input type="url" name="' . $this->name . '"' . $class . ' id="' . $this->id . '" value="' . JStringPunycode::urlToUTF8($this->value, ENT_COMPAT, 'UTF-8') . '"' . $size . $disabled . $readonly . $hint . $autocomplete . $autofocus . $spellcheck . $onchange . $maxLength . $required . ' />';
 }
开发者ID:nhtang,项目名称:joomla,代码行数:32,代码来源:url.php

示例3: getInput

 /**
  * Method to get the field input markup.
  *
  * @return  string  The field input markup.
  *
  * @since   3.1.2 (CMS)
  */
 protected function getInput()
 {
     // Initialize some field attributes.
     $size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
     $maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : '';
     $class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '" ' : '" ';
     $readonly = (string) $this->element['readonly'] == 'true' ? ' readonly="readonly"' : '';
     $disabled = (string) $this->element['disabled'] == 'true' ? ' disabled="disabled"' : '';
     $required = $this->required ? ' required="required" aria-required="true"' : '';
     // Initialize JavaScript field attributes.
     $onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
     return '<input type="url" name="' . $this->name . '"' . $class . ' id="' . $this->id . '" value="' . JStringPunycode::urlToUTF8($this->value, ENT_COMPAT, 'UTF-8') . '"' . $size . $disabled . $readonly . $onchange . $maxLength . $required . '/>';
 }
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:20,代码来源:url.php

示例4: renderUrl

 /**
  * renderUrl
  *
  * @param   string  $url  Param.
  *
  * @return	string
  */
 public static function renderUrl($url)
 {
     if (EXTLY_J3) {
         return htmlspecialchars(JStringPunycode::urlToUTF8($url), ENT_COMPAT, 'UTF-8');
     } else {
         return htmlspecialchars($url, ENT_COMPAT, 'UTF-8');
     }
 }
开发者ID:johngrange,项目名称:wookeyholeweb,代码行数:15,代码来源:text.php

示例5: urlToUTF8

 /**
  * Helper wrapper method for urlToUTF8
  *
  * @param   string  $uri  The Punycode URL to transform.
  *
  * @return string  The UTF-8 URL.
  *
  * @see     JStringPunycode::urlToUTF8()
  * @since   3.4
  */
 public function urlToUTF8($uri)
 {
     return JStringPunycode::urlToUTF8($uri);
 }
开发者ID:deenison,项目名称:joomla-cms,代码行数:14,代码来源:punycode.php

示例6:

    ?>
		</span>
	</dd>
<?php 
}
if ($this->contact->webpage && $this->params->get('show_webpage')) {
    ?>
	<dt>
		<span class="<?php 
    echo $this->params->get('marker_class');
    ?>
">
		</span>
	</dt>
	<dd>
		<span class="contact-webpage">
			<a href="<?php 
    echo $this->contact->webpage;
    ?>
" target="_blank" itemprop="url">
			<?php 
    echo JStringPunycode::urlToUTF8($this->contact->webpage);
    ?>
</a>
		</span>
	</dd>
<?php 
}
?>
</dl>
开发者ID:adjaika,项目名称:J3Base,代码行数:30,代码来源:default_address.php

示例7: url

 /**
  * returns a anchor tag generated from a given value
  *
  * @param   string  $value  url to use
  *
  * @return mixed|string
  */
 public static function url($value)
 {
     if (empty($value)) {
         return JHtml::_('users.value', $value);
     } else {
         // Convert website url to utf8 for display
         $value = JStringPunycode::urlToUTF8(htmlspecialchars($value));
         if (substr($value, 0, 4) == "http") {
             return '<a href="' . $value . '">' . $value . '</a>';
         } else {
             return '<a href="http://' . $value . '">' . $value . '</a>';
         }
     }
 }
开发者ID:ziyou-liu,项目名称:1line,代码行数:21,代码来源:profile.php

示例8: defined

/**
 * @package     Joomla.Site
 * @subpackage  Layout
 *
 * @copyright   Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;
//
$name = $displayData[0];
$id = $displayData[1];
$value = $displayData[2];
$size = $displayData[3];
$maxlength = $displayData[4];
$class = $displayData[5];
$readonly = $displayData[6];
$disabled = $displayData[7];
$required = $displayData[8];
$hint = $displayData[9];
$autocomplete = $displayData[10];
$autofocus = $displayData[11];
$spellcheck = $displayData[12];
$onchange = $displayData[13];
// Including fallback code for HTML5 non supported browsers.
JHtml::_('jquery.framework');
JHtml::_('script', 'system/html5fallback.js', false, true);
echo '<input type="url" name="' . $name . '"' . $class . ' id="' . $id . '" value="' . htmlspecialchars(JStringPunycode::urlToUTF8($value), ENT_COMPAT, 'UTF-8') . '"' . $size . $disabled . $readonly . $hint . $autocomplete . $autofocus . $spellcheck . $onchange . $maxLength . $required . ' />';
?>


开发者ID:angieradtke,项目名称:cms-naked,代码行数:28,代码来源:url.php

示例9: sprintf

 $hits = (int) @$value['hits'];
 $link_params = $title ? ' title="' . $title . '"' : '';
 $link_params .= $class ? ' class="' . $class . '"' : '';
 $link_params .= $id ? ' id="' . $id . '"' : '';
 $link_params .= $target_param;
 $link_params .= $rel_nofollow;
 if ($field->parameters->get('use_direct_link', 0)) {
     // Direct access to the web-link, hits counting not possible
     $href = $value['link'];
 } else {
     // Indirect access to the web-link, via calling FLEXIcontent component, thus counting hits too
     $href = JRoute::_('index.php?option=com_flexicontent&fid=' . $field->id . '&cid=' . $item->id . '&ord=' . ($n + 1) . '&task=weblink');
 }
 // Create indirect link to web-link address with custom displayed text
 if (empty($linktext)) {
     $linktext = $title ? $title : $this->cleanurl(FLEXI_J30GE ? JStringPunycode::urlToUTF8($value['link']) : $value['link']);
 }
 $html = '<a href="' . $href . '" ' . $link_params . ' itemprop="url">' . $linktext . '</a>';
 // HITS: either as icon or as inline text or both
 $hits_html = '';
 if ($display_hits && $hits) {
     $hits_html = '<span class="fcweblink_hits">';
     if ($add_hits_img && @$hits_icon) {
         $hits_html .= sprintf($hits_icon, $hits);
     }
     if ($add_hits_txt) {
         $hits_html .= '(' . $hits . '&nbsp;' . JTEXT::_('FLEXI_HITS') . ')';
     }
     $hits_html .= '</span>';
     if ($prop == 'display_hitsonly') {
         $html = $hits_html;
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:31,代码来源:value_default.php

示例10: onDisplayFieldValue


//.........这里部分代码省略.........
         $posttext = $remove_space ? $posttext : ' ' . $posttext;
     }
     switch ($separatorf) {
         case 0:
             $separatorf = '&nbsp;';
             break;
         case 1:
             $separatorf = '<br />';
             break;
         case 2:
             $separatorf = '&nbsp;|&nbsp;';
             break;
         case 3:
             $separatorf = ',&nbsp;';
             break;
         case 4:
             $separatorf = $closetag . $opentag;
             break;
         case 5:
             $separatorf = '';
             break;
         default:
             $separatorf = '&nbsp;';
             break;
     }
     // Optimization, do some stuff outside the loop
     static $hits_icon = null;
     if ($hits_icon === null && ($display_hits == 1 || $display_hits == 3)) {
         $_hits_tip = flexicontent_html::getToolTip(null, '%s ' . JText::_('FLEXI_HITS', true), 0, 0);
         $_attribs = $display_hits == 1 ? 'class="' . (FLEXI_J30GE ? 'hasTooltip' : 'hasTip') . '" title="' . $_hits_tip . '"' : '';
         $hits_icon = FLEXI_J16GE ? JHTML::image('components/com_flexicontent/assets/images/' . 'user.png', JText::_('FLEXI_HITS'), $_attribs) : JHTML::_('image.site', 'user.png', 'components/com_flexicontent/assets/images/', NULL, NULL, JText::_('FLEXI_HITS'), $_attribs);
     }
     // Initialise property with default value
     $field->{$prop} = array();
     $n = 0;
     foreach ($values as $value) {
         if (empty($value['link']) && !$is_ingroup) {
             continue;
         }
         // Skip empty if not in field group
         if (empty($value['link'])) {
             $field->{$prop}[$n++] = '';
             continue;
         }
         // If not using property or property is empty, then use default property value
         // NOTE: default property values have been cleared, if (propertyname_usage != 2)
         $title = $usetitle && @$value['title'] ? $value['title'] : $default_title;
         $linktext = '';
         // no linktext for weblink for extended web link field if this is needed
         $hits = (int) @$value['hits'];
         $link_params = $title ? ' title="' . $title . '"' : '';
         $link_params .= $target_param;
         $link_params .= $rel_nofollow;
         if ($field->parameters->get('use_direct_link', 0)) {
             // Direct access to the web-link, hits counting not possible
             $href = $value['link'];
         } else {
             // Indirect access to the web-link, via calling FLEXIcontent component, thus counting hits too
             $href = JRoute::_('index.php?option=com_flexicontent&fid=' . $field->id . '&cid=' . $item->id . '&ord=' . ($n + 1) . '&task=weblink');
         }
         // Create indirect link to web-link address with custom displayed text
         if (empty($linktext)) {
             $linktext = $title ? $title : $this->cleanurl(FLEXI_J30GE ? JStringPunycode::urlToUTF8($value['link']) : $value['link']);
         }
         $html = '<a href="' . $href . '" ' . $link_params . ' itemprop="url">' . $linktext . '</a>';
         // HITS: either as icon or as inline text or both
         $hits_html = '';
         if ($display_hits && $hits) {
             $hits_html = '<span class="fcweblink_hits">';
             if ($add_hits_img && @$hits_icon) {
                 $hits_html .= sprintf($hits_icon, $hits);
             }
             if ($add_hits_txt) {
                 $hits_html .= '(' . $hits . '&nbsp;' . JTEXT::_('FLEXI_HITS') . ')';
             }
             $hits_html .= '</span>';
             if ($prop == 'display_hitsonly') {
                 $html = $hits_html;
             } else {
                 $html .= ' ' . $hits_html;
             }
         }
         // Add prefix / suffix
         $field->{$prop}[$n] = $pretext . $html . $posttext;
         $n++;
         if (!$multiple) {
             break;
         }
         // multiple values disabled, break out of the loop, not adding further values even if the exist
     }
     if (!$is_ingroup) {
         // Apply separator and open/close tags
         $field->{$prop} = implode($separatorf, $field->{$prop});
         if ($field->{$prop} !== '') {
             $field->{$prop} = $opentag . $field->{$prop} . $closetag;
         } else {
             $field->{$prop} = '';
         }
     }
 }
开发者ID:nettdotkomm,项目名称:flexicontent-cck,代码行数:101,代码来源:weblink.php

示例11: testUrlToUTF8

 /**
  * Tests JStringPunycode::urlToUTF8
  *
  * @return  void
  *
  * @since   3.2
  */
 public function testUrlToUTF8()
 {
     $this->assertEquals(JStringPunycode::urlToUTF8('http://www.xn----7sblgc4ag8bhcd.xn--p1ai'), 'http://www.джумла-тест.рф', 'Tests punycode decoding a UTF8 url in Cyrillic');
     $this->assertEquals(JStringPunycode::urlToUTF8('http://xn--au-gr-de-nos-plumes-fzb.fr'), 'http://au-gré-de-nos-plumes.fr', 'Tests punycode decoding a UTF8 url in French');
     $this->assertEquals(JStringPunycode::urlToUTF8('http://www.xn----7sblgc4ag8bhcd.xn--p1ai#test'), 'http://www.джумла-тест.рф#test', 'Tests punycode decoding a UTF8 url in Cyrillic with an anchor (See GitHub #4362)');
 }
开发者ID:n3t,项目名称:joomla-cms,代码行数:13,代码来源:JStringPunycodeTest.php

示例12: nl2br

                <?php echo $this->params->get('marker_mobile'); ?>
            </span>
		</dt>
		<dd>
            <span class="churchdirectory-mobile" itemprop="telephone">
                <?php echo nl2br($this->member->mobile); ?>
            </span>
		</dd>
	<?php endif; ?>
	<?php if ($this->member->webpage && $this->params->get('show_webpage')) : ?>
		<dt>
            <span class="<?php echo $this->params->get('marker_class'); ?>">
            </span>
		</dt>
		<dd>
            <span class="churchdirectory-webpage">
                <?php if (substr_count($this->member->webpage, 'http://', 0))
                {
	                $a = '';
                }
                else
                {
	                $a = 'http://';
                } ?>
	            <a href="<?php echo $a . $this->member->webpage; ?>" target="_blank">
		            <?php echo JStringPunycode::urlToUTF8($this->member->webpage); ?></a>
            </span>
		</dd>
	<?php endif; ?>
</dl>
开发者ID:Joomla-Bible-Study,项目名称:joomla_churchdirectory,代码行数:30,代码来源:default_address.php

示例13: array

 * @var   array    $options         Options available for this field.
 * @var   array    $inputType       Options available for this field.
 * @var   string   $accept          File types that are accepted.
 */
// Including fallback code for HTML5 non supported browsers.
JHtml::_('jquery.framework');
JHtml::_('script', 'system/html5fallback.js', false, true);
$autocomplete = !$autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $autocomplete . '"';
$autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete;
$attributes = array(!empty($size) ? ' size="' . $size . '"' : '', $disabled ? ' disabled' : '', $readonly ? ' readonly' : '', strlen($hint) ? ' placeholder="' . $hint . '"' : '', $autocomplete, $autofocus ? ' autofocus' : '', $spellcheck ? '' : ' spellcheck="false"', $onchange ? ' onchange="' . $onchange . '"' : '', !empty($maxLength) ? $maxLength : '', $required ? ' required aria-required="true"' : '');
?>
<input <?php 
echo $inputType;
?>
 name="<?php 
echo $name;
?>
" <?php 
echo !empty($class) ? ' class="' . $class . '"' : '';
?>
 id="<?php 
echo $id;
?>
" value="<?php 
echo htmlspecialchars(JStringPunycode::urlToUTF8($value), ENT_COMPAT, 'UTF-8');
?>
" <?php 
echo implode(' ', $attributes);
?>
 />
开发者ID:eshiol,项目名称:joomla-cms,代码行数:30,代码来源:url.php

示例14: onDisplayField


//.........这里部分代码省略.........
                $js .= "\n\t\t\t\t//jQuery('#sortables_" . $field->id . "').sortable('refresh');  // Refresh was done appendTo ?\n\t\t\t\t";
            }
            // Show new field, increment counters
            $js .= "\n\t\t\t\t//newField.fadeOut({ duration: 400, easing: 'swing' }).fadeIn({ duration: 200, easing: 'swing' });\n\t\t\t\tif (scroll_visible) fc_scrollIntoView(newField, 1);\n\t\t\t\tif (animate_visible) newField.css({opacity: 0.1}).animate({ opacity: 1 }, 800);\n\t\t\t\t\n\t\t\t\t// Enable tooltips on new element\n\t\t\t\tnewField.find('.hasTooltip').tooltip({'html': true,'container': newField});\n\t\t\t\t\n\t\t\t\trowCount" . $field->id . "++;       // incremented / decremented\n\t\t\t\tuniqueRowNum" . $field->id . "++;   // incremented only\n\t\t\t}\n\n\t\t\tfunction deleteField" . $field->id . "(el, groupval_box, fieldval_box)\n\t\t\t{\n\t\t\t\t// Find field value container\n\t\t\t\tvar row = fieldval_box ? fieldval_box : jQuery(el).closest('li');\n\t\t\t\t\n\t\t\t\t// Add empty container if last element, instantly removing the given field value container\n\t\t\t\tif(rowCount" . $field->id . " == 1)\n\t\t\t\t\taddField" . $field->id . "(null, groupval_box, row, {remove_previous: 1, scroll_visible: 0, animate_visible: 0});\n\t\t\t\t\n\t\t\t\t// Remove if not last one, if it is last one, we issued a replace (copy,empty new,delete old) above\n\t\t\t\tif(rowCount" . $field->id . " > 1) {\n\t\t\t\t\t// Destroy the remove/add/etc buttons, so that they are not reclicked, while we do the hide effect (before DOM removal of field value)\n\t\t\t\t\trow.find('.fcfield-delvalue').remove();\n\t\t\t\t\trow.find('.fcfield-insertvalue').remove();\n\t\t\t\t\trow.find('.fcfield-drag-handle').remove();\n\t\t\t\t\t// Do hide effect then remove from DOM\n\t\t\t\t\trow.slideUp(400, function(){ jQuery(this).remove(); });\n\t\t\t\t\trowCount" . $field->id . "--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t";
            $css .= '';
            $remove_button = '<span class="fcfield-delvalue' . (JComponentHelper::getParams('com_flexicontent')->get('form_font_icons', 1) ? ' fcfont-icon' : '') . '" title="' . JText::_('FLEXI_REMOVE_VALUE') . '" onclick="deleteField' . $field->id . '(this);"></span>';
            $move2 = '<span class="fcfield-drag-handle' . (JComponentHelper::getParams('com_flexicontent')->get('form_font_icons', 1) ? ' fcfont-icon' : '') . '" title="' . JText::_('FLEXI_CLICK_TO_DRAG') . '"></span>';
            $add_here = '';
            $add_here .= $add_position == 2 || $add_position == 3 ? '<span class="fcfield-insertvalue fc_before' . (JComponentHelper::getParams('com_flexicontent')->get('form_font_icons', 1) ? ' fcfont-icon' : '') . '" onclick="addField' . $field->id . '(null, jQuery(this).closest(\'ul\'), jQuery(this).closest(\'li\'), {insert_before: 1});" title="' . JText::_('FLEXI_ADD_BEFORE') . '"></span> ' : '';
            $add_here .= $add_position == 1 || $add_position == 3 ? '<span class="fcfield-insertvalue fc_after' . (JComponentHelper::getParams('com_flexicontent')->get('form_font_icons', 1) ? ' fcfont-icon' : '') . '"  onclick="addField' . $field->id . '(null, jQuery(this).closest(\'ul\'), jQuery(this).closest(\'li\'), {insert_before: 0});" title="' . JText::_('FLEXI_ADD_AFTER') . '"></span> ' : '';
        } else {
            $remove_button = '';
            $move2 = '';
            $add_here = '';
            $js .= '';
            $css .= '';
        }
        if ($js) {
            $document->addScriptDeclaration($js);
        }
        if ($css) {
            $document->addStyleDeclaration($css);
        }
        // *****************************************
        // Create field's HTML display for item form
        // *****************************************
        $field->html = array();
        $n = 0;
        //if ($use_ingroup) {print_r($field->value);}
        foreach ($field->value as $value) {
            // Compatibility for unserialized values (e.g. reload user input after form validation error) or for NULL values in a field group
            if (!is_array($value)) {
                $v = !empty($value) ? @unserialize($value) : false;
                $value = $v !== false || $v === 'b:0;' ? $v : array('link' => $value, 'title' => '', 'hits' => 0);
            }
            if (empty($value['link']) && !$use_ingroup && $n) {
                continue;
            }
            // If at least one added, skip empty if not in field group
            $fieldname_n = $fieldname . '[' . $n . ']';
            $elementid_n = $elementid . '_' . $n;
            // NOTE: HTML tag id of this form element needs to match the -for- attribute of label HTML tag of this FLEXIcontent field, so that label will be marked invalid when needed
            $value['link'] = !empty($value['link']) ? $value['link'] : $default_link;
            $value['link'] = htmlspecialchars(FLEXI_J30GE ? JStringPunycode::urlToUTF8($value['link']) : $value['link'], ENT_COMPAT, 'UTF-8');
            $link = '
				<div class="nowrap_box">
					<label class="label urllink-lbl" for="' . $elementid_n . '_link">' . JText::_('FLEXI_FIELD_URL') . '</label>
					<input class="urllink fcfield_textval ' . $required . '" name="' . $fieldname_n . '[link]" id="' . $elementid_n . '_link" type="text" ' . $attribs . ' value="' . $value['link'] . '" />
				</div>';
            $title = '';
            if ($usetitle) {
                $value['title'] = !empty($value['title']) ? $value['title'] : $default_title;
                $value['title'] = htmlspecialchars($value['title'], ENT_COMPAT, 'UTF-8');
                $title = '
				<div class="nowrap_box urltitle-lbl">
					<label class="label" for="' . $elementid_n . '_title">' . JText::_('FLEXI_FIELD_URLTITLE') . '</label>
					<input class="urltitle fcfield_textval" name="' . $fieldname_n . '[title]" id="' . $elementid_n . '_title" type="text" size="' . $size . '" value="' . $value['title'] . '" />
				</div>';
            }
            $hits = '';
            $usehits = 1;
            if ($usehits) {
                $hits = (int) @$value['hits'];
                $hits = '
					<div class="nowrap_box urlhits-lbl">
						<label class="label hits" for="' . $elementid_n . '_hits">' . JText::_('FLEXI_FIELD_HITS') . '</label>
						<span class="hitcount">' . $hits . '</span> 
						<input class="urlhits" name="' . $fieldname_n . '[hits]" id="' . $elementid_n . '_hits" type="hidden" value="' . $hits . '" />
					</div>';
            }
            $field->html[] = '
				' . $link . '
				' . $title . '
				' . $hits . '
				' . ($use_ingroup ? '' : $move2) . '
				' . ($use_ingroup ? '' : $remove_button) . '
				' . ($use_ingroup || !$add_position ? '' : $add_here) . '
				';
            $n++;
            if (!$multiple) {
                break;
            }
            // multiple values disabled, break out of the loop, not adding further values even if the exist
        }
        if ($use_ingroup) {
            // do not convert the array to string if field is in a group
        } else {
            if ($multiple) {
                // handle multiple records
                $field->html = !count($field->html) ? '' : '<li class="' . $value_classes . '">' . implode('</li><li class="' . $value_classes . '">', $field->html) . '</li>';
                $field->html = '<ul class="fcfield-sortables" id="sortables_' . $field->id . '">' . $field->html . '</ul>';
                if (!$add_position) {
                    $field->html .= '<span class="fcfield-addvalue ' . (JComponentHelper::getParams('com_flexicontent')->get('form_font_icons', 1) ? ' fcfont-icon' : '') . '" onclick="addField' . $field->id . '(this);" title="' . JText::_('FLEXI_ADD_TO_BOTTOM') . '">' . JText::_('FLEXI_ADD_VALUE') . '</span>';
                }
            } else {
                // handle single values
                $field->html = '<div class="fcfieldval_container valuebox fcfieldval_container_' . $field->id . '">' . $field->html[0] . '</div>';
            }
        }
    }
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:101,代码来源:weblink.php

示例15: foreach

    $fields = $this->item->profile->getFieldset('profile');
    ?>
	<div class="contact-profile" id="users-profile-custom">
		<dl class="dl-horizontal">
			<?php 
    foreach ($fields as $profile) {
        if ($profile->value) {
            echo '<dt>' . $profile->label . '</dt>';
            $profile->text = htmlspecialchars($profile->value, ENT_COMPAT, 'UTF-8');
            switch ($profile->id) {
                case 'profile_website':
                    $v_http = substr($profile->value, 0, 4);
                    if ($v_http === 'http') {
                        echo '<dd><a href="' . $profile->text . '">' . JStringPunycode::urlToUTF8($profile->text) . '</a></dd>';
                    } else {
                        echo '<dd><a href="http://' . $profile->text . '">' . JStringPunycode::urlToUTF8($profile->text) . '</a></dd>';
                    }
                    break;
                case 'profile_dob':
                    echo '<dd>' . JHtml::_('date', $profile->text, JText::_('DATE_FORMAT_LC4'), false) . '</dd>';
                    break;
                default:
                    echo '<dd>' . $profile->text . '</dd>';
                    break;
            }
        }
    }
    ?>
		</dl>
	</div>
<?php 
开发者ID:Rai-Ka,项目名称:joomla-cms,代码行数:31,代码来源:default_profile.php


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