Skip to content

Instantly share code, notes, and snippets.

@cscartjp
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cscartjp/e2b6d1a7bd57f22946a3 to your computer and use it in GitHub Desktop.
Save cscartjp/e2b6d1a7bd57f22946a3 to your computer and use it in GitHub Desktop.
addon scheme3.0 fully commented example of an addon.xml.
<?xml version="1.0"?>
<!--
アドオンスキーム3.0バーションの概要
オプション以外のパタメーターは必須項目となります。
@edition_type ーすべての設定関連の要素で使用可能なオプション属性
利用可能なエディションを複数定義することが出来ます。
このTYPEが設定されていない場合、値はROOTとなります。
-->
<addon scheme="3.0" edition_type="ROOT,ULT:VENDOR">
<!-- アドオン識別子。アドオンのファイルのディレクトリ名と同じである必要がります。-->
<id>sample_addon_3_0</id>
<!-- アドオンのバーション -->
<version>1.0</version>
<!-- アドオンのデフォルト言語。このオプションのパラメーターが指定されてない場合、言語は英語(EN)として認識されます。-->
<default_language>en</default_language>
<!-- アドオンの優先順位。優先順位が高いほど、アドオンは後で実行されます。-->
<priority>100</priority>
<!-- アドオンのインストール後の状態を設定します(有効/無効);デフォルトでは【無効】です。 -->
<status>active</status>
<!-- アドオン作成者の問い合わせ先情報 -->
<!-- (authorsは、全てのフィールドがオプションです。 -->
<authors>
<author>
<name>CS-Cart</name>
<email>contact@cs-cart.com</email>
<url>http://cs-cart.com</url>
<phone>+1 999 1234 5678</phone>
</author>
</authors>
<!-- 他のアドオンとの互換性やシステムの環境設定についてのブロック -->
<compatibility>
<!-- 依存するアドオン。ここにリストされるアドオンはこのアドオンをインストールする際に必須となりインストールされていない場合は、自動でインストールされます。他のアドオンをインストール出来ない場合は、エラーメッセージが表示されます。-->
<dependencies>discussion,form_builder</dependencies>
<!-- コンフリクト。これらのアドオンはこのアドオンがインストールされる前に自動的に無効になり通知が表示されます -->
<conflicts>catalog_mode,reward_points</conflicts>
<!-- インストール可能なCS-Cartの最小/最大バージョン。(このパラメーターはオプションです)-->
<core_version>
<min>4.0.3</min>
</core_version>
<!-- CS-Cartのエディション;通常版/マーケットプレイス版(MULTIVENDOR) -->
<core_edition>
ULTIMATE,MULTIVENDOR
</core_edition>
<!-- 対応するPHPのバーション範囲。(このパラメーターはオプションです)-->
<php_version>
<min>5.3.0</min>
<max>5.5.0</max>
</php_version>
<!-- PHP Extentionの確認 -->
<php_extensions>
<!-- 拡張機能をチェック。インストールする必要がある;Y。インストールの必要がない;N -->
<calendar>
<supported>Y</supported>
</calendar>
<!-- Extension ID(phpinfo)と必要なバージョン-->
<json>
<min>1.1.0</min>
<max>1.2.2</max>
</json>
</php_extensions>
</compatibility>
<!-- 予備のフィールド -->
<license></license>
<!--Prepend or append the common tab list with add-on tabs (default defained as append)
アドオンタブをもつ共通のタブリストをプリテンドまたは追加する(デフォルトでは追加)
-->
<tab_order>prepend</tab_order>
<!-- Add-on settings block. Optional.
@layout - Defines where the settings page will be opened (popup/separate). Optional attribute; "popup" by default
アドオン設定ブロック
@layoutーどの設定ページ(ポップアップ/セパレート)を開くのか定義する。オプションの属性;デフォルトでは【ポップアップ】
-->
<settings layout="separate" edition_type="ROOT,ULT:VENDOR">
<!-- List of tabs on the add-on settings page
アドオン設定ページのタブのリスト
-->
<sections>
<!-- Tab for settings.
@id - text identifier. This setting can be accessed later on through Registry::get('addons.[addon_id].[setting_id]')
@edition_type - list of editions in which the tab will be available. Optional
設定用タブ
@idーテキスト識別子。この設定はレジストリを通じて、後で接アクセスできるようになります。
@edition_typeーエディションのリストでタブが利用可能になります。オプション
-->
<section id="section1">
<!-- List of settings in the tab
タブの設定の一覧
-->
<items>
<!-- Add-on settings
@id - setting identifier.
@edition_type - list of editions in which the setting will be available.
アドオン設定
@id - セッティング識別子
@edition_type - エディションのリストでタブが利用可能になります
-->
<item id="header">
<!-- Element type:
input, textarea, password, checkbox, selectbox, multiple select,
multiple checkboxes, countries list, states list,
file, info, header, template
エレメントタイプ
入力, テキストエリア, パスワード, チェックボックス, セレクトボックス, 複数セレクト,
複数チェックボックスリスト, 国リスト, ステータスリスト,
ファイル, 情報, ヘッダー, テンプレート
-->
<type>header</type>
<!-- Setting name in the default language
デフォルト言語での設定名
-->
<name>Header</name>
</item>
<item id="input">
<type>input</type>
</item>
<item id="password">
<type>password</type>
</item>
<item id="checkbox">
<type>checkbox</type>
</item>
<item id="textarea">
<type>textarea</type>
<!-- Default value; must be option id for lists (items with options like selectbox, multiple select etc.
デフォルト値;リストのオプションID(セレクトボックスや複数セレクトのようなオプションをもつアイテム)
-->
<default_value>Sample textarea text</default_value>
</item>
<item id="radiogroup">
<type>radiogroup</type>
<default_value>radio_2</default_value>
<!-- Options - for types selectbox, multiple select,
multiple checkboxes, combo select
Options - セレクトボックス、複数セレクト、複数チェックボックス、コンボセレクトのタイプ
-->
<variants>
<!-- @id - option identifier
@id - オプション識別子
-->
<item id="radio_1"></item>
<item id="radio_2"></item>
</variants>
</item>
<item id="file">
<type>file</type>
</item>
</items>
</section>
<section id="section2">
<translations>
<item lang="ru">Списки</item>
</translations>
<items>
<item id="selectbox">
<type>selectbox</type>
<variants>
<item id="select_box_1"></item>
<item id="select_box_2"></item>
</variants>
</item>
<item id="countries_list">
<type>countries list</type>
</item>
<item id="states_list">
<type>states list</type>
</item>
<item id="multiple_select">
<type>multiple select</type>
<variants>
<item id="select_box_1"></item>
<item id="select_box_2"></item>
<item id="select_box_3"></item>
</variants>
</item>
<item id="multiple_checkboxes">
<type>multiple checkboxes</type>
<variants>
<item id="select_box_1"></item>
<item id="select_box_2"></item>
<item id="select_box_3"></item>
</variants>
<default_value>select_box_2</default_value>
</item>
</items>
</section>
<section id="section3">
<items>
<item id="selectable_box">
<!-- The current setting options will be taken from the function fn_settings_variants_addons_[addon_id]_[setting_id]
現在の設定イプションは関数fn_settings_variants_addons_[addon_id]_[setting_id]から取得されます
-->
<type>selectable_box</type>
<default_value><![CDATA[#M#product_code=Y&product=Y&amount=Y&price=Y]]></default_value>
</item>
<!-- In this case the information returned by the function "handler" will be displayed
この場合、関数"handler"によって返された情報が表示されます
-->
<item id="info">
<type>info</type>
<handler>fn_sample_addon_3_0_info</handler>
</item>
<!-- Setting appearance; type "template". In this case a user-defined template from the folder themes/THEME_NAME/addons/ADDON_NAME/settings/TEMPLATE_NAME is loaded.
The template name is stored in the "default_value"
Setting appearance;タイプは【テンプレート】
この場合、themes/THEME_NAME/addons/ADDON_NAME/settings/TEMPLATE_NAMEフォルダからのユーザー定義のテンプレートが読み込まれます
このテンプレート名は"default_value"にあります-->
<item id="template">
<type>template</type>
<default_value>sample.tpl</default_value>
</item>
<!-- A hidden setting. Exists in the database and in the Registry but is not shown to the user
非表示設定。データベースやレジストリには存在するがユーザーには表示されない
-->
<item id="hidden">
<type>hidden</type>
<default_value>Some hidden setting value</default_value>
</item>
</items>
</section>
</sections>
</settings>
<!-- Additional database queries
追加のデータベースクエリ
-->
<queries>
<!-- If parameter "for" equals "install" or is not set, the query is executed during the add-on installation
パラメーター"for"が"install"と等しい、または設定されていない場合、クエリはアドオンインストール中に実行されます
-->
<item for="install">
CREATE TABLE `?:addon_test_123456789` (
`queue_id` mediumint NOT NULL auto_increment,
PRIMARY KEY (`queue_id`)
) ENGINE=MyISAM DEFAULT CHARSET=UTF8
</item>
<!-- If the "editions" attribute is given, the request will be executed only for the editions that are defined in it (separated with commas)
"editions"が指定されている場合、リクエストはそこに定義されているエディションのためにのみ実行されます(カンマで区切られます)
-->
<item for="install" editions="ULTIMATE,MULTIVENDOR">
ALTER TABLE `?:addon_test_123456789` ADD company_id INT NOT NULL DEFAULT 0;
</item>
<!-- If the parameter "for" equals "uninstall", the query is executed during the add-on uninstallation
パラメーター"for"が"uninstall"と等しい場合、クエリはアドオンのインストール中に実行されます
-->
<item for="uninstall">DROP TABLE IF EXISTS `?:addon_test_123456789`</item>
</queries>
<!-- User-defined functions called on certain events:
before_install - before the add-on installation
install - after the installation of the add-on, its templates, settings and language variables but before its activation and cache clearing
uninstall - before uninstallation
イベントでよびだされるユーザー定義の関数;
before_install - アドオンインストールの前
install - アドオン、そのテンプレート、設定や言語変数のインストール後??
uninstall - アンインストールの前
-->
<functions>
<item for="install">fn_google_export_add_features</item>
<item for="install">fn_google_export_add_feed</item>
<item for="uninstall">fn_google_export_remove_features</item>
<item for="uninstall">fn_google_export_remove_feed</item>
</functions>
</addon>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment