/** * Adds the OpenGraph information on the page * * @param array $data - the array containing the open graph data * * @return void */ public static function add($data) { $document = JFactory::getDocument(); $document->addCustomTag('<meta property="og:url" content="' . JURI::current() . '" />'); if (isset($data['type'])) { if ($data['type'] == 'place') { if (isset($data['lat']) && isset($data['lng'])) { $document->addCustomTag('<meta property="og:type" content="' . $data['type'] . '" />'); $document->addCustomTag('<meta property="place:location:latitude" content="' . $data['lat'] . '" />'); $document->addCustomTag('<meta property="place:location:longitude" content="' . $data['lng'] . '" />'); } } else { $document->addCustomTag('<meta property="og:type" content="' . $data['type'] . '" />'); } } if (isset($data['title'])) { $document->addCustomTag('<meta property="og:title" content="' . self::escape(JHtmlString::truncate(strip_tags($data['title']), 150)) . '" />'); } if (isset($data['description'])) { $document->addCustomTag('<meta property="og:description" content="' . self::escape(JHtmlString::truncate(strip_tags($data['description'], 200))) . '" />'); } if (isset($data['image']) && strlen($data['image'])) { $document->addCustomTag('<meta property="og:image" content="' . $data['image'] . '" />'); } }
public function updateFile() { $my = JXFactory::getUser(); $file_id = JRequest::getInt('file_id'); $file_name = JRequest::getVar('new_name', ''); $result = new stdClass(); $result->result = false; if (intval($file_id) > 0 && preg_match("/^[^\\/?*:;{}\\\\]+\$/", $file_name)) { $file = JTable::getInstance('File', 'StreamTable'); if ($file->load($file_id)) { if ($my->authorise('stream.file.edit', $file)) { $originalName = explode('.', $file->filename); $extension = array_pop($originalName); $file->filename = $file_name . '.' . $extension; $file->store(); $result->result = true; $result->fileid = $file_id; $result->filename = StreamTemplate::escape(JHtmlString::truncate($file->filename, 32)); $result->full_filename = StreamTemplate::escape(preg_replace('/\\.[a-z]+$/i', '', $file->filename)); } else { $result->error = JText::_('Not authorized to edit file!'); } } else { $result->error = $file->getError(); } } else { $result->error = JText::_('Invalid filename!'); } echo htmlspecialchars(json_encode($result), ENT_NOQUOTES); exit; }
/** * Get text from string with or without stripped html tags * Strips out Joomla plugin tags * Joomla 3.1+ only * */ static function getText($text, $type = 'html', $max_letter_count = 0, $strip_tags = true, $tags_to_keep = '') { $temp = ''; if ($max_letter_count == 0) { return $temp; } if ($max_letter_count > 0) { if ($type == 'html') { $temp = self::stripPluginTags($text); if ($strip_tags) { if ($tags_to_keep == '') { $temp = strip_tags($temp); return JHtmlString::truncate($temp, $max_letter_count, false, false); // splits words and no html allowed } else { $temp = strip_tags($temp, $tags_to_keep); if (method_exists('JHtmlString', 'truncateComplex')) { return JHtmlString::truncateComplex($temp, $max_letter_count, true); // since Joomla v3.1 } else { //JFactory::getApplication()->enqueueMessage(JText::_('LIB_SYW_WARNING_CANNOTUSETRUNCATE'), 'warning'); // requires Joomla 3.1 minimum return JHtmlString::truncate($temp, $max_letter_count, false, false); } } } else { if (method_exists('JHtmlString', 'truncateComplex')) { return JHtmlString::truncateComplex($temp, $max_letter_count, true); // since Joomla v3.1 } else { //JFactory::getApplication()->enqueueMessage(JText::_('LIB_SYW_WARNING_CANNOTUSETRUNCATE'), 'warning'); // requires Joomla 3.1 minimum JHtmlString::truncate($temp, $max_letter_count, false, false); } } } else { // 'txt' return JHtmlString::truncate($text, $max_letter_count, false, false); // splits words and no html allowed } } else { // take everything if ($type == 'html') { $temp = self::stripPluginTags($text); if ($strip_tags) { if ($tags_to_keep == '') { return strip_tags($temp); } else { return strip_tags($temp, $tags_to_keep); } } else { return $temp; } } else { // 'txt' return $text; } } return $temp; }
public static function truncateHighLight($text, $limit) { preg_match('/' . preg_quote(ElasticSearchConfig::getHighLigthPre()) . '/', $text, $matches, PREG_OFFSET_CAPTURE); if ($matches) { $posPreTag = $matches[0][1]; //If pos if at the beginning it is not necessary to truncate the left part if ($posPreTag > $limit * 0.75) { $pos = strpos($text, " ", $posPreTag - $limit * 0.3); $text = substr($text, $pos); $text = '... ' . $text; } return JHtmlString::truncate($text, $limit + 4, true, true); } return $text; }
/** * This method store a post by user. */ public function storePost() { $app = JFactory::getApplication(); /** @var $app JApplicationSite */ $content = $this->input->getString('content'); $user = JFactory::getUser(); $userId = $user->get('id'); $content = JString::trim(strip_tags($content)); $content = JHtmlString::truncate($content, 140); if (!$userId) { $app->close(); } $userTimeZone = !$user->getParam('timezone') ? null : $user->getParam('timezone'); try { $date = new JDate('now', $userTimeZone); $entity = new Socialcommunity\Wall\User\Post(JFactory::getDbo()); $entity->setUserId($userId); $entity->setContent($content); $entity->setCreated($date->toSql(true)); $entity->store(); } catch (Exception $e) { JLog::add($e->getMessage()); throw new Exception(JText::_('COM_SOCIALCOMMUNITY_ERROR_SYSTEM')); } $params = JComponentHelper::getParams('com_socialcommunity'); $filesystemHelper = new Prism\Filesystem\Helper($params); $mediaFolder = $filesystemHelper->getMediaFolderUri($userId); $profile = new Socialcommunity\Profile\Profile(JFactory::getDbo()); $profile->load(['user_id' => $userId]); $displayData = new stdClass(); $displayData->id = $entity->getId(); $displayData->profileLink = JRoute::_(SocialCommunityHelperRoute::getProfileRoute($profile->getSlug()), false); $displayData->name = htmlentities($profile->getName(), ENT_QUOTES, 'utf-8'); $displayData->alias = htmlentities($profile->getAlias(), ENT_QUOTES, 'utf-8'); $displayData->imageSquare = $mediaFolder . '/' . $profile->getImageSquare(); $displayData->imageAlt = $displayData->name; $displayData->content = $entity->getContent(); $displayData->created = JHtml::_('socialcommunity.created', $entity->getCreated(), $userTimeZone); $layout = new JLayoutFile('wall_post'); echo $layout->render($displayData); $app->close(); }
/** * Prepare the document */ protected function prepareDocument() { $app = JFactory::getApplication(); /** @var $app JApplicationSite */ // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx')); // Prepare page heading $this->preparePageHeading(); // Prepare page heading $this->preparePageTitle(); if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } else { if (!$this->item) { $metaDescription = JText::_('COM_CROWDFUNDING_REPORT_CAMPAIGN'); } else { $metaDescription = JText::sprintf('COM_CROWDFUNDING_REPORT_S', $this->item->title); } $this->document->setDescription($metaDescription); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetaData('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetaData('robots', $this->params->get('robots')); } // Breadcrumb $pathway = $app->getPathway(); $currentBreadcrumb = !$this->item ? JText::_('COM_CROWDFUNDING_REPORT_CAMPAIGN') : JHtmlString::truncate($this->item->title, 16); $pathway->addItem($currentBreadcrumb, ''); // Add scripts JHtml::_('jquery.framework'); JHtml::_('prism.ui.bootstrapMaxlength'); JHtml::_('prism.ui.bootstrap3Typeahead'); $this->document->addScript('media/' . $this->option . '/js/site/report.js'); }
/** * Tests the JHtmlString::truncateComplex method. * * @param string $html The text to truncate. * @param integer $maxLength The maximum length of the text. * @param boolean $noSplit Don't split a word if that is where the cutoff occurs (default: true) * @param string $expected The expected result. * * @return void * * @dataProvider getTestTruncateComplexData * @since 12.2 */ public function testTruncateComplex($html, $maxLength, $noSplit, $expected) { $this->assertThat(JHtmlString::truncateComplex($html, $maxLength, $noSplit), $this->equalTo($expected)); }
<?php echo $this->escape($item->title); ?> </a> <?php if ($this->displayProjectsNumber) { $number = !array_key_exists($item->id, $this->projectsNumber) ? 0 : $this->projectsNumber[$item->id]['number']; echo '( ' . $number . ' )'; } ?> </h3> <?php if ((bool) $this->params->get('categories_display_description', true)) { ?> <p><?php echo JHtmlString::truncate($item->description, $this->descriptionLength, true, false); ?> </p> <?php } ?> </div> </div> </div> <?php } ?> </div> </div> <?php }
} } ?> (<?php echo StreamMessage::formatBytes($row->filesize); ?> ) </span> <div class="file-list-meta-content"> <div class="file-list-meta-inner"> <span>Attached in:</span> <a href="<?php echo $streamObj->getUri(); ?> "><?php echo StreamTemplate::escape(JHtmlString::truncate($streamObj->message, 200)); ?> </a> </div> <span class="uploader"><a href="<?php echo $user->getURL(); ?> " class="actor-link"><?php echo $this->escape($user->name); ?> </a></span> </div> </div> <?php /*
<!-- Cell --> <?php if ($item->published != '1') { ?> <div class="system-unpublished"> <?php } ?> <?php if ($this->params->get('global_list_meta_title') != 'hide') { ?> <h3> <a href="<?php echo JRoute::_(hwdMediaShareHelperRoute::getMediaItemRoute($item->slug)); ?> "> <?php echo $this->escape(JHtmlString::truncate($item->title, $this->params->get('global_list_title_truncate'))); ?> </a> </h3> <?php } ?> <!-- Thumbnail Image --> <div class="media-item thumbnail"> <?php if ($canEdit || $canDelete) { ?> <!-- Actions --> <ul class="media-nav"> <li><a href="#" class="pagenav-manage"><?php echo JText::_('COM_HWDMS_MANAGE'); ?>
echo $newprod; ?> "> <span class="hover"></span> <?php $image = !empty($product->images[0]) ? $product->images[0]->displayMediaThumb('class="featuredProductImage" border="0"', FALSE) : ''; echo '<div class="image">' . JHTML::_('link', $link . $itemid, $image, array('title' => $product->product_name)) . '</div>'; ?> <div class="prod-details fixclear"> <h3><?php echo JHtml::link($link . $itemid, $product->product_name); ?> </h3> <p class="desc"><?php echo JHtmlString::truncate($product->product_desc, 80, true, false); ?> </p> <?php echo shopFunctionsF::renderVmSubLayout('kl_prices_basic', array('product' => $product, 'currency' => $currency)); ?> <div class="kl-extra-info"> <?php echo shopFunctionsF::renderVmSubLayout('kl_rating', array('showRating' => $showRating, 'product' => $product)); ?> </div> </div><!-- /.prod-details --> <div class="prod-actions"> <?php // More info button
?> </a> <div class="caption"> <h3> <a href="<?php echo JRoute::_(CrowdfundingHelperRoute::getDetailsRoute($this->item->slug, $this->item->catslug)); ?> "> <?php echo JHtmlString::truncate($this->item->title, $this->titleLength, true, false); ?> </a> </h3> <p><?php echo JHtmlString::truncate($this->item->short_desc, $this->descriptionLength, true, false); ?> </p> </div> <div class="cf-caption-info absolute-bottom"> <?php echo JHtml::_("crowdfunding.progressbar", $fundedPercents, $this->item->days_left, $this->item->funding_type); ?> <div class="row-fluid"> <div class="col-md-4"> <div class="bolder"><?php echo $this->item->funded_percents; ?> %</div> <div class="text-uppercase"><?php
/** * Prepare the document */ protected function prepareDocument() { // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx')); // Prepare page heading $this->preparePageHeading(); // Prepare page heading $this->preparePageTitle(); if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } else { $this->document->setDescription($this->item->short_desc); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } // Breadcrumb $pathway = $this->app->getPathWay(); $currentBreadcrumb = JHtmlString::truncate($this->item->title, 16); $pathway->addItem($currentBreadcrumb, ''); // Scripts JHtml::_('bootstrap.framework'); $this->document->addScript('media/' . $this->option . '/js/site/backing.js'); }
<tbody> <?php for ($i = 0, $max = count($this->mostFunded); $i < $max; $i++) { ?> <tr> <td><?php echo $i + 1; ?> </td> <td> <a href="<?php echo JRoute::_('index.php?option=com_crowdfunding&view=projects&filter_search=id:' . (int) $this->mostFunded[$i]['id']); ?> "> <?php echo JHtmlString::truncate(strip_tags($this->mostFunded[$i]['title']), 53); ?> </a> </td> <td> <?php echo $this->amount->setValue($this->mostFunded[$i]['funded'])->formatCurrency(); ?> </td> </tr> <?php } ?> </tbody> </table> </div>
<h3>Files</h3> <a href="<?php echo JRoute::_('index.php?option=com_stream&view=files&user_id=' . $this->user->id); ?> ">Show All (<?php echo $this->fileCount; ?> )</a> </div> <ol class="content-list"> <?php foreach ($this->files as $file) { $dlLink = JRoute::_('index.php?option=com_stream&view=system&task=download&file_id=' . $file->id); echo '<li class="message-content-file">'; echo '<a title="Click to download" href="' . $dlLink . '">' . StreamTemplate::escape(JHtmlString::truncate($file->filename, 24)) . '</a>'; echo ' <span class="small hint">(' . StreamMessage::formatBytes($file->filesize, 1) . ')</span>'; echo '</li>'; } ?> </ol> </div> <div class="data-grid"> <div class="content-title"> <h3>Links</h3> <a href="<?php echo JRoute::_('index.php?option=com_stream&view=links&user_id=' . $this->user->id); ?>
/** * Prepare the document */ protected function prepareDocument() { // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx')); // Prepare page heading $this->preparePageHeading(); // Prepare page heading $this->preparePageTitle(); if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } else { $this->document->setDescription(JText::sprintf('COM_CROWDFUNDING_MAIL_TO_FRIEND_META_DESC_S', $this->item->title)); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetaData('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetaData('robots', $this->params->get('robots')); } // Breadcrumb $pathway = $this->app->getPathway(); $currentBreadcrumb = JHtmlString::truncate($this->item->title, 16); $pathway->addItem($currentBreadcrumb, ''); // Add scripts JHtml::_('jquery.framework'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.formvalidation'); }
/** * Prepare the document */ protected function prepareDocument() { // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx')); // Prepare page heading $this->preparePageHeading(); // Prepare page heading $this->preparePageTitle(); // Meta description $this->document->setDescription($this->item->short_desc); if ($this->params->get('menu-meta_keywords')) { $this->document->setMetaData('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetaData('robots', $this->params->get('robots')); } // Breadcrumb $pathway = $this->app->getPathway(); $currentBreadcrumb = JHtmlString::truncate($this->item->title, 32); $pathway->addItem($currentBreadcrumb, ''); // Add scripts JHtml::_('jquery.framework'); }
<?php } ?> <td> <a href="<?php echo $orderlink; ?> " target="_blank"> <?php echo $item->order_number; ?> <span class="icon-print"></span> </a> <br/> <label class="label"> <?php echo JHtmlString::truncate($tour->title, 20, true); ?> </label> </td> <td class="center hidden-phone"> <?php echo $this->escape($item->id); ?> </td> </tr> <?php } } ?> </tbody> </table>
echo htmlspecialchars($user->name, ENT_QUOTES, 'UTF-8'); ?> </a> <?php } else { ?> <?php echo htmlspecialchars($user->name, ENT_QUOTES, 'UTF-8'); ?> <?php } ?> </span> <p><?php echo htmlspecialchars(JHtmlString::truncate($project->getShortDesc(), $params->get('description_length', 255), true, false), ENT_QUOTES, 'UTF-8'); ?> </p> </div> <div class="cf-caption-info absolute-bottom"> <?php echo JHtml::_('crowdfunding.progressbar', $fundedPercents, $project->getDaysLeft(), $project->getFundingType()); ?> <div class="row"> <div class="col-md-4"> <div class="bolder"><?php echo $project->getFundedPercent(); ?> %</div> <div class="text-uppercase"><?php
"> <img src="<?php echo JRoute::_(hwdMediaShareDownloads::thumbnail($item, $this->elementType)); ?> " border="0" alt="<?php echo $this->escape($item->title); ?> " style="width:100px;max-width:100%;;" /> </a> <?php } ?> </div> <?php if ($this->params->get('category_list_meta_category_desc') != 'hide') { ?> <div class="span9"> <?php echo $this->escape(JHtmlString::truncate(strip_tags($item->description), $this->params->get('global_list_desc_truncate'))); ?> <?php if ($this->params->get('category_list_meta_subcategory_count') != 'hide' || $this->params->get('category_list_meta_media_count') != 'hide') { ?> <?php if ($this->params->get('category_list_meta_media_count') != 'hide') { ?> <p> <span><?php echo JText::_('COM_HWDMS_MEDIA'); ?> </span> <span>(<?php echo (int) $item->numitems; ?> )</span>
if ($socialProfiles !== null) { ?> <div class="font-xxsmall"> <?php echo JText::sprintf('COM_CROWDFUNDING_BY_S', $profileName); ?> </div> <?php } ?> <?php if ((bool) $params->get('discover_display_description', Prism\Constants::DISPLAY)) { ?> <p><?php echo JHtmlString::truncate($item->short_desc, $displayData['descriptionLength'], true, false); ?> </p> <?php } ?> </div> <div class="cf-caption-info absolute-bottom"> <div class="row"> <div class="col-md-8"> <span class="text-uppercase"><span class="fa fa-university"></span> <?php echo JText::_('COM_CROWDFUNDING_RAISED'); ?> </span> </div> <div class="col-md-4 text-right">
/** * Tests the JHtmlString::truncateComplex method. * * @param string $html The text to truncate. * @param integer $maxLength The maximum length of the text. * @param boolean $noSplit Don't split a word if that is where the cutoff occurs (default: true) * @param string $expected The expected result. * * @return void * * @since 3.1 * @dataProvider getTestTruncateComplexData */ public function testTruncateComplex($html, $maxLength, $noSplit, $expected) { $this->assertEquals($expected, JHtmlString::truncateComplex($html, $maxLength, $noSplit)); }
<div class="small"> <?php echo $this->escape($item->parent_txn_id); ?> </div> <?php } ?> </td> <td class="hidden-phone"> <a href="<?php echo JRoute::_("index.php?option=com_crowdfunding&view=transactions&filter_search=pid:" . $item->project_id); ?> "> <?php echo JHtmlString::truncate(strip_tags($item->project), 53); ?> </a> </td> <td class="hidden-phone"> <?php echo JHtml::_("crowdfundingbackend.name", $item->sender, $item->investor_id); ?> </td> <td class="hidden-phone"> <?php echo JHtml::_("crowdfundingbackend.name", $item->beneficiary, $item->receiver_id); ?> </td> <td><?php echo JHtml::_('crowdfundingbackend.transactionAmount', $item, $this->amount, $this->currencies);
<li class="post"> <div class="details"> <span class="date"><?php echo JHtml::_('date', $item->publish_up, JText::_('TPL_KALLYAS_MOD_LPOSTS_DATE_FORMAT_LP2')); ?> </span> <span class="cat"><?php echo JText::sprintf('TPL_KALLYAS_MOD_LPOSTS_CONTENT_PARENT', $item->category_title); ?> </span> </div> <h4 class="title"><a href="<?php echo $item->link; ?> "><?php echo $item->title; ?> </a></h4> <div class="text"><?php echo JHtmlString::truncate($item->introtext, $params->get('introtext_limit', 200), true, false); ?> </div> </li> <?php } ?> </ul> </div> </div><!-- end // latest posts style 2 -->
/** * Tests the JHtmlString::truncate method. * * @param string $text The text to truncate. * @param integer $length The maximum length of the text. * @param boolean $noSplit Don't split a word if that is where the cutoff occurs (default: true). * @param boolean $allowHtml Allow HTML tags in the output, and close any open tags (default: true). * @param string $expected The expected result. * * @return void * * @dataProvider getTestTruncateData * @since 11.3 */ public function testTruncate($text, $length, $noSplit, $allowedHtml, $expected) { $this->assertThat(JHtmlString::truncate($text, $length, $noSplit, $allowedHtml), $this->equalTo($expected)); }
echo $subject->order_number; ?> </a> <br /> <label class="label"> <?php if (isset($orderComplex->hotel)) { ?> <a href="<?php echo JRoute::_('index.php?option=com_bookpro&view=hotel&id=' . $orderComplex->hotel->id); ?> " title="<?php echo $orderComplex->hotel->title; ?> "><?php echo JHtmlString::truncate($orderComplex->hotel->title, 20, true); ?> </a> <?php } ?> </label> </td> <td><?php echo isset($orderComplex->orderinfos[0]) ? JFactory::getDate($orderComplex->orderinfos[0]->start)->format(DateHelper::getConvertDateFormat('P')) : ''; ?> </td> <td><?php echo isset($orderComplex->orderinfos[0]) ? HotelHelper::checkOutDate($orderComplex->orderinfos[0]->end) : ''; ?> </td>
</a> </h3> <?php if (!is_null($this->socialProfileLink)) { ?> <div class="font-xxsmall"> <?php echo JText::sprintf('COM_CROWDFUNDING_BY_S', JHtml::_('crowdfunding.socialProfileLink', $this->socialProfileLink, $this->item->user_name, array('target' => '_blank'))); ?> </div> <?php } ?> <p><?php echo JHtmlString::truncate($this->item->short_desc, $this->params->get('discover_description_length', 255), true, false); ?> </p> <?php echo JHtml::_('crowdfunding.progressbar', $this->item->funded_percents, $this->item->days_left, $this->item->funding_type); ?> <div class="row"> <div class="col-md-4"> <div class="bolder"><?php echo $this->item->funded_percents; ?> %</div> <div class="text-uppercase"><?php echo JText::_('COM_CROWDFUNDING_FUNDED');
<div class="media-body"> <h4 class="media-heading"> <a href="<?php echo JRoute::_(UserIdeasHelperRoute::getDetailsRoute($item->slug, $item->catid)); ?> " > <?php echo $this->escape($item->title); ?> </a> </h4> <?php if ($this->params->get("items_display_description", 1)) { ?> <?php echo JHtmlString::truncate($item->description, $this->params->get("items_description_length", 255), true, $this->params->get("items_description_html", 0)); ?> <?php } ?> </div> <div class="clearfix"></div> <div class="well well-small"> <div class="pull-left"> <?php $name = strcmp("name", $this->params->get("name_type")) == 0 ? $item->name : $item->username; $profile = JHtml::_("userideas.profile", $this->socialProfiles, $item->user_id); // Prepare item owner avatar. $profileAvatar = null; if ($this->params->get("integration_display_owner_avatar", 0)) { $profileAvatar = JHtml::_("userideas.avatar", $this->socialProfiles, $item->user_id, $this->integrationOptions);
"> <?php echo $this->item->client_id == 0 ? JText::_('JSITE') : JText::_('JADMINISTRATOR'); ?> </span> </div> <div> <?php $short_description = JText::_($this->item->xml->description); $this->fieldset = 'description'; $long_description = JLayoutHelper::render('joomla.edit.fieldset', $this); if (!$long_description) { $truncated = JHtmlString::truncate($short_description, 550, true, false); if (strlen($truncated) > 500) { $long_description = $short_description; $short_description = JHtmlString::truncate($truncated, 250); if ($short_description == $long_description) { $long_description = ''; } } } ?> <p><?php echo $short_description; ?> </p> <?php if ($long_description) { ?> <p class="readmore"> <a href="#" onclick="jQuery('.nav-tabs a[href=#description]').tab('show');">
/** * Prepare the document */ protected function prepareDocument() { $app = JFactory::getApplication(); /** @var $app JApplicationSite * */ // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx')); // Prepare page heading $this->preparePageHeading(); // Prepare page heading $this->preparePageTitle(); // Meta description $this->document->setDescription($this->item->short_desc); if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } // Breadcrumb $pathway = $app->getPathWay(); $currentBreadcrumb = JHtmlString::truncate($this->item->title, 32); $pathway->addItem($currentBreadcrumb, ''); // Add styles // Load bootstrap media styles if ($this->params->get("bootstrap_mediacomponent", false)) { JHtml::_("itprism.ui.bootstrap_mediacomponent"); } // Add scripts JHtml::_('jquery.framework'); }