Location: PHPKode > projects > injooosm > components/com_injooosm/helpers/layout.php
<?php
/**
 * Joomla! 1.5 component injooosm
 *
 * @version $Id: layout.php 2010-02-05 14:53:00$
 * @author Christian Knorr
 * @package injooosm
 * @subpackage frontend
 * @license GNU/GPL
 * @filesource
 *
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

class layoutHelper {

	function navigation() {
		$user =& JFactory::getUser();
		$juser = new JUser($user->id);
		$uri =& JRequest::getVar('layout');
		$navi = '';
		$navi .= '<div class="gps-navi">';
		$navi .= '<div class="navi-part"><a href="'.
			JRoute::_("index.php?option=com_injooosm").'">'.JText::_("OSM_OVERVIEW").'</a></div>';
		$navi .= '<div class="navi-part"><a href="'.
			JRoute::_("index.php?option=com_injooosm&view=cats&layout=default").'">'.JText::_("OSM_CATS").'</a></div>';
		$navi .= '<div class="navi-part"><a href="'.
			JRoute::_("index.php?option=com_injooosm&view=files&layout=list").'">'.JText::_("OSM_FILES").'</a></div>';
		$cfg = injooosmHelper::getConfig();
// $navi .= "ich bin ".$juser->get('gid')." und muss mindestens ".$cfg->gid." sein";
		if ($user->get('id')) {
// Erscheint nur, wenn User kein Gast
			if ($juser->get('gid') >= $cfg->gid ) {
// Erscheint nur, wenn User Berechtigung zum erstellen hat
				$navi .= '<div class="navi-part"><a href="'.
					JRoute::_("index.php?option=com_injooosm&view=files&layout=form").'">'.
					JText::_("OSM_ADD_FILE").'</a></div>';
				}
// Erscheint bei jedem Registrierten
			$navi .= '<div class="navi-part"><a href="'.
				JRoute::_("index.php?option=com_injooosm&view=files&layout=user").'">'.
				JText::_("OSM_MY_FILES").'</a></div>';
			if ( ($uri != null) AND ($uri == 'file') ) {
// Erscheint nur bei einzelnen Dateien
			$gps = new injooosmModelFiles;
			$track =& JRequest::getVar('id');
			$track = $gps->getFile($track);
			if ( (
				( $user->get('id') == $track->uid ) OR ((int)$juser->gid) >= 20 )
// Wenn Trackbesitzer oder in Gruppe "Editor" oder höher
				) {
					$navi .= '<div class="navi-part"><a href="'.
						JRoute::_("index.php?option=com_injooosm&view=files&layout=form&id=".
						JRequest::getVar('id')).'">'.JText::_("OSM_UPDATE").'</a></div>';
					$navi .= '<div class="navi-part"><a href="'.
						JRoute::_("index.php?option=com_injooosm&controller=files&task=delete&id=".
						JRequest::getVar('id')).'">'.JText::_("OSM_DELETE_FILE").'</a></div>';
				}
			}
		}
		$navi .= '<div class="no-float"></div>';
		$navi .= '</div>';
		return $navi;
	}

	function footer() {
		$footer = '<div class="gps-footer">'.JText::_("OSM_POWEREDBY");
		$footer .= ' <a href="http://sourceforge.net/projects/injooosm"';
		$footer .= ' target="_blank">injooosm</a></div>';
		return $footer;
	}

	function disclaimericons() {
		$disclaimericons = '<div class="gps-footer">'.JText::_("OSM_DISCLAIMER_ICONS");
		$disclaimericons .= ' '.JText::_("OSM_FROM").' <a href="" target="_blank"></a></div>';
		return $disclaimericons;
	}
}
Return current item: injooosm