Merge branch 'master' of git://anongit.kde.org/owncloud

Conflicts:
	lib/template.php
remotes/origin/stable
Jakob Sack 14 years ago
commit 962907ee6f
  1. 7
      admin/appinfo/app.php
  2. 8
      admin/apps.php
  3. 2
      admin/system.php
  4. 2
      admin/users.php
  5. 2
      apps/files_publiclink/appinfo/app.php
  6. 2
      apps/media/css/music.css
  7. 24
      apps/media/css/player.css
  8. 10
      apps/media/index.php
  9. 65
      apps/media/js/settings.js
  10. 20
      apps/media/templates/collection.php
  11. 74
      apps/media/templates/music.php
  12. 21
      apps/media/templates/player.php
  13. 24
      apps/media/templates/playlist.php
  14. 23
      apps/media/templates/settings.php
  15. 2
      apps/user_ldap/appinfo/app.php
  16. 14
      core/css/styles.css
  17. 10
      core/js/setup.js
  18. 4
      core/templates/installation.php
  19. 69
      core/templates/layout.admin.php
  20. 15
      core/templates/layout.user.php
  21. 2
      files/admin.php
  22. 5
      files/appinfo/app.php
  23. 2
      files/templates/index.php
  24. 9
      help/appinfo/app.php
  25. 2
      help/index.php
  26. 181
      lib/app.php
  27. 4
      lib/setup.php
  28. 19
      lib/template.php
  29. 1
      settings/appinfo/app.php
  30. 2
      settings/index.php

@ -2,11 +2,4 @@
OC_App::register( array( "order" => 1, "id" => "admin", "name" => "Administration" ));
// OC_App::addAdminPage( array( "id" => "core_system", "order" => 1, "href" => OC_Helper::linkTo( "admin", "system.php" ), "name" =>"System", "icon" => OC_Helper::imagePath( "admin", "administration.png" )));
OC_App::addAdminPage( array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "admin", "users.php" ), "name" => "Users", "icon" => OC_Helper::imagePath( "admin", "users.png" )));
OC_App::addAdminPage( array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "admin", "apps.php?installed" ), "name" => "Apps", "icon" => OC_Helper::imagePath( "admin", "apps.png" )));
// Add subentries for App installer
//OC_App::addNavigationSubEntry( "core_apps", array( "id" => "core_apps_get", "order" => 4, "href" => OC_Helper::linkTo( "admin", "apps.php" ), "name" => "Get new apps", "icon" => OC_Helper::imagePath( "admin", "navicon.png" )));
?>

