/**
  * Display a batch widget for the client selector.
  *
  * @return  string  The necessary HTML for the widget.
  *
  * @since   2.5
  */
 public static function clients()
 {
     JHtml::_('bootstrap.tooltip');
     // Create the batch selector to change the client on a selection list.
     $lines = array('<label id="batch-client-lbl" for="batch-client" class="hasTooltip" title="' . JHtml::tooltipText('COM_BANNERS_BATCH_CLIENT_LABEL', 'COM_BANNERS_BATCH_CLIENT_LABEL_DESC') . '">', JText::_('COM_BANNERS_BATCH_CLIENT_LABEL'), '</label>', '<select name="batch[client_id]" class="inputbox" id="batch-client-id">', '<option value="">' . JText::_('COM_BANNERS_BATCH_CLIENT_NOCHANGE') . '</option>', '<option value="0">' . JText::_('COM_BANNERS_NO_CLIENT') . '</option>', JHtml::_('select.options', static::clientlist(), 'value', 'text'), '</select>');
     return implode("\n", $lines);
 }
Example #2
0
 /**
  * Method to get form input field
  *
  * @return string
  */
 protected function getinput()
 {
     $doc = JFactory::getDocument();
     $fieldName = $this->name;
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_bwpostman/tables');
     $newsletter = JTable::getInstance('newsletters', 'BwPostmanTable');
     if ($this->value) {
         $newsletter->load($this->value);
     } else {
         $newsletter->subject = JText::_('COM_BWPOSTMAN_SELECT_NEWSLETTER');
     }
     $js = "\r\n\t\tfunction SelectNewsletter(id, subject) {\r\n\t\t\tdocument.getElementById('a_id').value = id;\r\n\t\t\tdocument.getElementById('a_name').value = subject;\r\n\t\t\tvar btn = window.parent.document.getElementById('sbox-btn-close');\r\n\t\t\tbtn.fireEvent('click');\r\n\t\t}";
     $link = 'index.php?option=com_bwpostman&amp;view=newsletterelement&amp;tmpl=component';
     $doc->addScriptDeclaration($js);
     JHTML::_('behavior.modal', 'a.modal');
     // The active newsletter id field.
     if (0 == (int) $this->value) {
         $value = '';
     } else {
         $value = (int) $this->value;
     }
     // class='required' for client side validation
     $class = '';
     if ($this->required) {
         $class = ' class="required modal-value"';
     }
     $html = '<span class="input-append">';
     $html .= '<input type="text" class="input-medium" id="a_name" value="' . $newsletter->subject . '" disabled="disabled" size="35" />';
     $html .= '<a class="modal btn hasTooltip" title="' . JHtml::tooltipText('COM_BWPOSTMAN_SELECT_NEWSLETTER') . '" href="' . $link . '" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> ' . JText::_('JSELECT') . '</a>';
     $html .= "\n<input type=\"hidden\" id=\"a_id\" {$class} name=\"{$fieldName}\" value=\"{$value}\" />";
     return $html;
 }
Example #3
0
 /**
  * Method to get the field label markup for a spacer.
  * Use the label text or name from the XML element as the spacer or
  * Use a hr="true" to automatically generate plain hr markup
  *
  * @return  string  The field label markup.
  *
  * @since   11.1
  */
 protected function getLabel()
 {
     $html = array();
     $class = !empty($this->class) ? ' class="' . $this->class . '"' : '';
     $html[] = '<span class="spacer">';
     $html[] = '<span class="before"></span>';
     $html[] = '<span' . $class . '>';
     if ((string) $this->element['hr'] == 'true') {
         $html[] = '<hr' . $class . ' />';
     } else {
         $label = '';
         // Get the label text from the XML element, defaulting to the element name.
         $text = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name'];
         $text = $this->translateLabel ? JText::_($text) : $text;
         // Build the class for the label.
         $class = !empty($this->description) ? 'hasTooltip' : '';
         $class = $this->required == true ? $class . ' required' : $class;
         // Add the opening label tag and main attributes attributes.
         $label .= '<label id="' . $this->id . '-lbl" class="' . $class . '"';
         // If a description is specified, use it to build a tooltip.
         if (!empty($this->description)) {
             JHtml::_('bootstrap.tooltip');
             $label .= ' title="' . JHtml::tooltipText(trim($text, ':'), JText::_($this->description), 0) . '"';
         }
         // Add the label text and closing tag.
         $label .= '>' . $text . '</label>';
         $html[] = $label;
     }
     $html[] = '</span>';
     $html[] = '<span class="after"></span>';
     $html[] = '</span>';
     return implode('', $html);
 }
Example #4
0
 public static function edit($weblink, $params, $attribs = array())
 {
     $uri = JUri::getInstance();
     if ($params && $params->get('popup')) {
         return;
     }
     if ($weblink->state < 0) {
         return;
     }
     JHtml::_('bootstrap.tooltip');
     $url = WeblinksHelperRoute::getFormRoute($weblink->id, base64_encode($uri));
     $icon = $weblink->state ? 'edit.png' : 'edit_unpublished.png';
     $text = JHtml::_('image', 'system/' . $icon, JText::_('JGLOBAL_EDIT'), null, true);
     if ($weblink->state == 0) {
         $overlib = JText::_('JUNPUBLISHED');
     } else {
         $overlib = JText::_('JPUBLISHED');
     }
     $date = JHtml::_('date', $weblink->created);
     $author = $weblink->created_by_alias ? $weblink->created_by_alias : $weblink->author;
     $overlib .= '&lt;br /&gt;';
     $overlib .= $date;
     $overlib .= '&lt;br /&gt;';
     $overlib .= htmlspecialchars($author, ENT_COMPAT, 'UTF-8');
     $button = JHtml::_('link', JRoute::_($url), $text);
     $output = '<span class="hasTooltip" title="' . JHtml::tooltipText('COM_WEBLINKS_EDIT') . ' :: ' . $overlib . '">' . $button . '</span>';
     return $output;
 }
