]> source.dussan.org Git - nextcloud-server.git/commitdiff
Changes in the user experience
authorJakob Sack <kde@jakobsack.de>
Sat, 16 Apr 2011 15:49:57 +0000 (17:49 +0200)
committerJakob Sack <kde@jakobsack.de>
Sat, 16 Apr 2011 15:49:57 +0000 (17:49 +0200)
21 files changed:
admin/appinfo/app.php
admin/apps.php [new file with mode: 0644]
admin/js/users.js [new file with mode: 0644]
files/appinfo/app.php
help/appinfo/app.php [new file with mode: 0644]
help/index.php [new file with mode: 0644]
help/templates/index.php [new file with mode: 0644]
img/layout/back.png [new file with mode: 0644]
img/layout/help.png [new file with mode: 0644]
img/layout/logout.png [new file with mode: 0644]
img/layout/settings.png [new file with mode: 0644]
lib/app.php
lib/template.php
log/appinfo/app.php
log/index.php
plugins/blacklist.txt
settings/img/information.png [new file with mode: 0644]
settings/index.php
settings/templates/index.php
templates/layout.admin.php
templates/layout.user.php

index 9e39a0524435ad04776c02a8ce5d3e268b435a68..2426adc9f8acaddcdb67c0c29d584804329b43e3 100644 (file)
@@ -1,14 +1,10 @@
 <?php
 
 OC_APP::register( array( "order" => 1, "id" => "admin", "name" => "Administration" ));
-if( OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' ))
-{
-       OC_APP::addNavigationEntry( array( "id" => "admin_index", "order" => 1, "href" => OC_HELPER::linkTo( "admin", "index.php" ), "icon" => OC_HELPER::imagePath( "admin", "navicon.png" ), "name" => "Administration" ));
-}
-OC_APP::addAdminPage( array( "id" => "core_basic", "order" => 1, "href" => OC_HELPER::linkTo( "admin", "basic.php" ), "name" => "Basic Settings" ));
-OC_APP::addAdminPage( array( "id" => "core_system", "order" => 2, "href" => OC_HELPER::linkTo( "admin", "system.php" ), "name" => "System settings" ));
-OC_APP::addAdminPage( array( "id" => "core_users", "order" => 3, "href" => OC_HELPER::linkTo( "admin", "users.php" ), "name" => "Users" ));
-OC_APP::addAdminPage( array( "id" => "core_apps", "order" => 4, "href" => OC_HELPER::linkTo( "admin", "apps.php" ), "name" => "Apps" ));
-OC_APP::addAdminPage( array( "id" => "core_plugins", "order" => 5, "href" => OC_HELPER::linkTo( "admin", "plugins.php" ), "name" => "Plugins" ));
+
+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" )));
 
 ?>
diff --git a/admin/apps.php b/admin/apps.php
new file mode 100644 (file)
index 0000000..10bfd83
--- /dev/null
@@ -0,0 +1,39 @@
+<?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();
+}
+
+// We have some javascript foo!
+OC_UTIL::addScript( "admin", "apps" );
+
+
+$tmpl = new OC_TEMPLATE( "admin", "apps", "admin" );
+$tmpl->printPage();
+
+?>
+
diff --git a/admin/js/users.js b/admin/js/users.js
new file mode 100644 (file)
index 0000000..6d59a2e
--- /dev/null
@@ -0,0 +1,101 @@
+$(document).ready(function(){
+       // Dialog for adding users
+       $( "#adduser-form" ).dialog({
+               autoOpen: false,
+               height: 300,
+               width: 350,
+               modal: true,
+               buttons: {
+                       "Create an account": function() {
+                               $( this ).dialog( "close" );
+                       },
+                       Cancel: function() {
+                               $( this ).dialog( "close" );
+                       }
+               },
+               close: function() {
+                       allFields.val( "" ).removeClass( "ui-state-error" );
+               }
+       });
+
+       $( "#adduser-button" )
+               .click(function() {
+                       $( "#adduser-form" ).dialog( "open" );
+                       return false;
+               });
+
+       // Dialog for adding users
+       $( "#edituser-form" ).dialog({
+               autoOpen: false,
+               height: 300,
+               width: 350,
+               modal: true,
+               buttons: {
+                       "Edit password": function() {
+                               $( this ).dialog( "close" );
+                       },
+                       Cancel: function() {
+                               $( this ).dialog( "close" );
+                       }
+               },
+               close: function() {
+                       allFields.val( "" ).removeClass( "ui-state-error" );
+               }
+       });
+
+       $( ".edituser-button" )
+               .click(function() {
+                       $( "#edituser-form" ).dialog( "open" );
+                       return false;
+               });
+
+       // Dialog for adding users
+       $( "#removeuser-form" ).dialog({
+               autoOpen: false,
+               height: 300,
+               width: 350,
+               modal: true,
+               buttons: {
+                       "Remove user": function() {
+                               $( this ).dialog( "close" );
+                       },
+                       Cancel: function() {
+                               $( this ).dialog( "close" );
+                       }
+               },
+               close: function() {
+                       allFields.val( "" ).removeClass( "ui-state-error" );
+               }
+       });
+
+       $( ".removeuser-button" )
+               .click(function() {
+                       $( "#removeuser-form" ).dialog( "open" );
+                       return false;
+               });
+
+       // Dialog for adding users
+       $( "#removegroup-form" ).dialog({
+               autoOpen: false,
+               height: 300,
+               width: 350,
+               modal: true,
+               buttons: {
+                       "Remove group": function() {
+                               $( this ).dialog( "close" );
+                       },
+                       Cancel: function() {
+                               $( this ).dialog( "close" );
+                       }
+               },
+               close: function() {
+                       allFields.val( "" ).removeClass( "ui-state-error" );
+               }
+       });
+
+       $( ".removegroup-button" )
+               .click(function() {
+                       $( "#removegroup-form" ).dialog( "open" );
+                       return false;
+               });
+} );
index a3532e805d2ef5cabf00de3def640307b1015b75..eff45cbe6e3ade3530970a3bd1a586db67626a1a 100644 (file)
@@ -3,6 +3,6 @@
 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::addAdminPage( array( "order" => 1, "href" => OC_HELPER::linkTo( "files", "admin.php" ), "name" => "Files" ));
