@@ -4,15 +4,15 @@ discard block |
||
4 | 4 | */ |
5 | 5 | class SlideFolder extends Page { |
6 | 6 | |
7 | - static $default_child = 'SlidePage'; |
|
7 | + static $default_child = 'SlidePage'; |
|
8 | 8 | |
9 | - static $allowed_children = array('SlidePage'); |
|
9 | + static $allowed_children = array('SlidePage'); |
|
10 | 10 | |
11 | - // Hide terms from the LHS menu |
|
12 | - static $defaults = array( |
|
11 | + // Hide terms from the LHS menu |
|
12 | + static $defaults = array( |
|
13 | 13 | 'ShowInMenus' => 0, |
14 | 14 | //'ShowInSearch' => 0 |
15 | - ); |
|
15 | + ); |
|
16 | 16 | |
17 | 17 | |
18 | 18 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | |
22 | 22 | |
23 | - function getCMSFields() { |
|
23 | + function getCMSFields() { |
|
24 | 24 | $fields = parent::getCMSFields(); |
25 | 25 | |
26 | 26 | /* |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | |
43 | 43 | return $fields; |
44 | - } |
|
44 | + } |
|
45 | 45 | |
46 | 46 | |
47 | 47 | } |
@@ -16,14 +16,14 @@ discard block |
||
16 | 16 | static $allowed_children = 'none'; |
17 | 17 | |
18 | 18 | private static $defaults = array ( |
19 | - 'ShowInMenus' => false, |
|
20 | - 'ShowInSearch' => false |
|
19 | + 'ShowInMenus' => false, |
|
20 | + 'ShowInSearch' => false |
|
21 | 21 | ); |
22 | 22 | |
23 | 23 | |
24 | 24 | public function getThumbnail2() { |
25 | - return $this->InternalPage()->getPortletImage()->CMSThumbnail()->Tag; |
|
26 | - } |
|
25 | + return $this->InternalPage()->getPortletImage()->CMSThumbnail()->Tag; |
|
26 | + } |
|
27 | 27 | |
28 | 28 | |
29 | 29 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | |
55 | - $fields->addFieldToTab('Root.Main', |
|
55 | + $fields->addFieldToTab('Root.Main', |
|
56 | 56 | new TreeDropdownField( "InternalPageID", _t('SlidePage.CHOOSE_INTERNAL_LINK', 'Select a page on the website to link to'), "SiteTree" )); |
57 | 57 | |
58 | 58 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | static $allowed_children = 'none'; |
17 | 17 | |
18 | - private static $defaults = array ( |
|
18 | + private static $defaults = array( |
|
19 | 19 | 'ShowInMenus' => false, |
20 | 20 | 'ShowInSearch' => false |
21 | 21 | ); |
@@ -42,25 +42,25 @@ discard block |
||
42 | 42 | $photo_field = null; |
43 | 43 | $internal_page = $this->InternalPage(); |
44 | 44 | |
45 | - if($internal_page instanceof RenderableAsPortlet) { |
|
45 | + if ($internal_page instanceof RenderableAsPortlet) { |
|
46 | 46 | error_log('Class implements renderable as a portlet'); |
47 | 47 | $existing_photo = $this->InternalPage()->getPortletImage(); |
48 | 48 | } else { |
49 | 49 | // check parents recursively |
50 | 50 | $parents = class_parents($internal_page); |
51 | - error_log(print_r($parents,1)); |
|
51 | + error_log(print_r($parents, 1)); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
55 | 55 | $fields->addFieldToTab('Root.Main', |
56 | - new TreeDropdownField( "InternalPageID", _t('SlidePage.CHOOSE_INTERNAL_LINK', 'Select a page on the website to link to'), "SiteTree" )); |
|
56 | + new TreeDropdownField("InternalPageID", _t('SlidePage.CHOOSE_INTERNAL_LINK', 'Select a page on the website to link to'), "SiteTree")); |
|
57 | 57 | |
58 | 58 | |
59 | 59 | $composite_photoField = null; |
60 | 60 | |
61 | 61 | if (!$existing_photo) { |
62 | 62 | $photo_field = new UploadField('Photo', _t('SlidePage.PHOTO', 'Photo')); |
63 | - $photo_info = new LiteralField('PhotoInfo', _t('Slide.PHOTO_INFO','If the page you choose to link to has an image already it will appear here'), 'Photo'); |
|
63 | + $photo_info = new LiteralField('PhotoInfo', _t('Slide.PHOTO_INFO', 'If the page you choose to link to has an image already it will appear here'), 'Photo'); |
|
64 | 64 | $composite_photoField = CompositeField::create($photo_field, $photo_info); |
65 | 65 | |
66 | 66 | } else { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $fields->addFieldToTab("Root.Main", new TextField('Caption', _t('SlidePage.CAPTION', 'Caption'))); |
81 | 81 | $fields->renameField('Title', 'Slide Title'); |
82 | 82 | |
83 | - $fields->removeFieldFromTab("Root.Main","Content"); |
|
83 | + $fields->removeFieldFromTab("Root.Main", "Content"); |
|
84 | 84 | |
85 | 85 | return $fields; |
86 | 86 | } |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | $result = '#"'; |
116 | 116 | |
117 | 117 | if ($this->InternalPageID) { |
118 | - $targetPage = DataObject::get_by_id( 'Page', $this->InternalPageID ); |
|
119 | - if ( $targetPage ) { |
|
118 | + $targetPage = DataObject::get_by_id('Page', $this->InternalPageID); |
|
119 | + if ($targetPage) { |
|
120 | 120 | $result = $targetPage->Link(); |
121 | 121 | } else { |
122 | 122 | $result = '#'; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function newpageselected(SS_HTTPRequest $request) { |
140 | 140 | error_log('**** NEW PAGE SELECTED ****'); |
141 | - $sitetree_id = $request->param( 'ID' ); |
|
141 | + $sitetree_id = $request->param('ID'); |
|
142 | 142 | $page = SiteTree::get_by_id($sitetree_id); |
143 | 143 | $result = array(); |
144 | 144 | if ($page) { |