Auto include Modul System

Aus Wiki | modified eCommerce Shopsoftware
Zur Navigation springenZur Suche springen

(by oneQ; Stand 30.05.2024)

Einleitung[Bearbeiten]

Seit modified eCommerce Shopsoftware 2.0.0.0 ist es möglich mit Hilfe von Hook-Points in verschiedenen Dateien über ein Auto include Modul System den Shop um Funktionen/Module zu erweitern, ohne dabei die Core-Dateien ändern zu müssen. Im Forum wird dabei auch von "updatesicher" gesprochen.

Eine Übersicht der Hook-Points findet Ihr am Ende der Seite.

Benamung im Modul[Bearbeiten]

Um Konflikte zwischen Modulen unterschiedlicher Entwickler und dem Shop vorzubeugen, sollte in den Modulen ein Prefix (z.B. Nickname, Forumname, Initiale, o.ä.) für Variablen, Dateinamen, Tabellen, usw. verwendet werden.

Ordnerstruktur[Bearbeiten]

Die Verzeichnisse
~/includes/extra/
~/admin/includes/extra/
~/lang/[SPRACHE]/extra/
beinhalten die Ordnerstruktur für das Auto include Modul System.

Eigene zusätzliche Moduldateien, z.B. Funktionen oder Klassen, sollten in einem Ordner ~/includes/external/[MODUL_NAME] gespeichert werden, sofern diese nicht im Verzeichnis ~/admin/ benötigt oder über das Auto Include System eingebunden werden.
Dateien für die Modulinstallation befinden sich unter ~/admin/includes/modules/[MODUL-KATEGORIE]/. Eine Beispiel dazu gibt es auf der Wikiseite Einstieg in die Modul-Entwicklung

Beispiel[Bearbeiten]

Die Datei ~/admin/includes/filenames.php hat in Zeile 14 einen Hook-Point:

foreach(auto_include(DIR_FS_ADMIN.'includes/extra/filenames/', 'php') as $file) require ($file);

Damit werden alle php-Dateien im Ordner ~/admin/includes/extra/filenames/ an dieser Stelle "eingefügt". In diesem Fall lässt sich die ~/admin/includes/filenames.php so um weitere Einträge erweitern ohne diese selbst zu ändern. Die Datei im Ordner ~/admin/includes/extra/filenames/ könnte zum Beispiel prefix_mein_erstes_modul.php heißen und folgenden Inhalt haben:

<?php
	// mein erstes Modul
	define('FILENAME_PREFIX_MEIN_ERSTES_MODUL', 'prefix_mein_erstes_modul.php');
?>


Hilfreiche Seiten im Wiki:
Neue Adminseite hinzufügen
Einstieg in die Modul-Entwicklung - u.a. Beispiel einer Modulinstallationsdatei

Hilfreiche Topics im Forum:
Shopversion 2.0.0.0 - Neues für Module mit einem Dummy-Modul als Beispiel.

Reihenfolge der Einbindung manipulieren[Bearbeiten]

Die Reihenfolge der eingefügten Dateien lässt sich über den Dateinamen manipulieren, da diese in alphabetischer Reihenfolge aufgerufen werden. Gerne werden dazu auch zahlen verwendet. Im oberen Beispiel wäre das z.B. 10_prefix_mein_erstes_modul.php

Übersicht der Hookpoints[Bearbeiten]

Stand: Shopversion 3.1.0

Datei auto_include Ordner ab Version

~/admin/content_manager.php

~/admin/includes/extra/modules/content_manager/action/

2.0.6.0

~/admin/includes/add_db_fields.php

~/admin/includes/extra/modules/add_db_fields/

2.0.0.0

~/admin/includes/application_bottom.php

~/admin/includes/extra/application_bottom/

2.0.0.0

~/admin/includes/application_top.php

~/admin/includes/extra/functions/
~/admin/includes/extra/application_top/application_top_begin/
~/admin/includes/extra/application_top/application_top_end/

2.0.0.0
2.0.0.0
2.0.0.0

~/admin/includes/classes/categories.php

~/templates/

2.0.5.0

~/admin/includes/classes/image_manipulator.php

~/admin/includes/extra/modules/image_sharpen/

3.0.0

~/admin/includes/classes/image_manipulator_GD2_advanced.php