+OC_APP::addSettingsPage( array( "order" => 1, "href" => OC_HELPER::linkTo( "files", "admin.php" ), "name" => "Files" ));
 
 ?>
diff --git a/help/appinfo/app.php b/help/appinfo/app.php
new file mode 100644 (file)
index 0000000..184f4d3
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+
+OC_APP::register( array( "id" => "help", "name" => "Help" ));
+OC_APP::addPersonalMenuEntry( array( "order" => 2, "href" => OC_HELPER::linkTo( "help", "index.php" ), "name" => "Help" ));
+
+?>
diff --git a/help/index.php b/help/index.php
new file mode 100644 (file)
index 0000000..0a54ddb
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+
+require_once('../lib/base.php');
+require( 'template.php' );
+if( !OC_USER::isLoggedIn()){
+    header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+    exit();
+}
+
+$settings = array();
+
+// Do the work ...
+if( $_POST["submit"] )
+{
+    if( $_POST["newpassword"] != $_POST["newpasswordconfirm"] ){
+        // Say "Passwords not equal"
+    }
+    else{
+        if( OC_USER::checkPassword( $_SESSION["username"], $_POST["password"] )){
+            // Set password
+            OC_USER::setPassord( $_SESSION["username"], $_POST["newpassword"] );
+        }
+        else{
+            // Say "old password bad"
+        }
+    }
+}
+
+$tmpl = new OC_TEMPLATE( "help", "index", "user" );
+$tmpl->assign( "settings", $settings );
+$tmpl->printPage();
+
+?>
diff --git a/help/templates/index.php b/help/templates/index.php
new file mode 100644 (file)
index 0000000..945969d
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+/*
+ * Template for settings page
+ */
+?>
+<h1>Help</h1>
+
+Help.
\ No newline at end of file
diff --git a/img/layout/back.png b/img/layout/back.png
new file mode 100644 (file)
index 0000000..a2d5c84
Binary files /dev/null and b/img/layout/back.png differ
diff --git a/img/layout/help.png b/img/layout/help.png
new file mode 100644 (file)
index 0000000..a2d5c84
Binary files /dev/null and b/img/layout/help.png differ
diff --git a/img/layout/logout.png b/img/layout/logout.png
new file mode 100644 (file)
index 0000000..a2d5c84
Binary files /dev/null and b/img/layout/logout.png differ
diff --git a/img/layout/settings.png b/img/layout/settings.png
new file mode 100644 (file)
index 0000000..a2d5c84
Binary files /dev/null and b/img/layout/settings.png differ
index 9f1ce6f104714d85028b0b013c5d778e45f6441f..b08733e04d924ecf540881ec4fc50057870f3dee 100644 (file)
@@ -53,7 +53,7 @@ class OC_APP{
                }
 
                // Our very own core apps are hardcoded
