Skip to content
Snippets Groups Projects
Commit 1372d833 authored by Frank Karlitschek's avatar Frank Karlitschek
Browse files

add a date format function for more eyecandy

parent cf50c497
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
?>
......
......@@ -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; ?>
......
......@@ -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
......
......@@ -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;
......
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