Author Topic: Adding New Menu Item in the admin  (Read 7641 times)

Offline bioenergy

  • Newbie
  • *
  • Posts: 19
  • Karma: +2/-2
    • View Profile
Adding New Menu Item in the admin
« on: September 12, 2013, 03:33:20 AM »
add in own support system link at " admin panel Help"

Where is the code should i edit??
« Last Edit: September 12, 2013, 07:52:23 PM by abantecart »

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4251
  • Karma: +278/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: add in own support system link at " admin panel Help"
« Reply #1 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.

Code: [Select]
$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

Code: [Select]
--
--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



« Last Edit: September 12, 2013, 09:23:57 AM by abantecart »
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline bioenergy

  • Newbie
  • *
  • Posts: 19
  • Karma: +2/-2
    • View Profile
Re: add in own support system link at " admin panel Help"
« Reply #2 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

 

Powered by SMFPacks Social Login Mod