Completed
Branch master (010acb)
by Gordon
05:58
created
code/AttachedGalleryExtension.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@
 block discarded – undo
8 8
 
9 9
 
10 10
   public function updateCMSFields(FieldList $fields) {
11
-    $galleryField =       new TreeDropdownField(
11
+    $galleryField = new TreeDropdownField(
12 12
       "AttachedGalleryID",
13 13
       _t('AttachedGalleryExtension.CHOOSE_A_GALLERY', "Choose another gallery to show on this page"),
14 14
       "GalleryPage"
15 15
       );
16 16
 
17
-    $fields->addFieldToTab( "Root."._t('AttachedGalleryExtension.ATTACHED_GALLERY', 'Attached Gallery'), $galleryField );
17
+    $fields->addFieldToTab("Root."._t('AttachedGalleryExtension.ATTACHED_GALLERY', 'Attached Gallery'), $galleryField);
18 18
   }
19 19
 
20 20
   /*
Please login to merge, or discard this patch.
code/ImageMetaDataExtension.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
   );
15 15
 
16 16
 
17
-  static $defaults = array ('Lat' =>0, 'Lon' => 0, 'Zoom' => 4);
17
+  static $defaults = array('Lat' =>0, 'Lon' => 0, 'Zoom' => 4);
18 18
 
19 19
 
20 20
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
   	// when the image is first saved, the file will still be a temp file
27 27
   	if (file_exists($filename)) {
28 28
   		try {
29
-     		$exif = exif_read_data($filename,0,true);
29
+     		$exif = exif_read_data($filename, 0, true);
30 30
       
31 31
 		  	$aperture = $exif['COMPUTED']['ApertureFNumber'];
32 32
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         $shutterspeed = '';
39 39
         if (isset($exif['ExposureTime'])) {
40 40
           $shutterspeed = $exif['ExposureTime'];
41
-        } else{
41
+        } else {
42 42
           $shutterspeed = $exif['EXIF']['ExposureTime'];
43 43
         }
44 44
 		  	
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
           $this->owner->TakenAt = $exif['EXIF']['DateTimeOriginal'];
51 51
         }
52 52
 
53
-        $iso='';
53
+        $iso = '';
54 54
         if (isset($exif['ISOSpeedRatings'])) {
55 55
           $iso = $exif['ISOSpeedRatings'];
56 56
         } else {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
           $seconds = $parts[0] / $parts[1];
77 77
 
78 78
           error_log('LATITUDE: DMS='.$degrees.','.$minutes.','.$seconds);
79
-		  		$latitude = $degrees+$minutes/60+$seconds/3600;
79
+		  		$latitude = $degrees+$minutes / 60+$seconds / 3600;
80 80
           error_log('LAT:'.$latitude);
81 81
 
82 82
           error_log('LATITUDE:'.$latitude);
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
           $parts = explode('/', $seconds);
93 93
           $seconds = $parts[0] / $parts[1];
94 94
 
95
-		  		$longitude =  $degrees+$minutes/60+$seconds/3600;
95
+		  		$longitude = $degrees+$minutes / 60+$seconds / 3600;
96 96
 		  		$this->owner->Lat = $latitude;
97 97
 		  		$this->owner->Lon = $longitude;
98 98
 		  	} else {
Please login to merge, or discard this patch.
code/GalleryFolder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 	public function getCMSFields() {
11 11
 		$fields = parent::getCMSFields();
12
-		$fields->renameField('Content','Brief Summary');
12
+		$fields->renameField('Content', 'Brief Summary');
13 13
 		return $fields;
14 14
 	}
15 15
 
Please login to merge, or discard this patch.
code/GalleryPage.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
   		//$gbu->setConfig('fileRelationName','Image');
25 25
   		$gbu->setConfig('folderName', 'galleries/'.$this->ID);
26 26
   		//$gbm->setConfig('editableFields', array('Title'));
27
-  		$gbm->setConfig('fieldsNameBlacklist', array('Lat','Lon','ZoomLevel'));
27
+  		$gbm->setConfig('fieldsNameBlacklist', array('Lat', 'Lon', 'ZoomLevel'));
28 28
   		$gridfield = new GridField("GalleryImages", $galleryimagesi18n, $this->GalleryImages()->sort("SortOrder"), $gridFieldConfig);
29 29
   		$fields->addFieldToTab('Root.'.$galleryimagesi18n, $gridfield);
30 30
 
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
     }
42 42
     $map = $photosWithLocation->getRenderableMap();
43 43
     // $map->setDelayLoadMapFunction( true );
44
-    $map->setZoom( 10 );
45
-    $map->setAdditionalCSSClasses( 'fullWidthMap' );
46
-    $map->setShowInlineMapDivStyle( true );
44
+    $map->setZoom(10);
45
+    $map->setAdditionalCSSClasses('fullWidthMap');
46
+    $map->setShowInlineMapDivStyle(true);
47 47
     $map->setClusterer(true);
48 48
     /*
49 49
     foreach($this->MapLayers() as $layer) {
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 
54 54
 
55 55
     //$map->addKML('http://assets.tripodtravel.co.nz/cycling/meuang-nont-to-bang-sue-loop.kml');
56
-    $map->setSize('100%','600px');
56
+    $map->setSize('100%', '600px');
57 57
     return $map;
58 58
   }
59 59
 
60 60
 }
61 61
 class GalleryPage_Controller extends Page_Controller {
62 62
 	
63
-	public static $allowed_actions = array (
63
+	public static $allowed_actions = array(
64 64
 	);
65 65
 	
66 66
 	public function GetGalleryImages() {
Please login to merge, or discard this patch.
code/GalleryImageShortCodeHandler.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
 class GalleryImageShortCodeHandler {
4 4
 
5 5
     // taken from http://www.ssbits.com/tutorials/2010/2-4-using-short-codes-to-embed-a-youtube-video/ and adapted for SS3
6
-    public static function parse_gallery_image( $arguments, $caption = null, $parser = null ) {
6
+    public static function parse_gallery_image($arguments, $caption = null, $parser = null) {
7 7
 //  public static function link_shortcode_handler($arguments, $content = null, $parser = null) {
8 8
 
9 9
         // first things first, if we dont have a video ID, then we don't need to
10 10
         // go any further
11
-        if ( empty( $arguments['id'] ) ) {
11
+        if (empty($arguments['id'])) {
12 12
             return;
13 13
         }
14 14
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         error_log('ID:'.$arguments['id']);
19 19
 
20 20
 
21
-        $galleryImage = DataObject::get_by_id('GalleryImage',$arguments['id']);
21
+        $galleryImage = DataObject::get_by_id('GalleryImage', $arguments['id']);
22 22
         error_log('GALLERY IMAGE:'.$galleryImage);
23 23
 
24 24
 
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
         $customise['Title'] = $galleryImage->Title;
35 35
    
36 36
         //overide the defaults with the arguments supplied
37
-        $customise = array_merge( $customise, $arguments );
37
+        $customise = array_merge($customise, $arguments);
38 38
 
39 39
         //get our YouTube template
40
-        $template = new SSViewer( 'ShortCodeGalleryImage' );
40
+        $template = new SSViewer('ShortCodeGalleryImage');
41 41
 
42 42
         //return the customised template
43
-        return $template->process( new ArrayData( $customise ) );
43
+        return $template->process(new ArrayData($customise));
44 44
 
45 45
     }
46 46
 }
47 47
\ No newline at end of file
Please login to merge, or discard this patch.
code/GalleryImage.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
  // tidy up the CMS by not showing these fields
18 18
   public function getCMSFields() {
19 19
  		$fields = parent::getCMSFields();
20
-		$fields->removeFieldFromTab("Root.Main","GalleryPageID");
21
-    $fields->removeFieldFromTab("Root.Main","SortOrder");
20
+		$fields->removeFieldFromTab("Root.Main", "GalleryPageID");
21
+    $fields->removeFieldFromTab("Root.Main", "SortOrder");
22 22
     $fields->renameField('Title', _t('GalleryImage.TITLE', 'Title'));
23 23
     $fields->renameField('Image', _t('GalleryImage.IMAGE', 'Image'));
24 24
 
@@ -72,18 +72,18 @@  discard block
 block discarded – undo
72 72
   }
73 73
 
74 74
 
75
-  function HorizontalMargin( $intendedWidth ) {
75
+  function HorizontalMargin($intendedWidth) {
76 76
     //FIXME - is there a way to avoid a database call here?
77
-    $image100 = $this->Image()->SetRatioSize(100,100);
78
-    $result = ( $intendedWidth-$image100->Width )/2;
77
+    $image100 = $this->Image()->SetRatioSize(100, 100);
78
+    $result = ($intendedWidth-$image100->Width) / 2;
79 79
     error_log('HORIZONTAL MARGIN:'.$result);
80 80
     return $result;
81 81
   }
82 82
 
83
-  function VerticalMargin( $intendedHeight ) {
83
+  function VerticalMargin($intendedHeight) {
84 84
     //FIXME - is there a way to avoid a database call here?
85
-    $image100 = $this->Image()->SetRatioSize(100,100);
86
-    return ( $intendedHeight-$image100->Height )/2;
85
+    $image100 = $this->Image()->SetRatioSize(100, 100);
86
+    return ($intendedHeight-$image100->Height) / 2;
87 87
   }
88 88
  
89 89
 }
90 90
\ No newline at end of file
Please login to merge, or discard this patch.
_config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,2 +1,2 @@
 block discarded – undo
1 1
 <?php
2
-ShortcodeParser::get('default')->register('GalleryImage',array('GalleryImageShortCodeHandler','parse_gallery_image'));
2
+ShortcodeParser::get('default')->register('GalleryImage', array('GalleryImageShortCodeHandler', 'parse_gallery_image'));
Please login to merge, or discard this patch.