]> source.dussan.org Git - nextcloud-server.git/commitdiff
Everything nice and active now
authorJakob Sack <kde@jakobsack.de>
Sun, 17 Apr 2011 18:00:07 +0000 (20:00 +0200)
committerJakob Sack <kde@jakobsack.de>
Sun, 17 Apr 2011 18:00:07 +0000 (20:00 +0200)
16 files changed:
admin/appinfo/app.php
admin/apps.php
admin/index.php [deleted file]
admin/plugins.php
admin/system.php
admin/templates/index.php [deleted file]
files/admin.php
files/appinfo/app.php
files/index.php
help/appinfo/app.php
help/index.php
log/appinfo/app.php
log/index.php
settings/appinfo/app.php
settings/index.php
templates/layout.admin.php

index 40d8b9188ec499cf1fa9d7ca44453083db66cce5..ffe941552b85d66348a3a1592c01ca56b5797566 100644 (file)
@@ -2,12 +2,12 @@
 
 OC_APP::register( array( "order" => 1, "id" => "admin", "name" => "Administration" ));
 
-OC_APP::addAdminPage( array( "id" => "core_system", "order" => 2, "href" => OC_HELPER::linkTo( "admin", "system.php" ), "name" => "System settings", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
-OC_APP::addAdminPage( array( "id" => "core_users", "order" => 3, "href" => OC_HELPER::linkTo( "admin", "users.php" ), "name" => "Users", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
-OC_APP::addAdminPage( array( "id" => "core_apps", "order" => 4, "href" => OC_HELPER::linkTo( "admin", "apps.php" ), "name" => "Apps", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
-OC_APP::addAdminPage( array( "id" => "core_plugins", "order" => 5, "href" => OC_HELPER::linkTo( "admin", "plugins.php" ), "name" => "Plugins", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
+OC_APP::addAdminPage( array( "id" => "core_system", "order" => 1, "href" => OC_HELPER::linkTo( "admin", "system.php" ), "name" => "System settings", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
+OC_APP::addAdminPage( array( "id" => "core_users", "order" => 2, "href" => OC_HELPER::linkTo( "admin", "users.php" ), "name" => "Users", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
+OC_APP::addAdminPage( array( "id" => "core_apps", "order" => 3, "href" => OC_HELPER::linkTo( "admin", "apps.php" ), "name" => "Apps", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
+OC_APP::addAdminPage( array( "id" => "core_plugins", "order" => 4, "href" => OC_HELPER::linkTo( "admin", "plugins.php" ), "name" => "Plugins", "icon" => OC_HELPER::imagePath( "admin", "navicon.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" ), "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?add=some&parameters=here" ), "name" => "Installed apps", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
 
 ?>
index 1b777bc246c4c4f8f9440caf227cc0f9b5987234..7ce3f4c419fb63f66040c2f846bac884daabf4e2 100644 (file)
@@ -51,11 +51,13 @@ print_r($value);
 
 */
 
+// OC_APP::setActiveNavigationEntry( "core_apps_installed" );
 
 
 if($id==0) {
+       OC_APP::setActiveNavigationEntry( "core_apps" );
 
-        if($cat==0){
+       if($cat==0){
                $numcats=array();
                foreach($categories as $key=>$value) $numcats[]=$key;
                $apps=OC_OCSCLIENT::getApplications($numcats);
@@ -72,6 +74,7 @@ if($id==0) {
        unset($tmpl);
 
 }else{
+       OC_APP::setActiveNavigationEntry( "core_apps" );
 
        $app=OC_OCSCLIENT::getApplication($id);
 
diff --git a/admin/index.php b/admin/index.php
deleted file mode 100644 (file)
index 80e70d1..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-
-/**
-* ownCloud
-*
-* @author Frank Karlitschek
-* @copyright 2010 Frank Karlitschek karlitschek@kde.org
-*
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
-* License as published by the Free Software Foundation; either
-* version 3 of the License, or any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
-*
-* You should have received a copy of the GNU Affero General Public
-* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
-*
-*/
-
-require_once('../lib/base.php');
-require( 'template.php' );
-if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' )){
-       header( "Location: ".OC_HELPER::linkTo( "","index.php" ));
-       exit();
-}
-
-$apppages = array();
-$syspages = array();
-
-foreach( OC_APP::getAdminPages() as $i ){
-       if( substr( $i["id"], 0, 5 ) == "core_" ){
-               $syspages[] = $i;
-       }
-       else{
-               $apppages[] = $i;
-       }
-}
-
-$tmpl = new OC_TEMPLATE( "admin", "index", "admin" );
-$tmpl->assign( "apppages", $apppages );
-$tmpl->assign( "syspages", $syspages );
-$tmpl->printPage();
-
-?>
-
index 60d23585a4feb7891ae6204ec824cbcc19b4af26..fd1933a7fa1f61b133802cdb762cad56a601c711 100644 (file)
@@ -28,6 +28,7 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin'
        exit();
 }
 
+OC_APP::setActiveNavigationEntry( "core_plugins" );
 $plugins=array();
 $blacklist=OC_PLUGIN::loadBlackList();
 
index de62b133f85b33a457e627b582780e498b64d9e1..310979295f0db24e9cd008625ec6e029f8f70e26 100644 (file)
@@ -28,6 +28,8 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin'
        exit();
 }
 
+OC_APP::setActiveNavigationEntry( "administration" );
+
 $tmpl = new OC_TEMPLATE( "admin", "system", "admin" );
 $tmpl->printPage();
 
diff --git a/admin/templates/index.php b/admin/templates/index.php
deleted file mode 100644 (file)
index fa32a67..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-/*
- * Template for admin pages
- */
-?>
-<h1>Administration</h1>
-
-<h2>System</h2>
-<ul>
-       <?php foreach($_["syspages"] as $i): ?>
-               <li><a href="<?php echo $i["href"]; ?>"><?php echo $i["name"]; ?></a></li>
-       <?php endforeach; ?>
-</ul>
-<h2>Applications</h2>
-<ul>
-       <?php foreach($_["apppages"] as $i): ?>
-               <li><a href="<?php echo $i["href"]; ?>"><?php echo $i["name"]; ?></a></li>
-       <?php endforeach; ?>
-</ul>
index 3cc8a57d4cb1ec1c3aa40eeb2b425250d0e0139a..0333e2c6cb1c2bde02c10d32660e300cf6e89152 100644 (file)
@@ -32,6 +32,7 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin'
        exit();
 }
 
+OC_APP::setActiveNavigationEntry( "files_administration" );
 // return template
 $tmpl = new OC_TEMPLATE( "files", "admin", "admin" );
 $tmpl->printPage();
index 1d83674852ddd6196d076db5dfd20b6c3f87acbc..851a774286da33a7a9e528d93566790a402cad2b 100644 (file)
@@ -5,4 +5,7 @@ OC_APP::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
 OC_APP::addNavigationEntry( array( "id" => "files_index", "order" => 1, "href" => OC_HELPER::linkTo( "files", "index.php" ), "icon" => OC_HELPER::imagePath( "files", "navicon.png" ), "name" => "Files" ));
 OC_APP::addSettingsPage( array( "id" => "files_administration", "order" => 1, "href" => OC_HELPER::linkTo( "files", "admin.php" ), "name" => "Files" ));
 
+// To add navigation sub entries use
+// OC_APP::addNavigationSubEntry( "files_index", array( ... ));
+
 ?>
index c0f078bd21537d5b31c76ced729dc90aa89d4a99..2a78e8a438e6311a6445de26b283c6541335d94f 100644 (file)
@@ -35,7 +35,7 @@ if( !OC_USER::isLoggedIn()){
 // Load the files we need
 OC_UTIL::addStyle( "files", "files" );
 OC_UTIL::addScript( "files", "files" );
-
+OC_APP::setActiveNavigationEntry( "files_index" );
 // Load the files
 $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
 
index 952c57f9bc8cb1148142cbc2843887987a52c321..4743292ebb7b078334d7fa67ce97fc7705222940 100644 (file)
@@ -1,6 +1,14 @@
 <?php
 
 OC_APP::register( array( "order" => 1, "id" => "help", "name" => "Help" ));
-OC_APP::addSettingsPage( array( "id" => "help", "order" => 2, "href" => OC_HELPER::linkTo( "help", "index.php" ), "name" => "Help", "icon" => OC_HELPER::imagePath( "settings", "information.png" )));
+
+// Workaround for having help as the last entry always
+$entry = array( "id" => "help", "order" => 1000, "href" => OC_HELPER::linkTo( "help", "index.php" ), "name" => "Help", "icon" => OC_HELPER::imagePath( "settings", "information.png" ));
+if( OC_GROUP::inGroup( $_SESSION["user_id"], "admin" )){
+       OC_APP::addAdminPage( $entry );
+}
+else{
+       OC_APP::addSettingsPage( $entry );
+}
 
 ?>
index 426abe3956010af83f49e9934f78804e543b0c35..e6a2d5661f576aac637ba604a8f2f2c5bbe293de 100644 (file)
@@ -9,7 +9,6 @@ if( !OC_USER::isLoggedIn()){
 
 // Load the files we need
 OC_UTIL::addStyle( "help", "help" );
-
 OC_APP::setActiveNavigationEntry( "help" );
 
 $kbe=OC_OCSCLIENT::getKnownledgebaseEntries();
index 60769a990ff641661e71dcd9509a84a94a5ea5e1..7058c6ebc98fd7e3bfd126b74df397cc14760aef 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
 OC_APP::register( array( "order" => 1, "id" => "log", "name" => "Log" ));
-OC_APP::addSettingsPage( array( "id" => "log", "order" => 2, "href" => OC_HELPER::linkTo( "log", "index.php" ), "name" => "Log", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
+OC_APP::addSettingsPage( array( "id" => "log", "order" => 999, "href" => OC_HELPER::linkTo( "log", "index.php" ), "name" => "Log", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
 
 ?>
index 23194f18a61bcdb64453d21838a51a9067e25cd3..646dbc0cc595429c746a89e1affefff49c1010a3 100644 (file)
@@ -30,6 +30,7 @@ if( !OC_USER::isLoggedIn()){
     exit();
 }
 
+OC_APP::setActiveNavigationEntry( "log" );
 $logs=OC_LOG::get( $dir );
 
 foreach( $logs as &$i ){
index 5f78b83dc23a7d282cdef0cce99472ed9a674c7a..2eb24b90efa03d2c996ee7cbc864daffba4ab99c 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
 OC_APP::register( array( "id" => "settings", "name" => "Settings" ));
+OC_APP::addSettingsPage( array( "id" => "settings", "order" => -1000, "href" => OC_HELPER::linkTo( "settings", "index.php" ), "name" => "Information", "icon" => OC_HELPER::imagePath( "settings", "information.png" )));
 
 ?>
index 0e3b3f285500f109b769f11db0f9dbc0349f57ff..9bf89145cc3250b82e8a70904478504484b348df 100644 (file)
@@ -7,7 +7,7 @@ if( !OC_USER::isLoggedIn()){
     exit();
 }
 
-
+OC_APP::setActiveNavigationEntry( "settings" );
 $tmpl = new OC_TEMPLATE( "settings", "index", "admin");
 $used=OC_FILESYSTEM::filesize('/');
 $free=OC_FILESYSTEM::free_space();
index f7392c5de1d687ca2e1a99b5bd83d015cdd16d31..0212419a9522e7ee1dc5e72fcbb7746c2c16ac01 100644 (file)
                <div id="main">
                        <div id="plugins">
                                <ul>
-                                       <li><a style="background-image:url(<?php echo image_path('settings', 'information.png'); ?>)" href="<?php echo link_to('settings', 'index.php'); ?>" title="">Information</a></li>
                                        <?php foreach($_['settingsnavigation'] as $entry):?>
-                                               <li><a style="background-image:url(<?php echo $entry['icon']; ?>)" href="<?php echo $entry['href']; ?>" title=""><?php echo $entry['name'] ?></a></li>
+                                               <li><a style="background-image:url(<?php echo $entry['icon']; ?>)" href="<?php echo $entry['href']; ?>" title=""><?php echo $entry['name'] ?><?php if( $entry["active"] ) echo "I AM ACTIVE!!!"; ?></a></li>
+                                               <?php if( sizeof( $entry["subnavigation"] )): ?>
+                                                       <?php foreach($entry["subnavigation"] as $subentry):?>
+                                                               <li><a style="background-color:#FF8800;" href="<?php echo $subentry['href']; ?>" title=""><?php echo $subentry['name'] ?></a></li>
+                                                       <?php endforeach; ?>
+                                               <?php endif; ?>
                                        <?php endforeach; ?>
                                        <?php foreach($_['adminnavigation'] as $entry):?>
                                                <li><a style="background-image:url(<?php echo $entry['icon']; ?>)" href="<?php echo $entry['href']; ?>" title=""><?php echo $entry['name'] ?><?php if( $entry["active"] ) echo "I AM ACTIVE!!!"; ?></a></li>