Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

permissions update

  • Loading branch information...
commit b557b813a4680cc8ee479ba2329555fe6bc0039a 1 parent 8a0662e
@toppa authored
Showing with 264 additions and 130 deletions.
  1. 0  Admin/Display/images/loader.gif
  2. 0  Admin/Display/images/picasa.gif
  3. 0  Admin/Display/media.css
  4. 0  Admin/Display/mediaAlbums.php
  5. 0  Admin/Display/mediaPhotos.php
  6. 0  Admin/Display/settings.php
  7. +12 −3 Admin/ShashinContainer.php
  8. +32 −26 Admin/ShashinInstall.php
  9. 0  Admin/ShashinMediaMenuWp.php
  10. +23 −4 Admin/ShashinMenuActionHandlerAlbums.php
  11. +17 −16 Admin/ShashinMenuDisplayer.php
  12. 0  Admin/ShashinScheduledSynchronizer.php
  13. +3 −2 Admin/ShashinSettingsMenu.php
  14. +4 −0 Admin/ShashinSynchronizer.php
  15. 0  Admin/ShashinSynchronizerFlickr.php
  16. 0  Admin/ShashinSynchronizerTwitpic.php
  17. 0  Admin/ShashinSynchronizerYoutube.php
  18. +31 −5 Admin/ShashinUninstaller.php
  19. 0  Admin/ShashinUpgradeWp.php
  20. 0  Admin/ShashinWidgetWp.php
  21. 0  Languages/shashin.pot
  22. +2 −1  Lib/ShashinAlbum.php
  23. 0  Lib/ShashinAlbumPhotosCollection.php
  24. 0  Lib/ShashinAlbumRefData.php
  25. +5 −0 Lib/ShashinDataObject.php
  26. 0  Lib/ShashinDataObjectCollection.php
  27. 0  Lib/ShashinDataObjectRefData.php
  28. +2 −1  Lib/ShashinPhoto.php
  29. 0  Lib/ShashinPhotoRefData.php
  30. 0  Public/Display/highslide/graphics/close.png
  31. 0  Public/Display/highslide/graphics/closeX.png
  32. 0  Public/Display/highslide/graphics/controlbar-black-border.gif
  33. 0  Public/Display/highslide/graphics/controlbar-text-buttons.png
  34. 0  Public/Display/highslide/graphics/controlbar-white-small.gif
  35. 0  Public/Display/highslide/graphics/controlbar-white.gif
  36. 0  Public/Display/highslide/graphics/controlbar2.gif
  37. 0  Public/Display/highslide/graphics/controlbar3.gif
  38. 0  Public/Display/highslide/graphics/controlbar4-hover.gif
  39. 0  Public/Display/highslide/graphics/controlbar4.gif
  40. 0  Public/Display/highslide/graphics/fullexpand.gif
  41. 0  Public/Display/highslide/graphics/geckodimmer.png
  42. 0  Public/Display/highslide/graphics/icon.gif
  43. 0  Public/Display/highslide/graphics/loader.gif
  44. 0  Public/Display/highslide/graphics/loader.white.gif
  45. 0  Public/Display/highslide/graphics/outlines/Outlines.psd
  46. 0  Public/Display/highslide/graphics/outlines/beveled.png
  47. 0  Public/Display/highslide/graphics/outlines/drop-shadow.png
  48. 0  Public/Display/highslide/graphics/outlines/glossy-dark.png
  49. 0  Public/Display/highslide/graphics/outlines/outer-glow.png
  50. 0  Public/Display/highslide/graphics/outlines/rounded-black.png
  51. 0  Public/Display/highslide/graphics/outlines/rounded-white.png
  52. 0  Public/Display/highslide/graphics/resize.gif
  53. 0  Public/Display/highslide/graphics/scrollarrows.png
  54. 0  Public/Display/highslide/graphics/zoomin.cur
  55. 0  Public/Display/highslide/graphics/zoomout.cur
  56. 0  Public/Display/highslide/highslide-ie6.css
  57. 0  Public/Display/highslide/highslide.css
  58. 0  Public/Display/highslide/highslide.js
  59. 0  Public/Display/highslide/swfobject.js
  60. +7 −7 Public/Display/highslideSettings.js
  61. 0  Public/Display/photoGroupsDisplayer.js
  62. +15 −2 Public/Display/shashin.css
  63. +4 −4 Public/ShashinAlbumDisplayer.php
  64. 0  Public/ShashinAlbumDisplayerPicasa.php
  65. 0  Public/ShashinAlbumDisplayerTwitpic.php
  66. 0  Public/ShashinAlbumDisplayerYoutube.php
  67. 0  Public/ShashinContainer.php
  68. +2 −8 Public/ShashinDataObjectDisplayer.php
  69. +61 −17 Public/ShashinHeadTags.php
  70. 0  Public/ShashinLayoutManager.php
  71. 0  Public/ShashinOldShortcode.php
  72. +17 −16 Public/ShashinPhotoDisplayer.php
  73. 0  Public/ShashinPhotoDisplayerPicasaHighslide.php
  74. +2 −4 Public/ShashinPhotoDisplayerPicasaOther.php
  75. 0  Public/ShashinPhotoDisplayerPicasaSource.php
  76. 0  Public/ShashinPhotoDisplayerTwitpic.php
  77. 0  Public/ShashinPhotoDisplayerTwitpicHighslide.php
  78. +2 −4 Public/ShashinPhotoDisplayerTwitpicOther.php
  79. 0  Public/ShashinPhotoDisplayerTwitpicSource.php
  80. 0  Public/ShashinPhotoDisplayerYoutube.php
  81. 0  Public/ShashinPhotoDisplayerYoutubeHighslide.php
  82. +2 −4 Public/ShashinPhotoDisplayerYoutubeOther.php
  83. 0  Public/ShashinPhotoDisplayerYoutubeSource.php
  84. 0  Public/ShashinSessionManager.php
  85. +1 −1  ShashinWp.php
  86. 0  Tests/Lib/UnitShashinPhotoRefData.php
  87. 0  readme.txt
  88. 0  screenshot-1.png
  89. 0  screenshot-2.png
  90. 0  screenshot-3.png
  91. 0  screenshot-4.png
  92. +19 −3 start.php
  93. +1 −2  uninstall.php