@ -53,7 +53,7 @@ if($installed){
$records[]=$record;
}
$tmpl = new OC_Template( "admin", "appsinst", "admin" );
$tmpl = new OC_Template( "admin", "appsinst", "user" );
$tmpl->assign( "apps", $records );
$tmpl->printPage();
unset($tmpl);
@ -63,7 +63,7 @@ if($installed){
if($categories==NULL){
OC_App::setActiveNavigationEntry( "core_apps" );
$tmpl = new OC_Template( "admin", "app_noconn", "admin" );
$tmpl = new OC_Template( "admin", "app_noconn", "user" );
$tmpl->printPage();
unset($tmpl);
exit();
@ -82,7 +82,7 @@ if($installed){
}
// return template
$tmpl = new OC_Template( "admin", "apps", "admin" );
$tmpl = new OC_Template( "admin", "apps", "user" );
$tmpl->assign( "categories", $categories );
$tmpl->assign( "apps", $apps );
@ -94,7 +94,7 @@ if($installed){
$app=OC_OCSClient::getApplication($id);
$tmpl = new OC_Template( "admin", "app", "admin" );
$tmpl = new OC_Template( "admin", "app", "user" );
$tmpl->assign( "categories", $categories );
$tmpl->assign( "app", $app );
$tmpl->printPage();

@ -29,7 +29,7 @@ if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' ))
OC_App::setActiveNavigationEntry( "administration" );
$tmpl = new OC_Template( "admin", "system", "admin" );
$tmpl = new OC_Template( "admin", "system", "user" );
$tmpl->printPage();
?>

@ -48,7 +48,7 @@ foreach( OC_Group::getGroups() as $i ){
$groups[] = array( "name" => $i );
}
$tmpl = new OC_Template( "admin", "users", "admin" );
$tmpl = new OC_Template( "admin", "users", "user" );
$tmpl->assign( "users", $users );
$tmpl->assign( "groups", $groups );
$tmpl->printPage();

@ -1,6 +1,6 @@
<?php
OC_App::addNavigationSubEntry('files_index', array( "id" => "files_publiclink_administration", "order" => 1, "href" => OC_Helper::linkTo( "files_publiclink", "admin.php" ), "name" => "Public Links"));
OC_App::addNavigationEntry(array( "id" => "files_publiclink_administration", "order" => 2, "href" => OC_Helper::linkTo( "files_publiclink", "admin.php" ), "name" => "Public Links"));
?>

@ -16,4 +16,4 @@ li button.right.prettybutton{font-size:1em;}
img.remove{float:right;}
#searchresults input.play, #searchresults input.add{float:right; height:16px; width:16px;}
#collection tr.collapsed td.album, #collection tr.collapsed td.title{color:#ddd}
a.expander{float:right;display:block}
a.expander{float:right;display:block}

@ -1,29 +1,25 @@
#jp-interface{position:fixed;z-index:100;width:25em;left:201px;top:-20px;height:60px;border-bottom:none;}
#jp-interface div.player{height:0px}
#jp-interface ul.jp-controls{list-style-type:none;padding:0;}
#jp-interface ul.jp-controls li{display:inline;}
#jp-interface ul.jp-controls a{position:absolute;overflow:hidden;text-indent:-9999px;}
a.jp-play,a.jp-pause{width:40px;height:40px;z-index:1;top:20px;left:48px;}
#controls ul.jp-controls{list-style-type:none;padding:0;}
#controls ul.jp-controls li{display:inline;}
#controls ul.jp-controls a{position:absolute;overflow:hidden;text-indent:-9999px;}
a.jp-play,a.jp-pause{width:40px;height:40px;z-index:1;top:0;left:48px;}
a.jp-play{background:url("../img/jplayer.blue.monday.png") 0 0 no-repeat;}
a.jp-play:hover{background:url("../img/jplayer.blue.monday.png") -41px 0 no-repeat;}
a.jp-pause{background:url("../img/jplayer.blue.monday.png") 0 -42px no-repeat;display:none;}
a.jp-pause:hover{background:url("../img/jplayer.blue.monday.png") -41px -42px no-repeat;}
a.jp-stop{top:26px;left:126px;background:url("../img/jplayer.blue.monday.png") 0 -83px no-repeat;width:28px;height:28px;z-index:1;}
a.jp-stop:hover{background:url("../img/jplayer.blue.monday.png") -29px -83px no-repeat;}
a.jp-previous{left:20px;top:26px;background:url("../img/jplayer.blue.monday.png") 0 -112px no-repeat;width:28px;height:28px;}
a.jp-previous{left:20px;top:.5em;background:url("../img/jplayer.blue.monday.png") 0 -112px no-repeat;width:28px;height:28px;}
a.jp-previous:hover{background:url("../img/jplayer.blue.monday.png") -29px -112px no-repeat;}
a.jp-next{left:88px;top:26px;background:url("../img/jplayer.blue.monday.png") 0 -141px no-repeat;width:28px;height:28px;}
a.jp-next{left:88px;top:.5em;background:url("../img/jplayer.blue.monday.png") 0 -141px no-repeat;width:28px;height:28px;}
a.jp-next:hover{background:url("../img/jplayer.blue.monday.png") -29px -141px no-repeat;}
div.jp-progress{position:absolute;overflow:hidden;background-color:#293b51;top:32px;left:164px;width:122px;height:15px;}
div.jp-progress{position:absolute;overflow:hidden;background-color:#293b51;top:1em;left:164px;width:122px;height:15px;}
div.jp-seek-bar{background:url("../img/jplayer.blue.monday.png") 0 -202px repeat-x;width:0;height:100%;cursor:pointer;}
div.jp-play-bar{background:url("../img/jplayer.blue.monday.png") 0 -218px repeat-x;width:0;height:100%;}
div.jp-seeking-bg{background:url("../img/pbar-ani.gif");}
a.jp-mute,a.jp-unmute{height:15px;width:18px;top:32px;left:296px;}
a.jp-mute,a.jp-unmute{height:15px;width:18px;top:1em;left:296px;}
a.jp-mute{background:url("../img/jplayer.blue.monday.png") 0 -186px no-repeat;}
a.jp-mute:hover{background:url("../img/jplayer.blue.monday.png") -19px -170px no-repeat;}
a.jp-unmute{background:url("../img/jplayer.blue.monday.png") 0 -170px no-repeat;display:none;}
a.jp-unmute:hover{background:url("../img/jplayer.blue.monday.png") -19px -186px no-repeat;}
div.jp-volume-bar{position:absolute;overflow:hidden;background:url("../img/jplayer.blue.monday.png") 0 -250px repeat-x;width:46px;height:5px;cursor:pointer;top:37px;left:324px;}
div.jp-volume-bar{position:absolute;overflow:hidden;background:url("../img/jplayer.blue.monday.png") 0 -250px repeat-x;width:46px;height:5px;cursor:pointer;top:1.3em;left:324px;}
div.jp-volume-bar-value{background:url("../img/jplayer.blue.monday.png") 0 -256px repeat-x;width:0;height:5px;}
div.jp-current-time,div.jp-duration{position:absolute;font-size:.64em;font-style:oblique;top:45px;left:164px;width:122px;}
div.jp-current-time,div.jp-duration{position:absolute;font-size:.64em;font-style:oblique;top:1em;left:164px;width:122px;}
div.jp-duration{text-align:right;}

@ -42,17 +42,9 @@ OC_Util::addScript('media','jquery.jplayer.min');
OC_Util::addStyle('media','player');
OC_Util::addStyle('media','music');
OC_App::setActiveNavigationEntry( 'media_playlist' );
OC_App::setActiveNavigationEntry( 'media_index' );
$tmpl = new OC_Template( 'media', 'music', 'user' );
$player = new OC_Template( 'media', 'player');
$playlist = new OC_Template( 'media', 'playlist');
$collection= new OC_Template( 'media', 'collection');
$tmpl->assign('player',$player->fetchPage());
$tmpl->assign('playlist',$playlist->fetchPage());
$tmpl->assign('collection',$collection->fetchPage());
$tmpl->printPage();
?>

@ -1,65 +0,0 @@
$(document).ready(function() {
$("button.scan").click(function(event){
event.preventDefault();
var parent=$(this).parent().parent();
var path=parent.children('input').val();
scan(path);
});
$("button.rescan").live('click', function(event) {
event.preventDefault();
var parent=$(this).parent().parent();
var path=parent.contents().filter(function(){ return(this.nodeType == 3); }).text();
path=path.trim();
scan(path);
});
$("button.delete").live('click', function(event) {
event.preventDefault();
var parent=$(this).parent().parent();
var path=parent.contents().filter(function(){ return(this.nodeType == 3); }).text();
path=path.trim();
var data="action=delete&path="+path;
$.ajax({
type: 'POST',
url: 'ajax/api.php',
cache: false,
data: data,
success: function(){
parent.remove();
}
});
});
$( "#scanpath" ).autocomplete({
source: "../../files/ajax/autocomplete.php?dironly=true",
minLength: 1
});
$('#autoupdate').change(function(){
$.ajax({
url: 'ajax/autoupdate.php',
data: "autoupdate="+$(this).attr('checked')
});
})
});
function scan(path){
var data="action=scan&path="+path;
$.ajax({
type: 'POST',
url: 'ajax/api.php',
cache: false,
data: data,
success: function(songCount){
var found=false;
$('#folderlist').children('li').each(function(){
var otherPath=$(this).contents().filter(function(){ return(this.nodeType == 3); }).text();
otherPath=otherPath.trim();
if(otherPath==path){
found=true;
$(this).children("span").html(songCount+" songs <button class='rescan prettybutton'>Rescan</button></span>");
}
})
if(!found){
$('#folderlist').children().last().before("<li>"+path+"<span class='right'>"+songCount+" songs <button class='rescan prettybutton'>Rescan</button></span></li>");
}
}
});
}

@ -1,20 +0,0 @@
<div id='scan'>
<p id='scancount' style='display:none'><span class='songCount'>0</span> Songs scanned</p>
<div id="scanprogressbar"></div>
<input type='button' class='start' value='Recan Collection'></input>
<input type='button' class='stop' style='display:none' value='Pause'></input>
</div>
<table id='collection'>
<thead>
<th>Artist</th>
<th>Album</th>
<th>Title</th>
</thead>
<tbody>
<tr class='template'>
<td class='artist'><a/></td>
<td class='album'><a/></td>
<td class='title'><a/></td>
</tr>
</tbody>
</table>

@ -1,3 +1,71 @@
<?php echo $_['player'];?>
<?php echo $_['playlist'];?>
<?php echo $_['collection'];?>
<div id="controls">
<ul class="jp-controls">
<li><a href="#" class="jp-play" tabindex="1">play</a></li>
<li><a href="#" class="jp-pause" tabindex="1">pause</a></li>
<li><a href="#" class="jp-mute" tabindex="1">mute</a></li>
<li><a href="#" class="jp-unmute" tabindex="1">unmute</a></li>
<li><a href="#" class="jp-previous" tabindex="1">previous</a></li>
<li><a href="#" class="jp-next" tabindex="1">next</a></li>
</ul>
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<div class="jp-current-time"></div>
<div class="jp-duration"></div>
<div class="player" id="jp-player"></div>
</div>
<div id="leftcontent">
<table id="playlist">
<thead>
<tr>
<th class="name"><input id="selectAll" type="checkbox">Name</th>
<th class="artist">Artist</th>
</tr>
</thead>
<tbody>
<tr>
<td>
The playlist is empty
</td>
</tr>
</tbody>
<tfoot>
<tr class="template">
<td class="name">
<input type="checkbox">
<span></span>
</td>
<td class="artist"></td>
</tr>
</tfoot>
</table>
</div>
<div id="rightcontent">
<div id="scan">
<p id="scancount" style="display:none"><span class="songCount">0</span> Songs scanned</p>
<div id="scanprogressbar"></div>
<input type="button" class="start" value="Rescan Collection"></input>
<input type="button" class="stop" style="display:none" value="Pause"></input>
</div>
<table id="collection">
<thead>
<th>Artist</th>
<th>Album</th>
<th>Title</th>
</thead>
<tbody>
<tr class="template">
<td class="artist"><a/></td>
<td class="album"><a/></td>
<td class="title"><a/></td>
</tr>
</tbody>
</table>
</div>

@ -1,21 +0,0 @@
<div id="jp-interface">
<ul class="jp-controls">
<li><a href="#" class="jp-play" tabindex="1">play</a></li>
<li><a href="#" class="jp-pause" tabindex="1">pause</a></li>
<li><a href="#" class="jp-mute" tabindex="1">mute</a></li>
<li><a href="#" class="jp-unmute" tabindex="1">unmute</a></li>
<li><a href="#" class="jp-previous" tabindex="1">previous</a></li>
<li><a href="#" class="jp-next" tabindex="1">next</a></li>
</ul>
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<div class="jp-current-time"></div>
<div class="jp-duration"></div>
<div class='player' id='jp-player'></div>
</div>

@ -1,24 +0,0 @@
<table id='playlist'>
<thead>
<tr>
<th class='name'><input id='selectAll' type='checkbox'>Name</th>
<th class='artist'>Artist</th>
</tr>
</thead>
<tbody>
<tr>
<td>
The playlist is empty
</td>
</tr>
</tbody>
<tfoot>
<tr class='template'>
<td class='name'>
<input type='checkbox'>
<span></span>
</td>
<td class='artist'></td>
</tr>
</tfoot>
</table>

@ -1,23 +0,0 @@
<form id="quota">
<fieldset>
<legend>Music Directories</legend>
<ul id='folderlist'>
<?php foreach($_['folders'] as $folder):?>
<li>
<?php echo $folder['name'];?>
<span class='right'>
<?php echo $folder['songs'];?> songs
<button class='rescan prettybutton'>Rescan</button>
<button class='delete prettybutton'>Delete</button>
</span>
</li>
<?php endforeach; ?>
<li>
<input placeholder='path' id='scanpath'/>
<span class='right'><button class='scan prettybutton'>Scan</button></span>
</li>
</ul>
<label for="autoupdate" title='Automaticaly scan new files in above directories'>Auto Update</label>
<input type='checkbox' <?php if($_['autoupdate']){echo 'checked="checked"';};?> id='autoupdate' title='Automaticaly scan new files in above directories'>
</fieldset>
</form>

@ -36,4 +36,4 @@ $entry = array(
'href' => OC_Helper::linkTo( "user_ldap", "settings.php" ),
'name' => 'LDAP'
);
OC_App::addNavigationSubEntry( "core_users", $entry);
// OC_App::addNavigationSubEntry( "core_users", $entry);

@ -1,10 +1,9 @@
* { margin:0; padding:0; border:0; outline:0; cursor:default; }
body { background:#fefefe; font:normal 80%/1.6em "Lucida Grande", Arial, Verdana, sans-serif; color:#000; }
body { background:#fefefe; font:normal 80%/1.6em "Lucida Grande", Arial, Verdana, sans-serif; color:#000; margin-bottom:2em; }
/* HEADERS */
#body-user #header, #body-settings #header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; box-shadow:0 0 10px #000, inset 0 -2px 10px #222; }
#body-settings #header { background:#313131; }
#body-login #header { margin:-2em auto 0; text-align:center; height:10em;
-moz-box-shadow:0 0 1em #000; -webkit-box-shadow:0 0 1em #000; box-shadow:0 0 1em #000;
background: #1d2d44; /* Old browsers */
@ -54,7 +53,12 @@ border:1px solid #ddd; font-weight:bold; cursor:pointer; background:#f2f2f2; col
legend { padding:.2em; font-size:1.2em; }
.template{display:none;}
div.controls { width:100%; height:3em; margin:0; background-color:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:2; }
/* CONTENT ------------------------------------------------------------------ */
#controls { width:100%; top:3.5em; height:3em; margin:0; background-color:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:2; }
#content { margin:3.5em 0 0 12.5em; }
#body-settings #content { padding:1em; }
#leftcontent { position:absolute; top:6.5em; width:50em; }
#rightcontent { position:absolute; top:6.5em; left:32em; }
/* LOG IN & INSTALLATION ------------------------------------------------------------ */
#body-login { background-color:#ddd; }
@ -87,10 +91,6 @@ div.controls { width:100%; height:3em; margin:0; background-color:#f7f7f7; borde
#navigation .subentry.active { background-color:#bbb; border-top:1px solid #888; border-bottom:1px solid #bbb; }
#navigation .subentry a { padding-left:3.1em; font-size:1em; }
/* CONTENT ------------------------------------------------------------------ */
#content { margin:3.5em 0 0 12.5em; }
#body-settings #content { padding:1em; }
/* USER SETTINGS ------------------------------------------------------------ */
#quota_indicator { margin:0 4em 1em 0; padding:0; border:1px solid #ddd; border-radius:10px; -webkit-border-radius:10px; -moz-border-radius:10px; }
#quota_indicator div { background-color:#76A9EA; border-radius:10px; -webkit-border-radius:10px; -moz-border-radius:10px; }

@ -1,9 +1,4 @@
$(document).ready(function() {
// Hide the MySQL config div if needed :
if(!$('#mysql').is(':checked')) {
$('#use_mysql').hide();
}
// Hide the PostgreSQL config div if needed:
if(!$('#pgsql').is(':checked')) {
$('#use_postgresql').hide();
@ -35,4 +30,9 @@ $(document).ready(function() {
$('#databaseField').slideToggle(250);
}
});
// Hide the MySQL config div if needed :
if($('#dbtype').val()=='sqlite') {
$('#databaseField').hide();
}
});

@ -20,14 +20,14 @@
<legend><?php echo $l->t( 'Create an <strong>admin account</strong>' ); ?></legend>
<input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_Helper::init_var('adminlogin'); ?>" placeholder="<?php echo $l->t( 'Username' ); ?>" autofocus /></p>
<input type="password" name="adminpass" id="adminpass" value="<?php print OC_Helper::init_var('adminpass'); ?>" placeholder="<?php echo $l->t( 'Password' ); ?>" /></p>
</fieldset>
</fieldset>
<a id='showAdvanced'><strong><?php echo $l->t( 'Advanced' ); ?></strong></a>
<fieldset id='datadirField'>
<legend><?php echo $l->t( 'Set data folder' ); ?></legend>
<input type="text" name="directory" id="directory" value="<?php print OC_Helper::init_var('directory', $_['directory']); ?>" placeholder="<?php echo $l->t( 'Data folder' ); ?>" /></p>
</fieldset>
</fieldset>
<fieldset id='databaseField'>
<legend><?php echo $l->t( 'Configure the database' ); ?></legend>

@ -1,69 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>ownCloud</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="<?php echo image_path('', 'favicon.png'); ?>" /><link rel="apple-touch-icon-precomposed" href="<?php echo image_path('', 'favicon-touch.png'); ?>" />
<?php foreach($_['cssfiles'] as $cssfile): ?>
<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
<?php endforeach; ?>
<script type="text/javascript">
var oc_webroot = '<?php global $WEBROOT; echo $WEBROOT; ?>';
var oc_current_user = '<?php echo OC_User::getUser() ?>';
// </script>
<?php foreach($_['jsfiles'] as $jsfile): ?>
<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
<?php endforeach; ?>
<?php foreach($_['headers'] as $header): ?>
<?php
echo '<'.$header['tag'].' ';
foreach($header['attributes'] as $name=>$value){
echo "$name='$value' ";
};
echo '>';
echo $header['text'];
echo '</'.$header['tag'].'>';
?>
<?php endforeach; ?>
</head>
<body id="body-settings">
<div id="header">
<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>
<ul id="metanav">
<li><a href="<?php echo link_to('', 'index.php'); ?>" title="Back to files"><img class='svg' src="<?php echo image_path('', 'actions/back.svg'); ?>"></a></li>
<li><a href="<?php echo link_to('', 'index.php?logout=true'); ?>" title="Log out"><img class='svg' src="<?php echo image_path('', 'actions/logout.svg'); ?>"></a></li>
</ul>
</div>
<div id="navigation">
<ul>
<?php foreach($_['settingsnavigation'] as $entry):?>
<li><a style="background-image:url(<?php echo $entry['icon']; ?>)" href="<?php echo $entry['href']; ?>" title="" <?php if( $entry["active"] ): ?> class="active"<?php endif; ?>><?php echo $entry['name'] ?></a></li>
<?php if( sizeof( $entry["subnavigation"] )): ?>
<?php foreach($entry["subnavigation"] as $subentry):?>
<li><a href="<?php echo $subentry['href']; ?>" title="" <?php if( $subentry['active'] ): ?>class="active"<?php endif; ?>><?php echo $subentry['name'] ?></a></li>
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php if(isset($_['adminnavigation'])):?>
<?php foreach($_['adminnavigation'] as $entry):?>
<li><a style="background-image:url(<?php echo $entry['icon']; ?>)" href="<?php echo $entry['href']; ?>" title="" <?php if( $entry["active"] ): ?> class="active"<?php endif; ?>><?php echo $entry['name'] ?></a>
<?php if( sizeof( $entry["subnavigation"] )): ?>
<ul>
<?php foreach($entry["subnavigation"] as $subentry):?>
<li class="subentry"><a class="subentry<?php if( $subentry['active'] ): ?> active<?php endif; ?>" href="<?php echo $subentry['href']; ?>" title=""><?php echo $subentry['name'] ?></a></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>
<div id="content">
<?php echo $_['content']; ?>
</div>
</body>
</html>

@ -27,18 +27,17 @@
<?php endforeach; ?>
</head>
<body id="body-user">
<body id="<?php echo $_['bodyid'];?>">
<div id="header">
<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>
<?php echo $_['searchbox']?>
<ul id="metanav">
<li><a href="<?php echo link_to('settings', 'index.php'); ?>" title="Settings"><img class='svg' src="<?php echo image_path('', 'actions/settings.svg'); ?>"></a></li>
<li><a href="<?php echo link_to('', 'index.php'); ?>?logout=true" title="Log out"><img class='svg' src="<?php echo image_path('', 'actions/logout.svg'); ?>"></a></li>
</ul>
</div>
<div id="navigation">
<ul>
<ul id="apps">
<?php foreach($_['navigation'] as $entry): ?>
<li><a style="background-image:url(<?php echo $entry['icon']; ?>)" href="<?php echo $entry['href']; ?>" title="" <?php if( $entry['active'] ): ?> class="active"<?php endif; ?>><?php echo $entry['name']; ?></a>
<?php if( sizeof( $entry["subnavigation"] )): ?>
@ -51,6 +50,16 @@
</li>
<?php endforeach; ?>
</ul>
<ul id="settings">
<?php foreach($_['settingsnavigation'] as $entry):?>
<li><a style="background-image:url(<?php echo $entry['icon']; ?>)" href="<?php echo $entry['href']; ?>" title="" <?php if( $entry["active"] ): ?> class="active"<?php endif; ?>><?php echo $entry['name'] ?></a></li>
<?php if( sizeof( $entry["subnavigation"] )): ?>
<?php foreach($entry["subnavigation"] as $subentry):?>
<li><a href="<?php echo $subentry['href']; ?>" title="" <?php if( $subentry['active'] ): ?>class="active"<?php endif; ?>><?php echo $subentry['name'] ?></a></li>
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
<div id="content">
<?php echo $_['content']; ?>

@ -42,7 +42,7 @@ if(isset($_POST['maxUploadSize'])){
OC_App::setActiveNavigationEntry( "files_administration" );
// return template
$tmpl = new OC_Template( "files", "admin", "admin" );
$tmpl = new OC_Template( "files", "admin", "user" );
$tmpl->assign( 'htaccessWorking', $htaccessWorking );
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
$tmpl->printPage();

@ -3,10 +3,5 @@
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", "home.png" ), "name" => "Files" ));
OC_App::addAdminPage( array( "id" => "files_administration", "order" => 3, "href" => OC_Helper::linkTo( "files", "admin.php" ), "name" => "Files", "icon" => OC_Helper::imagePath( "files", "folder.png" )));
// To add navigation sub entries use
// OC_App::addNavigationSubEntry( "files_index", array( ... ));
?>

@ -1,4 +1,4 @@
<div class="controls">
<div id="controls">
<span class="nav">
<?php echo($_['breadcrumb']); ?>
</span>

@ -2,13 +2,4 @@
OC_App::register( array( "order" => 1, "id" => "help", "name" => "Help" ));
// 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( "help", "help.png" ));
if( isset( $_SESSION["user_id"] ) && OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
OC_App::addAdminPage( $entry );
}
else{
OC_App::addSettingsPage( $entry );
}
?>

@ -18,7 +18,7 @@ OC_App::setActiveNavigationEntry( "help" );
$kbe=OC_OCSClient::getKnownledgebaseEntries();
$tmpl = new OC_Template( "help", "index", "admin" );
$tmpl = new OC_Template( "help", "index", "user" );
$tmpl->assign( "kbe", $kbe );
$tmpl->assign( "pagecount", $pagecount );
$tmpl->assign( "page", $page );

@ -30,10 +30,7 @@ class OC_App{
static private $init = false;
static private $apps = array();
static private $activeapp = '';
static private $adminpages = array();
static private $settingspages = array();
static private $navigation = array();
static private $subnavigation = array();
/**
* @brief loads all apps
@ -166,38 +163,6 @@ class OC_App{
return true;
}
/**
* @brief adds a sub entry to the navigation
* @param $parent id of the parent
* @param $data array containing the data
* @returns true/false
*
* This function adds a new sub entry to the navigation visible to users.
* these entries are visible only if the parent navigation entry is marked
* as being active (see activateNavigationEntry()). $data is an associative
* array.
* The following keys are required:
* - id: unique id for this entry ('addressbook_index')
* - href: link to the page
* - name: Human readable name ('Addressbook')
*
* The following keys are optional:
* - icon: path to the icon of the app
* - order: integer, that influences the position of your application in
* the navigation. Lower values come first.
*/
public static function addNavigationSubEntry( $parent, $data ){
$data['active']=false;
if(!isset($data['icon'])){
$data['icon']='';
}
if( !array_key_exists( $parent, self::$subnavigation )){
self::$subnavigation[$parent] = array();
}
self::$subnavigation[$parent][] = $data;
return true;
}
/**
* @brief marks a navigation entry as active
* @param $id id of the entry
@ -223,70 +188,6 @@ class OC_App{
return self::$activeapp;
}
/**
* @brief registers an admin page
* @param $data array containing the data
* @returns true/false
*
* This function registers a admin page that will be shown in the admin
* menu. $data is an associative array.
* The following keys are required:
* - id: unique id for this entry ('files_admin')
* - href: link to the admin page
* - name: Human readable name ('Files Administration')
*
* The following keys are optional:
* - order: integer, that influences the position of your application in
* the list. Lower values come first.
*/
public static function addAdminPage( $data = array()){
// TODO: write function
OC_App::$adminpages[] = $data;
return true;
}
/**
* @brief registers a settings page
* @param $data array containing the data
* @returns true/false
*
* This function registers a settings page. $data is an associative array.
* The following keys are required:
* - app: app the settings belong to ('files')
* - id: unique id for this entry ('files_public')
* - href: link to the admin page
* - name: Human readable name ('Public files')
*
* The following keys are optional:
* - order: integer, that influences the position of your application in
* the list. Lower values come first.
*
* For the main settings page of an app, the keys 'app' and 'id' have to be
* the same.
*/
public static function addSettingsPage( $data = array()){
// TODO: write function
OC_App::$settingspages[] = $data;
return true;
}
/**
* @brief Returns the navigation
* @returns associative array
*
* This function returns an array containing all entries added. The
* entries are sorted by the key 'order' ascending. Additional to the keys
* given for each app the following keys exist:
* - active: boolean, signals if the user is on this navigation entry
* - children: array that is empty if the key 'active' is false or
* contains the subentries if the key 'active' is true
*/
public static function getNavigation(){
$navigation = self::proceedNavigation( self::$navigation );
$navigation = self::addSubNavigation( $navigation );
return $navigation;
}
/**
* @brief Returns the Settings Navigation
* @returns associative array
@ -295,57 +196,20 @@ class OC_App{
* entries are sorted by the key 'order' ascending.
*/
public static function getSettingsNavigation(){
$navigation = self::proceedNavigation( self::$settingspages );
$navigation = self::addSubNavigation( $navigation );
return $navigation;
}
/**
* @brief Returns the admin navigation
* @returns associative array
*
* This function returns an array containing all admin pages added. The
* entries are sorted by the key 'order' ascending.
*/
public static function getAdminNavigation(){
$navigation = self::proceedNavigation( self::$adminpages );
$navigation = self::addSubNavigation( $navigation );
return $navigation;
}
/// Private foo
private static function addSubNavigation( $list ){
if(isset(self::$subnavigation[self::$activeapp])){
$subNav=self::$subnavigation[self::$activeapp];
foreach( $list as &$naventry ){
if( $naventry['id'] == self::$activeapp ){
$naventry['active'] = true;
$naventry['subnavigation'] = $subNav;
}
}
}else{
foreach(self::$subnavigation as $parent=>$entries){
$activeParent=false;
foreach($entries as &$subNav){
$subNav['active']=$subNav['id'] == self::$activeapp;
if($subNav['active']){
$activeParent=true;
}
}
if($activeParent){
foreach( $list as &$naventry ){
if( $naventry['id'] == $parent ){
$naventry['active'] = true;
$naventry['subnavigation'] = $entries;
}
}
}
}
$admin=array(
array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "admin", "users.php" ), "name" => "Users", "icon" => OC_Helper::imagePath( "admin", "users.png" )),
array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "admin", "apps.php?installed" ), "name" => "Apps", "icon" => OC_Helper::imagePath( "admin", "apps.png" )),
array( "id" => "files_administration", "order" => 3, "href" => OC_Helper::linkTo( "files", "admin.php" ), "name" => "Files", "icon" => OC_Helper::imagePath( "files", "folder.png" )),
);
$settings=array(
array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "help", "index.php" ), "name" => "Help", "icon" => OC_Helper::imagePath( "help", "help.png" )),
array( "id" => "settings", "order" => 1, "href" => OC_Helper::linkTo( "settings", "index.php" ), "name" => "Personal", "icon" => OC_Helper::imagePath( "settings", "personal.png" ))
);
if( OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
$settings=array_merge($admin,$settings);
}
return $list;
$navigation = self::proceedNavigation($settings);
return $navigation;
}
/// This is private as well. It simply works, so don't ask for more details
@ -354,9 +218,6 @@ class OC_App{
$naventry['subnavigation'] = array();
if( $naventry['id'] == self::$activeapp ){
$naventry['active'] = true;
if( array_key_exists( $naventry['id'], self::$subnavigation )){
$naventry['subnavigation'] = self::$subnavigation[$naventry['id']];
}
}
else{
$naventry['active'] = false;
@ -392,6 +253,22 @@ class OC_App{
return $data;
}
/**
* @brief Returns the navigation
* @returns associative array
*
* This function returns an array containing all entries added. The
* entries are sorted by the key 'order' ascending. Additional to the keys
* given for each app the following keys exist:
* - active: boolean, signals if the user is on this navigation entry
* - children: array that is empty if the key 'active' is false or
* contains the subentries if the key 'active' is true
*/
public static function getNavigation(){
$navigation = self::proceedNavigation( self::$navigation );
return $navigation;
}
/**
* get the id of loaded app
* @return string

@ -224,7 +224,9 @@ class OC_Setup {
OC_Installer::installShippedApps(true);
//create htaccess files for apache hosts
self::createHtaccess(); //TODO detect if apache is used
if (strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) {
self::createHtaccess();
}
//and we are done
OC_Config::setValue('installed', true);

@ -233,23 +233,16 @@ class OC_Template{
$search=new OC_Template( 'core', 'part.searchbox');
$search->assign('searchurl',OC_Helper::linkTo( 'search', 'index.php' ));
$page->assign('searchbox', $search->fetchPage());
if(array_search(OC_APP::getCurrentApp(),array('settings','admin','help'))!==false){
$page->assign('bodyid','body-settings');
}else{
$page->assign('bodyid','body-user');
}
// Add navigation entry
$page->assign( "navigation", OC_App::getNavigation());
}
elseif( $this->renderas == "admin" ){
$page = new OC_Template( "core", "layout.admin" );
$search=new OC_Template( 'core', 'part.searchbox');
$search->assign('searchurl',OC_Helper::linkTo( 'search', 'index.php' ));
$page->assign('searchbox', $search->fetchPage());
// Add menu data
if( OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
$page->assign( "adminnavigation", OC_App::getAdminNavigation());
}
$page->assign( "settingsnavigation", OC_App::getSettingsNavigation());
}
else{
}else{
$page = new OC_Template( "core", "layout.guest" );
}

@ -1,6 +1,5 @@
<?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" => "Personal", "icon" => OC_Helper::imagePath( "settings", "personal.png" )));
?>

@ -24,7 +24,7 @@ unset($languages[array_search($lang,$languages)]);
array_unshift($languages,$lang);
// Return template
$tmpl = new OC_Template( "settings", "index", "admin");
$tmpl = new OC_Template( "settings", "index", "user");
$tmpl->assign('usage',OC_Helper::humanFileSize($used));
$tmpl->assign('total_space',OC_Helper::humanFileSize($total));
$tmpl->assign('usage_relative',$relative);

Loading…
Cancel
Save