Source of file BlogTagSharedCategoriesExtension.php
Size: 1,179 Bytes - Last Modified: 2021-12-23T10:38:52+00:00
/var/www/docs.ssmods.com/process/src/code/model/BlogTagSharedCategoriesExtension.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 | <?php /** * extends BlogTags * */ class BlogTagSharedCategoriesExtension extends DataExtension { private static $summary_fields = array( 'Title' => 'Title', 'Blog.Title' => 'Belongs To' ); /** * overrules has_many method * to return ALL tags * * @return DataList */ public function UsedCategories() { return $this->owner->Parent()->UsedCategories(); } /**d * overrules has_many method * to return ALL categories * * @return DataList */ public function UsedTags() { return $this->owner->Parent()->UsedTags(); } /** * Update Fields * @return FieldList */ public function updateCMSFields(FieldList $fields) { $pleaseSelectOne = _t( 'BlogTagSharedCategoriesExtension.PLEASE_SELECT_ONE', '-- please select one --' ); $fields->insertAfter( DropDownField::create( 'BlogID', 'Show Under', array(0 => $pleaseSelectOne) + Blog::get()->map()->toArray() ), 'Title' ); } } |