~/admin/includes/extra/modules/image_sharpen/

2.0.5.0-2.0.7.0

~/admin/includes/classes/import.php

~/admin/includes/extra/modules/import/file_layout/
~/admin/includes/extra/modules/import/insert_before/
~/admin/includes/extra/modules/import/insert_end/
~/admin/includes/extra/modules/export/file_layout/
~/admin/includes/extra/modules/export/export_end/

2.0.5.0
2.0.5.0
2.0.5.0
2.0.7.0
2.0.7.0

~/admin/includes/extra_menu.php

~/admin/includes/extra/menu/

2.0.0.0

~/admin/includes/filenames.php

~/admin/includes/extra/filenames/

2.0.0.0

~/admin/includes/footer.php

~/admin/includes/extra/footer/

2.0.0.0

~/admin/includes/functions/general.php

~/includes/extra/cache/

2.0.5.0

~/admin/includes/head.php

~/admin/includes/extra/css/
~/admin/includes/extra/javascript/

2.0.0.0
2.0.0.0

~/admin/includes/modules/categories_view.php

~/admin/includes/extra/modules/categories_view/products_search/

2.0.0.0

~/admin/includes/modules/content_manager_content.php

~/admin/includes/extra/modules/content_manager/content/

2.0.6.0

~/admin/includes/modules/content_manager_email.php

~/admin/includes/extra/modules/content_manager/email/

2.0.6.0

~/admin/includes/modules/content_manager_pages.php

~/admin/includes/extra/modules/content_manager/pages/

2.0.6.0

~/admin/includes/modules/content_manager_products.php

~/admin/includes/extra/modules/content_manager/products/

2.0.6.0

~/admin/includes/modules/new_attributes_change.php

~/admin/includes/extra/modules/new_attributes/new_attributes_change/
~/admin/includes/extra/modules/new_attributes/new_attributes_change_dl/
~/admin/includes/extra/new_attributes/new_attributes_change_dl/

2.0.1.0
2.0.5.0
2.0.1.0-2.0.4.0

~/admin/includes/modules/new_attributes_include.php

~/admin/includes/extra/modules/new_attributes/new_attributes_include_th/
~/admin/includes/extra/modules/new_attributes/new_attributes_include_td/

2.0.1.0
2.0.1.0

~/admin/includes/modules/new_category.php

~/admin/includes/extra/modules/new_category/
~/admin/includes/extra/modules/new_category_description/

2.0.0.0
2.0.7.0

~/admin/includes/modules/new_product.php

~/admin/includes/extra/modules/new_product/
~/admin/includes/extra/modules/new_product_description/

2.0.0.0
2.0.7.0

~/admin/includes/modules/orders_info_blocks.php

~/admin/includes/extra/modules/orders/orders_info_payment/
~/admin/includes/extra/modules/orders/orders_info_blocks/
~/admin/includes/extra/modules/orders/orders_info_blocks_end/

2.0.0.0
2.0.0.0
2.0.1.0

~/admin/includes/modules/orders_update.php

~/admin/includes/extra/modules/orders/orders_update/

2.0.6.0

~/admin/includes/paths.php

~/admin/includes/extra/paths/

2.0.2.0

~/admin/manufacturers.php

~/admin/includes/extra/modules/manufacturers/action/
~/admin/includes/extra/modules/manufacturers/details/

2.0.6.0
2.0.6.0

~/admin/modules.php

~/admin/includes/extra/submenu/modules/

2.0.0.0

~/admin/orders.php

~/admin/includes/extra/modules/orders/orders_action/

2.0.0.0

~/admin/print_order.php

~/admin/includes/extra/modules/orders/orders_print/

2.0.6.0

~/admin/print_packingslip.php

~/admin/includes/extra/modules/orders/orders_print/

2.0.6.0

~/admin/whos_online.php

~/admin/includes/extra/modules/whos_online/

2.0.6.0

~/checkout_process.php

~/includes/extra/checkout/checkout_process_products/
~/includes/extra/checkout/checkout_process_attributes/
~/includes/extra/checkout/checkout_process_download/
~/includes/extra/checkout/checkout_process_products_end/
~/includes/extra/checkout/checkout_process_order/
~/includes/extra/checkout/checkout_process_end/

2.0.0.0
2.0.0.0
2.0.0.0
3.0.0
2.0.6.0
2.0.0.0

