Changeset 8323
- Timestamp:
- 04/05/08 20:43:39 (6 months ago)
- Files:
-
- branches/1.1/data/web/sf/sf_admin/js/double_list.js (modified) (2 diffs)
- branches/1.1/lib/helper/ObjectAdminHelper.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/data/web/sf/sf_admin/js/double_list.js
r5345 r8323 1 1 2 function double_list_move(src , dest)2 function double_list_move(srcId, destId) 3 3 { 4 var src=document.getElementById(srcId); 5 var dest=document.getElementById(destId); 4 6 for (var i = 0; i < src.options.length; i++) 5 7 { … … 13 15 } 14 16 15 function double_list_submit( form_name)17 function double_list_submit() 16 18 { 17 // default id to allow using a custom form id 18 if( ! form_name ) { 19 var form_name = 'sf_admin_edit_form'; 20 } 21 22 var form = $(form_name); 19 var form = document.getElementById('sf_admin_edit_form'); 23 20 var element; 24 21 branches/1.1/lib/helper/ObjectAdminHelper.php
r7757 r8323 6 6 * This file is part of the symfony package. 7 7 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 8 * 8 * 9 9 * For the full copyright and license information, please view the LICENSE 10 10 * file that was distributed with this source code. … … 64 64 // get the lists of objects 65 65 list($all_objects, $objects_associated, $associated_ids) = _get_object_list($object, $method, $options, $callback); 66 66 67 67 $objects_unassociated = array(); 68 68 foreach ($all_objects as $object) … … 103 103 '; 104 104 105 $response = sfContext::getInstance()->getResponse(); 106 $response->addJavascript(sfConfig::get('sf_prototype_web_dir').'/js/prototype'); 107 $response->addJavascript(sfConfig::get('sf_admin_web_dir').'/js/double_list'); 105 sfContext::getInstance()->getResponse()->addJavascript(sfConfig::get('sf_admin_web_dir').'/js/double_list.js'); 108 106 109 107 return sprintf($html, 110 108 $label_all, 111 109 $select1, 112 submit_image_tag(sfConfig::get('sf_admin_web_dir').'/images/next.png', "style=\"border: 0\" onclick=\"double_list_move( \$('{$name1}'), \$('{$name2}')); return false;\""),113 submit_image_tag(sfConfig::get('sf_admin_web_dir').'/images/previous.png', "style=\"border: 0\" onclick=\"double_list_move( \$('{$name2}'), \$('{$name1}')); return false;\""),110 submit_image_tag(sfConfig::get('sf_admin_web_dir').'/images/next.png', "style=\"border: 0\" onclick=\"double_list_move('{$name1}), '{$name2}'); return false;\""), 111 submit_image_tag(sfConfig::get('sf_admin_web_dir').'/images/previous.png', "style=\"border: 0\" onclick=\"double_list_move('{$name2}', '{$name1}'); return false;\""), 114 112 $label_assoc, 115 113 $select2