Example #5
0
 protected function getInput()
 {
     // Load language
     JFactory::getLanguage()->load('com_sppagebuilder', JPATH_ADMINISTRATOR);
     // Build the script.
     $script = array();
     // Select button script
     $script[] = '	function jSelectPage_' . $this->id . '(id, title, catid, object) {';
     $script[] = '		document.getElementById("' . $this->id . '_id").value = id;';
     $script[] = '		document.getElementById("' . $this->id . '_name").value = title;';
     $script[] = '		jQuery("#modalPage' . $this->id . '").modal("hide");';
     if ($this->required) {
         $script[] = '		document.formvalidator.validate(document.getElementById("' . $this->id . '_id"));';
         $script[] = '		document.formvalidator.validate(document.getElementById("' . $this->id . '_name"));';
     }
     $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_sppagebuilder&amp;view=pages&amp;layout=modal&amp;tmpl=component&amp;function=jSelectPage_' . $this->id;
     if (isset($this->element['language'])) {
         $link .= '&amp;forcedLanguage=' . $this->element['language'];
     }
     if ((int) $this->value > 0) {
         $db = JFactory::getDbo();
         $query = $db->getQuery(true)->select($db->quoteName('title'))->from($db->quoteName('#__sppagebuilder'))->where($db->quoteName('id') . ' = ' . (int) $this->value);
         $db->setQuery($query);
         try {
             $title = $db->loadResult();
         } catch (RuntimeException $e) {
             JError::raiseWarning(500, $e->getMessage());
         }
     }
     if (empty($title)) {
         $title = JText::_('COM_SPPAGEBUILDER_SELECT_AN_PAGE');
     }
     $title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
     // The active page id field.
     if (0 == (int) $this->value) {
         $value = '';
     } else {
         $value = (int) $this->value;
     }
     $url = $link . '&amp;' . JSession::getFormToken() . '=1';
     // The current article display field.
     $html[] = '<span class="input-append">';
     $html[] = '<input type="text" class="input-medium" id="' . $this->id . '_name" value="' . $title . '" disabled="disabled" size="35" />';
     $html[] = '<a href="#modalPage' . $this->id . '" class="btn hasTooltip" role="button"  data-toggle="modal" title="' . JHtml::tooltipText('COM_SPPAGEBUILDER_CHANGE_PAGE') . '">' . '<span class="icon-file"></span> ' . JText::_('JSELECT') . '</a>';
     $html[] = '</span>';
     // The class='required' for client side validation
     $class = '';
     if ($this->required) {
         $class = ' class="required modal-value"';
     }
     $html[] = '<input type="hidden" id="' . $this->id . '_id"' . $class . ' name="' . $this->name . '" value="' . $value . '" />';
     $html[] = JHtml::_('bootstrap.renderModal', 'modalPage' . $this->id, array('url' => $url, 'title' => JText::_('COM_SPPAGEBUILDER_SELECT_AN_PAGE'), 'width' => '800px', 'height' => '400px', 'footer' => '<button class="btn" data-dismiss="modal" aria-hidden="true">' . JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</button>'));
     return implode("\n", $html);
 }
Example #6
0
 protected function getInput()
 {
     $app = JFactory::getApplication();
     JHtml::_('behavior.modal', 'a.modal');
     $script = array();
     $script[] = '	function jSelectListing_' . $this->id . '(id, title, object) {';
     $script[] = '		document.id("' . $this->id . '").value = id;';
     $script[] = '		document.id("' . $this->id . '_name").value = title;';
     $script[] = '		SqueezeBox.close();';
     $script[] = '	}';
     JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
     $html = array();
     $link = 'index.php?option=com_judirectory&amp;view=listings&amp;layout=modal&amp;tmpl=component&amp;function=jSelectListing_' . $this->id;
     $db = JFactory::getDbo();
     $db->setQuery('SELECT title' . ' FROM #__judirectory_listings' . ' WHERE id = ' . (int) $this->value);
     $title = $db->loadResult();
     if ($error = $db->getErrorMsg()) {
         JError::raiseWarning(500, $error);
     }
     if (empty($title)) {
         $title = JText::_('COM_JUDIRECTORY_SELECT_LISTING');
     }
     $title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
     $joomla_version_arr = explode(".", JVERSION);
     $priVersion = $joomla_version_arr[0];
     $view = $app->input->get('view', '');
     if ($priVersion == 3) {
         $html[] = '<span class="' . ($view != 'modcomment' ? 'input-append' : '') . '">';
         $html[] = '<input type="text" id="' . $this->id . '_name" value="' . $title . '" disabled="disabled" size="' . $this->element['size'] . '"/>';
         if ($view != 'modcomment') {
             $html[] = '<a class="modal btn hasTooltip" title="' . JHtml::tooltipText('COM_JUDIRECTORY_SELECT_LISTING') . '"  href="' . $link . '&amp;' . JSession::getFormToken() . '=1" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-list"></i> ' . JText::_('COM_JUDIRECTORY_SELECT') . '</a>';
         }
         $html[] = '</span>';
     } else {
         $html[] = '<div class="fltlft">';
         $html[] = '<input type="text" id="' . $this->id . '_name" value="' . $title . '" disabled="disabled" size="' . $this->element['size'] . '" />';
         $html[] = '</div>';
         if ($view != 'modcomment') {
             $html[] = '<div class="button2-left">';
             $html[] = '<div class="blank">';
             $html[] = '<a class="modal" title="' . JText::_('COM_JUDIRECTORY_SELECT_LISTING') . '"  href="' . $link . '&amp;' . JSession::getFormToken() . '=1" rel="{handler: \'iframe\', size: {x: 800, y: 450}}">' . JText::_('COM_JUDIRECTORY_SELECT_LISTING') . '</a>';
             $html[] = '</div>';
             $html[] = '</div>';
         }
     }
     if (0 == (int) $this->value) {
         $value = '';
     } else {
         $value = (int) $this->value;
     }
     $class = '';
     if ($this->required) {
         $class = ' class="required modal-value"';
     }
     $html[] = '<input type="hidden" id="' . $this->id . '"' . $class . ' name="' . $this->name . '" value="' . $value . '" />';
     return implode("\n", $html);
 }
Example #7
0
 /**
  * Get the HTML code of the state switcher
  *
  * @param   int      $i          Row number
  * @param   int      $value      The state value
  * @param   boolean  $canChange  Can the user change the state?
  *
  * @return  string
  *
  * @since   3.4
  */
 public static function status($i, $value = 0, $canChange = false)
 {
     // Array of image, task, title, action.
     $states = array(-2 => array('trash', 'messages.unpublish', 'JTRASHED', 'COM_MESSAGES_MARK_AS_UNREAD'), 1 => array('publish', 'messages.unpublish', 'COM_MESSAGES_OPTION_READ', 'COM_MESSAGES_MARK_AS_UNREAD'), 0 => array('unpublish', 'messages.publish', 'COM_MESSAGES_OPTION_UNREAD', 'COM_MESSAGES_MARK_AS_READ'));
     $state = JArrayHelper::getValue($states, (int) $value, $states[0]);
     $icon = $state[0];
     if ($canChange) {
         $html = '<a href="#" onclick="return listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')" class="btn btn-micro hasTooltip' . ($value == 1 ? ' active' : '') . '" title="' . JHtml::tooltipText($state[3]) . '"><span class="icon-' . $icon . '"></span></a>';
     }
     return $html;
 }
Example #8
0
 protected function getInput()
 {
     JHtml::_('behavior.modal', 'a.modal');
     $script = array();
     $script[] = '    function jSelectTag_' . $this->id . '(id, title, object) {';
     $script[] = '        document.id("' . $this->id . '_id").value = id;';
     $script[] = '        document.id("' . $this->id . '_name").value = title;';
     $script[] = '        SqueezeBox.close();';
     $script[] = '    }';
     JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
     $html = array();
     $link = 'index.php?option=com_judownload&amp;view=tags&amp;layout=modal&amp;tmpl=component&amp;function=jSelectTag_' . $this->id . '&amp;' . JSession::getFormToken() . '=1';
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->select('title');
     $query->from('#__judownload_tags');
     $query->where('id=' . (int) $this->value);
     $db->setQuery($query);
     $title = $db->loadResult();
     if (empty($title)) {
         $title = JText::_('COM_JUDOWNLOAD_SELECT_TAG');
     }
     $title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
     $joomla_version_arr = explode(".", JVERSION);
     $priVersion = $joomla_version_arr[0];
     if ($priVersion == 3) {
         $html[] = '<span class="input-append">';
         $html[] = '<input type="text" class="input-medium" id="' . $this->id . '_name" value="' . $title . '" disabled="disabled" size="35" />';
         $html[] = '<a class="modal btn hasTooltip" title="' . JHtml::tooltipText('COM_JUDOWNLOAD_CHANGE_TAG') . '"  href="' . $link . '&amp;' . JSession::getFormToken() . '=1" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> ' . JText::_('COM_JUDOWNLOAD_CHANGE_TAG') . '</a>';
     } else {
         $html[] = '<div class="fltlft">';
         $html[] = '  <input type="text" id="' . $this->id . '_name" value="' . $title . '" disabled="disabled" size="35" />';
         $html[] = '</div>';
         $html[] = '<div class="button2-left">';
         $html[] = '  <div class="blank">';
         $html[] = '	<a class="modal" title="' . JText::_('COM_JUDOWNLOAD_CHANGE_TAG') . '"  href="' . $link . '"
		rel="{handler: \'iframe\', size: {x: 800, y: 450}}">' . JText::_('COM_JUDOWNLOAD_CHANGE_TAG') . '</a>';
         $html[] = '  </div>';
         $html[] = '</div>';
     }
     if (0 == (int) $this->value) {
         $value = '';
     } else {
         $value = (int) $this->value;
     }
     $class = '';
     if ($this->required) {
         $class = ' class="required modal-value"';
     }
     $html[] = '<input type="hidden" id="' . $this->id . '_id"' . $class . ' name="' . $this->name . '" value="' . $value . '" />';
     return implode("\n", $html);
 }
  function getversionlist()
  {
      // Check for request forgeries
      JRequest::checkToken('request') or jexit('Invalid Token');
      @ob_end_clean();
      $id = JRequest::getInt('id', 0);
      $active = JRequest::getInt('active', 0);
      if (!$id) {
          return;
      }
      $revert = JHTML::image('administrator/components/com_flexicontent/assets/images/arrow_rotate_anticlockwise.png', JText::_('FLEXI_REVERT'));
      $view = JHTML::image('administrator/components/com_flexicontent/assets/images/magnifier.png', JText::_('FLEXI_VIEW'));
      $comment = JHTML::image('administrator/components/com_flexicontent/assets/images/comment.png', JText::_('FLEXI_COMMENT'));
      $model = $this->getModel('item');
      $model->setId($id);
      $item = $model->getItem($id);
      $cparams = JComponentHelper::getParams('com_flexicontent');
      $versionsperpage = $cparams->get('versionsperpage', 10);
      $currentversion = $item->version;
      $page = JRequest::getInt('page', 0);
      $versioncount = $model->getVersionCount();
      $numpage = ceil($versioncount / $versionsperpage);
      if ($page > $numpage) {
          $page = $numpage;
      } elseif ($page < 1) {
          $page = 1;
      }
      $limitstart = ($page - 1) * $versionsperpage;
      $versions = $model->getVersionList();
      $versions = $model->getVersionList($limitstart, $versionsperpage);
      $jt_date_format = FLEXI_J16GE ? 'FLEXI_DATE_FORMAT_FLEXI_VERSIONS_J16GE' : 'FLEXI_DATE_FORMAT_FLEXI_VERSIONS';
      $df_date_format = FLEXI_J16GE ? "d/M H:i" : "%d/%m %H:%M";
      $date_format = JText::_($jt_date_format);
      $date_format = $date_format == $jt_date_format ? $df_date_format : $date_format;
      $ctrl_task = FLEXI_J16GE ? 'task=items.edit' : 'controller=items&task=edit';
      foreach ($versions as $v) {
          $class = $v->nr == $active ? ' id="active-version"' : '';
          echo '
	<tr' . $class . '>
		<td class="versions">#' . $v->nr . '</td>
		<td class="versions">' . JHTML::_('date', $v->nr == 1 ? $item->created : $v->date, $date_format) . '</td>
		<td class="versions">' . ($v->nr == 1 ? $item->creator : $v->modifier) . '</td>
		<td class="versions" align="center">
			<a href="javascript:;" class="hasTooltip" title="' . JHtml::tooltipText(JText::_('FLEXI_COMMENT'), $v->comment ? $v->comment : 'No comment written', 0, 1) . '">' . $comment . '</a>
		' . ((int) $v->nr == (int) $currentversion ? '<a onclick="javascript:return clickRestore(\'index.php?option=com_flexicontent&' . $ctrl_task . '&cid=' . $item->id . '&version=' . $v->nr . '\');" href="javascript:;">' . JText::_('FLEXI_CURRENT') . '</a>' : '<a class="modal-versions" href="index.php?option=com_flexicontent&view=itemcompare&cid[]=' . $item->id . '&version=' . $v->nr . '&tmpl=component" title="' . JText::_('FLEXI_COMPARE_WITH_CURRENT_VERSION') . '" rel="{handler: \'iframe\', size: {x:window.getSize().scrollSize.x-100, y: window.getSize().size.y-100}}">' . $view . '</a>
			<a onclick="javascript:return clickRestore(\'index.php?option=com_flexicontent&' . $ctrl_task . '&cid=' . $item->id . '&version=' . $v->nr . '&' . JSession::getFormToken() . '=1\');" href="javascript:;" title="' . JText::sprintf('FLEXI_REVERT_TO_THIS_VERSION', $v->nr) . '">' . $revert . '</a>
		') . '
		</td>
	</tr>';
      }
      exit;
  }
Example #10
0
 /**
  * Show the featured/not-featured icon.
  *
  * @param   int   $value      The featured value.
  * @param   int   $i          Id of the item.
  * @param   bool  $canChange  Whether the value can be changed or not.
  *
  * @return  string	The anchor tag to toggle featured/unfeatured contacts.
  *
  * @since   1.6
  */
 public static function featured($value = 0, $i, $canChange = true)
 {
     // Array of image, task, title, action
     $states = array(0 => array('unfeatured', 'contacts.featured', 'COM_CONTACT_UNFEATURED', 'JGLOBAL_TOGGLE_FEATURED'), 1 => array('featured', 'contacts.unfeatured', 'JFEATURED', 'JGLOBAL_TOGGLE_FEATURED'));
     $state = JArrayHelper::getValue($states, (int) $value, $states[1]);
     $icon = $state[0];
     if ($canChange) {
         $html = '<a href="#" onclick="return listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')" class="btn btn-micro hasTooltip' . ($value == 1 ? ' active' : '') . '" title="' . JHtml::tooltipText($state[3]) . '"><span class="icon-' . $icon . '"></span></a>';
     } else {
         $html = '<a class="btn btn-micro hasTooltip disabled' . ($value == 1 ? ' active' : '') . '" title="' . JHtml::tooltipText($state[2]) . '"><span class="icon-' . $icon . '"></span></a>';
     }
     return $html;
 }
 public static function gallery($value = 0, $i, $canChange = true)
 {
     JHtml::_('bootstrap.tooltip');
     // Array of image, task, title, action
     $states = array(0 => array('unfeatured', 'galleries.featured', 'COM_BOOKPRO_UNFEATURED', 'COM_BOOKPRO_TOGGLE_TO_FEATURE'), 1 => array('featured', 'galleries.unfeatured', 'COM_BOOKRPO_FEATURED', 'COM_BOOKPRO_TOGGLE_TO_UNFEATURE'));
     $state = JArrayHelper::getValue($states, (int) $value, $states[1]);
     $icon = $state[0];
     if ($canChange) {
         $html = '<a href="#" onclick="return listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')" class="btn btn-micro hasTooltip' . ($value == 1 ? ' active' : '') . '" title="' . JHtml::tooltipText($state[3]) . '"><i class="icon-' . $icon . '"></i></a>';
     } else {
         $html = '<a class="btn btn-micro hasTooltip disabled' . ($value == 1 ? ' active' : '') . '" title="' . JHtml::tooltipText($state[2]) . '"><i class="icon-' . $icon . '"></i></a>';
     }
     return $html;
 }
