system.xmlファイルを使用して、このftpパスをデータベースのバックエンドの編集可能なフィールドに保存できないのはなぜですか?
次に、各バックエンドでこれを変更して、ローカル/開発/ライブバージョンにする必要があります。
モジュールのetcディレクトリにsystem.xmlファイルを作成し、これを配置します。
<?xml version="1.0"?>
<config>
<sections>
<ftppath translate="label" module="yourmodule">
<label>Manage </label>
<tab>general</tab>
<sort_order>50</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<groups>
<general translate="label">
<label>General</label>
<frontend_type>text</frontend_type>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<path translate="label">
<label>Path to FTP Server</label>
<frontend_type>text</frontend_type>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</path>
</fields>
</general>
</groups>
</ftppath>
</sections>
この値を取得するには、Mage :: getStoreConfig('ftppath / general / path');を実行します。
このセクションを特定のユーザーグループの管理者だけが表示できるようにする必要がある場合は、adminhtml.xmlファイルにaclを作成します(モジュールのetcディレクトリにあります)。
<?xml version="1.0" encoding="UTF-8"?>
<config>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<ftppath translate="title" module="yourmodule">
<title>Manage FTP</title>
<sort_order>50</sort_order>
</ftppath>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
PS:以前はapp / etc / local.xmlファイルでそのようなものを機能させていましたが、1.7以降は機能しなくなりました:(