本文整理汇总了PHP中JHtmlBehavior::tooltip方法的典型用法代码示例。如果您正苦于以下问题:PHP JHtmlBehavior::tooltip方法的具体用法?PHP JHtmlBehavior::tooltip怎么用?PHP JHtmlBehavior::tooltip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JHtmlBehavior
的用法示例。
在下文中一共展示了JHtmlBehavior::tooltip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testTooltip
/**
* Tests the tooltip method.
*
* @param string $expected @todo
* @param string $selector @todo
* @param array $params @todo
*
* @return void
*
* @since 3.1
* @dataProvider getTooltipData
*/
public function testTooltip($expected, $selector = '.hasTooltip', $params = array())
{
JHtmlBehavior::tooltip($selector, $params);
$this->assertEquals($expected, JHtmlBehaviorInspector::getLoaded(), 'The tooltip behavior is not loaded with all dependencies');
}
示例2: getPreview
/**
* Get Preview Image.
*
* @return string Preview image html.
*/
public function getPreview()
{
// The Preview.
$preview = (string) $this->element['preview'];
$showPreview = true;
$showAsTooltip = false;
switch ($preview) {
case 'no':
// Deprecated parameter value
// Deprecated parameter value
case 'false':
case 'none':
$showPreview = false;
break;
case 'yes':
// Deprecated parameter value
// Deprecated parameter value
case 'true':
case 'show':
break;
case 'tooltip':
default:
$this->showAsTooltip = $showAsTooltip = true;
$options = array('onShow' => 'AKFinderRefreshPreviewTip(this)');
JHtmlBehavior::tooltip('.hasTipPreview', $options);
break;
}
if ($showPreview) {
if ($this->value && file_exists(JPATH_ROOT . '/' . $this->value)) {
$src = JURI::root() . $this->value;
} else {
$src = '';
}
$width = (int) XmlHelper::get($this->element, 'preview_width', 300);
$height = (int) XmlHelper::get($this->element, 'preview_height', 200);
$style = '';
$style .= $width > 0 ? 'max-width:' . $width . 'px;' : '';
$style .= $height > 0 ? 'max-height:' . $height . 'px;' : '';
$style .= !$showAsTooltip ? 'margin: 10px 0;' : '';
$imgattr = array('id' => $this->id . '_preview', 'class' => 'media-preview', 'style' => $style);
$imgattr['class'] = $showAsTooltip ? $imgattr['class'] : $imgattr['class'] . ' img-polaroid';
$img = JHtml::image($src, JText::_('JLIB_FORM_MEDIA_PREVIEW_ALT'), $imgattr);
$previewImg = '<div id="' . $this->id . '_preview_img"' . ($src ? '' : ' style="display:none"') . '>' . $img . '</div>';
$previewImgEmpty = '<div id="' . $this->id . '_preview_empty"' . ($src ? ' style="display:none"' : '') . '>' . JText::_('JLIB_FORM_MEDIA_PREVIEW_EMPTY') . '</div>';
$html[] = '<div class="media-preview add-on fltlft">';
if ($showAsTooltip) {
$tooltip = $previewImgEmpty . $previewImg;
$options = array('title' => JText::_('JLIB_FORM_MEDIA_PREVIEW_SELECTED_IMAGE'), 'text' => '<i class="icon-eye"></i>', 'class' => 'hasTipPreview');
$options['text'] = JVERSION >= 3 ? $options['text'] : JText::_('JLIB_FORM_MEDIA_PREVIEW_TIP_TITLE');
$html[] = JHtml::tooltip($tooltip, $options);
} else {
$html[] = ' ' . $previewImgEmpty;
$html[] = ' ' . $previewImg;
$html[] = '<script type="text/javascript">AKFinderRefreshPreview("' . $this->id . '");</script>';
}
$html[] = '</div>';
}
return implode("\n", $html);
}
示例3: defined
<?php
/**
* @version $Id$
* @package Joomla.Administrator
* @subpackage JoomDOC
* @author ARTIO s.r.o., info@artio.net, http:://www.artio.net
* @copyright Copyright (C) 2011 Artio s.r.o.. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/* @var $this JoomDOCViewDocument */
JHtmlBehavior::tooltip();
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive');
jimport('joomla.html.pagination');
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
/* @var $mainframe JApplication */
$config = JoomDOCConfig::getInstance();
/* @var $config JoomDOCConfig */
$js[] = 'Joomla.submitbutton = function (task) {';
$js[] = ' var form = document.getElementById(\'item-form\');';
$js[] = ' if (task == \'' . JoomDOCHelper::getTask(JOOMDOC_DOCUMENT, JOOMDOC_TASK_CANCEL) . '\' || document.formvalidator.isValid(form)) {';
$js[] = ' Joomla.submitform(task, form);';
$js[] = ' } else {';
$js[] = ' alert(\'' . JText::_('JGLOBAL_VALIDATION_FORM_FAILED', true) . '\');';
$js[] = ' }';
$js[] = '}';
$js[] = 'function tableOrdering(order, dir, task) {';
$js[] = ' document.versionForm.filter_order.value = order;';