Skip to content

Commit 453e0ed

Browse files
author
Michael Toppa
committed
change calls to Toppa Libraries classes and methods to new Shashin versions
1 parent 0ae4905 commit 453e0ed

28 files changed

+74
-97
lines changed

Admin/Display/toolsAlbums.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
echo '<td class="shashinCenter">' . $this->functionsFacade->dateI18n("d-M-Y H:i", $album->lastSync) . "</td>" . PHP_EOL;
6868
echo '<td class="shashinCenter">';
6969

70-
echo ToppaHtmlFormField::quickBuild(
70+
echo Lib_ShashinHtmlFormField::quickBuild(
7171
"includeInRandom[{$album->id}]",
7272
$refData['includeInRandom'],
7373
$album->includeInRandom);
@@ -129,9 +129,9 @@
129129
</dl>
130130

131131
<p><strong><?php _e("URL:", 'shashin'); ?></strong>
132-
<?php echo ToppaHtmlFormField::quickBuild('userUrl', $refData['dataUrl']); ?><br />
132+
<?php echo Lib_ShashinHtmlFormField::quickBuild('userUrl', $refData['dataUrl']); ?><br />
133133
<?php _e("Include these photos in random photo displays?", 'shashin'); ?>
134-
<?php echo ToppaHtmlFormField::quickBuild('includeInRandom', $refData['includeInRandom'], 'Y'); ?></p>
134+
<?php echo Lib_ShashinHtmlFormField::quickBuild('includeInRandom', $refData['includeInRandom'], 'Y'); ?></p>
135135
<p><input class="button-primary" type="submit" name="submit" value="<?php _e("Add Albums", 'shashin'); ?>" /></p>
136136
</form>
137137

@@ -161,9 +161,9 @@
161161
</dl>
162162

163163
<p><strong><?php _e("RSS URL:", 'shashin'); ?></strong>
164-
<?php echo ToppaHtmlFormField::quickBuild('userUrl', $refData['dataUrl']); ?><br />
164+
<?php echo Lib_ShashinHtmlFormField::quickBuild('userUrl', $refData['dataUrl']); ?><br />
165165
<?php _e("Include these videos in random photo/video displays?", 'shashin'); ?>
166-
<?php echo ToppaHtmlFormField::quickBuild('includeInRandom', $refData['includeInRandom'], 'Y'); ?></p>
166+
<?php echo Lib_ShashinHtmlFormField::quickBuild('includeInRandom', $refData['includeInRandom'], 'Y'); ?></p>
167167
<p><input class="button-primary" type="submit" name="submit" value="<?php _e("Add Videos", 'shashin'); ?>" /></p>
168168
</form>
169169

@@ -183,9 +183,9 @@
183183
<dd>http://twitpic.com/photos/<strong>mtoppa</strong></dd>
184184
</dl>
185185
<p><strong><?php _e("URL:", 'shashin'); ?></strong>
186-
<?php echo ToppaHtmlFormField::quickBuild('userUrl', $refData['dataUrl']); ?><br />
186+
<?php echo Lib_ShashinHtmlFormField::quickBuild('userUrl', $refData['dataUrl']); ?><br />
187187
<?php _e("Include these photos in random photo displays?", 'shashin'); ?>
188-
<?php echo ToppaHtmlFormField::quickBuild('includeInRandom', $refData['includeInRandom'], 'Y'); ?></p>
188+
<?php echo Lib_ShashinHtmlFormField::quickBuild('includeInRandom', $refData['includeInRandom'], 'Y'); ?></p>
189189
<p><input class="button-primary" type="submit" name="submit" value="<?php _e("Add Photos", 'shashin'); ?>" /></p>
190190
</form>
191191

Admin/Display/toolsPhotos.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
? 'Unknown' : date("d-M-Y H:i", $photo->takenTimestamp))
4949
. '</td>' . PHP_EOL;
5050
echo '<td>';
51-
echo ToppaHtmlFormField::quickBuild(
51+
echo Lib_ShashinHtmlFormField::quickBuild(
5252
"includeInRandom[{$photo->id}]",
5353
$refData['includeInRandom'],
5454
$photo->includeInRandom);

Admin/ShashinHeadTags.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public function __construct($version) {
1010
$this->version = $version;
1111
}
1212

13-
public function setFunctionsFacade(ToppaFunctionsFacade $functionsFacade) {
13+
public function setFunctionsFacade(Lib_ShashinFunctionsFacade $functionsFacade) {
1414
$this->functionsFacade = $functionsFacade;
1515
return $this->functionsFacade;
1616
}

Admin/ShashinInstall.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct($version) {
4747
$this->version = $version;
4848
}
4949

50-
public function setDbFacade(ToppaDatabaseFacade $dbFacade) {
50+
public function setDbFacade(Lib_ShashinDatabaseFacade $dbFacade) {
5151
$this->dbFacade = $dbFacade;
5252
return $this->dbFacade;
5353
}
@@ -67,7 +67,7 @@ public function setSettings(Lib_ShashinSettings $settings) {
6767
return $this->settings;
6868
}
6969

70-
public function setFunctionsFacade(ToppaFunctionsFacade $functionsFacade) {
70+
public function setFunctionsFacade(Lib_ShashinFunctionsFacade $functionsFacade) {
7171
$this->functionsFacade = $functionsFacade;
7272
return $this->functionsFacade;
7373
}

Admin/ShashinMenuActionHandlerAlbums.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Admin_ShashinMenuActionHandlerAlbums {
1010
public function __construct() {
1111
}
1212

13-
public function setFunctionsFacade(ToppaFunctionsFacade $functionsFacade) {
13+
public function setFunctionsFacade(Lib_ShashinFunctionsFacade $functionsFacade) {
1414
$this->functionsFacade = $functionsFacade;
1515
return $this->functionsFacade;
1616
}

Admin/ShashinMenuActionHandlerPhotos.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Admin_ShashinMenuActionHandlerPhotos {
99
public function __construct() {
1010
}
1111

12-
public function setFunctionsFacade(ToppaFunctionsFacade $functionsFacade) {
12+
public function setFunctionsFacade(Lib_ShashinFunctionsFacade $functionsFacade) {
1313
$this->functionsFacade = $functionsFacade;
1414
return $this->functionsFacade;
1515
}
@@ -58,4 +58,4 @@ public function runUpdateIncludeInRandom() {
5858
return __('Updated "Include In Random" settings', 'shashin');
5959
}
6060
}
61-
// 610-316-5890
61+

Admin/ShashinMenuDisplayer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ abstract class Admin_ShashinMenuDisplayer {
1515
public function __construct() {
1616
}
1717

18-
public function setFunctionsFacade(ToppaFunctionsFacade $functionsFacade) {
18+
public function setFunctionsFacade(Lib_ShashinFunctionsFacade $functionsFacade) {
1919
$this->functionsFacade = $functionsFacade;
2020
return $this->functionsFacade;
2121
}

Admin/ShashinSettingsMenu.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ public function __construct() {
337337
);
338338
}
339339

340-
public function setFunctionsFacade(ToppaFunctionsFacade $functionsFacade) {
340+
public function setFunctionsFacade(Lib_ShashinFunctionsFacade $functionsFacade) {
341341
$this->functionsFacade = $functionsFacade;
342342
return $this->functionsFacade;
343343
}
@@ -401,7 +401,7 @@ public function createHtmlForSettingsField($setting) {
401401
. $this->refData[$setting]['label']
402402
. '</label></th>' . PHP_EOL
403403
. '<td nowrap="nowrap">'
404-
. ToppaHtmlFormField::quickBuild($setting, $this->refData[$setting], $value)
404+
. Lib_ShashinHtmlFormField::quickBuild($setting, $this->refData[$setting], $value)
405405
. '</td>' . PHP_EOL
406406
. '<td>' . $this->refData[$setting]['help'] . '</td>' . PHP_EOL
407407
. '</tr>' . PHP_EOL;

Admin/ShashinSynchronizer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function setClonablePhoto(Lib_ShashinPhoto $clonablePhoto) {
3030
$this->clonablePhoto = $clonablePhoto;
3131
}
3232

33-
public function setDatabaseFacade(ToppaDatabaseFacade $dbFacade) {
33+
public function setDatabaseFacade(Lib_ShashinDatabaseFacade $dbFacade) {
3434
$this->dbFacade = $dbFacade;
3535
}
3636

Admin/ShashinSynchronizerPicasa.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function syncAlbumForThisAlbumType(array $decodedAlbumData) {
112112
$this->album = clone $this->clonableAlbum;
113113
$albumRefData = $this->clonableAlbum->getRefData();
114114
$albumData = $this->extractFieldsFromDecodedData($decodedAlbumData['feed'], $albumRefData, 'picasa');
115-
$albumData['pubDate'] = ToppaFunctions::makeTimestampPhpSafe($albumData['pubDate']);
115+
$albumData['pubDate'] = Lib_ShashinFunctions::makeTimestampPhpSafe($albumData['pubDate']);
116116
$albumData['lastSync'] = $this->syncTime;
117117
$albumData['albumType'] = $this->album->albumType;
118118

@@ -150,7 +150,7 @@ public function syncAlbumPhotos(array $decodedAlbumData, $sourceOrder = 0) {
150150
$photoData['albumId'] = $this->album->id;
151151
$photoData['albumType'] = $this->album->albumType;
152152
if (isset($photoData['takenTimestamp'])) {
153-
$photoData['takenTimestamp'] = ToppaFunctions::makeTimestampPhpSafe($photoData['takenTimestamp']);
153+
$photoData['takenTimestamp'] = Lib_ShashinFunctions::makeTimestampPhpSafe($photoData['takenTimestamp']);
154154
}
155155
$photoData['uploadedTimestamp'] = strtotime($photoData['uploadedTimestamp']);
156156
$photoData['sourceOrder'] = ++$sourceOrder;

Admin/ShashinUninstaller.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Admin_ShashinUninstaller {
99
public function __construct() {
1010
}
1111

12-
public function setDbFacade(ToppaDatabaseFacade $dbFacade) {
12+
public function setDbFacade(Lib_ShashinDatabaseFacade $dbFacade) {
1313
$this->dbFacade = $dbFacade;
1414
return $this->dbFacade;
1515
}
@@ -29,7 +29,7 @@ public function setSettings(Lib_ShashinSettings $settings) {
2929
return $this->settings;
3030
}
3131

32-
public function setFunctionsFacade(ToppaFunctionsFacade $functionsFacade) {
32+
public function setFunctionsFacade(Lib_ShashinFunctionsFacade $functionsFacade) {
3333
$this->functionsFacade = $functionsFacade;
3434
return $this->functionsFacade;
3535
}

Admin/ShashinUpgradeWp.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Admin_ShashinUpgradeWp {
1515
public function __construct() {
1616
}
1717

18-
public function setDbFacade(ToppaDatabaseFacade $dbFacade) {
18+
public function setDbFacade(Lib_ShashinDatabaseFacade $dbFacade) {
1919
$this->dbFacade = $dbFacade;
2020
return $this->dbFacade;
2121
}
@@ -30,7 +30,7 @@ public function setPhoto(Lib_ShashinPhoto $photo) {
3030
return $this->photo;
3131
}
3232

33-
public function setFunctionsFacade(ToppaFunctionsFacade $functionsFacade) {
33+
public function setFunctionsFacade(Lib_ShashinFunctionsFacade $functionsFacade) {
3434
$this->functionsFacade = $functionsFacade;
3535
return $this->functionsFacade;
3636
}

Admin/ShashinWidgetWp.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function form($instance) {
4747
foreach ($this->shashinFormFields as $k=>$v) {
4848
$inputName = $this->get_field_name($k);
4949
echo '<tr><td>' . $v['label'] . ':</td><td>';
50-
echo ToppaHtmlFormField::quickBuild($inputName, $v, $instance[$k]);
50+
echo Lib_ShashinHtmlFormField::quickBuild($inputName, $v, $instance[$k]);
5151
echo '</td></tr>';
5252
}
5353

Lib/ShashinAlbum.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class Lib_ShashinAlbum extends Lib_ShashinDataObject {
44
private $clonablePhoto;
55

66
public function __construct(
7-
ToppaDatabaseFacade $dbFacade,
7+
Lib_ShashinDatabaseFacade $dbFacade,
88
Lib_ShashinPhoto $clonablePhoto) {
99

1010
$this->refData = array(

Lib/ShashinContainer.php

+2-22
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,19 @@ public function __construct() {
1919

2020
public function getDatabaseFacade() {
2121
if (!isset($this->dbFacade)) {
22-
/*
23-
* @todo: remove the $autoLoader - it's needed here only for temporary compatibility with the old version of toppa-libs, which may still be active when upgrading through the wp plugin admin
24-
*/
25-
$autoLoader = new ToppaAutoLoaderWp('/shashin');
26-
$this->dbFacade = new ToppaDatabaseFacadeWp($autoLoader);
22+
$this->dbFacade = new Lib_ShashinDatabaseFacade();
2723
}
2824

2925
return $this->dbFacade;
3026
}
3127

3228
public function getFunctionsFacade() {
3329
if (!isset($this->functionsFacade)) {
34-
$this->functionsFacade = new ToppaFunctionsFacadeWp();
30+
$this->functionsFacade = new Lib_ShashinFunctionsFacade();
3531
}
3632
return $this->functionsFacade;
3733
}
3834

39-
public function getPhotoRefData() {
40-
if (!isset($this->photoRefData)) {
41-
$this->photoRefData = new Lib_ShashinPhotoRefData();
42-
}
43-
44-
return $this->photoRefData;
45-
}
46-
4735
public function getClonablePhoto() {
4836
if (!isset($this->clonablePhoto)) {
4937
$this->getDatabaseFacade();
@@ -81,14 +69,6 @@ public function getClonableAlbumPhotosCollection() {
8169
return $this->clonableAlbumPhotosCollection;
8270
}
8371

84-
public function getAlbumRefData() {
85-
if (!isset($this->albumRefData)) {
86-
$this->albumRefData = new Lib_ShashinAlbumRefData();
87-
}
88-
89-
return $this->albumRefData;
90-
}
91-
9272
public function getClonableAlbum() {
9373
if (!isset($this->clonableAlbum)) {
9474
$this->getDatabaseFacade();

Lib/ShashinDataObject.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ abstract class Lib_ShashinDataObject {
88
protected $refData;
99
protected $videoFileTypes = array('mpg', 'mod', 'mmv', 'tod', 'wmv', 'asf', 'avi', 'divx', 'mov', 'm4v', '3gp', '3g2', 'mp4', 'm2t', 'm2ts', 'mts', 'mkv');
1010

11-
public function __construct(ToppaDatabaseFacade $dbFacade) {
11+
public function __construct(Lib_ShashinDatabaseFacade $dbFacade) {
1212
$this->dbFacade = $dbFacade;
1313
}
1414

Lib/ShashinDataObjectCollection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ abstract class Lib_ShashinDataObjectCollection {
2020
public function __construct() {
2121
}
2222

23-
public function setDbFacade(ToppaDatabaseFacade $dbFacade) {
23+
public function setDbFacade(Lib_ShashinDatabaseFacade $dbFacade) {
2424
$this->dbFacade = $dbFacade;
2525
return $this->dbFacade;
2626
}
@@ -195,7 +195,7 @@ public function getCollectionInUserOrder() {
195195
}
196196

197197
$ids = explode(",", $this->idString);
198-
array_walk($ids, array('ToppaFunctions', 'trimCallback'));
198+
array_walk($ids, array('Lib_ShashinFunctions', 'trimCallback'));
199199

200200
foreach ($ids as $id) {
201201
foreach ($rows as $row) {

Lib/ShashinPhoto.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
class Lib_ShashinPhoto extends Lib_ShashinDataObject {
4-
public function __construct(ToppaDatabaseFacade $dbFacade) {
4+
public function __construct(Lib_ShashinDatabaseFacade $dbFacade) {
55
$this->refData = array(
66
'id' => array(
77
'db' => array(
@@ -207,7 +207,7 @@ public function flush() {
207207
}
208208

209209
public function isVideo() {
210-
$fileExtension = strtolower(ToppaFunctions::getFileExtension($this->data['filename']));
210+
$fileExtension = strtolower(Lib_ShashinFunctions::getFileExtension($this->data['filename']));
211211

212212
if (in_array($fileExtension, $this->videoFileTypes)) {
213213
return true;

Lib/ShashinSettings.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Lib_ShashinSettings {
55
private $name = 'shashin';
66
private $data = array();
77

8-
public function __construct(ToppaFunctionsFacade $functionsFacade) {
8+
public function __construct(Lib_ShashinFunctionsFacade $functionsFacade) {
99
$this->functionsFacade = $functionsFacade;
1010
}
1111

@@ -39,11 +39,11 @@ public function set(array $newSettings, $preferExisting = false) {
3939
$this->refresh();
4040

4141
if ($preferExisting) {
42-
$this->data = ToppaFunctions::arrayMergeRecursiveForSettings($newSettings, $this->data);
42+
$this->data = Lib_ShashinFunctions::arrayMergeRecursiveForSettings($newSettings, $this->data);
4343
}
4444

4545
else {
46-
$this->data = ToppaFunctions::arrayMergeRecursiveForSettings($this->data, $newSettings);
46+
$this->data = Lib_ShashinFunctions::arrayMergeRecursiveForSettings($this->data, $newSettings);
4747
}
4848

4949
$this->functionsFacade->setSetting($this->name, $this->data);

Public/ShashinDataObjectDisplayer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function setShortcode(Public_ShashinShortcode $shortcode) {
5555
$this->shortcode = $shortcode;
5656
}
5757

58-
public function setFunctionsFacade(ToppaFunctionsFacade $functionsFacade) {
58+
public function setFunctionsFacade(Lib_ShashinFunctionsFacade $functionsFacade) {
5959
$this->functionsFacade = $functionsFacade;
6060
}
6161

Public/ShashinHeadTags.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public function __construct($version) {
1010
$this->version = $version;
1111
}
1212

13-
public function setFunctionsFacade(ToppaFunctionsFacade $functionsFacade) {
13+
public function setFunctionsFacade(Lib_ShashinFunctionsFacade $functionsFacade) {
1414
$this->functionsFacade = $functionsFacade;
1515
return $this->functionsFacade;
1616
}
@@ -31,7 +31,7 @@ public function run() {
3131
$shashinJsParams['prettyPhotoTheme'] = $this->settings->prettyPhotoTheme;
3232
$shashinJsParams['prettyPhotoOverlayGallery'] = $this->settings->prettyPhotoOverlayGallery;
3333
// need to get the desired width - we can get it from any subclass of the PhotoDisplayer
34-
$photoDisplayerSkeleton = new Public_ShashinPhotoDisplayerPicasaPrettyPhoto();
34+
$photoDisplayerSkeleton = new Public_ShashinPhotoDisplayerPicasaPrettyphoto();
3535
$sizesMap = $photoDisplayerSkeleton->getExpandedSizesMap();
3636
$shashinJsParams['prettyPhotoDefaultWidth'] = $sizesMap[$this->settings->expandedImageSize];
3737
// assume 4:3 ratio

Public/ShashinLayoutManager.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function setSettings(Lib_ShashinSettings $settings) {
3636
return $this->settings;
3737
}
3838

39-
public function setFunctionsFacade(ToppaFunctionsFacade $functionsFacade) {
39+
public function setFunctionsFacade(Lib_ShashinFunctionsFacade $functionsFacade) {
4040
$this->functionsFacade = $functionsFacade;
4141
return $this->functionsFacade;
4242
}

0 commit comments

Comments
 (0)