Skip to content
Snippets Groups Projects
Commit 2f95b829 authored by Robin Appelman's avatar Robin Appelman
Browse files

fix disableing/enabling apps

parent 3c01c362
No related branches found
No related tags found
No related merge requests found
<?php
// Init owncloud
require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
......
$("input[x-use='appenablebutton']").live( "click", function(){
appid = $(this).parent().parent().attr("x-uid");
appid = $(this).parent().data("uid");
//alert("dsfsdfsdf");
if($(this).val() == "enabled"){
$(this).attr("value","disabled");
$(this).removeClass( "enabled" );
$(this).addClass( "disabled" );
//$.post( "ajax/disableapp.php", $(appid).serialize(), function(data){} );
$.post( "ajax/disableapp.php", { appid: appid }, function(data){ alert(data.status);});
$.post( "ajax/disableapp.php", 'appid='+appid);
}
else if($(this).val() == "disabled"){
$(this).attr("value","enabled");
$(this).removeClass( "disabled" );
$(this).addClass( "enabled" );
$.post( "ajax/enableapp.php", { appid: appid }, function(data){ alert(data.status);} );
$.post( "ajax/enableapp.php", 'appid='+appid);
}
});
\ No newline at end of file
<ul id="apps">
<?php foreach($_["apps"] as $app): ?>
<li x-uid="<?php echo($app['id']); ?>"><strong><?php echo($app['name']); ?></strong> <?php echo($app['version']); ?> <em>by <?php echo($app['author']); ?></em>
<li data-uid="<?php echo($app['id']); ?>"><strong><?php echo($app['name']); ?></strong> <?php echo($app['version']); ?> <em>by <?php echo($app['author']); ?></em>
<input x-use="appenablebutton" type="submit" value="<?php echo $l->t( $app['enabled'] ? 'enabled' : 'disabled' ); ?>" class="appbutton <?php echo( $app['enabled'] ? 'enabled' : 'disabled' ); ?>" />
</li>
<?php endforeach; ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment