Author: rande
Date: 2010-01-12 01:03:00 +0100 (Tue, 12 Jan 2010)
New Revision: 26509

Added:
   plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/widget/
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/widget/sfWidgetFormJQueryAssetSelect.class.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_edit.php
Removed:
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/widget/sfWidgetFormJQueryAssetSelect.class.php
Modified:
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/config/swDoctrineAssetsLibraryPluginConfiguration.class.php
   plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/doc/01-Installation.txt
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/doctrine/PluginsfAssetForm.class.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/sfAssetCreateFolderForm.class.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/sfAssetMassUploadForm.class.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/sfAssetMoveFolderForm.class.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/helper/sfAssetHelper.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/menu/swDoctrineAssetsLibraryMenuHandler.class.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/i18n/sfAsset.fr.xml
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/lib/BasesfAssetActions.class.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_asset.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_edit_form.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_list.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_list.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_search.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_sort.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/createFolderSuccess.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/editSuccess.php
   
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/popupLayout.php
Log:
[swDoctrineAssetsLibraryPlugin] first merge from sf1.3-vjousse, cleanup

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/config/swDoctrineAssetsLibraryPluginConfiguration.class.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/config/swDoctrineAssetsLibraryPluginConfiguration.class.php
    2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/config/swDoctrineAssetsLibraryPluginConfiguration.class.php
    2010-01-12 00:03:00 UTC (rev 26509)
@@ -8,19 +8,23 @@
     
     if($this->configuration instanceof sfApplicationConfiguration)
     {
-      $this->configuration->loadHelpers(array('Url', 'sfAsset', 'Date', 
'swToolbox', 'I18N'));
+      $this->configuration->loadHelpers(array(
+        'Url',
+        'sfAsset',
+        'Date',
+        'swToolbox',
+        'I18N',
+        'JavascriptBase'
+      ));
     }
     
-    
     if (sfConfig::get('app_swDoctrineAssetsLibrary_routes_register', true) && 
in_array('sfAsset', sfConfig::get('sf_enabled_modules', array())))
     {
      
       $this->dispatcher->connect('routing.load_configuration', 
array('sfAssetsRouting', 'listenToRoutingLoadConfigurationEvent')); 
     }
-    
 
     // register menu handler
     $this->dispatcher->notify(new 
sfEvent('swDoctrineAssetsLibraryMenuHandler', 
'sw_menu_manager.register_listener'));
-//    $this->dispatcher->notify(new sfEvent('swDoctrineAssetsLibraryPlugin', 
'sw_menu_manager.register_listener'));
   }
 }
\ No newline at end of file

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/doc/01-Installation.txt
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/doc/01-Installation.txt    
    2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/doc/01-Installation.txt    
    2010-01-12 00:03:00 UTC (rev 26509)
@@ -4,7 +4,12 @@
 
   * Get code from the svn
      $ svn co .... 
http://svn.symfony-project.com/plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.2
-     
+
+  * You will need to install/enable some other plugins
+      [php]
+      
$this->enablePlugins('sfDoctrinePlugin','sfProtoculousPlugin','swDoctrineAssetsLibraryPlugin','swFormExtraPlugin','swToolboxPlugin');
+
+
   * Set settings value in the general app.yml
       
       [yml]
@@ -53,4 +58,9 @@
   * create the database root node
       
       $ ./symfony sfAsset:create-root
+
+  * If you want to use the jQuery widget, don't forget to include the 
javascript file in your module view.yml
+      [yml]
+      all:
+        javascripts: [/swDoctrineAssetsLibraryPlugin/js/assetSelectJQuery]
       
\ No newline at end of file

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/doctrine/PluginsfAssetForm.class.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/doctrine/PluginsfAssetForm.class.php
  2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/doctrine/PluginsfAssetForm.class.php
  2010-01-12 00:03:00 UTC (rev 26509)
