本文整理汇总了PHP中JHtml::link方法的典型用法代码示例。如果您正苦于以下问题:PHP JHtml::link方法的具体用法?PHP JHtml::link怎么用?PHP JHtml::link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JHtml
的用法示例。
在下文中一共展示了JHtml::link方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItems
public function getItems()
{
$db = JFactory::getDbo();
$config = SroHelper::getConfig();
$altinn = $this->getState("filter.altsearch");
$gencode = $this->getState("filter.generatecode");
$botcode = substr(md5(time()), 0, 6);
$ip = $_SERVER["REMOTE_ADDR"];
$dbextra = $this->getState("dbextra", "");
if ($dbextra == 'captcha') {
$img = self::randomCaptcha();
$items = array('error' => $config->get("error_captcha"), 'captcha' => '/media/com_sro/images/captcha/' . $img[basename]);
return $items;
}
if ($dbextra == 'generate') {
self::genCode($db, $gencode, $botcode);
}
if ($dbextra == 'alt') {
self::getCode($db, $config, $altinn, $botcode, $ip);
}
$db->setQuery($this->_getListQuery(), $this->getState("list.start"), $this->getState("list.limit"));
$items = $db->loadObjectList();
if (!$this->getState("dbextra", false)) {
$rootfolder = $config->get("rootfolder");
$linktext = $config->get("file_text", JText::_("COM_SRO_DOWNLOAD"));
$fullpath = JPATH_SITE . "/" . $rootfolder;
foreach ($items as &$item) {
$files = JFolder::files($fullpath, $item->inn);
$item->file = empty($files) ? "" : JHtml::link(JURI::base() . $rootfolder . "/" . $files[0], $linktext);
}
}
return $items;
}
示例2: getComposedEmail
public static function getComposedEmail($parms, $cfg, $article, $email = true, $updt = false)
{
$tnam = $email ? 'email_tmpl' : 'sms_tmpl';
$tmpl = $cfg[$tnam] ?: $parms->get($tnam, '');
if ($uppo = strpos($tmpl, '[[update]]')) {
if ($updt) {
$tmpl = trim(substr($tmpl, $uppo + 10));
} else {
$tmpl = trim(substr($tmpl, 0, $uppo));
}
}
if (preg_match_all('|{{([A-Z_-]+)}}|', $tmpl, $mtchs)) {
//var_dump($mtchs);
foreach ($mtchs[1] as $mtch) {
$rpl = '';
switch ($mtch) {
case 'TITLE':
$rpl = $article->title;
break;
case 'CATEGORY':
$rpl = self::getCatTitle($article->catid);
break;
case 'ITEM-LINK':
$rpl = self::getArticleHref($article);
$rpl = JHtml::link($rpl, $rpl);
break;
}
if ($rpl) {
$tmpl = str_replace('{{' . $mtch . '}}', $rpl, $tmpl);
}
}
}
return $tmpl;
}
示例3: preflight
public function preflight()
{
if (!version_compare(JVERSION, $this->required, '>=')) {
$link = JHtml::link('index.php?option=com_joomlaupdate', $this->required);
JFactory::getApplication()->enqueueMessage(sprintf('You need Joomla! %s or later to install this extension', $link), 'error');
return false;
}
return true;
}
示例4: createInfoBox
/**
* createInfoBox
*
* @param $context
* @param $article
* @param $params
*
* @return string
*/
public static function createInfoBox($context, $article, $params)
{
$input->{$option} = JRequest::getVar('option');
$view = JRequest::getVar('view');
$layout = JRequest::getVar('layout', 'default');
if ($option != 'com_content' || $view != 'article' || $layout != 'default') {
return;
}
// Include Component Core
include_once JPATH_ADMINISTRATOR . '/components/com_userxtd/includes/core.php';
$ux = plgSystemUserxtd::getInstance();
$param = $ux->params;
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
UXHelper::_('lang.loadLanguage', 'com_userxtd', 'admin');
if ($app->isAdmin()) {
return;
}
// init params
$image_field = $param->get('UserInfo_ImageField', 'BASIC_AVATAR');
$title_field = $param->get('UserInfo_TitleField', 'name');
$about_field = $param->get('UserInfo_AboutField', 'BASIC_ABOUT');
$website_field = $param->get('UserInfo_WebiteField', 'BASIC_WEBSITE');
$width = $param->get('UserInfo_ImageWidth', 150);
$height = $param->get('UserInfo_ImageHeight', 150);
$crop = $param->get('UserInfo_ImageCrop', 1);
$include_css = $param->get('UserInfo_IncludeCSS_Article', 1);
// Include CSS
if ($include_css) {
$doc->addStyleSheet('administrator/components/com_userxtd/includes/bootstrap/css/bootstrap.min.css');
$doc->addStyleSheet('components/com_userxtd/includes/css/userxtd-userinfo.css');
}
// handle params
$user = UXFactory::getUser($article->created_by);
$image = $user->get($image_field);
$image = AKHelper::_('thumb.resize', $image, $width, $height, $crop);
$link = JRoute::_('index.php?option=com_userxtd&view=user&id=' . $user->get('id'));
$link = JHtml::link($link, JText::_('COM_USERXTD_USER_INFO_MORE'));
$website_link = $user->get($website_field);
$website_link = $website_link ? JHtml::link($website_link, JText::_('COM_USERXTD_USER_INFO_WEBSITE')) : null;
// Get Template override
$tpl = $app->getTemplate();
$file = JPATH_THEMES . "/{$tpl}/html/plg_userxtd/content/userInfo.php";
if (!JFile::exists($file)) {
$file = dirname(__FILE__) . '/tmpl/userInfo.php';
}
// Start capturing output into a buffer
ob_start();
// Include the requested template filename in the local scope
include $file;
// Done with the requested template; get the buffer and clear it.
$html = ob_get_contents();
ob_end_clean();
return $html;
}
示例5: autoThumb
/**
* autoThumb
*
* @param string $context
* @param object $article
* @param \JRegistry $params
*
* @return void
*/
public static function autoThumb($context, $article, $params = null)
{
\JHtmlBehavior::modal();
$minimal = 30;
$es = \Ezset::getInstance();
include_once EZSET_ROOT . '/lib/dom/simple_html_dom.php';
$html = str_get_html($article->text);
$imgs = $html->find('img');
foreach ($imgs as $img) {
$classes = explode(' ', $img->class);
$imgUrl = UriHelper::pathAddHost($img->src);
// Has class nothumb, skip to next.
if (in_array('nothumb', $classes)) {
continue;
}
// If is anchor already, skip to next.
if ($img->parent->tag == 'a') {
continue;
}
// If img tag has no width and height attrs, skip.
if (!$img->width && !$img->height) {
continue;
}
// If not localhost image, skip.
if (!strpos('-' . $imgUrl, \JURI::root()) && $es->params->get('onlyLocalhostThumb', 1)) {
continue;
}
// Get img path and size
$imgPath = \JPath::clean(str_replace(\JURI::root(), JPATH_ROOT . '/', $imgUrl));
$size = getimagesize($imgPath);
// Manul size
$imgW = $img->width;
$imgH = $img->height;
// Original size
$oriW = $size[0];
$oriH = $size[1];
// If too small, skip.
if ($oriW <= $minimal || $oriH <= $minimal) {
continue;
}
// If large ten origin, skip.
if ($oriW <= $imgW || $oriW <= $imgW) {
continue;
}
// Get thumb url
$thumb = new \Windwalker\Image\Thumb();
$img->src = $thumb->resize($imgUrl, $imgW, $imgH);
$imgtext = $img->outertext;
$imgtext = \JHtml::link($imgUrl, $imgtext, array('class' => 'modal'));
$img->outertext = $imgtext;
$classes = null;
}
$article->text = $html->save();
}
示例6: getStaffLink
public static function getStaffLink($item, $params)
{
$flag = "";
if ($params->get('show_flag')) {
$flag = Countries::getCountryFlag($item->country) . " ";
}
$text = "<i>" . JoomleagueHelper::formatName(null, $item->firstname, $item->nickname, $item->lastname, $params->get("name_format")) . "</i>";
if ($params->get('show_staff_link')) {
$link = JoomleagueHelperRoute::getStaffRoute($params->get('p'), $params->get('team'), $item->slug);
echo $flag . JHtml::link($link, $text);
} else {
echo '<i>' . JText::sprintf('%1$s', $flag . $text) . '</i>';
}
}
示例7: notice
/**
* function notice
* @param
*/
public function notice()
{
$params = $this->params;
$redirect = false;
if ($params->get('Integrate_Override_InsertImageArticle', 1) || $params->get('Integrate_Override_MediaFormField', 1) || $params->get('Integrate_Override_MediaManager', 1)) {
$redirect = true;
}
$enabled = JPluginHelper::isEnabled('system', 'remoteimage');
if ($redirect && !$enabled) {
$msg = JText::_('COM_REMOTEIMAGE_SYSTEM_PLUGIN_NEED_ENABLED') . '<br />';
$msg .= JHtml::link(JRoute::_('index.php?option=com_plugins&filter_search=remoteimage'), JText::_('COM_REMOTEIMAGE_GO_TO_PLUGINS'), array('target' => '_blank'));
$app = JFactory::getApplication();
$app->enqueueMessage($msg, 'warning');
}
}
示例8: getInput
protected function getInput()
{
$html = '<fieldset id="' . $this->name . '" class="radio">';
$setupURLid = $this->name . '_setupURL';
$arr = array(JHtml::_('select.option', '1', JText::_('JYES')), JHtml::_('select.option', '0', JText::_('JNO')));
$html .= JHtml::_('select.radiolist', $arr, $this->name, 'onchange="$(\'' . $setupURLid . '\').toggle()"', 'value', 'text', (int) $this->value);
$attribs = array();
$attribs['class'] = 'modal';
$attribs['style'] = 'float: right; display:' . ($this->value ? 'inline' : 'none');
$attribs['rel'] = "{handler: 'iframe', size: {x: 640, y: 480}}";
$attribs['id'] = $setupURLid;
$html .= JHtml::link($this->element->getAttribute('setupURL'), '<input style="color: #F00; font-weight: bold; border-color: #F00;" type="button" value="Setup" />', $attribs);
$html .= '</fieldset>';
return $html;
}
示例9: getLabel
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 11.1
*/
protected function getLabel()
{
$db = JFactory::getDbo();
$q = $db->getQuery(true);
$q->select("extension_id")->from("#__extensions")->where("name = 'plg_system_akmarkdown'");
$db->setQuery($q);
$id = $db->loadResult();
$html = '';
if ($id) {
$link = "index.php?option=com_plugins&task=plugin.edit&extension_id=" . $id;
$html = JHtml::link($link, JText::_('PLG_EDITORS_AKMARKDOWN_GOTO_SYSTEM'), array('target' => '_blank'));
$html = "<label>{$html}</label>";
}
return $html;
}
示例10: switch
</span>
</td>
<td class="data">
<?php
$outputName = JoomleagueHelper::formatName(null, $this->person->firstname, $this->person->nickname, $this->person->lastname, $this->config["name_format"]);
if ($this->person->id) {
switch ($this->config['show_user_profile']) {
case 1:
// Link to Joomla Contact Page
$link = JoomleagueHelperRoute::getContactRoute($this->person->contact_id);
$outputName = JHtml::link($link, $outputName);
break;
case 2:
// Link to CBE User Page with support for JoomLeague Tab
$link = JoomleagueHelperRoute::getUserProfileRouteCBE($this->person->id, $this->project->id, $this->person->id);
$outputName = JHtml::link($link, $outputName);
break;
default:
break;
}
}
echo $outputName;
?>
</td>
</tr>
<?php
if (!empty($this->person->nickname)) {
?>
<tr>
<td class="">
<span class="label">
示例11: testLink
/**
* Tests the link method.
*
* @param string $url The href for the anchor tag.
* @param string $text The text for the anchor tag.
* @param mixed $attribs A string or array of link attributes.
* @param string $expected The expected result.
*
* @return void
*
* @since 3.1
* @dataProvider dataTestLink
*/
public function testLink($url, $text, $attribs, $expected)
{
$this->assertEquals(JHtml::link($url, $text, $attribs), $expected);
}
示例12:
<td align="left">
<?php
if ($prow->virtuemart_media_id) {
?>
<span class="cart-images">
<?php
if (!empty($prow->images[0])) {
echo $prow->images[0]->displayMediaThumb('', FALSE);
}
?>
</span>
<?php
}
?>
<?php
echo JHtml::link($prow->url, $prow->product_name);
echo $this->customfieldsModel->CustomsFieldCartDisplay($prow);
?>
</td>
<td align="left"><?php
echo $prow->product_sku;
?>
</td>
<td align="center">
<?php
if (VmConfig::get('checkout_show_origprice', 1) && $prow->prices['discountedPriceWithoutTax'] != $prow->prices['priceWithoutTax']) {
echo '<span class="line-through">' . $this->currencyDisplay->createPriceDiv('basePriceVariant', '', $prow->prices, TRUE, FALSE) . '</span><br />';
}
if ($prow->prices['discountedPriceWithoutTax']) {
echo $this->currencyDisplay->createPriceDiv('discountedPriceWithoutTax', '', $prow->prices, FALSE, FALSE);
示例13: array
echo $review->comment;
?>
</blockquote>
<span class="bold"><?php
echo $review->customer;
?>
</span>
</div>
<?php
}
$i++;
if ($i == $ratingsShow && !$showall) {
/* Show all reviews ? */
if ($reviews_published >= $ratingsShow) {
$attribute = array('class' => 'details', 'title' => vmText::_('COM_VIRTUEMART_MORE_REVIEWS'));
echo JHtml::link($this->more_reviews, vmText::_('COM_VIRTUEMART_MORE_REVIEWS'), $attribute);
}
break;
}
}
} else {
// "There are no reviews for this product"
?>
<span class="step"><?php
echo vmText::_('COM_VIRTUEMART_NO_REVIEWS');
?>
</span>
<?php
}
?>
<div class="clear"></div>
示例14: foreach
<?php
foreach ($this->matchstaffs as $player) {
if ($player->pposid == $pos->pposid && $player->ptid == $this->match->projectteam2_id) {
?>
<li class="list">
<?php
$match_player = JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $this->config["name_format"]);
$imgTitle = JText::sprintf('Picture of %1$s', $match_player);
$picture = $player->picture;
if (!file_exists($picture)) {
$picture = JoomleagueHelper::getDefaultPlaceholder("player");
}
echo JoomleagueHelper::getPictureThumb($picture, $imgTitle, $this->config['staff_picture_width'], $this->config['staff_picture_height']);
echo ' ';
$player_link = JoomleagueHelperRoute::getStaffRoute($this->project->slug, $player->team_slug, $player->person_slug);
echo JHtml::link($player_link, $match_player);
?>
</li>
<?php
}
}
?>
</ul>
</div>
</td>
</tr>
<?php
}
?>
</table>
<?php
示例15: array
echo $item->custom_title;
?>
</td>
<td class="center">
<input type="text" name="alias[<?php
echo $item->id;
?>
]" class="cf_alias_input" id="cf_alias_<?php
echo $item->id;
?>
" disabled="disabled" class="inputbox" size="45" value="<?php
echo $item->alias;
?>
"/>
<?php
echo JHtml::link('javascript:void(0)', ' ', array('class' => 'cf_edit_btn', 'onclick' => "document.id('cf_alias_" . $item->id . "').disabled=''"));
?>
</td>
<td class="left">
<?php
echo $item->custom_descr;
?>
</td>
<td class="left">
<?php
echo $item->field_type;
?>
</td>
<td class="order">