一)Adding new fields to Admin User Info in magento
二)在Magento
增加新的領域管理員用戶信息
您需要在admin_user表中添加一列。做一個表與下面的代碼:
<?php
$installer->getConnection()->addColumn($installer->getTable('admin/user'),
'location', array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 256,
'nullable' => true,
'default' => null
));
?>
然後,如果你想從你需要 重寫方法Mage_Adminhtml_Block_System_Account_Edit_Form :: _ prepareForm,並在那裏加入新 元素後端添加/編輯這個字段:
<?php
$fieldset->addField('location', 'select', array(
'name' => 'location',
'label' => Mage::helper('adminhtml')->__('Location'),
'id' => 'location',
'title' => Mage::helper('adminhtml')->__('Location'),
'class' => 'input-select',
'style' => 'width: 80px',
'options' => array('1' =>
Mage::helper('adminhtml')->__('Russia'), '0' =>
Mage::helper('adminhtml')->__('India')),
));
?>
清除緩存並運行代碼。您可以將新字段添加到Magento中的管理用戶信息中。