Webylon 3.2 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
  • Download
Version: current
  • 3.2
  • 3.1

Packages

  • 1c
    • exchange
      • catalog
  • auth
  • Booking
  • building
    • company
  • cart
    • shipping
    • steppedcheckout
  • Catalog
    • monument
  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • newsletter
    • publishers
    • reports
    • security
    • tasks
  • Dashboard
  • DataObjectManager
  • event
  • faq
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • googlesitemaps
  • guestbook
  • installer
  • newsletter
  • None
  • photo
    • gallery
  • PHP
  • polls
  • recaptcha
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets
  • seo
    • open
      • graph
  • sfDateTimePlugin
  • spamprotection
  • stealth
    • captha
  • subsites
  • userform
    • pagetypes
  • userforms
  • webylon
  • widgets

Classes

  • Cart
  • CartOrderButton
  • CartPage
  • CartSiteConfig
  • CartTableListField
  • CheckoutPage
  • ExtendGroupDiscount
  • ExtendMemberCart
  • ExtendPageCart
  • ExtendPageSpecialCatalog
  • ExtendProductSpecialCatalog
  • ExtendProfilePageOrder
  • Order
  • OrderAdmin
  • OrderExporter
  • OrderItem
  • OrderItemField
  • SpecialCatalog
  • TextLiteralField
 1 <?php
 2 
 3 /**
 4  * Выбор товара в админке
 5  *
 6  * @package cart
 7  * @author dvp
 8  */
 9 class OrderItemField extends TreeDropdownField {
10 
11     public function __construct($name, $title = null) {
12         $_REQUEST['filter'] = 'CMSSiteTreeFilter_Search';
13 
14         parent::__construct($name, $title, 'SiteTree', 'ID', 'Title', true);
15 //      $this->setTreeBaseID(DataObject::get_one('StartCatalog')->ID);
16         $this->setFilterFunction(array('OrderItemField', 'tree_filter'));
17         $this->setSearchFunction(array('OrderItemField', 'tree_search'));
18     }
19 
20     public function Field() {
21         $res = parent::Field();
22         Requirements::javascript('cart/javascript/OrderItemField.js');
23         Requirements::css('cart/css/OrderItemField.css');
24         return $res;
25     }
26 
27     public static function tree_filter($node) {
28         return ($node->ClassName == 'Catalog' || $node->ClassName == 'StartCatalog' || $node->ClassName == 'Product');
29     }
30 
31     public static function tree_search($class, $field, $search) {
32         return DataObject::get('Product', "\"Title\" LIKE '%$search%' OR Import LIKE '$search%'");
33     }
34 }
35 
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -
Webylon 3.2 API Docs API documentation generated by ApiGen 2.8.0