Exemplo n.º 1
0
 function getInput()
 {
     JHtml::_('behavior.modal');
     //$this->_loadAssets();
     $this->_setOptions();
     if ($this->container->hasParameter('roksprocket.current_provider')) {
         /** @var RokSprocket_IProvider $provider */
         $provider = $this->container->getParameter('roksprocket.current_provider');
         $provider->filterPerItemTypes($this->type, $this->fieldname, $this->options);
     }
     if (preg_match("/^-([a-z]{1,})-\$/", $this->value)) {
         if ($this->value == '-article-' && preg_match("/_title\$/", $this->id)) {
             $this->value = '-title-';
         }
         $this->isCustom = false;
     }
     $class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . ' peritempicker' . (count($this->options) == 1 ? ' single' : '') . '"' : ' class="peritempicker"';
     $placeholder = $this->element['placeholder'] ? ' placeholder="' . (string) $this->element['placeholder'] . '"' : '';
     $html = array();
     $cleaned_value = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8');
     $html[] = '<div class="peritempicker-wrapper' . (!$this->isCustom ? ' peritempicker-noncustom' : '') . '" data-peritempicker="true" data-peritempicker-id="' . $this->id . '" data-peritempicker-name="' . $this->name . '">';
     $html[] = '		<input data-peritempicker-display="true" data-original-title="' . $cleaned_value . '" type="text" value="' . $cleaned_value . '" ' . $class . $placeholder . ' />';
     $html[] = '		<input type="hidden" id="' . $this->id . '" name="' . $this->name . '" value="' . $cleaned_value . '" />';
     $html[] = $this->_getDropdown();
     $html[] = '</div>';
     return implode("\n", $html);
 }
Exemplo n.º 2
0
 function getInput()
 {
     JHtml::_('behavior.modal');
     //$this->_loadAssets();
     $this->_setOptions();
     if ($this->container->hasParameter('roksprocket.current_provider')) {
         /** @var RokSprocket_IProvider $provider */
         $provider = $this->container->getParameter('roksprocket.current_provider');
         $provider->filterPerItemTypes($this->type, $this->fieldname, $this->options);
     }
     if (preg_match("/^-([a-z]{1,})-\$/", $this->value)) {
         if ($this->value == '-article-' && preg_match("/_title\$/", $this->id)) {
             $this->value = '-title-';
         }
         $this->isCustom = false;
     }
     if (!$this->value) {
         $this->value = array();
     }
     if (!is_array($this->value)) {
         if (strpos($this->value, ',') === false) {
             $this->value = array($this->value);
         } else {
             $this->value = explode(",", preg_replace("/\\s/", "", $this->value));
         }
     }
     $class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . ' peritempickertags' . (count($this->options) == 1 ? ' single' : '') . '"' : ' class="peritempickertags"';
     $placeholder = $this->element['placeholder'] ? ' placeholder="' . (string) $this->element['placeholder'] . '"' : '';
     $html = array();
     //$cleaned_value = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8');
     $html[] = '<div class="peritempickertags-wrapper' . (!$this->isCustom ? ' peritempickertags-noncustom' : '') . '" data-peritempickertags="true" data-peritempickertags-id="' . $this->id . '" data-peritempickertags-name="' . $this->name . '">';
     $html[] = '<div class="tags" data-tags>';
     $html[] = '   <ul class="tags-holder" data-tags-holder>';
     $html[] = $this->_createTags();
     $html[] = '       <li class="tags-input main-input"><input type="text" data-tags-maininput style="width: 15px;" /></li>';
     $html[] = '   </ul>';
     $html[] = '   <input type="hidden" id="' . $this->id . '" name="' . $this->name . '" ' . $class . ' value="' . implode(", ", $this->value) . '" data-tags-input data-peritempickertags-display="true" />';
     //$html[] = ' <input data-peritempickertags-display="true" data-original-title="'.$cleaned_value.'" type="text" value="'.$cleaned_value.'" '.$class.$placeholder.' />';
     $html[] = '</div>';
     //$html[] = '     <input type="hidden" id="'.$this->id.'" name="'.$this->name.'" value="'.$cleaned_value.'" />';
     $html[] = $this->_getDropdown();
     $html[] = '</div>';
     return implode("\n", $html);
 }