Author: garak
Date: 2010-09-10 15:56:34 +0200 (Fri, 10 Sep 2010)
New Revision: 30876

Modified:
   plugins/sfAssetsLibraryPlugin/branches/1.3/README
   plugins/sfAssetsLibraryPlugin/branches/1.3/lib/helper/sfAssetHelper.php
   plugins/sfAssetsLibraryPlugin/branches/1.3/lib/model/plugin/PluginsfAsset.php
   plugins/sfAssetsLibraryPlugin/branches/1.3/test/unit/sfAssetTest.php
Log:
[sfAssetsLibraryPlugin] fixed slash on relative URLs not working on Windows.


Modified: plugins/sfAssetsLibraryPlugin/branches/1.3/README
===================================================================
--- plugins/sfAssetsLibraryPlugin/branches/1.3/README   2010-09-10 09:09:22 UTC 
(rev 30875)
+++ plugins/sfAssetsLibraryPlugin/branches/1.3/README   2010-09-10 13:56:34 UTC 
(rev 30876)
@@ -210,21 +210,24 @@
     [php]
     <?php use_helper('sfAsset') ?>
     <?php use_javascript('tiny_mce/tiny_mce') /* must point to your actual 
path of tinyMCE */ ?>
+    <?php use_javascript('tiny_mce/setup) /* you must create setup.js, see 
below */ ?>
     <?php echo init_asset_library() ?>
 
-The next thing to do is to pass a special JavaScript callback function to the
-TinyMCE object at initialization. This should be done in you tinyMCE's 
configuration file:
+You need to create a setup.js file in tiny_mce directory (you can name this 
file as you
+prefer and store it whenever you want, as long as you point it correctly).
+This is an example of its content:
 
     [javascript]
     tinyMCE.init({
       theme : "advanced",
       mode: "textareas",
       editor_selector : "rich",
+      relative_urls: false,
       file_browser_callback : 'sfAssetsLibrary.fileBrowserCallBack'
     });
 
-If you use the configuration above, you can add tinyMCE to all your textarea's 
with class
-"rich" (with generator.yml in admin generator, or with form templates 
otherwise).
+Please refer to (official 
documentation)[http://wiki.moxiecode.com/index.php/TinyMCE:Configuration]
+for more detailed configuration.
 
 That's it, the TinyMCE file browser is now the `sfAssetsLibrary`'s one.
 
@@ -235,14 +238,12 @@
 
     [yml]
     generator:
-      class:              sfPropelGenerator
-      param:
-        model_class:      Post
-        theme:            admin
-
+    # ...
         config:
+      # ...
+        form:
           fields:
-            content: { class: rich }
+            foo: { attributes: { class: rich, rows: 5, cols: 70 } }
 
 
 Using the form's widget
@@ -293,7 +294,6 @@
 TODO
 ----
 
-* Check Windows compatibility
 * Make list of ignored files and folders configurable in synchronize task
 * 100% model coverage for unit tests
 * Drag and drop manipulation for file and folders

Modified: 
plugins/sfAssetsLibraryPlugin/branches/1.3/lib/helper/sfAssetHelper.php
===================================================================
--- plugins/sfAssetsLibraryPlugin/branches/1.3/lib/helper/sfAssetHelper.php     
2010-09-10 09:09:22 UTC (rev 30875)
+++ plugins/sfAssetsLibraryPlugin/branches/1.3/lib/helper/sfAssetHelper.php     
2010-09-10 13:56:34 UTC (rev 30876)
@@ -129,7 +129,7 @@
   // this trick is need to get the web debug toolbar. Dunno why :-|
   if (sfConfig::get('sf_web_debug'))
   {
-    $debug = current(sfContext::getInstance()->getLogger()->getLoggers());;
+    $debug = current(sfContext::getInstance()->getLogger()->getLoggers());
     $content = $debug->filterResponseContent($event, $content);
   }
 

Modified: 
plugins/sfAssetsLibraryPlugin/branches/1.3/lib/model/plugin/PluginsfAsset.php
===================================================================
--- 
plugins/sfAssetsLibraryPlugin/branches/1.3/lib/model/plugin/PluginsfAsset.php   
    2010-09-10 09:09:22 UTC (rev 30875)
+++ 
plugins/sfAssetsLibraryPlugin/branches/1.3/lib/model/plugin/PluginsfAsset.php   
    2010-09-10 13:56:34 UTC (rev 30876)
@@ -73,7 +73,7 @@
     $url = sfAssetsLibraryTools::getMediaDir();
     if ($thumbnail_type == 'full')
     {
-      $url .= $relative_path . DIRECTORY_SEPARATOR . $this->getFilename();
+      $url .= $relative_path . '/' . $this->getFilename();
     }
     else
     {

Modified: plugins/sfAssetsLibraryPlugin/branches/1.3/test/unit/sfAssetTest.php
===================================================================
--- plugins/sfAssetsLibraryPlugin/branches/1.3/test/unit/sfAssetTest.php        
2010-09-10 09:09:22 UTC (rev 30875)
+++ plugins/sfAssetsLibraryPlugin/branches/1.3/test/unit/sfAssetTest.php        
2010-09-10 13:56:34 UTC (rev 30876)
@@ -29,17 +29,17 @@
   $sfAsset->setFilename('filename.jpg');
 
   $t->diag('sfAsset::getRelativePath()');
-  $t->is($sfAsset->getRelativePath(), 
sfConfig::get('app_sfAssetsLibrary_upload_dir') .  DIRECTORY_SEPARATOR . 
'filename.jpg', 'getRelativePath() returns the path relative to the media 
directory');
+  $t->is($sfAsset->getRelativePath(), 
sfConfig::get('app_sfAssetsLibrary_upload_dir') .  '/filename.jpg', 
'getRelativePath() returns the path relative to the media directory');
 
   $t->diag('sfAsset::getFullPath()');
-  $t->is($sfAsset->getFullPath(), sfConfig::get('sf_web_dir'). 
DIRECTORY_SEPARATOR . sfConfig::get('app_sfAssetsLibrary_upload_dir') . 
DIRECTORY_SEPARATOR .'filename.jpg', 'getFullPath() returns the complete asset 
path on the disk');
-  $t->is($sfAsset->getFullPath('small'), sfConfig::get('sf_web_dir'). 
DIRECTORY_SEPARATOR . sfConfig::get('app_sfAssetsLibrary_upload_dir') 
.DIRECTORY_SEPARATOR .'thumbnail/small_filename.jpg', 'getFullPath(\'small\') 
returns the complete small thumbnail path on the disk');
-  $t->is($sfAsset->getFullPath('large'), sfConfig::get('sf_web_dir'). 
DIRECTORY_SEPARATOR . sfConfig::get('app_sfAssetsLibrary_upload_dir') 
.DIRECTORY_SEPARATOR .'thumbnail/large_filename.jpg', 'getFullPath(\'large\') 
returns the complete large thumbnail path on the disk');
+  $t->is($sfAsset->getFullPath(), sfConfig::get('sf_web_dir'). '/' . 
sfConfig::get('app_sfAssetsLibrary_upload_dir') . '/filename.jpg', 
'getFullPath() returns the complete asset path on the disk');
+  $t->is($sfAsset->getFullPath('small'), sfConfig::get('sf_web_dir'). '/' . 
sfConfig::get('app_sfAssetsLibrary_upload_dir') . 
'/thumbnail/small_filename.jpg', 'getFullPath(\'small\') returns the complete 
small thumbnail path on the disk');
+  $t->is($sfAsset->getFullPath('large'), sfConfig::get('sf_web_dir'). '/' . 
sfConfig::get('app_sfAssetsLibrary_upload_dir') . 
'/thumbnail/large_filename.jpg', 'getFullPath(\'large\') returns the complete 
large thumbnail path on the disk');
 
   $t->diag('sfAsset::getUrl()');
-  $t->is($sfAsset->getUrl(), DIRECTORY_SEPARATOR . 
sfConfig::get('app_sfAssetsLibrary_upload_dir') .DIRECTORY_SEPARATOR . 
'filename.jpg', 'getUrl() returns the asset URL');
-  $t->is($sfAsset->getUrl('small'),DIRECTORY_SEPARATOR . 
sfConfig::get('app_sfAssetsLibrary_upload_dir') .DIRECTORY_SEPARATOR 
.'thumbnail/small_filename.jpg', 'getUrl(\'small\') returns the small thumbnail 
url');
-  $t->is($sfAsset->getUrl('large'),DIRECTORY_SEPARATOR . 
sfConfig::get('app_sfAssetsLibrary_upload_dir') .DIRECTORY_SEPARATOR 
.'thumbnail/large_filename.jpg', 'getUrl(\'large\') returns the large thumbnail 
url');
+  $t->is($sfAsset->getUrl(), '/' . 
sfConfig::get('app_sfAssetsLibrary_upload_dir') . '/filename.jpg', 'getUrl() 
returns the asset URL');
+  $t->is($sfAsset->getUrl('small'), '/' . 
sfConfig::get('app_sfAssetsLibrary_upload_dir') . 
'/thumbnail/small_filename.jpg', 'getUrl(\'small\') returns the small thumbnail 
url');
+  $t->is($sfAsset->getUrl('large'), '/' . 
sfConfig::get('app_sfAssetsLibrary_upload_dir') . 
'/thumbnail/large_filename.jpg', 'getUrl(\'large\') returns the large thumbnail 
url');
 
   $t->diag('sfAsset::create()');
   $assets_path = dirname(__FILE__).'/../assets/';
@@ -56,7 +56,7 @@
   $t->is($asset1->getFilename(), 'raikkonen.jpg', 'create() sets the object 
filename according to the given asset');
   $t->is($asset1->getFilesize(), 18, 'create() sets the object filesize 
according to the given asset');
   $t->ok($asset1->isImage(), 'create() sets the object type according to the 
given asset');
-  $t->is($asset1->getUrl(), $folder1->getUrl() . DIRECTORY_SEPARATOR . 
$asset1->getFilename(), 'create() sets the object url according to the given 
asset and folder object');
+  $t->is($asset1->getUrl(), $folder1->getUrl() . '/' . $asset1->getFilename(), 
'create() sets the object url according to the given asset and folder object');
   $t->ok(is_file($asset1->getFullPath()), 'create() physically copies asset');
   $t->ok(is_file($asset1->getFullPath('large')), 'create() physically creates 
thumbnail');
 
@@ -65,7 +65,7 @@
   $old_thumb_path = $asset1->getFullPath('large');
   $asset1->move($root, 'raikkonen2.jpg');
   $t->is($asset1->getFilename(), 'raikkonen2.jpg', 'move() changes filename');
-  $t->is($asset1->getUrl(), $root->getUrl() . DIRECTORY_SEPARATOR . 
$asset1->getFilename(), 'move() changes the object url according to the new 
folder');
+  $t->is($asset1->getUrl(), $root->getUrl() . '/' . $asset1->getFilename(), 
'move() changes the object url according to the new folder');
   $t->ok(is_file($asset1->getFullPath()), 'move() physically moves asset to 
the new location');
   $t->ok(!is_file($old_path), 'move() physically removes asset from the 
previous location');
   $t->ok(is_file($asset1->getFullPath('large')), 'move() physically moves 
thumbnail to the new location');

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to