r81513 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81512‎ | r81513 | r81514 >
Date:13:44, 4 February 2011
Author:krinkle
Status:deferred
Tags:
Comment:
Modified paths:
  • /trunk/tools/wp-photocommons/inc/class-photocommons.php (modified) (history)
  • /trunk/tools/wp-photocommons/index.php (modified) (history)

Diff [purge]

Index: trunk/tools/wp-photocommons/inc/class-photocommons.php
@@ -5,7 +5,7 @@
66 @author Krinkle <krinklemail@gmail.com>
77
88 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
1010 published by the Free Software Foundation.
1111
1212 This program is distributed in the hope that it will be useful,
@@ -30,12 +30,12 @@
3131 }
3232 }
3333
34 - public function addShortcode($args) {
 34+ public function addShortcode( $args ) {
3535 $filename = $args['file'];
3636 $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 );
4040
4141 return sprintf(
4242 '<a href="%s" title="%s" class="wp-photocommons-thumb">' .
@@ -46,12 +46,12 @@
4747 );
4848 }
4949
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 ) );
5252 }
5353
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 ) );
5656 }
5757
5858 private function initAdmin() {
@@ -61,34 +61,34 @@
6262
6363 private function enqueueScripts() {
6464 // 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' );
6868
6969 // 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' );
7373
7474 // 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' );
7878 }
7979
8080 private function enqueueStyles() {
8181 // 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' );
8585
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' );
8989
9090 }
9191
9292 private function initFrontend() {
93 - add_shortcode('photocommons', array($this, 'addShortcode'));
 93+ add_shortcode( 'photocommons', array( $this, 'addShortcode' ) );
9494 }
9595 }
\ No newline at end of file
Index: trunk/tools/wp-photocommons/index.php
@@ -9,5 +9,5 @@
1010 License: GPL2
1111 */
1212
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

Status & tagging log