Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
fc63882f
Commit
fc63882f
authored
13 years ago
by
Frank Karlitschek
Browse files
Options
Downloads
Patches
Plain Diff
more layout fixes
parent
a7da3cd6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
admin/apps.php
+5
-3
5 additions, 3 deletions
admin/apps.php
admin/css/apps.css
+42
-0
42 additions, 0 deletions
admin/css/apps.css
admin/templates/apps.php
+2
-4
2 additions, 4 deletions
admin/templates/apps.php
lib/ocsclient.php
+43
-8
43 additions, 8 deletions
lib/ocsclient.php
with
92 additions
and
15 deletions
admin/apps.php
+
5
−
3
View file @
fc63882f
...
...
@@ -29,8 +29,7 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin'
}
// Load the files we need
//OC_UTIL::addStyle( "", "files" );
//OC_UTIL::addScript( "", "files" );
OC_UTIL
::
addStyle
(
"admin"
,
"apps"
);
if
(
isset
(
$_GET
[
'id'
]))
$id
=
$_GET
[
'id'
];
else
$id
=
0
;
...
...
@@ -41,7 +40,9 @@ $categories=OC_OCSCLIENT::getCategories();
if
(
$id
==
0
)
{
if
(
$cat
==
0
){
$apps
=
OC_OCSCLIENT
::
getApplications
(
$categories
);
$numcats
=
array
();
foreach
(
$categories
as
$key
=>
$value
)
$numcats
[]
=
$key
;
$apps
=
OC_OCSCLIENT
::
getApplications
(
$numcats
);
}
else
{
$apps
=
OC_OCSCLIENT
::
getApplications
(
$cat
);
}
...
...
@@ -59,6 +60,7 @@ if($id==0) {
$app
=
OC_OCSCLIENT
::
getApplication
(
$id
);
$tmpl
=
new
OC_TEMPLATE
(
"admin"
,
"app"
,
"admin"
);
$tmpl
->
assign
(
"categories"
,
$categories
);
$tmpl
->
assign
(
"app"
,
$app
);
$tmpl
->
printPage
();
unset
(
$tmpl
);
...
...
This diff is collapsed.
Click to expand it.
admin/css/apps.css
0 → 100644
+
42
−
0
View file @
fc63882f
/* APPS TABLE */
table
td
.date
{
width
:
5em
;
padding
:
0.5em
1em
;
text-align
:
right
;
}
.preview
{
padding
:
3px
;
text-align
:
left
;
}
table
td
.date
{
width
:
11em
;
color
:
#555555
;
}
table
td
.selection
,
table
th
.selection
,
table
td
.fileaction
{
width
:
2em
;
text-align
:
center
;
}
table
td
.name
a
{
padding
:
6px
;
text-decoration
:
none
;
color
:
#555555
;
}
.type
{
padding
:
6px
;
text-decoration
:
none
;
color
:
#888888
;
font-size
:
0.8em
;
}
This diff is collapsed.
Click to expand it.
admin/templates/apps.php
+
2
−
4
View file @
fc63882f
...
...
@@ -12,16 +12,14 @@
<th></th>
<th>
Name
</th>
<th>
Modified
</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach
(
$_
[
"apps"
]
as
$app
)
:
?>
<tr>
<td
width=
"1"
>
<?php
if
(
$app
[
"preview"
]
<>
""
)
{
echo
(
'<a href="
"><img
border="0" src="'
.
$app
[
"preview"
]
.
'" /></a>'
);
}
?>
</a></td>
<td
class=
"
file
name"
><a
href=
"
"
title=
""
>
<?php
echo
$app
[
"name"
];
?>
</a
></td>
<td
width=
"1"
>
<?php
if
(
$app
[
"preview"
]
<>
""
)
{
echo
(
'<a href="
'
.
OC_HELPER
::
linkTo
(
"admin"
,
"apps.php"
)
.
'?id='
.
$app
[
'id'
]
.
'"><img class="preview"
border="0" src="'
.
$app
[
"preview"
]
.
'" /></a>'
);
}
?>
</a></td>
<td
class=
"name"
><a
href=
"
<?php
echo
(
OC_HELPER
::
linkTo
(
"admin"
,
"apps.php"
)
.
'?id='
.
$app
[
'id'
]);
?>
"
title=
""
>
<?php
echo
$app
[
"name"
];
?>
</a><br
/>
<?php
echo
(
'<span class="type">'
.
$app
[
'typename'
]
.
'</span>'
);
?
>
</td>
<td
class=
"date"
>
<?php
echo
OC_UTIL
::
formatdate
(
$app
[
"changed"
]);
?>
</td>
<td
class=
"fileaction"
><a
href=
""
title=
""
><img
src=
"images/drop-arrow.png"
alt=
"+"
/></a></td>
</tr>
<?php
endforeach
;
?>
</tbody>
...
...
This diff is collapsed.
Click to expand it.
lib/ocsclient.php
+
43
−
8
View file @
fc63882f
...
...
@@ -37,16 +37,13 @@ class OC_OCSCLIENT{
public
static
function
getCategories
(){
$url
=
'http://api.opendesktop.org/v1/content/categories'
;
$cats
=
array
();
$xml
=
file_get_contents
(
$url
);
$data
=
simplexml_load_string
(
$xml
);
$tmp
=
$data
->
data
->
category
;
$cats
=
array
();
for
(
$i
=
0
;
$i
<
count
(
$tmp
);
$i
++
)
{
$cat
=
array
();
$cat
[
'id'
]
=
$tmp
[
$i
]
->
id
;
$cat
[
'name'
]
=
$tmp
[
$i
]
->
name
;
$cats
[]
=
$cat
;
$cats
[
$i
]
=
$tmp
[
$i
]
->
name
;
}
return
$cats
;
}
...
...
@@ -58,8 +55,12 @@ class OC_OCSCLIENT{
* This function returns a list of all the applications on the OCS server
*/
public
static
function
getApplications
(
$categories
){
$categoriesstring
=
implode
(
'x'
,
$categories
);
$url
=
'http://api.opendesktop.org/v1/content/data?categories='
.
$ocscategories
[
'ids'
]
.
'&sortmode=new&page=0&pagesize=10'
;
if
(
is_array
(
$categories
))
{
$categoriesstring
=
implode
(
'x'
,
$categories
);
}
else
{
$categoriesstring
=
$categories
;
}
$url
=
'http://api.opendesktop.org/v1/content/data?categories='
.
urlencode
(
$categoriesstring
)
.
'&sortmode=new&page=0&pagesize=10'
;
$apps
=
array
();
$xml
=
file_get_contents
(
$url
);
...
...
@@ -70,7 +71,8 @@ class OC_OCSCLIENT{
$app
=
array
();
$app
[
'id'
]
=
$tmp
[
$i
]
->
id
;
$app
[
'name'
]
=
$tmp
[
$i
]
->
name
;
$app
[
'type'
]
=
$tmp
[
$i
]
->
type
;
$app
[
'type'
]
=
$tmp
[
$i
]
->
typeid
;
$app
[
'typename'
]
=
$tmp
[
$i
]
->
typename
;
$app
[
'personid'
]
=
$tmp
[
$i
]
->
personid
;
$app
[
'detailpage'
]
=
$tmp
[
$i
]
->
detailpage
;
$app
[
'preview'
]
=
$tmp
[
$i
]
->
smallpreviewpic1
;
...
...
@@ -82,5 +84,38 @@ class OC_OCSCLIENT{
return
$apps
;
}
/**
* @brief Get an the applications from the OCS server
* @returns array with application data
*
* This function returns an applications from the OCS server
*/
public
static
function
getApplication
(
$id
){
$url
=
'http://api.opendesktop.org/v1/content/data/'
.
urlencode
(
$id
);
$xml
=
file_get_contents
(
$url
);
$data
=
simplexml_load_string
(
$xml
);
$tmp
=
$data
->
data
->
content
;
$app
=
array
();
$app
[
'id'
]
=
$tmp
->
id
;
$app
[
'name'
]
=
$tmp
->
name
;
$app
[
'type'
]
=
$tmp
->
typeid
;
$app
[
'typename'
]
=
$tmp
->
typename
;
$app
[
'personid'
]
=
$tmp
->
personid
;
$app
[
'detailpage'
]
=
$tmp
->
detailpage
;
$app
[
'preview1'
]
=
$tmp
->
smallpreviewpic1
;
$app
[
'preview2'
]
=
$tmp
->
smallpreviewpic2
;
$app
[
'preview3'
]
=
$tmp
->
smallpreviewpic3
;
$app
[
'changed'
]
=
strtotime
(
$tmp
->
changed
);
$app
[
'description'
]
=
$tmp
->
description
;
return
$app
;
}
}
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment