Luyenkim.Net!

...where your idea grows!

 
  • Decrease font size
  • Default font size
  • Increase font size
Trang chủ arrow Công nghệ thông tin arrow Kinh nghiệm-thủ thuật arrow Overview of Components - Sơ lược về Com
Overview of Components - Sơ lược về Com PDF Print E-mail
(0 votes)
Thứ sáu, 23 Tháng một 2007
Article Index
Overview of Components - Sơ lược về Com
Page 2
Page 3
Page 4
Page 5
Page 6
Page 7
Page 8

Developing the Administrator Component

From Mambo Manual

We need to develop a component in the Administrator in order for your Client to maintain who should be shown on the in/out board. We also need to plug into the Categories feature to enable us to provide different groups of users for different in/out boards.

So, where do we start?

[edit]

Adding Menu Items

Most components will have some sort of administration function. This is placed under the menu item called 'Components' on the menu bar. All these items are generated dynamically from the database. When you finally deploy your component, it will be delivered in a zipped file with an xml definition file telling the Component Installer what files to copy where, what tables to create and what menu items to provide. Well, it's a bit premature to do that during the development stage so we'll have to add the menu items by hand.

We need to add a few rows to the mos_components table. Have a look at this table. It has the following fields:

Table 5−1. mos_components Table Structure

id the primary key for each record in the table
name the proper−case name of the component
link this is the link for the front−end (eg, option=com_inout)
menuid has the component been attached to a main menu item
parent this is the parent menu item in the components dropdown menu
admin_menu_link the link for the menu item in the administrator
admin_menu_alt the alt text for the graphic in the menu
admin_menu_image the image associated with the menu text (that is, the name)
option the component option, that is, the name of the component directory (eg, com_inout)
ordering the order the component apears in the menu
iscore true if this is a core component of Mambo
comdir
admindir

So, let's create a menu item called 'In/Out Board' and a fly−out menu with two item: 'Manages Users' and 'In/Out Categories'. The SQL to do this is:

INSERT INTO `mos_components`VALUES(500, 'In/Out Board', '', 0, 0, '',
'In/Out Board Management', 'com_inout', 0,'js/ThemeOffice/module.png', 0, '', '');
INSERT INTO `mos_components`VALUES(501, 'Manage Users', '', 0, 500, 'option=com_inout',
'User Management','com_inout', 1, 'js/ThemeOffice/module.png', 0, '', '');
INSERT INTO `mos_components`VALUES(502, 'In/Out Categories', '', 0, 500,
'option=categories&section=com_inout','In/Out Categories', 'com_inout', 2,
'js/ThemeOffice/module.png', 0, '', '');

Execute these three lines of code in your database client. Refresh the Mambo Administrator and you should see the new entries in the menu.




Related news items:
Newer news items:
Older news items:

 

Please install Flash and turn on Javascript.

Đăng nhập






Lost Password?
No account yet? Register

Liên kết website

joomlaviet.org
buaxua.vn
Luyenkim.net
thietbidien.vn
onbai.com
Sửa ĐTDD

Thống kê

We have 13 guests online