View
0  Admin/Display/images/loader.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Admin/Display/images/picasa.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Admin/Display/media.css 100644 → 100755
File mode changed
View
0  Admin/Display/mediaAlbums.php 100644 → 100755
File mode changed
View
0  Admin/Display/mediaPhotos.php 100644 → 100755
File mode changed
View
0  Admin/Display/settings.php 100644 → 100755
File mode changed
View
15 Admin/ShashinContainer.php
@@ -26,11 +26,13 @@ public function getInstaller() {
$this->getClonableAlbum();
$this->getClonablePhoto();
$this->getSettings();
+ $this->getFunctionsFacade();
$this->installer = new Admin_ShashinInstall();
$this->installer->setDbFacade($this->dbFacade);
- $this->installer->setAlbumAndAlbumVars($this->clonableAlbum);
- $this->installer->setPhotoAndPhotoVars($this->clonablePhoto);
+ $this->installer->setAlbum($this->clonableAlbum);
+ $this->installer->setPhoto($this->clonablePhoto);
$this->installer->setSettings($this->settings);
+ $this->installer->setFunctionsFacade($this->functionsFacade);
}
return $this->installer;
@@ -59,8 +61,15 @@ public function getUninstaller() {
$this->getClonableAlbum();
$this->getClonablePhoto();
$this->getSettings();
- $this->uninstaller = new Admin_ShashinUninstaller($this->dbFacade, $this->clonableAlbum, $this->clonablePhoto, $this->settings);
+ $this->getFunctionsFacade();
+ $this->uninstaller = new Admin_ShashinUninstaller();
+ $this->uninstaller->setDbFacade($this->dbFacade);
+ $this->uninstaller->setAlbum($this->clonableAlbum);
+ $this->uninstaller->setPhoto($this->clonablePhoto);
+ $this->uninstaller->setSettings($this->settings);
+ $this->uninstaller->setFunctionsFacade($this->functionsFacade);
}
+
return $this->uninstaller;
}
View
58 Admin/ShashinInstall.php
@@ -4,14 +4,11 @@ class Admin_ShashinInstall {
private $dbFacade;
private $album;
private $photo;
- private $albumTable;
- private $albumRefData;
- private $photoTable;
- private $photoRefData;
+ private $functionsFacade;
private $settings;
private $settingsDefaults = array(
'supportOldShortcodes' => 'n',
- 'imageDisplay' => 'highslide',
+ 'imageDisplay' => 'fancybox',
'expandedImageSize' => 'medium',
'defaultPhotoLimit' => 18,
'scheduledUpdate' => 'n',
@@ -48,17 +45,13 @@ public function setDbFacade(ToppaDatabaseFacade $dbFacade) {
return $this->dbFacade;
}
- public function setAlbumAndAlbumVars(Lib_ShashinAlbum $album) {
+ public function setAlbum(Lib_ShashinAlbum $album) {
$this->album = $album;
- $this->albumTable = $this->album->getTableName();
- $this->albumRefData = $this->album->getRefData();
return $this->album;
}
- public function setPhotoAndPhotoVars(Lib_ShashinPhoto $photo) {
+ public function setPhoto(Lib_ShashinPhoto $photo) {
$this->photo = $photo;
- $this->photoTable = $this->photo->getTableName();
- $this->photoRefData = $this->photo->getRefData();
return $this->photo;
}
@@ -67,38 +60,51 @@ public function setSettings(Lib_ShashinSettings $settings) {
return $this->settings;
}
+ public function setFunctionsFacade(ToppaFunctionsFacade $functionsFacade) {
+ $this->functionsFacade = $functionsFacade;
+ return $this->functionsFacade;
+ }
+
public function run() {
- $this->createAlbumTable();
- $this->verifyAlbumTable();
- $this->createPhotoTable();
- $this->verifyPhotoTable();
+ return $this->functionsFacade->callFunctionForNetworkSites(array($this, 'runForNetworkSites'));
+ }
+
+ public function runForNetworkSites() {
+ // this is called for each site in the network, so the table
+ // name prefix will be different for each call
+ $albumTable = $this->dbFacade->getTableNamePrefix() . $this->album->getBaseTableName();
+ $photoTable = $this->dbFacade->getTableNamePrefix() . $this->photo->getBaseTableName();
+ $this->createAlbumTable($albumTable);
+ $this->verifyAlbumTable($albumTable);
+ $this->createPhotoTable($photoTable);
+ $this->verifyPhotoTable($photoTable);
$this->updateSettings();
return true;
}
- public function createAlbumTable() {
- return $this->dbFacade->createTable($this->albumTable, $this->albumRefData);
+ public function createAlbumTable($albumTable) {
+ return $this->dbFacade->createTable($albumTable, $this->album->getRefData());
}
- public function verifyAlbumTable() {
- $result = $this->dbFacade->verifyTableExists($this->albumTable, $this->albumRefData);
+ public function verifyAlbumTable($albumTable) {
+ $result = $this->dbFacade->verifyTableExists($albumTable, $this->album->getRefData());
if (!$result) {
- throw new Exception(__('Failed to create table ', 'shashin') . $this->albumTable);
+ throw new Exception(__('Failed to create table ', 'shashin') . $albumTable);
}
return $result;
}
- public function createPhotoTable() {
- return $this->dbFacade->createTable($this->photoTable, $this->photoRefData);
+ public function createPhotoTable($photoTable) {
+ return $this->dbFacade->createTable($photoTable, $this->photo->getRefData());
}
- public function verifyPhotoTable() {
- $result = $this->dbFacade->verifyTableExists($this->photoTable, $this->photoRefData);
+ public function verifyPhotoTable($photoTable) {
+ $result = $this->dbFacade->verifyTableExists($photoTable, $this->photo->getRefData());
if (!$result) {
- throw new Exception(__('Failed to create table ', 'shashin') . $this->photoTable);
+ throw new Exception(__('Failed to create table ', 'shashin') . $photoTable);
}
return $result;
@@ -107,4 +113,4 @@ public function verifyPhotoTable() {
public function updateSettings() {
return $this->settings->set($this->settingsDefaults, true);
}
-}
+}
View
0  Admin/ShashinMediaMenuWp.php 100644 → 100755
File mode changed
View
27 Admin/ShashinMenuActionHandlerAlbums.php
@@ -36,6 +36,10 @@ public function setRequest(array $request) {
}
public function run() {
+ if (!array_key_exists('shashinAction', $this->request)) {
+ return $this->menuDisplayer->run();
+ }
+
switch ($this->request['shashinAction']) {
case 'addAlbums':
$this->functionsFacade->checkAdminNonceFields('shashinNonceAdd', 'shashinNonceAdd');
@@ -133,13 +137,28 @@ public function runDeleteAlbum() {
}
public function runUpdateIncludeInRandom() {
- $shortcodeMimic = array('type' => 'album', 'order' => 'title');
- $albums = $this->menuDisplayer->getDataObjects($shortcodeMimic);
+ $albumsShortcodeMimic = array('type' => 'album', 'order' => 'title');
+ $albums = $this->menuDisplayer->getDataObjects($albumsShortcodeMimic);
foreach ($albums as $album) {
- $albumData = array('includeInRandom'=> $this->request['includeInRandom'][$album->id]);
- $album->set($albumData);
+ if ($album->includeInRandom == $this->request['includeInRandom'][$album->id]) {
+ continue;
+ }
+
+ $includeInRandom = array('includeInRandom'=> $this->request['includeInRandom'][$album->id]);
+ $album->set($includeInRandom);
$album->flush();
+
+ /* I want to set this for every photo in the album as well, but this isn't
+ working - commenting out for now
+ $albumPhotosShortcodeMimic = array('id' => $album->id, 'type' => 'albumphotos');
+ $albumPhotos = $this->menuDisplayer->getDataObjects($albumPhotosShortcodeMimic);
+
+ foreach ($albumPhotos as $photo) {
+ $photo->set($includeInRandom);
+ $photo->flush();
+ }
+ */
}
return __('Updated "Include In Random" settings', 'shashin');
View
33 Admin/ShashinMenuDisplayer.php
@@ -38,7 +38,7 @@ public function setContainer(Public_ShashinContainer $container = null) {
}
public function run($message = null) {
- if ($this->request['shashinOrderBy']) {
+ if (array_key_exists('shashinOrderBy', $this->request) && $this->request['shashinOrderBy']) {
$this->checkOrderByNonce();
}
@@ -54,26 +54,27 @@ public function run($message = null) {
}
public function showUpgradeCleanupNotice() {
- if ($this->functionsFacade->getSetting('shashin_options')) {
- $url = '?page=ShashinToolsMenu&shashinAction=cleanupUpgrade';
- $noncedUrl = $this->functionsFacade->addNonceToUrl($url, 'shashinNonceCleanupUpgrade');
-
- $notice = '<p><strong>';
- $notice .= __('Upgrade notice', 'shashin');
- $notice .= ':</strong> ';
- $notice .= __('Please click "Sync All" below to complete the upgrade. Then review your Shashin albums, tags, and photos. If everything looks correct, please', 'shashin');
- $notice .= ' <a href="' . $noncedUrl . '">';
- $notice .= __('click here to remove the old settings and database backup', 'shashin');
- $notice .= '</a> ';
- $notice .= __('(which will remove this nag). Also, if you have posts containing Shashin tags, go to the Shashin settings menu to turn on support for old-style tags.', 'shashin');
- $notice .= '</p>';
+ if (!$this->functionsFacade->getSetting('shashin_options')) {
+ return null;
}
+ $url = '?page=ShashinToolsMenu&amp;shashinAction=cleanupUpgrade';
+ $noncedUrl = $this->functionsFacade->addNonceToUrl($url, 'shashinNonceCleanupUpgrade');
+
+ $notice = '<p><strong>';
+ $notice .= __('Upgrade notice', 'shashin');
+ $notice .= ':</strong> ';
+ $notice .= __('Please click "Sync All" below to complete the upgrade. Then review your Shashin albums, tags, and photos. If everything looks correct, please', 'shashin');
+ $notice .= ' <a href="' . $noncedUrl . '">';
+ $notice .= __('click here to remove the old settings and database backup', 'shashin');
+ $notice .= '</a> ';
+ $notice .= __('(which will remove this nag). Also, if you have posts containing Shashin tags, go to the Shashin settings menu to turn on support for old-style tags.', 'shashin');
+ $notice .= '</p>';
return $notice;
}
public function mimicShortcode() {
- if (is_string($this->request['shashinOrderBy'])) {
+ if (array_key_exists('shashinOrderBy', $this->request) && is_string($this->request['shashinOrderBy'])) {
$orderBy = $this->request['shashinOrderBy'];
}
@@ -81,7 +82,7 @@ public function mimicShortcode() {
$orderBy = $this->defaultOrderBy;
}
- if (is_string($this->request['shashinReverse'])) {
+ if (array_key_exists('shashinReverse', $this->request) && is_string($this->request['shashinReverse'])) {
$reverse = $this->request['shashinReverse'];
}
View
0  Admin/ShashinScheduledSynchronizer.php 100644 → 100755
File mode changed
View
5 Admin/ShashinSettingsMenu.php 100644 → 100755
@@ -45,14 +45,15 @@ public function __construct() {
'type' => 'select',
'subgroup' => array(
'source' => __('Display at photo hosting site', 'shashin'),
+ 'fancybox' => __('Use FancyBox', 'shashin'),
'highslide' => __('Use Highslide', 'shashin'),
'other' => __('Use another viewer', 'shashin')
)
),
'validateFunction' => 'in_array',
- 'validValues' => array('source', 'highslide', 'other'),
+ 'validValues' => array('source', 'fancybox', 'highslide', 'other'),
'label' => __('How to display a full-size photo when its thumbnail is clicked', 'shashin'),
- 'help' => __('Highslide is included with Shashin and works "out of the box." If you select "Use another viewer," you are responsible for implementing your own image viewer. See "Highslide Settings" and "Other Viewer Settings" below.', 'shashin'),
+ 'help' => __('FancyBox is included with Shashin and works "out of the box." If you select "Use another viewer," you are responsible for implementing your own image viewer. See "Highslide Settings" and "Other Viewer Settings" below.', 'shashin'),
'group' => 'general'
),
'expandedImageSize' => array(
View
4 Admin/ShashinSynchronizer.php
@@ -119,6 +119,10 @@ public function extractFieldsFromDecodedData(array $decodedData, array $refData,
$extractedFields = array();
foreach ($refData as $k=>$v) {
+ if (!isset($v[$albumType])) {
+ continue;
+ }
+
switch(count($v[$albumType])) {
case 0:
break;
View
0  Admin/ShashinSynchronizerFlickr.php 100644 → 100755
File mode changed
View
0  Admin/ShashinSynchronizerTwitpic.php 100644 → 100755
File mode changed
View
0  Admin/ShashinSynchronizerYoutube.php 100644 → 100755
File mode changed
View
36 Admin/ShashinUninstaller.php
@@ -6,28 +6,54 @@ class Admin_ShashinUninstaller {
private $album;
private $photo;
- public function __construct($dbFacade, $album, $photo, $settings) {
+ public function __construct() {
+ }
+
+ public function setDbFacade(ToppaDatabaseFacade $dbFacade) {
$this->dbFacade = $dbFacade;
+ return $this->dbFacade;
+ }
+
+ public function setAlbum(Lib_ShashinAlbum $album) {
$this->album = $album;
+ return $this->album;
+ }
+
+ public function setPhoto(Lib_ShashinPhoto $photo) {
$this->photo = $photo;
+ return $this->photo;
+ }
+
+ public function setSettings(Lib_ShashinSettings $settings) {
$this->settings = $settings;
+ return $this->settings;
+ }
+
+ public function setFunctionsFacade(ToppaFunctionsFacade $functionsFacade) {
+ $this->functionsFacade = $functionsFacade;
+ return $this->functionsFacade;
}
public function run() {
try {
- $this->dropTables();
- $this->deleteSettings();
+ $status = $this->functionsFacade->callFunctionForNetworkSites(array($this, 'runForNetworkSites'), false);
}
catch (Exception $e) {
return $e->getMessage();
}
+ return $status;
+ }
+
+ public function runForNetworkSites() {
+ $this->dropTables();
+ $this->deleteSettings();
return true;
}
public function dropTables() {
- $albumTable = $this->album->getTableName();
+ $albumTable = $this->dbFacade->getTableNamePrefix() . $this->album->getBaseTableName();
$albumRefData = $this->album->getRefData();
$this->dbFacade->dropTable($albumTable);
@@ -35,7 +61,7 @@ public function dropTables() {
throw new Exception(__('Failed to drop table ', 'shashin') . $albumTable);
}
- $photoTable = $this->photo->getTableName();
+ $photoTable = $this->dbFacade->getTableNamePrefix() . $this->photo->getBaseTableName();
$photoRefData = $this->photo->getRefData();
$this->dbFacade->dropTable($photoTable);
View
0  Admin/ShashinUpgradeWp.php 100644 → 100755
File mode changed
View
0  Admin/ShashinWidgetWp.php 100644 → 100755
File mode changed
View
0  Languages/shashin.pot 100644 → 100755
File mode changed
View
3  Lib/ShashinAlbum.php
@@ -9,7 +9,8 @@ public function __construct(
Lib_ShashinPhoto $clonablePhoto) {
$this->clonablePhoto = $clonablePhoto;
- $this->tableName = $dbFacade->getTableNamePrefix() . 'shashin_album';
+ $this->baseTableName = 'shashin_album';
+ $this->tableName = $dbFacade->getTableNamePrefix() . $this->baseTableName;
parent::__construct($dbFacade, $refData);
}
View
0  Lib/ShashinAlbumPhotosCollection.php 100644 → 100755
File mode changed
View
0  Lib/ShashinAlbumRefData.php 100644 → 100755
File mode changed
View
5 Lib/ShashinDataObject.php
@@ -3,6 +3,7 @@
abstract class Lib_ShashinDataObject {
protected $dbFacade;
protected $tableName;
+ protected $baseTableName;
protected $data = array();
protected $refData;
protected $videoFileTypes = array('mpg', 'mod', 'mmv', 'tod', 'wmv', 'asf', 'avi', 'divx', 'mov', 'm4v', '3gp', '3g2', 'mp4', 'm2t', 'm2ts', 'mts', 'mkv');
@@ -20,6 +21,10 @@ public function getTableName() {
return $this->tableName;
}
+ public function getBaseTableName() {
+ return $this->baseTableName;
+ }
+
public function __get($name) {
if (array_key_exists($name, $this->getRefData())) {
return $this->data[$name];
View
0  Lib/ShashinDataObjectCollection.php 100644 → 100755
File mode changed
View
0  Lib/ShashinDataObjectRefData.php 100644 → 100755
File mode changed
View
3  Lib/ShashinPhoto.php
@@ -2,7 +2,8 @@
class Lib_ShashinPhoto extends Lib_ShashinDataObject {
public function __construct(ToppaDatabaseFacade $dbFacade, Lib_ShashinPhotoRefData $refData) {
- $this->tableName = $dbFacade->getTableNamePrefix() . 'shashin_photo';
+ $this->baseTableName = 'shashin_photo';
+ $this->tableName = $dbFacade->getTableNamePrefix() . $this->baseTableName;
parent::__construct($dbFacade, $refData);
}
View
0  Lib/ShashinPhotoRefData.php 100644 → 100755
File mode changed
View
0  Public/Display/highslide/graphics/close.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/closeX.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/controlbar-black-border.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/controlbar-text-buttons.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/controlbar-white-small.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/controlbar-white.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/controlbar2.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/controlbar3.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/controlbar4-hover.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/controlbar4.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/fullexpand.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/geckodimmer.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/icon.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/loader.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/loader.white.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/outlines/Outlines.psd 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/outlines/beveled.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/outlines/drop-shadow.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/outlines/glossy-dark.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/outlines/outer-glow.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/outlines/rounded-black.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/outlines/rounded-white.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/resize.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Public/Display/highslide/graphics/scrollarrows.png 100644 → 100755
Diff not rendered
View
0  Public/Display/highslide/graphics/zoomin.cur 100644 → 100755
File mode changed
View
0  Public/Display/highslide/graphics/zoomout.cur 100644 → 100755
File mode changed
View
0  Public/Display/highslide/highslide-ie6.css 100644 → 100755
File mode changed
View
0  Public/Display/highslide/highslide.css 100644 → 100755
File mode changed
View
0  Public/Display/highslide/highslide.js 100644 → 100755
File mode changed
View
0  Public/Display/highslide/swfobject.js 100644 → 100755
File mode changed
View
14 Public/Display/highslideSettings.js 100644 → 100755
@@ -1,11 +1,11 @@
// The "-0" and "!!" are for type casting, as all vars brought over
// from wp_localize_script come in as strings
-hs.graphicsDir = highslideSettings.graphicsDir;
+hs.graphicsDir = shashinHighslideSettings.graphicsDir;
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
-hs.outlineType = ((highslideSettings.outlineType == "none") ? null : highslideSettings.outlineType);
+hs.outlineType = ((shashinHighslideSettings.outlineType == "none") ? null : shashinHighslideSettings.outlineType);
hs.fadeInOut = true;
-hs.dimmingOpacity = highslideSettings.dimmingOpacity-0;
+hs.dimmingOpacity = shashinHighslideSettings.dimmingOpacity-0;
// need this to make sure we don't add controls for a slideshowGroup
@@ -19,14 +19,14 @@ function addHSSlideshow(groupID) {
hs.addSlideshow({
slideshowGroup: groupID,
- interval: highslideSettings.interval-0,
- repeat: !!(highslideSettings.repeat-0),
+ interval: shashinHighslideSettings.interval-0,
+ repeat: !!(shashinHighslideSettings.repeat-0),
useControls: true,
fixedControls: true,
overlayOptions: {
opacity: .75,
- position: highslideSettings.position,
- hideOnMouseOut: !!(highslideSettings.hideController-0)
+ position: shashinHighslideSettings.position,
+ hideOnMouseOut: !!(shashinHighslideSettings.hideController-0)
}
});
}
View
0  Public/Display/photoGroupsDisplayer.js 100644 → 100755
File mode changed
View
17 Public/Display/shashin.css 100644 → 100755
@@ -63,7 +63,20 @@
color: darkgray;
}
-.shashinHighslideLinkToOriginalPhoto {
+.shashinLinkToOriginalPhoto {
float: right;
padding-left: 5px;
-}
+}
+
+.shashinFancyboxCaptionTitle {
+ text-align: left;
+}
+
+.shashinFancyboxCaptionTitle b {
+ display: block;
+ margin-right: 80px;
+}
+
+.shashinFancyboxCaptionClose {
+ float: right;
+}
View
8 Public/ShashinAlbumDisplayer.php 100644 → 100755
@@ -6,12 +6,12 @@ public function __construct() {
}
public function setImgAlt() {
- $this->imgAlt = $this->makeTextQuotable($this->dataObject->title);
+ $this->imgAlt = $this->functionsFacade->htmlSpecialCharsOnce($this->dataObject->title);
return $this->imgAlt;
}
public function setImgTitle() {
- $this->imgTitle = $this->makeTextQuotable($this->dataObject->title);
+ $this->imgTitle = $this->functionsFacade->htmlSpecialCharsOnce($this->dataObject->title);
return $this->imgTitle;
}
@@ -87,12 +87,12 @@ private function generateCaptionLocationAndPhotoCount() {
}
// degenerate
- public function formatExifDataForHighslideCaption() {
+ public function setExifDataForCaption() {
return null;
}
// degenerate
- public function formatDateForHighslideCaption($date = null) {
+ public function setDateForCaption($date = null) {
return null;
}
}
View
0  Public/ShashinAlbumDisplayerPicasa.php 100644 → 100755
File mode changed
View
0  Public/ShashinAlbumDisplayerTwitpic.php 100644 → 100755
File mode changed
View
0  Public/ShashinAlbumDisplayerYoutube.php 100644 → 100755
File mode changed
View
0  Public/ShashinContainer.php 100644 → 100755
File mode changed
View
10 Public/ShashinDataObjectDisplayer.php 100644 → 100755
@@ -204,12 +204,6 @@ public function setImgWidthAndHeight() {
abstract public function setImgAlt();
abstract public function setImgTitle();
- public function makeTextQuotable($text) {
- // there may already be entities in the text, so we want to be very
- // conservative with what we replace
- return str_replace('"', '&quot;', $text);
- }
-
public function setImgClass() {
$this->imgClass = 'shashinThumbnailImage';
return $this->imgClass;
@@ -325,6 +319,6 @@ public function getImgWidth() {
return $this->imgWidth;
}
- abstract public function formatExifDataForHighslideCaption();
- abstract public function formatDateForHighslideCaption($date = null);
+ abstract public function setExifDataForCaption();
+ abstract public function setDateForCaption($date = null);
}
View
78 Public/ShashinHeadTags.php 100644 → 100755
@@ -5,6 +5,7 @@ class Public_ShashinHeadTags {
private $version;
private $functionsFacade;
private $settings;
+ private $baseUrl;
public function __construct($version) {
$this->version = $version;
@@ -21,34 +22,77 @@ public function setSettings(Lib_ShashinSettings $settings) {
}
public function run() {
+ $this->baseUrl = $this->functionsFacade->getPluginsUrl('/Display/', __FILE__);
+ $this->enqueueForShashin();
+ $this->enqueueForFancyBox();
+ $this->enqueueForHighslide();
+
+ }
+
+ public function enqueueForShashin() {
$shashinCssUrl = $this->functionsFacade->getUrlforCustomizableFile('shashin.css', __FILE__, 'Display/');
$this->functionsFacade->enqueueStylesheet('shashinStyle', $shashinCssUrl, false, $this->version);
- $baseUrl = $this->functionsFacade->getPluginsUrl('/Display/', __FILE__);
$this->functionsFacade->enqueueScript(
'shashinPhotoGroupsDisplayer',
- $baseUrl . 'photoGroupsDisplayer.js',
+ $this->baseUrl . 'photoGroupsDisplayer.js',
array('jquery'),
$this->version
);
$adminAjax = $this->functionsFacade->getAdminUrl('admin-ajax.php');
$photoGroupsDisplayerParams = array('ajaxurl' => $adminAjax);
$this->functionsFacade->localizeScript('shashinPhotoGroupsDisplayer', 'shashinPhotoGroupsDisplayer', $photoGroupsDisplayerParams);
+ return true;
+ }
+
+ public function enqueueForFancyBox() {
+ if ($this->settings->imageDisplay != 'fancybox') {
+ return true;
+ }
+
+ $fancyboxCssUrl = $this->functionsFacade->getUrlforCustomizableFile('jquery.fancybox.css', __FILE__, 'Display/fancybox/');
+ $this->functionsFacade->enqueueStylesheet('shashinFancyboxStyle', $fancyboxCssUrl, false, '1.3.4');
+ $this->functionsFacade->enqueueScript(
+ 'shashinFancybox',
+ $this->baseUrl . 'fancybox/jquery.fancybox.js',
+ array('jquery'),
+ '1.3.4'
+ );
+ $this->functionsFacade->enqueueScript(
+ 'shashinFancyboxSettings',
+ $this->baseUrl . 'fancyboxSettings.js',
+ array('shashinFancybox'),
+ $this->version
+ );
+
+ $this->functionsFacade->localizeScript('shashinFancyboxSettings', 'shashinFancyboxSettings', array(
+ 'fancyboxDir' => $this->baseUrl . 'fancybox/',
+ ));
+ }
- if ($this->settings->imageDisplay == 'highslide') {
- $highslideCssUrl = $this->functionsFacade->getUrlforCustomizableFile('highslide.css', __FILE__, 'Display/highslide/');
- $this->functionsFacade->enqueueStylesheet('highslideStyle', $highslideCssUrl, false, '4.1.12');
- $this->functionsFacade->enqueueScript('highslide', $baseUrl . 'highslide/highslide.js', false, '4.1.12');
- $this->functionsFacade->enqueueScript('swfobject', $baseUrl . 'highslide/swfobject.js', false, '2.2');
- $this->functionsFacade->enqueueScript('highslideSettings', $baseUrl . 'highslideSettings.js', false, $this->version);
- $this->functionsFacade->localizeScript('highslideSettings', 'highslideSettings', array(
- 'graphicsDir' => $baseUrl . 'highslide/graphics/',
- 'outlineType' => $this->settings->highslideOutlineType,
- 'dimmingOpacity' => $this->settings->highslideDimmingOpacity,
- 'interval' => $this->settings->highslideInterval,
- 'repeat' => $this->settings->highslideRepeat,
- 'position' => $this->settings->highslideVPosition . ' ' . $this->settings->highslideHPosition,
- 'hideController' => $this->settings->highslideHideController
- ));
+ public function enqueueForHighslide() {
+ if ($this->settings->imageDisplay != 'highslide') {
+ return true;
}
+
+ $highslideCssUrl = $this->functionsFacade->getUrlforCustomizableFile('highslide.css', __FILE__, 'Display/highslide/');
+ $this->functionsFacade->enqueueStylesheet('shashinHighslideStyle', $highslideCssUrl, false, '4.1.12');
+ $this->functionsFacade->enqueueScript('shashinHighslide', $this->baseUrl . 'highslide/highslide.js', false, '4.1.12');
+ $this->functionsFacade->enqueueScript('shashinSwfobject', $this->baseUrl . 'highslide/swfobject.js', false, '2.2');
+ $this->functionsFacade->enqueueScript(
+ 'shashinHighslideSettings',
+ $this->baseUrl . 'highslideSettings.js',
+ array('shashinHighslide'),
+ $this->version
+ );
+
+ $this->functionsFacade->localizeScript('shashinHighslideSettings', 'shashinHighslideSettings', array(
+ 'graphicsDir' => $this->baseUrl . 'highslide/graphics/',
+ 'outlineType' => $this->settings->highslideOutlineType,
+ 'dimmingOpacity' => $this->settings->highslideDimmingOpacity,
+ 'interval' => $this->settings->highslideInterval,
+ 'repeat' => $this->settings->highslideRepeat,
+ 'position' => $this->settings->highslideVPosition . ' ' . $this->settings->highslideHPosition,
+ 'hideController' => $this->settings->highslideHideController
+ ));
}
}
View
0  Public/ShashinLayoutManager.php 100644 → 100755
File mode changed
View
0  Public/ShashinOldShortcode.php 100644 → 100755
File mode changed
View
33 Public/ShashinPhotoDisplayer.php 100644 → 100755
@@ -13,12 +13,12 @@ public function __construct() {
}
public function setImgAlt() {
- $this->imgAlt = $this->makeTextQuotable($this->dataObject->description);
+ $this->imgAlt = $this->functionsFacade->htmlSpecialCharsOnce($this->dataObject->description);
return $this->imgAlt;
}
public function setImgTitle() {
- $this->imgTitle = $this->makeTextQuotable($this->dataObject->description);
+ $this->imgTitle = $this->functionsFacade->htmlSpecialCharsOnce($this->dataObject->description);
return $this->imgTitle;
}
@@ -56,32 +56,33 @@ public function setLinkIdForCaption() {
// awkward to put this here, but I don't want to duplicate it in each Highslide
// child class, and making it another class seems like overkill (can't wait for
- // need traits!). In the child class, override setCaption, call it in the
- // parent, and then call this
+ // traits!). In the child class, override setCaption, call parent::setCaption,
+ // and then call this
public function setCaptionForHighslide() {
$highslideCaption = '<div class="highslide-caption">';
- $highslideCaption .= $this->formatOriginalPhotoLinkForHighslideCaption();
+ $highslideCaption .= $this->setOriginalPhotoLinkForCaption();
if ($this->dataObject->description) {
$highslideCaption .= $this->dataObject->description;
}
- $highslideCaption .= $this->formatExifDataForHighslideCaption();
+ $highslideCaption .= $this->setExifDataForCaption();
$highslideCaption .= '</div>';
return $highslideCaption;
}
// twitpic community guidelines require a link back to the original photo,
// and it's nice to acknowledge the others too
- public function formatOriginalPhotoLinkForHighslideCaption() {
- return ' <div class="shashinHighslideLinkToOriginalPhoto">'
+ public function setOriginalPhotoLinkForCaption() {
+ return '<div class="shashinLinkToOriginalPhoto">'
. '<a href="' . $this->dataObject->linkUrl . '">'
. __('View at', 'shashin')
. ' ' . ucfirst($this->dataObject->albumType)
- . '</a></div>';
+ . '</a>'
+ . '</div>';
}
- public function formatExifDataForHighslideCaption() {
+ public function setExifDataForCaption() {
$exifCaption = null;
$exifParts = array();
$photoData = $this->dataObject->getData();
@@ -89,14 +90,14 @@ public function formatExifDataForHighslideCaption() {
switch ($this->settings->captionExif) {
case'date':
if ($photoData['takenTimestamp'])
- $exifParts[] = $this->formatDateForHighslideCaption($photoData['takenTimestamp']);
+ $exifParts[] = $this->setDateForCaption($photoData['takenTimestamp']);
break;
case 'none':
break;
case 'all':
default:
if ($photoData['takenTimestamp'])
- $exifParts[] = $this->formatDateForHighslideCaption($photoData['takenTimestamp']);
+ $exifParts[] = $this->setDateForCaption($photoData['takenTimestamp']);
if ($photoData['make'])
$exifParts[] = $photoData['make'] . " " . $photoData['model'];
if ($photoData['fstop'])
@@ -110,15 +111,15 @@ public function formatExifDataForHighslideCaption() {
}
if (!empty($exifParts)) {
- $exifCaption = '<span class="shashinCaptionExif">';
- $exifCaption .= implode(', ', $exifParts);
- $exifCaption .= '</span>';
+ $exifCaption .= '<span class="shashinCaptionExif">'
+ . implode(', ', $exifParts)
+ . '</span>';
}
return $exifCaption;
}
- public function formatDateForHighslideCaption($date = null) {
+ public function setDateForCaption($date = null) {
if (!$date) {
return null;
}
View
0  Public/ShashinPhotoDisplayerPicasaHighslide.php 100644 → 100755
File mode changed
View
6 Public/ShashinPhotoDisplayerPicasaOther.php 100644 → 100755
@@ -6,13 +6,11 @@ public function __construct() {
}
public function setImgTitle() {
- $this->imgTitle = null;
-
if (in_array('images', $this->settings->otherTitle)) {
- $this->imgTitle = $this->makeTextQuotable($this->dataObject->description);
+ return parent::setImgTitle();
}
- return $this->imgTitle;
+ return null;
}
public function setImgClass() {
View
0  Public/ShashinPhotoDisplayerPicasaSource.php 100644 → 100755
File mode changed
View
0  Public/ShashinPhotoDisplayerTwitpic.php 100644 → 100755
File mode changed
View
0  Public/ShashinPhotoDisplayerTwitpicHighslide.php 100644 → 100755
File mode changed
View
6 Public/ShashinPhotoDisplayerTwitpicOther.php 100644 → 100755
@@ -6,13 +6,11 @@ public function __construct() {
}
public function setImgTitle() {
- $this->imgTitle = null;
-
if (in_array('images', $this->settings->otherTitle)) {
- $this->imgTitle = $this->makeTextQuotable($this->dataObject->description);
+ return parent::setImgTitle();
}
- return $this->imgTitle;
+ return null;
}
public function setImgClass() {
View
0  Public/ShashinPhotoDisplayerTwitpicSource.php 100644 → 100755
File mode changed
View
0  Public/ShashinPhotoDisplayerYoutube.php 100644 → 100755
File mode changed
View
0  Public/ShashinPhotoDisplayerYoutubeHighslide.php 100644 → 100755
File mode changed
View
6 Public/ShashinPhotoDisplayerYoutubeOther.php 100644 → 100755
@@ -6,13 +6,11 @@ public function __construct() {
}
public function setImgTitle() {
- $this->imgTitle = null;
-
if (in_array('images', $this->settings->otherTitle)) {
- $this->imgTitle = $this->makeTextQuotable($this->dataObject->description);
+ return parent::setImgTitle();
}
- return $this->imgTitle;
+ return null;
}
public function setImgClass() {
View
0  Public/ShashinPhotoDisplayerYoutubeSource.php 100644 → 100755
File mode changed
View
0  Public/ShashinSessionManager.php 100644 → 100755
File mode changed
View
2  ShashinWp.php
@@ -63,7 +63,7 @@ public function displayToolsMenu() {
try {
$adminContainer = new Admin_ShashinContainer($this->autoLoader);
- if ($_REQUEST['shashinMenu'] == 'photos') {
+ if (array_key_exists('shashinMenu', $_REQUEST) && $_REQUEST['shashinMenu'] == 'photos') {
$menuActionHandler = $adminContainer->getMenuActionHandlerPhotos($_REQUEST['id']);
}
View
0  Tests/Lib/UnitShashinPhotoRefData.php 100644 → 100755
File mode changed
View
0  readme.txt 100644 → 100755
File mode changed
View
0  screenshot-1.png 100644 → 100755
Diff not rendered
View
0  screenshot-2.png 100644 → 100755
Diff not rendered
View
0  screenshot-3.png 100644 → 100755
Diff not rendered
View
0  screenshot-4.png 100644 → 100755
Diff not rendered
View
22 start.php
@@ -8,10 +8,10 @@
Author URI: http://www.toppa.com
*/
-
$shashinAutoLoaderPath = dirname(__FILE__) . '/../toppa-plugin-libraries-for-wordpress/ToppaAutoLoaderWp.php';
+add_action('wpmu_new_blog', 'shashinActivateForNewNetworkSite');
register_activation_hook(__FILE__, 'shashinActivate');
-register_deactivation_hook(__FILE__, 'shashinDeactivate');
+register_deactivation_hook(__FILE__, 'shashinDeactivateForNetworkSites');
load_plugin_textdomain('shashin', false, basename(dirname(__FILE__)) . '/Languages/');
if (file_exists($shashinAutoLoaderPath)) {
@@ -22,6 +22,17 @@
$shashin->run();
}
+function shashinActivateForNewNetworkSite($blog_id) {
+ global $wpdb;
+
+ if (is_plugin_active_for_network(__FILE__)) {
+ $old_blog = $wpdb->blogid;
+ switch_to_blog($blog_id);
+ shashinActivate();
+ switch_to_blog($old_blog);
+ }
+}
+
function shashinActivate() {
$autoLoaderPath = dirname(__FILE__) . '/../toppa-plugin-libraries-for-wordpress/ToppaAutoLoaderWp.php';
@@ -50,7 +61,6 @@ function shashinActivate() {
shashinCancelActivation($status);
}
}
-
}
function shashinCancelActivation($message) {
@@ -58,6 +68,12 @@ function shashinCancelActivation($message) {
wp_die($message);
}
+function shashinDeactivateForNetworkSites() {
+ $toppaAutoLoader = new ToppaAutoLoaderWp('/toppa-plugin-libraries-for-wordpress');
+ $functionsFacade = new ToppaFunctionsFacadeWp();
+ $functionsFacade->callFunctionForNetworkSites('shashinDeactivate');
+}
+
function shashinDeactivate() {
wp_clear_scheduled_hook('shashinSync');
}
View
3  uninstall.php
@@ -5,7 +5,6 @@
}
require_once(dirname(__FILE__) . '/../toppa-plugin-libraries-for-wordpress/ToppaAutoLoaderWp.php');
-
$shashinToppaAutoLoader = new ToppaAutoLoaderWp('/toppa-plugin-libraries-for-wordpress');
$shashinAutoLoader = new ToppaAutoLoaderWp('/shashin');
$shashinAdminContainer = new Admin_ShashinContainer($shashinAutoLoader);
@@ -13,5 +12,5 @@
$shashinUninstallStatus = $shashinUninstaller->run();
if ($shashinUninstallStatus !== true) {
- trigger_error(__('Uninstall failed: ', 'shashin') . $shashinUninstallStatus, E_USER_ERROR);
+ wp_die(__('Uninstall failed: ', 'shashin') . $shashinUninstallStatus);
}
Please sign in to comment.
Something went wrong with that request. Please try again.