Example #12
0
 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     // Load the modal behavior script.
     JHtml::_('behavior.modal', 'a.modal');
     // Build the script.
     $script = array();
     $script[] = '	function jSelectVisdata_' . $this->id . '(id, title, object) {';
     $script[] = '		document.getElementById("' . $this->id . '_id").value = id;';
     $script[] = '		document.getElementById("' . $this->id . '_name").value = title;';
     $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_visforms&amp;view=visforms&amp;layout=modal_data&amp;tmpl=component&amp;function=jSelectVisdata_' . $this->id;
     $db = JFactory::getDbo();
     $db->setQuery('SELECT title' . ' FROM #__visforms' . ' WHERE id = ' . (int) $this->value);
     try {
         $title = $db->loadResult();
     } catch (RuntimeException $e) {
         JError::raiseWarning(500, $e->getMessage());
     }
     if ($error = $db->getErrorMsg()) {
         JError::raiseWarning(500, $error);
     }
     if (empty($title)) {
         $title = JText::_('COM_VISFORMS_CHOOSE_FORM');
     }
     $title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
     // The active article id field.
     if (0 == (int) $this->value) {
         $value = '';
     } else {
         $value = (int) $this->value;
     }
     // The current article display field.
     $html[] = '<span class="input-append">';
     $html[] = '<input type="text" class="input-medium" id="' . $this->id . '_name" value="' . $title . '" disabled="disabled" size="35" />';
     $html[] = '<a class="modal btn hasTooltip" title="' . JHtml::tooltipText('COM_VISFORMS_CHANGE_FORM') . '"  href="' . $link . '&amp;' . JSession::getFormToken() . '=1" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> ' . JText::_('COM_VISFORMS_CHANGE_FORM_BUTTON') . '</a>';
     $html[] = '</span>';
     // class='required' for client side validation
     $class = '';
     if ($this->required) {
         $class = ' class="required modal-value"';
     }
     $html[] = '<input type="hidden" id="' . $this->id . '_id"' . $class . ' name="' . $this->name . '" value="' . $value . '" />';
     return implode("\n", $html);
 }
