Un petit article rapide d’aide mémoire pour la gestion des fichiers system.xml dans magento 1 .
Ces fichiers peuvent utiliser souvent les éléments suivants :

 Source Model

Il doivent être utilisés pour des champs de types « select » ou « multiselect »

Ex :

<demo_field_source translate="label">
    <label>Demo Field source model</label>
    <frontend_type>select</frontend_type>
    <!-- Définition de la source -->
    <source_model>adminhtml/system_config_source_yesno</source_model>
    <!-- Fin Définition de la source -->
    <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>
</demo_field_source>

Les plus utiles à retenir sont les suivants :

  • adminhtml/system_config_source_yesno ( Oui / Non )
  • adminhtml/system_config_source_country (Liste des pays )
  • adminhtml/system_config_source_cms_page ( Liste des pages cms )
  • adminhtml/system_config_source_email_template ( Listes des emails transactionnels )

Liste complète :

adminhtml/system_config_source_yesno
adminhtml/system_config_source_admin_page
adminhtml/system_config_source_catalog_gridPerPage
adminhtml/system_config_source_catalog_listMode
adminhtml/system_config_source_catalog_listPerPage
adminhtml/system_config_source_catalog_listSort
adminhtml/system_config_source_catalog_search_type
adminhtml/system_config_source_catalog_timeFormat
adminhtml/system_config_source_checktype
adminhtml/system_config_source_cms_page
adminhtml/system_config_source_cms_wysiwyg_enabled
adminhtml/system_config_source_country
adminhtml/system_config_source_cron_frequency
adminhtml/system_config_source_currency
adminhtml/system_config_source_currency_service
adminhtml/system_config_source_customer_address_type
adminhtml/system_config_source_customer_forgotpassword
adminhtml/system_config_source_customer_group
adminhtml/system_config_source_design_robots
adminhtml/system_config_source_email_identity
adminhtml/system_config_source_email_method
adminhtml/system_config_source_email_smtpauth
adminhtml/system_config_source_email_template
adminhtml/system_config_source_enabledisable
adminhtml/system_config_source_frequency
adminhtml/system_config_source_locale
adminhtml/system_config_source_locale_currency_all
adminhtml/system_config_source_locale_timezone
adminhtml/system_config_source_locale_weekdaycodes
adminhtml/system_config_source_locale_weekdaycodes
adminhtml/system_config_source_locale_weekdays
adminhtml/system_config_source_nooptreq
adminhtml/system_config_source_notification_frequency
adminhtml/system_config_source_order_status_new
adminhtml/system_config_source_order_status_newprocessing
adminhtml/system_config_source_order_status_processing
adminhtml/system_config_source_payment_allspecificcountries
adminhtml/system_config_source_payment_cctype
adminhtml/system_config_source_price_scope
adminhtml/system_config_source_price_step
adminhtml/system_config_source_product_thumbnail
adminhtml/system_config_source_reports_scope
adminhtml/system_config_source_security_domainpolicy
adminhtml/system_config_source_shipping_allspecificcountries
adminhtml/system_config_source_shipping_flatrate
adminhtml/system_config_source_shipping_tablerate
adminhtml/system_config_source_shipping_taxclass
adminhtml/system_config_source_storage_media_database
adminhtml/system_config_source_storage_media_storage
adminhtml/system_config_source_store
adminhtml/system_config_source_tax_apply_on
adminhtml/system_config_source_tax_basedon
adminhtml/system_config_source_watermark_position
adminhtml/system_config_source_web_redirect
adminhtml/system_config_source_yesno
adminhtml/system_config_source_yesnocustom
backup/config_source_type
captcha/config_font
captcha/config_form_backend
captcha/config_form_frontend
captcha/config_mode
catalog/product_attribute_source_msrp_type
cataloginventory/source_backorders
checkout/config_source_cart_summary
configurableswatches/system_config_source_catalog_product_configattribute
configurableswatches/system_config_source_catalog_product_configattribute_select
customer/config_share
downloadable/system_config_source_contentdisposition
downloadable/system_config_source_orderitemstatus
googleanalytics/system_config_source_type
googlebase/source_accounttype
googlebase/source_country
log/adminhtml_system_config_source_loglevel
pagecache/system_config_source_controls
paygate/authorizenet_source_cctype
paygate/authorizenet_source_cctype
paygate/authorizenet_source_paymentAction
payment/source_invoice
paypal/config::getApiAuthenticationMethods
paypal/config::getExpressCheckoutBASignupOptions
paypal/config::getExpressCheckoutButtonFlavors
paypal/config::getExpressCheckoutSolutionTypes
paypal/config::getPayflowproCcTypesAsOptionArray
paypal/config::getWppCcTypesAsOptionArray
paypal/config::getWppPeCcTypesAsOptionArray
paypal/system_config_source_bmlPosition::getBmlPositionsCCP
paypal/system_config_source_bmlPosition::getBmlPositionsCheckout
paypal/system_config_source_bmlPosition::getBmlPositionsCPP
paypal/system_config_source_bmlPosition::getBmlPositionsHP
paypal/system_config_source_bmlSize::getBmlSizeCCPC
paypal/system_config_source_bmlSize::getBmlSizeCCPS
paypal/system_config_source_bmlSize::getBmlSizeCheckoutC
paypal/system_config_source_bmlSize::getBmlSizeCheckoutN
paypal/system_config_source_bmlSize::getBmlSizeCPPC
paypal/system_config_source_bmlSize::getBmlSizeCPPN
paypal/system_config_source_bmlSize::getBmlSizeHPH
paypal/system_config_source_bmlSize::getBmlSizeHPS
paypal/system_config_source_buyerCountry
paypal/system_config_source_fetchingSchedule
paypal/system_config_source_logo
paypal/system_config_source_merchantCountry
paypal/system_config_source_paymentActions
paypal/system_config_source_paymentActions_express
paypal/system_config_source_requireBillingAddress
paypal/system_config_source_urlMethod
paypal/system_config_source_yesnoShortcut
salesrule/system_config_source_coupon_format
shipping/source_handlingAction
shipping/source_handlingType
tax/system_config_source_algorithm
tax/system_config_source_apply
tax/system_config_source_priceType
tax/system_config_source_tax_country
tax/system_config_source_tax_display_type
tax/system_config_source_tax_region
usa/shipping_carrier_abstract_source_mode
usa/shipping_carrier_abstract_source_requesttype
usa/shipping_carrier_dhl_international_source_contenttype
usa/shipping_carrier_dhl_international_source_method_doc
usa/shipping_carrier_dhl_international_source_method_freedoc
usa/shipping_carrier_dhl_international_source_method_freenondoc
usa/shipping_carrier_dhl_international_source_method_nondoc
usa/shipping_carrier_dhl_international_source_method_size
usa/shipping_carrier_dhl_international_source_method_unitofmeasure
usa/shipping_carrier_dhl_source_dutypaymenttype
usa/shipping_carrier_dhl_source_freemethod
usa/shipping_carrier_dhl_source_method
usa/shipping_carrier_dhl_source_protection_rounding
usa/shipping_carrier_dhl_source_protection_value
usa/shipping_carrier_dhl_source_shipmenttype
usa/shipping_carrier_fedex_source_dropoff
usa/shipping_carrier_fedex_source_freemethod
usa/shipping_carrier_fedex_source_method
usa/shipping_carrier_fedex_source_packaging
usa/shipping_carrier_fedex_source_unitofmeasure
usa/shipping_carrier_ups_source_container
usa/shipping_carrier_ups_source_destType
usa/shipping_carrier_ups_source_freemethod
usa/shipping_carrier_ups_source_method
usa/shipping_carrier_ups_source_originShipment
usa/shipping_carrier_ups_source_pickup
usa/shipping_carrier_ups_source_type
usa/shipping_carrier_ups_source_unitofmeasure
usa/shipping_carrier_usps_source_container
usa/shipping_carrier_usps_source_freemethod
usa/shipping_carrier_usps_source_machinable
usa/shipping_carrier_usps_source_method
usa/shipping_carrier_usps_source_size
weee/config_source_display
weee/config_source_fpt_tax
wishlist/config_source_summary

 

 Frontend Model :

