diff --git a/admin/blank.php b/admin/blank.php index a7a517753..b67f890bd 100644 --- a/admin/blank.php +++ b/admin/blank.php @@ -2,4 +2,4 @@ - \ No newline at end of file + diff --git a/admin/block_areas.php b/admin/block_areas.php index a370b4f22..ba640d622 100644 --- a/admin/block_areas.php +++ b/admin/block_areas.php @@ -2,7 +2,7 @@ + id): ?>selected="selected">name; ?> @@ -12,7 +12,7 @@

- +

title; ?>type); ?>

diff --git a/admin/comment.php b/admin/comment.php index 4862a64c2..8af86523f 100644 --- a/admin/comment.php +++ b/admin/comment.php @@ -3,4 +3,4 @@ out(); ?>
- \ No newline at end of file + diff --git a/admin/comments_items.php b/admin/comments_items.php index ee0eb197a..c8bd29ff9 100644 --- a/admin/comments_items.php +++ b/admin/comments_items.php @@ -22,7 +22,7 @@ foreach($comment->menu as $act_id => $action): $url = str_replace('__commentid__', $comment->id, $action['url']); ?> -
  • +
  • admin_comment_actions($comment); ?> diff --git a/admin/db_profiling.php b/admin/db_profiling.php index 69b0c5cc9..b371f2e43 100644 --- a/admin/db_profiling.php +++ b/admin/db_profiling.php @@ -57,4 +57,4 @@
    \ No newline at end of file +?> diff --git a/admin/formcontrols/admincontrol_submit.php b/admin/formcontrols/admincontrol_submit.php index 43c10974d..b654d76b8 100644 --- a/admin/formcontrols/admincontrol_submit.php +++ b/admin/formcontrols/admincontrol_submit.php @@ -1,5 +1,5 @@
    >> - +

    diff --git a/admin/formcontrols/formcontrol_button.php b/admin/formcontrols/formcontrol_button.php index 47f1209f4..436ccc140 100644 --- a/admin/formcontrols/formcontrol_button.php +++ b/admin/formcontrols/formcontrol_button.php @@ -1,11 +1,11 @@ ->disabled tabindex="" name="" value="" - +>disabled tabindex="" name="" value="" + > - +

    diff --git a/admin/formcontrols/formcontrol_checkbox.php b/admin/formcontrols/formcontrol_checkbox.php index 56af1fad9..0caf46f95 100644 --- a/admin/formcontrols/formcontrol_checkbox.php +++ b/admin/formcontrols/formcontrol_checkbox.php @@ -3,4 +3,4 @@ > errors_out('
  • %s
  • ', ''); ?> - \ No newline at end of file + diff --git a/admin/formcontrols/formcontrol_form.php b/admin/formcontrols/formcontrol_form.php index 1f8d5a2b6..f57a503e7 100644 --- a/admin/formcontrols/formcontrol_form.php +++ b/admin/formcontrols/formcontrol_form.php @@ -7,7 +7,7 @@ class="" accept-charset="" > - +
    diff --git a/admin/formcontrols/formcontrol_password.php b/admin/formcontrols/formcontrol_password.php index f9d05a872..862c1c227 100644 --- a/admin/formcontrols/formcontrol_password.php +++ b/admin/formcontrols/formcontrol_password.php @@ -1,6 +1,6 @@ > - +

    diff --git a/admin/formcontrols/formcontrol_radio.php b/admin/formcontrols/formcontrol_radio.php index 4381ccb25..7b51cc70a 100644 --- a/admin/formcontrols/formcontrol_radio.php +++ b/admin/formcontrols/formcontrol_radio.php @@ -2,7 +2,7 @@ $text) : ?> > - +

    diff --git a/admin/formcontrols/formcontrol_select.php b/admin/formcontrols/formcontrol_select.php index 3fd09eaf0..de15da0da 100644 --- a/admin/formcontrols/formcontrol_select.php +++ b/admin/formcontrols/formcontrol_select.php @@ -13,7 +13,7 @@ - +

    diff --git a/admin/formcontrols/formcontrol_silos.php b/admin/formcontrols/formcontrol_silos.php index 3361ff4df..1984b8cbf 100644 --- a/admin/formcontrols/formcontrol_silos.php +++ b/admin/formcontrols/formcontrol_silos.php @@ -1,6 +1,6 @@
    $silodir): ?> diff --git a/admin/formcontrols/formcontrol_submit.php b/admin/formcontrols/formcontrol_submit.php index 34d078a68..66418efc2 100644 --- a/admin/formcontrols/formcontrol_submit.php +++ b/admin/formcontrols/formcontrol_submit.php @@ -1,5 +1,5 @@ ->disabled tabindex="" name="" value=""> - +>disabled tabindex="" name="" value=""> +

    diff --git a/admin/formcontrols/formcontrol_textmulti.php b/admin/formcontrols/formcontrol_textmulti.php index 0e7da7a12..bd3e4c35b 100644 --- a/admin/formcontrols/formcontrol_textmulti.php +++ b/admin/formcontrols/formcontrol_textmulti.php @@ -1,10 +1,10 @@ > - +

    caption; ?>

    " class=""> - \ No newline at end of file + diff --git a/admin/formcontrols/optionscontrol_checkbox.php b/admin/formcontrols/optionscontrol_checkbox.php index d1c7fabe4..02271442e 100644 --- a/admin/formcontrols/optionscontrol_checkbox.php +++ b/admin/formcontrols/optionscontrol_checkbox.php @@ -1,11 +1,11 @@ > > - + - +

    diff --git a/admin/formcontrols/optionscontrol_select.php b/admin/formcontrols/optionscontrol_select.php index 05fa4ec76..da136cf78 100644 --- a/admin/formcontrols/optionscontrol_select.php +++ b/admin/formcontrols/optionscontrol_select.php @@ -13,10 +13,10 @@ - + - +

    diff --git a/admin/formcontrols/optionscontrol_submit.php b/admin/formcontrols/optionscontrol_submit.php index ece8ddf3b..89ee69971 100644 --- a/admin/formcontrols/optionscontrol_submit.php +++ b/admin/formcontrols/optionscontrol_submit.php @@ -1,6 +1,6 @@ > > - +

    - \ No newline at end of file + diff --git a/admin/formcontrols/optionscontrol_text.php b/admin/formcontrols/optionscontrol_text.php index ddb130ffd..6a8591b33 100644 --- a/admin/formcontrols/optionscontrol_text.php +++ b/admin/formcontrols/optionscontrol_text.php @@ -1,10 +1,10 @@ > > - + - +

    diff --git a/admin/formcontrols/optionscontrol_textarea.php b/admin/formcontrols/optionscontrol_textarea.php index 6fa227dd0..81ee610f8 100644 --- a/admin/formcontrols/optionscontrol_textarea.php +++ b/admin/formcontrols/optionscontrol_textarea.php @@ -2,7 +2,7 @@ - +

    diff --git a/admin/group.php b/admin/group.php index 122672d57..23b05766f 100644 --- a/admin/group.php +++ b/admin/group.php @@ -4,7 +4,7 @@ diff --git a/admin/header.php b/admin/header.php index a269c276a..7c0aae646 100644 --- a/admin/header.php +++ b/admin/header.php @@ -43,13 +43,13 @@ - +
    display('logs_items'); ?> diff --git a/admin/themes.php b/admin/themes.php index b82a2c8ab..fcfab29be 100644 --- a/admin/themes.php +++ b/admin/themes.php @@ -43,7 +43,7 @@ ob_start(); Plugins::act( 'theme_ui', $active_theme ); $output = ob_get_clean(); - if(trim($output) != '') : + if (trim($output) != '') : ?>
    @@ -166,7 +166,7 @@ function change_scope(){ foreach ( $all_themes as $inactive_theme ): if ( $inactive_theme['path'] != $active_theme_dir ) : ?> -
    "> +
    ">
    name; ?> version; ?>

      - +
    • @@ -209,7 +209,7 @@ function change_scope(){ ?>
    - +
    diff --git a/classes/acl.php b/classes/acl.php index d65401ede..3a68f7dcf 100644 --- a/classes/acl.php +++ b/classes/acl.php @@ -400,7 +400,7 @@ public static function get_user_token_access( $user, $token ) $default_groups = array(); $default_groups = Plugins::filter( 'user_default_groups', $default_groups, $user_id ); $default_groups = array_filter( array_map( 'intval', $default_groups ) ); - switch( count( $default_groups ) ) { + switch ( count( $default_groups ) ) { case 0: // do nothing break; case 1: // single argument diff --git a/classes/adminhandler.php b/classes/adminhandler.php index eb376568a..f95a8afbb 100644 --- a/classes/adminhandler.php +++ b/classes/adminhandler.php @@ -2032,7 +2032,7 @@ private function fetch_posts( $params = array() ) } $to_update = Posts::get( array( 'where' => $ids, 'nolimit' => 1 ) ); foreach ( $to_update as $post ) { - switch( $change ) { + switch ( $change ) { case 'delete': if ( ACL::access_check( $post->get_access(), 'delete' ) ) { $post->delete(); @@ -2296,7 +2296,7 @@ public function ajax_update_entries($handler_vars) $ids[] = (int) substr($id, 1); } } - if(count($ids) == 0) { + if (count($ids) == 0) { $posts = new Posts(); } else { @@ -3357,7 +3357,7 @@ private function access_allowed( $page, $type ) $require_any = array(); $result = false; - switch( $page ) { + switch ( $page ) { case 'comment': case 'comments': case 'ajax_comments': @@ -3734,7 +3734,7 @@ public function ajax_save_areas( $handler_vars ) $msg = ''; - if(isset($_POST['area_blocks'])) { + if (isset($_POST['area_blocks'])) { $area_blocks = $_POST['area_blocks']; DB::query('DELETE FROM {blocks_areas} WHERE scope_id = :scope_id', array( 'scope_id' => $scope ) ); diff --git a/classes/ajaxresponse.php b/classes/ajaxresponse.php index 0f4d8c0aa..eb612d9ed 100644 --- a/classes/ajaxresponse.php +++ b/classes/ajaxresponse.php @@ -26,7 +26,7 @@ function __construct($response_code = 200, $message = null, $data = null) { public function __set($var, $val) { - switch( $var ) { + switch ( $var ) { case 'response_code': case 'message': case 'data': @@ -38,7 +38,7 @@ public function __set($var, $val) public function html($name, $value) { - if(empty($this->html)) { + if (empty($this->html)) { $this->html = array( $name => $value ); } else { @@ -58,7 +58,7 @@ public function out() if ($this->callback != null) { $ret_array['habari_callback'] = $this->callback; } - if(!empty($this->html)) { + if (!empty($this->html)) { $ret_array['html'] = $this->html; } @@ -68,4 +68,4 @@ public function out() } -?> \ No newline at end of file +?> diff --git a/classes/atomhandler.php b/classes/atomhandler.php index 4b48cc9e0..5b98eb6ae 100644 --- a/classes/atomhandler.php +++ b/classes/atomhandler.php @@ -261,7 +261,7 @@ public function add_comments($xml, $comments) public function act_collection() { Utils::check_request_method( array( 'GET', 'HEAD', 'POST' ) ); - switch( $_SERVER['REQUEST_METHOD'] ) { + switch ( $_SERVER['REQUEST_METHOD'] ) { case 'GET': case 'HEAD': $this->get_collection(); @@ -279,7 +279,7 @@ public function act_collection() public function act_entry() { Utils::check_request_method( array( 'GET', 'HEAD', 'POST', 'PUT', 'DELETE' ) ); - switch( $_SERVER['REQUEST_METHOD'] ) { + switch ( $_SERVER['REQUEST_METHOD'] ) { case 'GET': case 'HEAD': case 'POST': diff --git a/classes/bitmask.php b/classes/bitmask.php index 049cdd18a..e70332f22 100644 --- a/classes/bitmask.php +++ b/classes/bitmask.php @@ -60,7 +60,7 @@ public function __construct( $flags = null, $value = null ) */ public function __set( $bit, $on ) { - switch( $bit ) { + switch ( $bit ) { case 'full': if ( ! is_bool( $on ) ) { throw new InvalidArgumentException( _t( 'Bitmask full toggle must be boolean' ) ); diff --git a/classes/block.php b/classes/block.php index c941487dd..7cb5c4b90 100644 --- a/classes/block.php +++ b/classes/block.php @@ -124,10 +124,10 @@ public function content_type() 'block.' . $this->type, 'block', ); - if(isset($this->title)) { + if (isset($this->title)) { array_unshift($types, 'block.' . $this->type . '.' . Utils::slugify($this->title)); } - if(isset($this->_area)) { + if (isset($this->_area)) { $areas = array(); foreach($types as $type) { $areas[] = $this->_area . '.' . $type; diff --git a/classes/comments.php b/classes/comments.php index 67f706fe6..6ee7c3151 100644 --- a/classes/comments.php +++ b/classes/comments.php @@ -558,7 +558,7 @@ private function sort_comments() foreach ( $this as $c ) { // first, divvy up approved and unapproved comments - switch( $c->status ) { + switch ( $c->status ) { case Comment::STATUS_APPROVED: $this->sort['approved'][] = $c; $this->sort['moderated'][] = $c; diff --git a/classes/cronjob.php b/classes/cronjob.php index 7f0eb1ace..0fc8d22d5 100644 --- a/classes/cronjob.php +++ b/classes/cronjob.php @@ -144,7 +144,7 @@ public function execute() */ public function __set( $name, $value ) { - switch( $name ) { + switch ( $name ) { case 'callback': if ( is_array($value) || is_object($value) ) { $value = serialize( $value ); diff --git a/classes/crontab.php b/classes/crontab.php index f89783185..eee42b704 100644 --- a/classes/crontab.php +++ b/classes/crontab.php @@ -44,7 +44,7 @@ static function run_cron( $async = false ) } else { usleep(5000); - if( Options::get('cron_running') != $run_time ) { + if ( Options::get('cron_running') != $run_time ) { return; } @@ -83,7 +83,7 @@ function act_poll_cron() } // allow script to run for 10 minutes. This only works on host with safe mode DISABLED - if( !ini_get( 'safe_mode' ) ) { + if ( !ini_get( 'safe_mode' ) ) { set_time_limit( 600 ); } $time = HabariDateTime::date_create(); diff --git a/classes/curlrequestprocessor.php b/classes/curlrequestprocessor.php index cc4b1243c..95b226776 100644 --- a/classes/curlrequestprocessor.php +++ b/classes/curlrequestprocessor.php @@ -83,7 +83,7 @@ public function execute( $method, $url, $headers, $body, $timeout ) $success = curl_exec( $ch ); - if( $success ) { + if ( $success ) { rewind( $fh ); $body = stream_get_contents( $fh ); } diff --git a/classes/eventlog.php b/classes/eventlog.php index 6ef51b994..9c878dbf9 100644 --- a/classes/eventlog.php +++ b/classes/eventlog.php @@ -27,7 +27,7 @@ class EventLog extends ArrayObject */ public function __get( $name ) { - switch( $name ) { + switch ( $name ) { case 'onelogentry': return ( count( $this ) == 1 ); } @@ -60,8 +60,8 @@ public static function register_type( $type = 'default', $module = null ) public static function unregister_type( $type = 'default', $module = null ) { $id = DB::get_value( "SELECT id FROM {log_types} WHERE module = ? and type = ?", array( self::get_module( $module ), $type ) ); - if( $id ) { - if( !DB::exists( '{log}', array( 'type_id' => $id ) ) ) { + if ( $id ) { + if ( !DB::exists( '{log}', array( 'type_id' => $id ) ) ) { DB::delete( '{log_types}', array( 'id' => $id ) ); } } @@ -130,7 +130,7 @@ public static function get( $paramarray = array() ) $paramarray = Utils::get_params( $paramarray ); $select_fields = LogEntry::default_fields(); - if(!isset($paramarray['return_data'])) { + if (!isset($paramarray['return_data'])) { unset($select_fields['data']); } foreach ( $select_fields as $field => $value ) { @@ -232,7 +232,7 @@ public static function get( $paramarray = array() ) if ( isset( $paramset['criteria'] ) ) { preg_match_all( '/(?<=")(\w[^"]*)(?=")|([:\w]+)/u', $paramset['criteria'], $matches ); foreach ( $matches[0] as $word ) { - if(preg_match('%^id:(\d+)$%i', $word, $special_crit)) { + if (preg_match('%^id:(\d+)$%i', $word, $special_crit)) { $where[] .= '(id = ?)'; $params[] = $special_crit[1]; } @@ -309,7 +309,7 @@ public static function get( $paramarray = array() ) } } // If the month counts are requested, replace the select clause - if( isset( $paramset['month_cts'] ) ) { + if ( isset( $paramset['month_cts'] ) ) { // @todo shouldn't this hand back to habari to convert to DateTime so it reflects the right timezone? $select = 'MONTH(FROM_UNIXTIME(timestamp)) AS month, YEAR(FROM_UNIXTIME(timestamp)) AS year, COUNT(*) AS ct'; $groupby = 'year, month'; diff --git a/classes/feedbackhandler.php b/classes/feedbackhandler.php index 834f055e1..9e8ffcbbb 100644 --- a/classes/feedbackhandler.php +++ b/classes/feedbackhandler.php @@ -167,7 +167,7 @@ function add_comment( $post, $name = null, $email = null, $url = null, $content } // Users need to have permission to add comments - if(!$user->can('comment')) { + if (!$user->can('comment')) { Session::error( _t( 'You do not have permission to create comments.' ) ); Utils::redirect( $post->permalink ); } diff --git a/classes/format.php b/classes/format.php index 695bb32e1..566ada1b1 100644 --- a/classes/format.php +++ b/classes/format.php @@ -401,7 +401,7 @@ public static function summarize( $text, $count = 100, $max_paragraphs = 1 ) $end['attrs'] = null; $end['value'] = null; $summary[] = $end; - } while( ($bail || $end['name'] != $token['name']) && count($stack) > 0 ); + } while ( ($bail || $end['name'] != $token['name']) && count($stack) > 0 ); if ( count($stack) == 0 ) { $para++; } diff --git a/classes/formstorage.php b/classes/formstorage.php index 4fd16f82a..f1f34e19f 100644 --- a/classes/formstorage.php +++ b/classes/formstorage.php @@ -26,4 +26,4 @@ function field_save($key, $value); function field_load($key); } -?> \ No newline at end of file +?> diff --git a/classes/formui.php b/classes/formui.php index ef85916c9..95c74d256 100644 --- a/classes/formui.php +++ b/classes/formui.php @@ -1592,7 +1592,7 @@ public function pre_out() return false; }, remove: function(e){ - if(confirm("' . _t('Remove this item?') . '")) { + if (confirm("' . _t('Remove this item?') . '")) { $(e).parent().prev().remove(); $(e).parent().remove(); } diff --git a/classes/hiengine.php b/classes/hiengine.php index 51d7e9657..809bc21cf 100644 --- a/classes/hiengine.php +++ b/classes/hiengine.php @@ -233,11 +233,11 @@ function hi_command($matches) case 'url': return ''; case 'session': - switch($cmd_matches[2]) { + switch ($cmd_matches[2]) { case 'messages': - return ''; + return ''; case 'errors': - return ''; + return ''; } // this is an internal match case 'context': @@ -262,7 +262,7 @@ function hi_var($matches) $params = array(); $returnval = false; - if(preg_match_all('/(?<=\s)(?P[@a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff.]*)\s*=\s*(?P(?P["\']).+?\3|[^"\'\s]+)/i', $cmd, $foundparams, PREG_SET_ORDER)) { + if (preg_match_all('/(?<=\s)(?P[@a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff.]*)\s*=\s*(?P(?P["\']).+?\3|[^"\'\s]+)/i', $cmd, $foundparams, PREG_SET_ORDER)) { foreach($foundparams as $p) { $params[$p['name']] = trim($p['value'], $p['quot']); } @@ -291,7 +291,7 @@ function hi_var($matches) $returnval = '$'. $cmdmatch; } } - if($returnval !== false) { + if ($returnval !== false) { $returnval = $this->apply_parameters($returnval, $params); return ''; } @@ -315,10 +315,10 @@ function hi_var($matches) function apply_parameters($returnval, $params) { foreach($params as $k => $v) { - if($k[0] == '@') { + if ($k[0] == '@') { $returnval = '$theme->' . substr($cmd,1) . '(' . $returnval . ", '" . $v . "')"; } - switch($k) { + switch ($k) { case 'dateformat': $returnval = "call_user_func(array(" . $returnval . ", 'format'), '" . addslashes($v) . "')"; break; @@ -348,7 +348,7 @@ function hi_loop($matches) /** * Replace variables in the hiengine syntax with PHP varaibles - * @param array $matches The match array found in hi_if() + * @param array $matches The match array found in hi_if () * @returns string A PHP variable string to use as the replacement */ function var_replace($matches) @@ -393,7 +393,7 @@ function hi_to_var($hisyntax) /** * Creates a table of static strings in hiengine expressions to be replaced in later - * @param array $matches The match found in hi_if() + * @param array $matches The match found in hi_if () * @returns string An uncommon string index for the stored static string. */ function string_stack($matches) @@ -409,7 +409,7 @@ function string_stack($matches) * @param array $matches The match array found in HiEngineParser::process() * @return string The PHP replacement for the template tag */ - function hi_if($matches) + function hi_if ($matches) { list($void, $eval, $context) = $matches; @@ -420,7 +420,7 @@ function hi_if($matches) $context = preg_replace('/\{hi:\?else\?\}/i', '', $context); - $output = ''; + $output = ''; $output .= $this->process($context); $output .= ''; return $output; diff --git a/classes/iscontent.php b/classes/iscontent.php index c6c6885d7..58938d3ba 100644 --- a/classes/iscontent.php +++ b/classes/iscontent.php @@ -23,4 +23,4 @@ function content_type(); } -?> \ No newline at end of file +?> diff --git a/classes/media.php b/classes/media.php index a5b51ce73..56be7851e 100644 --- a/classes/media.php +++ b/classes/media.php @@ -26,12 +26,12 @@ class Media */ public static function dir($path = '') { - if($path == '') { + if ($path == '') { self::init_silos(); $dirs = array(); foreach(self::$silos as $siloname => $silo) { $info = $silo->silo_info(); - if(isset($info['icon'])) + if (isset($info['icon'])) { $dirs[] = new MediaAsset($siloname, true, array(), $info['icon']); } @@ -86,11 +86,11 @@ public static function prepare($path) */ public static function put($filedata, $path = null) { - if(!$path) { + if (!$path) { $path = $filedata->path; } $silo = Media::get_silo($path, true); - if($path == '') { + if ($path == '') { return false; } else { @@ -107,7 +107,7 @@ public static function put($filedata, $path = null) public static function delete($path) { $silo = Media::get_silo($path, true); - if($path == '') { + if ($path == '') { return false; } else { @@ -124,7 +124,7 @@ public static function delete($path) */ public static function copy($pathfrom, $pathto) { - if($source = Media::get($pathfrom)) { + if ($source = Media::get($pathfrom)) { return Media::put($pathto, $source); } else { @@ -142,7 +142,7 @@ public static function copy($pathfrom, $pathto) */ public static function move($pathfrom, $pathto) { - if(Media::copy($pathfrom, $pathto)) { + if (Media::copy($pathfrom, $pathto)) { return Media::delete($pathfrom); } else { @@ -159,7 +159,7 @@ public static function move($pathfrom, $pathto) public static function highlights($path = null) { $highlights = array(); - if(isset($path)) { + if (isset($path)) { $silo = Media::get_silo($path); return $silo->silo_highlights(); } @@ -193,13 +193,13 @@ public static function permissions( $path ) */ public static function get_silo(&$silo, $parse_path = false) { - if($silo instanceof MediaSilo) { + if ($silo instanceof MediaSilo) { return $silo; } $siloname = $silo; - if($parse_path) { + if ($parse_path) { $exp = explode('/', $silo, 2); - if(count($exp) > 1) { + if (count($exp) > 1) { list($siloname, $silo) = $exp; } else { @@ -216,12 +216,12 @@ public static function get_silo(&$silo, $parse_path = false) */ public static function init_silos() { - if(empty(self::$silos)) { + if (empty(self::$silos)) { $tempsilos = Plugins::get_by_interface('MediaSilo'); self::$silos = array(); foreach($tempsilos as $eachsilo) { $info = $eachsilo->silo_info(); - if(isset($info['name'])) { + if (isset($info['name'])) { self::$silos[$info['name']] = $eachsilo; } } diff --git a/classes/mediaasset.php b/classes/mediaasset.php index 33d03a031..b4153a713 100644 --- a/classes/mediaasset.php +++ b/classes/mediaasset.php @@ -46,8 +46,8 @@ public function __construct($path, $is_dir, $properties = array(), $icon = NULL) */ protected function _get() { - if(empty($this->content)) { - switch($this->mode) { + if (empty($this->content)) { + switch ($this->mode) { case self::MODE_DATA: $this->content = Media::get($this->path); break; @@ -93,7 +93,7 @@ public function get_props() */ public function __get($name) { - switch($name) { + switch ($name) { case 'content': return $this->_get(); case 'is_dir': @@ -115,7 +115,7 @@ public function __get($name) */ public function __set($name, $value) { - switch($name) { + switch ($name) { case 'content': $this->mode = self::MODE_DATA; return $this->_set($value); @@ -147,7 +147,7 @@ public function load( $file ) */ public function save( $file ) { - switch( $this->mode ) { + switch ( $this->mode ) { case self::MODE_DATA: return file_put_contents( $file, $this->content ) !== false; break; diff --git a/classes/modules.php b/classes/modules.php index e9683406d..0d57d2232 100644 --- a/classes/modules.php +++ b/classes/modules.php @@ -210,15 +210,15 @@ public static function commit_active() */ public static function setup_status_module() { - if( isset( self::$status_data ) ) { + if ( isset( self::$status_data ) ) { return; } self::$status_data = Plugins::filter('dashboard_status', array()); - if( count( self::$status_data ) > 0 ) { + if ( count( self::$status_data ) > 0 ) { self::$available_modules['Status'] = _t('System Status'); - if(array_search(_t('System Status'), self::$active_modules) === false) { + if (array_search(_t('System Status'), self::$active_modules) === false) { self::$active_modules[] = _t('System Status'); } Plugins::register( array( 'Modules', 'filter_dash_module_status' ), 'filter', 'dash_module_system_status'); diff --git a/classes/options.php b/classes/options.php index f4659b34e..16c2c0d4b 100644 --- a/classes/options.php +++ b/classes/options.php @@ -63,7 +63,7 @@ public static function get( $name, $default_value = null ) public static function get_group( $prefix ) { - if( substr( $prefix, -2 ) != '__' ) { + if ( substr( $prefix, -2 ) != '__' ) { $prefix .= '__'; } diff --git a/classes/pluggable.php b/classes/pluggable.php index e92272524..7a6190975 100644 --- a/classes/pluggable.php +++ b/classes/pluggable.php @@ -74,7 +74,7 @@ public function get_url( $trail = false ) final public function plugin_id() { static $id; - if(!isset($id)) { + if (!isset($id)) { $id = Plugins::id_from_file( str_replace('\\', '/', $this->get_file() ) ); } return $id; diff --git a/classes/post.php b/classes/post.php index f51f796e5..721f8fb81 100644 --- a/classes/post.php +++ b/classes/post.php @@ -732,7 +732,7 @@ public function __get( $name ) */ public function __set( $name, $value ) { - switch( $name ) { + switch ( $name ) { case 'pubdate': case 'updated': case 'modified': diff --git a/classes/posts.php b/classes/posts.php index 3eb9f3d63..7da76d327 100644 --- a/classes/posts.php +++ b/classes/posts.php @@ -179,8 +179,8 @@ public static function get( $paramarray = array() ) } - if( isset( $paramset['vocabulary'] ) ) { - if( is_string( $paramset['vocabulary'] ) ) { + if ( isset( $paramset['vocabulary'] ) ) { + if ( is_string( $paramset['vocabulary'] ) ) { $paramset['vocabulary'] = Utils::get_params( $paramset['vocabulary'] ); } $paramset['vocabulary'] = self::_vocabulary_params( $paramset['vocabulary'] ); @@ -207,7 +207,7 @@ public static function get( $paramarray = array() ) break; } } - if( count( $all ) ) { + if ( count( $all ) ) { foreach( $all as $key => $value ) { $value = Utils::single_array( $value ); $joins['term2post_posts'] = ' JOIN {object_terms} ON {posts}.id = {object_terms}.object_id'; @@ -221,7 +221,7 @@ public static function get( $paramarray = array() ) $params[] = $object_id; } } - if( count( $any ) ) { + if ( count( $any ) ) { foreach( $any as $key => $value ) { $value = Utils::single_array( $value ); $joins['term2post_posts'] = ' JOIN {object_terms} ON {posts}.id = {object_terms}.object_id'; @@ -231,7 +231,7 @@ public static function get( $paramarray = array() ) $params[] = $object_id; } } - if( count( $not ) ) { + if ( count( $not ) ) { foreach( $not as $key => $value ) { $value = Utils::single_array( $value ); $where[] = 'NOT EXISTS (SELECT 1 @@ -944,7 +944,7 @@ public static function search_to_get( $search_string ) } $value = trim( $value ); - switch( strtolower($match['flag']) ) { + switch ( strtolower($match['flag']) ) { case 'author': if ( $u = User::get( $value ) ) { $arguments['user_id'][] = (int) $u->id; @@ -1047,7 +1047,7 @@ public static function _vocabulary_params( $params ) $ret = array(); foreach($params as $key => $value) { - if(strpos($key, ':') !== false) { + if (strpos($key, ':') !== false) { list($newkey, $subkey) = explode(':', $key, 2); $params[$newkey][$subkey] = $value; unset($params[$key]); @@ -1057,7 +1057,7 @@ public static function _vocabulary_params( $params ) foreach( $params as $vocab => $values ) { foreach( $values as $key => $value ) { $value = Utils::single_array( $value ); - if(strpos($key, ':') !== false ) { + if (strpos($key, ':') !== false ) { list($mode, $by_field) = explode(':', $key, 2); foreach( $value as $v ) { $ret[$mode][] = Term::get( Vocabulary::get($vocab)->id, $v ); @@ -1065,12 +1065,12 @@ public static function _vocabulary_params( $params ) } else { foreach( $value as $v ) { - if($v instanceof Tag) { - // @todo This if() section needs to be destroyed -- convert Tag to Term! + if ($v instanceof Tag) { + // @todo This if () section needs to be destroyed -- convert Tag to Term! // $vocab is not a vocab, but a mode: $ret[$vocab][] = Term::get( Vocabulary::get('tags')->id, $v->id ); } - elseif($v instanceof Term) { + elseif ($v instanceof Term) { // $vocab is not a vocab, but a mode: $ret[$vocab][] = $v; } diff --git a/classes/rawphpengine.php b/classes/rawphpengine.php index ce6a76eb6..69cde3225 100644 --- a/classes/rawphpengine.php +++ b/classes/rawphpengine.php @@ -106,7 +106,7 @@ public function display( $template ) public function template_exists( $template ) { if ( empty( $this->available_templates ) ) { - if(!is_array($this->template_dir)) { + if (!is_array($this->template_dir)) { $this->template_dir = array($this->template_dir); } $alltemplates = array(); @@ -185,4 +185,4 @@ public function append( $key, $value ='' ) } } } -?> \ No newline at end of file +?> diff --git a/classes/site.php b/classes/site.php index 715ecb253..a2bdb248c 100644 --- a/classes/site.php +++ b/classes/site.php @@ -125,7 +125,7 @@ public static function get_url( $name, $trail = false ) { $url = ''; - switch( strtolower( $name ) ) { + switch ( strtolower( $name ) ) { case 'host': $protocol = 'http'; // If we're running on a port other than 80, i @@ -303,7 +303,7 @@ public static function get_dir( $name, $trail = false ) $match = MultiByte::substr( $match, MultiByte::strpos( $match, '.' ) + 1 ); $x--; - } while( MultiByte::strpos( $match,'.' ) !== false ); + } while ( MultiByte::strpos( $match,'.' ) !== false ); $path = self::$config_path; break; diff --git a/classes/smartyengine.php b/classes/smartyengine.php index d41a712aa..5dd60dbaa 100644 --- a/classes/smartyengine.php +++ b/classes/smartyengine.php @@ -122,7 +122,7 @@ public function display( $template ) public function template_exists( $template ) { if ( empty( $this->available_templates ) ) { - if(!is_array($this->template_dir)) { + if (!is_array($this->template_dir)) { $this->template_dir = array($this->template_dir); } $alltemplates = array(); diff --git a/classes/superglobal.php b/classes/superglobal.php index bb5fbac24..498f8348d 100644 --- a/classes/superglobal.php +++ b/classes/superglobal.php @@ -80,11 +80,11 @@ public static function process_c() */ public function raw($index) { - if(isset($this->raw_values[$index])) { + if (isset($this->raw_values[$index])) { return $this->raw_values[$index]; } $cp = $this->get_array_copy_raw(); - if(isset($cp[$index])) { + if (isset($cp[$index])) { $this->raw_values[$index] = $cp[$index]; return $this->raw_values[$index]; } @@ -122,11 +122,11 @@ public function current() */ public function offsetGet($index) { - if(isset($this->values[$index])) { + if (isset($this->values[$index])) { return $this->values[$index]; } $cp = $this->get_array_copy_raw(); - if(isset($cp[$index])) { + if (isset($cp[$index])) { $this->values[$index] = $this->base_filter($cp[$index]); return $this->values[$index]; } @@ -153,10 +153,10 @@ public function offsetSet($index, $value) */ protected function base_filter($value) { - if(is_array($value)) { + if (is_array($value)) { return array_map(array($this, 'base_filter'), $value); } - elseif(is_string($value)) { + elseif (is_string($value)) { return InputFilter::filter($value); } else { @@ -175,9 +175,9 @@ public function merge() $args = func_get_args(); $cp = $this->get_array_copy_raw(); foreach($args as $ary) { - if(is_array($ary)) { + if (is_array($ary)) { foreach($ary as $key => $value) { - if(is_numeric($key)) { + if (is_numeric($key)) { $cp[] = $value; } else { @@ -185,10 +185,10 @@ public function merge() } } } - elseif($ary instanceof SuperGlobal) { + elseif ($ary instanceof SuperGlobal) { // loop to get raw data. - while( $ary->valid() ) { - if( is_numeric($ary->key()) ) { + while ( $ary->valid() ) { + if ( is_numeric($ary->key()) ) { $cp[] = $ary->raw($ary->key()); } else { @@ -197,10 +197,10 @@ public function merge() $ary->next(); } } - elseif($ary instanceof ArrayObject || $ary instanceof ArrayIterator) { + elseif ($ary instanceof ArrayObject || $ary instanceof ArrayIterator) { $arycp = $ary->getArrayCopy(); // Don't trigger offsetGet for ArrayObject foreach($arycp as $key => $value) { - if(is_numeric($key)) { + if (is_numeric($key)) { $cp[] = $value; } else { @@ -226,7 +226,7 @@ public function filter_keys() $keys = array(); $args = func_get_args(); foreach($args as $ary) { - if(!is_array($ary)) { + if (!is_array($ary)) { $ary = array($ary); } $keys = array_merge($keys, array_values($ary)); diff --git a/classes/tags.php b/classes/tags.php index 2ad9e5c25..dc98c2124 100644 --- a/classes/tags.php +++ b/classes/tags.php @@ -23,7 +23,7 @@ public function __construct( $tags = array() ) // Turn each of the tags into a Tag if ( count( $tags ) ) { - if( is_string( $tags[0] ) || $tags[0] instanceof Term ) { + if ( is_string( $tags[0] ) || $tags[0] instanceof Term ) { array_walk( $tags, create_function('&$tag', '$tag = new Tag($tag);') ); } } @@ -296,7 +296,7 @@ public function has( $tags ) $diff = array_diff( $tags, (array)$this ); foreach( $tags as $tag ) { - if( in_array( $tag, $diff ) ) { + if ( in_array( $tag, $diff ) ) { return false; } } diff --git a/classes/templateengine.php b/classes/templateengine.php index 35ddcbc89..0bbd92ebe 100644 --- a/classes/templateengine.php +++ b/classes/templateengine.php @@ -120,4 +120,4 @@ public function set_template_dir( $dir ) } } -?> \ No newline at end of file +?> diff --git a/classes/term.php b/classes/term.php index 154276e0c..57922a042 100644 --- a/classes/term.php +++ b/classes/term.php @@ -279,7 +279,7 @@ public function parent() public function siblings() { $parent = $this->parent(); - if( $parent ) { + if ( $parent ) { return $parent->children(); } else { diff --git a/classes/theme.php b/classes/theme.php index 4699dc10d..016ab2175 100644 --- a/classes/theme.php +++ b/classes/theme.php @@ -221,11 +221,11 @@ public function act_display( $paramarray = array( 'user_filters'=> array() ) ) $this->assign( 'posts', $posts ); /* - if( !isset( $this->page ) ) { - if( isset( $page ) ) { + if ( !isset( $this->page ) ) { + if ( isset( $page ) ) { $this->assign( 'page', $page ); } - elseif( isset( Controller::get_handler()->handler_vars['page'] ) ) { + elseif ( isset( Controller::get_handler()->handler_vars['page'] ) ) { $this->assign( 'page', Controller::get_handler()->handler_vars['page'] ); } }*/ @@ -856,14 +856,14 @@ public function theme_comments_count( $theme, $post, $zero = '', $one = '', $man return sprintf( $text, $count ); } else { - if( empty($one) && empty($many) ) { + if ( empty($one) && empty($many) ) { $text = _n( '%s Comment', '%s Comments', $count); } else{ - if( empty($one) ) { + if ( empty($one) ) { $one = $many; } - if( empty($many) ) { + if ( empty($many) ) { $many = $one; } $text = $count == 1 ? $one : $many; @@ -1012,7 +1012,7 @@ public function __call( $function, $params ) } array_unshift( $params, $function, $this ); $result = call_user_func_array( array( 'Plugins', 'theme' ), $params ); - switch( $purposed ) { + switch ( $purposed ) { case 'return': return $result; case 'end': @@ -1075,7 +1075,7 @@ function check_scope_criteria($criteria) $stack[] = $value; } else { - switch($crit) { + switch ($crit) { case 'not': $stack[] = ! array_pop($stack); break; @@ -1124,7 +1124,7 @@ public function get_scopes($area) **/ public function sort_scopes($scope1, $scope2) { - if($scope1->priority == $scope2->priority) { + if ($scope1->priority == $scope2->priority) { return 0; } return $scope1->priority < $scope2->priority ? 1 : -1; @@ -1149,7 +1149,7 @@ public function theme_area($theme, $area, $context = null, $scope = null) foreach ( $scopes as $scope_id => $scope_object ) { if ( $this->check_scope_criteria($scope_object->criteria) ) { $scope_block_count = DB::get_value('SELECT count(*) FROM {blocks_areas} ba WHERE ba.scope_id = ?', array($scope_object->id)); - if($scope_block_count > 0) { + if ($scope_block_count > 0) { $active_scope = $scope_object->id; } break; @@ -1180,7 +1180,7 @@ public function theme_area($theme, $area, $context = null, $scope = null) $hook = 'block_content_' . $block->type; Plugins::act($hook, $block, $this); $block->_content = implode( '', $this->content_return($block, $context)); - if(trim($block->_content) == '') { + if (trim($block->_content) == '') { unset($area_blocks[$block_instance_id]); } } @@ -1198,7 +1198,7 @@ public function theme_area($theme, $area, $context = null, $scope = null) $this->content = $block->_content; // This pattern renders the block inside the wrapper template only if a matching template exists $newoutput = $this->display_fallback( $fallback, 'fetch' ); - if($newoutput === false) { + if ($newoutput === false) { $output .= $block->_content; } else { @@ -1222,7 +1222,7 @@ public function theme_area($theme, $area, $context = null, $scope = null) ); $this->content = $output; $newoutput = $this->display_fallback( $fallback, 'fetch' ); - if($newoutput !== false) { + if ($newoutput !== false) { $output = $newoutput; } diff --git a/classes/themes.php b/classes/themes.php index 993ddb9a5..b4c9e7847 100644 --- a/classes/themes.php +++ b/classes/themes.php @@ -21,7 +21,7 @@ public static function get_all() { if ( !isset( self::$all_themes ) ) { $dirs = array( HABARI_PATH . '/system/themes/*' , HABARI_PATH . '/3rdparty/themes/*', HABARI_PATH . '/user/themes/*'); - if( Site::is('multi') ) { + if ( Site::is('multi') ) { $dirs[] = Site::get_dir('config') . '/themes/*'; } $themes = array(); @@ -76,7 +76,7 @@ public static function get_all_data() */ public static function get_theme_dir($nopreview = false) { - if(!$nopreview && isset($_SESSION['user_theme_dir'])) { + if (!$nopreview && isset($_SESSION['user_theme_dir'])) { $theme_dir = $_SESSION['user_theme_dir']; } else { @@ -175,7 +175,7 @@ public static function preview_theme( $theme_name, $theme_dir ) */ public static function cancel_preview() { - if(isset($_SESSION['user_theme_name'])) { + if (isset($_SESSION['user_theme_name'])) { EventLog::log( _t( 'Canceled Theme Preview: %s', array( $_SESSION['user_theme_name'] ) ), 'notice', 'theme', 'habari' ); unset($_SESSION['user_theme_name']); unset($_SESSION['user_theme_dir']); @@ -208,7 +208,7 @@ public static function create( $name = '', $template_engine = '', $theme_dir = ' $themedata->template_engine = $template_engine; $themedata->theme_dir = $themedata->name; $themedata->version = 0; - if( $theme_dir != '' ) { + if ( $theme_dir != '' ) { $themedata->theme_dir = $theme_dir; } else { @@ -236,9 +236,9 @@ public static function create( $name = '', $template_engine = '', $theme_dir = ' /** * @todo Should we include_once a theme's theme.php file here? **/ - if( file_exists( $themedata->theme_dir . 'theme.php' ) ) { + if ( file_exists( $themedata->theme_dir . 'theme.php' ) ) { include_once( $themedata->theme_dir . 'theme.php' ); - if( defined('THEME_CLASS') ) { + if ( defined('THEME_CLASS') ) { $classname = THEME_CLASS; } } diff --git a/classes/update.php b/classes/update.php index f843c5da4..fd67d6626 100644 --- a/classes/update.php +++ b/classes/update.php @@ -60,7 +60,7 @@ public static function check() { try { $instance = self::instance(); - if(count($instance->beacons) == 0) { + if (count($instance->beacons) == 0) { Update::add('Habari', '7a0313be-d8e3-11db-8314-0800200c9a66', Version::get_habariversion()); // add all active plugins @@ -90,13 +90,13 @@ public static function check() $beaconid = (string)$beacon['id']; foreach($beacon->update as $update) { // Do we have this beacon? If not, don't process it. - if(empty($instance->beacons[$beaconid])) { + if (empty($instance->beacons[$beaconid])) { continue; } // If the remote update info version is newer... - if( version_compare($update['version'], $instance->beacons[$beaconid]['version']) > 0 ) { + if ( version_compare($update['version'], $instance->beacons[$beaconid]['version']) > 0 ) { // If this version is more recent than all other newer versions... - if( + if ( empty($instance->beacons[$beaconid]['latest_version']) || version_compare ( @@ -107,7 +107,7 @@ public static function check() { $instance->beacons[$beaconid]['latest_version'] = (string)$update['version']; } - if(isset($instance->beacons[$beaconid]['severity'])) { + if (isset($instance->beacons[$beaconid]['severity'])) { $instance->beacons[$beaconid]['severity'][] = (string)$update['severity']; array_unique($instance->beacons[$beaconid]['severity']); } diff --git a/classes/utils.php b/classes/utils.php index 7c9dcfc36..28bf5dc6e 100644 --- a/classes/utils.php +++ b/classes/utils.php @@ -338,7 +338,7 @@ public static function debug() public static function firedebug() { $fooargs = func_get_args(); - $output = " - \ No newline at end of file + diff --git a/installer/theme.php b/installer/theme.php index 7f3e3c181..9255cb704 100644 --- a/installer/theme.php +++ b/installer/theme.php @@ -27,4 +27,4 @@ public function add_template_vars() } -?> \ No newline at end of file +?> diff --git a/plugins/autop/autop.plugin.php b/plugins/autop/autop.plugin.php index 923fdf7b7..ec501be84 100644 --- a/plugins/autop/autop.plugin.php +++ b/plugins/autop/autop.plugin.php @@ -18,4 +18,4 @@ public function action_init_theme() { } -?> \ No newline at end of file +?> diff --git a/plugins/coredashmodules/coredashmodules.plugin.php b/plugins/coredashmodules/coredashmodules.plugin.php index a251305ad..b54ea6ee3 100644 --- a/plugins/coredashmodules/coredashmodules.plugin.php +++ b/plugins/coredashmodules/coredashmodules.plugin.php @@ -16,7 +16,7 @@ class CoreDashModules extends Plugin */ function action_plugin_activation( $file ) { - if( Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__) ) { + if ( Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__) ) { Modules::add( 'Latest Entries' ); Modules::add( 'Latest Comments' ); Modules::add( 'Latest Log Activity' ); @@ -30,7 +30,7 @@ function action_plugin_activation( $file ) */ function action_plugin_deactivation( $file ) { - if( Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__) ) { + if ( Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__) ) { Modules::remove_by_name( 'Latest Entries' ); Modules::remove_by_name( 'Latest Comments' ); Modules::remove_by_name( 'Latest Log Activity' ); @@ -44,10 +44,10 @@ function action_plugin_deactivation( $file ) function filter_dash_modules( $modules ) { $modules[] = 'Latest Entries'; - if(User::identify()->can('manage_all_comments')) { + if (User::identify()->can('manage_all_comments')) { $modules[] = 'Latest Comments'; } - if(User::identify()->can('manage_logs')) { + if (User::identify()->can('manage_logs')) { $modules[] = 'Latest Log Activity'; } diff --git a/plugins/flickrsilo/flickrsilo.plugin.php b/plugins/flickrsilo/flickrsilo.plugin.php index 6225e446d..563c4bd51 100644 --- a/plugins/flickrsilo/flickrsilo.plugin.php +++ b/plugins/flickrsilo/flickrsilo.plugin.php @@ -41,7 +41,7 @@ function call($method, $args = array ()) $args = array_merge($args, array ('api_sig' => $this->sign($args))); ksort($args); - if($method == 'upload'){ + if ($method == 'upload'){ $req = curl_init(); $args['api_key'] = $this->key; $photo = $args['photo']; @@ -134,13 +134,13 @@ function cachedToken() function getPublicPhotos($nsid, $extras = '', $per_page = '', $page = '') { $params = array('user_id' => $nsid); - if($extras){ + if ($extras){ $params['extras'] = $extras; } - if($per_page){ + if ($per_page){ $params['per_page'] = $per_page; } - if($page){ + if ($page){ $params['page'] = $page; } @@ -162,7 +162,7 @@ function photosetsGetList($nsid = '') { $params = array(); - if($nsid){ + if ($nsid){ $params['user_id'] = $nsid; } @@ -201,7 +201,7 @@ function photosetsGetPhotos($photoset_id) function photosRecentlyUpdated() { $params = array(); - if($this->cachedToken()){ + if ($this->cachedToken()){ $params['auth_token'] = $this->cachedToken(); } @@ -219,7 +219,7 @@ function photosRecentlyUpdated() function mediaSearch( $params = array() ) { - if($this->cachedToken()){ + if ($this->cachedToken()){ $params['auth_token'] = $this->cachedToken(); } @@ -238,7 +238,7 @@ function mediaSearch( $params = array() ) function photosSearch( $params = array() ) { - if($this->cachedToken()){ + if ($this->cachedToken()){ $params['auth_token'] = $this->cachedToken(); } @@ -263,7 +263,7 @@ function photosSearch( $params = array() ) function videoSearch( $params = array() ) { - if($this->cachedToken()){ + if ($this->cachedToken()){ $params['auth_token'] = $this->cachedToken(); } @@ -284,7 +284,7 @@ function videoSearch( $params = array() ) function tagsGetListUser($userid = null) { $params = array(); - if(isset($userid)) { + if (isset($userid)) { $params['user_id'] = $userid; } $xml = $this->call('flickr.tags.getListUser', $params); @@ -294,7 +294,7 @@ function tagsGetListUser($userid = null) function photosGetInfo($photo_id) { $params = array(); - if($this->cachedToken()){ + if ($this->cachedToken()){ $params['auth_token'] = $this->cachedToken(); } @@ -316,23 +316,23 @@ function photosGetInfo($photo_id) $id = -1; foreach($value->children() as $kk => $vv){ $typed = false; - if(isset($vv['id'])){ + if (isset($vv['id'])){ $id = (string)$vv['id']; - }elseif(isset($vv['type'])){ + }elseif (isset($vv['type'])){ $id = (string)$vv['type']; $typed = true; }else $id++; foreach($vv->attributes() as $kkk => $vvv){ $ret[(string)$key][$id][(string)$kkk] = (string)$vvv; } - if($typed){ + if ($typed){ $ret[(string)$key][$id] = (string)$vv; } else{ $ret[(string)$key][$id]['text'] = (string)$vv; } } - if(!count($ret[(string)$key])) $ret[(string)$key] = (string)$value; + if (!count($ret[(string)$key])) $ret[(string)$key] = (string)$value; } return $ret; } @@ -340,12 +340,12 @@ function photosGetInfo($photo_id) function upload($photo, $title = '', $description = '', $tags = '', $perms = '', $async = 1, &$info = null) { $store = HABARI_PATH . '/' . Site::get_path('user') . '/cache'; - if(!is_dir($store)){ + if (!is_dir($store)){ mkdir($store, 0777); } $params = array('auth_token' => $this->cachedToken()); $url = InputFilter::parse_url('file://' . $photo); - if(isset($url['scheme'])){ + if (isset($url['scheme'])){ $localphoto = fopen(HABARI_PATH . '/' . $photo, 'r'); $store = tempnam($store, 'G2F'); file_put_contents($store, $localphoto); @@ -358,37 +358,37 @@ function upload($photo, $title = '', $description = '', $tags = '', $perms = '', $info = filesize($params['photo']); - if($title){ + if ($title){ $params['title'] = $title; } - if($description){ + if ($description){ $params['description'] = $description; } - if($tags){ + if ($tags){ $params['tags'] = $tags; } - if($perms){ - if(isset($perms['is_public'])){ + if ($perms){ + if (isset($perms['is_public'])){ $params['is_public'] = $perms['is_public']; } - if(isset($perms['is_friend'])){ + if (isset($perms['is_friend'])){ $params['is_friend'] = $perms['is_friend']; } - if(isset($perms['is_family'])){ + if (isset($perms['is_family'])){ $params['is_family'] = $perms['is_family']; } } - if($async){ + if ($async){ $params['async'] = $async; } // call the upload method. $xml = $this->call('upload', $params); - if($store){ + if ($store){ unlink($store); } @@ -396,7 +396,7 @@ function upload($photo, $title = '', $description = '', $tags = '', $perms = '', throw $xml; } - if($async){ + if ($async){ return((string)$xml->ticketid); } else{ @@ -406,9 +406,9 @@ function upload($photo, $title = '', $description = '', $tags = '', $perms = '', function photosUploadCheckTickets($tickets) { - if(is_array($tickets)){ + if (is_array($tickets)){ foreach($tickets as $key => $value){ - if($key){ + if ($key){ $params['tickets'] .= ' '; } $params['tickets'] .= $value; @@ -435,7 +435,7 @@ function reflectionGetMethods() { $params = array(); $xml = $this->call('flickr.reflection.getMethods', $params); - if(!$xml){ + if (!$xml){ return false; } $ret = (array)$xml->methods->method; @@ -467,7 +467,7 @@ public function action_init() */ public function silo_info() { - if($this->is_auth()) { + if ($this->is_auth()) { return array('name' => self::SILO_NAME, 'icon' => URL::get_from_filesystem(__FILE__) . '/icon.png'); } else { @@ -488,7 +488,7 @@ public function silo_dir($path) $size = Options::get('flickrsilo__flickr_size'); $section = strtok($path, '/'); - switch($section) { + switch ($section) { case 'attrib-sa': $xml = $flickr->photosSearch(array('user_id' => '', 'license' => '4,5', 'text'=>$_SESSION['flickrsearch'])); foreach($xml->photos->photo as $photo) { @@ -573,7 +573,7 @@ public function silo_dir($path) break; case 'tags': $selected_tag = strtok('/'); - if($selected_tag) { + if ($selected_tag) { $xml = $flickr->photosSearch(array('tags'=>$selected_tag)); foreach($xml->photos->photo as $photo) { @@ -606,7 +606,7 @@ public function silo_dir($path) break; case 'sets': $selected_set = strtok('/'); - if($selected_set) { + if ($selected_set) { $xml = $flickr->photosetsGetPhotos($selected_set); foreach($xml->photoset->photo as $photo) { @@ -645,7 +645,7 @@ public function silo_dir($path) $section = $path; case '': - if(isset($_SESSION['flickrsearch'])) { + if (isset($_SESSION['flickrsearch'])) { $results[] = new MediaAsset( self::SILO_NAME . '/search', true, @@ -703,13 +703,13 @@ public function silo_get($path, $qualities = null) public function silo_url($path, $qualities = null) { $photo = false; - if(preg_match('%^photos/(.+)$%', $path, $matches)) { + if (preg_match('%^photos/(.+)$%', $path, $matches)) { $id = $matches[1]; $photo = self::$cache[$id]; } $size = ''; - if(isset($qualities['size']) && $qualities['size'] == 'thumbnail') { + if (isset($qualities['size']) && $qualities['size'] == 'thumbnail') { $size = '_m'; } $url = "http://farm{$photo['farm']}.static.flickr.com/{$photo['server']}/{$photo['id']}_{$photo['secret']}{$size}.jpg"; @@ -798,7 +798,7 @@ public function filter_plugin_config($actions, $plugin_id) if ($plugin_id == $this->plugin_id()){ $flickr_ok = $this->is_auth(); - if($flickr_ok){ + if ($flickr_ok){ $actions[] = 'De-Authorize'; } else{ @@ -821,7 +821,7 @@ public function action_plugin_ui($plugin_id, $action) if ($plugin_id == $this->plugin_id()){ switch ($action){ case 'Authorize': - if($this->is_auth()){ + if ($this->is_auth()){ $deauth_url = URL::get('admin', array('page' => 'plugins', 'configure' => $this->plugin_id(), 'configaction' => 'De-Authorize')) . '#plugin_options'; echo "

    You have already successfully authorized Habari to access your Flickr account.

    "; echo "

    Do you want to revoke authorization?

    "; @@ -842,13 +842,13 @@ public function action_plugin_ui($plugin_id, $action) case 'confirm': $flickr = new Flickr(); - if(!isset($_SESSION['flickr_frob'])){ + if (!isset($_SESSION['flickr_frob'])){ $auth_url = URL::get('admin', array('page' => 'plugins', 'configure' => $this->plugin_id(), 'configaction' => 'Authorize')) . '#plugin_options'; echo '

    Either you have already authorized Habari to access your flickr account, or you have not yet done so. Please try again.

    '; } else{ $token = $flickr->getToken($_SESSION['flickr_frob']); - if(isset($token->auth->perms)){ + if (isset($token->auth->perms)){ Options::set('flickr_token_' . User::identify()->id, '' . $token->auth->token); echo '

    Your authorization was set successfully.

    '; } @@ -877,9 +877,9 @@ public function action_plugin_ui($plugin_id, $action) } } public function action_admin_footer( $theme ) { - if(Controller::get_var('page') == 'publish') { + if (Controller::get_var('page') == 'publish') { $size = Options::get('flickrsilo__flickr_size'); - switch($size) { + switch ($size) { case '_s': $vsizex = 75; break; @@ -933,16 +933,16 @@ public function action_admin_footer( $theme ) { private function is_auth() { static $flickr_ok = null; - if(isset($flickr_ok)){ + if (isset($flickr_ok)){ return $flickr_ok; } $flickr_ok = false; $token = Options::get('flickr_token_' . User::identify()->id); - if($token != ''){ + if ($token != ''){ $flickr = new Flickr(); $result = $flickr->call('flickr.auth.checkToken', array('api_key' => $flickr->key, 'auth_token' => $token)); - if(isset($result->auth->perms)){ + if (isset($result->auth->perms)){ $flickr_ok = true; $_SESSION['nsid'] = (string)$result->auth->user['nsid']; } @@ -968,13 +968,13 @@ private function is_auth() public function filter_media_controls( $controls, $silo, $path, $panelname ) { $class = __CLASS__; - if($silo instanceof $class) { + if ($silo instanceof $class) { unset($controls['root']); $search_criteria = isset($_SESSION['flickrsearch']) ? htmlentities($_SESSION['flickrsearch']) : ''; $controls['search']= '