Example #13
0
 /**
  * Method to generate a link to the create item page for the given category
  *
  * @param   object    $category  The category information
  * @param   Registry  $params    The item parameters
  * @param   array     $attribs   Optional attributes for the link
  * @param   boolean   $legacy    True to use legacy images, false to use icomoon based graphic
  *
  * @return  string  The HTML markup for the create item link
  */
 public static function create($category, $params, $attribs = array(), $legacy = false)
 {
     $uri = JUri::getInstance();
     $url = 'index.php?option=com_content&task=article.add&return=' . base64_encode($uri) . '&a_id=0&catid=' . $category->id;
     $text = JLayoutHelper::render('joomla.content.icons.create', array('params' => $params, 'legacy' => $legacy));
     // Add the button classes to the attribs array
     if (isset($attribs['class'])) {
         $attribs['class'] = $attribs['class'] . ' btn btn-primary';
     } else {
         $attribs['class'] = 'btn btn-primary';
     }
     $button = JHtml::_('link', JRoute::_($url), $text, $attribs);
     $output = '<span class="hasTooltip" title="' . JHtml::tooltipText('COM_CONTENT_CREATE_ARTICLE') . '">' . $button . '</span>';
     return $output;
 }
Example #14
0
 /**
  * Display the published or unpublished state of an item.
  *
  * @param   int      $value      The state value.
  * @param   int      $i          The ID of the item.
  * @param   boolean  $canChange  An optional prefix for the task.
  *
  * @return  string
  *
  * @since   1.6
  *
  * @throws  InvalidArgumentException
  */
 public static function published($value = 0, $i = null, $canChange = true)
 {
     // Note: $i is required but has to be an optional argument in the function call due to argument order
     if (null === $i) {
         throw new InvalidArgumentException('$i is a required argument in JHtmlRedirect::published');
     }
     // Array of image, task, title, action
     $states = array(1 => array('publish', 'links.unpublish', 'JENABLED', 'COM_REDIRECT_DISABLE_LINK'), 0 => array('unpublish', 'links.publish', 'JDISABLED', 'COM_REDIRECT_ENABLE_LINK'), 2 => array('archive', 'links.unpublish', 'JARCHIVED', 'JUNARCHIVE'), -2 => array('trash', 'links.publish', 'JTRASHED', 'COM_REDIRECT_ENABLE_LINK'));
     $state = JArrayHelper::getValue($states, (int) $value, $states[0]);
     $icon = $state[0];
     if ($canChange) {
         $html = '<a href="#" onclick="return listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')" class="btn btn-micro hasTooltip' . ($value == 1 ? ' active' : '') . '" title="' . JHtml::tooltipText($state[3]) . '"><span class="icon-' . $icon . '"></span></a>';
     }
     return $html;
 }
Example #15
0
 /**
  * Display the thumb for the template.
  *
  * @param   string   $template  The name of the template.
  * @param   integer  $clientId  The application client ID the template applies to
  *
  * @return  string  The html string
  *
  * @since   1.6
  */
 public static function thumb($template, $clientId = 0)
 {
     $client = JApplicationHelper::getClientInfo($clientId);
     $basePath = $client->path . '/templates/' . $template;
     $thumb = $basePath . '/template_thumbnail.png';
     $preview = $basePath . '/template_preview.png';
     $html = '';
     if (file_exists($thumb)) {
         JHtml::_('bootstrap.tooltip');
         $clientPath = $clientId == 0 ? '' : 'administrator/';
         $thumb = $clientPath . 'templates/' . $template . '/template_thumbnail.png';
         $html = JHtml::_('image', $thumb, JText::_('COM_TEMPLATES_PREVIEW'));
         if (file_exists($preview)) {
             $html = '<a href="#' . $template . '-Modal" role="button" class="thumbnail pull-left hasTooltip" data-toggle="modal" title="' . JHtml::tooltipText('COM_TEMPLATES_CLICK_TO_ENLARGE') . '">' . $html . '</a>';
         }
     }
     return $html;
 }
Example #16
0
 protected function getInput()
 {
     $recipe_urlfield = isset($this->element['recipe_urlfield']) ? $this->element['recipe_urlfield'] : 'recipe_urlfield';
     // Load language
     JFactory::getLanguage()->load('com_akrecipes', JPATH_ADMINISTRATOR);
     // Build the script.
     $script = array();
     // Select button script
     $script[] = '	function jSelectArticle_' . $this->id . '(id, title, catid, object) {';
     //$script[] = ' alert("IN jSelectArticle_ " + id );';
     //$script[] = '		document.getElementById("' . $this->id . '_id").value = id;';
     $script[] = ' 		var recipe_url = "index.php?option=com_akrecipes&view=recipe&id=" + id ;';
     $script[] = '		jQuery("#jform_' . $recipe_urlfield . '").val(recipe_url);';
     $script[] = '		jQuery("#modalRecipe' . $this->id . '").modal("hide");';
     $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_akrecipes&amp;view=recipes&amp;layout=modal&amp;tmpl=component&amp;function=jSelectArticle_' . $this->id;
     if (empty($title)) {
         $title = JText::_('COM_AKRECIPES_MODULE_SELECT_RECIPE');
     }
     $title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
     // The active article id field.
     if (0 == (int) $this->value) {
         $value = '';
     } else {
         $value = (int) $this->value;
     }
     $url = $link . '&amp;' . JSession::getFormToken() . '=1';
     // The current article display field.
     $html[] = '<span class="input-append">';
     $html[] = '<input type="text" class="input-medium" id="' . $this->id . '_name" value="' . $title . '" disabled="disabled" size="35" />';
     $html[] = '<a href="#modalRecipe' . $this->id . '" class="btn hasTooltip" role="button"  data-toggle="modal" title="' . JHtml::tooltipText('COM_AKRECIPES_MODULE_SELECT_RECIPE') . '">' . '<span class="icon-file"></span> ' . JText::_('JSELECT') . '</a>';
     $html[] = '</span>';
     // The class='required' for client side validation
     $class = '';
     if ($this->required) {
         $class = ' class="required modal-value"';
     }
     $html[] = JHtml::_('bootstrap.renderModal', 'modalRecipe' . $this->id, array('url' => $url, 'title' => JText::_('COM_AKRECIPES_MODULE_SELECT_RECIPE'), 'width' => '800px', 'height' => '300px', 'footer' => '<button class="btn" data-dismiss="modal" aria-hidden="true">' . JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</button>'));
     return implode("\n", $html);
 }
Example #17
0
 public function getLabel()
 {
     $output = parent::getLabel();
     $output = str_replace('</label>', $this->Addition('label') . '</label>', $output);
     return $output;
     if ($this->hidden) {
         return '';
     }
     // Get the label text from the XML element, defaulting to the element name.
     $text = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name'];
     $text = $this->translateLabel ? JText::_($text) : $text;
     $text .= $this->Addition('label');
     // Forcing the Alias field to display the tip below
     $position = $this->element['name'] == 'alias' ? ' data-placement="bottom" ' : '';
     $description = $this->translateDescription && !empty($this->description) ? JText::_($this->description) : $this->description;
     $displayData = array('text' => $text, 'description' => $description, 'for' => $this->id, 'required' => (bool) $this->required, 'classes' => explode(' ', $this->labelclass), 'position' => $position);
     $text = $displayData['text'];
     $desc = $displayData['description'];
     $for = $displayData['for'];
     $req = $displayData['required'];
     $classes = array_filter((array) $displayData['classes']);
     $position = $displayData['position'];
     $id = $for . '-lbl';
     $title = '';
     // If a description is specified, use it to build a tooltip.
     if (!empty($desc)) {
         JHtml::_('bootstrap.tooltip');
         $classes[] = 'hasTooltip';
         $title = ' title="' . JHtml::tooltipText(null, $desc, 0) . '"';
     }
     // If required, there's a class for that.
     if ($req) {
         $classes[] = 'required';
     }
     $return = '<label id="' . $id . '" for="' . $for . '" class="' . implode(' ', $classes) . '" ' . $title . $position . '>' . $text;
     if ($req) {
         $return .= '<span class="star">&#160;*</span>';
     }
     $return .= '</label>';
     return $return;
 }
Example #18
0
 /**
  * Returns the HTML output of a tooltip if showing tooltips is enabled
  *
  * @param   string  $text       The text of the tooltip
  * @param   string  $title      The title of the tooltip
  * @param   boolean $addclass   True, if the class attribute shall be added and false if it's already there
  * @param   boolean $translate  True, if the text and the title shall be translated
  * @param   string  $class      The name of the class used by Mootools to detect the tooltips
  * @return  string  The HTML output created
  * @since   1.5.5
  */
 public static function tip($text = 'Tooltip', $title = null, $addclass = false, $translate = true, $class = 'hasHint')
 {
     $config = JoomConfig::getInstance();
     $html = '';
     if ($config->get('jg_tooltips')) {
         static $loaded = false;
         if (!$loaded) {
             $params = array();
             if ($config->get('jg_tooltips') == 2) {
                 $params['template'] = '<div class="tooltip jg-tooltip-wrap" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>';
             }
             JHtml::_('bootstrap.tooltip', '.' . $class, $params);
             $loaded = true;
         }
         if ($addclass) {
             $html = ' class="' . $class . '" title="' . JHtml::tooltipText($title, $text, $translate, $translate) . '"';
         } else {
             $html = ' ' . $class . '" title="' . JHtml::tooltipText($title, $text, $translate, $translate);
         }
     }
     return $html;
 }
Example #19
0
 /**
  * Method to get the field input markup.
  */
 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 . '"' : '';
     $pattern = !empty($this->pattern) ? ' pattern="' . $this->pattern . '"' : '';
     $inputmode = !empty($this->inputmode) ? ' inputmode="' . $this->inputmode . '"' : '';
     $dirname = !empty($this->dirname) ? ' dirname="' . $this->dirname . '"' : '';
     $tooltiplabel = JText::_($this->getAttribute('tooltiplabel'));
     $tooltipdesc = JText::_($this->getAttribute('tooltipdescription'));
     $tooltiplink = JText::_($this->getAttribute('tooltiplink'));
     // Initialize JavaScript field attributes.
     $onchange = !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : '';
     $tip = JHtml::tooltipText($tooltiplabel, $tooltipdesc, 0);
     if ($tooltiplink) {
         $attribs = array();
         $attribs['title'] = $tip;
         $attribs['target'] = '_blank';
         $attribs['class'] = 'hasTooltip';
         $image = JHtml::_('image', 'system/tooltip.png', null, NULL, true);
         $output = ' ' . JHtml::_('link', $tooltiplink, $image, $attribs);
     } else {
         $attribs = array();
         $attribs['title'] = $tip;
         $attribs['class'] = 'hasTooltip';
         $output = JHtml::_('image', 'system/tooltip.png', $tooltiplabel, $attribs, true);
     }
     $html[] = '<input type="text" name="' . $this->name . '" id="' . $this->id . '"' . $dirname . ' value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $size . $disabled . $readonly . $hint . $onchange . $maxLength . $required . $inputmode . $pattern . ' />';
     $html[] = $output;
     return implode($html);
 }
 /**
  * Function to create the tooltip text regardless of Joomla version
  *
  * @return 	string  : the HTML of the tooltip for usage in the title paramter of the HTML tag
  * @since 1.5
  */
 static function getToolTip($title = '', $content = '', $translate = 1, $escape = 1)
 {
     if (FLEXI_J30GE) {
         return JHtml::tooltipText($title, $content, $translate, $escape);
     } else {
         // Return empty in no title or content is given.
         if ($title == '' && $content == '') {
             return '';
         }
         // Pass texts through the JText.
         if ($translate) {
             $title = JText::_($title);
             $content = JText::_($content);
         }
         // Escape the texts.
         if ($escape) {
             $title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8');
             $content = htmlspecialchars($content, ENT_COMPAT, 'UTF-8');
         }
         // Return only the title or content if no title or content is given respectively
         return $title . '::' . $content;
     }
 }
Example #21
0
 public static function thumb($template, $clientId = 0)
 {
     $client = JApplicationHelper::getClientInfo($clientId);
     $basePath = $client->path . '/components/com_tz_portfolio_plus/templates/' . $template;
     $baseUrl = $clientId == 0 ? JUri::root(true) : JUri::root(true) . '/administrator';
     //        $thumb = $basePath . '/template_thumbnail.png';
     $preview = $basePath . '/template_preview.png';
     $html = '';
     //        if (file_exists($thumb))
     //        {
     //            $clientPath = ($clientId == 0) ? '' : 'administrator/';
     //            $thumb = $clientPath . 'components/com_tz_portfolio_plus/templates/' . $template . '/template_thumbnail.png';
     //            $html = JHtml::_('image', $thumb, JText::_('COM_TEMPLATES_PREVIEW'));
     if (file_exists($preview)) {
         JHtml::_('bootstrap.tooltip');
         JHtml::_('behavior.modal');
         $preview = $baseUrl . '/components/com_tz_portfolio_plus/templates/' . $template . '/template_preview.png';
         $html = JHtml::_('image', '/components/com_tz_portfolio_plus/templates/' . $template . '/template_preview.png', JText::_('COM_TEMPLATES_PREVIEW'));
         $html = '<a href="' . $preview . '" class="thumbnail pull-left modal hasTooltip" title="' . JHtml::tooltipText('COM_TEMPLATES_CLICK_TO_ENLARGE') . '">' . $html . '</a>';
     }
     //        }
     return $html;
 }
Example #22
0
 /**
  * Method to get the field label markup.
  *
  * @return  string  The field label markup.
  */
 protected function getLabel($fld)
 {
     $label = '';
     $text = JText::_($fld->get('label'));
     $desc = $fld->get('desc');
     // Build the class for the label.
     $class = !empty($desc) ? 'hasTooltip' : '';
     $class = $fld->get('required') ? $class . ' required' : $class;
     // $class = !empty($this->labelclass) ? $class . ' ' . $this->labelclass : $class;
     // Add the opening label tag and main attributes attributes.
     $label .= '<label id="' . $fld->get('id') . '-lbl" for="' . $fld->get('id') . '" class="' . $class . '"';
     // If a description is specified, use it to build a tooltip.
     if (!empty($desc)) {
         JHtml::_('bootstrap.tooltip');
         $label .= ' title="' . JHtml::tooltipText(trim($text, ':'), JText::_($fld->get('desc')), 0) . '"';
     }
     // Add the label text and closing tag.
     if ($fld->get('required')) {
         $label .= '>' . $text . '<span class="star">&#160;*</span></label>';
     } else {
         $label .= '>' . $text . '</label>';
     }
     return $label;
 }
Example #23
0
 public static function sort($title, $order, $direction = 'asc', $selected = 0, $task = null, $new_direction = 'asc', $tip = '', $form = '', $suffix = '')
 {
     JHtml::_('behavior.core');
     JHtml::_('bootstrap.tooltip');
     $direction = strtolower($direction);
     $icon = array('arrow-up-3', 'arrow-down-3');
     $index = (int) ($direction == 'desc');
     if ($order != $selected) {
         $direction = $new_direction;
     } else {
         $direction = $direction == 'desc' ? 'asc' : 'desc';
     }
     $html = '<a href="#" onclick="Joomla.tableOrderingPhoca(\'' . $order . '\',\'' . $direction . '\',\'' . $task . '\',\'' . $form . '\',\'' . $suffix . '\');return false;"' . ' class="hasTooltip" title="' . JHtml::tooltipText($tip ? $tip : $title, 'JGLOBAL_CLICK_TO_SORT_THIS_COLUMN') . '">';
     if (isset($title['0']) && $title['0'] == '<') {
         $html .= $title;
     } else {
         $html .= JText::_($title);
     }
     if ($order == $selected) {
         $html .= ' <i class="icon-' . $icon[$index] . '"></i>';
     }
     $html .= '</a>';
     return $html;
 }
Example #24
0
        ?>
					<?php 
    }
    ?>
				</td>
				<td class="center">
					<?php 
    echo JHtml::_('grid.boolean', $i, !$item->activation, 'users.activate', null);
    ?>
				</td>
				<td class="center">
					<?php 
    if (substr_count($item->group_names, "\n") > 1) {
        ?>
						<span class="hasTooltip" title="<?php 
        echo JHtml::tooltipText(JText::_('COM_USERS_HEADING_GROUPS'), nl2br($item->group_names), 0);
        ?>
"><?php 
        echo JText::_('COM_USERS_USERS_MULTIPLE_GROUPS');
        ?>
</span>
					<?php 
    } else {
        ?>
						<?php 
        echo nl2br($item->group_names);
        ?>
					<?php 
    }
    ?>
				</td>