Le frontend model est un block de template magento  et  qui permets de gérer un affichage particulier pour l’élément de configuration.
Voici 3 exemples possibles :

<demo_field_frontend_model1>
    <label>Demo Field frontend model heading</label>
    <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
    <sort_order>6</sort_order>
    <show_in_default>1</show_in_default>
    <show_in_website>1</show_in_website>
    <show_in_store>1</show_in_store>
</demo_field_frontend_model1>
<demo_field_frontend_model2>
    <label>Demo Field frontend model 2</label>
    <type>text</type>
    <frontend_model>adminhtml/catalog_form_renderer_config_yearRange</frontend_model>
    <sort_order>7</sort_order>
    <show_in_default>1</show_in_default>
    <show_in_website>1</show_in_website>
    <show_in_store>1</show_in_store>
</demo_field_frontend_model2>
<demo_field_frontend_model3>
    <label>Demo Field frontend model 3</label>
    <type>text</type>
    <frontend_model>adminhtml/system_config_form_field_regexceptions</frontend_model>
    <sort_order>8</sort_order>
    <show_in_default>1</show_in_default>
    <show_in_website>1</show_in_website>
    <show_in_store>1</show_in_store>
</demo_field_frontend_model3>

Et le rendu associé à ce code

Frontend model

Liste complète :

