Location: PHPKode > projects > injooosm > administrator/components/com_injooosm/views/files/tmpl/form.php
<?php
/**
 * Joomla! 1.5 component injooosm
 *
 * @version $Id: form.php 2010-02-08 15:49:00$
 * @author Christian Knorr
 * @package injooosm
 * @subpackage backend
 * @license GNU/GPL
 * @filesource
 *
 */

defined('_JEXEC') or die('Restricted access');

// toolbar
if($this->id < 1)
	$title = JText::_('OSM_ADD_FILE');
else
	$title = JText::_('OSM_EDIT_FILE');
JToolBarHelper::title($title, 'categories.png');
JToolBarHelper::back($alt= 'Back', $href= 'javascript:history.back();');
JToolBarHelper::spacer();
if($this->id < 1):
	JToolBarHelper::save('savefile', 'Save', 'save.png' );
else:
	JToolBarHelper::save('updatefile', 'Save', 'save.png' );
endif;

$map = "";
if($this->id >= 1) {
	$cache =& JFactory::getCache('com_injooosm');
	$cfg = injooosmHelper::getConfig();
	$model = $this->getModel();
	$track = $cache->get(array($model, 'getFile'), array($id));
	$document =& JFactory::getDocument();
	require_once("..".DS."components".DS."com_injooosm".DS."helpers".DS."gpsClass.php");
	$gps = new gpsClass();
	$document->addScript('http://www.openlayers.org/api/OpenLayers.js');
	$document->addScript('http://www.openstreetmap.org/openlayers/OpenStreetMap.js');
	$document->addScript('http://www.openlayers.org/api/Ajax.js');
// 	JHTML::script('injooosm.js', 'components/com_injooosm/assets/js/', false); // Für Durchschnittsberechnung
	$document->addScript("../components/com_injooosm/assets/js/injooosm.js");
	$document->addScript("../components/com_injooosm/assets/js/jd.gallery.js");
// 	$document->addScript('');
// 	$document->addScript('http://ajax.googleapis.com/ajax/libs/dojo/1.3/dojo/dojo.xd.js');
	$map .= $gps->writeSingleTrackOSM($this->track->file);
	$map .= ("<div id=\"map\" align=\"center\" ");
	$map .= ("style=\"width: 400px; height: 300px; background-color:#EEE; vertical-align:middle;\" >");
	$map .= ("<script>slippymap_init(\"map\");</script>");
// 	$map .= ("<br><br>".JText::_('OSM_MAPLOADING'));
	$map .= ("</div>");
}

?>
<form action="" method="post" name="adminForm" id="adminForm" class="adminForm" enctype="multipart/form-data">
    <table class="adminlist" cellpadding="1">
        <thead>
            <tr>
                <th colspan="3" align="center"><?php echo $title; ?></th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td><?php echo JText::_('OSM_FILE').":"; if($this->id < 1) echo "*";?></td>
                <td><?php if($this->id < 1) { ?><input type="file" name="file" value="" size="30" /><?php } else echo $this->track->file; ?></td>
                <td rowspan="9" width="1" valign="top"><?php echo $map; ?></td>
            </tr><?php if($this->id >= 1) { ?>
            <tr>
                <td>Id:</td>
                <td><?php echo $this->id; ?></td>
            </tr><?php } ?>
            <tr>
                <td><?php echo JText::_('OSM_TITLE'); ?>:*</td>
                <td><input id="title" type="text" name="title" value="<?php if(isset($this->id)) echo $this->track->title; ?>" size="30" /></td>
            </tr>
            <tr>
                <td><?php echo JText::_('OSM_DATE'); ?>:*</td>
                <td><input id="date" type="text" name="date" value="<?php echo $this->track->date; ?>" size="10" /></td>
            </tr>
            <tr>
                <td><?php echo JText::_('AUTHOR'); ?>:*<br /></td>
                <td><?php echo $this->lists['uid']; ?></td>
            </tr>
            <tr>
                <td><?php echo JText::_('OSM_LEVEL'); ?>* <?php echo JHTML::tooltip(JText::_('OSM_TT_LEVEL')); ?>:
                <td><?php echo $this->level; ?></td>
            </tr>
            <tr>
                <td><?php echo JText::_('OSM_CAT'); ?>:</td>
                <td><?php echo $this->lists['cats']; ?></td>
            </tr>
            <tr>
                <td><?php echo JText::_('OSM_ACCESS_LEVEL'); ?>:</td>
                <td><?php echo $this->lists['access']; ?></td>
            </tr>
            <tr>
                <td><?php echo JText::_('OSM_TERRAIN'); ?>:</td>
                <td><?php echo $this->lists['terrain']; ?></td>
            </tr>
            <tr>
                <td><?php echo JText::_('OSM_DESCRIPTION'); ?>:*</td>
                <td colspan="2"><?php echo $this->editor->display( 'description', $this->track->description , '500', '200', '15', '25', false ) ; ?></td>
            </tr><?php
/*
echo ("	<tr>
		<td>".JText::_('OSM_WPS').":</td>
		<td colspan=\"2\"></td>
	</tr>
	<tr>
		<td>".JText::_('OSM_TRACKS').":</td>
		<td colspan=\"2\"></td>
	</tr>
");
*/
?>            <tr>
                <td valign="top"><?php echo JText::_('OSM_IMAGES'); ?> (max. 10):</td>
                <td colspan="2"><input type="file" name="images[]" class="multi" maxlength="10"><br clear="all"/></td>
            </tr>
            <?php
            if($this->cfg->terms == 1):
            ?>
            <tr>
                <td><?php echo JText::_('OSM_TERMS'); ?></td>
                <td><input id="terms" type="checkbox" name="terms" value="" /><?php echo JText::_('OSM_AGREE'); ?> <a class="modal" href="<?php echo $this->terms; ?>" target="_blank"><?php echo JText::_('OSM_TERMS'); ?></a></td>
            </tr>
            <?php
            endif;
            ?>
        </tbody>
    </table>
    <?php
    echo JHTML::_( 'form.token' ); ?>
    <input type="hidden" name="option" value="com_injooosm" />
    <input type="hidden" name="controller" value="files" />
    <input type="hidden" name="task" value="" />
<?php
if ($this->id)
	echo ("<input type=\"hidden\" name=\"id\" value=\"".$this->id."\" />")
?>
</form>
Return current item: injooosm