Example #25
0
?>
">
<div id="filter-bar" class="btn-toolbar">
	<div class="filter-search btn-group pull-left">
		<input type="text" name="search" id="search" value="<?php 
echo $this->lists['search'];
?>
" placeholder="Tìm kiếm"  />
	</div>
	<div class="btn-group pull-left">
		<button type="submit" class="btn hasTooltip" title="<?php 
echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT');
?>
"><i class="icon-search"></i></button>
		<button  class="btn hasTooltip" title="<?php 
echo JHtml::tooltipText('JSEARCH_RESET');
?>
" onclick="document.getElementById('search').value='';this.form.getElementById('filter_type').value='0';this.form.getElementById('filter_logged').value='0';this.form.submit();"><i class="icon-remove"></i></button>
	</div>
	<div class="btn-group pull-right">
		<?php 
echo $this->lists['status'];
?>
	</div>
</div>
<table class="table table-bordered">
<thead>
<tr>
	<th style="text-align: center;vertical-align:middle;" nowrap="nowrap" width="15">
    	<?php 
echo JText::_('STT');
echo $this->pagination->getLimitBox();
?>
	</div>
	<div class="filter-search btn-group pull-left">
		<label for="filter_search" class="element-invisible"><?php 
echo JText::_('JSEARCH_FILTER_LABEL');
?>
</label>
		<input type="text" name="filter_search" id="filter_search" placeholder="<?php 
