Add new item to admin sidebar
Hi, I want to add a custom items to the admin sidebar. I realized that the sidebar view is nav.php in /modules/fuel/views/_blocks. Also I saw that in modules/fuel/config/fuel_modules.php are some links of that sidebar.
My question is what is the correct configuration or the correct form to add an item to the admin sidebar?
Comments
$config['nav']['site']['my_module'] = 'My Module';
This will be inserted under the SITE heading.
For more control, you can set the 'nav_auto_arrange' property to FALSE:
// will auto arrange the navigation into the normal order $config['nav_auto_arrange'] = FALSE;
Then you could simply create your own navigation array:
$config['nav'] = array(); $config['nav']['mysite'] = array( 'mysite/item1' => 'Item 1', 'mysite/item2' => 'Item 2', 'mysite/item3' => 'Item 3', );
i want to ask something how can i hide the related item window,i am using the location module and have done many customization in it ,i have a map on admin site which i showed when admin enters any address or location that map automatically pointing to that location and i have put the code in admin_main in modules/fuel/views/_layout/admin_main but the problem i am facing i have some other form doing different work and that map as well appears and i want to hide it ...i have looked for related_items but no success!
please guide me thanks
<?php
// set some render variables based on what is in the panels array
$no_menu = (!$this->fuel->admin->has_panel('nav')) ? TRUE : FALSE;
$no_titlebar = (!$this->fuel->admin->has_panel('titlebar')) ? TRUE : FALSE;
$no_actions = (!$this->fuel->admin->has_panel('actions') OR empty($actions)) ? TRUE : FALSE;
$no_notification = (!$this->fuel->admin->has_panel('notification')) ? TRUE : FALSE;
?>
<?php $this->load->module_view(FUEL_FOLDER, '_blocks/fuel_header'); ?>
function codeAddress() {
g'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
//Latitude = results[0].geometry.location.lat();
//Longitude = results[0].geometry.location.lng();
var Latitude = results[0].geometry.location.lat();
var Longitude = results[0].geometry.location.lng();
var latlngPos = new google.maps.LatLng(latitude, longitude);
$('#longitude').val(Longitude);
$('#latitude').val(Latitude);
//map show code goes here. . .
//alert();
var mapCanvas = document.getElementById('map');
var mapOptions = {
center: new google.maps.LatLng(Latitude,Longitude),
zoom: 14,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(mapCanvas, mapOptions);
}
function pakmap() {
var latlngPos = new google.maps.LatLng(30.032776, 70.640759);
var myOptions = {
google.maps.event.addDomListener(window, 'load', initialize);
<?php if ($this->fuel->admin->has_panel('top')) : ?>
<?php $this->load->module_view(FUEL_FOLDER, '_blocks/fuel_top'); ?>
<?php endif; ?>
<?php if ($this->fuel->admin->has_panel('nav')) : ?>
<?php $this->load->module_view(FUEL_FOLDER, '_blocks/nav'); ?>
<?php endif; ?>
<?php if ($this->fuel->admin->has_panel('titlebar')) : ?>
<?php $this->load->module_view(FUEL_FOLDER, '_blocks/titlebar')?>
<?php endif; ?>
<?=$this->form->open('action="'.$form_action.'" method="'.((!empty($form_method)) ? $form_method : 'post').'" id="form" enctype="multipart/form-data"')?>
<?php if ($this->fuel->admin->has_panel('actions') AND !empty($actions)) : ?>
<?php /* ?><?=$this->form->open('action="'.$form_action.'" method="post" id="form_actions" enctype="multipart/form-data"')?><?php */ ?>
<?php if (!empty($actions)) : ?>
<?=$actions?>
<?php endif; ?>
<?php /* ?><?=$this->form->close()?><?php */ ?>
<?php endif; ?>
<?php if ($this->fuel->admin->has_panel('notification')) : ?>
<?php if (!empty($notifications)) : ?>
<?=$notifications?>
<?php endif; ?>
<?php if (!empty($pagination)): ?>
<?php endif; ?>
<?php endif; ?>
<?php
$main_content_class = '';
if($no_actions AND $no_notification) :
$main_content_class = 'noactions_nonotification';
elseif($no_actions AND $no_titlebar) :
$main_content_class = 'noactions_notitlebar';
elseif ($no_titlebar) :
$main_content_class = 'notitlebar';
elseif ($no_actions) :
$main_content_class = 'noactions';
endif;
?>
<?php /* ?><?=$this->form->open('action="'.$form_action.'" method="post" id="form" enctype="multipart/form-data"')?><?php */ ?>
<?=$body?>
<?=$this->form->hidden('fuel_inline', (int)$this->fuel->admin->is_inline())?>
<?=$this->form->close()?>
<?php $this->load->module_view(FUEL_FOLDER, '_blocks/fuel_footer'); ?>
all things are working properly only the map div appears on different section of admin on right side not every where but like in category create etc
$module_overwrites['locations_points']['model_location'] = 'app'; $module_overwrites['locations_points']['mode_name'] = 'my_locations_model';
Then your my_locations_model.php file could look like the following:
require_once(FUEL_PATH.'models/base_module_model.php'); class Locations_model extends Base_module_model { function related_items($values = array()) { return ''; } }