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:
First file mod
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);
Second file
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 -->
Third file - CSS
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
Category edit form
In very similiar way you can modify files for category edit form:
Download
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.