<?php
-OC_APP::register( array( "id" => "admin", "name" => "Administration" ));
+OC_APP::register( array( "order" => 1, "id" => "admin", "name" => "Administration" ));
if( OC_USER::ingroup( $_SESSION['username'], 'admin' ))
{
- OC_UTIL::addNavigationEntry( array( "app" => "admin", "file" => "index.php", "name" => "Administration" ));
+ OC_UTIL::addNavigationEntry( array( "id" => "admin_index", "order" => 1, "href" => OC_HELPER::linkTo( "admin", "index.php" ), "icon" => OC_HELPER::imagePath( "admin", "navicon.png" ), "name" => "Administration" ));
}
-OC_UTIL::addAdminPage( array( "app" => "admin", "file" => "system.php", "name" => "System Settings" ));
-OC_UTIL::addAdminPage( array( "app" => "admin", "file" => "users.php", "name" => "Users" ));
-OC_UTIL::addAdminPage( array( "app" => "admin", "file" => "plugins.php", "name" => "Plugins" ));
+OC_UTIL::addAdminPage( array( "order" => 1, "href" => OC_HELPER::linkTo( "admin", "system.php" ), "name" => "System settings" ));
+OC_UTIL::addAdminPage( array( "order" => 2, "href" => OC_HELPER::linkTo( "admin", "users.php" ), "name" => "Users" ));
+OC_UTIL::addAdminPage( array( "order" => 3, "href" => OC_HELPER::linkTo( "admin", "plugins.php" ), "name" => "Plugins" ));
?>
$adminpages = array();
-foreach( OC_APP::list() as $i ){
+foreach( OC_UTIL::$adminpages as $i ){
// Do some more work here soon
$adminpages[] = $i;
}
<ul>
<? foreach( $_["adminpages"] as $i ){ ?>
- <li><a href="<? echo link_to( $i["app"], $i["file"] ) ?>"><? echo $i["name"] ?></a></li>
+ <li><a href="<? echo $i["href"] ?>"><? echo $i["name"] ?></a></li>
<? } ?>
</ul>
<?php
-OC_APP::register( array( "id" => "files", "name" => "Files" ));
-OC_UTIL::addNavigationEntry( array( "app" => "files", "file" => "index.php", "name" => "Files" ));
-OC_UTIL::addAdminPage( array( "app" => "files", "file" => "admin.php", "name" => "Files" ));
+OC_APP::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
+
+OC_UTIL::addNavigationEntry( array( "id" => "files_index", "order" => 1, "href" => OC_HELPER::linkTo( "files", "index.php" ), "icon" => OC_HELPER::imagePath( "files", "navicon.png" ), "name" => "Files" ));
+OC_UTIL::addAdminPage( array( "order" => 1, "href" => OC_HELPER::linkTo( "files", "admin.php" ), "name" => "Files" ));
?>
/**
*
*/
- public static function init(){
+ public static function loadApps(){
+ global $SERVERROOT;
+
// Get all appinfo
$dir = opendir( $SERVERROOT );
while( false !== ( $filename = readdir( $dir ))){
if( substr( $filename, 0, 1 ) != '.' ){
- if( file_exists( "$SERVERROOT/$filename/appinfo.php" )){
- oc_require( "$filename/appinfo.php" );
+ if( file_exists( "$SERVERROOT/$filename/appinfo/app.php" )){
+ oc_require( "$filename/appinfo/app.php" );
}
}
}
/**
*
*/
- public static function list(){
- return OC_APP::$apps[];
+ public static function getApps(){
+ return OC_APP::$apps;
}
}
}
// load core libs
+oc_require_once('helper.php');
oc_require_once('app.php');
oc_require_once('files.php');
oc_require_once('filesystem.php');
oc_require_once('connect.php');
oc_require_once('remotestorage.php');
oc_require_once('plugin.php');
-oc_require_once('helper.php');
OC_PLUGIN::loadPlugins( "" );
}
// Add the stuff we need always
-OC_UTIL::addPersonalMenuEntry( array( "file" => "index.php?logout=1", "name" => "Logout" ));
+OC_UTIL::addPersonalMenuEntry( array( "order" => 1000, "href" => OC_HELPER::linkTo( "", "index.php?logout=1" ), "name" => "Logout" ));
OC_UTIL::addScript( "jquery-1.5.min" );
OC_UTIL::addScript( "jquery-ui-1.8.10.custom.min" );
OC_UTIL::addScript( "js" );
OC_UTIL::addStyle( "jquery-ui-1.8.10.custom" );
OC_UTIL::addStyle( "styles" );
-// Require all appinfo.php
-OC_APP::init();
+// Load Apps
+OC_APP::loadApps();
// check if the server is correctly configured for ownCloud
OC_UTIL::checkserver();
*
* @param array $entry
*/
- public static function addAdminPage( $entry){
+ public static function addAdminPage( $entry ){
OC_UTIL::$adminpages[] = $entry;
}
<?php
-OC_APP::register( array( "id" => "log", "name" => "Log" ));
-OC_UTIL::addNavigationEntry( array( "app" => "log", "file" => "index.php", "name" => "Log" ));
+OC_APP::register( array( "order" => 1, "id" => "log", "name" => "Log" ));
+OC_UTIL::addPersonalMenuEntry( array( "order" => 2, "href" => OC_HELPER::linkTo( "log", "index.php" ), "name" => "Log" ));
?>
<?php
OC_APP::register( array( "id" => "settings", "name" => "Settings" ));
-OC_UTIL::addNavigationEntry( array( "app" => "settings", "file" => "index.php", "name" => "Settings" ));
+OC_UTIL::addPersonalMenuEntry( array( "order" => 1, "href" => OC_HELPER::linkTo( "settings", "index.php" ), "name" => "Settings" ));
?>
<a id="user_menu_link" href="" title="">Username</a>
<ul id="user_menu">
<? foreach( $_["personalmenu"] as $entry ){ ?>
- <li><a href="<? echo link_to( $entry["app"], $entry["file"] )?>" title=""><? echo $entry["name"] ?></a></li>
+ <li><a href="<? echo $entry["href"] ?>" title=""><? echo $entry["name"] ?></a></li>
<? } ?>
</ul>
</div>
<div id="main">
<div id="plugins">
<ul>
- <? foreach( $_["navigation"] as $entry ){ ?>
- <li><a href="<? echo link_to( $entry["app"], $entry["file"] )?>" title=""><? echo $entry["name"] ?></a></li>
- <? } ?>
+ <li><a style="background-image:url(<? echo image_path( "admin", "navicon.png" ) ?>)" href="<? echo link_to( "admin", "index.php" )?>" title="">Administration</a></li>
+ <li><a style="background-image:url(<? echo image_path( "", "actions/arrow-left.png" ) ?>)" href="<? echo link_to( "", "index.php" )?>" title="">Back</a></li>
</ul>
</div>
<a id="user_menu_link" href="" title="">Username</a>
<ul id="user_menu">
<? foreach( $_["personalmenu"] as $entry ){ ?>
- <li><a href="<? echo link_to( $entry["app"], $entry["file"] )?>" title=""><? echo $entry["name"] ?></a></li>
+ <li><a href="<? echo $entry["href"] ?>" title=""><? echo $entry["name"] ?></a></li>
<? } ?>
</ul>
</div>
<div id="plugins">
<ul>
<? foreach( $_["navigation"] as $entry ){ ?>
- <li><a href="<? echo link_to( $entry["app"], $entry["file"] )?>" title=""><? echo $entry["name"] ?></a></li>
+ <li><a style="background-image:url(<? echo $entry["icon"] ?>)" href="<? echo $entry["href"] ?>" title=""><? echo $entry["name"] ?></a></li>
<? } ?>
</ul>
</div>