Location: PHPKode > projects > Visitas > html/com_content/article/default.php
<?php 
/**
 * Joomla! 1.5 template MobiVisit
 * A Joomla template for mobile phones
 *
 * @version $Id: $
 * @package Joomla
 * @subpackage MobiVisit
 *
 * This program has been created by Omicron Ceti AB on behalf of 
 * Norrbottens county council, Piteå municipality, Region of Västerbotten, 
 * Robertsfors municipality, Skellefteå municipality, Umeå municipality, 
 * Västerbottens county council and the European Regional Development Found
 * 
 * @copyright Copyright (C) 2010 Municipality of Umea, Sweden
 * @author Magnus Häggström - Omicron Ceti AB
 * @author Mikael Wiberg - Omicron Ceti AB
 * 
 * @license GNU/GPL v2
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */


// no direct access
defined('_JEXEC') or die('Restricted access');
/*print_r($this);*/

/* Show title if it should be shown */
if ($this->params->get('show_page_title', 1) && $this->params->get('page_title') != $this->article->title) {
	echo '<div class="componentheading'.$this->escape($this->params->get('pageclass_sfx')).'">'.$this->escape($this->params->get('page_title')).'</div>';
}

/* Show edit tools if authorized user */ 
/* 
 * Edit button is disabled in MobiVisit
 * A user shall never be able to edit site from MobiVisit frontend
 *
if (($this->user->authorize('com_content', 'edit', 'content', 'all') || $this->user->authorize('com_content', 'edit', 'content', 'own')) && !$this->print) {
	echo '<div class="contentpaneopen_edit'.$this->escape($this->params->get( 'pageclass_sfx' )).'" >'; 
	echo JHTML::_('icon.edit', $this->article, $this->params, $this->access);
	echo '</div>';
}
*/

/* Show title if it should be shown */
if ($this->params->get('show_title',1)) {
	echo '<h2 class="contentheading'.$this->escape($this->params->get( 'pageclass_sfx' )).'">';
	if ($this->params->get('link_titles') && $this->article->readmore_link != '') {
		echo '<a href="'.$this->article->readmore_link.'" class="contentpagetitle'.$this->escape($this->params->get( 'pageclass_sfx' )).'">';
		echo $this->escape($this->article->title);
		echo '</a>';
	} else {
		echo $this->escape($this->article->title);
	}
	echo '</h2>';
}

echo $this->article->event->afterDisplayTitle;

