Magento core: Unterschied zwischen den Versionen

Aus Vosp.info
Wechseln zu:Navigation, Suche
(Model)
(Model)
Zeile 149: Zeile 149:
  
 
<source lang="php">
 
<source lang="php">
 +
    /**
 +
    *    gibt die Thumbnail image galery für zB Frontend zurück (inkl. cache generierung)
 +
    */
 
     public function getMediaGalleryImages()
 
     public function getMediaGalleryImages()
 
     {
 
     {

Version vom 28. November 2013, 19:05 Uhr

Magento Core Übersicht

CORE MAGE Extension: Catalog

app/code/core/Mage/Catalog
app/code/core/Mage/Adminhtml/Block/Catalog

Catalog/Product

Bilder Gallery

sn Suchwort: @Galerie 
magento Suchwort: media gallery

die Image Gallery ist ein ist eine Unter Unter Extension von Catalog

Catalog > Product > Gallery






Bilder Gallery für svg erweitern

Bildergallerie mit der Dateiendung *.svg erweitern
replace
array('jpg','jpeg','gif','png') => array('jpg','jpeg','gif','png', 'svg')
Images (.gif, .jpg, .png) => Images (.gif, .jpg, .png, .svg)
array('*.gif', '*.jpg','*.jpeg', '*.png') => array('*.gif', '*.jpg','*.jpeg', '*.png', '*.svg')
  • Mage_Adminhtml_Catalog_Product_GalleryController::uploadAction()
    • app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php
        $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png', 'svg'));
  • Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery_Content::_prepareLayout()
    • app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php
        $this->getUploader()->getConfig()
            ->setUrl(Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('*/catalog_product_gallery/upload'))
            ->setFileField('image')
            ->setFilters(array(
                'images' => array(
                    'label' => Mage::helper('adminhtml')->__('Images (.gif, .jpg, .png, .svg)'),
                    'files' => array('*.gif', '*.jpg','*.jpeg', '*.png', '*.svg')
                )
            ));
  • Mage_Adminhtml_Block_Media_Uploader::__construct()
    • app/code/core/Mage/Adminhtml/Block/Media/Uploader.php
        $this->getConfig()->setFilters(array(
            'images' => array(
                'label' => Mage::helper('adminhtml')->__('Images (.gif, .jpg, .png, .svg)'),
                'files' => array('*.gif', '*.jpg', '*.png')
            ),
            'media' => array(
                'label' => Mage::helper('adminhtml')->__('Media (.avi, .flv, .swf)'),
                'files' => array('*.avi', '*.flv', '*.swf')
            ),
            'all'    => array(
                'label' => Mage::helper('adminhtml')->__('All Files'),
                'files' => array('*.*')
            )
        ));
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Images::_prepareImagesData($image)
    • app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Images.php
        $this->getConfig()->setFilters(array(
            'images' => array(
                'label' => Mage::helper('adminhtml')->__('Images (.gif, .jpg, .png, .svg)'),
                'files' => array('*.gif', '*.jpg','*.jpeg', '*.png', '*.svg')
        )));
  • Sprachanpassungen
    • app/locale/de_DE/Mage_Adminhtml.csv
    • app/locale/en_US/Mage_Adminhtml.csv
Validator
  • Mage_Adminhtml_Catalog_Product_GalleryController::uploadAction()
    • /home/dev/Magento/Magento18/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php

Zeilen auskommentieren

//            $uploader->addValidateCallback('catalog_product_image',
//                Mage::helper('catalog/image'), 'validateUploadFile');

oder die Mage_Catalog_Helper_Image::validateUploadFile($filePath) modifizieren



MODE CONFIG

  • Catalog/etc/config.xml
    • keine Bilder in der Bilder Reiter Tabelle beim Produkt
      • product_attribute_media_gallery
      • product_attribute_media_gallery_value

BLOCK

Backend (Adminhtml)
app/code/core/Mage/Adminhtml/Block/Catalog/Product/
  • Helper
    • Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php
      • Objektfunktionen die die Anzeige (Tabelle, upload, ...) aufrufen
      • class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery extends Varien_Data_Form_Element_Abstract
    • Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php
      • Klassen-Funktionen die Anzeige Elemente fürs Template zurück geben
      • class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery_Content extends Mage_Adminhtml_Block_Widget
    • Adminhtml/Block/Catalog/Product/Helper/Form/Image.php
  • Edit
    • Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php
    • class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes extends Mage_Adminhtml_Block_Catalog_Form
      • Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes->_prepareForm() -- generiert alle Punkte die unter #catalog.xml (z.B. Katalog > Produkte verwalten > Produkt > Bilder) nicht aufgeführt sind
      • Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes->_getAdditionalElementTypes() -- Ortsangabe zum Gallery Helper (muss hier zur Verfügung stehen, sonst Fehler bei Produktanzeige)
    • Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php *
      • ähnlich wie oben nur weiß ich nicht was es betrifft
  • Attribute
    • Adminhtml/Block/Catalog/Product/Attribute/New/Product/Attributes.php
Frontend
app/code/core/Mage/Catalog/Block/Product/
  • Catalog/Block/Product/Gallery.php
    • class Mage_Catalog_Block_Product_Gallery extends Mage_Core_Block_Template

Template

Adminhtml
app/design/adminhtml/default/default/template/catalog/product/
  • Template greift auf Funktionen von Gallery/Content.php zu
    • adminhtml/default/default/template/catalog/product/helper/gallery.phtml

Model

app/code/core/Mage/Catalog/Model
  • app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Media.php
    • class Mage_Catalog_Model_Resource_Product_Attribute_Backend_Media extends Mage_Core_Model_Resource_Db_Abstract


  • app/code/core/Mage/Catalog/Model/Product.php
    • class Mage_Catalog_Model_Product extends Mage_Catalog_Model_Abstract
    /**
     *    gibt die Thumbnail image galery für zB Frontend zurück (inkl. cache generierung)
     */
    public function getMediaGalleryImages()
    {
                // .... 
                // erstellt den Thumbmail Cache
                $images->addItem(new Varien_Object($image));
                // .... 
    }

Controller

app/code/core/Mage/Adminhtml/controllers/Catalog/
  • Adminhtml/controllers/Catalog/Product/GalleryController.php

Bibliotheken

lib/Varien/File/Uploader.php

evt unrelevant

  • Magento18/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Images.php
    • class Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Images extends Mage_Adminhtml_Block_Template
  • Magento18/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php
    • class Mage_Adminhtml_Block_Media_Uploader extends Mage_Adminhtml_Block_Widget
  • Magento18/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Uploader.php
    • class Mage_Adminhtml_Block_Cms_Wysiwyg_Images_Content_Uploader extends Mage_Adminhtml_Block_Media_Uploader





catalog.xml

Magento18/app/design/adminhtml/default/default/layout/catalog.xml

catalog.xml bezieht sich auf admin panel > Katalog

  • Artikel verwalten
  • Kategorien verwalten

alle anderen (Attribute, Url Rewrite Verwaltung, Suchbegriffe ... ) nicht

  • admin panel > Katalog > Produkt
    • Allgemein:
    • Preise:
    • Metadaten:
    • Bilder:
    • Wiederkehrendes Profil:
    • Design:
    • Geschenkoptionen:
    • Lagerverwaltung:
    • Kategorien: adminhtml_catalog_product_categories
    • Zubehör adminhtml_catalog_product_related
    • Up-Selling adminhtml_catalog_product_upsell
    • Up-Selling > Suche adminhtml_catalog_product_upsellgrid
    • Cross-Selling adminhtml_catalog_product_crosssell
    • Cross-Selling > Suche adminhtml_catalog_product_crosssellgrid
    • Kundenmeinungen: adminhtml_catalog_product_reviews
    • Schlagworte: adminhtml_catalog_product_taggrid
    • Kunden, die Schlagworte adminhtml_catalog_product_tagcustomergrid
    • Individualisierungsoptionen adminhtml_catalog_product_options
    • überall bzw ab und zu
      • ## > Neues Attribut adminhtml_catalog_product_attribute_edit
  • Konfigurierbare Produkte
    • Fehlermeldung: Konfigurierbaren Artikel erstellen und keine Attributte haben adminhtml_catalog_product_configurable_new
  • Katalog >
    • Kategorien verwalten: adminhtml_catalog_category_edit
  • unklar
    •  ? adminhtml_catalog_product_grid (Tabellen)
    •  ? adminhtml_catalog_product_relatedgrid
    •  ? adminhtml_catalog_product_superconfig
    •  ? adminhtml_catalog_product_alertspricegrid
    •  ? adminhtml_catalog_product_alertsstockgrid
    •  ? adminhtml_catalog_product_simple
    •  ? adminhtml_catalog_product_simple
    •  ? adminhtml_catalog_product_grouped
    •  ? adminhtml_catalog_product_supergroup
    •  ? adminhtml_catalog_product_supergroupgridonly
    •  ? adminhtml_catalog_product_configurable
    •  ? adminhtml_catalog_product_action_attribute_edit
    •  ? ADMINHTML_CATALOG_PRODUCT_COMPOSITE_CONFIGURE
    •  ? ADMINHTML_CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR
    •  ? ADMINHTML_CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT
    •  ? PRODUCT_TYPE_configurable
    •  ? PRODUCT_TYPE_grouped