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

  • Address
  • AddSubsiteTask
  • Announcement
  • AnnouncementDecorator
  • AnnouncementHolder
  • AssociatedFolderDecorator
  • AttachedFiles
  • AudioPhpCaptcha
  • AutoCompleteField
  • Base1CExchanger
  • BookingOrder_StatusLog
  • CalendarUtil
  • CalendarWidgetExtention
  • CatalogCatalogLinkedDecorator
  • CatalogOldFieldsDecorator
  • CatalogProductLinkedDecorator
  • CheckoutStep_ShippingMethod
  • ChequePayment
  • ClearHistoryTask
  • ClientEmailOrderNotification_SiteConfig
  • ClientVKOrderNotification_SiteConfig
  • CommentsSiteConfig
  • ContactsPage
  • CookieExtention
  • CostTableShippingRate
  • CustomMenu
  • CustomMenuAdmin
  • CustomMenuDecorator
  • CustomMenuHolder
  • CustomMenuItem
  • CustomPayment
  • DataObjectLoggerExtension
  • DataObjectSubsites
  • DefaultCMSActionDecorator
  • DocPage
  • DocumentDirection
  • DocumentHaving
  • DocumentSearchForm
  • DocumentSiteConfig
  • DocumentsPage
  • DocumentType
  • DOMUtil
  • ExtendPageAnnouncement
  • ExtendPagePoll
  • FavoriteExtention
  • FavoritePage
  • FavoriteProductMemberExtention
  • FavoriteProducts
  • FileOversizeDecorator
  • FindCyrillicSiteConfig
  • FolderRenameTask
  • GDMergeAlpha
  • HomePage
  • ImageAutoResize
  • ImageResizeTask
  • ImportCatalog1C_Importer
  • ImportCatalogSiteConfig
  • ImportSiteConfig
  • LoggerAdmin
  • LogItem
  • ManagerEmailOrderNotification_SiteConfig
  • MapObject
  • MapObjectGroup
  • MapPage
  • MediawebForm
  • MemberLoggerExtension
  • MonumentsSiteConfig
  • MultiUploadConfig
  • NearestEventExtention
  • NewDocumentsAdmin
  • NewsArchive
  • NewsEntry
  • NewsHolder
  • NewsSiteConfig
  • Order_StatusLog
  • Orders1CExchange_Exporter
  • PageHideFieldsExtension
  • PageInformerRates
  • PageInformerWeather
  • Payment_Failure
  • Payment_Processing
  • Payment_Result
  • Payment_Success
  • PaymentMethod
  • PaymentSiteConfig
  • PayPalPayment
  • PayPalPayment_Handler
  • PhoneField
  • PhotoAlbumExtentions
  • PhpCaptcha
  • PhpCaptchaColour
  • PhpCaptchaField
  • phpMorphy
  • phpMorphy_AncodesResolver_AsIs
  • phpMorphy_AncodesResolver_Proxy
  • phpMorphy_AncodesResolver_ToDialingAncodes
  • phpMorphy_AncodesResolver_ToText
  • phpMorphy_AnnotDecoder_Base
  • phpMorphy_AnnotDecoder_Common
  • phpMorphy_AnnotDecoder_Factory
  • phpMorphy_AnnotDecoder_Predict
  • phpMorphy_FilesBundle
  • phpMorphy_Fsa
  • phpMorphy_Fsa_Decorator
  • phpMorphy_Fsa_Proxy
  • phpMorphy_Fsa_Sparse_File
  • phpMorphy_Fsa_Sparse_Mem
  • phpMorphy_Fsa_Sparse_Shm
  • phpMorphy_Fsa_Tree_File
  • phpMorphy_Fsa_Tree_Mem
  • phpMorphy_Fsa_Tree_Shm
  • phpMorphy_Fsa_WordsCollector
  • phpMorphy_GramInfo
  • phpMorphy_GramInfo_AncodeCache
  • phpMorphy_GramInfo_Decorator
  • phpMorphy_Graminfo_File
  • phpMorphy_Graminfo_Mem
  • phpMorphy_GramInfo_Proxy
  • phpMorphy_GramInfo_Proxy_WithHeader
  • phpMorphy_GramInfo_RuntimeCaching
  • phpMorphy_Graminfo_Shm
  • phpMorphy_GrammemsProvider_Base
  • phpMorphy_GrammemsProvider_Decorator
  • phpMorphy_GrammemsProvider_Empty
  • phpMorphy_GrammemsProvider_Factory
  • phpMorphy_GrammemsProvider_ForFactory
  • phpMorphy_GrammemsProvider_ru_RU
  • phpMorphy_GramTab
  • phpMorphy_GramTab_Empty
  • phpMorphy_GramTab_Proxy
  • phpMorphy_Link
  • phpMorphy_Link_Annot
  • phpMorphy_Link_Base
  • phpMorphy_Morphier_Base
  • phpMorphy_Morphier_Bulk
  • phpMorphy_Morphier_Common
  • phpMorphy_Morphier_Empty
  • phpMorphy_Morphier_Finder_Base
  • phpMorphy_Morphier_Finder_Common
  • phpMorphy_Morphier_Finder_Predict_Databse
  • phpMorphy_Morphier_Finder_Predict_Suffix
  • phpMorphy_Morphier_Helper
  • phpMorphy_Morphier_Predict_Database
  • phpMorphy_Morphier_Predict_Suffix
  • phpMorphy_Morphier_PredictCollector
  • phpMorphy_Semaphore
  • phpMorphy_Semaphore_Empty
  • phpMorphy_Semaphore_Nix
  • phpMorphy_Semaphore_Win
  • phpMorphy_Shm_Cache
  • phpMorphy_Shm_Cache_FileDescriptor
  • phpMorphy_Shm_Header
  • phpMorphy_Source_Dba
  • phpMorphy_Source_Fsa
  • phpMorphy_State
  • phpMorphy_Storage
  • phpMorphy_Storage_Factory
  • phpMorphy_Storage_File
  • phpMorphy_Storage_Mem
  • phpMorphy_Storage_Proxy
  • phpMorphy_Storage_Shm
  • phpMorphy_UnicodeHelper
  • phpMorphy_UnicodeHelper_Base
  • phpMorphy_UnicodeHelper_MultiByteFixed
  • phpMorphy_UnicodeHelper_singlebyte
  • phpMorphy_UnicodeHelper_ucs_2be
  • phpMorphy_UnicodeHelper_ucs_2le
  • phpMorphy_UnicodeHelper_ucs_4be
  • phpMorphy_UnicodeHelper_ucs_4le
  • phpMorphy_UnicodeHelper_utf_16_Base
  • phpMorphy_UnicodeHelper_utf_16be
  • phpMorphy_UnicodeHelper_utf_16le
  • phpMorphy_UnicodeHelper_utf_32_Base
  • phpMorphy_UnicodeHelper_utf_32be
  • phpMorphy_UnicodeHelper_utf_32le
  • phpMorphy_UnicodeHelper_utf_8
  • phpMorphy_WordDescriptor
  • phpMorphy_WordDescriptor_Collection
  • phpMorphy_WordDescriptor_Collection_Serializer
  • phpMorphy_WordForm
  • ProductCatalogImportTask
  • ProductOldFieldsDecorator
  • ProductParamValue_BoolValueField
  • ProductParamValue_MultiValueField
  • ProductParamValue_MultiValueSetField
  • ProductParamValue_ValueField
  • ProductProductLinkedDecorator
  • PublHolder
  • Publication
  • PublicationSiteTree
  • RatingDataObject
  • RatingExtension
  • RealtySiteConfigDecorator
  • RecentComments
  • RecentFiles
  • RecentPages
  • RelatedPageLink
  • RoomRate_PriceField
  • RussianUpLower
  • SberbankPayment
  • SberbankPayment_Handler
  • SetMainSiteHomePageTypeTask
  • ShippingEstimator
  • ShippingPackage
  • ShowUserFromExtension
  • ShowViewedProductExtention
  • SiteConfigDecorator
  • SiteConfigSubsites
  • SiteTreeSubsites
  • SMSCOrderNotification_SiteConfig
  • SMSOrderNotification_SiteConfig
  • Socle
  • SocleSize
  • SortCMSActionDecorator
  • SS_Report_FakeQuery
  • SSMorphy
  • SSNController
  • SteppedCheckout_PageMessages
  • SubpageListField
  • SubscribeFormAllPagesExtension
  • SubsiteDropdownField
  • SubsiteReportWrapper
  • TableShippingRate
  • UnitellerPayment
  • UnitellerPayment_Handler
  • UnmoderatedComments
  • VAT
  • VideoManager
  • VideoSiteConfig
  • ViewedProductExtention
  • WatermarkImage
  • WatermarkSiteConfig
  • WeightTableShippingRate
  • XMLValidate
  • YaMoneyPayment
  • YaMoneyPayment_Handler
  • YMLExporter
  • YMLSiteConfig

