AbanteCart Community

Shopping Cart Operations => Support => General Support => Topic started by: bioenergy on September 12, 2013, 03:33:20 AM

Title: Adding New Menu Item in the admin
Post by: bioenergy on September 12, 2013, 03:33:20 AM
add in own support system link at " admin panel Help"
(http://www.ecomdiy.com/images/s-1.jpg)
Where is the code should i edit??
Title: Re: add in own support system link at " admin panel Help"
Post by: abantecart on September 12, 2013, 09:21:53 AM
Menu items are store in the data set tables. These are flexible framework to store data.
http://www.abantecart.com/document_wiki/index.php/Developing_Extensions_and_Extension_API#Database_extension

The best way to do this with creation of extension and use of Developer Tools https://github.com/abantecart/developer_tools_extension

There are 2 ways to add admin menu item:

1. PHP API functions (easier)
Make sure you put this code in controller of admin section for one time run.


$menu = new AMenu ( "admin" );
$menu->insertMenuItem ( array (  "item_id" => "unique_name",
"parent_id"=>"sale",
"item_text" => "text_unique_name",
"item_url" => "extension/unique_name",
"item_type"=>"core",
"sort_order"=>"6")
);

$data = array('language_id' => 0,
'section' => 1,
'block' => 'common/header',
'language_key' => 'text_unique_name',
'language_value' => 'Menu Name');

$this->loader->model('localisation/language_definitions');
$model = $this->registry->get('model_localisation_language_definitions');
$model->addLanguageDefinition();



NOTE:
item_text - This is text entry that need to be present in language. Can be added to XML, but will not be automatically loaded is site is already live

item_url - This can be rt (route) or full URL for external links. 

2. Direct database insert ( more advanced )
Here you need to add new unique dataset_column_id and row_id


--
--SUBMENU CATEGORY
--ITEM_ID
INSERT INTO `ac_dataset_values` (`dataset_column_id`, `value_varchar`,`row_id`)
VALUES  (7,'unique_name',11),

--ITEM_TEXT
INSERT INTO `ac_dataset_values` (`dataset_column_id`, `value_varchar`,`row_id`)
VALUES  (8,'text_unique_name',11),

--ITEM_URL
INSERT INTO `ac_dataset_values` (`dataset_column_id`, `value_varchar`,`row_id`)
VALUES  (9,'[rt or URL]',11),

--PARENT_ID
INSERT INTO `ac_dataset_values` (`dataset_column_id`, `value_varchar`,`row_id`)
VALUES  (10,'unique_name',11),

--SORT_ORDER
INSERT INTO `ac_dataset_values` (`dataset_column_id`, `value_integer`,`row_id`)
VALUES  (11,1,11),

--ITEM_TYPE
INSERT INTO `ac_dataset_values` (`dataset_column_id`, `value_varchar`,`row_id`)
VALUES  (12,'core',11),



Main/parent tabs text IDs:
catalog
sale
design
extension
system
reports
help



Title: Re: add in own support system link at " admin panel Help"
Post by: bioenergy on September 12, 2013, 01:14:35 PM
Can I Change the Support forum to My Support Site is easy..
at Phpmyadmin i din find any ac-datasets.. all is ab-datasets