Merge branch 'master' of git://anongit.kde.org/owncloud
This commit is contained in:
commit
557b5b4b47
6 changed files with 39 additions and 4 deletions
9
admin/ajax/disableapp.php
Normal file
9
admin/ajax/disableapp.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
// Init owncloud
|
||||
require_once('../../lib/base.php');
|
||||
header( "Content-Type: application/jsonrequest" );
|
||||
|
||||
OC_APP::disable($_POST['appid']);
|
||||
|
||||
?>
|
9
admin/ajax/enableapp.php
Normal file
9
admin/ajax/enableapp.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
// Init owncloud
|
||||
require_once('../../lib/base.php');
|
||||
header( "Content-Type: application/jsonrequest" );
|
||||
|
||||
OC_APP::enable($_POST['appid']);
|
||||
|
||||
?>
|
|
@ -30,6 +30,7 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin'
|
|||
|
||||
// Load the files we need
|
||||
OC_UTIL::addStyle( "admin", "apps" );
|
||||
OC_UTIL::addScript( "admin", "apps" );
|
||||
|
||||
|
||||
if(isset($_GET['id'])) $id=$_GET['id']; else $id=0;
|
||||
|
@ -42,7 +43,6 @@ if($installed){
|
|||
$records = array();
|
||||
|
||||
OC_APP::setActiveNavigationEntry( "core_apps_installed" );
|
||||
echo count($apps);
|
||||
foreach($apps as $app){
|
||||
$info=OC_APP::getAppInfo("$SERVERROOT/apps/$app/appinfo/info.xml");
|
||||
$record = array( 'id' => $app,
|
||||
|
|
17
admin/js/apps.js
Normal file
17
admin/js/apps.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
$("div[x-use='appenableddiv']").live( "click", function(){
|
||||
appid = $(this).parent().parent().attr("x-uid");
|
||||
|
||||
if($(this).text() == "enabled"){
|
||||
$(this).html( "disabled" );
|
||||
$(this).parent().removeClass( "enabled" );
|
||||
$(this).parent().addClass( "disabled" );
|
||||
//$.post( "ajax/disableapp.php", $(appid).serialize(), function(data){} );
|
||||
$.post( "ajax/disableapp.php", { appid: appid }, function(data){ alert(data.status);});
|
||||
}
|
||||
else if($(this).text() == "disabled"){
|
||||
$(this).html( "enabled" );
|
||||
$(this).parent().removeClass( "disabled" );
|
||||
$(this).parent().addClass( "enabled" );
|
||||
$.post( "ajax/enableapp.php", { appid: appid }, function(data){ alert(data.status);} );
|
||||
}
|
||||
});
|
|
@ -16,11 +16,11 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($_["apps"] as $app): ?>
|
||||
<tr>
|
||||
<tr x-uid="<?php echo($app['id']); ?>">
|
||||
<td class="name" width="200"><?php echo($app['name']); ?></td>
|
||||
<td class="version"><?php echo($app['version']); ?></td>
|
||||
<td><?php echo($app['author']); ?></td>
|
||||
<td class="<?php echo $app['enabled'] ? 'enabled' : 'disabled' ?>"><?php echo $l->t( $app['enabled'] ? 'enabled' : 'disabled' ); ?></td>
|
||||
<td class="<?php echo $app['enabled'] ? 'enabled' : 'disabled' ?>"><div x-use="appenableddiv"><?php echo $l->t( $app['enabled'] ? 'enabled' : 'disabled' ); ?></div></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $l->t( 'Name' ); ?></th>
|
||||
<th>Groups</th>
|
||||
<th><?php echo $l->t( 'Groups' ); ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
Loading…
Reference in a new issue