added basic "installed apps" page
This commit is contained in:
parent
317b18bef8
commit
7ac7a6801c
4 changed files with 100 additions and 46 deletions
|
@ -7,6 +7,6 @@ OC_APP::addAdminPage( array( "id" => "core_users", "order" => 2, "href" => OC_HE
|
|||
OC_APP::addAdminPage( array( "id" => "core_apps", "order" => 3, "href" => OC_HELPER::linkTo( "admin", "apps.php" ), "name" => "Apps", "icon" => OC_HELPER::imagePath( "admin", "apps.png" )));
|
||||
|
||||
// Add subentries for App installer
|
||||
OC_APP::addNavigationSubEntry( "core_apps", array( "id" => "core_apps_installed", "order" => 4, "href" => OC_HELPER::linkTo( "admin", "apps.php?add=some¶meters=here" ), "name" => "Installed apps", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
|
||||
OC_APP::addNavigationSubEntry( "core_apps", array( "id" => "core_apps_installed", "order" => 4, "href" => OC_HELPER::linkTo( "admin", "apps.php?installed" ), "name" => "Installed apps", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
|
||||
|
||||
?>
|
||||
|
|
|
@ -34,34 +34,44 @@ OC_UTIL::addStyle( "admin", "apps" );
|
|||
|
||||
if(isset($_GET['id'])) $id=$_GET['id']; else $id=0;
|
||||
if(isset($_GET['cat'])) $cat=$_GET['cat']; else $cat=0;
|
||||
if(isset($_GET['installed'])) $installed=true; else $installed=false;
|
||||
|
||||
$categories=OC_OCSCLIENT::getCategories();
|
||||
if($categories==NULL){
|
||||
if($installed){
|
||||
global $SERVERROOT;
|
||||
$apps = OC_APPCONFIG::getApps();
|
||||
$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,
|
||||
'name' => $info['name'],
|
||||
'version' => $info['version'],
|
||||
'author' => $info['author'],
|
||||
'enabled' => OC_APP::isEnabled( $app ));
|
||||
$records[]=$record;
|
||||
}
|
||||
|
||||
$tmpl = new OC_TEMPLATE( "admin", "appsinst", "admin" );
|
||||
$tmpl->assign( "apps", $records );
|
||||
$tmpl->printPage();
|
||||
unset($tmpl);
|
||||
exit();
|
||||
}else{
|
||||
|
||||
$categories=OC_OCSCLIENT::getCategories();
|
||||
if($categories==NULL){
|
||||
OC_APP::setActiveNavigationEntry( "core_apps" );
|
||||
|
||||
$tmpl = new OC_TEMPLATE( "admin", "app_noconn", "admin" );
|
||||
$tmpl->printPage();
|
||||
unset($tmpl);
|
||||
exit();
|
||||
}
|
||||
/*
|
||||
|
||||
All
|
||||
Installed Apps
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach($categories as $key=>$value) {
|
||||
print_r($value);
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
||||
// OC_APP::setActiveNavigationEntry( "core_apps_installed" );
|
||||
|
||||
|
||||
if($id==0) {
|
||||
if($id==0) {
|
||||
OC_APP::setActiveNavigationEntry( "core_apps" );
|
||||
|
||||
if($cat==0){
|
||||
|
@ -80,7 +90,7 @@ if($id==0) {
|
|||
$tmpl->printPage();
|
||||
unset($tmpl);
|
||||
|
||||
}else{
|
||||
}else{
|
||||
OC_APP::setActiveNavigationEntry( "core_apps" );
|
||||
|
||||
$app=OC_OCSCLIENT::getApplication($id);
|
||||
|
@ -91,8 +101,7 @@ if($id==0) {
|
|||
$tmpl->printPage();
|
||||
unset($tmpl);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -7,6 +7,24 @@ table td.date
|
|||
text-align: right;
|
||||
}
|
||||
|
||||
table td.version, table td.enabled, table td.disabled
|
||||
{
|
||||
padding: 0.5em 1em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table td.enabled
|
||||
{
|
||||
color: #006600;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table td.disabled
|
||||
{
|
||||
color: #660000;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.preview
|
||||
{
|
||||
padding: 3px;
|
||||
|
|
27
admin/templates/appsinst.php
Normal file
27
admin/templates/appsinst.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
/*
|
||||
* Template for Installed Apps
|
||||
*/
|
||||
?>
|
||||
<h1><?php echo $l->t( 'Installed Applications' ); ?></h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $l->t( 'Name' ); ?></th>
|
||||
<th><?php echo $l->t( 'Version' ); ?></th>
|
||||
<th><?php echo $l->t( 'Author' ); ?></th>
|
||||
<th><?php echo $l->t( 'Status' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($_["apps"] as $app): ?>
|
||||
<tr>
|
||||
<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>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
Loading…
Reference in a new issue