Example #1
0
 /**
  * Method to get the field input markup for a generic list.
  * Use the multiple attribute to enable multiselect.
  *
  * @return  string  The field input markup.
  */
 protected function getInput()
 {
     // Initialize variables.
     $attributes = array('type' => 'text', 'value' => htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8'), 'name' => $this->name, 'id' => $this->id, 'size' => $this->element['size'] ? (int) $this->element['size'] : '', 'maxlength' => $this->element['maxlength'] ? (int) $this->element['maxlength'] : '', 'class' => 'orcid' . ($this->element['class'] ? (string) $this->element['class'] : ''), 'autocomplete' => (string) $this->element['autocomplete'] == 'off' ? 'off' : '', 'readonly' => (string) $this->element['readonly'] == 'true' ? 'readonly' : '', 'disabled' => (string) $this->element['disabled'] == 'true' ? 'disabled' : '', 'onchange' => $this->element['onchange'] ? (string) $this->element['onchange'] : '');
     $attr = array();
     foreach ($attributes as $key => $value) {
         if ($key != 'value' && !$value) {
             continue;
         }
         $attr[] = $key . '="' . $value . '"';
     }
     $attr = implode(' ', $attr);
     $html = array();
     $html[] = '<div class="grid">';
     $html[] = '	<div class="col span9">';
     $html[] = '		<input ' . $attr . ' placeholder="####-####-####-####" />';
     $html[] = '		<input type="hidden" name="base_uri" id="base_uri" value="' . rtrim(Request::base(true), '/') . '" />';
     $html[] = '	</div>';
     $html[] = '	<div class="col span3 omega">';
     $html[] = '		<a class="btn button icon-search orcid-fetch" data-base="' . rtrim(Request::base(true), '/') . '" data-id="' . $this->id . '" href="' . Request::base() . '/' . Route::url('index.php?option=com_members&controller=orcid') . '">' . Lang::txt('COM_MEMBERS_PROFILE_ORCID_FIND') . '</a>';
     $html[] = '	</div>';
     $html[] = '</div>';
     $html[] = '<p><img src="' . Request::root() . '/core/components/com_members/site/assets/img/orcid-logo.png" width="80" alt="ORCID" /> ' . Lang::txt('COM_MEMBERS_PROFILE_ORCID_ABOUT') . '</p>';
     Behavior::framework(true);
     Behavior::modal();
     if (file_exists(PATH_ROOT . '/core/components/com_members/site/assets/js/orcid.js')) {
         Document::addScript('/core/components/com_members/site/assets/js/orcid.js?t=' . filemtime(PATH_ROOT . '/core/components/com_members/site/assets/js/orcid.js'));
     }
     return implode($html);
 }
Example #2
0
 /**
  * Fetch the HTML for the button
  *
  * @param   string   $type     Unused string, formerly button type.
  * @param   string   $name     Button name
  * @param   string   $text     The link text
  * @param   string   $url      URL for popup
  * @param   integer  $width    Width of popup
  * @param   integer  $height   Height of popup
  * @param   integer  $top      Top attribute.
  * @param   integer  $left     Left attribute
  * @param   string   $onClose  JavaScript for the onClose event.
  * @return  string   HTML string for the button
  */
 public function fetchButton($type = 'Popup', $name = '', $text = '', $url = '', $width = 640, $height = 480, $top = 0, $left = 0, $onClose = '')
 {
     Behavior::modal();
     $text = \Lang::txt($text);
     $class = $this->fetchIconClass($name);
     $doTask = $this->_getCommand($name, $url, $width, $height, $top, $left);
     $html = "<a data-title=\"{$text}\" class=\"modal\" href=\"{$doTask}\" rel=\"{size: {width: {$width}, height: {$height}}, onClose: function() {" . $onClose . "}}\">\n";
     $html .= "<span class=\"{$class}\">\n";
     $html .= "{$text}\n";
     $html .= "</span>\n";
     $html .= "</a>\n";
     return $html;
 }