if (
($this->params->get('show_create_date'))
|| (($this->params->get('show_author')) && ($this->article->author != ""))
|| (($this->params->get('show_section') && $this->article->sectionid) || ($this->params->get('show_category') && $this->article->catid))
|| ($this->params->get('show_pdf_icon') || $this->params->get('show_print_icon') || $this->params->get('show_email_icon'))
|| ($this->params->get('show_url') && $this->article->urls)
) :
?>
<div class="article-tools">
	<div class="article-meta">
	<?php if ($this->params->get('show_create_date')) : ?>
		<span class="createdate">
			<?php echo JHTML::_('date', $this->article->created, JText::_('DATE_FORMAT_LC2')) ?>
		</span>
	<?php endif; ?>

	<?php if (($this->params->get('show_author')) && ($this->article->author != "")) : ?>
		<span class="createby">
			<?php $this->escape(JText::printf(($this->escape($this->article->created_by_alias) ? $this->escape($this->article->created_by_alias) : $this->escape($this->article->author)) )); ?>
		</span>
	<?php endif; ?>

	<?php if (($this->params->get('show_section') && $this->article->sectionid) || ($this->params->get('show_category') && $this->article->catid)) : ?>
		<?php if ($this->params->get('show_section') && $this->article->sectionid && isset($this->article->section)) : ?>
		<span class="article-section">
			<?php if ($this->params->get('link_section')) : ?>
				<?php echo '<a href="'.JRoute::_(ContentHelperRoute::getSectionRoute($this->article->sectionid)).'">'; ?>
			<?php endif; ?>
			<?php echo $this->escape($this->article->section); ?>
			<?php if ($this->params->get('link_section')) : ?>
				<?php echo '</a>'; ?>
			<?php endif; ?>
				<?php if ($this->params->get('show_category')) : ?>
				<?php echo ' - '; ?>
			<?php endif; ?>
		</span>
		<?php endif; ?>
		<?php if ($this->params->get('show_category') && $this->article->catid) : ?>
		<span class="article-section">
			<?php if ($this->params->get('link_category')) : ?>
				<?php echo '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->article->catslug, $this->article->sectionid)).'">'; ?>
			<?php endif; ?>
			<?php echo $this->escape($this->article->category); ?>
			<?php if ($this->params->get('link_category')) : ?>
				<?php echo '</a>'; ?>
			<?php endif; ?>
		</span>
		<?php endif; ?>
	<?php endif; ?>
	</div>
	<?php /*if ($this->params->get('show_pdf_icon') || $this->params->get('show_print_icon') || $this->params->get('show_email_icon')) : ?>
	<div class="buttonheading">
		<?php if (!$this->print) : ?>
			<?php if ($this->params->get('show_email_icon')) : ?>
			<span>
			<?php echo JHTML::_('icon.email',  $this->article, $this->params, $this->access); ?>
			</span>
			<?php endif; ?>

			<?php if ( $this->params->get( 'show_print_icon' )) : ?>
			<span>
			<?php echo JHTML::_('icon.print_popup',  $this->article, $this->params, $this->access); ?>
			</span>
			<?php endif; ?>

			<?php if ($this->params->get('show_pdf_icon')) : ?>
			<span>
			<?php echo JHTML::_('icon.pdf',  $this->article, $this->params, $this->access); ?>
			</span>
			<?php endif; ?>
		<?php else : ?>
			<span>
			<?php echo JHTML::_('icon.print_screen',  $this->article, $this->params, $this->access); ?>
			</span>
		<?php endif; ?>
	</div>
	<?php endif;*/ ?>

	<?php if ($this->params->get('show_url') && $this->article->urls) : ?>
		<span class="article-url">
			<a href="http://<?php echo $this->escape($this->article->urls) ; ?>" target="_blank">
				<?php echo $this->escape($this->article->urls); ?></a>
		</span>
	<?php endif; ?>
</div>
<?php endif; ?>

<?php echo $this->article->event->beforeDisplayContent; ?>

<?php 
JPlugin::loadLanguage( 'tpl_mobivisit' );
$uri=&JURI::getInstance();
if($this->article->fulltext == "") {
      $visibletext = $this->article->text; 
}else if($uri->getVar('readmore', 0) == 1) {
      $visibletext = $this->article->text;
} else {
      ?><div class="clearfix" /><?php
      $visibletext = $this->article->introtext;
      // Find if there are any images in text 
      if(preg_match('/<\s*img.*?\s*>/is', $this->article->text, $matches)) {
           ?><div class="article-images"><?php
           // Show image first, without alignment
	   echo preg_replace('/align\s*=\s*\"\w*\"/i','',$matches[0])."\n";
           // Remove all other visible images
	   $visibletext = preg_replace('/<\s*img.*?\s*>/is','', $visibletext);
           ?></div><?php
      }
      // Show read more link
      $uri->setVar('readmore', 1);
      $visibletext .= '
          <p><a href="'.str_replace("&","&amp;",$uri->toString()).'">'.JText::_( 'READ MORE' ).'</a></p>';
      $uri->delVar('readmore', 0);
      // Append custom properties tags
      if(preg_match('/<\s*div\s*class\s*=\s*[\'"]cp_tags[\'"]\s*.+<\/\s*div\s*>/is', $this->article->text, $matches)) {
/*           ?><textarea rows="20" cols="100"><?php
           echo $matches[0];
           ?></textarea><?php*/
           $visibletext .= $matches[0];
      } 
} 
?>

<div class="article-content">
<?php if (isset ($this->article->toc)) : ?>
	<?php echo $this->article->toc; ?>
<?php endif; ?>
<?php echo $visibletext; ?>
</div>

<?php if ( intval($this->article->modified) !=0 && $this->params->get('show_modify_date')) : ?>
	<span class="modifydate">
		<?php echo JText::sprintf('LAST_UPDATED2', $this->escape(JHTML::_('date', $this->article->modified, JText::_('DATE_FORMAT_LC2')))); ?>
	</span>
<?php endif; ?>

<span class="article_separator">&nbsp;</span>
<?php echo $this->article->event->afterDisplayContent; ?>
Return current item: Visitas