Fixed whitespace to standard coding conventions.

This commit is contained in:
paul.baranowski 2010-11-18 14:39:03 -05:00
parent 52fe579ce4
commit 8014f94c58
35 changed files with 6072 additions and 6070 deletions

View File

@ -274,6 +274,7 @@ class Playlist {
return FALSE; return FALSE;
} }
/** /**
* Set playlist edit flag * Set playlist edit flag
* *

View File

@ -80,8 +80,7 @@ class Prefs {
return $subjid; return $subjid;
} }
if (is_null($subjid)) { if (is_null($subjid)) {
return PEAR::raiseError("Prefs::savePref: invalid session id", return PEAR::raiseError("Prefs::savePref: invalid session id", GBERR_SESS);
GBERR_SESS);
} }
$r = $this->update($subjid, $key, $value); $r = $this->update($subjid, $key, $value);
if (PEAR::isError($r)) { if (PEAR::isError($r)) {
@ -113,16 +112,14 @@ class Prefs {
return $subjid; return $subjid;
} }
if (is_null($subjid)) { if (is_null($subjid)) {
return PEAR::raiseError("Prefs::delPref: invalid session id", return PEAR::raiseError("Prefs::delPref: invalid session id", GBERR_SESS);
GBERR_SESS);
} }
$r = $this->delete($subjid, $key); $r = $this->delete($subjid, $key);
if (PEAR::isError($r)) { if (PEAR::isError($r)) {
return $r; return $r;
} }
if ($r === FALSE) { if ($r === FALSE) {
return PEAR::raiseError("Prefs::delPref: invalid preference key", return PEAR::raiseError("Prefs::delPref: invalid preference key", GBERR_PREF);
GBERR_PREF);
} }
return TRUE; return TRUE;
} }

View File

@ -109,6 +109,7 @@ class ScheduleGroup {
// Check if there are any conflicts with existing entries // Check if there are any conflicts with existing entries
$length = trim($playlist->getLength()); $length = trim($playlist->getLength());
var_dump($length);
if (empty($length)) { if (empty($length)) {
return new PEAR_Error("Length is empty."); return new PEAR_Error("Length is empty.");
} }
@ -122,8 +123,10 @@ class ScheduleGroup {
$itemStartTime = $p_datetime; $itemStartTime = $p_datetime;
$plItems = $playlist->getContents(); $plItems = $playlist->getContents();
var_dump($plItems);
foreach ($plItems as $row) { foreach ($plItems as $row) {
$trackLength = $row["cliplength"]; $trackLength = $row["cliplength"];
var_dump($trackLength);
$sql = "INSERT INTO ".$CC_CONFIG["scheduleTable"] $sql = "INSERT INTO ".$CC_CONFIG["scheduleTable"]
." (id, playlist_id, starts, ends, group_id, file_id," ." (id, playlist_id, starts, ends, group_id, file_id,"
." clip_length, cue_in, cue_out, fade_in, fade_out)" ." clip_length, cue_in, cue_out, fade_in, fade_out)"
@ -226,7 +229,9 @@ class Schedule {
." WHERE (starts >= '$p_datetime') " ." WHERE (starts >= '$p_datetime') "
." AND (ends <= (TIMESTAMP '$p_datetime' + INTERVAL '$p_length'))"; ." AND (ends <= (TIMESTAMP '$p_datetime' + INTERVAL '$p_length'))";
//$_SESSION["debug"] = $sql; //$_SESSION["debug"] = $sql;
var_dump($sql);
$count = $CC_DBC->GetOne($sql); $count = $CC_DBC->GetOne($sql);
var_dump($count);
return ($count == '0'); return ($count == '0');
} }

View File

@ -75,7 +75,4 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
return Common::setTimeInSub($this, 'CLIPLENGTH', $time); return Common::setTimeInSub($this, 'CLIPLENGTH', $time);
} }
} // CcPlaylistcontents } // CcPlaylistcontents

View File

@ -114,8 +114,9 @@ class twitter{
// //
function publicTimeline($sinceid=false){ function publicTimeline($sinceid=false){
$qs=''; $qs='';
if($sinceid!==false) if($sinceid!==false) {
$qs='?since_id='.intval($sinceid); $qs='?since_id='.intval($sinceid);
}
$request = 'http://twitter.com/statuses/public_timeline.xml'.$qs; $request = 'http://twitter.com/statuses/public_timeline.xml'.$qs;
return $this->process($request); return $this->process($request);
} }
@ -132,14 +133,15 @@ class twitter{
// //
function friendsTimeline($id=false,$since=false){ function friendsTimeline($id=false,$since=false){
$qs=''; $qs='';
if($since!==false) if($since!==false) {
$qs='?since='.urlencode($since); $qs='?since='.urlencode($since);
}
if($id===false) if($id===false) {
$request = 'http://twitter.com/statuses/friends_timeline.xml'.$qs; $request = 'http://twitter.com/statuses/friends_timeline.xml'.$qs;
else } else {
$request = 'http://twitter.com/statuses/friends_timeline/'.urlencode($id).'.xml'.$qs; $request = 'http://twitter.com/statuses/friends_timeline/'.urlencode($id).'.xml'.$qs;
}
return $this->process($request); return $this->process($request);
} }
@ -159,10 +161,11 @@ class twitter{
if($since!==false) if($since!==false)
$qs .= '&since='.urlencode($since); $qs .= '&since='.urlencode($since);
if($id===false) if($id===false) {
$request = 'http://twitter.com/statuses/user_timeline.xml'.$qs; $request = 'http://twitter.com/statuses/user_timeline.xml'.$qs;
else } else {
$request = 'http://twitter.com/statuses/user_timeline/'.urlencode($id).'.xml'.$qs; $request = 'http://twitter.com/statuses/user_timeline/'.urlencode($id).'.xml'.$qs;
}
return $this->process($request); return $this->process($request);
} }
@ -221,8 +224,9 @@ class twitter{
// //
function directMessages($since=false){ function directMessages($since=false){
$qs=''; $qs='';
if($since!==false) if($since!==false) {
$qs='?since='.urlencode($since); $qs='?since='.urlencode($since);
}
$request = 'http://twitter.com/direct_messages.xml'.$qs; $request = 'http://twitter.com/direct_messages.xml'.$qs;
return $this->process($request); return $this->process($request);
} }
@ -256,8 +260,9 @@ class twitter{
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postargs); curl_setopt ($ch, CURLOPT_POSTFIELDS, $postargs);
} }
if($this->username !== false && $this->password !== false) if($this->username !== false && $this->password !== false) {
curl_setopt($ch, CURLOPT_USERPWD, $this->username.':'.$this->password); curl_setopt($ch, CURLOPT_USERPWD, $this->username.':'.$this->password);
}
curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_NOBODY, 0); curl_setopt($ch, CURLOPT_NOBODY, 0);

View File

@ -253,8 +253,7 @@ class uiBase
global $CC_DBC, $CC_CONFIG; global $CC_DBC, $CC_CONFIG;
$this->gb = new GreenBox(); $this->gb = new GreenBox();
$CC_CONFIG['accessRawAudioUrl'] = $CC_CONFIG['storageUrlPath'].'/xmlrpc/simpleGet.php'; $CC_CONFIG['accessRawAudioUrl'] = $CC_CONFIG['storageUrlPath'].'/xmlrpc/simpleGet.php';
$this->sessid = isset($_REQUEST[$CC_CONFIG['authCookieName']]) ? $this->sessid = isset($_REQUEST[$CC_CONFIG['authCookieName']]) ? $_REQUEST[$CC_CONFIG['authCookieName']] : null;
$_REQUEST[$CC_CONFIG['authCookieName']] : null;
$this->userid = GreenBox::GetSessUserId($this->sessid); $this->userid = GreenBox::GetSessUserId($this->sessid);
$this->login = Alib::GetSessLogin($this->sessid); $this->login = Alib::GetSessLogin($this->sessid);
if (PEAR::isError($this->login)) { if (PEAR::isError($this->login)) {

View File

@ -731,7 +731,7 @@ class uiHandler extends uiBase {
} }
return TRUE; return TRUE;
} // fn changeStationPrefs }
} // class uiHandler }
?> ?>

View File

@ -32,11 +32,11 @@ class uiPlaylist
public function setReload($url=NULL) public function setReload($url=NULL)
{ {
if($url) if($url) {
$this->Base->redirUrl = $url; $this->Base->redirUrl = $url;
else } else {
$this->Base->redirUrl = $this->reloadUrl; $this->Base->redirUrl = $this->reloadUrl;
}
} // fn setReload } // fn setReload

View File

@ -1,12 +1,8 @@
<?php <?php
/** /**
* @package Campcaster * @package Campcaster
* @subpackage htmlUI * @subpackage htmlUI
* @copyright 2010 Sourcefabric O.P.S. * @copyright 2010 Sourcefabric O.P.S.
*/ */
class uiScratchPad class uiScratchPad
{ {
@ -150,10 +146,11 @@ class uiScratchPad
$scratchpad = $this->get(); $scratchpad = $this->get();
foreach ($ids as $id) { foreach ($ids as $id) {
if($type === 'playlist') if($type === 'playlist') {
$item = $this->Base->getPLMetaInfo($id); $item = $this->Base->getPLMetaInfo($id);
else } else {
$item = $this->Base->getMetaInfo($id); $item = $this->Base->getMetaInfo($id);
}
foreach ($scratchpad as $key => $val) { foreach ($scratchpad as $key => $val) {
if ($val['id'] == $item['id']) { if ($val['id'] == $item['id']) {
@ -259,12 +256,13 @@ class uiScratchPad
public function reloadMetadata() public function reloadMetadata()
{ {
foreach ($this->items as $key => $val) { foreach ($this->items as $key => $val) {
if($val['type'] === 'playlist') if ($val['type'] === 'playlist') {
$this->items[$key] = $this->Base->getPLMetaInfo($val['id']); $this->items[$key] = $this->Base->getPLMetaInfo($val['id']);
else } else {
$this->items[$key] = $this->Base->getMetaInfo($val['id']); $this->items[$key] = $this->Base->getMetaInfo($val['id']);
} }
} }
}
public function reloadActivePLMetadata($id) public function reloadActivePLMetadata($id)
{ {