echo JText::_('JSEARCH_FILTER');
?>
" value="<?php 
echo $this->escape($this->state->get('filter.search'));
?>
" class="hasTooltip" title="<?php 
echo JHtml::tooltipText('COM_INSTALLER_LANGUAGES_FILTER_SEARCH_DESC');
?>
" />
	</div>
	<div class="btn-group pull-left hidden-phone">
		<button type="submit" class="btn hasTooltip" title="<?php 
echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT');
?>
"><span class="icon-search"></span></button>
		<button type="button" class="btn hasTooltip" title="<?php 
echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR');
?>
" onclick="document.getElementById('filter_search').value='';this.form.submit();"><span class="icon-remove"></span></button>
	</div>
</div>
<div class="clearfix"> </div>
Example #27
0
<?php

/**
 * @package     Joomla.Site
 * @subpackage  Layout
 *
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('JPATH_BASE') or die;
// Set the tooltips
JText::script('JTOGGLE_HIDE_SIDEBAR');
JText::script('JTOGGLE_SHOW_SIDEBAR');
?>
<div
	id="j-toggle-sidebar-button"
	class="j-toggle-sidebar-button hidden-phone hasTooltip"
	title="<?php 
echo JHtml::tooltipText('JTOGGLE_HIDE_SIDEBAR');
?>
"
	type="button"
	onclick="toggleSidebar(false); return false;"
	>
	<span id="j-toggle-sidebar-icon" class="icon-cancel"></span>
</div>
Example #28
0
        $canCreate = $user->authorise('core.create', 'com_htraininglogs.category.' . 0);
        $canEdit = $user->authorise('core.edit', 'com_htraininglogs.category.' . 0);
        $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || $item->checked_out == 0;
        $canChange = $user->authorise('core.edit.state', 'com_htraininglogs.category.' . 0) && $canCheckin;
        ?>
					<tr class="row<?php 
        echo $i % 2;
        ?>
" sortable-group-id="0">
						<td class="order nowrap center hidden-phone">
							<?php 
        $iconClass = '';
        if (!$canChange) {
            $iconClass = ' inactive';
        } elseif (!$saveOrder) {
            $iconClass = ' inactive tip-top hasTooltip" name="' . JHtml::tooltipText('JORDERINGDISABLED');
        }
        ?>
							<span class="sortable-handler<?php 
        echo $iconClass;
        ?>
">
								<i class="icon-menu"></i>
							</span>
							<?php 
        if ($canChange && $saveOrder) {
            ?>
								<input type="text" style="display:none" name="order[]" size="5" value="<?php 
            echo $item->ordering;
            ?>
" class="width-20 text-area-order " />
            $class = '';
            ?>
			<h3 class="page-header item-title">
				<a href="<?php 
            echo JRoute::_(WeblinksHelperRoute::getCategoryRoute($item->id));
            ?>
">
					<?php 
            echo $this->escape($item->title);
            ?>
</a>
					<?php 
            if ($this->params->get('show_cat_num_articles_cat') == 1) {
                ?>
						<span class="badge badge-info tip hasTooltip" title="<?php 
                echo JHtml::tooltipText('COM_WEBLINKS_NUM_ITEMS');
                ?>
">
							<?php 
                echo $item->numitems;
                ?>
						</span>
					<?php 
            }
            ?>
					<?php 
            if (count($item->getChildren()) > 0) {
                ?>
						<a href="#category-<?php 
                echo $item->id;
                ?>
Example #30
0
 /**
  * Render an HTML table based on a multi-dimensional array.
  *
  * @param   array    $table         An array of tabular data.
  * @param   boolean  &$hasWarnings  Changes value to true if warnings are displayed, otherwise untouched
  *
  * @return  string
  *
  * @since   3.1.2
  */
 protected function tableToHtml($table, &$hasWarnings)
 {
     if (!$table) {
         return null;
     }
     $html = array();
     $html[] = '<table class="table table-striped dbg-query-table"><tr>';
     foreach (array_keys($table[0]) as $k) {
         $html[] = '<th>' . htmlspecialchars($k) . '</th>';
     }
     $html[] = '</tr>';
     $durations = array();
     foreach ($table as $tr) {
         if (isset($tr['Duration'])) {
             $durations[] = $tr['Duration'];
         }
     }
     rsort($durations, SORT_NUMERIC);
     foreach ($table as $tr) {
         $html[] = '<tr>';
         foreach ($tr as $k => $td) {
             if ($td === null) {
                 // Display null's as 'NULL'.
                 $td = 'NULL';
             }
             // Treat special columns.
             if ($k == 'Duration') {
                 if ($td >= 0.001 && ($td == $durations[0] || isset($durations[1]) && $td == $durations[1])) {
                     // Duration column with duration value of more than 1 ms and within 2 top duration in SQL engine: Highlight warning.
                     $html[] = '<td class="dbg-warning">';
                     $hasWarnings = true;
                 } else {
                     $html[] = '<td>';
                 }
                 // Display duration in milliseconds with the unit instead of seconds.
                 $html[] = sprintf('%.1f&nbsp;ms', $td * 1000);
             } elseif ($k == 'Error') {
                 // An error in the EXPLAIN query occured, display it instead of the result (means original query had syntax error most probably).
                 $html[] = '<td class="dbg-warning">' . htmlspecialchars($td);
                 $hasWarnings = true;
             } elseif ($k == 'key') {
                 if ($td === 'NULL') {
                     // Displays query parts which don't use a key with warning:
                     $html[] = '<td><strong>' . '<span class="dbg-warning hasTooltip" title="' . JHtml::tooltipText('PLG_DEBUG_WARNING_NO_INDEX_DESC') . '">' . JText::_('PLG_DEBUG_WARNING_NO_INDEX') . '</span>' . '</strong>';
                     $hasWarnings = true;
                 } else {
                     $html[] = '<td><strong>' . htmlspecialchars($td) . '</strong>';
                 }
             } elseif ($k == 'Extra') {
                 $htmlTd = htmlspecialchars($td);
                 // Replace spaces with &nbsp; (non-breaking spaces) for less tall tables displayed.
                 $htmlTd = preg_replace('/([^;]) /', '\\1&nbsp;', $htmlTd);
                 // Displays warnings for "Using filesort":
                 $htmlTdWithWarnings = str_replace('Using&nbsp;filesort', '<span class="dbg-warning hasTooltip" title="' . JHtml::tooltipText('PLG_DEBUG_WARNING_USING_FILESORT_DESC') . '">' . JText::_('PLG_DEBUG_WARNING_USING_FILESORT') . '</span>', $htmlTd);
                 if ($htmlTdWithWarnings !== $htmlTd) {
                     $hasWarnings = true;
                 }
                 $html[] = '<td>' . $htmlTdWithWarnings;
             } else {
                 $html[] = '<td>' . htmlspecialchars($td);
             }
             $html[] = '</td>';
         }
         $html[] = '</tr>';
     }
     $html[] = '</table>';
     return implode('', $html);
 }