@@ -13,7 +13,7 @@
   public function setup()
   {
     parent::setup();
-    
+
     $this->widgetSchema['binary_content']    = new sfWidgetFormInputFile;
     $this->validatorSchema['binary_content'] = new sfValidatorFile(array(
       'required' => false

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/sfAssetCreateFolderForm.class.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/sfAssetCreateFolderForm.class.php
     2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/sfAssetCreateFolderForm.class.php
     2010-01-12 00:03:00 UTC (rev 26509)
@@ -5,7 +5,7 @@
 
   public function configure()
   {
-    $root = Doctrine::getTable('sfAssetFolder')->getTree()->findRoot();
+    $root = Doctrine::getTable('sfAssetFolder')->getTree()->fetchRoot();
 
     unset($this['folder_id']);
      
@@ -25,6 +25,7 @@
       $defaults['parent_folder'] = $this->getOption('folder')->getId();
       $this->setDefaults($defaults);
     }
+
   }
 
   public function updateObject($values = null)

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/sfAssetMassUploadForm.class.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/sfAssetMassUploadForm.class.php
       2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/sfAssetMassUploadForm.class.php
       2010-01-12 00:03:00 UTC (rev 26509)
@@ -6,7 +6,7 @@
 
   public function configure()
   {
-    $root = Doctrine::getTable('sfAssetFolder')->getTree()->findRoot();
+    $root = Doctrine::getTable('sfAssetFolder')->getTree()->fetchRoot();
 
     $this->widgetSchema['parent_folder'] = new 
swWidgetFormDoctrineSelectNestedSet(array(
       'object'    => $root,

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/sfAssetMoveFolderForm.class.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/sfAssetMoveFolderForm.class.php
       2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/form/sfAssetMoveFolderForm.class.php
       2010-01-12 00:03:00 UTC (rev 26509)
@@ -5,7 +5,7 @@
 {
   public function configure()
   {
-    $root = Doctrine::getTable('sfAssetFolder')->getTree()->findRoot();
+    $root = Doctrine::getTable('sfAssetFolder')->getTree()->fetchRoot();
 
     unset($this['name']);
     

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/helper/sfAssetHelper.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/helper/sfAssetHelper.php
   2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/helper/sfAssetHelper.php
   2010-01-12 00:03:00 UTC (rev 26509)
@@ -85,6 +85,9 @@
       case 2:
         // popup called from a simple form input (or via input_sf_asset_tag)
         return link_to_function($text, 
"setImageField('".$asset->getUrl()."')");
+      case 4:
+        // popup called from the asset widget
+        return link_to_function($text, "addAsset(".$asset->getId().", '" . 
$user->getAttribute('widgetid', -1, 'sf_admin/sf_asset/navigation') . "' , 
\"".$asset->getUrl()."\" , \"".$asset->getUrl('small')."\")");
     }
   }
   else
@@ -96,7 +99,7 @@
 
 function init_asset_library()
 {
-  use_helper('Javascript');
+
   use_javascript('/swDoctrineAssetsLibraryPlugin/js/main', 'last');
 
   echo 
javascript_tag('sfAssetsLibrary.init(\''.url_for('sfAsset/list?popup=2').'\')');
@@ -113,7 +116,7 @@
 
 function input_sf_asset_tag($name, $value, $options = array())
 {
-  use_helper('Form', 'I18N');
+  
   use_javascript('/swDoctrineAssetsLibraryPlugin/js/main', 'last');
   $options = _convert_options($options);
   $type = 'all';
@@ -182,7 +185,14 @@
     else
     {
       $current_dir .= $i ? '/' . $dir : $dir;
-      $html .= link_to_asset($dir, 'sfAsset/'.$action.'?dir='.$current_dir) 
.'<span class="crumb">/</span>';
+      $pattern='';
+
+      if($action == 'list')
+        $pattern = '@sf_asset_library_dir?dir=';
+      else
+        $pattern = 'sfAsset/'.$action.'?dir=';
+    
+        $html .= link_to_asset($dir, $pattern.$current_dir) .'<span 
class="crumb">/</span>';
     }
     $i++;
   }

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/menu/swDoctrineAssetsLibraryMenuHandler.class.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/menu/swDoctrineAssetsLibraryMenuHandler.class.php
  2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/menu/swDoctrineAssetsLibraryMenuHandler.class.php
  2010-01-12 00:03:00 UTC (rev 26509)
@@ -4,11 +4,11 @@
 {
   public function buildMenu(array $menus, sfActionStackEntry $action_entry)
   {
+
     $menus['main']->addChild(new swMenuElement(array(
       'route' => 'sfAsset/index',
       'name'  => 'media'
     )));
     
-    
   }
 }
\ No newline at end of file

Deleted: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/widget/sfWidgetFormJQueryAssetSelect.class.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3-vjousse/lib/widget/sfWidgetFormJQueryAssetSelect.class.php
     2010-01-11 23:32:00 UTC (rev 26507)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/widget/sfWidgetFormJQueryAssetSelect.class.php
     2010-01-12 00:03:00 UTC (rev 26509)
@@ -1,128 +0,0 @@
-<?php
-
-/*
- * This file is part of the symfony package.
- * (c) Fabien Potencier <[email protected]>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * sfWidgetFormJQueryDate represents a date widget rendered by JQuery UI.
- *
- * This widget needs JQuery and JQuery UI to work.
- *
- * @package    symfony
- * @subpackage widget
- * @author     Vincent Jousse <[email protected]>
-
- */
-class sfWidgetFormJQueryAssetSelect extends sfWidgetForm
-{
-  /**
-   * Configures the current widget.
-   *
-   * Available options:
-   *
-   *  * image:   The image path to represent the widget (false by default)
-   *  * config:  A JavaScript array that configures the JQuery date widget
-   *  * culture: The user culture
-   *
-   * @param array $options     An array of options
-   * @param array $attributes  An array of default HTML attributes
-   *
-   * @see sfWidgetForm
-   */
-  protected function configure($options = array(), $attributes = array())
-  {
-    $this->addOption('many', false);
-    $this->addRequiredOption('assets');
-
-
-    parent::configure($options, $attributes);
-
-  }
-
-  /**
-   * @param  string $name        The element name
-   * @param  string $value       The date displayed in this widget
-   * @param  array  $attributes  An array of HTML attributes to be merged with 
the default HTML attributes
-   * @param  array  $errors      An array of errors for the field
-   *
-   * @return string An HTML tag string
-   *
-   * @see sfWidgetForm
-   */
-  public function render($name, $value = null, $attributes = array(), $errors 
= array())
-  {
-    if (!is_array($value))
-    {
-      $value = array($value);
-    }
-
-    $assets = $this->getOption('assets');
-
-
-    if ($assets instanceof sfAsset)
-    {
-      $assets = array($assets);
-    }
-
-
-    //var_dump($this->getOption('assets'));exit;
-
-    $prefix = $this->generateId($name);
-    $html='
-    <style type="text/css">
-    .sortableJ{
-    margin:10px 0px 20px 0px;
-    padding:0px;
-    width:100%;
-    }
-
-    .sortableJ li{
-    float:left;
-    list-style:none;
-    display:block;
-    padding: 5px 5px 5px 5px;
-    text-align: center;
-    }
-
-    </style>
-
-    <script type="text/javascript">
-    ';
-
-    if($this->getOption('many')) $many=1; else $many=0;
-
-    if($many) $text = 'Ajouter une autre image'; else $text= 'Choisir une 
image';
-
-    $html.='
-      var assetsFormName=\'' . $name . '\';
-      var isMany' . $prefix . '=' .  $many . ';
-
-
-      $(document).ready(function(){';
-      foreach($assets as $asset)
-      {
-
-        $html.='addAssetToTab(\'' . $prefix . '\',' . $asset->id . 
',\''.$asset->getUrl('small').'\');';
-      }
-        
-    $html.='
-      });
-    </script>
-    
-    ' . 
link_to($text,'sfAsset/list?popup=4&widgetid='.$prefix,array('class'=>'iframe')).'
-    
-    <div id="assets_content_' . $prefix . '">
-      <ul class="sortableJ"></ul>
-    </div>
-
-    ';
-
-    return $html;
-
-  }
-}

Copied: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/widget/sfWidgetFormJQueryAssetSelect.class.php
 (from rev 26507, 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3-vjousse/lib/widget/sfWidgetFormJQueryAssetSelect.class.php)
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/widget/sfWidgetFormJQueryAssetSelect.class.php
                             (rev 0)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/lib/widget/sfWidgetFormJQueryAssetSelect.class.php
     2010-01-12 00:03:00 UTC (rev 26509)
@@ -0,0 +1,128 @@
+<?php
+
+/*
+ * This file is part of the symfony package.
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/**
+ * sfWidgetFormJQueryDate represents a date widget rendered by JQuery UI.
+ *
+ * This widget needs JQuery and JQuery UI to work.
+ *
+ * @package    symfony
+ * @subpackage widget
+ * @author     Vincent Jousse <[email protected]>
+
+ */
+class sfWidgetFormJQueryAssetSelect extends sfWidgetForm
+{
+  /**
+   * Configures the current widget.
+   *
+   * Available options:
+   *
+   *  * image:   The image path to represent the widget (false by default)
+   *  * config:  A JavaScript array that configures the JQuery date widget
+   *  * culture: The user culture
+   *
+   * @param array $options     An array of options
+   * @param array $attributes  An array of default HTML attributes
+   *
+   * @see sfWidgetForm
+   */
+  protected function configure($options = array(), $attributes = array())
+  {
+    $this->addOption('many', false);
+    $this->addRequiredOption('assets');
+
+
+    parent::configure($options, $attributes);
+
+  }
+
+  /**
+   * @param  string $name        The element name
+   * @param  string $value       The date displayed in this widget
+   * @param  array  $attributes  An array of HTML attributes to be merged with 
the default HTML attributes
+   * @param  array  $errors      An array of errors for the field
+   *
+   * @return string An HTML tag string
+   *
+   * @see sfWidgetForm
+   */
+  public function render($name, $value = null, $attributes = array(), $errors 
= array())
+  {
+    if (!is_array($value))
+    {
+      $value = array($value);
+    }
+
+    $assets = $this->getOption('assets');
+
+
+    if ($assets instanceof sfAsset)
+    {
+      $assets = array($assets);
+    }
+
+
+    //var_dump($this->getOption('assets'));exit;
+
+    $prefix = $this->generateId($name);
+    $html='
+    <style type="text/css">
+    .sortableJ{
+    margin:10px 0px 20px 0px;
+    padding:0px;
+    width:100%;
+    }
+
+    .sortableJ li{
+    float:left;
+    list-style:none;
+    display:block;
+    padding: 5px 5px 5px 5px;
+    text-align: center;
+    }
+
+    </style>
+
+    <script type="text/javascript">
+    ';
+
+    if($this->getOption('many')) $many=1; else $many=0;
+
+    if($many) $text = 'Ajouter une autre image'; else $text= 'Choisir une 
image';
+
+    $html.='
+      var assetsFormName=\'' . $name . '\';
+      var isMany' . $prefix . '=' .  $many . ';
+
+
+      $(document).ready(function(){';
+      foreach($assets as $asset)
+      {
+
+        $html.='addAssetToTab(\'' . $prefix . '\',' . $asset->id . 
',\''.$asset->getUrl('small').'\');';
+      }
+        
+    $html.='
+      });
+    </script>
+    
+    ' . 
link_to($text,'sfAsset/list?popup=4&widgetid='.$prefix,array('class'=>'iframe')).'
+    
+    <div id="assets_content_' . $prefix . '">
+      <ul class="sortableJ"></ul>
+    </div>
+
+    ';
+
+    return $html;
+
+  }
+}

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/i18n/sfAsset.fr.xml
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/i18n/sfAsset.fr.xml
    2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/i18n/sfAsset.fr.xml
    2010-01-12 00:03:00 UTC (rev 26509)
@@ -334,6 +334,26 @@
         <source>Insert</source>
         <target>Insérer</target>
       </trans-unit>
+      <trans-unit>
+        <source>Add a file</source>
+        <target>Ajouter un fichier</target>
+      </trans-unit>
+      <trans-unit>
+        <source>Author</source>
+        <target>Auteur</target>
+      </trans-unit>
+      <trans-unit>
+        <source>Binary content</source>
+        <target>Fichier</target>
+      </trans-unit>
+      <trans-unit>
+        <source>Parent folder</source>
+        <target>Répertoire parent</target>
+      </trans-unit>
+      <trans-unit>
+        <source>Name</source>
+        <target>Nom</target>
+      </trans-unit>
     </body>
   </file>
 </xliff>
\ No newline at end of file

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/lib/BasesfAssetActions.class.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/lib/BasesfAssetActions.class.php
       2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/lib/BasesfAssetActions.class.php
       2010-01-12 00:03:00 UTC (rev 26509)
@@ -24,11 +24,25 @@
         {
           $this->getUser()->setAttribute('popup', $popup, 
'sf_admin/sf_asset/navigation');
         }
+
+        //Used by the jquery widget
+        if ($request->getParameter('widgetid'))
+        {
+          $this->getUser()->setAttribute('widgetid', 
$request->getParameter('widgetid'), 'sf_admin/sf_asset/navigation');
+
+        }
         $this->getUser()->setFlash('sfAsset_folder_not_found', true);
         $this->redirect('sfAsset/list');
       }
     }
 
+    //Used by the jquery widget
+    if ($request->getParameter('widgetid'))
+    {
+      $this->getUser()->setAttribute('widgetid', 
$request->getParameter('widgetid'), 'sf_admin/sf_asset/navigation');
+
+    }
+
     $this->folder = $folder;
 
     // search option

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_asset.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_asset.php
   2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_asset.php
   2010-01-12 00:03:00 UTC (rev 26509)
@@ -1,4 +1,3 @@
-<?php use_helper('sfAsset') ?>
 <div class="assetImage">
   <div class="thumbnails">
     <?php echo link_to_asset_action(asset_image_tag($sf_asset, 'small', 
array('width' => 84), isset($folder) ? $folder->getRelativePath() : null), 
$sf_asset) ?>

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_edit_form.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_edit_form.php
       2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_edit_form.php
       2010-01-12 00:03:00 UTC (rev 26509)
@@ -1,4 +1,32 @@
+<?php if ($form->hasGlobalErrors()): ?>
+
+        <ul class="error_list">
+          <?php foreach ($form->getGlobalErrors() as $name => $error): ?>
+            <li><?php echo $name.': '.$error ?></li>
+          <?php endforeach; ?>
+        </ul>
+
+<?php endif; ?>
+
 <form action="<?php echo url_for('sfAsset/update?id='.$sf_asset->getId()) ?>" 
method="post" enctype="multipart/form-data">
+
+<fieldset id="sf_fieldset_none" class="">
+
+  <div class="form-row">
+    <div class="content">
+    <?php echo __('Path:', null, 'sfAsset') ?>
+    <?php if (!$sf_asset->isNew()): ?>
+      <?php echo assets_library_breadcrumb($sf_asset->getFolderPath(ESC_RAW), 
true, 'list') ?><?php echo $sf_asset->getFilename(); ?>
+    <?php endif ?>
+    </div>
+  </div>
+
+</fieldset>
+
+<fieldset id="sf_fieldset_meta" class="">
+  <table>
   <?php echo $form ?>
+  </table>
   <input type="submit" name="submit" />
+</fieldset>
 </form>
\ No newline at end of file

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_list.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_list.php
    2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_list.php
    2010-01-12 00:03:00 UTC (rev 26509)
@@ -1,4 +1,3 @@
-<?php use_helper('sfAsset') ?>
 <div id="sf_asset_breadcrumbs">
    <?php echo assets_library_breadcrumb($folder->getRelativePath(ESC_RAW)) ?>
 </div>
@@ -11,22 +10,22 @@
     <div class="assetComment" id="ajax_dir_0">..</div>
   </div>
 <?php endif; ?>
-
-<?php if($folder->getNode()->hasChildren()): ?>
-  <?php foreach ($folder->getNode()->getChildren() as $dir): ?>
-    <div class="assetImage">
-      <div class="thumbnails">
-        <?php echo link_to_asset(
-          image_tag('/swDoctrineAssetsLibraryPlugin/images/folder', 
'size=64x64 title='.$dir->getName()), 
-          '@sf_asset_library_dir?dir='.$dir->getRelativePath()) 
-        ?>
-      </div>
-      <div class="assetComment"><?php echo auto_wrap_text($dir->getName()) ?>
-      </div>
-    </div>
-  <?php endforeach; ?>
-<?php endif; ?>
-
-<?php foreach ($folder->getsfAssets() as $sf_asset): ?>
-  <?php include_partial('sfAsset/asset', array('sf_asset' => $sf_asset, 
'folder' => $folder)) ?>
+
+<?php if($folder->getNode()->hasChildren()): ?>
+  <?php foreach ($folder->getNode()->getChildren() as $dir): ?>
+    <div class="assetImage">
+      <div class="thumbnails">
+        <?php echo link_to_asset(
+          image_tag('/swDoctrineAssetsLibraryPlugin/images/folder', 
'size=64x64 title='.$dir->getName()), 
+          '@sf_asset_library_dir?dir='.$dir->getRelativePath()) 
+        ?>
+      </div>
+      <div class="assetComment"><?php echo auto_wrap_text($dir->getName()) ?>
+      </div>
+    </div>
+  <?php endforeach; ?>
+<?php endif; ?>
+
+<?php foreach ($folder->getsfAssets() as $sf_asset): ?>
+  <?php include_partial('sfAsset/asset', array('sf_asset' => $sf_asset, 
'folder' => $folder)) ?>
 <?php endforeach; ?>
\ No newline at end of file

Copied: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_edit.php
 (from rev 24320, 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.2-vjousse/modules/sfAsset/templates/_sidebar_edit.php)
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_edit.php
                            (rev 0)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_edit.php
    2010-01-12 00:03:00 UTC (rev 26509)
@@ -0,0 +1,11 @@
+<?php use_helper('JavascriptBase', 'sfAsset') ?>
+
+<?php if (!$sf_asset->isNew()): ?>
+  <div id="thumbnail">
+    <a href="<?php echo $sf_asset->getUrl('full') ?>"><?php echo 
asset_image_tag($sf_asset, 'large', array('title' => __('See full-size 
version', null, 'sfAsset')), null) ?></a>
+  </div>
+  <p><?php echo auto_wrap_text($sf_asset->getFilename()) ?></p>
+  <p><?php echo __('%weight% Kb', array('%weight%' => 
$sf_asset->getFilesize()), 'sfAsset') ?></p>
+  <p><?php echo __('Created on %date%', array('%date%' => 
format_date($sf_asset->getCreatedAt('U'))), 'sfAsset') ?></p>
+
+<?php endif ?>

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_list.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_list.php
    2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_list.php
    2010-01-12 00:03:00 UTC (rev 26509)
@@ -1,5 +1,3 @@
-<?php use_helper('Javascript', 'sfAsset') ?>
-
 <?php if ($folder->getNode()->isRoot()): ?>
 <div class="form-row">
   <?php echo image_tag('/swDoctrineAssetsLibraryPlugin/images/images.png', 
'align=top') ?>
@@ -16,20 +14,25 @@
   </label>
   
   <div id="input_new_file" style="display: none">
-    <?php echo $quickAddForm['description']->renderLabel() ?> <br />
+    <?php echo 
$quickAddForm['description']->renderLabel(__('Description',null,'sfAsset')) ?> 
<br />
     <?php echo $quickAddForm['description'] ?> <br />
     
-    <?php echo $quickAddForm['author']->renderLabel() ?> <br />
+    <?php echo 
$quickAddForm['author']->renderLabel(__('Author',null,'sfAsset')) ?> <br />
     <?php echo $quickAddForm['author'] ?> <br />
     
-    <?php echo $quickAddForm['copyright']->renderLabel() ?> <br />
+    <?php echo 
$quickAddForm['copyright']->renderLabel(__('Copyright',null,'sfAsset')) ?> <br 
/>
     <?php echo $quickAddForm['copyright'] ?> <br />
     
-    <?php echo $quickAddForm['binary_content']->renderLabel() ?> <br />
+    <?php echo $quickAddForm['binary_content']->renderLabel(__('Binary 
content',null,'sfAsset')) ?> <br />
     <?php echo $quickAddForm['binary_content'] ?> <br />
 
     <input type="submit" name="add" value="<?php echo __('Add', null, 
'sfAsset') ?>"/>
   </div>
+<?php
+if(isset($quickAddForm[sfForm::getCSRFFieldName()])) {
+echo $quickAddForm['_csrf_token'];
+}
+?>
 </form>
 
 
@@ -40,10 +43,29 @@
   </label>
   <div id="input_new_directory" style="display: none">
     <table>
-      <?php echo $createFolderForm ?>
-    </table>
+      <tr>
+        <th>
+          <?php echo 
$createFolderForm['name']->renderLabel(__('Name',null,'sfAsset')) ?>
+        </th>
+        <td>
+          <?php echo $createFolderForm['name'] ?>
+        </td>
+      </tr>
+      <tr>
+        <th>
+          <?php echo 
$createFolderForm['parent_folder']->renderLabel(__('Parent 
folder',null,'sfAsset')) ?>
+        </th>
+        <td>
+          <?php echo $createFolderForm['parent_folder'] ?><br />
+        </td>
+      </tr>    </table>
     <input type="submit" name="create" value="<?php echo __('Create', null, 
'sfAsset') ?>"/>
   </div>
+<?php
+if(isset($createFolderForm[sfForm::getCSRFFieldName()])) {
+echo $createFolderForm['_csrf_token'];
+}
+?>
 </form>
     
 <?php if (!$folder->getNode()->isRoot()): ?>

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_search.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_search.php
  2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_search.php
  2010-01-12 00:03:00 UTC (rev 26509)
@@ -1,5 +1,3 @@
-<?php use_helper('Javascript') ?>
-
 <div class="form-row">
   <?php echo image_tag('/swDoctrineAssetsLibraryPlugin/images/magnifier.png', 
'align=top') ?>
   <?php echo link_to_function(

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_sort.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_sort.php
    2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_sidebar_sort.php
    2010-01-12 00:03:00 UTC (rev 26509)
@@ -1,4 +1,3 @@
-<?php use_helper('sfAsset') ?>
 <div class="form-row">
   <?php $sort = $sf_user->getAttribute('sort', 'name', 
'sf_admin/sf_asset/sort') ?>
   <label>

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/createFolderSuccess.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/createFolderSuccess.php
      2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/createFolderSuccess.php
      2010-01-12 00:03:00 UTC (rev 26509)
@@ -1,4 +1,5 @@
-<?php use_helper('Validation', 'I18N') ?>
+<?php use_helper('Javascript') ?>
+<?php use_helper('Validation') ?>
 
 <h2><?php echo __('Create a new folder', null, 'sfAsset') ?></h2>
 

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/editSuccess.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/editSuccess.php
      2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/editSuccess.php
      2010-01-12 00:03:00 UTC (rev 26509)
@@ -1,11 +1,13 @@
 <?php use_stylesheet('/sf/sf_admin/css/main') ?>
 
-<?php use_helper('I18N', 'Date')?>
-
 <h2><?php echo __('Asset edition', null, 'sfAsset') ?></h2>
 
 <?php include_partial('sfAsset/edit_header', array('sf_asset' => $sf_asset)) ?>
 
+<div id="sf_asset_bar">
+  <?php include_partial('sfAsset/sidebar_edit', array('sf_asset' => 
$sf_asset)); ?>
+</div>
+
 <div id="sf_asset_container">
   <?php include_partial('sfAsset/messages', array('sf_asset' => $sf_asset)) ?>
   <?php include_partial('sfAsset/edit_form', array('sf_asset' => $sf_asset, 
'form' => $form)) ?>

Modified: 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/popupLayout.php
===================================================================
--- 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/popupLayout.php
      2010-01-12 00:01:14 UTC (rev 26508)
+++ 
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/popupLayout.php
      2010-01-12 00:03:00 UTC (rev 26509)
@@ -5,6 +5,8 @@
     <?php include_metas() ?>
     <?php include_title() ?>
     <link rel="shortcut icon" href="/favicon.ico" />
+    <?php include_javascripts() ?>
+    <?php include_stylesheets() ?>
   </head>
   <body>
     <div id="page">

-- 
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