Merge branch 'master' into sharing
|
After Width: | Height: | Size: 742 B |
@ -0,0 +1,340 @@
|
||||
/* @group Base */
|
||||
select.chzn-select {
|
||||
visibility: hidden;
|
||||
height: 28px !important;
|
||||
min-height: 28px !important;
|
||||
}
|
||||
.chzn-container {
|
||||
font-size: 13px;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
zoom: 1;
|
||||
*display: inline;
|
||||
}
|
||||
.chzn-container .chzn-drop {
|
||||
background: #fff;
|
||||
border: 1px solid #aaa;
|
||||
border-top: 0;
|
||||
position: absolute;
|
||||
top: 29px;
|
||||
left: 0;
|
||||
-webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15);
|
||||
-moz-box-shadow : 0 4px 5px rgba(0,0,0,.15);
|
||||
-o-box-shadow : 0 4px 5px rgba(0,0,0,.15);
|
||||
box-shadow : 0 4px 5px rgba(0,0,0,.15);
|
||||
z-index: 999;
|
||||
}
|
||||
/* @end */
|
||||
|
||||
/* @group Single Chosen */
|
||||
.chzn-container-single .chzn-single {
|
||||
background-color: #fff;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
|
||||
background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
|
||||
background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
|
||||
background-image: -o-linear-gradient(top, #eeeeee 0%,#ffffff 50%);
|
||||
background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 50%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
|
||||
background-image: linear-gradient(top, #eeeeee 0%,#ffffff 50%);
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius : 4px;
|
||||
border-radius : 4px;
|
||||
-moz-background-clip : padding;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip : padding-box;
|
||||
border: 1px solid #aaa;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
padding: 0 0 0 8px;
|
||||
color: #444;
|
||||
text-decoration: none;
|
||||
}
|
||||
.chzn-container-single .chzn-single span {
|
||||
margin-right: 26px;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
-o-text-overflow: ellipsis;
|
||||
-ms-text-overflow: ellipsis;
|
||||
-moz-binding: url('/xml/ellipsis.xml#ellipsis');
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.chzn-container-single .chzn-single div {
|
||||
-webkit-border-radius: 0 4px 4px 0;
|
||||
-moz-border-radius : 0 4px 4px 0;
|
||||
border-radius : 0 4px 4px 0;
|
||||
-moz-background-clip : padding;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip : padding-box;
|
||||
background: #ccc;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
|
||||
background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
|
||||
background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
|
||||
background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
|
||||
background-image: -ms-linear-gradient(top, #cccccc 0%,#eeeeee 60%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cccccc', endColorstr='#eeeeee',GradientType=0 );
|
||||
background-image: linear-gradient(top, #cccccc 0%,#eeeeee 60%);
|
||||
border-left: 1px solid #aaa;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 18px;
|
||||
}
|
||||
.chzn-container-single .chzn-single div b {
|
||||
background: url('chosen-sprite.png') no-repeat 0 1px;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.chzn-container-single .chzn-search {
|
||||
padding: 3px 4px;
|
||||
margin: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.chzn-container-single .chzn-search input {
|
||||
background: #fff url('chosen-sprite.png') no-repeat 100% -20px;
|
||||
background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
|
||||
background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||
background: url('chosen-sprite.png') no-repeat 100% -20px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||
background: url('chosen-sprite.png') no-repeat 100% -20px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
|
||||
background: url('chosen-sprite.png') no-repeat 100% -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%);
|
||||
background: url('chosen-sprite.png') no-repeat 100% -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%);
|
||||
background: url('chosen-sprite.png') no-repeat 100% -20px, linear-gradient(top, #ffffff 85%,#eeeeee 99%);
|
||||
margin: 1px 0;
|
||||
padding: 4px 20px 4px 5px;
|
||||
outline: 0;
|
||||
border: 1px solid #aaa;
|
||||
font-family: sans-serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
.chzn-container-single .chzn-drop {
|
||||
-webkit-border-radius: 0 0 4px 4px;
|
||||
-moz-border-radius : 0 0 4px 4px;
|
||||
border-radius : 0 0 4px 4px;
|
||||
-moz-background-clip : padding;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip : padding-box;
|
||||
}
|
||||
/* @end */
|
||||
|
||||
/* @group Multi Chosen */
|
||||
.chzn-container-multi .chzn-choices {
|
||||
background-color: #fff;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
|
||||
background-image: -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||
background-image: -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||
background-image: -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
|
||||
background-image: -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
|
||||
background-image: linear-gradient(top, #ffffff 85%,#eeeeee 99%);
|
||||
border: 1px solid #aaa;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
cursor: text;
|
||||
overflow: hidden;
|
||||
height: auto !important;
|
||||
height: 1%;
|
||||
position: relative;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices li {
|
||||
float: left;
|
||||
list-style: none;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-field {
|
||||
white-space: nowrap;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-field input {
|
||||
color: #666;
|
||||
background: transparent !important;
|
||||
border: 0 !important;
|
||||
padding: 5px;
|
||||
margin: 1px 0;
|
||||
outline: 0;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow : none;
|
||||
-o-box-shadow : none;
|
||||
box-shadow : none;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-field .default {
|
||||
color: #999;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-choice {
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius : 3px;
|
||||
border-radius : 3px;
|
||||
-moz-background-clip : padding;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip : padding-box;
|
||||
background-color: #e4e4e4;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #e4e4e4), color-stop(0.7, #eeeeee));
|
||||
background-image: -webkit-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%);
|
||||
background-image: -moz-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%);
|
||||
background-image: -o-linear-gradient(bottom, #e4e4e4 0%, #eeeeee 70%);
|
||||
background-image: -ms-linear-gradient(top, #e4e4e4 0%,#eeeeee 70%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e4e4e4', endColorstr='#eeeeee',GradientType=0 );
|
||||
background-image: linear-gradient(top, #e4e4e4 0%,#eeeeee 70%);
|
||||
color: #333;
|
||||
border: 1px solid #b4b4b4;
|
||||
line-height: 13px;
|
||||
padding: 3px 19px 3px 6px;
|
||||
margin: 3px 0 3px 5px;
|
||||
position: relative;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-choice span {
|
||||
cursor: default;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-choice-focus {
|
||||
background: #d4d4d4;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-choice .search-choice-close {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 6px;
|
||||
width: 8px;
|
||||
height: 9px;
|
||||
font-size: 1px;
|
||||
background: url(chosen-sprite.png) right top no-repeat;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover {
|
||||
background-position: right -9px;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close {
|
||||
background-position: right -9px;
|
||||
}
|
||||
/* @end */
|
||||
|
||||
/* @group Results */
|
||||
.chzn-container .chzn-results {
|
||||
margin: 0 4px 4px 0;
|
||||
max-height: 190px;
|
||||
padding: 0 0 0 4px;
|
||||
position: relative;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.chzn-container-multi .chzn-results {
|
||||
margin: -1px 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
.chzn-container .chzn-results li {
|
||||
line-height: 80%;
|
||||
padding: 7px 7px 8px;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.chzn-container .chzn-results .active-result {
|
||||
cursor: pointer;
|
||||
}
|
||||
.chzn-container .chzn-results .highlighted {
|
||||
background: #3875d7;
|
||||
color: #fff;
|
||||
}
|
||||
.chzn-container .chzn-results li em {
|
||||
background: #feffde;
|
||||
font-style: normal;
|
||||
}
|
||||
.chzn-container .chzn-results .highlighted em {
|
||||
background: transparent;
|
||||
}
|
||||
.chzn-container .chzn-results .no-results {
|
||||
background: #f4f4f4;
|
||||
}
|
||||
.chzn-container .chzn-results .group-result {
|
||||
cursor: default;
|
||||
color: #999;
|
||||
font-weight: bold;
|
||||
}
|
||||
.chzn-container .chzn-results .group-option {
|
||||
padding-left: 20px;
|
||||
}
|
||||
.chzn-container-multi .chzn-drop .result-selected {
|
||||
display: none;
|
||||
}
|
||||
/* @end */
|
||||
|
||||
/* @group Active */
|
||||
.chzn-container-active .chzn-single {
|
||||
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
|
||||
-moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
|
||||
-o-box-shadow : 0 0 5px rgba(0,0,0,.3);
|
||||
box-shadow : 0 0 5px rgba(0,0,0,.3);
|
||||
border: 1px solid #5897fb;
|
||||
}
|
||||
.chzn-container-active .chzn-single-with-drop {
|
||||
border: 1px solid #aaa;
|
||||
-webkit-box-shadow: 0 1px 0 #fff inset;
|
||||
-moz-box-shadow : 0 1px 0 #fff inset;
|
||||
-o-box-shadow : 0 1px 0 #fff inset;
|
||||
box-shadow : 0 1px 0 #fff inset;
|
||||
background-color: #eee;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
|
||||
background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
|
||||
background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
|
||||
background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
|
||||
background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
|
||||
background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
|
||||
-webkit-border-bottom-left-radius : 0;
|
||||
-webkit-border-bottom-right-radius: 0;
|
||||
-moz-border-radius-bottomleft : 0;
|
||||
-moz-border-radius-bottomright: 0;
|
||||
border-bottom-left-radius : 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.chzn-container-active .chzn-single-with-drop div {
|
||||
background: transparent;
|
||||
border-left: none;
|
||||
}
|
||||
.chzn-container-active .chzn-single-with-drop div b {
|
||||
background-position: -18px 1px;
|
||||
}
|
||||
.chzn-container-active .chzn-choices {
|
||||
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
|
||||
-moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
|
||||
-o-box-shadow : 0 0 5px rgba(0,0,0,.3);
|
||||
box-shadow : 0 0 5px rgba(0,0,0,.3);
|
||||
border: 1px solid #5897fb;
|
||||
}
|
||||
.chzn-container-active .chzn-choices .search-field input {
|
||||
color: #111 !important;
|
||||
}
|
||||
/* @end */
|
||||
|
||||
/* @group Right to Left */
|
||||
.chzn-rtl { direction:rtl;text-align: right; }
|
||||
.chzn-rtl .chzn-single { padding-left: 0; padding-right: 8px; }
|
||||
.chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; }
|
||||
.chzn-rtl .chzn-single div {
|
||||
left: 0; right: auto;
|
||||
border-left: none; border-right: 1px solid #aaaaaa;
|
||||
-webkit-border-radius: 4px 0 0 4px;
|
||||
-moz-border-radius : 4px 0 0 4px;
|
||||
border-radius : 4px 0 0 4px;
|
||||
}
|
||||
.chzn-rtl .chzn-choices li { float: right; }
|
||||
.chzn-rtl .chzn-choices .search-choice { padding: 3px 6px 3px 19px; margin: 3px 5px 3px 0; }
|
||||
.chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 5px; right: auto; background-position: right top;}
|
||||
.chzn-rtl.chzn-container-single .chzn-results { margin-left: 4px; margin-right: 0; padding-left: 0; padding-right: 4px; }
|
||||
.chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 20px; }
|
||||
.chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; }
|
||||
.chzn-rtl .chzn-search input {
|
||||
background: url('chosen-sprite.png') no-repeat -38px -20px, #ffffff;
|
||||
background: url('chosen-sprite.png') no-repeat -38px -20px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
|
||||
background: url('chosen-sprite.png') no-repeat -38px -20px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||
background: url('chosen-sprite.png') no-repeat -38px -20px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||
background: url('chosen-sprite.png') no-repeat -38px -20px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
|
||||
background: url('chosen-sprite.png') no-repeat -38px -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%);
|
||||
background: url('chosen-sprite.png') no-repeat -38px -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%);
|
||||
background: url('chosen-sprite.png') no-repeat -38px -20px, linear-gradient(top, #ffffff 85%,#eeeeee 99%);
|
||||
padding: 4px 5px 4px 20px;
|
||||
}
|
||||
/* @end */
|
||||
@ -0,0 +1,24 @@
|
||||
# Chosen, a Select Box Enhancer for jQuery and Protoype
|
||||
## by Patrick Filler for [Harvest](http://getharvest.com)
|
||||
|
||||
Available for use under the [MIT License](http://en.wikipedia.org/wiki/MIT_License)
|
||||
|
||||
Copyright (c) 2011 by Harvest
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@ -0,0 +1,46 @@
|
||||
# Chosen
|
||||
|
||||
Chosen is a library for making long, unwieldy select boxes more user friendly.
|
||||
|
||||
- jQuery support: 1.4+
|
||||
- Prototype support: 1.7+
|
||||
|
||||
For documentation, usage, and examples, see:
|
||||
http://harvesthq.github.com/chosen
|
||||
|
||||
### Contributing to Chosen
|
||||
|
||||
Contributions and pull requests are very welcome. Please follow these guidelines when submitting new code.
|
||||
|
||||
1. Make all changes in Coffeescript files, **not** JavaScript files.
|
||||
2. For feature changes, update both jQuery *and* Prototype versions
|
||||
3. Use 'cake build' to generate Chosen's JavaScript file and minified version.
|
||||
4. Don't touch the VERSION file
|
||||
5. Submit a Pull Request using GitHub.
|
||||
|
||||
### Using CoffeeScript & Cake
|
||||
|
||||
First, make sure you have the proper CoffeeScript / Cake set-up in place.
|
||||
|
||||
1. Install Coffeescript: the [CoffeeScript documentation](http://jashkenas.github.com/coffee-script/) provides easy-to-follow instructions.
|
||||
2. Install UglifyJS: <code>npm -g install uglify-js</code>
|
||||
3. Verify that your $NODE_PATH is properly configured using <code>echo $NODE_PATH</code>
|
||||
|
||||
Once you're configured, building the JavasScript from the command line is easy:
|
||||
|
||||
cake build # build Chosen from source
|
||||
cake watch # watch coffee/ for changes and build Chosen
|
||||
|
||||
If you're interested, you can find the recipes in Cakefile.
|
||||
|
||||
|
||||
### Chosen Credits
|
||||
|
||||
- Built by [Harvest](http://www.getharvest.com/)
|
||||
- Concept and development by [Patrick Filler](http://www.patrickfiller.com/)
|
||||
- Design and CSS by [Matthew Lettini](http://matthewlettini.com/)
|
||||
|
||||
### Notable Forks
|
||||
|
||||
- [Chosen for MooTools](https://github.com/julesjanssen/chosen), by Jules Janssen
|
||||
- [Chosen Drupal 7 Module](https://github.com/Polzme/chosen), by Pol Dell'Aiera
|
||||
@ -0,0 +1 @@
|
||||
0.9.1
|
||||
@ -1,9 +1,14 @@
|
||||
/* APPS TABLE */
|
||||
table td.date { width:5em; padding:.5em 1em; text-align:right; }
|
||||
table td.version, table td.enabled, table td.disabled { padding:.5em 1em; text-align:center; }
|
||||
table td.date { width:5em; padding:.5em 1em; text-align:left; }
|
||||
table td.version, table td.enabled, table td.disabled { padding:.5em 1em; text-align:left; }
|
||||
.preview { padding:3px; text-align:left; }
|
||||
table td.date { width:11em; color:#555555; }
|
||||
table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; }
|
||||
table td.name a { padding:6px; text-decoration:none; color:#555555; }
|
||||
.type { text-decoration:none; color:#888888; font-size:.8em; }
|
||||
.description { text-decoration:none; color:#666666; font-size:.9em; }
|
||||
table td.date { width:11em; color:#555; }
|
||||
table td.selection, table th.selection, table td.fileaction { width:2em; text-align:left; }
|
||||
table td.name a { padding:6px; text-decoration:none; color:#555; }
|
||||
.type { text-decoration:none; color:#888; font-size:.8em; }
|
||||
.description { text-decoration:none; color:#666; font-size:.9em; }
|
||||
|
||||
#content ul#apps { width:40em; list-style:none; }
|
||||
#content ul#apps li { display:block; padding:.2em; clear:right; }
|
||||
#content ul#apps em { color:#555; }
|
||||
#content ul#apps input { float:right; }
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
form {display:inline}
|
||||
td.remove>img,td.select>input{display:none;cursor:pointer}
|
||||
td.select,td.remove{width:1em}
|
||||
tr:hover>td.remove>img{display:inline}
|
||||
li.selected{background-color:#ddd}
|
||||
@ -1,18 +1,17 @@
|
||||
$("input[x-use='appenablebutton']").live( "click", function(){
|
||||
appid = $(this).parent().parent().attr("x-uid");
|
||||
appid = $(this).parent().data("uid");
|
||||
|
||||
//alert("dsfsdfsdf");
|
||||
if($(this).val() == "enabled"){
|
||||
$(this).attr("value","disabled");
|
||||
$(this).removeClass( "enabled" );
|
||||
$(this).addClass( "disabled" );
|
||||
//$.post( "ajax/disableapp.php", $(appid).serialize(), function(data){} );
|
||||
$.post( "ajax/disableapp.php", { appid: appid }, function(data){ alert(data.status);});
|
||||
$.post( "ajax/disableapp.php", 'appid='+appid);
|
||||
}
|
||||
else if($(this).val() == "disabled"){
|
||||
$(this).attr("value","enabled");
|
||||
$(this).removeClass( "disabled" );
|
||||
$(this).addClass( "enabled" );
|
||||
$.post( "ajax/enableapp.php", { appid: appid }, function(data){ alert(data.status);} );
|
||||
$.post( "ajax/enableapp.php", 'appid='+appid);
|
||||
}
|
||||
});
|
||||
@ -1,340 +1,100 @@
|
||||
$(document).ready(function(){
|
||||
// Vars we need
|
||||
var uid = "";
|
||||
var gid = "";
|
||||
var togglepassword = "";
|
||||
var togglegroup = "";
|
||||
|
||||
//#########################################################################
|
||||
// Stuff I don't understand
|
||||
//#########################################################################
|
||||
|
||||
function doToggleGroup( group ){
|
||||
$("#changegroupgid").val(group);
|
||||
|
||||
// Serialize the data
|
||||
var post = $( "#changegroupsform" ).serialize();
|
||||
// Ajax foo
|
||||
$.post( 'ajax/togglegroups.php', post, function(data){
|
||||
if( data.status == "success" ){
|
||||
var groups = [];
|
||||
$("input[x-use='togglegroup']").each( function(index){
|
||||
if( $(this).attr("checked")){
|
||||
groups.push($(this).val());
|
||||
}
|
||||
});
|
||||
if( groups.length == 0 ){
|
||||
$("#changegroups").prev().html( ' ' );
|
||||
}
|
||||
else{
|
||||
$("#changegroups").prev().html( groups.join(", "));
|
||||
}
|
||||
}
|
||||
else{
|
||||
printError( data.data.message );
|
||||
$('select[multiple]').chosen();
|
||||
|
||||
$('td.remove>img').live('click',function(event){
|
||||
var uid=$(this).parent().parent().data('uid');
|
||||
$.post(
|
||||
OC.filePath('admin','ajax','removeuser.php'),
|
||||
{username:uid},
|
||||
function(result){
|
||||
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function printError( message ){
|
||||
$("#errormessage").text( message );
|
||||
$("#errordialog").dialog( "open" );
|
||||
return false;
|
||||
}
|
||||
|
||||
//#########################################################################
|
||||
// Functions for editing the dom after user manipulation
|
||||
//#########################################################################
|
||||
|
||||
// Manipulating the page after crteating a user
|
||||
function userCreated( username, groups ){
|
||||
// We need at least a space for showing the div
|
||||
if( groups == "" ){
|
||||
groups = ' ';
|
||||
}
|
||||
|
||||
// Add user to table
|
||||
var newrow = '<tr x-uid="'+username+'"><td x-use="username"><div x-use="usernamediv">'+username+'</div></td>';
|
||||
newrow = newrow+'<td x-use="usergroups"><div x-use="usergroupsdiv">'+groups+'</td>';
|
||||
newrow = newrow+'<td><a class="removeuserbutton" href="">remove</a></td></tr>';
|
||||
$("#usertable").append( newrow );
|
||||
|
||||
// Clear forms
|
||||
$("input[x-use='createuserfield']").val( "" );
|
||||
$("input[x-use='createusercheckbox']").attr( "checked", false );
|
||||
}
|
||||
|
||||
function userRemoved( username ){
|
||||
$( "tr[x-uid='"+username+"']" ).remove();
|
||||
}
|
||||
|
||||
function groupCreated( groupname ){
|
||||
var newrow = '<tr x-gid="'+groupname+'"><td>' + groupname + '</td>';
|
||||
newrow = newrow + '<td><a class="removegroupbutton" href="">remove</a></td></tr>';
|
||||
$("#grouptable").append( newrow );
|
||||
|
||||
// Delete form content
|
||||
$("input[x-use='creategroupfield']").val( "" );
|
||||
|
||||
// Add group option to Create User and Edit User
|
||||
var createuser = '<input x-use="createusercheckbox" x-gid="'+groupname+'" type="checkbox" name="groups[]" value="'+groupname+'" /> <span x-gid="'+groupname+'">'+groupname+'<br /></span>';
|
||||
$("#createusergroups").append( createuser );
|
||||
var changeuser = '<input x-use="togglegroup" x-gid="'+groupname+'" type="checkbox" name="groups[]" value="'+groupname+'" /> <span x-use="togglegroup" x-gid="'+groupname+'">'+groupname+'<br /></span>';
|
||||
$("#changegroupsform").append( changeuser );
|
||||
}
|
||||
|
||||
function groupRemoved( groupname ){
|
||||
// Delete the options
|
||||
$( "tr[x-gid='"+groupname+"']" ).remove();
|
||||
$( "span[x-gid='"+groupname+"']" ).remove();
|
||||
$( "input[x-gid='"+groupname+"']" ).remove();
|
||||
|
||||
// remove it from user list
|
||||
$( "div[x-use='usergroupsdiv']" ).each(function(index){
|
||||
var content = $(this).text();
|
||||
var list = content.split( ", " );
|
||||
var newlist = [];
|
||||
for( var i = 0; i < list.length; i++ ){
|
||||
var temp = list[i];
|
||||
if( temp != groupname ){
|
||||
newlist.push( temp );
|
||||
}
|
||||
);
|
||||
$(this).parent().parent().remove();
|
||||
});
|
||||
|
||||
$('#newuser').submit(function(event){
|
||||
event.preventDefault();
|
||||
var username=$('#newusername').val();
|
||||
var password=$('#newuserpassword').val();
|
||||
var groups=$('#newusergroups').val();
|
||||
$.post(
|
||||
OC.filePath('admin','ajax','createuser.php'),
|
||||
{
|
||||
username:username,
|
||||
password:password,
|
||||
groups:groups,
|
||||
},
|
||||
function(result){
|
||||
|
||||
}
|
||||
var newstring = newlist.join( ", " );
|
||||
$(this).html( newstring )
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//#########################################################################
|
||||
// Editing the users properties by clicking the cell
|
||||
//#########################################################################
|
||||
|
||||
// Password (clicking on user name)
|
||||
$("span[x-use='usernamediv']").live( "click", function(){
|
||||
if( togglepassword == "" || $(this).parent().parent().attr("x-uid") != togglepassword ){
|
||||
togglepassword = $(this).parent().parent().attr("x-uid");
|
||||
// Set the username!
|
||||
$("#changepassworduid").val(togglepassword);
|
||||
$("#changepasswordpwd").val("");
|
||||
$(this).parent().append( $('#changepassword') );
|
||||
$('#changepassword').show();
|
||||
}
|
||||
else{
|
||||
$('#changepassword').hide();
|
||||
togglepassword = "";
|
||||
);
|
||||
var tr=$('#rightcontent tr').first().clone();
|
||||
tr.attr('data-uid',username);
|
||||
tr.find('td.name').text(username);
|
||||
tr.find('td.groups').text(groups.join(', '));
|
||||
$('#rightcontent tr').first().after(tr);
|
||||
if(groups.indexOf($('#leftcontent li.selected').text().trim())!=-1){
|
||||
tr.find('td.select input').attr('checked','checked');
|
||||
}
|
||||
});
|
||||
|
||||
$("#changepasswordbutton").click( function(){
|
||||
// Serialize the data
|
||||
var post = $( "#changepasswordform" ).serialize();
|
||||
// Ajax foo
|
||||
$.post( 'ajax/changepassword.php', post, function(data){
|
||||
if( data.status == "success" ){
|
||||
togglepassword = "";
|
||||
$('#changepassword').hide();
|
||||
}
|
||||
else{
|
||||
printError( data.data.message );
|
||||
|
||||
$('#newgroup').submit(function(event){
|
||||
event.preventDefault();
|
||||
var name=$('#newgroupname').val();
|
||||
$.post(
|
||||
OC.filePath('admin','ajax','creategroup.php'),
|
||||
{groupname:name},
|
||||
function(result){
|
||||
|
||||
}
|
||||
});
|
||||
return false;
|
||||
);
|
||||
$('#newusergroups').append('<option value="'+name+'">'+name+'</option>');
|
||||
$('select[multiple]').trigger("liszt:updated");
|
||||
var li=$('#leftcontent li').first().next().clone();
|
||||
li.text(name);
|
||||
$('#leftcontent li').first().after(li);
|
||||
});
|
||||
|
||||
// Groups
|
||||
$("div[x-use='usergroupsdiv']").live( "click", function(){
|
||||
if( togglegroup == "" || $(this).parent().parent().attr("x-uid") != togglegroup){
|
||||
togglegroup = $(this).parent().parent().attr("x-uid");
|
||||
var groups = $(this).text();
|
||||
groups = groups.split(", ");
|
||||
$("input[x-use='togglegroup']").each( function(index){
|
||||
var check = false;
|
||||
// Group checked?
|
||||
for( var i = 0; i < groups.length; i++ ){
|
||||
if( $(this).val() == groups[i] ){
|
||||
check = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check/uncheck
|
||||
if( check ){
|
||||
$(this).attr("checked","checked");
|
||||
}
|
||||
else{
|
||||
$(this).removeAttr("checked");
|
||||
}
|
||||
});
|
||||
$("#changegroupuid").val(togglegroup);
|
||||
$(this).empty();
|
||||
$(this).parent().append( $('#changegroups') );
|
||||
$('#changegroups').show();
|
||||
}
|
||||
else{
|
||||
var groups = [];
|
||||
$("input[x-use='togglegroup']").each( function(index){
|
||||
if( $(this).attr("checked")){
|
||||
groups.push($(this).val());
|
||||
}
|
||||
});
|
||||
if( groups.length == 0 ){
|
||||
$("#changegroups").prev().html( ' ' );
|
||||
}
|
||||
else{
|
||||
$("#changegroups").prev().html( groups.join(", "));
|
||||
}
|
||||
$('#changegroups').hide();
|
||||
togglegroup = "";
|
||||
}
|
||||
|
||||
$('#leftcontent li').live('click',function(event){
|
||||
$('#leftcontent li').removeClass('selected');
|
||||
$(this).addClass('selected');
|
||||
$('#rightcontent tr td.select input').show();
|
||||
$('#rightcontent tr td.select input').removeAttr('checked');
|
||||
var group=$(this).text().trim();
|
||||
var rows=$('#rightcontent tr').filter(function(i,tr){
|
||||
return ($(tr).children('td.groups').text().split(', ').indexOf(group)>-1);
|
||||
});
|
||||
rows.find('td.select input').attr('checked','checked');
|
||||
});
|
||||
|
||||
$("span[x-use='togglegroup']").live( "click", function(){
|
||||
if( $(this).prev().attr("checked")){
|
||||
$(this).prev().removeAttr("checked")
|
||||
}
|
||||
else{
|
||||
$(this).prev().attr("checked","checked")
|
||||
$('#rightcontent tr td.select input').live('change',function(event){
|
||||
var group=$('#leftcontent li.selected').text().trim();
|
||||
var user=$(this).parent().parent().children('td.name').text().trim();
|
||||
if(group=='admin' && user==OC.currentUser){
|
||||
event.preventDefault();
|
||||
$(this).attr('checked','checked');
|
||||
return false;
|
||||
}
|
||||
doToggleGroup( $(this).attr("x-gid"));
|
||||
});
|
||||
|
||||
$("input[x-use='togglegroup']").live( "click", function(){
|
||||
doToggleGroup( $(this).attr("x-gid"));
|
||||
});
|
||||
//#########################################################################
|
||||
// Clicking on buttons
|
||||
//#########################################################################
|
||||
|
||||
|
||||
// Create a new user
|
||||
$( "#createuserbutton" )
|
||||
.click(function(){
|
||||
if(!$( "#createuserbutton" ).data('active')){
|
||||
$( "#createuserbutton" ).data('active',true);
|
||||
|
||||
// Create the post data
|
||||
var post = $( "#createuserdata" ).serialize();
|
||||
|
||||
// Ajax call
|
||||
$.post( 'ajax/createuser.php', post, function(data){
|
||||
$( "#createuserbutton" ).data('active',false);
|
||||
if(group){
|
||||
$.post(
|
||||
OC.filePath('admin','ajax','togglegroups.php'),
|
||||
{
|
||||
username:user,
|
||||
group:group
|
||||
},
|
||||
function(result){
|
||||
|
||||
// If it says "success" then we are happy
|
||||
if( data.status == "success" ){
|
||||
userCreated( data.data.username, data.data.groups );
|
||||
}
|
||||
else{
|
||||
printError( data.data.message );
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
$( ".removeuserbutton" ).live( 'click', function() {
|
||||
uid = $( this ).parent().parent().attr( 'x-uid' );
|
||||
$("#deleteuserusername").html(uid);
|
||||
$("#deleteusernamefield").val(uid);
|
||||
$("#removeuserform").dialog( "open" );
|
||||
return false;
|
||||
});
|
||||
|
||||
$( "#creategroupbutton" )
|
||||
.click(function(){
|
||||
// Serialize the data
|
||||
var post = $( "#creategroupdata" ).serialize();
|
||||
// Ajax foo
|
||||
$.post( 'ajax/creategroup.php', post, function(data){
|
||||
if( data.status == "success" ){
|
||||
groupCreated( data.data.groupname );
|
||||
}
|
||||
else{
|
||||
printError( data.data.message );
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$( ".removegroupbutton" ).live( 'click', function(){
|
||||
gid = $( this ).parent().parent().attr( 'x-gid' );
|
||||
$("#removegroupgroupname").html(gid);
|
||||
$("#removegroupnamefield").val(gid);
|
||||
$("#removegroupform").dialog( "open" );
|
||||
return false;
|
||||
});
|
||||
|
||||
//#########################################################################
|
||||
// Dialogs
|
||||
//#########################################################################
|
||||
|
||||
// Removing users
|
||||
$( "#errordialog" ).dialog({
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
buttons: {
|
||||
OK: function() {
|
||||
$( this ).dialog( "close" );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Removing users
|
||||
$( "#removeuserform" ).dialog({
|
||||
autoOpen: false,
|
||||
height: 300,
|
||||
width: 350,
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Remove user": function() {
|
||||
var post = $( "#removeuserdata" ).serialize();
|
||||
$.post( 'ajax/removeuser.php', post, function(data){
|
||||
if( data.status == "success" ){
|
||||
userRemoved( uid );
|
||||
}
|
||||
else{
|
||||
printError( data.data.message );
|
||||
}
|
||||
});
|
||||
$( this ).dialog( "close" );
|
||||
},
|
||||
Cancel: function() {
|
||||
$( this ).dialog( "close" );
|
||||
}
|
||||
},
|
||||
close: function() {
|
||||
true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Dialog for adding users
|
||||
$( "#removegroupform" ).dialog({
|
||||
autoOpen: false,
|
||||
height: 300,
|
||||
width: 350,
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Remove group": function(){
|
||||
var post = $( "#removegroupdata" ).serialize();
|
||||
$.post( 'ajax/removegroup.php', post, function(data){
|
||||
if( data.status == "success" ){
|
||||
groupRemoved( gid );
|
||||
}
|
||||
else{
|
||||
printError( data.data.message );
|
||||
}
|
||||
});
|
||||
$( this ).dialog( "close" );
|
||||
},
|
||||
Cancel: function() {
|
||||
$( this ).dialog( "close" );
|
||||
);
|
||||
var groups=$(this).parent().parent().children('td.groups').text().trim().split(', ');
|
||||
if(groups[0]=='') groups.pop();
|
||||
var index=groups.indexOf(group);
|
||||
if(index==-1){
|
||||
groups.push(group);
|
||||
}else{
|
||||
groups.splice(index,1);
|
||||
}
|
||||
},
|
||||
close: function(){
|
||||
true;
|
||||
$(this).parent().parent().children('td.groups').text(groups.join(', '));
|
||||
}
|
||||
});
|
||||
|
||||
} );
|
||||
|
||||
});
|
||||
|
||||
@ -1,20 +1,7 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $l->t( 'Name' ); ?></th>
|
||||
<th><?php echo $l->t( 'Version' ); ?></th>
|
||||
<th><?php echo $l->t( 'Author' ); ?></th>
|
||||
<th><?php echo $l->t( 'Status' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($_["apps"] as $app): ?>
|
||||
<tr x-uid="<?php echo($app['id']); ?>">
|
||||
<td class="name" width="200"><?php echo($app['name']); ?></td>
|
||||
<td class="version"><?php echo($app['version']); ?></td>
|
||||
<td><?php echo($app['author']); ?></td>
|
||||
<td><input x-use="appenablebutton" type="submit" value="<?php echo $l->t( $app['enabled'] ? 'enabled' : 'disabled' ); ?>" class="appbutton <?php echo( $app['enabled'] ? 'enabled' : 'disabled' ); ?>" /></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<ul id="apps">
|
||||
<?php foreach($_["apps"] as $app): ?>
|
||||
<li data-uid="<?php echo($app['id']); ?>"><strong><?php echo($app['name']); ?></strong> <?php echo($app['version']); ?> <em>by <?php echo($app['author']); ?></em>
|
||||
<input x-use="appenablebutton" type="submit" value="<?php echo $l->t( $app['enabled'] ? 'enabled' : 'disabled' ); ?>" class="appbutton <?php echo( $app['enabled'] ? 'enabled' : 'disabled' ); ?>" />
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
@ -1,117 +1,39 @@
|
||||
<fieldset>
|
||||
<legend><?php echo $l->t( 'Users' ); ?></legend>
|
||||
<table id="usertable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $l->t( 'Name' ); ?></th>
|
||||
<th><?php echo $l->t( 'Groups' ); ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr id="createuserform">
|
||||
<form id="createuserdata">
|
||||
<td>
|
||||
<input x-use="createuserfield" type="text" name="username" placeholder="<?php echo $l->t( 'Name' ); ?>" />
|
||||
<input x-use="createuserfield" type="password" name="password" placeholder="<?php echo $l->t( 'Password' ); ?>" />
|
||||
</td>
|
||||
<td id="createusergroups">
|
||||
<?php foreach($_["groups"] as $i): ?>
|
||||
<input id='newuser_group_<?php echo $i["name"]; ?>' x-use="createusercheckbox" x-gid="<?php echo $i["name"]; ?>" type="checkbox" name="groups[]" value="<?php echo $i["name"]; ?>" />
|
||||
<span x-gid="<?php echo $i["name"]; ?>"><label for='newuser_group_<?php echo $i["name"]; ?>'><?php echo $i["name"]; ?></label></span>
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" id="createuserbutton" value="<?php echo $l->t( 'Add user' ); ?>" />
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php foreach($_["users"] as $user): ?>
|
||||
<tr x-uid="<?php echo $user["name"] ?>">
|
||||
<td x-use="username"><span x-use="usernamediv"><?php echo $user["name"]; ?></span></td>
|
||||
<td x-use="usergroups"><div x-use="usergroupsdiv"><?php if( $user["groups"] ){ echo $user["groups"]; }else{echo " ";} ?></div></td>
|
||||
<td>
|
||||
<?php if($user['name']!=OC_User::getUser()):?>
|
||||
<input type="submit" class="removeuserbutton" value="<?php echo $l->t( 'Remove' ); ?>" />
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $l->t( 'Groups' ); ?></legend>
|
||||
<table id="grouptable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $l->t( 'Name' ); ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<form id="creategroupdata">
|
||||
<tr>
|
||||
<td><input x-use="creategroupfield" type="text" name="groupname" placeholder="New group" /></td>
|
||||
<td><input type="submit" id="creategroupbutton" value="<?php echo $l->t( 'Create group' ); ?>" /></td>
|
||||
</tr>
|
||||
</form>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php foreach($_["groups"] as $group): ?>
|
||||
<tr x-gid="<?php echo $group["name"]; ?>">
|
||||
<td><?php echo $group["name"] ?></td>
|
||||
<td>
|
||||
<?php if( $group["name"] != "admin" ): ?>
|
||||
<input type="submit" class="removegroupbutton" value="<?php echo $l->t( 'remove' ); ?>" />
|
||||
<?php else: ?>
|
||||
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<span id="changegroups" style="display:none">
|
||||
<form id="changegroupsform">
|
||||
<input id="changegroupuid" type="hidden" name="username" value="" />
|
||||
<input id="changegroupgid" type="hidden" name="group" value="" />
|
||||
<?php foreach($_["groups"] as $i): ?>
|
||||
<input x-use="togglegroup" x-gid="<?php echo $i["name"]; ?>" type="checkbox" name="groups[]" value="<?php echo $i["name"]; ?>" />
|
||||
<span x-use="togglegroup" x-gid="<?php echo $i["name"]; ?>"><?php echo $i["name"]; ?></span>
|
||||
<?php endforeach; ?>
|
||||
<div id="controls">
|
||||
<form id="newgroup">
|
||||
<input id="newgroupname" placeholder="name"></input>
|
||||
<input type="submit" value="create"></input>
|
||||
</form>
|
||||
</span>
|
||||
|
||||
<span id="changepassword" style="display:none">
|
||||
<form id="changepasswordform">
|
||||
<input id="changepassworduid" type="hidden" name="username" value="" />
|
||||
<?php echo $l->t( 'Force new password:' ); ?>
|
||||
<input id="changepasswordpwd" type="password" name="password" value="" />
|
||||
<input type="submit" id="changepasswordbutton" value="<?php echo $l->t( 'Set' ); ?>" />
|
||||
</form>
|
||||
</span>
|
||||
|
||||
<div id="removeuserform" title="Remove user">
|
||||
<form id="removeuserdata">
|
||||
<?php echo $l->t( 'Do you really want to delete user' ); ?> <span id="deleteuserusername">$user</span>?
|
||||
<input id="deleteusernamefield" type="hidden" name="username" value="">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="removegroupform" title="Remove Group">
|
||||
<form id="removegroupdata">
|
||||
<?php echo $l->t( 'Do you really want to delete group' ); ?> <span id="removegroupgroupname">$group</span>?
|
||||
<input id="removegroupnamefield" type="hidden" name="groupname" value="">
|
||||
<form id="newuser">
|
||||
<input id="newusername" placeholder="username"></input>
|
||||
<input type="password" id="newuserpassword" placeholder="password"></input>
|
||||
<select id="newusergroups" data-placeholder="groups" title="groups" multiple="multiple">
|
||||
<?php foreach($_["groups"] as $group): ?>
|
||||
<option value="<?php echo $group['name'];?>"><?php echo $group['name'];?></option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
<input type="submit" value="Create"></input>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="errordialog" title="Error">
|
||||
<span id="errormessage"></span>
|
||||
<ul id="leftcontent">
|
||||
<?php foreach($_["groups"] as $group): ?>
|
||||
<li data-gid="<?php echo $group["name"]; ?>">
|
||||
<?php echo $group["name"] ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<div id="rightcontent">
|
||||
<table>
|
||||
<?php foreach($_["users"] as $user): ?>
|
||||
<tr data-uid="<?php echo $user["name"] ?>">
|
||||
<td class="select"><input type="checkbox"></input></td>
|
||||
<td class="name"><?php echo $user["name"]; ?></td>
|
||||
<td class="groups"><?php if( $user["groups"] ){ echo $user["groups"]; }else{echo " ";} ?></td>
|
||||
<td class="remove">
|
||||
<?php if($user['name']!=OC_User::getUser()):?>
|
||||
<img alt="Remove" title="Remove" class='svg' src='<?php echo image_path('core','actions/delete.svg') ?>'/>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - Addressbook
|
||||
*
|
||||
* @author Jakob Sack
|
||||
* @copyright 2011 Jakob Sack mail@jakobsack.de
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Init owncloud
|
||||
require_once('../../../lib/base.php');
|
||||
|
||||
$aid = $_POST['id'];
|
||||
$l10n = new OC_L10N('contacts');
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$addressbook = OC_Contacts_Addressbook::findAddressbook( $aid );
|
||||
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your addressbook!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$fn = $_POST['fn'];
|
||||
|
||||
$vcard = new Sabre_VObject_Component('VCARD');
|
||||
$vcard->add(new Sabre_VObject_Property('FN',$fn));
|
||||
$vcard->add(new Sabre_VObject_Property('UID',OC_Contacts_Addressbook::createUID()));
|
||||
$id = OC_Contacts_Addressbook::addCard($aid,$vcard->serialize());
|
||||
|
||||
$details = OC_Contacts_Addressbook::structureContact($vcard);
|
||||
$tmpl = new OC_Template('contacts','part.details');
|
||||
$tmpl->assign('details',$details);
|
||||
$tmpl->assign('id',$id);
|
||||
$page = $tmpl->fetchPage();
|
||||
|
||||
echo json_encode( array( 'status' => 'success', 'data' => array( 'id' => $id, 'page' => $page )));
|
||||
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - Addressbook
|
||||
*
|
||||
* @author Jakob Sack
|
||||
* @copyright 2011 Jakob Sack mail@jakobsack.de
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Init owncloud
|
||||
require_once('../../../lib/base.php');
|
||||
|
||||
$id = $_POST['id'];
|
||||
$l10n = new OC_L10N('contacts');
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$card = OC_Contacts_Addressbook::findCard( $id );
|
||||
if( $card === false ){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Can not find Contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$addressbook = OC_Contacts_Addressbook::findAddressbook( $card['addressbookid'] );
|
||||
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$vcard = Sabre_VObject_Reader::read($card['carddata']);
|
||||
$mimetype = $_FILES['photo']['type'] ? $_FILES['photo']['type'] : 'image/jpeg';
|
||||
$photobase = base64_encode(file_get_contents($_FILES['photo']['tmp_name']));
|
||||
$photo = new Sabre_VObject_Property( 'PHOTO', $photobase );
|
||||
$photo->parameters[] = new Sabre_VObject_Parameter('TYPE',$mimetype);
|
||||
$photo->parameters[] = new Sabre_VObject_Parameter('ENCODING','b');
|
||||
$vcard->add($photo);
|
||||
|
||||
$line = count($vcard->children) - 1;
|
||||
$checksum = md5($vcard->children[$line]->serialize());
|
||||
|
||||
OC_Contacts_Addressbook::editCard($id,$vcard->serialize());
|
||||
echo json_encode( array( 'status' => 'success', 'data' => array( 'id' => $id, 'line' => $line, 'checksum' => $checksum )));
|
||||
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - Addressbook
|
||||
*
|
||||
* @author Jakob Sack
|
||||
* @copyright 2011 Jakob Sack mail@jakobsack.de
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Init owncloud
|
||||
require_once('../../../lib/base.php');
|
||||
|
||||
$id = $_POST['id'];
|
||||
$l10n = new OC_L10N('contacts');
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$card = OC_Contacts_Addressbook::findCard( $id );
|
||||
if( $card === false ){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Can not find Contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$addressbook = OC_Contacts_Addressbook::findAddressbook( $card['addressbookid'] );
|
||||
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$vcard = Sabre_VObject_Reader::read($card['carddata']);
|
||||
|
||||
$name = $_POST['name'];
|
||||
$value = $_POST['value'];
|
||||
$parameters = isset($_POST['parameteres'])?$_POST['parameters']:array();
|
||||
|
||||
if(is_array($value)){
|
||||
$value = OC_Contacts_Addressbook::escapeSemicolons($value);
|
||||
}
|
||||
$property = new Sabre_VObject_Property( $name, $value );
|
||||
$parameternames = array_keys($parameters);
|
||||
foreach($parameternames as $i){
|
||||
$property->parameters[] = new Sabre_VObject_Parameter($i,$parameters[$i]);
|
||||
}
|
||||
|
||||
$vcard->add($property);
|
||||
|
||||
$line = count($vcard->children) - 1;
|
||||
$checksum = md5($property->serialize());
|
||||
|
||||
OC_Contacts_Addressbook::editCard($id,$vcard->serialize());
|
||||
|
||||
$tmpl = new OC_Template('contacts','part.property');
|
||||
$tmpl->assign('property',OC_Contacts_Addressbook::structureProperty($property,$line));
|
||||
$page = $tmpl->fetchPage();
|
||||
|
||||
echo json_encode( array( 'status' => 'success', 'data' => array( 'page' => $page )));
|
||||
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - Addressbook
|
||||
*
|
||||
* @author Jakob Sack
|
||||
* @copyright 2011 Jakob Sack mail@jakobsack.de
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Init owncloud
|
||||
require_once('../../../lib/base.php');
|
||||
|
||||
$id = $_GET['id'];
|
||||
|
||||
$l10n = new OC_L10N('contacts');
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
$addressbook = OC_Contacts_Addressbook::findAddressbook( $id );
|
||||
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
OC_Contacts_Addressbook::deleteAddressbook($id);
|
||||
echo json_encode( array( 'status' => 'success', 'data' => array( 'id' => $id )));
|
||||
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - Addressbook
|
||||
*
|
||||
* @author Jakob Sack
|
||||
* @copyright 2011 Jakob Sack mail@jakobsack.de
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Init owncloud
|
||||
require_once('../../../lib/base.php');
|
||||
|
||||
$id = $_GET['id'];
|
||||
|
||||
$l10n = new OC_L10N('contacts');
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
$card = OC_Contacts_Addressbook::findCard( $id );
|
||||
if( $card === false ){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Can not find Contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$addressbook = OC_Contacts_Addressbook::findAddressbook( $card['addressbookid'] );
|
||||
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
OC_Contacts_Addressbook::deleteCard($id);
|
||||
echo json_encode( array( 'status' => 'success', 'data' => array( 'id' => $id )));
|
||||
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - Addressbook
|
||||
*
|
||||
* @author Jakob Sack
|
||||
* @copyright 2011 Jakob Sack mail@jakobsack.de
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Init owncloud
|
||||
require_once('../../../lib/base.php');
|
||||
|
||||
$id = $_GET['id'];
|
||||
$line = $_GET['line'];
|
||||
$checksum = $_GET['checksum'];
|
||||
|
||||
|
||||
$l10n = new OC_L10N('contacts');
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
$card = OC_Contacts_Addressbook::findCard( $id );
|
||||
if( $card === false ){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Can not find Contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$addressbook = OC_Contacts_Addressbook::findAddressbook( $card['addressbookid'] );
|
||||
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$vcard = Sabre_VObject_Reader::read($card['carddata']);
|
||||
|
||||
if(md5($vcard->children[$line]->serialize()) != $checksum ){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Information about vCard is incorrect. Please reload page!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
unset($vcard->children[$line]);
|
||||
|
||||
OC_Contacts_Addressbook::editCard($id,$vcard->serialize());
|
||||
echo json_encode( array( 'status' => 'success', 'data' => array( 'id' => $id )));
|
||||
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - Addressbook
|
||||
*
|
||||
* @author Jakob Sack
|
||||
* @copyright 2011 Jakob Sack mail@jakobsack.de
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Init owncloud
|
||||
require_once('../../../lib/base.php');
|
||||
|
||||
$id = $_POST['id'];
|
||||
$line = $_POST['line'];
|
||||
$checksum = $_POST['checksum'];
|
||||
$l10n = new OC_L10N('contacts');
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$card = OC_Contacts_Addressbook::findCard( $id );
|
||||
if( $card === false ){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Can not find Contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$addressbook = OC_Contacts_Addressbook::findAddressbook( $card['addressbookid'] );
|
||||
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$vcard = Sabre_VObject_Reader::read($card['carddata']);
|
||||
$mimetype = $_FILES['photo']['type'] ? $_FILES['photo']['type'] : 'image/jpeg';
|
||||
$photobase = base64_encode(file_get_contents($_FILES['photo']['tmp_name']));
|
||||
|
||||
if(md5($vcard->children[$line]->serialize()) != $checksum){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Information about vCard is incorrect. Please reload page!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
// replace photo
|
||||
$vcard->children[$line]->setValue($photobase);
|
||||
$encoding = $type = false;
|
||||
foreach($vcard->children[$line]->parameters as &$parameter){
|
||||
if($parameter->name == 'TYPE'){
|
||||
$parameter->value = $mimetype;
|
||||
$type = true;
|
||||
}
|
||||
elseif($parameter->name == 'ENCODING'){
|
||||
$parameter->value = 'b';
|
||||
$encoding = true;
|
||||
}
|
||||
} unset($parameter);
|
||||
if(!$encoding) $vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter('ENCODING','b');
|
||||
if(!$type) $vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter('TYPE',$mimetype);
|
||||
|
||||
$checksum = md5($vcard->children[$line]->serialize());
|
||||
|
||||
OC_Contacts_Addressbook::editCard($id,$vcard->serialize());
|
||||
echo json_encode( array( 'status' => 'success', 'data' => array( 'id' => $id, 'line' => $line, 'checksum' => $checksum )));
|
||||
@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - Addressbook
|
||||
*
|
||||
* @author Jakob Sack
|
||||
* @copyright 2011 Jakob Sack mail@jakobsack.de
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Init owncloud
|
||||
require_once('../../../lib/base.php');
|
||||
|
||||
$id = $_POST['id'];
|
||||
$line = $_POST['line'];
|
||||
$checksum = $_POST['checksum'];
|
||||
$l10n = new OC_L10N('contacts');
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$card = OC_Contacts_Addressbook::findCard( $id );
|
||||
if( $card === false ){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Can not find Contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$addressbook = OC_Contacts_Addressbook::findAddressbook( $card['addressbookid'] );
|
||||
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$vcard = Sabre_VObject_Reader::read($card['carddata']);
|
||||
|
||||
if(md5($vcard->children[$line]->serialize()) != $checksum){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Information about vCard is incorrect. Please reload page!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
// Set the value
|
||||
$value = $_POST['value'];
|
||||
if(is_array($value)){
|
||||
$value = OC_Contacts_Addressbook::escapeSemicolons($value);
|
||||
}
|
||||
$vcard->children[$line]->setValue($value);
|
||||
|
||||
// Add parameters
|
||||
$postparameters = isset($_POST['parameters'])?$_POST['parameters']:array();
|
||||
for($i=0;$i<count($vcard->children[$line]->parameters);$i++){
|
||||
$name = $vcard->children[$line]->parameters[$i]->name;
|
||||
if(array_key_exists($name,$postparameters)){
|
||||
if($postparameters[$name] == '' || is_null($postparameters[$name])){
|
||||
unset($vcard->children[$line]->parameters[$i]);
|
||||
}
|
||||
else{
|
||||
$vcard->children[$line]->parameters[$i]->value = $postparameters[$name];
|
||||
}
|
||||
unset($postparameters[$name]);
|
||||
}
|
||||
}
|
||||
$missingparameters = array_keys($postparameters);
|
||||
foreach($missingparameters as $i){
|
||||
if(!$postparameters[$i] == '' && !is_null($postparameters[$i])){
|
||||
$vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter($i,$postparameters[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Do checksum and be happy
|
||||
$checksum = md5($vcard->children[$line]->serialize());
|
||||
|
||||
OC_Contacts_Addressbook::editCard($id,$vcard->serialize());
|
||||
|
||||
$tmpl = new OC_Template('contacts','part.property');
|
||||
$tmpl->assign('property',OC_Contacts_Addressbook::structureProperty($vcard->children[$line],$line));
|
||||
$page = $tmpl->fetchPage();
|
||||
|
||||
echo json_encode( array( 'status' => 'success', 'data' => array( 'page' => $page, 'line' => $line, 'oldchecksum' => $_POST['checksum'] )));
|
||||
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - Addressbook
|
||||
*
|
||||
* @author Jakob Sack
|
||||
* @copyright 2011 Jakob Sack mail@jakobsack.de
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Init owncloud
|
||||
require_once('../../../lib/base.php');
|
||||
|
||||
$l10n = new OC_L10N('contacts');
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$addressbooks = OC_Contacts_Addressbook::allAddressbooks(OC_USER::getUser());
|
||||
$tmpl = new OC_Template('contacts','part.addcardform');
|
||||
$tmpl->assign('addressbooks',$addressbooks);
|
||||
$page = $tmpl->fetchPage();
|
||||
|
||||
echo json_encode( array( 'status' => 'success', 'data' => array( 'page' => $page )));
|
||||
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - Addressbook
|
||||
*
|
||||
* @author Jakob Sack
|
||||
* @copyright 2011 Jakob Sack mail@jakobsack.de
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Init owncloud
|
||||
require_once('../../../lib/base.php');
|
||||
|
||||
$id = $_GET['id'];
|
||||
$l10n = new OC_L10N('contacts');
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$card = OC_Contacts_Addressbook::findCard( $id );
|
||||
if( $card === false ){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Can not find Contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$addressbook = OC_Contacts_Addressbook::findAddressbook( $card['addressbookid'] );
|
||||
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$tmpl = new OC_Template('contacts','part.addpropertyform');
|
||||
$tmpl->assign('id',$id);
|
||||
$page = $tmpl->fetchPage();
|
||||
|
||||
echo json_encode( array( 'status' => 'success', 'data' => array( 'page' => $page )));
|
||||
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - Addressbook
|
||||
*
|
||||
* @author Jakob Sack
|
||||
* @copyright 2011 Jakob Sack mail@jakobsack.de
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Init owncloud
|
||||
require_once('../../../lib/base.php');
|
||||
|
||||
$id = $_GET['id'];
|
||||
$line = $_GET['line'];
|
||||
$checksum = $_GET['checksum'];
|
||||
$l10n = new OC_L10N('contacts');
|
||||
|
||||
// Check if we are a user
|
||||
if( !OC_User::isLoggedIn()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$card = OC_Contacts_Addressbook::findCard( $id );
|
||||
if( $card === false ){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Can not find Contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$addressbook = OC_Contacts_Addressbook::findAddressbook( $card['addressbookid'] );
|
||||
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('This is not your contact!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
$vcard = Sabre_VObject_Reader::read($card['carddata']);
|
||||
if(md5($vcard->children[$line]->serialize()) != $checksum){
|
||||
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('Information about vCard is incorrect. Please reload page!'))));
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
$tmpl = new OC_Template('contacts','part.setpropertyform');
|
||||
$tmpl->assign('id',$id);
|
||||
$tmpl->assign('checksum',$checksum);
|
||||
$tmpl->assign('property',OC_Contacts_Addressbook::structureProperty($vcard->children[$line],$line));
|
||||
$page = $tmpl->fetchPage();
|
||||
|
||||
echo json_encode( array( 'status' => 'success', 'data' => array( 'page' => $page )));
|
||||
@ -1 +1 @@
|
||||
|
||||
.contacts_propertyname {float:left;}
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
Name <?php echo $_['details']['FN'][0]['value']; ?>
|
||||
<?php if(array_key_exists('PHOTO',$_['details'])): ?>
|
||||
<img src="photo.php?id=<?php echo $_['id']; ?>">
|
||||
<?php endif; ?>
|
||||
@ -0,0 +1,13 @@
|
||||
<form id="contacts_addcardform">
|
||||
<?php if(count($_['addressbooks'])==1): ?>
|
||||
<input type="hidden" name="id" value="<?php echo $_['addressbooks'][0]['id']; ?>">
|
||||
<?php else: ?>
|
||||
<select name="id" size="1">
|
||||
<?php foreach($_['addressbooks'] as $addressbook): ?>
|
||||
<option value="<?php echo $addressbook['id']; ?>"><?php echo $addressbook['displayname']; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php endif; ?>
|
||||
<input type="text" name="fn" value=""><br>
|
||||
<input type="submit">
|
||||
</form>
|
||||
@ -0,0 +1,43 @@
|
||||
<form id="contacts_addpropertyform">
|
||||
<input type="hidden" name="id" value="<?php echo $_['id']; ?>">
|
||||
<select name="name" size="1">
|
||||
<option value="BDAY"><?php echo $l->t('Birthday'); ?></option>
|
||||
<option value="ADR"><?php echo $l->t('Address'); ?></option>
|
||||
<option value="TEL"><?php echo $l->t('Telephone'); ?></option>
|
||||
<option value="EMAIL" selected="selected"><?php echo $l->t('Email'); ?></option>
|
||||
<option value="ORG"><?php echo $l->t('Organization'); ?></option>
|
||||
</select>
|
||||
<div id="contacts_generic">
|
||||
<input type="text" name="value" value="">
|
||||
</div>
|
||||
<input type="submit">
|
||||
</form>
|
||||
<div id="contacts_addcontactsparts" style="display:none;">
|
||||
<div id="contacts_addresspart">
|
||||
<select name="parameters[TYPE]" size="1">
|
||||
<option value="WORK"><?php echo $l->t('Work'); ?></option>
|
||||
<option value="HOME" selected="selected"><?php echo $l->t('Home'); ?></option>
|
||||
</select>
|
||||
<?php echo $l->t('PO Box'); ?> <input type="text" name="value[0]" value="">
|
||||
<?php echo $l->t('Extended Address'); ?> <input type="text" name="value[1]" value="">
|
||||
<?php echo $l->t('Street Name'); ?> <input type="text" name="value[2]" value="">
|
||||
<?php echo $l->t('City'); ?> <input type="text" name="value[3]" value="">
|
||||
<?php echo $l->t('Region'); ?> <input type="text" name="value[4]" value="">
|
||||
<?php echo $l->t('Postal Code'); ?> <input type="text" name="value[5]" value="">
|
||||
<?php echo $l->t('Country'); ?> <input type="text" name="value[6]" value="">
|
||||
</div>
|
||||
<div id="contacts_phonepart">
|
||||
<select name="parameters[TYPE]" size="1">
|
||||
<option value="WORK"><?php echo $l->t('Work'); ?></option>
|
||||
<option value="CELL" selected="selected"><?php echo $l->t('Mobile'); ?></option>
|
||||
<option value="HOME"><?php echo $l->t('Home'); ?></option>
|
||||
</select>
|
||||
<input type="text" name="value" value="">
|
||||
</div>
|
||||
<div id="contacts_fieldpart">
|
||||
<textarea type="text" name="value"></textarea>
|
||||
</div>
|
||||
<div id="contacts_generic">
|
||||
<input type="text" name="value" value="">
|
||||
</div>
|
||||
</div>
|
||||
@ -1,3 +1,3 @@
|
||||
<?php foreach( $_['contacts'] as $contact ): ?>
|
||||
<li x-id="<?php echo $contact['id']; ?>"><a href="index.php?id=<?php echo $contact['id']; ?>"><?php echo $contact['name']; ?></a></li>
|
||||
<li x-id="<?php echo $contact['id']; ?>"><a href="index.php?id=<?php echo $contact['id']; ?>"><?php echo $contact['name']; ?></a> </li>
|
||||
<?php endforeach; ?>
|
||||
@ -0,0 +1,22 @@
|
||||
<?php if(array_key_exists('PHOTO',$_['details'])): ?>
|
||||
<img src="photo.php?id=<?php echo $_['id']; ?>">
|
||||
<?php endif; ?>
|
||||
<?php echo $this->inc('part.property', array('property' => $_['details']['FN'][0])); ?>
|
||||
<?php if(isset($_['details']['BDAY'])): // Emails first ?>
|
||||
<?php echo $this->inc('part.property', array('property' => $_['details']['BDAY'][0])); ?>
|
||||
<?php endif; ?>
|
||||
<?php if(isset($_['details']['ORG'])): // Emails first ?>
|
||||
<?php echo $this->inc('part.property', array('property' => $_['details']['ORG'][0])); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach(array('EMAIL','TEL','ADR') as $type): ?>
|
||||
<?php if(isset($_['details'][$type])): // Emails first ?>
|
||||
<br>
|
||||
<?php foreach($_['details'][$type] as $property): ?>
|
||||
<?php echo $this->inc('part.property',array('property' => $property )); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<a id="contacts_deletecard"><img src="../../core/img/actions/delete.png"></a>
|
||||
<a id="contacts_addproperty"><img src="../../core/img/actions/download.png"></a>
|
||||
@ -0,0 +1,50 @@
|
||||
<div class="contacts_property" x-line="<?php echo $_['property']['line']; ?>" x-checksum="<?php echo $_['property']['checksum']; ?>">
|
||||
<?php if($_['property']['name'] == 'FN'): ?>
|
||||
<div class="contacts_propertyname"><?php echo $l->t('Name'); ?></div>
|
||||
<div class="contacts_propertyvalue">
|
||||
<span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span>
|
||||
<?php echo $_['property']['value']; ?>
|
||||
</div>
|
||||
<?php elseif($_['property']['name'] == 'BDAY'): ?>
|
||||
<div class="contacts_propertyname"><?php echo $l->t('Birthday'); ?></div>
|
||||
<div class="contacts_propertyvalue">
|
||||
<?php echo $l->l('date',new DateTime($_['property']['value'])); ?>
|
||||
<span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span>
|
||||
<span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span>
|
||||
</div>
|
||||
<?php elseif($_['property']['name'] == 'ORG'): ?>
|
||||
<div class="contacts_propertyname"><?php echo $l->t('Organisation'); ?></div>
|
||||
<div class="contacts_propertyvalue">
|
||||
<?php echo $_['property']['value']; ?>
|
||||
<span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span>
|
||||
<span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span>
|
||||
</div>
|
||||
<?php elseif($_['property']['name'] == 'EMAIL'): ?>
|
||||
<div class="contacts_propertyname"><?php echo $l->t('Email'); ?></div>
|
||||
<div class="contacts_propertyvalue">
|
||||
<?php echo $_['property']['value']; ?>
|
||||
<span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span>
|
||||
<span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span>
|
||||
</div>
|
||||
<?php elseif($_['property']['name'] == 'TEL'): ?>
|
||||
<div class="contacts_propertyname"><?php echo $l->t('Telefon'); ?></div>
|
||||
<div class="contacts_propertyvalue">
|
||||
<?php echo $_['property']['value']; ?>
|
||||
<span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span>
|
||||
<span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span>
|
||||
</div>
|
||||
<?php elseif($_['property']['name'] == 'ADR'): ?>
|
||||
<div class="contacts_propertyname"><?php echo $l->t('Address'); ?></div>
|
||||
<div class="contacts_propertyvalue">
|
||||
<?php echo $l->t('PO Box'); ?> <?php echo $_['property']['value'][0]; ?><br>
|
||||
<?php echo $l->t('Extended Address'); ?> <?php echo $_['property']['value'][1]; ?><br>
|
||||
<?php echo $l->t('Street Name'); ?> <?php echo $_['property']['value'][2]; ?><br>
|
||||
<?php echo $l->t('City'); ?> <?php echo $_['property']['value'][3]; ?><br>
|
||||
<?php echo $l->t('Region'); ?> <?php echo $_['property']['value'][4]; ?><br>
|
||||
<?php echo $l->t('Postal Code'); ?> <?php echo $_['property']['value'][5]; ?><br>
|
||||
<?php echo $l->t('Country'); ?> <?php echo $_['property']['value'][6]; ?>
|
||||
<span style="display:none;" x-use="edit"><img src="../../core/img/actions/rename.png"></span>
|
||||
<span style="display:none;" x-use="delete"><img src="../../core/img/actions/delete.png"></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@ -0,0 +1,21 @@
|
||||
<form id="contacts_setpropertyform">
|
||||
<input type="hidden" name="checksum" value="<?php echo $_['property']['checksum']; ?>">
|
||||
<input type="hidden" name="line" value="<?php echo $_['property']['line']; ?>">
|
||||
<input type="hidden" name="id" value="<?php echo $_['id']; ?>">
|
||||
<?php if($_['property']['name']=='ADR'): ?>
|
||||
<?php echo $l->t('PO Box'); ?> <input type="text" name="value[0]" value="<?php echo $_['property']['value'][0]; ?>">
|
||||
<?php echo $l->t('Extended Address'); ?> <input type="text" name="value[1]" value="<?php echo $_['property']['value'][1]; ?>">
|
||||
<?php echo $l->t('Street Name'); ?> <input type="text" name="value[2]" value="<?php echo $_['property']['value'][2]; ?>">
|
||||
<?php echo $l->t('City'); ?> <input type="text" name="value[3]" value="<?php echo $_['property']['value'][3]; ?>">
|
||||
<?php echo $l->t('Region'); ?> <input type="text" name="value[4]" value="<?php echo $_['property']['value'][4]; ?>">
|
||||
<?php echo $l->t('Postal Code'); ?> <input type="text" name="value[5]" value="<?php echo $_['property']['value'][5]; ?>">
|
||||
<?php echo $l->t('Country'); ?> <input type="text" name="value[6]" value="<?php echo $_['property']['value'][6]; ?>">
|
||||
<?php elseif($_['property']['name']=='TEL'): ?>
|
||||
<input type="text" name="value" value="<?php echo $_['property']['value']; ?>">
|
||||
<?php elseif($_['property']['name']=='NOTE'): ?>
|
||||
<textarea type="text" name="value"><?php echo $_['property']['value']; ?></textarea>
|
||||
<?php else: ?>
|
||||
<input type="text" name="value" value="<?php echo $_['property']['value']; ?>">
|
||||
<?php endif; ?>
|
||||
<input type="submit">
|
||||
</form>
|
||||
@ -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"));
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@ -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;}
|
||||
|
||||
@ -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,17 +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>
|
||||
<ul id='collection'>
|
||||
<li class='artist'>
|
||||
<img src="<?php echo image_path('files','loading.gif') ?>" alt='loading'/>Loading Collection...
|
||||
</li>
|
||||
<li class='template'>
|
||||
<span></span>
|
||||
<button class='add'>Add</button>
|
||||
<button class='play'>Play</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@ -1,3 +1,71 @@
|
||||
<?php echo $_['player'];?>
|
||||
<?php echo $_['collection'];?>
|
||||
<?php echo $_['playlist'];?>
|
||||
<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,22 +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-stop" tabindex="1">stop</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,30 +0,0 @@
|
||||
<table id='playlist'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='name'><input id='selectAll' type='checkbox'>Name</th>
|
||||
<th class='artist'>Artist</th>
|
||||
<th class='album'>Album</th>
|
||||
<th class='time'>Time</th>
|
||||
<th class='plays'>Plays</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>
|
||||
<td class='album'></td>
|
||||
<td class='time'></td>
|
||||
<td class='plays'></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>
|
||||
@ -0,0 +1,12 @@
|
||||
$(document).ready(function(){
|
||||
$('#openidform input').blur(function(event){
|
||||
event.preventDefault();
|
||||
var post = $( "#openidform" ).serialize();
|
||||
$.post( 'ajax/openid.php', post, function(data){
|
||||
if( data.status == "success" ){
|
||||
}else{
|
||||
alert('error while setting OpenID');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
$tmpl = new OC_Template( 'user_openid', 'settings');
|
||||
$identity=OC_Preferences::getValue(OC_User::getUser(),'user_openid','identity','');
|
||||
$tmpl->assign('identity',$identity);
|
||||
|
||||
OC_Util::addScript('user_openid','settings');
|
||||
|
||||
return $tmpl->fetchPage();
|
||||
?>
|
||||
@ -0,0 +1,6 @@
|
||||
<form id="openidform">
|
||||
<fieldset>
|
||||
<legend><?php echo $l->t( 'OpenID' );?></legend>
|
||||
<input type="text" name='identity' id='identity' value="<?php echo $_['identity']; ?>" placeholder="OpenID for <?php echo OC_User::getUser();?>" />
|
||||
</fieldset>
|
||||
</form>
|
||||
|
Before Width: | Height: | Size: 396 B |
@ -1,121 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.0"
|
||||
width="22"
|
||||
height="22"
|
||||
id="svg2423"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.48.1 r9760"
|
||||
sodipodi:docname="steadyflow-panel.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
||||
inkscape:export-filename="/home/jancborchardt/SparkleShare/playground/ownCloud/elementaryicons/elementary-icon-theme/elementary-mono-dark/panel/22/steadyflow-panel.png"
|
||||
inkscape:export-xdpi="205.86"
|
||||
inkscape:export-ydpi="205.86">
|
||||
<metadata
|
||||
id="metadata12">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<sodipodi:namedview
|
||||
inkscape:window-height="776"
|
||||
inkscape:window-width="1280"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
guidetolerance="10.0"
|
||||
gridtolerance="10.0"
|
||||
objecttolerance="10.0"
|
||||
borderopacity="1.0"
|
||||
bordercolor="#666666"
|
||||
pagecolor="#ffffff"
|
||||
id="base"
|
||||
showgrid="false"
|
||||
inkscape:zoom="18.409653"
|
||||
inkscape:cx="3.1144877"
|
||||
inkscape:cy="10.453039"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="24"
|
||||
inkscape:current-layer="svg2423"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:window-maximized="1">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid2989"
|
||||
empspacing="5"
|
||||
visible="true"
|
||||
enabled="true"
|
||||
snapvisiblegridlinesonly="true" />
|
||||
</sodipodi:namedview>
|
||||
<defs
|
||||
id="defs2425">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3678"
|
||||
id="linearGradient3805"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0,0.51263812,0.51263812,0,0.912685,4.921543)"
|
||||
x1="0.98925388"
|
||||
y1="20.108774"
|
||||
x2="26.631666"
|
||||
y2="20.093433" />
|
||||
<linearGradient
|
||||
id="linearGradient3678">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3680" />
|
||||
<stop
|
||||
style="stop-color:#e6e6e6;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3682" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientTransform="matrix(-0.4100229,0,0,0.5447147,78.029995,-3.8459034)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
xlink:href="#linearGradient3678"
|
||||
id="linearGradient2388-7"
|
||||
y2="38.279892"
|
||||
x2="159.68553"
|
||||
y1="14.403693"
|
||||
x1="159.68553" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3678"
|
||||
id="linearGradient3793"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-0.4100229,0,0,0.5447147,47.235507,-11.911988)"
|
||||
x1="159.68553"
|
||||
y1="14.403693"
|
||||
x2="159.68553"
|
||||
y2="38.279892" />
|
||||
</defs>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 11.5,19.5 -8,-7 8,-7 0,4 7,0 0,6 -7,0 z"
|
||||
id="path4348-1-1"
|
||||
style="opacity:0.5;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||
sodipodi:nodetypes="cccccccc" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 11.5,18.5 -8,-7 8,-7 0,4 7,0 0,6 -7,0 z"
|
||||
id="path4348-1"
|
||||
style="fill:url(#linearGradient3805);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||
sodipodi:nodetypes="cccccccc" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 695 B After Width: | Height: | Size: 883 B |
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 11 KiB |
@ -1,12 +1,8 @@
|
||||
<div id="login">
|
||||
<header><img src="<?php echo image_path('', 'owncloud-logo-medium-white.png'); ?>" alt="ownCloud" /></header>
|
||||
<ul>
|
||||
<?php foreach($_["errors"] as $error):?>
|
||||
<li class='error'>
|
||||
<?php echo $error['error'] ?><br/>
|
||||
<p class='hint'><?php if(isset($error['hint']))echo $error['hint'] ?></p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<?php foreach($_["errors"] as $error):?>
|
||||
<li class='error'>
|
||||
<?php echo $error['error'] ?><br/>
|
||||
<p class='hint'><?php if(isset($error['hint']))echo $error['hint'] ?></p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
||||
@ -1,85 +1,78 @@
|
||||
<div id="login">
|
||||
<header><img src="<?php echo image_path('', 'owncloud-logo-medium-white.png'); ?>" alt="ownCloud" /></header>
|
||||
<form action="index.php" method="post">
|
||||
|
||||
<input type="hidden" name="install" value="true" />
|
||||
<?php if(count($_['errors']) > 0): ?>
|
||||
<ul class="errors">
|
||||
<?php foreach($_['errors'] as $err): ?>
|
||||
<li>
|
||||
<?php if(is_array($err)):?>
|
||||
<?php print $err['error']; ?>
|
||||
<p class='hint'><?php print $err['hint']; ?></p>
|
||||
<?php else: ?>
|
||||
<?php print $err; ?>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<form action="index.php" method="post">
|
||||
|
||||
<fieldset>
|
||||
<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>
|
||||
|
||||
<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 id='databaseField'>
|
||||
<legend><?php echo $l->t( 'Configure the database' ); ?></legend>
|
||||
<?php if($_['hasSQLite']): ?>
|
||||
<input type='hidden' id='hasSQLite' value='true'/>
|
||||
<?php if(!$_['hasMySQL'] and !$_['hasPostgreSQL']): ?>
|
||||
<p><?php echo $l->t( 'SQLite will be used.' ); ?></p>
|
||||
<input type="hidden" id="dbtype" name="dbtype" value="sqlite" />
|
||||
<input type="hidden" name="install" value="true" />
|
||||
<?php if(count($_['errors']) > 0): ?>
|
||||
<ul class="errors">
|
||||
<?php foreach($_['errors'] as $err): ?>
|
||||
<li>
|
||||
<?php if(is_array($err)):?>
|
||||
<?php print $err['error']; ?>
|
||||
<p class='hint'><?php print $err['hint']; ?></p>
|
||||
<?php else: ?>
|
||||
<p><label class="sqlite" for="sqlite"><?php echo $l->t( 'SQLite' ); ?></label><input type="radio" name="dbtype" value='sqlite' id="sqlite" <?php OC_Helper::init_radio('dbtype', 'sqlite', 'sqlite'); ?>/></p>
|
||||
<?php endif; ?>
|
||||
<?php print $err; ?>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($_['hasMySQL']): ?>
|
||||
<input type='hidden' id='hasMySQL' value='true'/>
|
||||
<?php if(!$_['hasSQLite'] and !$_['hasPostgreSQL']): ?>
|
||||
<p><?php echo $l->t( 'MySQL will be used.' ); ?></p>
|
||||
<input type="hidden" id="dbtype" name="dbtype" value="mysql" />
|
||||
<?php else: ?>
|
||||
<label class="mysql" for="mysql">MySQL</label><input type="radio" name="dbtype" value='mysql' id="mysql" <?php OC_Helper::init_radio('dbtype','pgsql', 'mysql', 'sqlite'); ?>/>
|
||||
<?php endif; ?>
|
||||
<div id="use_mysql">
|
||||
<input type="text" name="dbuser" id="dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" placeholder="<?php echo $l->t( 'Database user' ); ?>" />
|
||||
<input type="password" name="dbpass" id="dbpass" value="<?php print OC_Helper::init_var('dbpass'); ?>" placeholder="<?php echo $l->t( 'Database password' ); ?>" />
|
||||
<input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" placeholder="<?php echo $l->t( 'Database name' ); ?>" />
|
||||
<input type="text" name="dbhost" id="dbhost" value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" placeholder="<?php echo $l->t( 'Host' ); ?>" />
|
||||
<input type="text" name="dbtableprefix" id="dbtableprefix" value="<?php print OC_Helper::init_var('dbtableprefix', 'oc_'); ?>" placeholder="<?php echo $l->t( 'Table prefix' ); ?>" />
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<fieldset>
|
||||
<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 required /></p>
|
||||
<input type="password" name="adminpass" id="adminpass" value="<?php print OC_Helper::init_var('adminpass'); ?>" placeholder="<?php echo $l->t( 'Password' ); ?>" required /></p>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id='databaseField'>
|
||||
<?php if($_['hasMySQL'] or $_['hasPostgreSQL']) $hasOtherDB = true; //other than SQLite ?>
|
||||
<legend><?php echo $l->t( 'Configure the database' ); ?></legend>
|
||||
<?php if($_['hasSQLite']): ?>
|
||||
<input type='hidden' id='hasSQLite' value='true' />
|
||||
<?php if(!$hasOtherDB): ?>
|
||||
<p><?php echo $l->t( 'SQLite will be used.' ); ?></p>
|
||||
<input type="hidden" id="dbtype" name="dbtype" value="sqlite" />
|
||||
<?php else: ?>
|
||||
<p><label class="sqlite" for="sqlite"><?php echo $l->t( 'SQLite' ); ?></label><input type="radio" name="dbtype" value='sqlite' id="sqlite" <?php OC_Helper::init_radio('dbtype', 'sqlite', 'sqlite'); ?>/></p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($_['hasPostgreSQL']): ?>
|
||||
<input type='hidden' id='hasPostgreSQL' value='true'/>
|
||||
<?php if(!$_['hasSQLite'] and !$_['hasSQLite']): ?>
|
||||
<p><?php echo $l->t( 'PostgreSQL will be used.' ); ?></p>
|
||||
<input type="hidden" id="dbtype" name="dbtype" value="pgsql" />
|
||||
<?php else: ?>
|
||||
<p><label class="pgsql" for="pgsql">PostgreSQL</label><input type="radio" name="dbtype" value='pgsql' id="pgsql" <?php OC_Helper::init_radio('dbtype','pgsql', 'mysql', 'sqlite'); ?>/></p>
|
||||
<?php endif; ?>
|
||||
<div id="use_postgresql">
|
||||
<input type="text" name="pg_dbuser" id="pg_dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" placeholder="<?php echo $l->t( 'Database user' ); ?>" />
|
||||
<input type="password" name="pg_dbpass" id="pg_dbpass" value="<?php print OC_Helper::init_var('dbpass'); ?>" placeholder="<?php echo $l->t( 'PostgreSQL password' ); ?>" />
|
||||
<input type="text" name="pg_dbname" id="pg_dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" placeholder="<?php echo $l->t( 'Database name' ); ?>" />
|
||||
<input type="text" name="pg_dbhost" id="pg_dbhost" value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" placeholder="<?php echo $l->t( 'Host' ); ?>" />
|
||||
<input type="text" name="pg_dbtableprefix" id="pg_dbtableprefix" value="<?php print OC_Helper::init_var('dbtableprefix', 'oc_'); ?>" placeholder="<?php echo $l->t( 'Table prefix' ); ?>" />
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</fieldset>
|
||||
<?php if($_['hasMySQL']): ?>
|
||||
<input type='hidden' id='hasMySQL' value='true'/>
|
||||
<?php if(!$_['hasSQLite'] and !$_['hasPostgreSQL']): ?>
|
||||
<p><?php echo $l->t( 'MySQL will be used.' ); ?></p>
|
||||
<input type="hidden" id="dbtype" name="dbtype" value="mysql" />
|
||||
<?php else: ?>
|
||||
<label class="mysql" for="mysql">MySQL</label><input type="radio" name="dbtype" value='mysql' id="mysql" <?php OC_Helper::init_radio('dbtype','pgsql', 'mysql', 'sqlite'); ?>/>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($_['hasPostgreSQL']): ?>
|
||||
<?php if(!$_['hasSQLite'] and !$_['hasMySQL']): ?>
|
||||
<p><?php echo $l->t( 'PostgreSQL will be used.' ); ?></p>
|
||||
<input type="hidden" id="dbtype" name="dbtype" value="pgsql" />
|
||||
<?php else: ?>
|
||||
<p><label class="pgsql" for="pgsql">PostgreSQL</label><input type="radio" name="dbtype" value='pgsql' id="pgsql" <?php OC_Helper::init_radio('dbtype','pgsql', 'mysql', 'sqlite'); ?>/></p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($hasOtherDB): ?>
|
||||
<div id="use_other_db">
|
||||
<input type="text" name="dbuser" id="dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" placeholder="<?php echo $l->t( 'Database user' ); ?>" required />
|
||||
<input type="password" name="dbpass" id="dbpass" value="<?php print OC_Helper::init_var('dbpass'); ?>" placeholder="<?php echo $l->t( 'Database password' ); ?>" />
|
||||
<input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" placeholder="<?php echo $l->t( 'Database name' ); ?>" required />
|
||||
<input type="text" name="dbhost" id="dbhost" value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" placeholder="<?php echo $l->t( 'Host' ); ?>" required />
|
||||
<input type="text" name="dbtableprefix" id="dbtableprefix" value="<?php print OC_Helper::init_var('dbtableprefix', 'oc_'); ?>" placeholder="<?php echo $l->t( 'Table prefix' ); ?>" />
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</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' ); ?>" required /></p>
|
||||
</fieldset>
|
||||
|
||||
<input type="submit" value="<?php echo $l->t( 'Finish setup' ); ?>" />
|
||||
</form>
|
||||
</div>
|
||||
<input type="submit" value="<?php echo $l->t( 'Finish setup' ); ?>" />
|
||||
</form>
|
||||
|
||||
@ -1,71 +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="main">
|
||||
<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>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,23 +1,17 @@
|
||||
<div id="login">
|
||||
<header>
|
||||
<img src="<?php echo image_path('', 'owncloud-logo-medium-white.png'); ?>" alt="ownCloud" />
|
||||
</header>
|
||||
<form action="index.php" method="post">
|
||||
<fieldset>
|
||||
<?php if($_['error']): ?>
|
||||
<?php echo $l->t( 'Login failed!' ); ?>
|
||||
<?php endif; ?>
|
||||
<?php if(empty($_["username"])){?>
|
||||
<input type="text" name="user" id="user" placeholder="Username" value="" autocomplete="off" required autofocus />
|
||||
<input type="password" name="password" id="password" placeholder="Password" value="" required />
|
||||
<input type="checkbox" name="remember_login" id="remember_login" /><label for="remember_login"><?php echo $l->t('remember'); ?></label>
|
||||
<?php }else{ ?>
|
||||
<input type="text" name="user" id="user" placeholder="Username" value="<?php echo $_['username']; ?>" autocomplete="off" required >
|
||||
<input type="password" name="password" id="password" placeholder="Password" value="" required autofocus />
|
||||
<input type="checkbox" name="remember_login" id="remember_login" checked /><label for="remember_login"><?php echo $l->t('remember'); ?></label>
|
||||
<?php } ?>
|
||||
<input type="submit" id="submit" value="Log in" />
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<form action="index.php" method="post">
|
||||
<fieldset>
|
||||
<?php if($_['error']): ?>
|
||||
<?php echo $l->t( 'Login failed!' ); ?>
|
||||
<?php endif; ?>
|
||||
<?php if(empty($_["username"])){?>
|
||||
<input type="text" name="user" id="user" placeholder="Username" value="" autocomplete="off" required autofocus />
|
||||
<input type="password" name="password" id="password" placeholder="Password" value="" required />
|
||||
<input type="checkbox" name="remember_login" id="remember_login" /><label for="remember_login"><?php echo $l->t('remember'); ?></label>
|
||||
<?php }else{ ?>
|
||||
<input type="text" name="user" id="user" placeholder="Username" value="<?php echo $_['username']; ?>" autocomplete="off" required >
|
||||
<input type="password" name="password" id="password" placeholder="Password" value="" required autofocus />
|
||||
<input type="checkbox" name="remember_login" id="remember_login" checked /><label for="remember_login"><?php echo $l->t('remember'); ?></label>
|
||||
<?php } ?>
|
||||
<input type="submit" id="submit" value="Log in" />
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
@ -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" )));
|
||||
|
||||
?>
|
||||
|
||||
@ -1,2 +1,4 @@
|
||||
#passworderror{display:none;}
|
||||
#passwordchanged{display:none;}
|
||||
#passworderror { display:none; }
|
||||
#passwordchanged { display:none; }
|
||||
|
||||
input#identity { width:20em; }
|
||||
|
||||