Interfaces

  • PaymentObjectInterface
  • phpMorphy_AncodesResolver_Interface
  • phpMorphy_AnnotDecoder_Interface
  • phpMorphy_Fsa_Interface
  • phpMorphy_GramInfo_Interace
  • phpMorphy_GrammemsProvider_Interface
  • phpMorphy_GramTab_Interface
  • phpMorphy_Morphier_Finder_Interface
  • phpMorphy_Morphier_Interface
  • phpMorphy_Shm_Cache_Interface
  • phpMorphy_Source_Interface

Exceptions

  • phpMorphy_Exception

Functions

  • column_sort
  • column_sort_callback_basic
  • encodeFileForEmail
  • encodeMultipart
  • getMimeType
  • htmlEmail
  • loadMimeTypes
  • phpmorphy_overload_mb_funcs
  • plaintextEmail
  • processHeaders
  • QuotedPrintable_encode
  • supressOutput
  • validEmailAddr
  • wrapImagesInline
  • wrapImagesInline_rewriter
  1 <?php
  2 /**
  3  * Description of SubpageListField
  4  *
  5  * @author inxo
  6  */
  7 class SubpageListField extends TableListField {
  8 
  9     protected $page;
 10     protected $subclass;
 11     protected $template = "SubpageListField";
 12 
 13     public $Dragable = false;
 14     public $Sortable = false;
 15     public $itemClass = 'SubpageListField_Item';
 16     
 17     function __construct($name, $page, $sourceClass, $sourceSort = null) {
 18         $this->page = $page;
 19         $this->subclass = $sourceClass;
 20         $this->setPageSize(30);
 21         $this->setShowPagination(true);
 22         $subpage_fields = singleton($sourceClass)->summaryFields();
 23         $subpage_fields['Status'] = 'Status';
 24         if (isset($sourceSort)) {
 25             $this->sourceSort = $sourceSort;
 26         }
 27         elseif(isset(singleton($sourceClass)->Sort)){
 28             $this->sourceSort = 'Sort';
 29         }
 30         else {
 31             $this->sourceSort = 'Title';
 32         }
 33     
 34         $this->sourceFilter = 'ParentID = '.$this->page->ID;
 35                 
 36         if (isset($_REQUEST['ctf'][$name]['SearchTitle'])) {
 37             $title = Convert::raw2sql($_REQUEST['ctf'][$name]['SearchTitle']);
 38             $this->sourceFilter .= " AND SiteTree.Title LIKE '%{$title}%'";
 39             $this->extraLinkParams["ctf[{$name}][SearchTitle]"] = $_REQUEST['ctf'][$name]['SearchTitle'];
 40         }
 41         
 42         parent::__construct(
 43                         $name,
 44                         $sourceClass,
 45                         $subpage_fields,
 46                         $this->sourceFilter,
 47                         $this->sourceSort
 48         );
 49         $this->Markable = true;
 50 
 51         if (!empty($_REQUEST['ctf'][$this->Name()]['sort'])) {
 52             $this->extraLinkParams["ctf[{$this->Name()}][sort]"] = urlencode($_REQUEST['ctf'][$this->Name()]['sort']);
 53         }
 54         if (!empty($_REQUEST['ctf'][$this->Name()]['dir'])) {
 55             $this->extraLinkParams["ctf[{$this->Name()}][dir]"] = urlencode($_REQUEST['ctf'][$this->Name()]['dir']);
 56         }
 57 
 58     }
 59 
 60     function addsubpage($data) {
 61         $className = $this->subclass;
 62         $p = new $className();
 63         
 64 //      if (!$p->Title) $p->Title = _t('CMSMain.NEW',"New ",PR_MEDIUM,'"New " followed by a className').singleton($className)->i18n_singular_name(); 
 65         if (!$p->Title) $p->Title = singleton($className)->i18n_singular_name(); 
 66         if (!$p->URLSegment) $p->URLSegment = "new-" . strtolower($className);
 67         $p->ClassName = $className;
 68         $p->ParentID = $this->page->ID;
 69 
 70         // DataObject::fieldExists only checks the current class, not the hierarchy
 71         // This allows the CMS to set the correct sort value
 72         if($p->castingHelper('Sort')) {
 73             $p->Sort = DB::query("SELECT MAX(\"Sort\") FROM \"SiteTree\" WHERE \"ParentID\" = '" . Convert::raw2sql($this->page->ID) . "'")->value() + 1;
 74         }
 75 
 76     }
 77     
 78     function handleItem($request) {
 79         return new SubPageListField_ItemRequest($this, $request->param('ID'));
 80     }
 81 
 82     function FieldHolder() {
 83         Requirements::javascript('webylon/javascript/SubpageListField.js');
 84         Requirements::javascript('webylon/javascript/SubpageAdmin.js');
 85         Requirements::css('webylon/css/SubpageAdmin.css');
 86 
 87         return parent::FieldHolder();
 88     }
 89     
 90     function FieldActions() {
 91         $actionSet = new FieldGroup(
 92             $f1 = new FormAction('addsubpage', _t('WebylonSubpage.ADDBUTTON', 'Add')),          
 93             $f2 = new FormAction('markall', _t('WebylonSubpage.MARKALL', 'Markall')),
 94             $delete = new FormAction('deletemarked', _t('WebylonSubpage.DELETEBUTTON', 'Delete')),
 95             $f3 = new FormAction('publishmarked', _t('WebylonSubpage.PUBLISHBUTTON', 'Publish')),
 96             $f4 = new FormAction('unpublishmarked', _t('WebylonSubpage.UNPUBLISHBUTTON', 'Unpublish'))
 97         );
 98         $f1->addExtraAttribute('type', 'button');
 99         $f2->addExtraAttribute('type', 'button');
100         $f3->addExtraAttribute('type', 'button');
101         $f4->addExtraAttribute('type', 'button');
102         $delete->addExtraAttribute('type', 'button');
103         $delete->addExtraClass('delete');
104         $val = '';
105         if (isset($_REQUEST['ctf'][$this->Name()]['SearchTitle'])) {
106             $val = $_REQUEST['ctf'][$this->Name()]['SearchTitle'];
107         }
108         $actionSet->push(new TextField('SearchTitle', 'Название', $val));
109         $actionSet->push(new FormAction('doSearch', _t('WebylonSubpage.SEARCHBUTTON', 'Поиск')));
110         $actionSet->push(new HiddenField('SubpageListFieldLink', '', $this->Link() . "?ctf[{$this->Name()}][SearchTitle]="));
111         
112         $actionSet->setForm($this->Form);
113         $actionSet->setID('group_actions');
114         
115         return $actionSet;
116     }
117 
118     function FieldHiddens() {
119         $hiddenSet = new HiddenFieldSet(
120             new HiddenField('SortList', 'SortList'),
121             new HiddenField('SubpageIDs', 'SubpageIDs'),
122             new HiddenField('DestID', 'DestID')
123         );
124         $hiddenSet->setForm($this->Form);
125         return $hiddenSet;
126     }
127 }
128 
129 class SubpageListField_Item extends TableListField_Item {
130     function Fields($xmlSafe = true) {
131         $data= parent::Fields($xmlSafe);
132         $items = $data->items;
133         foreach ($items as $item) {
134             if($item->Name=='Status') {
135                 if ($this->item->ExistsOnLive) {
136                     if ($this->item->IsModifiedOnStage) {
137                         $item->Value = _t('MediawebPage.StatusSaved (update)',$item->Value);
138                     } else {
139                         $item->Value = _t('MediawebPage.StatusPublished',$item->Value);
140                     }
141                 } else {
142                     $item->Value = _t('MediawebPage.StatusUnpublished',$item->Value);
143                 }
144             }
145         }
146         return new DataObjectSet($items);
147     }
148     function Dragable(){
149         return $this->parent->Dragable;
150     }
151     function Sortable(){
152         return $this->parent->Sortable;
153     }
154 }
155 
156 class SubPageListField_ItemRequest extends TableListField_ItemRequest {
157 
158     function delete() {
159         if ($this->ctf->Can('delete') !== true) {
160             return false;
161         }
162         // Объект должен быть наследником от SiteTree
163         if($this->dataObj()->doUnpublish()){
164             $this->dataObj()->delete();
165         }
166 
167     }
168 
169 }
170 
171 
[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