Exemple #1
0
 /**
  * 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 . ' />';
 }
Exemple #2
0
 /**
  * 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 . ' />';
 }
Exemple #3
0
 /**
  * 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 . '/>';
 }
Exemple #4
0
 /**
  * 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');
     }
 }
Exemple #5
0
 /**
  * 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);
 }
Exemple #6
0
    ?>
		</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>
Exemple #7
0
 /**
  * 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>';
         }
     }
 }
Exemple #8
0
/**
 * @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 . ' />';
?>


 $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;
 function onDisplayFieldValue(&$field, $item, $values = null, $prop = 'display')
 {
     if (!in_array($field->field_type, self::$field_types)) {
         return;
     }
     // Get isMobile / isTablet Flags
     static $isMobile = null;
     static $isTablet = null;
     static $useMobile = null;
     if ($useMobile === null) {
         $cparams = JComponentHelper::getParams('com_flexicontent');
         $force_desktop_layout = $cparams->get('force_desktop_layout', 0);
         //$start_microtime = microtime(true);
         $mobileDetector = flexicontent_html::getMobileDetector();
         $isMobile = $mobileDetector->isMobile();
         $isTablet = $mobileDetector->isTablet();
         $useMobile = $force_desktop_layout ? $isMobile && !$isTablet : $isMobile;
         //$time_passed = round(1000000 * 10 * (microtime(true) - $start_microtime)) / 10;
         //printf('<br/>-- [Detect Mobile: %.3f s] ', $time_passed/1000000);
     }
     $field->label = JText::_($field->label);
     // Some variables
     $is_ingroup = !empty($field->ingroup);
     $use_ingroup = $field->parameters->get('use_ingroup', 0);
     $multiple = $use_ingroup || (int) $field->parameters->get('allow_multiple', 0);
     // Value handling parameters
     $lang_filter_values = 0;
     //$field->parameters->get( 'lang_filter_values', 1);
     // some parameter shortcuts
     $target = $field->parameters->get('targetblank', 0);
     $target_param = $target ? ' target="_blank"' : '';
     $display_hits = $field->parameters->get('display_hits', 0);
     $add_hits_img = $display_hits == 1 || $display_hits == 3;
     $add_hits_txt = $display_hits == 2 || $display_hits == 3 || $isMobile;
     $rel_nofollow = $field->parameters->get('add_rel_nofollow', 0) ? ' rel="nofollow"' : '';
     // URL value
     $link_usage = $field->parameters->get('link_usage', 0);
     $default_link = $link_usage == 2 ? $field->parameters->get('default_value_link', '') : '';
     $default_link = $default_link ? JText::_($default_link) : '';
     // URL title & linking text (optional)
     $usetitle = $field->parameters->get('use_title', 0);
     $title_usage = $field->parameters->get('title_usage', 0);
     $default_title = $title_usage == 2 ? JText::_($field->parameters->get('default_value_title', '')) : '';
     $default_title = $default_title ? JText::_($default_title) : '';
     // Get field values
     $values = $values ? $values : $field->value;
     // Check for no values and no default value, and return empty display
     if (empty($values)) {
         if (!strlen($default_link)) {
             $field->{$prop} = $is_ingroup ? array() : '';
             return;
         }
         $values = array();
         $values[0]['link'] = $default_link;
         $values[0]['title'] = $default_title;
         $values[0]['hits'] = 0;
         $values[0] = serialize($values[0]);
     }
     // (* BECAUSE OF THIS, the value display loop expects unserialized values)
     foreach ($values as &$value) {
         // Compatibility for unserialized values 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);
         }
     }
     unset($value);
     // Unset this or you are looking for trouble !!!, because it is a reference and reusing it will overwrite the pointed variable !!!
     // Prefix - Suffix - Separator parameters, replacing other field values if found
     $remove_space = $field->parameters->get('remove_space', 0);
     $pretext = FlexicontentFields::replaceFieldValue($field, $item, $field->parameters->get('pretext', ''), 'pretext');
     $posttext = FlexicontentFields::replaceFieldValue($field, $item, $field->parameters->get('posttext', ''), 'posttext');
     $separatorf = $field->parameters->get('separatorf', 1);
     $opentag = FlexicontentFields::replaceFieldValue($field, $item, $field->parameters->get('opentag', ''), 'opentag');
     $closetag = FlexicontentFields::replaceFieldValue($field, $item, $field->parameters->get('closetag', ''), 'closetag');
     if ($pretext) {
         $pretext = $remove_space ? $pretext : $pretext . ' ';
     }
     if ($posttext) {
         $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} = '';
         }
     }
 }
 /**
  * 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)');
 }
                <?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>
Exemple #13
0
 * @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);
?>
 />
    function onDisplayField(&$field, &$item)
    {
        if (!in_array($field->field_type, self::$field_types)) {
            return;
        }
        $field->label = JText::_($field->label);
        $use_ingroup = $field->parameters->get('use_ingroup', 0);
        if ($use_ingroup) {
            $field->formhidden = 3;
        }
        if ($use_ingroup && empty($field->ingroup)) {
            return;
        }
        // initialize framework objects and other variables
        $document = JFactory::getDocument();
        // ****************
        // Number of values
        // ****************
        $multiple = $use_ingroup || (int) $field->parameters->get('allow_multiple', 0);
        $max_values = $use_ingroup ? 0 : (int) $field->parameters->get('max_values', 0);
        $required = $field->parameters->get('required', 0);
        $required = $required ? ' required' : '';
        $add_position = (int) $field->parameters->get('add_position', 3);
        // ***
        // URL
        // ***
        // Default value
        $link_usage = $field->parameters->get('link_usage', 0);
        $default_link = $item->version == 0 || $link_usage > 0 ? $field->parameters->get('default_value_link', '') : '';
        $default_link = $default_link ? JText::_($default_link) : '';
        // ***********************************
        // URL title & linking text (optional)
        // ***********************************
        // Default value
        $title_usage = $field->parameters->get('title_usage', 0);
        $default_title = $item->version == 0 || $title_usage > 0 ? JText::_($field->parameters->get('default_value_title', '')) : '';
        $default_title = $default_title ? JText::_($default_title) : '';
        $usetitle = $field->parameters->get('use_title', 0);
        // **********
        // Hits usage
        // **********
        $usehits = $field->parameters->get('use_hits', 1);
        // Form fields display parameters
        $size = (int) $field->parameters->get('size', 30);
        $maxlength = (int) $field->parameters->get('maxlength', 0);
        // client/server side enforced
        // create extra HTML TAG parameters for the form field
        $attribs = $field->parameters->get('extra_attributes', '');
        if ($maxlength) {
            $attribs .= ' maxlength="' . $maxlength . '" ';
        }
        $attribs .= ' size="' . $size . '" ';
        // Initialise property with default value
        if (!$field->value) {
            $field->value = array();
            $field->value[0]['link'] = $default_link;
            $field->value[0]['title'] = $default_title;
            $field->value[0]['hits'] = 0;
            $field->value[0] = serialize($field->value[0]);
        }
        // CSS classes of value container
        $value_classes = 'fcfieldval_container valuebox fcfieldval_container_' . $field->id;
        // Field name and HTML TAG id
        $fieldname = 'custom[' . $field->name . ']';
        $elementid = 'custom_' . $field->name;
        $js = "";
        $css = "";
        if ($multiple) {
            // Add the drag and drop sorting feature
            if (!$use_ingroup) {
                $js .= "\n\t\t\tjQuery(document).ready(function(){\n\t\t\t\tjQuery('#sortables_" . $field->id . "').sortable({\n\t\t\t\t\thandle: '.fcfield-drag-handle',\n\t\t\t\t\tcontainment: 'parent',\n\t\t\t\t\ttolerance: 'pointer'\n\t\t\t\t});\n\t\t\t});\n\t\t\t";
            }
            if ($max_values) {
                JText::script("FLEXI_FIELD_MAX_ALLOWED_VALUES_REACHED", true);
            }
            $js .= "\n\t\t\tvar uniqueRowNum" . $field->id . "\t= " . count($field->value) . ";  // Unique row number incremented only\n\t\t\tvar rowCount" . $field->id . "\t= " . count($field->value) . ";      // Counts existing rows to be able to limit a max number of values\n\t\t\tvar maxValues" . $field->id . " = " . $max_values . ";\n\t\t\t\n\t\t\tfunction addField" . $field->id . "(el, groupval_box, fieldval_box, params)\n\t\t\t{\n\t\t\t\tvar insert_before   = (typeof params!== 'undefined' && typeof params.insert_before   !== 'undefined') ? params.insert_before   : 0;\n\t\t\t\tvar remove_previous = (typeof params!== 'undefined' && typeof params.remove_previous !== 'undefined') ? params.remove_previous : 0;\n\t\t\t\tvar scroll_visible  = (typeof params!== 'undefined' && typeof params.scroll_visible  !== 'undefined') ? params.scroll_visible  : 1;\n\t\t\t\tvar animate_visible = (typeof params!== 'undefined' && typeof params.animate_visible !== 'undefined') ? params.animate_visible : 1;\n\t\t\t\t\n\t\t\t\tif((rowCount" . $field->id . " >= maxValues" . $field->id . ") && (maxValues" . $field->id . " != 0)) {\n\t\t\t\t\talert(Joomla.JText._('FLEXI_FIELD_MAX_ALLOWED_VALUES_REACHED') + maxValues" . $field->id . ");\n\t\t\t\t\treturn 'cancel';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Find last container of fields and clone it to create a new container of fields\n\t\t\t\tvar lastField = fieldval_box ? fieldval_box : jQuery(el).prev().children().last();\n\t\t\t\tvar newField  = lastField.clone();\n\t\t\t\t";
            // 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
            // Update new URL's address
            $js .= "\n\t\t\t\tvar theInput = newField.find('input.urllink').first();\n\t\t\t\ttheInput.val('" . $default_link . "');\n\t\t\t\ttheInput.attr('name','" . $fieldname . "['+uniqueRowNum" . $field->id . "+'][link]');\n\t\t\t\ttheInput.attr('id','" . $elementid . "_'+uniqueRowNum" . $field->id . "+'_link');\n\t\t\t\tnewField.find('.urllink-lbl').first().attr('for','" . $elementid . "_'+uniqueRowNum" . $field->id . "+'_link');\n\t\t\t\t";
            // Update new URL optional properties
            if ($usetitle) {
                $js .= "\n\t\t\t\tvar theInput = newField.find('input.urltitle').first();\n\t\t\t\ttheInput.val('" . $default_title . "');\n\t\t\t\ttheInput.attr('name','" . $fieldname . "['+uniqueRowNum" . $field->id . "+'][title]');\n\t\t\t\ttheInput.attr('id','" . $elementid . "_'+uniqueRowNum" . $field->id . "+'_title');\n\t\t\t\tnewField.find('.urltitle-lbl').first().attr('for','" . $elementid . "_'+uniqueRowNum" . $field->id . "+'_title');\n\t\t\t\t";
            }
            if ($usehits) {
                $js .= "\n\t\t\t\ttheInput = newField.find('input.urlhits').first();\n\t\t\t\ttheInput.val('0');\n\t\t\t\ttheInput.attr('name','" . $fieldname . "['+uniqueRowNum" . $field->id . "+'][hits]');\n\t\t\t\ttheInput.attr('id','" . $elementid . "_'+uniqueRowNum" . $field->id . "+'_hits');\n\t\t\t\tnewField.find('.urlhits-lbl').first().attr('for','" . $elementid . "_'+uniqueRowNum" . $field->id . "+'_hits');\n\t\t\t\t\n\t\t\t\t// Set hits to zero for new row value\n\t\t\t\tnewField.find('span span').html('0');\n\t\t\t\t";
            }
            // Add new field to DOM
            $js .= "\n\t\t\t\tlastField ?\n\t\t\t\t\t(insert_before ? newField.insertBefore( lastField ) : newField.insertAfter( lastField ) ) :\n\t\t\t\t\tnewField.appendTo( jQuery('#sortables_" . $field->id . "') ) ;\n\t\t\t\tif (remove_previous) lastField.remove();\n\t\t\t\t";
            // Add new element to sortable objects (if field not in group)
            if (!$use_ingroup) {
                $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>';
            }
        }
    }
Exemple #15
0
    $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 
    ?>
" >
		<?php 
    echo $this->params->get('marker_google_plus');
    ?>
		</span>
	</dt>
			
	<dd>
		<span class="proveedor-googlep">
			<a href="<?php 
    echo $this->proveedor->google_plus;
    ?>
" rel="nofollow" target="_blank" itemprop="url">
			<?php 
    echo JStringPunycode::urlToUTF8($this->proveedor->google_plus);
    ?>
</a>
		</span>
	</dd>
	
	
	
<?php 
}
?>




				<?php 
        if ($this->items[$i]->published == 0) {
            ?>
					<span class="label label-warning"><?php 
            echo JText::_('JUNPUBLISHED');
            ?>
</span>
				<?php 
        }
        ?>
				<br />
				<?php 
        if ($this->params->get('show_link')) {
            ?>
					<?php 
            $link = JStringPunycode::urlToUTF8($item->link);
            ?>
					<span class="list pull-left">
							<a href="<?php 
            echo $item->link;
            ?>
"><?php 
            echo $link;
            ?>
</a>
					</span>
					<br/>
				<?php 
        }
        ?>
				</li>
 function _getInitialParams()
 {
     $filename = JPATH_SITE . "/plugins/content/plugin_tommy/plugin_tommy.xml";
     // PHP changed external entity loading. This causes a warning when reading a local file. Switch to false to enable external entity loading.
     if (function_exists('libxml_disable_entity_loader')) {
         $oldValue = libxml_disable_entity_loader(false);
     }
     if ($xml = simplexml_load_file($filename)) {
         if (isset($xml->config[0]->fields[0])) {
             $root = $xml->config[0]->fields[0];
         } else {
             $root =& $xml;
         }
         foreach ($root->children() as $params) {
             foreach ($params->children() as $param) {
                 if ($param->attributes()->export == '1') {
                     $name = $param->attributes()->name;
                     $type = $param->attributes()->type;
                     if ($type == "checkbox") {
                         $this->initparams->{$name} = $this->params->get($name, $param->attributes()->default) == 1 ? true : false;
                     } elseif ($type == "number") {
                         $this->initparams->{$name} = (int) $this->params->get($name, $param->attributes()->default);
                     } elseif ($type == "url") {
                         $this->initparams->{$name} = JStringPunycode::urlToUTF8($this->params->get($name, $param->attributes()->default));
                     } else {
                         $this->initparams->{$name} = (string) $this->params->get($name, $param->attributes()->default);
                     }
                 }
             }
         }
     }
     if (function_exists('libxml_disable_entity_loader')) {
         libxml_disable_entity_loader($oldValue);
     }
     // Clean up generated variables
     unset($filename, $xml, $root, $params, $param, $name, $nm, $oldValue);
 }