-               foreach( array( "admin", "files", "log", "settings" ) as $app ){
+               foreach( array( "admin", "files", "log", "help", "settings" ) as $app ){
                        require( "$app/appinfo/app.php" );
                }
 
@@ -165,11 +165,22 @@ class OC_APP{
         * property from all other entries. The templates can use this for
         * highlighting the current position of the user.
         */
-       public static function activateNavigationEntry( $id ){
+       public static function setActiveNavigationEntry( $id ){
                self::$activeapp = $id;
                return true;
        }
 
+       /**
+        * @brief gets the active Menu entry
+        * @returns id or empty string
+        *
+        * This function returns the id of the active navigation entry (set by
+        * setActiveNavigationEntry
+        */
+       public static function getActiveNavigationEntry(){
+               return self::$activeapp;
+       }
+
        /**
         * @brief adds an entry to the personal menu
         * @param $data array containing the data
index c36b1e7a36743925be5306a262eddfa89264374a..fcf6334b956b4f448cd79e785c94608363db394b 100644 (file)
@@ -190,11 +190,25 @@ class OC_TEMPLATE{
                        {
                                $page = new OC_TEMPLATE( "core", "layout.user" );
                                // Add menu data
+
+                               // Add navigation entry and personal menu
+                               $page->assign( "navigation", OC_APP::getNavigation());
+                               $page->assign( "personalmenu", OC_APP::getPersonalMenu());
                        }
                        elseif( $this->renderas == "admin" )
                        {
                                $page = new OC_TEMPLATE( "core", "layout.admin" );
                                // Add menu data
+                               $navigation = array();
+                               if( OC_GROUP::inGroup( $_SESSION["user_id"], "admin" )){
+                                       foreach( OC_APP::getAdminPages() as $i ){
+                                               $navigation[] = $i;
+                                       }
+                               }
+                               foreach( OC_APP::getSettingsPages() as $i ){
+                                       $navigation[] = $i;
+                               }
+                               $page->assign( "navigation", $navigation );
                        }
                        else
                        {
@@ -210,10 +224,6 @@ class OC_TEMPLATE{
                                $page->append( "cssfiles", "$WEBROOT/$style.css" );
                        }
 
-                       // Add navigation entry and personal menu
-                       $page->assign( "navigation", OC_APP::getNavigation());
-                       $page->assign( "personalmenu", OC_APP::getPersonalMenu());
-
                        // Add css files and js files
                        $page->assign( "content", $data );
                        return $page->fetchPage();
index d3e848e960615ea2c9a49a943ed1df1afc61ccde..fd53d1ec225c1033751960fd933f335262f51683 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
 OC_APP::register( array( "order" => 1, "id" => "log", "name" => "Log" ));
-OC_APP::addPersonalMenuEntry( array( "order" => 2, "href" => OC_HELPER::linkTo( "log", "index.php" ), "name" => "Log" ));
+OC_APP::addSettingsPage( array( "order" => 2, "href" => OC_HELPER::linkTo( "log", "index.php" ), "name" => "Log", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
 
 ?>
index a401a38fa1ae98f09f4fc32ed020bc0c8de26cc6..23194f18a61bcdb64453d21838a51a9067e25cd3 100644 (file)
@@ -37,7 +37,7 @@ foreach( $logs as &$i ){
     $i["action"] = OC_LOG::$TYPE[$i['type']];
 }
 
-$tmpl = new OC_TEMPLATE( "log", "index", "user" );
+$tmpl = new OC_TEMPLATE( "log", "index", "admin" );
 $tmpl->assign( "logs", $logs );
 $tmpl->printPage();
 
index 08c79e5e75ee871662f417ef0c987d0e02bad5c9..e113a39d0b7a41dbc3c67ab2f93bc0ba70e0da75 100644 (file)
@@ -2,3 +2,4 @@ audioplayer
 ldap
 test
 textviewer
+publiclink
diff --git a/settings/img/information.png b/settings/img/information.png
new file mode 100644 (file)
index 0000000..cbabb0e
Binary files /dev/null and b/settings/img/information.png differ
index 85e4281c919b52b3c0be3c97270ef15e6e787941..31db326f6bc7cabfca607dbb7d1b0d9cc2bf429d 100644 (file)
@@ -7,27 +7,8 @@ if( !OC_USER::isLoggedIn()){
     exit();
 }
 
-$settings = array();
 
-// Do the work ...
-if( $_POST["submit"] )
-{
-    if( $_POST["newpassword"] != $_POST["newpasswordconfirm"] ){
-        // Say "Passwords not equal"
-    }
-    else{
-        if( OC_USER::checkPassword( $_SESSION["username"], $_POST["password"] )){
-            // Set password
-            OC_USER::setPassord( $_SESSION["username"], $_POST["newpassword"] );
-        }
-        else{
-            // Say "old password bad"
-        }
-    }
-}
-
-$tmpl = new OC_TEMPLATE( "settings", "index", "user" );
-$tmpl->assign( "settings", $settings );
+$tmpl = new OC_TEMPLATE( "settings", "index", "admin" );
 $tmpl->printPage();
 
 ?>
index 20410e06d12aab935a9990e2129ae9621d148cb7..106d313c014473e615b2af8bc9ba4e360688850c 100644 (file)
@@ -5,20 +5,4 @@
 ?>
 <h1>Settings</h1>
 
-<form action="" type="">
-       <p>
-               <span>New password:</span>
-               <input type="password" name="newpassword" value="">
-       </p>
-       <p>
-               <span>Confirm new password:</span>
-               <input type="password" name="newpasswordconfirm" value="">
-       </p>
-       <p>
-               <span>Old password:</span>
-               <input type="password" name="password" value="">
-       </p>
-       <p>
-               <input type="submit" name="submit" value="Send">
-       </p>
-</form>
+Welcome to the settings! Bla bla bla
\ No newline at end of file
index 85eba13827432c104288a3abd0009af705ba3f4b..ea352a0fb71bcf01937b606fbfd6e191bdd9cc50 100644 (file)
                        <a href="<?php echo link_to("", "index.php"); ?>" title="" id="owncloud"><img src="<?php echo image_path("", "owncloud-logo-small-white.png"); ?>" alt="ownCloud" /></a>
 
                        <div id="user">
-                               <a id="user_menu_link" href="" title=""><? echo $_SESSION["user_id"] ?></a>
-                               <ul id="user_menu">
-                                       <?php foreach($_["personalmenu"] as $entry): ?>
-                                               <li><a href="<?php echo $entry["href"]; ?>" title=""><?php echo $entry["name"]; ?></a></li>
-                                       <?php endforeach; ?>
-                               </ul>
+                               <a href="<?php echo link_to("","index.php"); ?>" title=""><img src="<?php echo image_path("", "layout/back.png"); ?>"></a>
+                               <a href="<?php echo link_to("settings","index.php"); ?>" title=""><img src="<?php echo image_path("", "layout/settings.png"); ?>"></a>
+                               <a href="<?php echo link_to("help","index.php"); ?>" title=""><img src="<?php echo image_path("", "layout/help.png"); ?>"></a>
+                               <a href="<?php echo link_to("","index.php?logout=true"); ?>" title=""><img src="<?php echo image_path("", "layout/logout.png"); ?>"></a>
                        </div>
                </div>
 
                <div id="main">
                        <div id="plugins">
                                <ul>
-                                       <li><a style="background-image:url(<?php echo image_path("admin", "navicon.png"); ?>)" href="<?php echo link_to("admin", "index.php"); ?>" title="">Administration</a></li>
-                                       <li><a style="background-image:url(<?php echo image_path("", "actions/arrow-left.png"); ?>)" href="<?php echo link_to("", "index.php"); ?>" title="">Back</a></li>
+                                       <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($_["navigation"] as $entry):?>
+                                               <li><a style="background-image:url(<?php echo $entry["icon"]; ?>)" href="<?php echo $entry["href"]; ?>" title=""><?php echo $entry["name"] ?></a></li>
+                                       <?php endforeach; ?>
                                </ul>
                        </div>
 
index 9fc4f97e1dcdf5d77800e6b8eb0de7f698b15ed4..be14cc0fc0d61bdf7ed772e999393a8e7d8e34a9 100644 (file)
                        <a href="<?php echo link_to("", "index.php"); ?>" title="" id="owncloud"><img src="<?php echo image_path("", "owncloud-logo-small-white.png"); ?>" alt="ownCloud" /></a>
 
                        <div id="user">
-                               <a id="user_menu_link" href="" title=""><? echo $_SESSION["user_id"] ?></a>
-                               <ul id="user_menu">
-                                       <?php foreach($_["personalmenu"] as $entry): ?>
-                                               <li><a href="<?php echo $entry["href"]; ?>" title=""><?php echo $entry["name"]; ?></a></li>
-                                       <?php endforeach; ?>
-                               </ul>
+                               <?php if( OC_APP::getActiveNavigationEntry() == "help" ): ?>
+                                       <a href="<?php echo link_to("","index.php"); ?>" title=""><img src="<?php echo image_path("", "layout/back.png"); ?>"></a>
+                               <?php endif; ?>
+                               <a href="<?php echo link_to("settings","index.php"); ?>" title=""><img src="<?php echo image_path("", "layout/settings.png"); ?>"></a>
+                               <a href="<?php echo link_to("help","index.php"); ?>" title=""><img src="<?php echo image_path("", "layout/help.png"); ?>"></a>
+                               <a href="<?php echo link_to("","index.php"); ?>?logout=true" title=""><img src="<?php echo image_path("", "layout/logout.png"); ?>"></a>
                        </div>
                </div>