Index: trunk/tools/wp-photocommons/inc/class-photocommons.php |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | @author Krinkle <krinklemail@gmail.com> |
7 | 7 | |
8 | 8 | This program is free software; you can redistribute it and/or modify |
9 | | - it under the terms of the GNU General Public License, version 2, as |
| 9 | + it under the terms of the GNU General Public License, version 2, as |
10 | 10 | published by the Free Software Foundation. |
11 | 11 | |
12 | 12 | This program is distributed in the hope that it will be useful, |
— | — | @@ -30,12 +30,12 @@ |
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
34 | | - public function addShortcode($args) { |
| 34 | + public function addShortcode( $args ) { |
35 | 35 | $filename = $args['file']; |
36 | 36 | $width = $args['width']; |
37 | | - $align = empty($args['align']) ? 'alignright' : 'align' . $args['align']; |
38 | | - $thumb = $this->getThumbUrl($filename, $width); |
39 | | - $filepage = $this->getPageUrl($filename, $width); |
| 37 | + $align = empty( $args['align'] ) ? 'alignright' : 'align' . $args['align']; |
| 38 | + $thumb = $this->getThumbUrl( $filename, $width ); |
| 39 | + $filepage = $this->getPageUrl( $filename, $width ); |
40 | 40 | |
41 | 41 | return sprintf( |
42 | 42 | '<a href="%s" title="%s" class="wp-photocommons-thumb">' . |
— | — | @@ -46,12 +46,12 @@ |
47 | 47 | ); |
48 | 48 | } |
49 | 49 | |
50 | | - private function getThumbUrl($file, $width) { |
51 | | - return sprintf(self::FILEPATH_PATTERN, rawurlencode($file), rawurlencode($width)); |
| 50 | + private function getThumbUrl( $file, $width ) { |
| 51 | + return sprintf( self::FILEPATH_PATTERN, rawurlencode( $file ), rawurlencode( $width ) ); |
52 | 52 | } |
53 | 53 | |
54 | | - private function getPageUrl($file, $width) { |
55 | | - return sprintf(self::FILEPAGE_PATTERN, rawurlencode($file)); |
| 54 | + private function getPageUrl( $file, $width ) { |
| 55 | + return sprintf( self::FILEPAGE_PATTERN, rawurlencode( $file ) ); |
56 | 56 | } |
57 | 57 | |
58 | 58 | private function initAdmin() { |
— | — | @@ -61,34 +61,34 @@ |
62 | 62 | |
63 | 63 | private function enqueueScripts() { |
64 | 64 | // Register some of our own scripts |
65 | | - wp_register_script('admin', plugins_url() . self::PLUGIN_PATH . 'js/admin.js'); |
66 | | - wp_register_script('search', plugins_url() . self::PLUGIN_PATH . 'js/search.js'); |
67 | | - wp_register_script('suggestions', plugins_url() . self::PLUGIN_PATH . 'js/jquery.suggestions.js'); |
| 65 | + wp_register_script( 'admin', plugins_url() . self::PLUGIN_PATH . 'js/admin.js' ); |
| 66 | + wp_register_script( 'search', plugins_url() . self::PLUGIN_PATH . 'js/search.js' ); |
| 67 | + wp_register_script( 'suggestions', plugins_url() . self::PLUGIN_PATH . 'js/jquery.suggestions.js' ); |
68 | 68 | |
69 | 69 | // Enqueue external libraries |
70 | | - wp_enqueue_script('jquery'); |
71 | | - wp_enqueue_script('jquery-ui-core'); |
72 | | - wp_enqueue_script('jquery-ui-dialog'); |
| 70 | + wp_enqueue_script( 'jquery' ); |
| 71 | + wp_enqueue_script( 'jquery-ui-core' ); |
| 72 | + wp_enqueue_script( 'jquery-ui-dialog' ); |
73 | 73 | |
74 | 74 | // Enqueue our own scripts |
75 | | - wp_enqueue_script('admin'); |
76 | | - wp_enqueue_script('search'); |
77 | | - wp_enqueue_script('suggestions'); |
| 75 | + wp_enqueue_script( 'admin' ); |
| 76 | + wp_enqueue_script( 'search' ); |
| 77 | + wp_enqueue_script( 'suggestions' ); |
78 | 78 | } |
79 | 79 | |
80 | 80 | private function enqueueStyles() { |
81 | 81 | // Register our own styles and enqueue |
82 | | - wp_register_style('jquid_jquery_blog_stylesheet', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/redmond/jquery-ui.css'); |
83 | | - wp_register_style('suggestions', plugins_url() . self::PLUGIN_PATH . 'css/jquery.suggestions.css'); |
84 | | - wp_register_style('search', plugins_url() . self::PLUGIN_PATH . 'css/search.css'); |
| 82 | + wp_register_style( 'jquid_jquery_blog_stylesheet', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/redmond/jquery-ui.css' ); |
| 83 | + wp_register_style( 'suggestions', plugins_url() . self::PLUGIN_PATH . 'css/jquery.suggestions.css' ); |
| 84 | + wp_register_style( 'search', plugins_url() . self::PLUGIN_PATH . 'css/search.css' ); |
85 | 85 | |
86 | | - wp_enqueue_style('jquid_jquery_blog_stylesheet'); |
87 | | - wp_enqueue_style('suggestions'); |
88 | | - wp_enqueue_style('search'); |
| 86 | + wp_enqueue_style( 'jquid_jquery_blog_stylesheet' ); |
| 87 | + wp_enqueue_style( 'suggestions' ); |
| 88 | + wp_enqueue_style( 'search' ); |
89 | 89 | |
90 | 90 | } |
91 | 91 | |
92 | 92 | private function initFrontend() { |
93 | | - add_shortcode('photocommons', array($this, 'addShortcode')); |
| 93 | + add_shortcode( 'photocommons', array( $this, 'addShortcode' ) ); |
94 | 94 | } |
95 | 95 | } |
\ No newline at end of file |
Index: trunk/tools/wp-photocommons/index.php |
— | — | @@ -9,5 +9,5 @@ |
10 | 10 | License: GPL2 |
11 | 11 | */ |
12 | 12 | |
13 | | -require 'inc/class-photocommons.php'; |
14 | | -new Photocommons(); |
\ No newline at end of file |
| 13 | +require_once 'inc/class-photocommons.php'; |
| 14 | +new PhotoCommons(); |
\ No newline at end of file |