~/inc/csrf_token.inc.php

~/admin/includes/extra/csrf_exclusion/

2.0.1.0

~/inc/db_functions_mysql.inc.php

~/includes/extra/db_query/

2.0.7.0

~/inc/db_functions_mysqli.inc.php

~/includes/extra/db_query/

2.0.7.0

~/inc/get_wishlist_content.inc.php

~/includes/extra/modules/wishlist_content/
~/includes/extra/modules/wishlist_content_attributes/

2.0.0.0
2.0.0.0

~/inc/product_redirect.inc.php

~/includes/extra/seo_url_mod/

2.0.5.0

~/inc/search_replace_utf-8.php

~/includes/extra/search_replace_utf-8/

2.0.4.0

~/inc/seo_url_mod.php

~/includes/extra/seo_url_mod/

2.0.1.0

~/inc/xtc_php_mail.inc.php

~/includes/extra/php_mail/

2.0.3.0

~/inc/xtc_validate_password.inc.php

~/includes/extra/validate_password/

2.0.2.0

~/inc/xtc_wysiwyg.inc.php

~/includes/extra/wysiwyg/

2.0.0.0

~/includes/application_bottom.php

~/includes/extra/application_bottom/

2.0.0.0

~/includes/application_top.php

~/includes/extra/functions/
~/includes/extra/application_top/application_top_begin/
~/includes/extra/application_top/application_top_end/

2.0.0.0
2.0.0.0
2.0.0.0

~/includes/application_top_callback.php

~/includes/extra/functions/
~/includes/extra/application_top_callback/application_top_callback_begin/
~/includes/extra/application_top_callback/application_top_callback_end/

3.0.0
2.0.0.0
2.0.0.0

~/includes/application_top_export.php

~/includes/extra/functions/
~/includes/extra/application_top_export/application_top_export_begin/
~/includes/extra/application_top_export/application_top_export_end/

3.0.0
2.0.0.0
2.0.0.0

~/includes/cart_actions.php

~/includes/extra/cart_actions/remove_product_prepare_get/
~/includes/extra/cart_actions/remove_product_before_redirect/
~/includes/extra/cart_actions/update_product_prepare_post/
~/includes/extra/cart_actions/update_product_before_redirect/
~/includes/extra/cart_actions/add_product_prepare_post/
~/includes/extra/cart_actions/add_product_before_redirect/
~/includes/extra/cart_actions/add_a_quickie_prepare_post/
~/includes/extra/cart_actions/buy_now_prepare_get/
~/includes/extra/cart_actions/custom/

2.0.3.0
2.0.3.0
2.0.0.0
2.0.0.0
2.0.0.0
2.0.0.0
2.0.4.0
2.0.4.0
2.0.1.0

~/includes/cart_requirements.php

~/includes/extra/shopping_cart/cart_requirements/

2.0.1.0

~/includes/checkout_requirements.php

~/includes/extra/checkout/checkout_requirements/

2.0.1.0

~/includes/classes/class.newsletter.php

~/includes/extra/newsletter/opt_in/
~/includes/extra/newsletter/unsubscribe/
~/includes/extra/newsletter/subscribe/

2.0.5.0
2.0.5.0
2.0.5.0

~/includes/classes/modified_cache.php

~/includes/extra/cache/

2.0.5.0

~/includes/classes/modified_captcha.php

~/includes/extra/captcha/

2.0.5.0

~/includes/configure.php

~/includes/extra/configure/

2.0.1.0

~/includes/database_tables.php

~/includes/extra/database_tables/

2.0.0.0

~/includes/define_add_select.php

~/includes/extra/define_add_select/

2.0.0.0

~/includes/filenames.php

~/includes/extra/filenames/

2.0.0.0

~/includes/functions/sessions.php

~/includes/extra/sessions/

2.0.6.0

~/includes/header.php

~/includes/extra/header/header_begin/
~/includes/extra/header/header_head/
~/includes/extra/header/header_body/

2.0.0.0
2.0.0.0
2.0.0.0

~/includes/modules/categories_listing.php

~/includes/extra/modules/categories_listing/categories_smarty/
~/includes/extra/modules/categories_listing/categories_content/

2.0.4.0
2.0.4.0

~/includes/modules/create_breadcrumb.php

