After successful installation of K2 Google Maps plugin there are extra fields in Plugins Tab in item edit form:
This text is a step by step manual how to get special Map Tab in item edit form:
administrator/components/com_k2/views/item/view.html.php
Find rows around #293
$K2PluginsItemOther=$dispatcher->trigger('onRenderAdminForm', array (&$item, 'item', 'other' ) ); $this->assignRef('K2PluginsItemOther', $K2PluginsItemOther); $form = new JParameter('', JPATH_COMPONENT.DS.'models'.DS.'item.xml'); $form->loadINI($item->params); $this->assignRef('form', $form);
.. and add 2 lines, so the final code is
$K2PluginsItemOther=$dispatcher->trigger('onRenderAdminForm', array (&$item, 'item', 'other' ) ); $this->assignRef('K2PluginsItemOther', $K2PluginsItemOther); $K2PluginsItemGMap=$dispatcher->trigger('onRenderAdminForm', array (&$item, 'item', 'gmap' ) ); $this->assignRef('K2PluginsItemGMap', $K2PluginsItemGMap); $form = new JParameter('', JPATH_COMPONENT.DS.'models'.DS.'item.xml'); $form->loadINI($item->params); $this->assignRef('form', $form);
administrator/components/com_k2/views/item/tmpl/default.php
Find lines #247-259
<!-- Tabs start here --> <div class="simpleTabs"> <ul class="simpleTabsNavigation"> <li id="tabContent"><a href="#"><?php echo JText::_('Content'); ?></a></li> <li id="tabImage"><a href="#"><?php echo JText::_('Image'); ?></a></li> <li id="tabImageGallery"><a href="#"><?php echo JText::_('Image gallery'); ?></a></li> <li id="tabVideo"><a href="#"><?php echo JText::_('Video'); ?></a></li> <li id="tabExtraFields"><a href="#"><?php echo JText::_('Extra fields'); ?></a></li> <li id="tabAttachments"><a href="#"><?php echo JText::_('Attachments'); ?></a></li> <?php if(count(array_filter($this->K2PluginsItemOther))): ?> <li id="tabPlugins"><a href="#"><?php echo JText::_('Plugins'); ?></a></li> <?php endif; ?> </ul>
.. and add 1 line, so the final code is
<!-- Tabs start here --> <div class="simpleTabs"> <ul class="simpleTabsNavigation"> <li id="tabContent"><a href="#"><?php echo JText::_('Content'); ?></a></li> <li id="tabImage"><a href="#"><?php echo JText::_('Image'); ?></a></li> <li id="tabImageGallery"><a href="#"><?php echo JText::_('Image gallery'); ?></a></li> <li id="tabVideo"><a href="#"><?php echo JText::_('Video'); ?></a></li> <li id="tabExtraFields"><a href="#"><?php echo JText::_('Extra fields'); ?></a></li> <li id="tabAttachments"><a href="#"><?php echo JText::_('Attachments'); ?></a></li> <li id="tabGMap"><a href="#"><?php echo JText::_('Map'); ?></a></li> <?php if(count(array_filter($this->K2PluginsItemOther))): ?> <li id="tabPlugins"><a href="#"><?php echo JText::_('Plugins'); ?></a></li> <?php endif; ?> </ul>
then, in the same file find lines #593-594
<?php if(count(array_filter($this->K2PluginsItemOther))): ?> <!-- Tab other plugins -->
.. and before these add few lines, so the final code is
<!-- Tab gMap -->
<div class="simpleTabsContent">
<div class="itemPlugins">
<?php foreach ($this->K2PluginsItemGMap as $K2Plugin) : ?>
<?php if(!is_null($K2Plugin)): ?>
<fieldset>
<legend><?php echo $K2Plugin->name; ?></legend>
<?php echo $K2Plugin->fields; ?>
</fieldset>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<?php if(count(array_filter($this->K2PluginsItemOther))): ?>
<!-- Tab other plugins -->
administrator/components/com_k2/css/k2.css
Add style to css file, line #235
ul.simpleTabsNavigation li#tabGMap a {background-image: url('/../images/editforms/Map.png');}
and upload an icon for the tab
administrator/components/com_k2/images/editforms/Map.png
In very similiar way you can modify files for category edit form:
Download all modified files in following ZIP package, extract with complete directory structure and after back-up of original files, upload to your server.
K2 version 2.3!, also changed files with special Tab in category edit form included.
Version: 1.0
The plugin adds some additional fields in K2 backend for item, category and user.
In K2 frontend it display Google Map with selected marker on position of respective item, etc.
Appearence of the Google Map highly customizable by plugin parameters.
Zoom/Pan Controls = None
Google Maps Type Buttons = No
Map Type on Start = Normal
Show Overview Map = No
Zoom/Pan Controls = Small Maps Control
Google Maps Type Buttons = No
Map Type on Start = Satellite
Show Overview Map = Yes
Zoom/Pan Controls = Large Maps Control
Google Maps Type Buttons = Yes
Map Type on Start = Terrain
Show Overview Map = No
Do you like my plugin?
Did I save your time and effort?
Please donate for further work.