summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/apps.php35
-rw-r--r--admin/templates/apps.php4
-rw-r--r--lib/base.php12
-rw-r--r--lib/ocsclient.php2
4 files changed, 41 insertions, 12 deletions
diff --git a/admin/apps.php b/admin/apps.php
index b03357a0fb0..b433fe0875b 100644
--- a/admin/apps.php
+++ b/admin/apps.php
@@ -28,25 +28,42 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin'
exit();
}
-
// Load the files we need
//OC_UTIL::addStyle( "", "files" );
//OC_UTIL::addScript( "", "files" );
+if(isset($_GET['id'])) $id=$_GET['id']; else $id=0;
+if(isset($_GET['cat'])) $cat=$_GET['cat']; else $cat=0;
+
$categories=OC_OCSCLIENT::getCategories();
-//print_r($categories);
-$apps=OC_OCSCLIENT::getApplications($categories);
-//print_r($apps);
+if($id==0) {
+
+ if($cat==0){
+ $apps=OC_OCSCLIENT::getApplications($categories);
+ }else{
+ $apps=OC_OCSCLIENT::getApplications($cat);
+ }
+
+ // return template
+ $tmpl = new OC_TEMPLATE( "admin", "apps", "admin" );
-// return template
-$tmpl = new OC_TEMPLATE( "admin", "apps", "admin" );
+ $tmpl->assign( "categories", $categories );
+ $tmpl->assign( "apps", $apps );
+ $tmpl->printPage();
+ unset($tmpl);
-$tmpl->assign( "categories", $categories );
-$tmpl->assign( "apps", $apps );
-$tmpl->printPage();
+}else{
+ $app=OC_OCSCLIENT::getApplication($id);
+
+ $tmpl = new OC_TEMPLATE( "admin", "app", "admin" );
+ $tmpl->assign( "app", $app );
+ $tmpl->printPage();
+ unset($tmpl);
+
+}
?>
diff --git a/admin/templates/apps.php b/admin/templates/apps.php
index c3f4fdfcc19..2f584775815 100644
--- a/admin/templates/apps.php
+++ b/admin/templates/apps.php
@@ -18,9 +18,9 @@
<tbody>
<?php foreach($_["apps"] as $app): ?>
<tr>
- <td class="filename"><?php if($app["preview"] <> "") { echo('<a href=""><img border="0" src="'.$app["preview"].'" /></a>'); } ?> </a></td>
+ <td width="1"><?php if($app["preview"] <> "") { echo('<a href=""><img border="0" src="'.$app["preview"].'" /></a>'); } ?> </a></td>
<td class="filename"><a href="" title=""><?php echo $app["name"]; ?></a></td>
- <td class="date"><?php echo date($app["changed"]); ?></td>
+ <td class="date"><?php echo OC_UTIL::formatdate($app["changed"]); ?></td>
<td class="fileaction"><a href="" title=""><img src="images/drop-arrow.png" alt="+" /></a></td>
</tr>
<?php endforeach; ?>
diff --git a/lib/base.php b/lib/base.php
index 93d6fb66c7e..8504518dbfb 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -222,6 +222,18 @@ class OC_UTIL {
self::$styles[] = "$application/css/$file";
}
+ /**
+ * formats a timestamp in the "right" way
+ *
+ * @param timestamp $timestamp
+ */
+ public static function formatDate( $timestamp ){
+ $timeformat='F j, Y, H:i';
+ return date($timeformat,$timestamp);
+ }
+
+
+
/**
* check if the current server configuration is suitable for ownCloud
* @return array arrays with error messages and hints
diff --git a/lib/ocsclient.php b/lib/ocsclient.php
index e58a210077e..d9ce11d537e 100644
--- a/lib/ocsclient.php
+++ b/lib/ocsclient.php
@@ -74,7 +74,7 @@ class OC_OCSCLIENT{
$app['personid']=$tmp[$i]->personid;
$app['detailpage']=$tmp[$i]->detailpage;
$app['preview']=$tmp[$i]->smallpreviewpic1;
- $app['changed']=$tmp[$i]->changed;
+ $app['changed']=strtotime($tmp[$i]->changed);
$app['description']=$tmp[$i]->description;
$apps[]=$app;