~/includes/extra/modules/create_breadcrumb/

2.0.1.0

~/includes/modules/default.php

~/includes/extra/default/category_depth/
~/includes/extra/default/categories_smarty/
~/includes/extra/default/listing_sql/
~/includes/extra/default/center_modules/
~/includes/extra/default/categories_content/

2.0.5.0
2.0.4.0
2.0.4.0
2.0.0.0
2.0.4.0-2.0.6.0

~/includes/modules/error_handler.php

~/includes/extra/modules/error_handler/

3.0.0

~/includes/modules/metatags.php

~/includes/extra/modules/metatags_data/
~/includes/extra/modules/metatags_end/

2.0.5.0
2.0.5.0

~/includes/modules/order/productTagsOnCheckout.php

~/includes/extra/modules/products_tags_data/
~/includes/extra/modules/products_tags_end/

2.0.5.0
2.0.5.0

~/includes/modules/order_details_cart.php

~/includes/extra/modules/order_details_cart_content/
~/includes/extra/modules/order_details_cart_attributes/
~/includes/extra/modules/order_details_cart_total/

2.0.0.0
2.0.0.0
2.0.0.0

~/includes/modules/product_attributes.php

~/includes/extra/modules/products_attributes_top/
~/includes/extra/modules/products_attributes_begin/
~/includes/extra/modules/products_attributes_data/
~/includes/extra/modules/products_attributes_end/
~/includes/extra/modules/products_attributes_bottom/

2.0.1.0
2.0.0.0
2.0.0.0
2.0.0.0
2.0.1.0

~/includes/modules/product_info.php

~/includes/extra/modules/product_info_mo_images/
~/includes/extra/modules/product_info_end/

2.0.1.0
2.0.0.0

~/includes/modules/product_listing.php

~/includes/extra/modules/product_listing_split/
~/includes/extra/modules/product_listing_begin/
~/includes/extra/modules/product_listing_end/

2.0.4.0
2.0.1.0
2.0.1.0

~/includes/modules/product_tags.php

~/includes/extra/modules/products_tags_begin/
~/includes/extra/modules/products_tags_data/
~/includes/extra/modules/products_tags_end/
~/includes/extra/modules/products_tags_bottom/
~/includes/extra/modules/products_tags_top/

2.0.4.0
2.0.3.0
2.0.3.0
2.0.3.0
2.0.3.0

~/includes/modules/set_language_sessions.php

~/includes/extra/modules/set_language_sessions/

2.0.0.0

~/includes/modules/set_session_and_cookie_parameters.php

~/includes/extra/modules/set_session_and_cookie_parameters/

2.0.6.0

~/includes/paths.php

~/includes/extra/paths/

2.0.2.0

~/lang/english/admin/english.php

~/lang/english/extra/admin/

2.0.0.0

~/lang/english/english.php

~/lang/english/extra/

2.0.0.0

~/lang/german/admin/german.php

~/lang/german/extra/admin/

2.0.0.0

~/lang/german/german.php

~/lang/german/extra/

2.0.0.0

~/login.php

~/includes/extra/login/

2.0.1.0

~/print_product_info.php

~/includes/extra/modules/product_info_mo_images/

2.0.7.0

~/product_reviews_write.php

~/includes/extra/modules/product_reviews_write/

2.0.3.0

~/products_new.php

~/includes/extra/modules/products_new_split/

2.0.4.0

~/send_order.php

~/includes/extra/send_order/data/
~/includes/extra/send_order/mail/
~/includes/extra/send_order/

2.0.1.0
2.0.1.0
2.0.0.0

~/shop_content.php

~/includes/extra/shop_content_end/

2.0.4.0

~/templates/tpl_modified/javascript/general_bottom.js.php

~/templates/'YOUR_TEMPLATE'/javascript/extra/

2.0.5.0

~/templates/tpl_modified_nova/javascript/general_bottom.js.php

~/templates/'YOUR_TEMPLATE'/javascript/extra/

3.0.0

~/templates/tpl_modified_responsive/javascript/general_bottom.js.php

~/templates/'YOUR_TEMPLATE'/javascript/extra/

2.0.5.0

~/templates/xtc5/javascript/general_bottom.js.php

~/templates/'YOUR_TEMPLATE'/javascript/extra/

2.0.5.0