本文整理汇总了PHP中JHtml::image方法的典型用法代码示例。如果您正苦于以下问题:PHP JHtml::image方法的具体用法?PHP JHtml::image怎么用?PHP JHtml::image使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JHtml
的用法示例。
在下文中一共展示了JHtml::image方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showImage
/**
* showImage
*
* @param mixed $value
*
* @return string
*/
public static function showImage($value)
{
if ($value) {
return \JHtml::image(static::getThumbPath($value), 'UserXTD image');
}
return '';
}
示例2: getAdminButtons
/**
* Returns a list of buttons for the backend
*
* @return array
*/
public static function getAdminButtons()
{
$buttons = array();
if (JFactory::getUser()->authorise('core.manage', 'com_pfdesigns')) {
$buttons[] = array('title' => 'COM_PROJECTFORK_SUBMENU_DESIGNS', 'link' => 'index.php?option=com_pfdesigns', 'icon' => JHtml::image('com_pfdesigns/header/icon-48-designs.png', JText::_('COM_PROJECTFORK_SUBMENU_DESIGNS'), null, true));
}
return $buttons;
}
示例3: display
/**
* Display the view
*
* @param string $tpl A template file to load. [optional]
*
* @return nothing
*/
public function display($tpl = null)
{
$this->logo_img = JHtml::image('com_attachments/attachments_help_logo32.png', '', null, true);
$this->version = AttachmentsDefines::$ATTACHMENTS_VERSION;
$rdate = new JDate(AttachmentsDefines::$ATTACHMENTS_VERSION_DATE);
$this->date = JHtml::_('date', $rdate, JText::_('DATE_FORMAT_LC1'));
parent::display($tpl);
}
示例4: getAdminButtons
/**
* Returns a list of buttons for the backend
*
* @return array
*/
public static function getAdminButtons()
{
$user = JFactory::getUser();
$buttons = array();
if ($user->authorise('core.manage', 'com_pfforum')) {
$buttons[] = array('title' => 'COM_PROJECTFORK_SUBMENU_FORUM', 'link' => 'index.php?option=com_pfforum', 'icon' => JHtml::image('com_projectfork/projectfork/header/icon-48-forum.png', JText::_('COM_PROJECTFORK_SUBMENU_FORUM'), null, true));
}
return $buttons;
}
示例5: link
public static function link($name, $text, $url)
{
$bar = JToolbar::getInstance('toolbar');
$img = JHtml::image("com_ostoolbar/icon-32-{$name}.png", null, null, true, true);
if ($img) {
$doc = JFactory::getDocument();
$doc->addStyleDeclaration(".icon-32-{$name} { background-image: url({$img}); }");
}
$bar->appendButton('link', $name, $text, $url);
}
示例6: getButtonIcon
/**
* getButtonImage
*
* @param array $button
*
* @return string
*/
public static function getButtonIcon($button)
{
if (!empty($button['icon_class'])) {
return "<i class=\"{$button['icon_class']}\"></i>";
}
if (!empty($button['image'])) {
return JHtml::image($button['image'], $button['id'], null, true);
}
return "<i class=\"icon-joomla\"></i>";
}
示例7: getInput
protected function getInput()
{
require_once JPATH_COMPONENT . '/helpers/jcomments.php';
$smiliesPath = JCommentsHelper::getSmiliesPath();
$livePath = str_replace('\\', '/', $smiliesPath);
if (!self::$initialised) {
$script = array();
$script[] = ' function JCommentsSmileyRefreshPreview(id) {';
$script[] = ' var value = document.id(id).value;';
$script[] = ' var img = document.id(id + "_preview");';
$script[] = ' if (img) {';
$script[] = ' if (value) {';
$script[] = ' img.src = "' . JURI::root() . $livePath . '" + value;';
$script[] = ' document.id(id + "_preview_empty").setStyle("display", "none");';
$script[] = ' document.id(id + "_preview_img").setStyle("display", "");';
$script[] = ' } else { ';
$script[] = ' img.src = ""';
$script[] = ' document.id(id + "_preview_empty").setStyle("display", "");';
$script[] = ' document.id(id + "_preview_img").setStyle("display", "none");';
$script[] = ' } ';
$script[] = ' } ';
$script[] = ' }';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
self::$initialised = true;
}
$html = array();
$html[] = '<div class="input-prepend input-append">';
// Images list
$listAttr = '';
$listAttr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
$listAttr .= ' onchange="JCommentsSmileyRefreshPreview(this.getAttribute(\'id\'))"';
$html[] = JHtml::_('select.genericlist', (array) $this->getOptions($smiliesPath), $this->name, trim($listAttr), 'value', 'text', $this->value, $this->id);
// Preview
if ($this->value && file_exists(JPATH_ROOT . '/' . $smiliesPath . $this->value)) {
$src = JURI::root() . $livePath . $this->value;
} else {
$src = '';
}
$width = isset($this->element['preview_width']) ? (int) $this->element['preview_width'] : 48;
$height = isset($this->element['preview_height']) ? (int) $this->element['preview_height'] : 48;
$style = '';
$style .= $width > 0 ? 'max-width:' . $width . 'px;' : '';
$style .= $height > 0 ? 'max-height:' . $height . 'px;' : '';
$imgAttr = array('id' => $this->id . '_preview', 'class' => 'media-preview', 'style' => $style);
$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">';
$html[] = ' ' . $previewImgEmpty;
$html[] = ' ' . $previewImg;
$html[] = '</div>';
$html[] = '</div>';
return implode("\n", $html);
}
示例8: setTitle
/**
* Default admin screen title
*
* @param string $sub
* @param string $icon
*
* @return void
*/
protected function setTitle($sub = null, $icon = 'ostoolbar')
{
$img = JHtml::image("com_ostoolbar/icon-48-{$icon}.png", null, null, true, true);
if ($img) {
$doc = JFactory::getDocument();
$doc->addStyleDeclaration(".icon-48-{$icon} { background-image: url({$img}); }");
}
$title = JText::_('COM_OSTOOLBAR');
if ($sub) {
$title .= ': ' . JText::_($sub);
}
JToolbarHelper::title($title, $icon);
}
示例9: DefaultEventManagementButton
function DefaultEventManagementButton($view, $row)
{
JEVHelper::script('view_detailJQ.js', 'components/' . JEV_COM_COMPONENT . "/assets/js/");
?>
<a href="#my-modal" data-toggle="modal" data-target="#action_dialogJQ<?php
echo $row->rp_id();
?>
" title="<?php
echo JText::_('JEV_E_EDIT', true);
?>
">
<?php
echo JHtml::image('com_jevents/icons-32/edit.png', JText::_("JEV_E_EDIT"), null, true);
?>
</a>
<?php
}
示例10: getLogo
/**
* get img for team
* @param object teams row
* @param int type = 0 for club small logo, 1 for medium logo, 2 for big logo
* @return html string
*/
public static function getLogo($item, $type = 1)
{
if ($type == 0) {
$picture = $item->logo_small;
if (is_null($item->logo_small) || !file_exists($picture)) {
$picture = JoomleagueHelper::getDefaultPlaceholder('clublogosmall');
}
echo JHtml::image($picture, $item->team_name, 'class="logo_small" title="View ' . $item->team_name . '"');
} else {
if ($type == 1) {
$picture = $item->logo_middle;
if (is_null($item->logo_middle) || !file_exists($picture)) {
$picture = JoomleagueHelper::getDefaultPlaceholder('clublogomedium');
}
echo JHtml::image($picture, $item->team_name, 'class="logo_middle" title="View ' . $item->team_name . '"');
} else {
if ($type == 2) {
$picture = $item->logo_big;
if (is_null($item->logo_big) || !file_exists($picture)) {
$picture = JoomleagueHelper::getDefaultPlaceholder('clublogobig');
}
echo JHtml::image($picture, $item->team_name, 'class="logo_big" title="View ' . $item->team_name . '"');
} else {
if ($type == 3) {
$picture = $item->team_picture;
if (is_null($item->team_picture) || !file_exists($picture)) {
$picture = JoomleagueHelper::getDefaultPlaceholder('team');
}
echo JHtml::image($picture, $item->team_name, 'class="team_picture" title="View ' . $item->team_name . '"');
} else {
if ($type == 4) {
$picture = $item->projectteam_picture;
if (is_null($item->projectteam_picture) || !file_exists($picture)) {
$picture = JoomleagueHelper::getDefaultPlaceholder('team');
}
echo JHtml::image($picture, $item->team_name, 'class="projecteam_picture" title="View ' . $item->team_name . '"');
}
}
}
}
}
return '';
}
示例11: initialize
private function initialize()
{
//now lets echo responese
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8" ?>', "\n";
echo "<nodes>\n";
$config = JFactory::getConfig();
$config->set('live_site', '');
// Inialize array
$contentIcon = JHtml::image('editors/arkeditor/content.png', '', null, true, true);
$menuIcon = JHtml::image('editors/arkeditor/menu.png', '', null, true, true);
$extensions = array('content' => array($contentIcon, $contentIcon), 'menu' => array($menuIcon, $menuIcon));
ARkTreeLinkHelper::ListExtensions($extensions);
foreach ($extensions as $extension => $icon) {
$load = JURI::root() . 'index.php?option=com_ajax&plugin=arktreelink&format=json&action=links&extension=' . $extension;
echo '<node text="' . ucfirst($extension) . '" openicon="' . $icon[0] . '" icon="' . $icon[1] . '" load="' . $load . '" selectable="false" url ="">' . "\n";
echo "</node>\n";
}
echo "</nodes>";
exit;
}
示例12: defined
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.tooltip');
?>
Tracks team link
<div class="mod_tracks_teamsocial">
<ul>
<?php
foreach ($links as $name => $s) {
?>
<?php
$attr = array('class' => 'hasTip', 'title' => $s->label);
?>
<li class="ts-<?php
echo $name;
?>
">
<?php
echo JHtml::link($s->link, JHtml::image($s->icon, $s->label, null, true), $attr);
?>
</li>
<?php
}
?>
</ul>
</div>
示例13: getInput
//.........这里部分代码省略.........
$script[] = ' }';
$script[] = ' }';
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
self::$initialised = true;
}
$html = array();
$attr = '';
// Tooltip for INPUT showing whole image path
$options = array('onShow' => 'jMediaRefreshImgpathTip');
JHtml::_('behavior.tooltip', '.hasTipImgpath', $options);
if (!empty($this->class)) {
$this->class .= ' hasTipImgpath';
} else {
$this->class = 'hasTipImgpath';
}
$attr .= ' title="' . htmlspecialchars('<span id="TipImgpath"></span>', ENT_COMPAT, 'UTF-8') . '"';
// Initialize some field attributes.
$attr .= !empty($this->class) ? ' class="input-small ' . $this->class . '"' : ' class="input-small"';
$attr .= !empty($this->size) ? ' size="' . $this->size . '"' : '';
// Initialize JavaScript field attributes.
$attr .= !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : '';
// The text field.
$html[] = '<div class="input-prepend input-append">';
// The Preview.
$showPreview = true;
$showAsTooltip = false;
switch ($this->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:
$showAsTooltip = true;
$options = array('onShow' => 'jMediaRefreshPreviewTip');
JHtml::_('behavior.tooltip', '.hasTipPreview', $options);
break;
}
if ($showPreview) {
if ($this->value && file_exists(JPATH_ROOT . '/' . $this->value)) {
$src = JUri::root() . $this->value;
} else {
$src = '';
}
$width = $this->previewWidth;
$height = $this->previewHeight;
$style = '';
$style .= $width > 0 ? 'max-width:' . $width . 'px;' : '';
$style .= $height > 0 ? 'max-height:' . $height . 'px;' : '';
$imgattr = array('id' => $this->id . '_preview', 'class' => 'media-preview', 'style' => $style);
$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>';
if ($showAsTooltip) {
$html[] = '<div class="media-preview add-on">';
$tooltip = $previewImgEmpty . $previewImg;
$options = array('title' => JText::_('JLIB_FORM_MEDIA_PREVIEW_SELECTED_IMAGE'), 'text' => '<span class="icon-eye"></span>', 'class' => 'hasTipPreview');
$html[] = JHtml::tooltip($tooltip, $options);
$html[] = '</div>';
} else {
$html[] = '<div class="media-preview add-on" style="height:auto">';
$html[] = ' ' . $previewImgEmpty;
$html[] = ' ' . $previewImg;
$html[] = '</div>';
}
}
$html[] = ' <input type="text" name="' . $this->name . '" id="' . $this->id . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" readonly="readonly"' . $attr . ' />';
if ($this->value && file_exists(JPATH_ROOT . '/' . $this->value)) {
$folder = explode('/', $this->value);
$folder = array_diff_assoc($folder, explode('/', JComponentHelper::getParams('com_media')->get('image_path', 'images')));
array_pop($folder);
$folder = implode('/', $folder);
} elseif (file_exists(JPATH_ROOT . '/' . JComponentHelper::getParams('com_media')->get('image_path', 'images') . '/' . $this->directory)) {
$folder = $this->directory;
} else {
$folder = '';
}
// The button.
if ($this->disabled != true) {
JHtml::_('bootstrap.tooltip');
$html[] = '<a class="modal btn" title="' . JText::_('JLIB_FORM_BUTTON_SELECT') . '" href="' . ($this->readonly ? '' : ($this->link ? $this->link : 'index.php?option=com_media&view=images&tmpl=component&asset=' . $asset . '&author=' . $this->form->getValue($this->authorField)) . '&fieldid=' . $this->id . '&folder=' . $folder) . '"' . ' rel="{handler: \'iframe\', size: {x: 800, y: 500}}">';
$html[] = JText::_('JLIB_FORM_BUTTON_SELECT') . '</a><a class="btn hasTooltip" title="' . JText::_('JLIB_FORM_BUTTON_CLEAR') . '" href="#" onclick="';
$html[] = 'jInsertFieldValue(\'\', \'' . $this->id . '\');';
$html[] = 'return false;';
$html[] = '">';
$html[] = '<span class="icon-remove"></span></a>';
}
$html[] = '</div>';
return implode("\n", $html);
}
示例14: array
echo JText::_('COM_JOOMLEAGUE_MATCHREPORT_EVENTS');
?>
</h2>
<?php
$txt_tab = '';
$p = 1;
echo JHtml::_('bootstrap.startTabSet', 'tabs_events', array('active' => 'panel1'));
foreach ($this->eventtypes as $event) {
$pic_tab = $event->icon;
if ($pic_tab == '/events/event.gif') {
$txt_tab = JText::_($event->name);
} else {
$imgTitle = JText::_($event->name);
$imgTitle2 = array(' title' => $imgTitle, ' alt' => $imgTitle, ' style' => 'max-height:40px;');
$txt_tab = JHtml::image($pic_tab, $imgTitle, $imgTitle2);
}
echo JHtml::_('bootstrap.addTab', 'tabs_events', 'panel' . $p++, $txt_tab);
echo '<table class="matchreport">';
echo '<tr>';
echo '<td class="list">';
echo '<ul>';
foreach ($this->matchevents as $me) {
if ($me->event_type_id == $event->id && $me->ptid == $this->match->projectteam1_id) {
echo '<li class="list">';
if ($this->config['show_event_minute'] == 1 && $me->event_time > 0) {
$prefix = str_pad($me->event_time, 2, '0', STR_PAD_LEFT) . "' ";
} else {
$prefix = null;
}
$match_player = JoomleagueHelper::formatName($prefix, $me->firstname1, $me->nickname1, $me->lastname1, $this->config["name_format"]);
示例15: showEventsContainerInResults
/**
* returns html for events in tabs
* @param object match
* @param array project events
* @param array match events
* @param aray match substitutions
* @param array $config
* @return string
*/
function showEventsContainerInResults($matchInfo, $projectevents, $matchevents, $substitutions = null, $config)
{
$output = '';
$result = '';
if ($this->config['use_tabs_events']) {
// Make event tabs with JPane integrated function in Joomla 1.5 API
$result = JPane::getInstance('tabs', array('startOffset' => 0));
$output .= $result->startPane('pane');
$cnt = 0;
foreach ($projectevents as $event) {
//display only tabs with events
foreach ($matchevents as $me) {
$cnt = 0;
if ($me->event_type_id == $event->id) {
$cnt++;
break;
}
}
if ($cnt == 0) {
continue;
}
// I think its better to show the event name,the the event image(gives some probs with tabs)
$pic_tab = $event->icon;
$imgTitle = JText::_($event->name);
$imgTitle2 = array(' title' => $imgTitle);
$txt_tab = JHtml::image($pic_tab, $imgTitle, $imgTitle2);
$backgroundStyle = "background: url(" . $pic_tab . ") no-repeat transparent";
if (empty($pic_tab)) {
$backgroundStyle = "";
}
$output .= $result->startPanel($txt_tab, $event->id);
//$output .= $result->startPanel($event->name,$event->id);
$output .= '<table class="matchreport" border="0">';
$output .= '<tr>';
$output .= '<td class="list">';
$output .= '<ul>';
foreach ($matchevents as $me) {
$output .= self::_formatEventContainerInResults($me, $event, $matchInfo->projectteam1_id, $backgroundStyle);
}
$output .= '</ul>';
$output .= '</td>';
$output .= '<td class="list">';
$output .= '<ul>';
foreach ($matchevents as $me) {
$output .= self::_formatEventContainerInResults($me, $event, $matchInfo->projectteam2_id, $backgroundStyle);
}
$output .= '</ul>';
$output .= '</td>';
$output .= '</tr>';
$output .= '</table>';
$output .= $result->endPanel();
}
if (!empty($substitutions)) {
$pic_time = 'images/com_joomleague/database/events/' . $this->project->fs_sport_type_name . '/playtime.gif';
$pic_out = 'images/com_joomleague/database/events/' . $this->project->fs_sport_type_name . '/out.png';
$pic_in = 'images/com_joomleague/database/events/' . $this->project->fs_sport_type_name . '/in.png';
$pic_tab = 'images/com_joomleague/database/events/' . $this->project->fs_sport_type_name . '/subst.png';
$imgTitle = JText::_('COM_JOOMLEAGUE_IN_OUT');
$imgTitle2 = array(' title' => $imgTitle);
$txt_tab = JHtml::image($pic_tab, $imgTitle, $imgTitle2);
$imgTime = JHtml::image($pic_time, JText::_('COM_JOOMLEAGUE_MATCHREPORT_SUBSTITUTION_MINUTE'), array(' title' => JText::_('COM_JOOMLEAGUE_MATCHREPORT_SUBSTITUTION_MINUTE')));
$imgOut = JHtml::image($pic_out, JText::_('COM_JOOMLEAGUE_MATCHREPORT_SUBSTITUTION_WENT_OUT'), array(' title' => JText::_('COM_JOOMLEAGUE_MATCHREPORT_SUBSTITUTION_WENT_OUT')));
$imgIn = JHtml::image($pic_in, JText::_('COM_JOOMLEAGUE_MATCHREPORT_SUBSTITUTION_CAME_IN'), array(' title' => JText::_('COM_JOOMLEAGUE_MATCHREPORT_SUBSTITUTION_CAME_IN')));
$output .= $result->startPanel($txt_tab, '0');
$output .= '<table class="matchreport" border="0">';
$output .= '<tr>';
$output .= '<td class="list">';
$output .= '<ul>';
foreach ($substitutions as $subs) {
$output .= self::_formatSubstitutionContainerInResults($subs, $matchInfo->projectteam1_id, $imgTime, $imgOut, $imgIn);
}
$output .= '</ul>';
$output .= '</td>';
$output .= '<td class="list">';
$output .= '<ul>';
foreach ($substitutions as $subs) {
$output .= self::_formatSubstitutionContainerInResults($subs, $matchInfo->projectteam2_id, $imgTime, $imgOut, $imgIn);
}
$output .= '</ul>';
$output .= '</td>';
$output .= '</tr>';
$output .= '</table>';
$output .= $result->endPanel();
}
$output .= $result->endPane();
} else {
$output .= '<table class="matchreport" border="0">';
$output .= '<tr>';
$output .= '<td class="list-left">';
$output .= '<ul>';
foreach ((array) $matchevents as $me) {
//.........这里部分代码省略.........