adminhtml/system_config_form_field_notification
adminhtml/catalog_form_renderer_config_dateFieldsOrder
adminhtml/catalog_form_renderer_config_yearRange
adminhtml/customer_system_config_validatevat
adminhtml/report_config_form_field_mtdStart
adminhtml/report_config_form_field_ytdStart
adminhtml/system_config_form_field_heading
adminhtml/system_config_form_field_regexceptions
adminhtml/system_config_form_field_select_flatcatalog
adminhtml/system_config_form_field_select_flatproduct
adminhtml/system_config_form_fieldset_modules_disableOutput
adminhtml/system_config_system_storage_media_synchronize
cataloginventory/adminhtml_form_field_minsaleqty
directory/adminhtml_frontend_currency_base
paypal/adminhtml_system_config_apiWizard
paypal/adminhtml_system_config_bmlApiWizard
paypal/adminhtml_system_config_field_country
paypal/adminhtml_system_config_field_hidden
paypal/adminhtml_system_config_field_solutionType
paypal/adminhtml_system_config_fieldset_deprecated
paypal/adminhtml_system_config_fieldset_expanded
paypal/adminhtml_system_config_fieldset_group
paypal/adminhtml_system_config_fieldset_hint
paypal/adminhtml_system_config_fieldset_location
paypal/adminhtml_system_config_fieldset_pathDependent
paypal/adminhtml_system_config_fieldset_payment
paypal/adminhtml_system_config_payflowlink_advanced
paypal/adminhtml_system_config_payflowlink_info
tax/adminhtml_frontend_region_updater
usa/adminhtml_dhl_unitofmeasure

 Backend Model :

Ces modèles permettent de traiter la donnée de configuration pour gérer  son affichage ou son enregistrement en base de données.
( Ajouter des vérifications suplémentaires, sérialiser/désérializer des données , encoder un mot de passe … )

Visuellement cela n’a pas d’incidence, voici un exemple d’utilisation :

<base_url translate="label">
    <label>Base URL</label>
    <frontend_type>text</frontend_type>
    <backend_model>adminhtml/system_config_backend_baseurl</backend_model>
    <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>
</base_url>

Liste complète :

adminhtml/system_config_backend_admin_custom
adminhtml/system_config_backend_admin_custompath
adminhtml/system_config_backend_admin_password_link_expirationperiod
adminhtml/system_config_backend_admin_usecustom
adminhtml/system_config_backend_admin_usecustompath
adminhtml/system_config_backend_admin_usesecretkey
adminhtml/system_config_backend_baseurl
adminhtml/system_config_backend_catalog_inventory_managestock
adminhtml/system_config_backend_catalog_search_type
adminhtml/system_config_backend_cookie
adminhtml/system_config_backend_currency_allow
adminhtml/system_config_backend_currency_base
adminhtml/system_config_backend_currency_cron
adminhtml/system_config_backend_currency_default
adminhtml/system_config_backend_customer_address_street
adminhtml/system_config_backend_customer_password_link_expirationperiod
adminhtml/system_config_backend_customer_show_address
adminhtml/system_config_backend_customer_show_customer
adminhtml/system_config_backend_datashare
adminhtml/system_config_backend_datashare
adminhtml/system_config_backend_design_exception
adminhtml/system_config_backend_design_package
adminhtml/system_config_backend_email_address
adminhtml/system_config_backend_email_logo
adminhtml/system_config_backend_email_sender
adminhtml/system_config_backend_encrypted
adminhtml/system_config_backend_filename
adminhtml/system_config_backend_image
adminhtml/system_config_backend_image_favicon
adminhtml/system_config_backend_image_pdf
adminhtml/system_config_backend_layer_children
adminhtml/system_config_backend_locale
adminhtml/system_config_backend_locale_timezone
adminhtml/system_config_backend_log_cron
adminhtml/system_config_backend_price_scope
adminhtml/system_config_backend_product_alert_cron
adminhtml/system_config_backend_secure
adminhtml/system_config_backend_seo_product
adminhtml/system_config_backend_shipping_tablerate
adminhtml/system_config_backend_sitemap
adminhtml/system_config_backend_sitemap_cron
adminhtml/system_config_backend_storage_media_database
adminhtml/system_config_backend_store
adminhtml/system_config_backend_translate
adminhtml/system_config_backend_web_secure_offloaderheader
backup/config_backend_cron
catalog/system_config_backend_catalog_category_flat
catalog/system_config_backend_catalog_product_flat
catalog/system_config_backend_catalog_url_rewrite_suffix
cataloginventory/system_config_backend_minqty
cataloginventory/system_config_backend_minsaleqty
cataloginventory/system_config_backend_qtyincrements
catalogsearch/system_config_backend_sitemap
contacts/system_config_backend_links
customer/config_share
importexport/product_attribute_backend_urlkey
paypal/system_config_backend_cert
paypal/system_config_backend_merchantCountry
rss/system_config_backend_links
tax/config_notification
tax/config_price_include
xmlconnect/adminhtml_system_config_backend_baseurl
xmlconnect/adminhtml_system_config_backend_currency_default