Version: current

     1 <?php
     2
     3 /**
     4  * Расширение добавляющее CustomMenu(segment) к страницам
     5  *
     6  * @author inxo, menedem
     7  */
     8 class CustomMenu extends Extension {
     9
    10     public function CustomMenu($segment=null) {
    11         $menu = Convert::raw2sql($segment);
    12         if ($menu) {
    13             $subsiteID = 0;
    14             if (class_exists('Subsite')) {
    15                 $subsiteID = Subsite::currentSubsiteID();
    16             }
    17             if ($menu = DataObject::get_one('CustomMenuHolder', "Segment = '$menu' AND SubsiteID = {$subsiteID}")) {
    18                 $pages = $menu->Pages();//DataObject::get('CustomMenuItem', "ParentID = '$menu->ID'", "SortOrder");
    19                 if ($pages && $pages->exists())
    20                     return $pages;
    21             }
    22         }
    23         return false;
    24     }
    25
    26 }
    27
    28

[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. -