diff options
| author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-24 10:17:19 +0000 | 
|---|---|---|
| committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-24 10:17:19 +0000 | 
| commit | 8f175fb48e3e748fae0003214a1eabbb296c19e5 (patch) | |
| tree | b0ca796f425c4502c954440f776b962c8347c2ed | |
| parent | b9a2ed42e6a85a14113a5509accdb16ae9d8d180 (diff) | |
| download | elgg-8f175fb48e3e748fae0003214a1eabbb296c19e5.tar.gz elgg-8f175fb48e3e748fae0003214a1eabbb296c19e5.tar.bz2  | |
Widgets now reload properly
git-svn-id: https://code.elgg.org/elgg/trunk@1089 36083f99-b078-4883-b0ff-0f9b5a30f544
| -rw-r--r-- | _graphics/ajax_loader.gif (renamed from _graphics/ajax-loader.gif) | bin | 4421 -> 4421 bytes | |||
| -rw-r--r-- | views/default/widgets/editwrapper.php | 5 | ||||
| -rw-r--r-- | views/default/widgets/wrapper.php | 27 | 
3 files changed, 29 insertions, 3 deletions
diff --git a/_graphics/ajax-loader.gif b/_graphics/ajax_loader.gif Binary files differindex 5a9af96d2..5a9af96d2 100644 --- a/_graphics/ajax-loader.gif +++ b/_graphics/ajax_loader.gif diff --git a/views/default/widgets/editwrapper.php b/views/default/widgets/editwrapper.php index a01f18310..bc7d497d9 100644 --- a/views/default/widgets/editwrapper.php +++ b/views/default/widgets/editwrapper.php @@ -47,10 +47,13 @@ $(document).ready(function() {  		$("#submit<?php echo $guid; ?>").attr("disabled","disabled");
  		$("#submit<?php echo $guid; ?>").attr("value","<?php echo elgg_echo("saving"); ?>");
 +		$("#widgetcontent<?php echo $guid; ?>").html('<?php echo elgg_view('ajax/loader',array('slashes' => true)); ?>');
  		var variables = $("#widgetform<?php echo $guid; ?>").serialize();
  		$.post($("#widgetform<?php echo $guid; ?>").attr("action"),variables,function() {
 -			$("#widget<?php echo $guid; ?>").load("<?php echo $vars['url']; ?>pg/view/<?php echo $guid; ?>?shell=no&username=<?php echo page_owner_entity()->username; ?>&context=<?php echo get_context(); ?>");
 +			$("#submit<?php echo $guid; ?>").attr("disabled","");
 +			$("#submit<?php echo $guid; ?>").attr("value","<?php echo elgg_echo("save"); ?>");
 +			$("#widgetcontent<?php echo $guid; ?>").load("<?php echo $vars['url']; ?>pg/view/<?php echo $guid; ?>?shell=no&username=<?php echo page_owner_entity()->username; ?>&context=<?php echo get_context(); ?>&callback=true");
  		});
  		return false;
 diff --git a/views/default/widgets/wrapper.php b/views/default/widgets/wrapper.php index dfb8b2279..6e3e26e5d 100644 --- a/views/default/widgets/wrapper.php +++ b/views/default/widgets/wrapper.php @@ -12,6 +12,9 @@  	 */
  	static $widgettypes;
 +	
 +	$callback = get_input('callback');
 +	
  	if (!isset($widgettypes)) $widgettypes = get_widget_types();
  	if ($vars['entity'] instanceof ElggObject && $vars['entity']->getSubtype() == 'widget') {
 @@ -22,6 +25,8 @@  		$title = elgg_echo("error"); 
  	}
 +	if ($callback != "true") {
 +	
  ?>
  	<div id="widget<?php echo $vars['entity']->getGUID(); ?>">
 @@ -51,7 +56,25 @@  	?>
  	<div class="collapsable_box_content">
 -		<?php echo elgg_view("widgets/{$handler}/view",$vars); ?>
 +		<?php 
 +		
 +	} // end if callback != "true"
 +
 +		echo "<div id=\"widgetcontent{$vars['entity']->getGUID()}\">";
 +	
 +		echo elgg_view("widgets/{$handler}/view",$vars); 
 +		
 +		echo "</div>";
 +		
 +	if ($callback != "true") {
 +		
 +		?>
  	</div><!-- /.collapsable_box_content -->
  	</div><!-- /.collapsable_box -->
 -	</div>
\ No newline at end of file +	</div>
 +	
 +<?php
 +
 +	}
 +
 +?>
\ No newline at end of file  | 
