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,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Init owncloud
|
// Init owncloud
|
||||||
require_once('../../lib/base.php');
|
require_once('../../lib/base.php');
|
||||||
header( "Content-Type: application/jsonrequest" );
|
header( "Content-Type: application/jsonrequest" );
|
||||||
|
|
|
@ -2,11 +2,4 @@
|
||||||
|
|
||||||
OC_App::register( array( "order" => 1, "id" => "admin", "name" => "Administration" ));
|
OC_App::register( array( "order" => 1, "id" => "admin", "name" => "Administration" ));
|
||||||
|
|
||||||
// OC_App::addAdminPage( array( "id" => "core_system", "order" => 1, "href" => OC_Helper::linkTo( "admin", "system.php" ), "name" =>"System", "icon" => OC_Helper::imagePath( "admin", "administration.png" )));
|
|
||||||
OC_App::addAdminPage( array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "admin", "users.php" ), "name" => "Users", "icon" => OC_Helper::imagePath( "admin", "users.png" )));
|
|
||||||
OC_App::addAdminPage( array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "admin", "apps.php?installed" ), "name" => "Apps", "icon" => OC_Helper::imagePath( "admin", "apps.png" )));
|
|
||||||
|
|
||||||
// Add subentries for App installer
|
|
||||||
//OC_App::addNavigationSubEntry( "core_apps", array( "id" => "core_apps_get", "order" => 4, "href" => OC_Helper::linkTo( "admin", "apps.php" ), "name" => "Get new apps", "icon" => OC_Helper::imagePath( "admin", "navicon.png" )));
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -53,7 +53,7 @@ if($installed){
|
||||||
$records[]=$record;
|
$records[]=$record;
|
||||||
}
|
}
|
||||||
|
|
||||||
$tmpl = new OC_Template( "admin", "appsinst", "admin" );
|
$tmpl = new OC_Template( "admin", "appsinst", "user" );
|
||||||
$tmpl->assign( "apps", $records );
|
$tmpl->assign( "apps", $records );
|
||||||
$tmpl->printPage();
|
$tmpl->printPage();
|
||||||
unset($tmpl);
|
unset($tmpl);
|
||||||
|
@ -63,7 +63,7 @@ if($installed){
|
||||||
if($categories==NULL){
|
if($categories==NULL){
|
||||||
OC_App::setActiveNavigationEntry( "core_apps" );
|
OC_App::setActiveNavigationEntry( "core_apps" );
|
||||||
|
|
||||||
$tmpl = new OC_Template( "admin", "app_noconn", "admin" );
|
$tmpl = new OC_Template( "admin", "app_noconn", "user" );
|
||||||
$tmpl->printPage();
|
$tmpl->printPage();
|
||||||
unset($tmpl);
|
unset($tmpl);
|
||||||
exit();
|
exit();
|
||||||
|
@ -82,7 +82,7 @@ if($installed){
|
||||||
}
|
}
|
||||||
|
|
||||||
// return template
|
// return template
|
||||||
$tmpl = new OC_Template( "admin", "apps", "admin" );
|
$tmpl = new OC_Template( "admin", "apps", "user" );
|
||||||
|
|
||||||
$tmpl->assign( "categories", $categories );
|
$tmpl->assign( "categories", $categories );
|
||||||
$tmpl->assign( "apps", $apps );
|
$tmpl->assign( "apps", $apps );
|
||||||
|
@ -94,7 +94,7 @@ if($installed){
|
||||||
|
|
||||||
$app=OC_OCSClient::getApplication($id);
|
$app=OC_OCSClient::getApplication($id);
|
||||||
|
|
||||||
$tmpl = new OC_Template( "admin", "app", "admin" );
|
$tmpl = new OC_Template( "admin", "app", "user" );
|
||||||
$tmpl->assign( "categories", $categories );
|
$tmpl->assign( "categories", $categories );
|
||||||
$tmpl->assign( "app", $app );
|
$tmpl->assign( "app", $app );
|
||||||
$tmpl->printPage();
|
$tmpl->printPage();
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
/* APPS TABLE */
|
/* APPS TABLE */
|
||||||
table td.date { width:5em; padding:.5em 1em; text-align:right; }
|
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:center; }
|
table td.version, table td.enabled, table td.disabled { padding:.5em 1em; text-align:left; }
|
||||||
.preview { padding:3px; text-align:left; }
|
.preview { padding:3px; text-align:left; }
|
||||||
table td.date { width:11em; color:#555555; }
|
table td.date { width:11em; color:#555; }
|
||||||
table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; }
|
table td.selection, table th.selection, table td.fileaction { width:2em; text-align:left; }
|
||||||
table td.name a { padding:6px; text-decoration:none; color:#555555; }
|
table td.name a { padding:6px; text-decoration:none; color:#555; }
|
||||||
.type { text-decoration:none; color:#888888; font-size:.8em; }
|
.type { text-decoration:none; color:#888; font-size:.8em; }
|
||||||
.description { text-decoration:none; color:#666666; font-size:.9em; }
|
.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(){
|
$("input[x-use='appenablebutton']").live( "click", function(){
|
||||||
appid = $(this).parent().parent().attr("x-uid");
|
appid = $(this).parent().data("uid");
|
||||||
|
|
||||||
//alert("dsfsdfsdf");
|
//alert("dsfsdfsdf");
|
||||||
if($(this).val() == "enabled"){
|
if($(this).val() == "enabled"){
|
||||||
$(this).attr("value","disabled");
|
$(this).attr("value","disabled");
|
||||||
$(this).removeClass( "enabled" );
|
$(this).removeClass( "enabled" );
|
||||||
$(this).addClass( "disabled" );
|
$(this).addClass( "disabled" );
|
||||||
//$.post( "ajax/disableapp.php", $(appid).serialize(), function(data){} );
|
$.post( "ajax/disableapp.php", 'appid='+appid);
|
||||||
$.post( "ajax/disableapp.php", { appid: appid }, function(data){ alert(data.status);});
|
|
||||||
}
|
}
|
||||||
else if($(this).val() == "disabled"){
|
else if($(this).val() == "disabled"){
|
||||||
$(this).attr("value","enabled");
|
$(this).attr("value","enabled");
|
||||||
$(this).removeClass( "disabled" );
|
$(this).removeClass( "disabled" );
|
||||||
$(this).addClass( "enabled" );
|
$(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(){
|
$(document).ready(function(){
|
||||||
// Vars we need
|
$('select[multiple]').chosen();
|
||||||
var uid = "";
|
|
||||||
var gid = "";
|
|
||||||
var togglepassword = "";
|
|
||||||
var togglegroup = "";
|
|
||||||
|
|
||||||
//#########################################################################
|
$('td.remove>img').live('click',function(event){
|
||||||
// Stuff I don't understand
|
var uid=$(this).parent().parent().data('uid');
|
||||||
//#########################################################################
|
$.post(
|
||||||
|
OC.filePath('admin','ajax','removeuser.php'),
|
||||||
|
{username:uid},
|
||||||
|
function(result){
|
||||||
|
|
||||||
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 ){
|
$(this).parent().parent().remove();
|
||||||
$("#changegroups").prev().html( ' ' );
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$("#changegroups").prev().html( groups.join(", "));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
printError( data.data.message );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
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 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var newstring = newlist.join( ", " );
|
|
||||||
$(this).html( newstring )
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
$('#newuser').submit(function(event){
|
||||||
|
event.preventDefault();
|
||||||
//#########################################################################
|
var username=$('#newusername').val();
|
||||||
// Editing the users properties by clicking the cell
|
var password=$('#newuserpassword').val();
|
||||||
//#########################################################################
|
var groups=$('#newusergroups').val();
|
||||||
|
$.post(
|
||||||
// Password (clicking on user name)
|
OC.filePath('admin','ajax','createuser.php'),
|
||||||
$("span[x-use='usernamediv']").live( "click", function(){
|
{
|
||||||
if( togglepassword == "" || $(this).parent().parent().attr("x-uid") != togglepassword ){
|
username:username,
|
||||||
togglepassword = $(this).parent().parent().attr("x-uid");
|
password:password,
|
||||||
// Set the username!
|
groups:groups,
|
||||||
$("#changepassworduid").val(togglepassword);
|
|
||||||
$("#changepasswordpwd").val("");
|
|
||||||
$(this).parent().append( $('#changepassword') );
|
|
||||||
$('#changepassword').show();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$('#changepassword').hide();
|
|
||||||
togglepassword = "";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#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 );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
// 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 = "";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$("span[x-use='togglegroup']").live( "click", function(){
|
|
||||||
if( $(this).prev().attr("checked")){
|
|
||||||
$(this).prev().removeAttr("checked")
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$(this).prev().attr("checked","checked")
|
|
||||||
}
|
|
||||||
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 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() {
|
function(result){
|
||||||
$( this ).dialog( "close" );
|
|
||||||
}
|
}
|
||||||
},
|
);
|
||||||
close: function() {
|
var tr=$('#rightcontent tr').first().clone();
|
||||||
true;
|
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');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#newgroup').submit(function(event){
|
||||||
|
event.preventDefault();
|
||||||
|
var name=$('#newgroupname').val();
|
||||||
|
$.post(
|
||||||
|
OC.filePath('admin','ajax','creategroup.php'),
|
||||||
|
{groupname:name},
|
||||||
|
function(result){
|
||||||
|
|
||||||
// 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" );
|
|
||||||
}
|
|
||||||
},
|
|
||||||
close: function(){
|
|
||||||
true;
|
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
$('#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);
|
||||||
});
|
});
|
||||||
|
|
||||||
} );
|
$('#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');
|
||||||
|
});
|
||||||
|
$('#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;
|
||||||
|
}
|
||||||
|
if(group){
|
||||||
|
$.post(
|
||||||
|
OC.filePath('admin','ajax','togglegroups.php'),
|
||||||
|
{
|
||||||
|
username:user,
|
||||||
|
group:group
|
||||||
|
},
|
||||||
|
function(result){
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
$(this).parent().parent().children('td.groups').text(groups.join(', '));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
@ -29,7 +29,7 @@ if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' ))
|
||||||
|
|
||||||
OC_App::setActiveNavigationEntry( "administration" );
|
OC_App::setActiveNavigationEntry( "administration" );
|
||||||
|
|
||||||
$tmpl = new OC_Template( "admin", "system", "admin" );
|
$tmpl = new OC_Template( "admin", "system", "user" );
|
||||||
$tmpl->printPage();
|
$tmpl->printPage();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,20 +1,7 @@
|
||||||
<table>
|
<ul id="apps">
|
||||||
<thead>
|
<?php foreach($_["apps"] as $app): ?>
|
||||||
<tr>
|
<li data-uid="<?php echo($app['id']); ?>"><strong><?php echo($app['name']); ?></strong> <?php echo($app['version']); ?> <em>by <?php echo($app['author']); ?></em>
|
||||||
<th><?php echo $l->t( 'Name' ); ?></th>
|
<input x-use="appenablebutton" type="submit" value="<?php echo $l->t( $app['enabled'] ? 'enabled' : 'disabled' ); ?>" class="appbutton <?php echo( $app['enabled'] ? 'enabled' : 'disabled' ); ?>" />
|
||||||
<th><?php echo $l->t( 'Version' ); ?></th>
|
</li>
|
||||||
<th><?php echo $l->t( 'Author' ); ?></th>
|
<?php endforeach; ?>
|
||||||
<th><?php echo $l->t( 'Status' ); ?></th>
|
</ul>
|
||||||
</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>
|
|
||||||
|
|
|
@ -1,117 +1,39 @@
|
||||||
<fieldset>
|
<div id="controls">
|
||||||
<legend><?php echo $l->t( 'Users' ); ?></legend>
|
<form id="newgroup">
|
||||||
<table id="usertable">
|
<input id="newgroupname" placeholder="name"></input>
|
||||||
<thead>
|
<input type="submit" value="create"></input>
|
||||||
<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>
|
</form>
|
||||||
</tr>
|
<form id="newuser">
|
||||||
</tfoot>
|
<input id="newusername" placeholder="username"></input>
|
||||||
<tbody>
|
<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>
|
||||||
|
<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): ?>
|
<?php foreach($_["users"] as $user): ?>
|
||||||
<tr x-uid="<?php echo $user["name"] ?>">
|
<tr data-uid="<?php echo $user["name"] ?>">
|
||||||
<td x-use="username"><span x-use="usernamediv"><?php echo $user["name"]; ?></span></td>
|
<td class="select"><input type="checkbox"></input></td>
|
||||||
<td x-use="usergroups"><div x-use="usergroupsdiv"><?php if( $user["groups"] ){ echo $user["groups"]; }else{echo " ";} ?></div></td>
|
<td class="name"><?php echo $user["name"]; ?></td>
|
||||||
<td>
|
<td class="groups"><?php if( $user["groups"] ){ echo $user["groups"]; }else{echo " ";} ?></td>
|
||||||
|
<td class="remove">
|
||||||
<?php if($user['name']!=OC_User::getUser()):?>
|
<?php if($user['name']!=OC_User::getUser()):?>
|
||||||
<input type="submit" class="removeuserbutton" value="<?php echo $l->t( 'Remove' ); ?>" />
|
<img alt="Remove" title="Remove" class='svg' src='<?php echo image_path('core','actions/delete.svg') ?>'/>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
|
||||||
</table>
|
</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; ?>
|
|
||||||
</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>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="errordialog" title="Error">
|
|
||||||
<span id="errormessage"></span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -28,8 +28,11 @@ if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' ))
|
||||||
}
|
}
|
||||||
|
|
||||||
// We have some javascript foo!
|
// We have some javascript foo!
|
||||||
OC_Util::addScript( "admin", "users" );
|
OC_Util::addScript( 'admin', 'users' );
|
||||||
OC_App::setActiveNavigationEntry( "core_users" );
|
OC_Util::addStyle( 'admin', 'users' );
|
||||||
|
OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' );
|
||||||
|
OC_Util::addStyle( '3rdparty', 'chosen' );
|
||||||
|
OC_App::setActiveNavigationEntry( 'core_users' );
|
||||||
|
|
||||||
$users = array();
|
$users = array();
|
||||||
$groups = array();
|
$groups = array();
|
||||||
|
@ -48,7 +51,7 @@ foreach( OC_Group::getGroups() as $i ){
|
||||||
$groups[] = array( "name" => $i );
|
$groups[] = array( "name" => $i );
|
||||||
}
|
}
|
||||||
|
|
||||||
$tmpl = new OC_Template( "admin", "users", "admin" );
|
$tmpl = new OC_Template( "admin", "users", "user" );
|
||||||
$tmpl->assign( "users", $users );
|
$tmpl->assign( "users", $users );
|
||||||
$tmpl->assign( "groups", $groups );
|
$tmpl->assign( "groups", $groups );
|
||||||
$tmpl->printPage();
|
$tmpl->printPage();
|
||||||
|
|
|
@ -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 )));
|
|
@ -21,7 +21,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Init owncloud
|
// Init owncloud
|
||||||
require_once('../../lib/base.php');
|
require_once('../../../lib/base.php');
|
||||||
|
|
||||||
$id = $_GET['id'];
|
$id = $_GET['id'];
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ $l10n = new OC_L10N('contacts');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
if( !OC_User::isLoggedIn()){
|
if( !OC_User::isLoggedIn()){
|
||||||
echo $l10n->t('You need to log in!');
|
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!'))));
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,10 +48,9 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
||||||
|
|
||||||
$vcard = Sabre_VObject_Reader::read($card['carddata']);
|
$vcard = Sabre_VObject_Reader::read($card['carddata']);
|
||||||
$details = OC_Contacts_Addressbook::structureContact($vcard);
|
$details = OC_Contacts_Addressbook::structureContact($vcard);
|
||||||
|
$tmpl = new OC_Template('contacts','part.details');
|
||||||
$tmpl = new OC_Template('contacts','_details');
|
|
||||||
$tmpl->assign('details',$details);
|
$tmpl->assign('details',$details);
|
||||||
$tmpl->assign('id',$id);
|
$tmpl->assign('id',$id);
|
||||||
$page = $tmpl->fetchPage();
|
$page = $tmpl->fetchPage();
|
||||||
|
|
||||||
echo json_encode( array( 'status' => 'success', 'data' => array( 'page' => $page )));
|
echo json_encode( array( 'status' => 'success', 'data' => array( 'id' => $id, 'page' => $page )));
|
|
@ -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,4 +1,24 @@
|
||||||
<?php
|
<?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/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
// Do not load FS ...
|
// Do not load FS ...
|
||||||
$RUNTIME_NOSETUPFS = true;
|
$RUNTIME_NOSETUPFS = true;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
|
.contacts_propertyname {float:left;}
|
||||||
|
|
|
@ -37,6 +37,12 @@ if( !OC_User::isLoggedIn()){
|
||||||
$addressbooks = OC_Contacts_Addressbook::allAddressbooks(OC_User::getUser());
|
$addressbooks = OC_Contacts_Addressbook::allAddressbooks(OC_User::getUser());
|
||||||
if( count($addressbooks) == 0){
|
if( count($addressbooks) == 0){
|
||||||
OC_Contacts_Addressbook::addAddressbook(OC_User::getUser(),'default','Default Address Book');
|
OC_Contacts_Addressbook::addAddressbook(OC_User::getUser(),'default','Default Address Book');
|
||||||
|
$addressbooks = OC_Contacts_Addressbook::allAddressbooks(OC_User::getUser());
|
||||||
|
}
|
||||||
|
$prefbooks = OC_Preferences::getValue(OC_User::getUser(),'contacts','openaddressbooks',null);
|
||||||
|
if(is_null($prefbooks)){
|
||||||
|
$prefbooks = $addressbooks[0]['id'];
|
||||||
|
OC_Preferences::setValue(OC_User::getUser(),'contacts','openaddressbooks',$prefbooks);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the files we need
|
// Load the files we need
|
||||||
|
@ -48,7 +54,7 @@ $id = isset( $_GET['id'] ) ? $_GET['id'] : null;
|
||||||
// sort addressbooks (use contactsort)
|
// sort addressbooks (use contactsort)
|
||||||
usort($addressbooks,'contacts_namesort');
|
usort($addressbooks,'contacts_namesort');
|
||||||
// Addressbooks to load
|
// Addressbooks to load
|
||||||
$openaddressbooks = explode(';',OC_Preferences::getValue(OC_User::getUser(),'contacts','openaddressbooks',null));
|
$openaddressbooks = explode(';',$prefbooks);
|
||||||
|
|
||||||
$contacts = array();
|
$contacts = array();
|
||||||
foreach( $openaddressbooks as $addressbook ){
|
foreach( $openaddressbooks as $addressbook ){
|
||||||
|
@ -63,7 +69,8 @@ usort($contacts,'contacts_namesort');
|
||||||
$details = array();
|
$details = array();
|
||||||
|
|
||||||
if( !is_null($id) || count($contacts)){
|
if( !is_null($id) || count($contacts)){
|
||||||
$contact = OC_Contacts_Addressbook::findCard(is_null($id)?$contacts[0]['id']:$id);
|
if(is_null($id)) $id = $contacts[0]['id'];
|
||||||
|
$contact = OC_Contacts_Addressbook::findCard($id);
|
||||||
$vcard = Sabre_VObject_Reader::read($contact['carddata']);
|
$vcard = Sabre_VObject_Reader::read($contact['carddata']);
|
||||||
$details = OC_Contacts_Addressbook::structureContact($vcard);
|
$details = OC_Contacts_Addressbook::structureContact($vcard);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$('.contacts_contacts').find('li').live('click',function(){
|
/* $('.contacts_addressbooksexpander').click(function(){
|
||||||
|
$('.contacts_addressbooksdetails').toggle();
|
||||||
|
return false;
|
||||||
|
});*/
|
||||||
|
|
||||||
|
$('#contacts_contacts li').live('click',function(){
|
||||||
var id = $(this).attr('x-id');
|
var id = $(this).attr('x-id');
|
||||||
$.getJSON('details.php',{'id':id},function(jsondata){
|
$.getJSON('ajax/getdetails.php',{'id':id},function(jsondata){
|
||||||
if(jsondata.status == 'success'){
|
if(jsondata.status == 'success'){
|
||||||
$('.contacts_details').html(jsondata.data.page);
|
$('#contacts_details').attr('x-id',jsondata.data.id);
|
||||||
|
$('#contacts_details').html(jsondata.data.page);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
alert(jsondata.data.message);
|
alert(jsondata.data.message);
|
||||||
|
@ -12,8 +18,140 @@ $(document).ready(function(){
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.contacts_addressbooksexpander').click(function(){
|
$('#contacts_deletecard').live('click',function(){
|
||||||
$('.contacts_addressbooksdetails').toggle();
|
var id = $('#contacts_details').attr('x-id');
|
||||||
|
$.getJSON('ajax/deletecard.php',{'id':id},function(jsondata){
|
||||||
|
if(jsondata.status == 'success'){
|
||||||
|
$('#contacts_contacts [x-id="'+jsondata.data.id+'"]').remove();
|
||||||
|
$('#contacts_details').attr('x-id','');
|
||||||
|
$('#contacts_details').html('');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert(jsondata.data.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#contacts_addproperty').live('click',function(){
|
||||||
|
var id = $('#contacts_details').attr('x-id');
|
||||||
|
$.getJSON('ajax/showaddproperty.php',{'id':id},function(jsondata){
|
||||||
|
if(jsondata.status == 'success'){
|
||||||
|
$('#contacts_details').append(jsondata.data.page);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert(jsondata.data.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#contacts_addpropertyform [name="name"]').live('change',function(){
|
||||||
|
$('#contacts_addpropertyform #contacts_addresspart').remove();
|
||||||
|
$('#contacts_addpropertyform #contacts_phonepart').remove();
|
||||||
|
$('#contacts_addpropertyform #contacts_fieldpart').remove();
|
||||||
|
$('#contacts_addpropertyform #contacts_generic').remove();
|
||||||
|
if($(this).val() == 'ADR'){
|
||||||
|
$('#contacts_addresspart').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
|
||||||
|
}
|
||||||
|
else if($(this).val() == 'TEL'){
|
||||||
|
$('#contacts_phonepart').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
|
||||||
|
}
|
||||||
|
else if($(this).val() == 'NOTE'){
|
||||||
|
$('#contacts_fieldpart').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#contacts_generic').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#contacts_addpropertyform input[type="submit"]').live('click',function(){
|
||||||
|
$.post('ajax/addproperty.php',$('#contacts_addpropertyform').serialize(),function(jsondata){
|
||||||
|
if(jsondata.status == 'success'){
|
||||||
|
$('#contacts_details').append(jsondata.data.page);
|
||||||
|
$('#contacts_addpropertyform').remove();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert(jsondata.data.message);
|
||||||
|
}
|
||||||
|
}, 'json');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#contacts_newcontact').click(function(){
|
||||||
|
$.getJSON('ajax/showaddcard.php',{},function(jsondata){
|
||||||
|
if(jsondata.status == 'success'){
|
||||||
|
$('#contacts_details').attr('x-id','');
|
||||||
|
$('#contacts_details').html(jsondata.data.page);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert(jsondata.data.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#contacts_addcardform input[type="submit"]').live('click',function(){
|
||||||
|
$.post('ajax/addcard.php',$('#contacts_addcardform').serialize(),function(jsondata){
|
||||||
|
if(jsondata.status == 'success'){
|
||||||
|
$('#contacts_details').attr('x-id',jsondata.data.id);
|
||||||
|
$('#contacts_details').html(jsondata.data.page);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert(jsondata.data.message);
|
||||||
|
}
|
||||||
|
}, 'json');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.contacts_property [x-use="edit"]').live('click',function(){
|
||||||
|
var id = $('#contacts_details').attr('x-id');
|
||||||
|
var checksum = $(this).parent().parent().attr('x-checksum');
|
||||||
|
var line = $(this).parent().parent().attr('x-line');
|
||||||
|
$.getJSON('ajax/showsetproperty.php',{'id': id, 'checksum': checksum, 'line': line },function(jsondata){
|
||||||
|
if(jsondata.status == 'success'){
|
||||||
|
$('.contacts_property[x-line="'+line+'"][x-checksum="'+checksum+'"] .contacts_propertyvalue').html(jsondata.data.page);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert(jsondata.data.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#contacts_setpropertyform input[type="submit"]').live('click',function(){
|
||||||
|
$.post('ajax/setproperty.php',$('#contacts_setpropertyform').serialize(),function(jsondata){
|
||||||
|
if(jsondata.status == 'success'){
|
||||||
|
$('.contacts_property[x-line="'+jsondata.data.line+'"][x-checksum="'+jsondata.data.oldchecksum+'"]').replaceWith(jsondata.data.page);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert(jsondata.data.message);
|
||||||
|
}
|
||||||
|
},'json');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.contacts_property [x-use="delete"]').live('click',function(){
|
||||||
|
var id = $('#contacts_details').attr('x-id');
|
||||||
|
var checksum = $(this).parent().parent().attr('x-checksum');
|
||||||
|
var line = $(this).parent().parent().attr('x-line');
|
||||||
|
$.getJSON('ajax/deleteproperty.php',{'id': id, 'checksum': checksum, 'line': line },function(jsondata){
|
||||||
|
if(jsondata.status == 'success'){
|
||||||
|
$('.contacts_property[x-line="'+line+'"][x-checksum="'+checksum+'"]').remove();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert(jsondata.data.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('.contacts_property').live('mouseenter',function(){
|
||||||
|
$(this).find('span').show();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.contacts_property').live('mouseleave',function(){
|
||||||
|
$(this).find('span').hide();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -78,7 +78,7 @@ class OC_Contacts_Addressbook{
|
||||||
$uris[] = $i['uri'];
|
$uris[] = $i['uri'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$uri = self::createURI('name', $uris );
|
$uri = self::createURI($name, $uris );
|
||||||
|
|
||||||
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_addressbooks (userid,displayname,uri,description,ctag) VALUES(?,?,?,?,?)' );
|
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_addressbooks (userid,displayname,uri,description,ctag) VALUES(?,?,?,?,?)' );
|
||||||
$result = $stmt->execute(array($userid,$name,$uri,$description,1));
|
$result = $stmt->execute(array($userid,$name,$uri,$description,1));
|
||||||
|
@ -167,14 +167,14 @@ class OC_Contacts_Addressbook{
|
||||||
$uri = $property->value.'.vcf';
|
$uri = $property->value.'.vcf';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$uri = self::createUID().'.vcf';
|
if(is_null($uri)) $uri = self::createUID().'.vcf';
|
||||||
|
|
||||||
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_cards (addressbookid,fullname,carddata,uri,lastmodified) VALUES(?,?,?,?,?)' );
|
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_cards (addressbookid,fullname,carddata,uri,lastmodified) VALUES(?,?,?,?,?)' );
|
||||||
$result = $stmt->execute(array($id,$fn,$data,$uri,time()));
|
$result = $stmt->execute(array($id,$fn,$data,$uri,time()));
|
||||||
|
|
||||||
self::touch($id);
|
self::touchAddressbook($id);
|
||||||
|
|
||||||
return OC_DB::insertid;
|
return OC_DB::insertid();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function addCardFromDAVData($id,$uri,$data){
|
public static function addCardFromDAVData($id,$uri,$data){
|
||||||
|
@ -189,13 +189,13 @@ class OC_Contacts_Addressbook{
|
||||||
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_cards (addressbookid,fullname,carddata,uri,lastmodified) VALUES(?,?,?,?,?)' );
|
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_cards (addressbookid,fullname,carddata,uri,lastmodified) VALUES(?,?,?,?,?)' );
|
||||||
$result = $stmt->execute(array($id,$fn,$data,$uri,time()));
|
$result = $stmt->execute(array($id,$fn,$data,$uri,time()));
|
||||||
|
|
||||||
self::touch($id);
|
self::touchAddressbook($id);
|
||||||
|
|
||||||
return OC_DB::insertid;
|
return OC_DB::insertid();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function editCard($id, $data){
|
public static function editCard($id, $data){
|
||||||
$oldcard = self::findCard($id,$aid,$uri);
|
$oldcard = self::findCard($id);
|
||||||
$fn = null;
|
$fn = null;
|
||||||
$card = Sabre_VObject_Reader::read($data);
|
$card = Sabre_VObject_Reader::read($data);
|
||||||
foreach($card->children as $property){
|
foreach($card->children as $property){
|
||||||
|
@ -207,7 +207,7 @@ class OC_Contacts_Addressbook{
|
||||||
$stmt = OC_DB::prepare( 'UPDATE *PREFIX*contacts_cards SET fullname = ?,carddata = ?, lastmodified = ? WHERE id = ?' );
|
$stmt = OC_DB::prepare( 'UPDATE *PREFIX*contacts_cards SET fullname = ?,carddata = ?, lastmodified = ? WHERE id = ?' );
|
||||||
$result = $stmt->execute(array($fn,$data,time(),$id));
|
$result = $stmt->execute(array($fn,$data,time(),$id));
|
||||||
|
|
||||||
self::touch($oldcard['addressbookid']);
|
self::touchAddressbook($oldcard['addressbookid']);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -226,20 +226,20 @@ class OC_Contacts_Addressbook{
|
||||||
$stmt = OC_DB::prepare( 'UPDATE *PREFIX*contacts_cards SET fullname = ?,carddata = ?, lastmodified = ? WHERE id = ?' );
|
$stmt = OC_DB::prepare( 'UPDATE *PREFIX*contacts_cards SET fullname = ?,carddata = ?, lastmodified = ? WHERE id = ?' );
|
||||||
$result = $stmt->execute(array($fn,$data,time(),$oldcard['id']));
|
$result = $stmt->execute(array($fn,$data,time(),$oldcard['id']));
|
||||||
|
|
||||||
self::touch($oldcard['addressbookid']);
|
self::touchAddressbook($oldcard['addressbookid']);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function deleteCard($id){
|
public static function deleteCard($id){
|
||||||
$stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_addressbooks WHERE id = ?' );
|
$stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE id = ?' );
|
||||||
$stmt->execute(array($id));
|
$stmt->execute(array($id));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function deleteCardFromDAVData($aid,$uri){
|
public static function deleteCardFromDAVData($aid,$uri){
|
||||||
$stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_addressbooks WHERE addressbookid = ? AND uri=?' );
|
$stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE addressbookid = ? AND uri=?' );
|
||||||
$stmt->execute(array($aid,$uri));
|
$stmt->execute(array($aid,$uri));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -265,23 +265,60 @@ class OC_Contacts_Addressbook{
|
||||||
return $userid;
|
return $userid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function escapeSemicolons($value){
|
||||||
|
foreach($value as &$i ){
|
||||||
|
$i = implode("\\\\;", explode(';', $i));
|
||||||
|
} unset($i);
|
||||||
|
return implode(';',$value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function unescapeSemicolons($value){
|
||||||
|
$array = explode(';',$value);
|
||||||
|
for($i=0;$i<count($array);$i++){
|
||||||
|
if(substr($array[$i],-2,2)=="\\\\"){
|
||||||
|
if(isset($array[$i+1])){
|
||||||
|
$array[$i] = substr($array[$i],0,count($array[$i])-2).';'.$array[$i+1];
|
||||||
|
unset($array[$i+1]);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$array[$i] = substr($array[$i],0,count($array[$i])-2).';';
|
||||||
|
}
|
||||||
|
$i = $i - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $array;
|
||||||
|
}
|
||||||
|
|
||||||
public static function structureContact($object){
|
public static function structureContact($object){
|
||||||
$details = array();
|
$details = array();
|
||||||
|
$line = 0;
|
||||||
foreach($object->children as $property){
|
foreach($object->children as $property){
|
||||||
$temp = array(
|
$temp = self::structureProperty($property,$line);
|
||||||
'name' => $property->name,
|
|
||||||
'value' => ($property->name == 'PHOTO' || $property->name == 'LOGO' ? null : $property->value ),
|
|
||||||
'parameters' => array());
|
|
||||||
foreach($property->parameters as $parameter){
|
|
||||||
$temp['parameters'][] = array( 'name' => $parameter->name, 'value' => $parameter->value);
|
|
||||||
}
|
|
||||||
if(array_key_exists($property->name,$details)){
|
if(array_key_exists($property->name,$details)){
|
||||||
$details[$property->name][] = $temp;
|
$details[$property->name][] = $temp;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$details[$property->name] = array($temp);
|
$details[$property->name] = array($temp);
|
||||||
}
|
}
|
||||||
|
$line++;
|
||||||
}
|
}
|
||||||
return $details;
|
return $details;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function structureProperty($property,$line=null){
|
||||||
|
$value = $property->value;
|
||||||
|
if($property->name == 'ADR'){
|
||||||
|
$value = self::unescapeSemicolons($value);
|
||||||
|
}
|
||||||
|
$temp = array(
|
||||||
|
'name' => $property->name,
|
||||||
|
'value' => $value,
|
||||||
|
'line' => $line,
|
||||||
|
'parameters' => array(),
|
||||||
|
'checksum' => md5($property->serialize()));
|
||||||
|
foreach($property->parameters as $parameter){
|
||||||
|
$temp['parameters'][$parameter->name] = $parameter->value;
|
||||||
|
}
|
||||||
|
return $temp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,23 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PDO CardDAV backend
|
* 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/>.
|
||||||
*
|
*
|
||||||
* @package Sabre
|
|
||||||
* @subpackage CardDAV
|
|
||||||
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
|
|
||||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
|
||||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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; ?>
|
|
|
@ -3,7 +3,8 @@ OC_Util::addScript('contacts','interface');
|
||||||
OC_Util::addStyle('contacts','styles');
|
OC_Util::addStyle('contacts','styles');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="contacts_addressbooks">
|
<?php
|
||||||
|
/*<div class="contacts_addressbooks">
|
||||||
<div class="contacts_addressbooksexpander">
|
<div class="contacts_addressbooksexpander">
|
||||||
Addressbooks
|
Addressbooks
|
||||||
</div>
|
</div>
|
||||||
|
@ -13,12 +14,14 @@ OC_Util::addStyle('contacts','styles');
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<br>To use this addressbook, use .../apps/contacts/carddav.php/addressbooks/USERNAME/addressbookname.php
|
<br>To use this addressbook, use .../apps/contacts/carddav.php/addressbooks/USERNAME/addressbookname.php
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>*/
|
||||||
<div class="contacts_contacts leftcontent">
|
?>
|
||||||
|
<div id="contacts_contacts" class="leftcontent">
|
||||||
<ul>
|
<ul>
|
||||||
<?php echo $this->inc("_contacts"); ?>
|
<?php echo $this->inc("part.contacts"); ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
<a id="contacts_newcontact"><?php echo $l->t('Add Contact'); ?></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="contacts_details rightcontent">
|
<div id="contacts_details" class="rightcontent" x-id="<?php echo $_['id']; ?>">
|
||||||
<?php echo $this->inc("_details"); ?>
|
<?php echo $this->inc("part.details"); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -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 ): ?>
|
<?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; ?>
|
<?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,4 +1,24 @@
|
||||||
<?php
|
<?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
|
// Init owncloud
|
||||||
require_once('../../lib/base.php');
|
require_once('../../lib/base.php');
|
||||||
$connector = new OC_Connector_Sabre_Principal;
|
$connector = new OC_Connector_Sabre_Principal;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?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"));
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -27,34 +27,4 @@ OC_Util::addScript('media','loader');
|
||||||
OC_App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
|
OC_App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
|
||||||
|
|
||||||
OC_App::addNavigationEntry( array( 'id' => 'media_index', 'order' => 2, 'href' => OC_Helper::linkTo( 'media', 'index.php' ), 'icon' => OC_Helper::imagePath( 'media', 'media.png' ), 'name' => 'Music' ));
|
OC_App::addNavigationEntry( array( 'id' => 'media_index', 'order' => 2, 'href' => OC_Helper::linkTo( 'media', 'index.php' ), 'icon' => OC_Helper::imagePath( 'media', 'media.png' ), 'name' => 'Music' ));
|
||||||
|
|
||||||
// add subnavigations
|
|
||||||
$entry = array(
|
|
||||||
'id' => "media_playlist",
|
|
||||||
'order'=>1,
|
|
||||||
'href' => '#playlist',
|
|
||||||
'name' => 'Playlist'
|
|
||||||
);
|
|
||||||
OC_App::addNavigationSubEntry( "media_index", $entry);
|
|
||||||
$entry = array(
|
|
||||||
'id' => "media_collection",
|
|
||||||
'order'=>1,
|
|
||||||
'href' => '#collection',
|
|
||||||
'name' => 'Collection'
|
|
||||||
);
|
|
||||||
OC_App::addNavigationSubEntry( "media_index", $entry);
|
|
||||||
// $entry = array(
|
|
||||||
// 'id' => "media_recent",
|
|
||||||
// 'order'=>1,
|
|
||||||
// 'href' => '#recent',
|
|
||||||
// 'name' => 'Most Recent'
|
|
||||||
// );
|
|
||||||
// OC_App::addNavigationSubEntry( "media_index", $entry);
|
|
||||||
// $entry = array(
|
|
||||||
// 'id' => "media_mostplayer",
|
|
||||||
// 'order'=>1,
|
|
||||||
// 'href' => '#mostplayed',
|
|
||||||
// 'name' => 'Most Played'
|
|
||||||
// );
|
|
||||||
// OC_App::addNavigationSubEntry( "media_index", $entry);
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
li button.right.prettybutton{font-size:1em;}
|
li button.right.prettybutton{font-size:1em;}
|
||||||
#collection{padding-top:1em;position:relative;width:70ex;float:left;}
|
#collection{padding-top:1em;position:relative;width:70ex;float:left;}
|
||||||
#collection li.album,#collection li.song{margin-left:3ex;}
|
#collection li.album,#collection li.song{margin-left:3ex;}
|
||||||
#playlist{width:100%;border-spacing:0;}
|
#playlist{border-spacing:0;}
|
||||||
#playlist th{background-color:#ccc; text-align:left; font-size:1.2em; padding:0.2em}
|
#playlist th{background-color:#ccc; text-align:left; font-size:1.2em; padding:0.2em}
|
||||||
#playlist tr.selected{background-color:#eee;}
|
#playlist tr.selected{background-color:#eee;}
|
||||||
#playlist tr.current{background-color:#ccc;}
|
#playlist tr.current{background-color:#ccc;}
|
||||||
|
@ -12,7 +12,8 @@ li button.right.prettybutton{font-size:1em;}
|
||||||
#collection li,#playlist li{list-style-type:none;}
|
#collection li,#playlist li{list-style-type:none;}
|
||||||
.template{display:none}
|
.template{display:none}
|
||||||
|
|
||||||
#collection{display:none}/*hide the collection initially*/
|
|
||||||
#collection li{padding-right:10px;}
|
#collection li{padding-right:10px;}
|
||||||
img.remove{float:right;}
|
img.remove{float:right;}
|
||||||
#searchresults input.play, #searchresults input.add{float:right; height:16px; width:16px;}
|
#searchresults input.play, #searchresults input.add{float:right; height:16px; width:16px;}
|
||||||
|
#collection tr.collapsed td.album, #collection tr.collapsed td.title{color:#ddd}
|
||||||
|
a.expander{float:right;display:block}
|
||||||
|
|
|
@ -1,29 +1,25 @@
|
||||||
#jp-interface{position:fixed;z-index:100;width:25em;left:201px;top:-20px;height:60px;border-bottom:none;}
|
#controls ul.jp-controls{list-style-type:none;padding:0;}
|
||||||
#jp-interface div.player{height:0px}
|
#controls ul.jp-controls li{display:inline;}
|
||||||
#jp-interface ul.jp-controls{list-style-type:none;padding:0;}
|
#controls ul.jp-controls a{position:absolute;overflow:hidden;text-indent:-9999px;}
|
||||||
#jp-interface ul.jp-controls li{display:inline;}
|
a.jp-play,a.jp-pause{width:40px;height:40px;z-index:1;top:0;left:48px;}
|
||||||
#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;}
|
|
||||||
a.jp-play{background:url("../img/jplayer.blue.monday.png") 0 0 no-repeat;}
|
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-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{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-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-previous{left:20px;top:.5em;background:url("../img/jplayer.blue.monday.png") 0 -112px no-repeat;width:28px;height:28px;}
|
||||||
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:hover{background:url("../img/jplayer.blue.monday.png") -29px -112px no-repeat;}
|
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;}
|
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-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-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");}
|
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{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-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{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;}
|
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-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;}
|
div.jp-duration{text-align:right;}
|
||||||
|
|
|
@ -42,17 +42,9 @@ OC_Util::addScript('media','jquery.jplayer.min');
|
||||||
OC_Util::addStyle('media','player');
|
OC_Util::addStyle('media','player');
|
||||||
OC_Util::addStyle('media','music');
|
OC_Util::addStyle('media','music');
|
||||||
|
|
||||||
OC_App::setActiveNavigationEntry( 'media_playlist' );
|
OC_App::setActiveNavigationEntry( 'media_index' );
|
||||||
|
|
||||||
$tmpl = new OC_Template( 'media', 'music', 'user' );
|
$tmpl = new OC_Template( 'media', 'music', 'user' );
|
||||||
|
|
||||||
$player = new OC_Template( 'media', 'player');
|
|
||||||
$playlist = new OC_Template( 'media', 'playlist');
|
|
||||||
$collection= new OC_Template( 'media', 'collection');
|
|
||||||
|
|
||||||
$tmpl->assign('player',$player->fetchPage());
|
|
||||||
$tmpl->assign('playlist',$playlist->fetchPage());
|
|
||||||
$tmpl->assign('collection',$collection->fetchPage());
|
|
||||||
$tmpl->printPage();
|
$tmpl->printPage();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
|
@ -49,21 +49,99 @@ Collection={
|
||||||
Collection.load(Collection.display)
|
Collection.load(Collection.display)
|
||||||
}else{
|
}else{
|
||||||
if(Collection.parent){
|
if(Collection.parent){
|
||||||
Collection.parent.children('li.artist').remove();
|
Collection.parent.find('tr:not(.template)').remove();
|
||||||
var template=Collection.parent.children('li.template');
|
var template=Collection.parent.find('tr.template');
|
||||||
for(var i=0;i<Collection.artists.length;i++){
|
var lastArtist='';
|
||||||
var artist=Collection.artists[i];
|
var lastAlbum='';
|
||||||
var li=template.clone();
|
$.each(Collection.artists,function(index,artist){
|
||||||
li.data('artist',artist);
|
$.each(artist.albums,function(index,album){
|
||||||
li.removeClass('template');
|
$.each(album.songs,function(index,song){
|
||||||
li.addClass('artist');
|
var tr=template.clone().removeClass('template');
|
||||||
li.data('type','artist');
|
tr.find('td.title a').text(song.song_name);
|
||||||
li.children('span').text(artist.artist_name);
|
tr.find('td.title a').click(function(event){
|
||||||
Collection.addButtons(li);
|
event.preventDefault();
|
||||||
Collection.parent.append(li);
|
PlayList.add(song);
|
||||||
|
PlayList.render();
|
||||||
|
});
|
||||||
|
if(artist.artist_name!=lastArtist){
|
||||||
|
tr.find('td.artist a').click(function(event){
|
||||||
|
event.preventDefault();
|
||||||
|
PlayList.add(artist);
|
||||||
|
PlayList.render();
|
||||||
|
});
|
||||||
|
tr.find('td.artist a').text(artist.artist_name);
|
||||||
|
if(artist.albums.length>1){
|
||||||
|
var expander=$('<a class="expander">></a>');
|
||||||
|
expander.data('expanded',true);
|
||||||
|
expander.click(function(event){
|
||||||
|
var tr=$(this).parent().parent();
|
||||||
|
if(expander.data('expanded')){
|
||||||
|
Collection.hideArtist(tr.data('artist'));
|
||||||
|
}else{
|
||||||
|
Collection.showArtist(tr.data('artist'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tr.children('td.artist').append(expander);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(album.album_name!=lastAlbum){
|
||||||
|
tr.find('td.album a').click(function(event){
|
||||||
|
event.preventDefault();
|
||||||
|
PlayList.add(album);
|
||||||
|
PlayList.render();
|
||||||
|
});
|
||||||
|
tr.find('td.album a').text(album.album_name);
|
||||||
|
if(album.songs.length>1){
|
||||||
|
var expander=$('<a class="expander">></a>');
|
||||||
|
expander.data('expanded',true);
|
||||||
|
expander.click(function(event){
|
||||||
|
var tr=$(this).parent().parent();
|
||||||
|
if(expander.data('expanded')){
|
||||||
|
Collection.hideAlbum(tr.data('album'));
|
||||||
|
}else{
|
||||||
|
Collection.showAlbum(tr.data('album'));
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
tr.children('td.album').append(expander);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tr.attr('data-artist',artist.artist_name);
|
||||||
|
tr.attr('data-album',album.album_name);
|
||||||
|
lastArtist=artist.artist_name;
|
||||||
|
lastAlbum=album.album_name;
|
||||||
|
|
||||||
|
Collection.parent.find('tbody').append(tr);
|
||||||
|
});
|
||||||
|
Collection.hideAlbum(artist.artist_name,album.album_name);
|
||||||
|
});
|
||||||
|
Collection.hideArtist(artist.artist_name);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showArtist:function(artist){
|
||||||
|
Collection.parent.find('tr[data-artist="'+artist+'"]').show();
|
||||||
|
Collection.parent.find('tr[data-artist="'+artist+'"]').first().removeClass('collapsed');
|
||||||
|
Collection.parent.find('tr[data-artist="'+artist+'"] a.expander').data('expanded',true);
|
||||||
|
Collection.parent.find('tr[data-artist="'+artist+'"] a.expander').addClass('expanded');
|
||||||
|
Collection.parent.find('tr[data-artist="'+artist+'"] a.expander').text('v');
|
||||||
|
},
|
||||||
|
hideArtist:function(artist){
|
||||||
|
if(Collection.parent.find('tr[data-artist="'+artist+'"]').length>1){
|
||||||
|
Collection.parent.find('tr[data-artist="'+artist+'"]').hide();
|
||||||
|
Collection.parent.find('tr[data-artist="'+artist+'"]').first().show();
|
||||||
|
Collection.parent.find('tr[data-artist="'+artist+'"]').first().addClass('collapsed');
|
||||||
|
Collection.parent.find('tr[data-artist="'+artist+'"] a.expander').data('expanded',false);
|
||||||
|
Collection.parent.find('tr[data-artist="'+artist+'"] a.expander').removeClass('expanded');
|
||||||
|
Collection.parent.find('tr[data-artist="'+artist+'"] a.expander').text('>');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showAlbum:function(artist,album){
|
||||||
|
Collection.parent.find('tr[data-artist="'+artist+'"][data-album="'+album+'"]').show();
|
||||||
|
},
|
||||||
|
hideAlbum:function(artist,album){
|
||||||
|
Collection.parent.find('tr[data-artist="'+artist+'"][data-album="'+album+'"]').hide();
|
||||||
|
Collection.parent.find('tr[data-artist="'+artist+'"][data-album="'+album+'"]').last().show();
|
||||||
},
|
},
|
||||||
parent:null,
|
parent:null,
|
||||||
hide:function(){
|
hide:function(){
|
||||||
|
@ -71,46 +149,6 @@ Collection={
|
||||||
Collection.parent.hide();
|
Collection.parent.hide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showAlbums:function(artistLi){
|
|
||||||
$('ul.albums').parent().removeClass('active');
|
|
||||||
$('ul.albums').remove();
|
|
||||||
var artist=artistLi.data('artist');
|
|
||||||
if(artist){
|
|
||||||
var template=Collection.parent.children('li.template');
|
|
||||||
var ul=$('<ul class="albums"></ul>');
|
|
||||||
for(var i=0;i<artist.albums.length;i++){
|
|
||||||
var li=template.clone();
|
|
||||||
var album=artist.albums[i];
|
|
||||||
li.removeClass('template');
|
|
||||||
li.addClass('album');
|
|
||||||
li.data('album',album);
|
|
||||||
li.data('type','album');
|
|
||||||
li.children('span').text(album.album_name);
|
|
||||||
Collection.addButtons(li);
|
|
||||||
ul.append(li);
|
|
||||||
}
|
|
||||||
artistLi.append(ul);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
showSongs:function(albumLi){
|
|
||||||
$('ul.songs').parent().removeClass('active');
|
|
||||||
$('ul.songs').remove();
|
|
||||||
var album=albumLi.data('album');
|
|
||||||
var template=Collection.parent.children('li.template');
|
|
||||||
var ul=$('<ul class="songs"></ul>');
|
|
||||||
for(var i=0;i<album.songs.length;i++){
|
|
||||||
var li=template.clone();
|
|
||||||
var song=album.songs[i];
|
|
||||||
li.removeClass('template');
|
|
||||||
li.addClass('song');
|
|
||||||
li.data('song',song);
|
|
||||||
li.data('type','song');
|
|
||||||
li.children('span').text(song.song_name);
|
|
||||||
Collection.addButtons(li);
|
|
||||||
ul.append(li);
|
|
||||||
}
|
|
||||||
albumLi.append(ul);
|
|
||||||
},
|
|
||||||
registerPlay:function(){
|
registerPlay:function(){
|
||||||
var item=PlayList.items[PlayList.current];
|
var item=PlayList.items[PlayList.current];
|
||||||
var song=Collection.findSong(item.artist,item.album,item.name);
|
var song=Collection.findSong(item.artist,item.album,item.name);
|
||||||
|
@ -198,14 +236,6 @@ Collection={
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
Collection.parent=$('#collection');
|
Collection.parent=$('#collection');
|
||||||
Collection.load();
|
Collection.load();
|
||||||
$('#collection li.artist>span').live('click',function(){
|
|
||||||
$(this).parent().toggleClass('active');
|
|
||||||
Collection.showAlbums($(this).parent());
|
|
||||||
});
|
|
||||||
$('#collection li.album>span').live('click',function(){
|
|
||||||
$(this).parent().toggleClass('active');
|
|
||||||
Collection.showSongs($(this).parent());
|
|
||||||
});
|
|
||||||
Collection.parent.hide();
|
Collection.parent.hide();
|
||||||
$('#scan input.start').click(function(){
|
$('#scan input.start').click(function(){
|
||||||
$('#scan input.start').hide();
|
$('#scan input.start').hide();
|
||||||
|
|
|
@ -1,23 +1,4 @@
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
//load the collection
|
|
||||||
$('#navigation a[href="#collection"]').click(function(){
|
|
||||||
$('#navigation li.subentry a.active').removeClass('active');
|
|
||||||
$(this).addClass('active');
|
|
||||||
PlayList.hide();
|
|
||||||
Collection.display();
|
|
||||||
});
|
|
||||||
$('#navigation a[href="#playlist"]').click(function(){
|
|
||||||
$('#navigation li.subentry a.active').removeClass('active');
|
|
||||||
$(this).addClass('active');
|
|
||||||
PlayList.render();
|
|
||||||
Collection.hide();
|
|
||||||
});
|
|
||||||
var tab=window.location.href.slice(window.location.href.indexOf('#') + 1);
|
|
||||||
PlayList.init('mp3',function(){
|
|
||||||
if(tab=='collection'){
|
|
||||||
$('#navigation a[href="#collection"]').trigger('click');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
OC.search.customResults.Music=function(row,item){
|
OC.search.customResults.Music=function(row,item){
|
||||||
var parts=item.link.substr(item.link.indexOf('#')+1).split('&');
|
var parts=item.link.substr(item.link.indexOf('#')+1).split('&');
|
||||||
var data={};
|
var data={};
|
||||||
|
@ -43,6 +24,7 @@ $(document).ready(function(){
|
||||||
});
|
});
|
||||||
row.find('div.name').append(button);
|
row.find('div.name').append(button);
|
||||||
}
|
}
|
||||||
|
Collection.display();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,19 +10,9 @@ PlayList.render=function(){
|
||||||
tr.removeClass('template');
|
tr.removeClass('template');
|
||||||
tr.data('name',item.name);
|
tr.data('name',item.name);
|
||||||
tr.data('artist',item.artist);
|
tr.data('artist',item.artist);
|
||||||
tr.data('album',item.album);
|
|
||||||
tr.data('time',item.length);
|
|
||||||
tr.data('plays',item.playcount);
|
|
||||||
tr.children('td.name').children('span').text(item.name);
|
tr.children('td.name').children('span').text(item.name);
|
||||||
tr.children('td.artist').text(item.artist);
|
tr.children('td.artist').text(item.artist);
|
||||||
tr.children('td.album').text(item.album);
|
tr.children('td.album').text(item.album);
|
||||||
var secconds=(item.length%60);
|
|
||||||
if(secconds<10){
|
|
||||||
secconds='0'+secconds;
|
|
||||||
}
|
|
||||||
var length=Math.floor(item.length/60)+':'+secconds;
|
|
||||||
tr.children('td.time').text(length);
|
|
||||||
tr.children('td.plays').text(item.playcount);
|
|
||||||
tr.data('index',i);
|
tr.data('index',i);
|
||||||
tr.click(function(){
|
tr.click(function(){
|
||||||
PlayList.play($(this).data('index'));
|
PlayList.play($(this).data('index'));
|
||||||
|
|
|
@ -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'];?>
|
<div id="controls">
|
||||||
<?php echo $_['collection'];?>
|
<ul class="jp-controls">
|
||||||
<?php echo $_['playlist'];?>
|
<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>
|
|
|
@ -36,4 +36,4 @@ $entry = array(
|
||||||
'href' => OC_Helper::linkTo( "user_ldap", "settings.php" ),
|
'href' => OC_Helper::linkTo( "user_ldap", "settings.php" ),
|
||||||
'name' => 'LDAP'
|
'name' => 'LDAP'
|
||||||
);
|
);
|
||||||
OC_App::addNavigationSubEntry( "core_users", $entry);
|
// OC_App::addNavigationSubEntry( "core_users", $entry);
|
||||||
|
|
|
@ -19,6 +19,8 @@ if(strpos($_SERVER["REQUEST_URI"],'?') and !strpos($_SERVER["REQUEST_URI"],'='))
|
||||||
OC_Util::addHeader('link',array('rel'=>'openid.server', 'href'=>$urlBase.OC_Helper::linkTo( "user_openid", "user.php" ).'/'.$userName));
|
OC_Util::addHeader('link',array('rel'=>'openid.server', 'href'=>$urlBase.OC_Helper::linkTo( "user_openid", "user.php" ).'/'.$userName));
|
||||||
OC_Util::addHeader('link',array('rel'=>'openid.delegate', 'href'=>$urlBase.OC_Helper::linkTo( "user_openid", "user.php" ).'/'.$userName));
|
OC_Util::addHeader('link',array('rel'=>'openid.delegate', 'href'=>$urlBase.OC_Helper::linkTo( "user_openid", "user.php" ).'/'.$userName));
|
||||||
|
|
||||||
|
OC_APP::registerPersonal('user_openid','settings');
|
||||||
|
|
||||||
require_once 'apps/user_openid/user_openid.php';
|
require_once 'apps/user_openid/user_openid.php';
|
||||||
|
|
||||||
//active the openid backend
|
//active the openid backend
|
||||||
|
|
|
@ -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>
|
|
@ -1,16 +1,34 @@
|
||||||
* { margin:0; padding:0; border:0; cursor:default; }
|
/* Copyright (c) 2011, Jan-Christoph Borchardt
|
||||||
body { background:#fefefe; font:normal 80%/1.6em "Lucida Grande", Arial, Verdana, sans-serif; color:#000; }
|
This file is licensed under the Affero General Public License version 3 or later.
|
||||||
#header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; box-shadow:0 0 10px #000, inset 0 -2px 10px #222; }
|
See the COPYING-README file. */
|
||||||
#body-settings #header { background:#313131; }
|
|
||||||
|
* { margin:0; padding:0; border:0; outline:0; cursor:default; }
|
||||||
|
body { background:#fefefe; font:normal 80%/1.6em "Lucida Grande", Arial, Verdana, sans-serif; color:#000; margin-bottom:2em; }
|
||||||
|
|
||||||
|
|
||||||
|
/* HEADERS */
|
||||||
|
#body-user #header, #body-settings #header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; box-shadow:0 0 10px #000, inset 0 -2px 10px #222; }
|
||||||
|
#body-login #header { margin:-2em auto 0; text-align:center; height:10em;
|
||||||
|
-moz-box-shadow:0 0 1em #000; -webkit-box-shadow:0 0 1em #000; box-shadow:0 0 1em #000;
|
||||||
|
background: #1d2d44; /* Old browsers */
|
||||||
|
background: -moz-linear-gradient(top, #35537a 0%, #1d2d42 100%); /* FF3.6+ */
|
||||||
|
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#35537a), color-stop(100%,#1d2d42)); /* Chrome,Safari4+ */
|
||||||
|
background: -webkit-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* Chrome10+,Safari5.1+ */
|
||||||
|
background: -o-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* Opera11.10+ */
|
||||||
|
background: -ms-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* IE10+ */
|
||||||
|
background: linear-gradient(top, #35537a 0%,#1d2d42 100%); /* W3C */
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', endColorstr='#1d2d42',GradientType=0 ); /* IE6-9 */ }
|
||||||
|
|
||||||
#owncloud { float:left; }
|
#owncloud { float:left; }
|
||||||
h1 { margin:1em 3em 1em 0; border-bottom:1px solid #666; text-transform:uppercase; font-weight:normal; font-style:italic; color:#666; }
|
h1 { margin:1em 3em 1em 0; border-bottom:1px solid #666; text-transform:uppercase; font-weight:normal; font-style:italic; color:#666; }
|
||||||
p.center { text-align:center; }
|
p.center { text-align:center; }
|
||||||
a { color:#000; text-decoration:none; outline:0; }
|
a { color:#000; text-decoration:none; }
|
||||||
table { white-space:nowrap; }
|
table { white-space:nowrap; }
|
||||||
input, select { background:#fff; color:#333; outline:0; }
|
|
||||||
a, a img, a strong, a span, input, button, select, li { cursor:pointer; }
|
a, a img, a strong, a span, input, button, select, li { cursor:pointer; }
|
||||||
input[type="text"], input[type="password"] { cursor:text; }
|
|
||||||
|
|
||||||
|
|
||||||
|
/* INPUTS */
|
||||||
|
input[type="text"], input[type="password"] { cursor:text; }
|
||||||
input, select { font-size:1em; width:10em; margin:.3em; padding:.5em; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #fff, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }
|
input, select { font-size:1em; width:10em; margin:.3em; padding:.5em; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #fff, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }
|
||||||
input[type="text"], input[type="password"] { background:#f8f8f8; color:#555; cursor:text; }
|
input[type="text"], input[type="password"] { background:#f8f8f8; color:#555; cursor:text; }
|
||||||
input[type="text"]:hover, input[type="text"]:focus, input[type="password"]:hover, input[type="password"]:focus { background:#fff; color:#333; }
|
input[type="text"]:hover, input[type="text"]:focus, input[type="password"]:hover, input[type="password"]:focus { background:#fff; color:#333; }
|
||||||
|
@ -22,47 +40,44 @@ input[type="checkbox"] { width:auto; }
|
||||||
#body-login input { font-size:1.5em; }
|
#body-login input { font-size:1.5em; }
|
||||||
#body-login input[type="submit"] { float:right; margin-right:.8em; }
|
#body-login input[type="submit"] { float:right; margin-right:.8em; }
|
||||||
#remember_login { margin:.8em .2em 0 1em; }
|
#remember_login { margin:.8em .2em 0 1em; }
|
||||||
form.searchbox input[type="search"] { position:fixed; font-size:1.2em; top:.3em; right:7em; padding:.2em .5em .2em 1.5em; background:#f8f8f8 url('../img/actions/search.png') .5em center no-repeat; border:0; -moz-border-radius:1em; -webkit-border-
|
form.searchbox input[type="search"] { position:fixed; font-size:1.2em; top:.4em; right:4em; padding:.2em .5em .2em 1.5em; background:#f8f8f8 url('../img/actions/search.png') .5em center no-repeat; border:0; -moz-border-radius:1em; -webkit-border-
|
||||||
radius:1em; border-radius:1em; }
|
radius:1em; border-radius:1em; }
|
||||||
input[type="submit"].enabled { background:#aea; -moz-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; }
|
input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; }
|
||||||
input[type="submit"].highlight{ background:#ffc100; border:1px solid #dda600; text-shadow:#ffeedd 0 1px 0; -moz-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; }
|
input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-shadow:#ffeedd 0 1px 0; -moz-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
form#user_settings { max-width:600px; }
|
form#user_settings { max-width:600px; }
|
||||||
form#user_settings p label { display:block; float:left; width:35%; padding:0.4em 0.5em 0 0; text-align:right; }
|
form#user_settings p label { display:block; float:left; width:35%; padding:0.4em 0.5em 0 0; text-align:right; }
|
||||||
form p { padding:0.5em 4em 0.5em 0.5em; text-align:left; }
|
form p { padding:0.5em 4em 0.5em 0.5em; text-align:left; }
|
||||||
form p.form_footer { margin:1em 0 0 0; text-align:right; }
|
form p.form_footer { margin:1em 0 0 0; text-align:right; }
|
||||||
form label { cursor:pointer; }
|
form label { cursor:pointer; }
|
||||||
fieldset { padding:1em; background-color:#f7f7f7; border:1px solid #ddd; max-width:600px; margin:2em; }
|
#body-settings fieldset { padding:1em; width:40em; margin:1em;
|
||||||
legend { padding:.5em; font-size:1.2em; }
|
border:1px solid #ddd; font-weight:bold; background:#f2f2f2; color:#555; text-shadow:#fff 0 1px 0; -moz-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em;}
|
||||||
|
legend { padding:.2em; font-size:1.2em; }
|
||||||
.template{display:none;}
|
.template{display:none;}
|
||||||
|
|
||||||
div.controls { width:100%; height:3em; margin:0; background-color:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:2; }
|
/* CONTENT ------------------------------------------------------------------ */
|
||||||
|
#controls { width:100%; top:3.5em; height:3em; margin:0; background-color:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:2; }
|
||||||
|
#content { margin:3.5em 0 0 12.5em; }
|
||||||
|
#body-settings #content { padding:1em; }
|
||||||
|
#leftcontent { position:absolute; top:6.5em; width:50em; }
|
||||||
|
#rightcontent { position:absolute; top:6.5em; left:32em; }
|
||||||
|
|
||||||
/* LOG IN & INSTALLATION ------------------------------------------------------------ */
|
/* LOG IN & INSTALLATION ------------------------------------------------------------ */
|
||||||
#body-login { background-color:#ddd; }
|
#body-login { background-color:#ddd; }
|
||||||
#body-login p.info { width:16em; margin:2em auto; padding:1em; background-color:#eee; -moz-box-shadow:0 1px 0 #bbb inset; -webkit-box-shadow:0 1px 0 #bbb inset; box-shadow:0 1px 0 #bbb inset; -moz-border-radius:1em; -webkit-border-radius:1em; border-radius:1em; }
|
#body-login p.info { width:16em; margin:2em auto; padding:1em; background-color:#eee; -moz-box-shadow:0 1px 0 #bbb inset; -webkit-box-shadow:0 1px 0 #bbb inset; box-shadow:0 1px 0 #bbb inset; -moz-border-radius:1em; -webkit-border-radius:1em; border-radius:1em; }
|
||||||
#body-login p.info a { font-weight:bold; }
|
#body-login p.info a { font-weight:bold; }
|
||||||
|
|
||||||
#body-login header { margin:-2em auto 0; text-align:center; height:10em;
|
|
||||||
-moz-box-shadow:0 0 1em #000; -webkit-box-shadow:0 0 1em #000; box-shadow:0 0 1em #000;
|
|
||||||
background: #1d2d44; /* Old browsers */
|
|
||||||
background: -moz-linear-gradient(top, #35537a 0%, #1d2d42 100%); /* FF3.6+ */
|
|
||||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#35537a), color-stop(100%,#1d2d42)); /* Chrome,Safari4+ */
|
|
||||||
background: -webkit-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* Chrome10+,Safari5.1+ */
|
|
||||||
background: -o-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* Opera11.10+ */
|
|
||||||
background: -ms-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* IE10+ */
|
|
||||||
background: linear-gradient(top, #35537a 0%,#1d2d42 100%); /* W3C */
|
|
||||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', endColorstr='#1d2d42',GradientType=0 ); /* IE6-9 */ }
|
|
||||||
|
|
||||||
#login { min-height:30em; margin:2em auto 0; border-bottom:1px solid #f8f8f8; background:#eee; }
|
#login { min-height:30em; margin:2em auto 0; border-bottom:1px solid #f8f8f8; background:#eee; }
|
||||||
#login form { width:18em; margin:2em auto 5em; padding:0; }
|
#login form { width:18em; margin:2em auto 5em; padding:0; }
|
||||||
#login form fieldset { background-color:transparent; border:0; margin:0; padding:0; }
|
#login form fieldset { background-color:transparent; border:0; margin-bottom:2em; padding:0; }
|
||||||
|
#login form fieldset legend { font-weight:bold; }
|
||||||
#login form p { position:relative; padding:0; }
|
#login form p { position:relative; padding:0; }
|
||||||
#login form label { position:absolute; margin:.8em .8em; font-size:1.5em; color:#666; }
|
#login form label { position:absolute; margin:.8em .8em; font-size:1.5em; color:#666; }
|
||||||
#login form input[type="checkbox"]+label { position:relative; margin:0; font-size:1em; text-shadow:#fff 0 1px 0; }
|
#login form input[type="checkbox"]+label { position:relative; margin:0; font-size:1em; text-shadow:#fff 0 1px 0; }
|
||||||
|
|
||||||
#login form #use_mysql { font-size:.9em; margin:0 0 0 1em; }
|
#login form ul.errors { background:#fed7d7; border:1px solid #f00; list-style-indent:inside; margin:0 0 4em 0; padding:1em 1em 1em 5em; }
|
||||||
#login form ul.errors { background:#fed7d7 url(images/no.png) no-repeat 1em 1em; border:1px solid #f00; font-size:1.2em; list-style-indent:inside; margin:0 0 4em 0; padding:1em 1em 1em 5em; }
|
|
||||||
|
|
||||||
/* META NAVIGATION (Settings, Log out) ---------------------------------------------------------------- */
|
/* META NAVIGATION (Settings, Log out) ---------------------------------------------------------------- */
|
||||||
#metanav { float:right; position:relative; top:.5em; right:1em; list-style:none; margin:0; padding:0; }
|
#metanav { float:right; position:relative; top:.5em; right:1em; list-style:none; margin:0; padding:0; }
|
||||||
|
@ -79,10 +94,8 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', end
|
||||||
#navigation .subentry { background-color:#ddd; border-top:1px solid #aaa; color:#555; }
|
#navigation .subentry { background-color:#ddd; border-top:1px solid #aaa; color:#555; }
|
||||||
#navigation .subentry.active { background-color:#bbb; border-top:1px solid #888; border-bottom:1px solid #bbb; }
|
#navigation .subentry.active { background-color:#bbb; border-top:1px solid #888; border-bottom:1px solid #bbb; }
|
||||||
#navigation .subentry a { padding-left:3.1em; font-size:1em; }
|
#navigation .subentry a { padding-left:3.1em; font-size:1em; }
|
||||||
|
#navigation #settings { position:absolute; bottom:3.5em; width:100%; }
|
||||||
/* CONTENT ------------------------------------------------------------------ */
|
#navigation #expand { margin:0 0 .2em 1.2em; cursor:pointer; }
|
||||||
#content { margin:3.5em 0 0 12.5em; }
|
|
||||||
#body-settings #content { padding:1em; }
|
|
||||||
|
|
||||||
/* USER SETTINGS ------------------------------------------------------------ */
|
/* USER SETTINGS ------------------------------------------------------------ */
|
||||||
#quota_indicator { margin:0 4em 1em 0; padding:0; border:1px solid #ddd; border-radius:10px; -webkit-border-radius:10px; -moz-border-radius:10px; }
|
#quota_indicator { margin:0 4em 1em 0; padding:0; border:1px solid #ddd; border-radius:10px; -webkit-border-radius:10px; -moz-border-radius:10px; }
|
||||||
|
|
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 |
|
@ -15,8 +15,8 @@
|
||||||
height="16"
|
height="16"
|
||||||
id="svg2457"
|
id="svg2457"
|
||||||
inkscape:version="0.48.1 r9760"
|
inkscape:version="0.48.1 r9760"
|
||||||
sodipodi:docname="bonobo-component-browser.svg"
|
sodipodi:docname="settings.svg"
|
||||||
inkscape:export-filename="/home/jancborchardt/SparkleShare/playground/ownCloud/elementaryicons/elementary-icon-theme/elementary/actions/16/bonobo-component-browser.png"
|
inkscape:export-filename="/home/jancborchardt/owncloud-sharing/core/img/actions/settings.png"
|
||||||
inkscape:export-xdpi="90"
|
inkscape:export-xdpi="90"
|
||||||
inkscape:export-ydpi="90">
|
inkscape:export-ydpi="90">
|
||||||
<metadata
|
<metadata
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
id="namedview21"
|
id="namedview21"
|
||||||
showgrid="false"
|
showgrid="false"
|
||||||
inkscape:zoom="17.875"
|
inkscape:zoom="17.875"
|
||||||
inkscape:cx="-2.3776224"
|
inkscape:cx="-0.41568268"
|
||||||
inkscape:cy="1.2867133"
|
inkscape:cy="1.2867133"
|
||||||
inkscape:window-x="0"
|
inkscape:window-x="0"
|
||||||
inkscape:window-y="24"
|
inkscape:window-y="24"
|
||||||
|
@ -188,32 +188,81 @@
|
||||||
</linearGradient>
|
</linearGradient>
|
||||||
<linearGradient
|
<linearGradient
|
||||||
inkscape:collect="always"
|
inkscape:collect="always"
|
||||||
xlink:href="#linearGradient3678"
|
xlink:href="#linearGradient3587-6-5-3-5-7"
|
||||||
id="linearGradient3959"
|
id="linearGradient3784"
|
||||||
|
x1="0.5"
|
||||||
|
y1="7.5560002"
|
||||||
|
x2="15.5"
|
||||||
|
y2="7.5560002"
|
||||||
|
gradientUnits="userSpaceOnUse" />
|
||||||
|
<linearGradient
|
||||||
|
x1="46.395508"
|
||||||
|
y1="12.707516"
|
||||||
|
x2="46.395508"
|
||||||
|
y2="38.409042"
|
||||||
|
id="linearGradient3795-2"
|
||||||
|
xlink:href="#linearGradient3587-6-5-3-5-7"
|
||||||
gradientUnits="userSpaceOnUse"
|
gradientUnits="userSpaceOnUse"
|
||||||
gradientTransform="translate(-17.058189,-0.444)"
|
gradientTransform="matrix(-0.4100229,0,0,0.5447147,28.02322,-5.9219706)" />
|
||||||
x1="25"
|
<linearGradient
|
||||||
y1="0"
|
id="linearGradient3587-6-5-3-5-7">
|
||||||
x2="25"
|
<stop
|
||||||
y2="16.000105" />
|
id="stop3589-9-2-2-6-2"
|
||||||
|
style="stop-color:#000000;stop-opacity:1"
|
||||||
|
offset="0" />
|
||||||
|
<stop
|
||||||
|
id="stop3591-7-4-73-5-1"
|
||||||
|
style="stop-color:#363636;stop-opacity:1"
|
||||||
|
offset="1" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3587-6-5-3-5-7"
|
||||||
|
id="linearGradient3810"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="matrix(-0.4100229,0,0,0.5447147,28.02322,-5.9219706)"
|
||||||
|
x1="46.395508"
|
||||||
|
y1="12.707516"
|
||||||
|
x2="46.395508"
|
||||||
|
y2="38.409042" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3587-6-5-3-5-7"
|
||||||
|
id="linearGradient3813"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="matrix(-0.4100229,0,0,0.5447147,10.462268,-5.974418)"
|
||||||
|
x1="46.395508"
|
||||||
|
y1="12.707516"
|
||||||
|
x2="46.395508"
|
||||||
|
y2="38.409042" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3587-6-5-3-5-7"
|
||||||
|
id="linearGradient3816"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x1="7.4930072"
|
||||||
|
y1="0.0035526801"
|
||||||
|
x2="7.4930072"
|
||||||
|
y2="14.998127" />
|
||||||
</defs>
|
</defs>
|
||||||
<g
|
<g
|
||||||
transform="translate(0.027972,0.944)"
|
transform="translate(0.027972,0.944)"
|
||||||
id="g2479-3"
|
id="g2479-3"
|
||||||
style="opacity:0.5;fill:#000000;fill-opacity:1">
|
style="opacity:0.6;fill:#ffffff;fill-opacity:1">
|
||||||
<path
|
<path
|
||||||
inkscape:connector-curvature="0"
|
inkscape:connector-curvature="0"
|
||||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:block;overflow:visible;enable-background:accumulate"
|
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994000000003;marker:none;visibility:visible;display:block;overflow:visible;enable-background:accumulate"
|
||||||
id="path2426-2"
|
id="path2426-2"
|
||||||
d="M 6.9375,0.056 C 6.6890831,0.056 6.5,0.245082 6.5,0.4935 l 0,1.25 C 5.9460971,1.885701 5.448836,2.115378 4.96875,2.39975 L 4.0625,1.4935 c -0.1756569,-0.175658 -0.449342,-0.175658 -0.625,0 l -1.5,1.5 c -0.175657,0.175658 -0.175657,0.449342 0,0.625 L 2.84375,4.52475 C 2.5593789,5.004836 2.329701,5.502097 2.1875,6.056 l -1.25,0 C 0.68908301,6.056 0.5,6.245082 0.5,6.4935 l 0,2.125 c 1e-8,0.248418 0.189083,0.4375 0.4375,0.4375 l 1.25,0 c 0.1422009,0.553903 0.371879,1.051164 0.65625,1.53125 L 1.9375,11.4935 c -0.175657,0.175658 -0.175657,0.449342 0,0.625 l 1.5,1.5 c 0.1756579,0.175658 0.449342,0.175658 0.625,0 L 4.96875,12.71225 C 5.4488361,12.996622 5.946097,13.2263 6.5,13.3685 l 0,1.25 c 1e-7,0.248418 0.189083,0.4375 0.4375,0.4375 l 2.125,0 C 9.3109176,15.056 9.5,14.866918 9.5,14.6185 l 0,-1.25 c 0.553903,-0.1422 1.051164,-0.371878 1.53125,-0.65625 l 0.90625,0.90625 c 0.175658,0.175658 0.449342,0.175658 0.625,0 l 1.5,-1.5 c 0.175658,-0.175658 0.175658,-0.449342 0,-0.625 L 13.15625,10.58725 C 13.440622,10.107164 13.6703,9.609903 13.8125,9.056 l 1.25,0 C 15.310918,9.056 15.5,8.866917 15.5,8.6185 l 0,-2.125 C 15.5,6.245082 15.310917,6.056 15.0625,6.056 l -1.25,0 C 13.6703,5.502097 13.440622,5.004836 13.15625,4.52475 L 14.0625,3.6185 c 0.175658,-0.175658 0.175658,-0.449342 0,-0.625 l -1.5,-1.5 c -0.175658,-0.175658 -0.449342,-0.175658 -0.625,0 L 11.03125,2.39975 C 10.551164,2.115378 10.053903,1.885701 9.5,1.7435 l 0,-1.25 C 9.4999996,0.245082 9.310918,0.056 9.0625,0.056 z M 8,4.2133427 c 1.8451469,0 3.342657,1.4975104 3.342657,3.3426573 0,1.8451469 -1.4975101,3.342657 -3.342657,3.342657 C 6.1548531,10.898657 4.6573427,9.4011469 4.6573427,7.556 4.6573427,5.7108531 6.1548531,4.2133427 8,4.2133427 z"
|
d="M 6.9375,0.056 C 6.6890831,0.056 6.5,0.245082 6.5,0.4935 l 0,1.25 C 5.9460971,1.885701 5.448836,2.115378 4.96875,2.39975 L 4.0625,1.4935 c -0.1756569,-0.175658 -0.449342,-0.175658 -0.625,0 l -1.5,1.5 c -0.175657,0.175658 -0.175657,0.449342 0,0.625 L 2.84375,4.52475 C 2.5593789,5.004836 2.329701,5.502097 2.1875,6.056 l -1.25,0 C 0.68908301,6.056 0.5,6.245082 0.5,6.4935 l 0,2.125 c 1e-8,0.248418 0.189083,0.4375 0.4375,0.4375 l 1.25,0 c 0.1422009,0.553903 0.371879,1.051164 0.65625,1.53125 L 1.9375,11.4935 c -0.175657,0.175658 -0.175657,0.449342 0,0.625 l 1.5,1.5 c 0.1756579,0.175658 0.449342,0.175658 0.625,0 L 4.96875,12.71225 C 5.4488361,12.996622 5.946097,13.2263 6.5,13.3685 l 0,1.25 c 1e-7,0.248418 0.189083,0.4375 0.4375,0.4375 l 2.125,0 C 9.3109176,15.056 9.5,14.866918 9.5,14.6185 l 0,-1.25 c 0.553903,-0.1422 1.051164,-0.371878 1.53125,-0.65625 l 0.90625,0.90625 c 0.175658,0.175658 0.449342,0.175658 0.625,0 l 1.5,-1.5 c 0.175658,-0.175658 0.175658,-0.449342 0,-0.625 L 13.15625,10.58725 C 13.440622,10.107164 13.6703,9.609903 13.8125,9.056 l 1.25,0 C 15.310918,9.056 15.5,8.866917 15.5,8.6185 l 0,-2.125 C 15.5,6.245082 15.310917,6.056 15.0625,6.056 l -1.25,0 C 13.6703,5.502097 13.440622,5.004836 13.15625,4.52475 L 14.0625,3.6185 c 0.175658,-0.175658 0.175658,-0.449342 0,-0.625 l -1.5,-1.5 c -0.175658,-0.175658 -0.449342,-0.175658 -0.625,0 L 11.03125,2.39975 C 10.551164,2.115378 10.053903,1.885701 9.5,1.7435 l 0,-1.25 C 9.4999996,0.245082 9.310918,0.056 9.0625,0.056 z M 8,4.2133427 c 1.8451469,0 3.342657,1.4975104 3.342657,3.3426573 0,1.8451469 -1.4975101,3.342657 -3.342657,3.342657 C 6.1548531,10.898657 4.6573427,9.4011469 4.6573427,7.556 4.6573427,5.7108531 6.1548531,4.2133427 8,4.2133427 z"
|
||||||
sodipodi:nodetypes="ssccssssccssssccssssccssssccssssccssssccssssccssssssss" />
|
sodipodi:nodetypes="ssccssssccssssccssssccssssccssssccssssccssssccssssssss" />
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g
|
||||||
id="g2479"
|
id="g2479"
|
||||||
transform="translate(0,-0.056)">
|
transform="translate(0,-0.056)"
|
||||||
|
style="fill-opacity:1;fill:url(#linearGradient3784);opacity:0.7">
|
||||||
<path
|
<path
|
||||||
inkscape:connector-curvature="0"
|
inkscape:connector-curvature="0"
|
||||||
style="fill:url(#linearGradient3959);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:block;overflow:visible;enable-background:accumulate"
|
style="fill:url(#linearGradient3816);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994000000003;marker:none;visibility:visible;display:block;overflow:visible;enable-background:accumulate"
|
||||||
id="path2426"
|
id="path2426"
|
||||||
d="M 6.9375,0.056 C 6.6890831,0.056 6.5,0.245082 6.5,0.4935 l 0,1.25 C 5.9460971,1.885701 5.448836,2.115378 4.96875,2.39975 L 4.0625,1.4935 c -0.1756569,-0.175658 -0.449342,-0.175658 -0.625,0 l -1.5,1.5 c -0.175657,0.175658 -0.175657,0.449342 0,0.625 L 2.84375,4.52475 C 2.5593789,5.004836 2.329701,5.502097 2.1875,6.056 l -1.25,0 C 0.68908301,6.056 0.5,6.245082 0.5,6.4935 l 0,2.125 c 1e-8,0.248418 0.189083,0.4375 0.4375,0.4375 l 1.25,0 c 0.1422009,0.553903 0.371879,1.051164 0.65625,1.53125 L 1.9375,11.4935 c -0.175657,0.175658 -0.175657,0.449342 0,0.625 l 1.5,1.5 c 0.1756579,0.175658 0.449342,0.175658 0.625,0 L 4.96875,12.71225 C 5.4488361,12.996622 5.946097,13.2263 6.5,13.3685 l 0,1.25 c 1e-7,0.248418 0.189083,0.4375 0.4375,0.4375 l 2.125,0 C 9.3109176,15.056 9.5,14.866918 9.5,14.6185 l 0,-1.25 c 0.553903,-0.1422 1.051164,-0.371878 1.53125,-0.65625 l 0.90625,0.90625 c 0.175658,0.175658 0.449342,0.175658 0.625,0 l 1.5,-1.5 c 0.175658,-0.175658 0.175658,-0.449342 0,-0.625 L 13.15625,10.58725 C 13.440622,10.107164 13.6703,9.609903 13.8125,9.056 l 1.25,0 C 15.310918,9.056 15.5,8.866917 15.5,8.6185 l 0,-2.125 C 15.5,6.245082 15.310917,6.056 15.0625,6.056 l -1.25,0 C 13.6703,5.502097 13.440622,5.004836 13.15625,4.52475 L 14.0625,3.6185 c 0.175658,-0.175658 0.175658,-0.449342 0,-0.625 l -1.5,-1.5 c -0.175658,-0.175658 -0.449342,-0.175658 -0.625,0 L 11.03125,2.39975 C 10.551164,2.115378 10.053903,1.885701 9.5,1.7435 l 0,-1.25 C 9.4999996,0.245082 9.310918,0.056 9.0625,0.056 z M 8,4.2133427 c 1.8451469,0 3.342657,1.4975104 3.342657,3.3426573 0,1.8451469 -1.4975101,3.342657 -3.342657,3.342657 C 6.1548531,10.898657 4.6573427,9.4011469 4.6573427,7.556 4.6573427,5.7108531 6.1548531,4.2133427 8,4.2133427 z"
|
d="M 6.9375,0.056 C 6.6890831,0.056 6.5,0.245082 6.5,0.4935 l 0,1.25 C 5.9460971,1.885701 5.448836,2.115378 4.96875,2.39975 L 4.0625,1.4935 c -0.1756569,-0.175658 -0.449342,-0.175658 -0.625,0 l -1.5,1.5 c -0.175657,0.175658 -0.175657,0.449342 0,0.625 L 2.84375,4.52475 C 2.5593789,5.004836 2.329701,5.502097 2.1875,6.056 l -1.25,0 C 0.68908301,6.056 0.5,6.245082 0.5,6.4935 l 0,2.125 c 1e-8,0.248418 0.189083,0.4375 0.4375,0.4375 l 1.25,0 c 0.1422009,0.553903 0.371879,1.051164 0.65625,1.53125 L 1.9375,11.4935 c -0.175657,0.175658 -0.175657,0.449342 0,0.625 l 1.5,1.5 c 0.1756579,0.175658 0.449342,0.175658 0.625,0 L 4.96875,12.71225 C 5.4488361,12.996622 5.946097,13.2263 6.5,13.3685 l 0,1.25 c 1e-7,0.248418 0.189083,0.4375 0.4375,0.4375 l 2.125,0 C 9.3109176,15.056 9.5,14.866918 9.5,14.6185 l 0,-1.25 c 0.553903,-0.1422 1.051164,-0.371878 1.53125,-0.65625 l 0.90625,0.90625 c 0.175658,0.175658 0.449342,0.175658 0.625,0 l 1.5,-1.5 c 0.175658,-0.175658 0.175658,-0.449342 0,-0.625 L 13.15625,10.58725 C 13.440622,10.107164 13.6703,9.609903 13.8125,9.056 l 1.25,0 C 15.310918,9.056 15.5,8.866917 15.5,8.6185 l 0,-2.125 C 15.5,6.245082 15.310917,6.056 15.0625,6.056 l -1.25,0 C 13.6703,5.502097 13.440622,5.004836 13.15625,4.52475 L 14.0625,3.6185 c 0.175658,-0.175658 0.175658,-0.449342 0,-0.625 l -1.5,-1.5 c -0.175658,-0.175658 -0.449342,-0.175658 -0.625,0 L 11.03125,2.39975 C 10.551164,2.115378 10.053903,1.885701 9.5,1.7435 l 0,-1.25 C 9.4999996,0.245082 9.310918,0.056 9.0625,0.056 z M 8,4.2133427 c 1.8451469,0 3.342657,1.4975104 3.342657,3.3426573 0,1.8451469 -1.4975101,3.342657 -3.342657,3.342657 C 6.1548531,10.898657 4.6573427,9.4011469 4.6573427,7.556 4.6573427,5.7108531 6.1548531,4.2133427 8,4.2133427 z"
|
||||||
sodipodi:nodetypes="ssccssssccssssccssssccssssccssssccssssccssssccssssssss" />
|
sodipodi:nodetypes="ssccssssccssssccssssccssssccssssccssssccssssccssssssss" />
|
||||||
|
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 11 KiB |
|
@ -27,7 +27,8 @@ t.cache={};
|
||||||
|
|
||||||
OC={
|
OC={
|
||||||
webroot:oc_webroot,
|
webroot:oc_webroot,
|
||||||
coreApps:['files','admin','log','search','settings','core'],
|
currentUser:oc_current_user,
|
||||||
|
coreApps:['files','admin','log','search','settings','core','3rdparty'],
|
||||||
/**
|
/**
|
||||||
* get an absolute url to a file in an appen
|
* get an absolute url to a file in an appen
|
||||||
* @param app the id of the app the file belongs to
|
* @param app the id of the app the file belongs to
|
||||||
|
@ -264,6 +265,12 @@ $(document).ready(function(){
|
||||||
$('#remember_login+label').fadeIn();
|
$('#remember_login+label').fadeIn();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if($('body').attr("id")=="body-user") { $('#settings li').hide(); }
|
||||||
|
$('#expand').click(function() {
|
||||||
|
$('#settings li').slideToggle();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,32 +1,20 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Hide the MySQL config div if needed :
|
|
||||||
if(!$('#mysql').is(':checked')) {
|
|
||||||
$('#use_mysql').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hide the PostgreSQL config div if needed:
|
|
||||||
if(!$('#pgsql').is(':checked')) {
|
|
||||||
$('#use_postgresql').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#datadirField').hide(250);
|
$('#datadirField').hide(250);
|
||||||
if($('#hasSQLite').val()=='true'){
|
if($('#hasSQLite').val()=='true'){
|
||||||
$('#databaseField').hide(250);
|
$('#databaseField').hide(250);
|
||||||
|
$('#use_other_db').slideUp(250);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#sqlite').click(function() {
|
$('#sqlite').click(function() {
|
||||||
$('#use_mysql').slideUp(250);
|
$('#use_other_db').slideUp(250);
|
||||||
$('#use_postgresql').slideUp(250);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#mysql').click(function() {
|
$('#mysql').click(function() {
|
||||||
$('#use_mysql').slideDown(250);
|
$('#use_other_db').slideDown(250);
|
||||||
$('#use_postgresql').slideUp(250);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#pgsql').click(function() {
|
$('#pgsql').click(function() {
|
||||||
$('#use_postgresql').slideDown(250);
|
$('#use_other_db').slideDown(250);
|
||||||
$('#use_mysql').slideUp(250);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#showAdvanced').click(function() {
|
$('#showAdvanced').click(function() {
|
||||||
|
|
|
@ -7,12 +7,9 @@ if(!isset($_)){//also provide standalone error page
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div id="login">
|
<ul>
|
||||||
<header><img src="<?php echo image_path('', 'weather-clear.png'); ?>" alt="ownCloud" /></header>
|
|
||||||
<ul>
|
|
||||||
<li class='error'>
|
<li class='error'>
|
||||||
<?php echo $l->t( 'Error 404, Cloud not found' ); ?><br/>
|
<?php echo $l->t( 'Cloud not found' ); ?><br/>
|
||||||
<p class='hint'><?php if(isset($_['file'])) echo $_['file']?></p>
|
<p class='hint'><?php if(isset($_['file'])) echo $_['file']?></p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
<div id="login">
|
<ul>
|
||||||
<header><img src="<?php echo image_path('', 'owncloud-logo-medium-white.png'); ?>" alt="ownCloud" /></header>
|
|
||||||
<ul>
|
|
||||||
<?php foreach($_["errors"] as $error):?>
|
<?php foreach($_["errors"] as $error):?>
|
||||||
<li class='error'>
|
<li class='error'>
|
||||||
<?php echo $error['error'] ?><br/>
|
<?php echo $error['error'] ?><br/>
|
||||||
<p class='hint'><?php if(isset($error['hint']))echo $error['hint'] ?></p>
|
<p class='hint'><?php if(isset($error['hint']))echo $error['hint'] ?></p>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
<div id="login">
|
<form action="index.php" method="post">
|
||||||
<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" />
|
<input type="hidden" name="install" value="true" />
|
||||||
<?php if(count($_['errors']) > 0): ?>
|
<?php if(count($_['errors']) > 0): ?>
|
||||||
<ul class="errors">
|
<ul class="errors">
|
||||||
<?php foreach($_['errors'] as $err): ?>
|
<?php foreach($_['errors'] as $err): ?>
|
||||||
|
@ -20,22 +18,16 @@
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><?php echo $l->t( 'Create an <strong>admin account</strong>' ); ?></legend>
|
<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="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' ); ?>" /></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>
|
|
||||||
|
|
||||||
<a id='showAdvanced'><strong><?php echo $l->t( 'Advanced' ); ?> ▾</strong></a>
|
|
||||||
|
|
||||||
<fieldset id='datadirField'>
|
|
||||||
<legend><?php echo $l->t( 'Set data folder' ); ?></legend>
|
|
||||||
<input type="text" name="directory" id="directory" value="<?php print OC_Helper::init_var('directory', $_['directory']); ?>" placeholder="<?php echo $l->t( 'Data folder' ); ?>" /></p>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset id='databaseField'>
|
<fieldset id='databaseField'>
|
||||||
|
<?php if($_['hasMySQL'] or $_['hasPostgreSQL']) $hasOtherDB = true; //other than SQLite ?>
|
||||||
<legend><?php echo $l->t( 'Configure the database' ); ?></legend>
|
<legend><?php echo $l->t( 'Configure the database' ); ?></legend>
|
||||||
<?php if($_['hasSQLite']): ?>
|
<?php if($_['hasSQLite']): ?>
|
||||||
<input type='hidden' id='hasSQLite' value='true'/>
|
<input type='hidden' id='hasSQLite' value='true' />
|
||||||
<?php if(!$_['hasMySQL'] and !$_['hasPostgreSQL']): ?>
|
<?php if(!$hasOtherDB): ?>
|
||||||
<p><?php echo $l->t( 'SQLite will be used.' ); ?></p>
|
<p><?php echo $l->t( 'SQLite will be used.' ); ?></p>
|
||||||
<input type="hidden" id="dbtype" name="dbtype" value="sqlite" />
|
<input type="hidden" id="dbtype" name="dbtype" value="sqlite" />
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
|
@ -51,35 +43,36 @@
|
||||||
<?php else: ?>
|
<?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'); ?>/>
|
<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; ?>
|
||||||
<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; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if($_['hasPostgreSQL']): ?>
|
<?php if($_['hasPostgreSQL']): ?>
|
||||||
<input type='hidden' id='hasPostgreSQL' value='true'/>
|
<?php if(!$_['hasSQLite'] and !$_['hasMySQL']): ?>
|
||||||
<?php if(!$_['hasSQLite'] and !$_['hasSQLite']): ?>
|
|
||||||
<p><?php echo $l->t( 'PostgreSQL will be used.' ); ?></p>
|
<p><?php echo $l->t( 'PostgreSQL will be used.' ); ?></p>
|
||||||
<input type="hidden" id="dbtype" name="dbtype" value="pgsql" />
|
<input type="hidden" id="dbtype" name="dbtype" value="pgsql" />
|
||||||
<?php else: ?>
|
<?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>
|
<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; ?>
|
||||||
<div id="use_postgresql">
|
<?php endif; ?>
|
||||||
<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' ); ?>" />
|
<?php if($hasOtherDB): ?>
|
||||||
<input type="text" name="pg_dbname" id="pg_dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" placeholder="<?php echo $l->t( 'Database name' ); ?>" />
|
<div id="use_other_db">
|
||||||
<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="dbuser" id="dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" placeholder="<?php echo $l->t( 'Database user' ); ?>" required />
|
||||||
<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' ); ?>" />
|
<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>
|
</div>
|
||||||
<?php endif; ?>
|
<?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>
|
</fieldset>
|
||||||
|
|
||||||
<input type="submit" value="<?php echo $l->t( 'Finish setup' ); ?>" />
|
<input type="submit" value="<?php echo $l->t( 'Finish setup' ); ?>" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
|
|
|
@ -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>
|
|
|
@ -29,7 +29,12 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="body-login">
|
<body id="body-login">
|
||||||
|
<div id="login">
|
||||||
|
<header><div id="header">
|
||||||
|
<img src="<?php echo image_path('', 'owncloud-logo-medium-white.png'); ?>" alt="ownCloud" />
|
||||||
|
</div></header>
|
||||||
<?php echo $_['content']; ?>
|
<?php echo $_['content']; ?>
|
||||||
<p class="info"><?php echo $l->t( '<a href="http://owncloud.org/">ownCloud</a> is a personal cloud which runs on your own server.</p>' ); ?>
|
</div>
|
||||||
|
<footer><p class="info"><?php echo $l->t( '<a href="http://owncloud.org/">ownCloud</a> is a personal cloud which runs on your own server.</p>' ); ?></p></footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -27,19 +27,17 @@
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="body-user">
|
<body id="<?php echo $_['bodyid'];?>">
|
||||||
<div id="header">
|
<header><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>
|
<a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img src="<?php echo image_path('', 'owncloud-logo-small-white.png'); ?>" alt="ownCloud" /></a>
|
||||||
<?php echo $_['searchbox']?>
|
<?php echo $_['searchbox']?>
|
||||||
<ul id="metanav">
|
<ul id="metanav">
|
||||||
<li><a href="<?php echo link_to('settings', 'index.php'); ?>" title="Settings"><img class='svg' src="<?php echo image_path('', 'actions/settings.svg'); ?>"></a></li>
|
<li><a href="<?php echo link_to('', 'index.php'); ?>?logout=true" title="Log out"><img class='svg' src="<?php echo image_path('', 'actions/logout.svg'); ?>" /></a></li>
|
||||||
<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>
|
</ul>
|
||||||
</div>
|
</div></header>
|
||||||
|
|
||||||
<div id="main">
|
<nav><div id="navigation">
|
||||||
<div id="navigation">
|
<ul id="apps">
|
||||||
<ul>
|
|
||||||
<?php foreach($_['navigation'] as $entry): ?>
|
<?php foreach($_['navigation'] as $entry): ?>
|
||||||
<li><a style="background-image:url(<?php echo $entry['icon']; ?>)" href="<?php echo $entry['href']; ?>" title="" <?php if( $entry['active'] ): ?> class="active"<?php endif; ?>><?php echo $entry['name']; ?></a>
|
<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"] )): ?>
|
<?php if( sizeof( $entry["subnavigation"] )): ?>
|
||||||
|
@ -52,10 +50,21 @@
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
<ul id="settings">
|
||||||
|
<img id="expand" class='svg' src="<?php echo image_path('', 'actions/settings.svg'); ?>" />
|
||||||
|
<?php foreach($_['settingsnavigation'] as $entry):?>
|
||||||
|
<li><a style="background-image:url(<?php echo $entry['icon']; ?>)" href="<?php echo $entry['href']; ?>" title="" <?php if( $entry["active"] ): ?> class="active"<?php endif; ?>><?php echo $entry['name'] ?></a></li>
|
||||||
|
<?php if( sizeof( $entry["subnavigation"] )): ?>
|
||||||
|
<?php foreach($entry["subnavigation"] as $subentry):?>
|
||||||
|
<li><a href="<?php echo $subentry['href']; ?>" title="" <?php if( $subentry['active'] ): ?>class="active"<?php endif; ?>><?php echo $subentry['name'] ?></a></li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
</div></nav>
|
||||||
|
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<?php echo $_['content']; ?>
|
<?php echo $_['content']; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
<div id="login">
|
<form action="index.php" method="post">
|
||||||
<header>
|
|
||||||
<img src="<?php echo image_path('', 'owncloud-logo-medium-white.png'); ?>" alt="ownCloud" />
|
|
||||||
</header>
|
|
||||||
<form action="index.php" method="post">
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<?php if($_['error']): ?>
|
<?php if($_['error']): ?>
|
||||||
<?php echo $l->t( 'Login failed!' ); ?>
|
<?php echo $l->t( 'Login failed!' ); ?>
|
||||||
|
@ -18,6 +14,4 @@
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<input type="submit" id="submit" value="Log in" />
|
<input type="submit" id="submit" value="Log in" />
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ if(isset($_POST['maxUploadSize'])){
|
||||||
|
|
||||||
OC_App::setActiveNavigationEntry( "files_administration" );
|
OC_App::setActiveNavigationEntry( "files_administration" );
|
||||||
// return template
|
// return template
|
||||||
$tmpl = new OC_Template( "files", "admin", "admin" );
|
$tmpl = new OC_Template( "files", "admin", "user" );
|
||||||
$tmpl->assign( 'htaccessWorking', $htaccessWorking );
|
$tmpl->assign( 'htaccessWorking', $htaccessWorking );
|
||||||
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
|
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
|
||||||
$tmpl->printPage();
|
$tmpl->printPage();
|
||||||
|
|
|
@ -3,10 +3,5 @@
|
||||||
OC_App::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
|
OC_App::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
|
||||||
|
|
||||||
OC_App::addNavigationEntry( array( "id" => "files_index", "order" => 1, "href" => OC_Helper::linkTo( "files", "index.php" ), "icon" => OC_Helper::imagePath( "files", "home.png" ), "name" => "Files" ));
|
OC_App::addNavigationEntry( array( "id" => "files_index", "order" => 1, "href" => OC_Helper::linkTo( "files", "index.php" ), "icon" => OC_Helper::imagePath( "files", "home.png" ), "name" => "Files" ));
|
||||||
OC_App::addAdminPage( array( "id" => "files_administration", "order" => 3, "href" => OC_Helper::linkTo( "files", "admin.php" ), "name" => "Files", "icon" => OC_Helper::imagePath( "files", "folder.png" )));
|
|
||||||
|
|
||||||
|
|
||||||
// To add navigation sub entries use
|
|
||||||
// OC_App::addNavigationSubEntry( "files_index", array( ... ));
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
.file_upload_wrapper { background:url("../img/file.png"); font-weight:bold; position:relative; top:-1.2em; left:-2em; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; width:8em; }
|
.file_upload_wrapper { background:url("../img/file.png"); font-weight:bold; position:relative; top:-1.2em; left:-2em; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; width:8em; }
|
||||||
.file_upload_start { opacity:0; filter:alpha(opacity=0); }
|
.file_upload_start { opacity:0; filter:alpha(opacity=0); }
|
||||||
|
|
||||||
#file_newfolder_name { background-image:url("../img/folder.png"); font-weight:bold; width:12em; }
|
#file_newfolder_name { background-image:url("../img/folder.png"); font-weight:bold; width:8em; }
|
||||||
.file_upload_start, .file_upload_filename { position:absolute; top:0; left:0; font-size:1em; }
|
.file_upload_start, .file_upload_filename { position:absolute; top:0; left:0; font-size:1em; }
|
||||||
#file_newfolder_submit, #file_upload_submit { width:3em; }
|
#file_newfolder_submit, #file_upload_submit { width:3em; }
|
||||||
.file_upload_target { display:none; }
|
.file_upload_target { display:none; }
|
||||||
|
|
|
@ -113,7 +113,7 @@ FileList={
|
||||||
var tr=$('tr[data-file="'+name+'"]');
|
var tr=$('tr[data-file="'+name+'"]');
|
||||||
tr.data('renaming',true);
|
tr.data('renaming',true);
|
||||||
var td=tr.children('td.filename');
|
var td=tr.children('td.filename');
|
||||||
var input=$('<input value='+name+' class="filename"></input>');
|
var input=$('<input value="'+name+'" class="filename"></input>');
|
||||||
var form=$('<form action="#"></form>')
|
var form=$('<form action="#"></form>')
|
||||||
form.append(input);
|
form.append(input);
|
||||||
td.children('a.name').text('');
|
td.children('a.name').text('');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="controls">
|
<div id="controls">
|
||||||
<span class="nav">
|
<span class="nav">
|
||||||
<?php echo($_['breadcrumb']); ?>
|
<?php echo($_['breadcrumb']); ?>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -2,13 +2,4 @@
|
||||||
|
|
||||||
OC_App::register( array( "order" => 1, "id" => "help", "name" => "Help" ));
|
OC_App::register( array( "order" => 1, "id" => "help", "name" => "Help" ));
|
||||||
|
|
||||||
// Workaround for having help as the last entry always
|
|
||||||
$entry = array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "help", "index.php" ), "name" => "Help", "icon" => OC_Helper::imagePath( "help", "help.png" ));
|
|
||||||
if( isset( $_SESSION["user_id"] ) && OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
|
|
||||||
OC_App::addAdminPage( $entry );
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
OC_App::addSettingsPage( $entry );
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -6,3 +6,5 @@ table td.selection, table th.selection, table td.fileaction { width:2em; text-al
|
||||||
table td.name a { padding:6px; text-decoration:none; color:#555555; }
|
table td.name a { padding:6px; text-decoration:none; color:#555555; }
|
||||||
.type { text-decoration:none; color:#888888; font-size:.8em; }
|
.type { text-decoration:none; color:#888888; font-size:.8em; }
|
||||||
.description { text-decoration:none; color:#666666; font-size:.9em; }
|
.description { text-decoration:none; color:#666666; font-size:.9em; }
|
||||||
|
|
||||||
|
table#help tr td { white-space:normal; }
|
||||||
|
|
|
@ -18,7 +18,7 @@ OC_App::setActiveNavigationEntry( "help" );
|
||||||
$kbe=OC_OCSClient::getKnownledgebaseEntries();
|
$kbe=OC_OCSClient::getKnownledgebaseEntries();
|
||||||
|
|
||||||
|
|
||||||
$tmpl = new OC_Template( "help", "index", "admin" );
|
$tmpl = new OC_Template( "help", "index", "user" );
|
||||||
$tmpl->assign( "kbe", $kbe );
|
$tmpl->assign( "kbe", $kbe );
|
||||||
$tmpl->assign( "pagecount", $pagecount );
|
$tmpl->assign( "pagecount", $pagecount );
|
||||||
$tmpl->assign( "page", $page );
|
$tmpl->assign( "page", $page );
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<?php if(is_null($_["kbe"])):?>
|
<?php if(is_null($_["kbe"])):?>
|
||||||
Can't connect to Q&A database
|
Can't connect to Q&A database
|
||||||
<?php else:?>
|
<?php else:?>
|
||||||
<table cellspacing="0" width="100%">
|
<table id="help" cellspacing="20">
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach($_["kbe"] as $kb): ?>
|
<?php foreach($_["kbe"] as $kb): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="1"><?php if($kb["preview1"] <> "") { echo('<img class="preview" border="0" src="'.$kb["preview1"].'" />'); } ?> </a></td>
|
<td width="1"><?php if($kb["preview1"] <> "") { echo('<img class="preview" border="0" src="'.$kb["preview1"].'" />'); } ?> </a></td>
|
||||||
<td class="name"><?php echo $kb["name"]; ?><br /><?php echo('<span class="type">'.$kb['description'].'</span>'); ?>
|
<td class="name"><p><strong><?php echo $kb["name"]; ?></strong></p><?php echo('<span class="type">'.$kb['description'].'</span>'); ?>
|
||||||
<?php if($kb['answer']<>'') echo('<br /><span class="type"><b>Answer:</b></span><br /><span class="type">'.$kb['answer'].'</span>');?>
|
<?php if($kb['answer']<>'') echo('<br /><span class="type"><b>Answer:</b></span><br /><span class="type">'.$kb['answer'].'</span>');?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
228
lib/app.php
|
@ -30,10 +30,10 @@ class OC_App{
|
||||||
static private $init = false;
|
static private $init = false;
|
||||||
static private $apps = array();
|
static private $apps = array();
|
||||||
static private $activeapp = '';
|
static private $activeapp = '';
|
||||||
static private $adminpages = array();
|
|
||||||
static private $settingspages = array();
|
|
||||||
static private $navigation = array();
|
static private $navigation = array();
|
||||||
static private $subnavigation = array();
|
static private $settingsForms = array();
|
||||||
|
static private $adminForms = array();
|
||||||
|
static private $personalForms = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief loads all apps
|
* @brief loads all apps
|
||||||
|
@ -166,38 +166,6 @@ class OC_App{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief adds a sub entry to the navigation
|
|
||||||
* @param $parent id of the parent
|
|
||||||
* @param $data array containing the data
|
|
||||||
* @returns true/false
|
|
||||||
*
|
|
||||||
* This function adds a new sub entry to the navigation visible to users.
|
|
||||||
* these entries are visible only if the parent navigation entry is marked
|
|
||||||
* as being active (see activateNavigationEntry()). $data is an associative
|
|
||||||
* array.
|
|
||||||
* The following keys are required:
|
|
||||||
* - id: unique id for this entry ('addressbook_index')
|
|
||||||
* - href: link to the page
|
|
||||||
* - name: Human readable name ('Addressbook')
|
|
||||||
*
|
|
||||||
* The following keys are optional:
|
|
||||||
* - icon: path to the icon of the app
|
|
||||||
* - order: integer, that influences the position of your application in
|
|
||||||
* the navigation. Lower values come first.
|
|
||||||
*/
|
|
||||||
public static function addNavigationSubEntry( $parent, $data ){
|
|
||||||
$data['active']=false;
|
|
||||||
if(!isset($data['icon'])){
|
|
||||||
$data['icon']='';
|
|
||||||
}
|
|
||||||
if( !array_key_exists( $parent, self::$subnavigation )){
|
|
||||||
self::$subnavigation[$parent] = array();
|
|
||||||
}
|
|
||||||
self::$subnavigation[$parent][] = $data;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief marks a navigation entry as active
|
* @brief marks a navigation entry as active
|
||||||
* @param $id id of the entry
|
* @param $id id of the entry
|
||||||
|
@ -223,70 +191,6 @@ class OC_App{
|
||||||
return self::$activeapp;
|
return self::$activeapp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief registers an admin page
|
|
||||||
* @param $data array containing the data
|
|
||||||
* @returns true/false
|
|
||||||
*
|
|
||||||
* This function registers a admin page that will be shown in the admin
|
|
||||||
* menu. $data is an associative array.
|
|
||||||
* The following keys are required:
|
|
||||||
* - id: unique id for this entry ('files_admin')
|
|
||||||
* - href: link to the admin page
|
|
||||||
* - name: Human readable name ('Files Administration')
|
|
||||||
*
|
|
||||||
* The following keys are optional:
|
|
||||||
* - order: integer, that influences the position of your application in
|
|
||||||
* the list. Lower values come first.
|
|
||||||
*/
|
|
||||||
public static function addAdminPage( $data = array()){
|
|
||||||
// TODO: write function
|
|
||||||
OC_App::$adminpages[] = $data;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief registers a settings page
|
|
||||||
* @param $data array containing the data
|
|
||||||
* @returns true/false
|
|
||||||
*
|
|
||||||
* This function registers a settings page. $data is an associative array.
|
|
||||||
* The following keys are required:
|
|
||||||
* - app: app the settings belong to ('files')
|
|
||||||
* - id: unique id for this entry ('files_public')
|
|
||||||
* - href: link to the admin page
|
|
||||||
* - name: Human readable name ('Public files')
|
|
||||||
*
|
|
||||||
* The following keys are optional:
|
|
||||||
* - order: integer, that influences the position of your application in
|
|
||||||
* the list. Lower values come first.
|
|
||||||
*
|
|
||||||
* For the main settings page of an app, the keys 'app' and 'id' have to be
|
|
||||||
* the same.
|
|
||||||
*/
|
|
||||||
public static function addSettingsPage( $data = array()){
|
|
||||||
// TODO: write function
|
|
||||||
OC_App::$settingspages[] = $data;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Returns the navigation
|
|
||||||
* @returns associative array
|
|
||||||
*
|
|
||||||
* This function returns an array containing all entries added. The
|
|
||||||
* entries are sorted by the key 'order' ascending. Additional to the keys
|
|
||||||
* given for each app the following keys exist:
|
|
||||||
* - active: boolean, signals if the user is on this navigation entry
|
|
||||||
* - children: array that is empty if the key 'active' is false or
|
|
||||||
* contains the subentries if the key 'active' is true
|
|
||||||
*/
|
|
||||||
public static function getNavigation(){
|
|
||||||
$navigation = self::proceedNavigation( self::$navigation );
|
|
||||||
$navigation = self::addSubNavigation( $navigation );
|
|
||||||
return $navigation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the Settings Navigation
|
* @brief Returns the Settings Navigation
|
||||||
* @returns associative array
|
* @returns associative array
|
||||||
|
@ -295,68 +199,28 @@ class OC_App{
|
||||||
* entries are sorted by the key 'order' ascending.
|
* entries are sorted by the key 'order' ascending.
|
||||||
*/
|
*/
|
||||||
public static function getSettingsNavigation(){
|
public static function getSettingsNavigation(){
|
||||||
$navigation = self::proceedNavigation( self::$settingspages );
|
$admin=array(
|
||||||
$navigation = self::addSubNavigation( $navigation );
|
array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "admin", "users.php" ), "name" => "Users", "icon" => OC_Helper::imagePath( "admin", "users.png" )),
|
||||||
|
array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "admin", "apps.php?installed" ), "name" => "Apps", "icon" => OC_Helper::imagePath( "admin", "apps.png" )),
|
||||||
|
array( "id" => "files_administration", "order" => 3, "href" => OC_Helper::linkTo( "files", "admin.php" ), "name" => "Files", "icon" => OC_Helper::imagePath( "files", "folder.png" )),
|
||||||
|
);
|
||||||
|
$settings=array(
|
||||||
|
array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "help", "index.php" ), "name" => "Help", "icon" => OC_Helper::imagePath( "help", "help.png" )),
|
||||||
|
array( "id" => "settings", "order" => 1, "href" => OC_Helper::linkTo( "settings", "index.php" ), "name" => "Personal", "icon" => OC_Helper::imagePath( "settings", "personal.png" ))
|
||||||
|
);
|
||||||
|
if( OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
|
||||||
|
$settings=array_merge($admin,$settings);
|
||||||
|
}
|
||||||
|
$navigation = self::proceedNavigation($settings);
|
||||||
return $navigation;
|
return $navigation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Returns the admin navigation
|
|
||||||
* @returns associative array
|
|
||||||
*
|
|
||||||
* This function returns an array containing all admin pages added. The
|
|
||||||
* entries are sorted by the key 'order' ascending.
|
|
||||||
*/
|
|
||||||
public static function getAdminNavigation(){
|
|
||||||
$navigation = self::proceedNavigation( self::$adminpages );
|
|
||||||
$navigation = self::addSubNavigation( $navigation );
|
|
||||||
|
|
||||||
return $navigation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Private foo
|
|
||||||
private static function addSubNavigation( $list ){
|
|
||||||
if(isset(self::$subnavigation[self::$activeapp])){
|
|
||||||
$subNav=self::$subnavigation[self::$activeapp];
|
|
||||||
foreach( $list as &$naventry ){
|
|
||||||
if( $naventry['id'] == self::$activeapp ){
|
|
||||||
$naventry['active'] = true;
|
|
||||||
$naventry['subnavigation'] = $subNav;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
foreach(self::$subnavigation as $parent=>$entries){
|
|
||||||
$activeParent=false;
|
|
||||||
foreach($entries as &$subNav){
|
|
||||||
$subNav['active']=$subNav['id'] == self::$activeapp;
|
|
||||||
if($subNav['active']){
|
|
||||||
$activeParent=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($activeParent){
|
|
||||||
foreach( $list as &$naventry ){
|
|
||||||
if( $naventry['id'] == $parent ){
|
|
||||||
$naventry['active'] = true;
|
|
||||||
$naventry['subnavigation'] = $entries;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $list;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This is private as well. It simply works, so don't ask for more details
|
/// This is private as well. It simply works, so don't ask for more details
|
||||||
private static function proceedNavigation( $list ){
|
private static function proceedNavigation( $list ){
|
||||||
foreach( $list as &$naventry ){
|
foreach( $list as &$naventry ){
|
||||||
$naventry['subnavigation'] = array();
|
$naventry['subnavigation'] = array();
|
||||||
if( $naventry['id'] == self::$activeapp ){
|
if( $naventry['id'] == self::$activeapp ){
|
||||||
$naventry['active'] = true;
|
$naventry['active'] = true;
|
||||||
if( array_key_exists( $naventry['id'], self::$subnavigation )){
|
|
||||||
$naventry['subnavigation'] = self::$subnavigation[$naventry['id']];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$naventry['active'] = false;
|
$naventry['active'] = false;
|
||||||
|
@ -392,6 +256,22 @@ class OC_App{
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the navigation
|
||||||
|
* @returns associative array
|
||||||
|
*
|
||||||
|
* This function returns an array containing all entries added. The
|
||||||
|
* entries are sorted by the key 'order' ascending. Additional to the keys
|
||||||
|
* given for each app the following keys exist:
|
||||||
|
* - active: boolean, signals if the user is on this navigation entry
|
||||||
|
* - children: array that is empty if the key 'active' is false or
|
||||||
|
* contains the subentries if the key 'active' is true
|
||||||
|
*/
|
||||||
|
public static function getNavigation(){
|
||||||
|
$navigation = self::proceedNavigation( self::$navigation );
|
||||||
|
return $navigation;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the id of loaded app
|
* get the id of loaded app
|
||||||
* @return string
|
* @return string
|
||||||
|
@ -407,4 +287,48 @@ class OC_App{
|
||||||
return $topFolder;
|
return $topFolder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the forms for either settings, admin or personal
|
||||||
|
*/
|
||||||
|
public static function getForms($type){
|
||||||
|
$forms=array();
|
||||||
|
switch($type){
|
||||||
|
case 'settings':
|
||||||
|
$source=self::$settingsForms;
|
||||||
|
break;
|
||||||
|
case 'admin':
|
||||||
|
$source=self::$adminForms;
|
||||||
|
break;
|
||||||
|
case 'personal':
|
||||||
|
$source=self::$personalForms;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
foreach($source as $form){
|
||||||
|
$forms[]=include $form;
|
||||||
|
}
|
||||||
|
return $forms;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* register a settings form to be shown
|
||||||
|
*/
|
||||||
|
public static function registerSettings($app,$page){
|
||||||
|
self::$settingsForms[]='apps/'.$app.'/'.$page.'.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* register an admin form to be shown
|
||||||
|
*/
|
||||||
|
public static function registerAdmin($app,$page){
|
||||||
|
self::$adminForms[]='apps/'.$app.'/'.$page.'.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* register a personal form to be shown
|
||||||
|
*/
|
||||||
|
public static function registerPersonal($app,$page){
|
||||||
|
self::$personalForms[]='apps/'.$app.'/'.$page.'.php';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
11
lib/l10n.php
|
@ -146,16 +146,11 @@ class OC_L10N{
|
||||||
// If you add something don't forget to add it to $localizations
|
// If you add something don't forget to add it to $localizations
|
||||||
// at the top of the page
|
// at the top of the page
|
||||||
case 'date':
|
case 'date':
|
||||||
if( is_string( $data )) $data = strtotime( $data );
|
|
||||||
return date( $this->localizations['date'], $data );
|
|
||||||
break;
|
|
||||||
case 'datetime':
|
case 'datetime':
|
||||||
if( is_string( $data )) $data = strtotime( $data );
|
|
||||||
return date( $this->localizations['datetime'], $data );
|
|
||||||
break;
|
|
||||||
case 'time':
|
case 'time':
|
||||||
if( is_string( $data )) $data = strtotime( $data );
|
if( $data instanceof DateTime ) return $data->format($this->localizations[$type]);
|
||||||
return date( $this->localizations['time'], $data );
|
elseif( is_string( $data )) $data = strtotime( $data );
|
||||||
|
return date( $this->localizations[$type], $data );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -46,39 +46,26 @@ class OC_Setup {
|
||||||
$error[] = 'STEP 2 : data directory path is not set.';
|
$error[] = 'STEP 2 : data directory path is not set.';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($dbtype=='mysql') { //mysql needs more config options
|
if($dbtype=='mysql' or $dbtype=='pgsql') { //mysql and postgresql needs more config options
|
||||||
|
if($dbtype=='mysql')
|
||||||
|
$dbprettyname = 'MySQL';
|
||||||
|
else
|
||||||
|
$dbprettyname = 'PostgreSQL';
|
||||||
|
|
||||||
if(empty($options['dbuser'])) {
|
if(empty($options['dbuser'])) {
|
||||||
$error[] = 'STEP 3 : MySQL database user is not set.';
|
$error[] = "STEP 3 : $dbprettyname database user is not set.";
|
||||||
}
|
}
|
||||||
if(empty($options['dbpass'])) {
|
if(empty($options['dbpass'])) {
|
||||||
$error[] = 'STEP 3 : MySQL database password is not set.';
|
$error[] = "STEP 3 : $dbprettyname database password is not set.";
|
||||||
}
|
}
|
||||||
if(empty($options['dbname'])) {
|
if(empty($options['dbname'])) {
|
||||||
$error[] = 'STEP 3 : MySQL database name is not set.';
|
$error[] = "STEP 3 : $dbprettyname database name is not set.";
|
||||||
}
|
}
|
||||||
if(empty($options['dbhost'])) {
|
if(empty($options['dbhost'])) {
|
||||||
$error[] = 'STEP 3 : MySQL database host is not set.';
|
$error[] = "STEP 3 : $dbprettyname database host is not set.";
|
||||||
}
|
}
|
||||||
if(!isset($options['dbtableprefix'])) {
|
if(!isset($options['dbtableprefix'])) {
|
||||||
$error[] = 'STEP 3 : MySQL database table prefix is not set.';
|
$error[] = "STEP 3 : $dbprettyname database table prefix is not set.";
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($dbtype=='pgsql') { //postgresql needs more config options
|
|
||||||
if(empty($options['pg_dbuser'])) {
|
|
||||||
$error[] = 'STEP 3 : PostgreSQL database user is not set.';
|
|
||||||
}
|
|
||||||
if(empty($options['pg_dbpass'])) {
|
|
||||||
$error[] = 'STEP 3 : PostgreSQL database password is not set.';
|
|
||||||
}
|
|
||||||
if(empty($options['pg_dbname'])) {
|
|
||||||
$error[] = 'STEP 3 : PostgreSQL database name is not set.';
|
|
||||||
}
|
|
||||||
if(empty($options['pg_dbhost'])) {
|
|
||||||
$error[] = 'STEP 3 : PostgreSQL database host is not set.';
|
|
||||||
}
|
|
||||||
if(!isset($options['pg_dbtableprefix'])) {
|
|
||||||
$error[] = 'STEP 3 : PostgreSQL database table prefix is not set.';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,11 +137,11 @@ class OC_Setup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($dbtype == 'pgsql') {
|
elseif($dbtype == 'pgsql') {
|
||||||
$dbuser = $options['pg_dbuser'];
|
$dbuser = $options['dbuser'];
|
||||||
$dbpass = $options['pg_dbpass'];
|
$dbpass = $options['dbpass'];
|
||||||
$dbname = $options['pg_dbname'];
|
$dbname = $options['dbname'];
|
||||||
$dbhost = $options['pg_dbhost'];
|
$dbhost = $options['dbhost'];
|
||||||
$dbtableprefix = $options['pg_dbtableprefix'];
|
$dbtableprefix = $options['dbtableprefix'];
|
||||||
OC_CONFIG::setValue('dbname', $dbname);
|
OC_CONFIG::setValue('dbname', $dbname);
|
||||||
OC_CONFIG::setValue('dbhost', $dbhost);
|
OC_CONFIG::setValue('dbhost', $dbhost);
|
||||||
OC_CONFIG::setValue('dbtableprefix', $dbtableprefix);
|
OC_CONFIG::setValue('dbtableprefix', $dbtableprefix);
|
||||||
|
@ -224,7 +211,9 @@ class OC_Setup {
|
||||||
OC_Installer::installShippedApps(true);
|
OC_Installer::installShippedApps(true);
|
||||||
|
|
||||||
//create htaccess files for apache hosts
|
//create htaccess files for apache hosts
|
||||||
self::createHtaccess(); //TODO detect if apache is used
|
if (strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) {
|
||||||
|
self::createHtaccess();
|
||||||
|
}
|
||||||
|
|
||||||
//and we are done
|
//and we are done
|
||||||
OC_Config::setValue('installed', true);
|
OC_Config::setValue('installed', true);
|
||||||
|
|
|
@ -202,15 +202,12 @@ class OC_Template{
|
||||||
*
|
*
|
||||||
* This function proceeds the template and prints its output.
|
* This function proceeds the template and prints its output.
|
||||||
*/
|
*/
|
||||||
public function printPage()
|
public function printPage(){
|
||||||
{
|
|
||||||
$data = $this->fetchPage();
|
$data = $this->fetchPage();
|
||||||
if( $data === false )
|
if( $data === false ){
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
{
|
|
||||||
print $data;
|
print $data;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -223,41 +220,29 @@ class OC_Template{
|
||||||
* This function proceeds the template. If $this->renderas is set, it will
|
* This function proceeds the template. If $this->renderas is set, it will
|
||||||
* will produce a full page.
|
* will produce a full page.
|
||||||
*/
|
*/
|
||||||
public function fetchPage()
|
public function fetchPage(){
|
||||||
{
|
|
||||||
// global Data we need
|
// global Data we need
|
||||||
global $WEBROOT;
|
global $WEBROOT;
|
||||||
global $SERVERROOT;
|
global $SERVERROOT;
|
||||||
$data = $this->_fetch();
|
$data = $this->_fetch();
|
||||||
|
|
||||||
if( $this->renderas )
|
if( $this->renderas ){
|
||||||
{
|
|
||||||
// Decide which page we show
|
// Decide which page we show
|
||||||
if( $this->renderas == "user" )
|
if( $this->renderas == "user" ){
|
||||||
{
|
|
||||||
$page = new OC_Template( "core", "layout.user" );
|
$page = new OC_Template( "core", "layout.user" );
|
||||||
$search=new OC_Template( 'core', 'part.searchbox');
|
$search=new OC_Template( 'core', 'part.searchbox');
|
||||||
$search->assign('searchurl',OC_Helper::linkTo( 'search', 'index.php' ));
|
$search->assign('searchurl',OC_Helper::linkTo( 'search', 'index.php' ));
|
||||||
$page->assign('searchbox', $search->fetchPage());
|
$page->assign('searchbox', $search->fetchPage());
|
||||||
|
if(array_search(OC_APP::getCurrentApp(),array('settings','admin','help'))!==false){
|
||||||
|
$page->assign('bodyid','body-settings');
|
||||||
|
}else{
|
||||||
|
$page->assign('bodyid','body-user');
|
||||||
|
}
|
||||||
|
|
||||||
// Add navigation entry
|
// Add navigation entry
|
||||||
$page->assign( "navigation", OC_App::getNavigation());
|
$page->assign( "navigation", OC_App::getNavigation());
|
||||||
}
|
|
||||||
elseif( $this->renderas == "admin" )
|
|
||||||
{
|
|
||||||
$page = new OC_Template( "core", "layout.admin" );
|
|
||||||
$search=new OC_Template( 'core', 'part.searchbox');
|
|
||||||
$search->assign('searchurl',OC_Helper::linkTo( 'search', 'index.php' ));
|
|
||||||
$page->assign('searchbox', $search->fetchPage());
|
|
||||||
|
|
||||||
// Add menu data
|
|
||||||
if( OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
|
|
||||||
$page->assign( "adminnavigation", OC_App::getAdminNavigation());
|
|
||||||
}
|
|
||||||
$page->assign( "settingsnavigation", OC_App::getSettingsNavigation());
|
$page->assign( "settingsnavigation", OC_App::getSettingsNavigation());
|
||||||
}
|
}else{
|
||||||
else
|
|
||||||
{
|
|
||||||
$page = new OC_Template( "core", "layout.guest" );
|
$page = new OC_Template( "core", "layout.guest" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,8 +280,7 @@ class OC_Template{
|
||||||
$page->assign( "content", $data );
|
$page->assign( "content", $data );
|
||||||
return $page->fetchPage();
|
return $page->fetchPage();
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
{
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -329,9 +313,14 @@ class OC_Template{
|
||||||
* Includes another template. use <?php echo $this->inc('template'); ?> to
|
* Includes another template. use <?php echo $this->inc('template'); ?> to
|
||||||
* do this.
|
* do this.
|
||||||
*/
|
*/
|
||||||
public function inc( $file ){
|
public function inc( $file, $additionalparams = null ){
|
||||||
// $_ erstellen
|
// $_ erstellen
|
||||||
$_ = $this->vars;
|
$_ = $this->vars;
|
||||||
|
$l = $this->l10n;
|
||||||
|
|
||||||
|
if( !is_null($additionalparams)){
|
||||||
|
$_ = array_merge( $additionalparams, $this->vars );
|
||||||
|
}
|
||||||
|
|
||||||
// Einbinden
|
// Einbinden
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
OC_App::register( array( "id" => "settings", "name" => "Settings" ));
|
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;}
|
#passworderror { display:none; }
|
||||||
#passwordchanged{display:none;}
|
#passwordchanged { display:none; }
|
||||||
|
|
||||||
|
input#identity { width:20em; }
|
||||||
|
|
|
@ -24,15 +24,16 @@ unset($languages[array_search($lang,$languages)]);
|
||||||
array_unshift($languages,$lang);
|
array_unshift($languages,$lang);
|
||||||
|
|
||||||
// Return template
|
// Return template
|
||||||
$tmpl = new OC_Template( "settings", "index", "admin");
|
$tmpl = new OC_Template( "settings", "index", "user");
|
||||||
$tmpl->assign('usage',OC_Helper::humanFileSize($used));
|
$tmpl->assign('usage',OC_Helper::humanFileSize($used));
|
||||||
$tmpl->assign('total_space',OC_Helper::humanFileSize($total));
|
$tmpl->assign('total_space',OC_Helper::humanFileSize($total));
|
||||||
$tmpl->assign('usage_relative',$relative);
|
$tmpl->assign('usage_relative',$relative);
|
||||||
$tmpl->assign('languages',$languages);
|
$tmpl->assign('languages',$languages);
|
||||||
$tmpl->assign('hasopenid',OC_App::isEnabled( 'user_openid' ));
|
|
||||||
if(OC_App::isEnabled( 'user_openid' )){
|
$forms=OC_App::getForms('personal');
|
||||||
$identity=OC_Preferences::getValue(OC_User::getUser(),'user_openid','identity','');
|
$tmpl->assign('forms',array());
|
||||||
$tmpl->assign('identity',$identity);
|
foreach($forms as $form){
|
||||||
|
$tmpl->append('forms',$form);
|
||||||
}
|
}
|
||||||
$tmpl->printPage();
|
$tmpl->printPage();
|
||||||
|
|
||||||
|
|
|
@ -19,17 +19,6 @@ $(document).ready(function(){
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#openidform').submit(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');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#languageinput").change( function(){
|
$("#languageinput").change( function(){
|
||||||
// Serialize the data
|
// Serialize the data
|
||||||
var post = $( "#languageinput" ).serialize();
|
var post = $( "#languageinput" ).serialize();
|
||||||
|
|
|
@ -18,16 +18,6 @@
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<?php if($_['hasopenid']):?>
|
|
||||||
<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();?>" />
|
|
||||||
<input type="submit" value="Save" /></p>
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
<?php endif;?>
|
|
||||||
|
|
||||||
<form id="languageform">
|
<form id="languageform">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><?php echo $l->t( 'Language' );?></legend>
|
<legend><?php echo $l->t( 'Language' );?></legend>
|
||||||
|
@ -39,3 +29,7 @@
|
||||||
</select>
|
</select>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<?php foreach($_['forms'] as $form){
|
||||||
|
echo $form;
|
||||||
|
};?>
|
||||||
|
|