summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorFrank Karlitschek <karlitschek@kde.org>2011-08-17 00:24:50 +0200
committerFrank Karlitschek <karlitschek@kde.org>2011-08-17 00:24:50 +0200
commitcb9fc6d901c59999f3ebd369449e4a845680665d (patch)
treed142cc1a9256225498fecdd56386c870777f69e8 /settings
parent9f28c20660e113c501a951262765ce9c9c4d0e84 (diff)
downloadnextcloud-server-cb9fc6d901c59999f3ebd369449e4a845680665d.tar.gz
nextcloud-server-cb9fc6d901c59999f3ebd369449e4a845680665d.zip
make the help section working and pretty. knowledge base entries are fetched via OCS from a different server. cool stuff
Diffstat (limited to 'settings')
-rw-r--r--settings/css/settings.css15
-rw-r--r--settings/help.php12
-rw-r--r--settings/templates/help.php11
3 files changed, 26 insertions, 12 deletions
diff --git a/settings/css/settings.css b/settings/css/settings.css
index c8163ff2f82..2068389909c 100644
--- a/settings/css/settings.css
+++ b/settings/css/settings.css
@@ -29,4 +29,17 @@ span.version{margin-left:3em;color:#ddd}
/* HELP */
-table#help tr td { white-space:normal; }
+
+table.help { border-spacing:1em; }
+table.help tr td { white-space:normal; }
+
+
+a.newquestion { font-size:1em; width:10em; margin:1.5em; padding:.6em .5em .4em; 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; }
+a.newquestion:hover { background:#ddd; }
+
+
+td.entry { padding:1em; margin:2em; 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; }
+td.entry:hover { background:#eee; }
+tr.entryrow:hover { background:#fff; }
+tr.pager:hover { background:#fff; }
+
diff --git a/settings/help.php b/settings/help.php
index b6466d282bf..731ae09a0af 100644
--- a/settings/help.php
+++ b/settings/help.php
@@ -6,17 +6,17 @@ if( !OC_User::isLoggedIn()){
exit();
}
-//hardcode for testing
-$pagecount=8;
-$page=2;
-
// Load the files we need
OC_Util::addStyle( "settings", "settings" );
OC_App::setActiveNavigationEntry( "help" );
-$kbe=OC_OCSClient::getKnownledgebaseEntries();
-
+$pagesize=5;
+if(isset($_GET['page'])) $page=$_GET['page']; else $page=0;
+$kbe=OC_OCSClient::getKnownledgebaseEntries($page,$pagesize);
+$totalitems=$kbe['totalitems'];
+unset($kbe['totalitems']);
+$pagecount=ceil($totalitems/$pagesize);
$tmpl = new OC_Template( "settings", "help", "user" );
$tmpl->assign( "kbe", $kbe );
diff --git a/settings/templates/help.php b/settings/templates/help.php
index 4cd748c3dff..3a7edfa9b22 100644
--- a/settings/templates/help.php
+++ b/settings/templates/help.php
@@ -1,14 +1,15 @@
<?php if(is_null($_["kbe"])):?>
Can't connect to Q&amp;A database
<?php else:?>
- <table id="help" cellspacing="20">
+ <table class="help">
<tbody>
<?php foreach($_["kbe"] as $kb): ?>
- <tr>
+ <tr class="entryrow">
<td width="1"><?php if($kb["preview1"] <> "") { echo('<img class="preview" border="0" src="'.$kb["preview1"].'" />'); } ?> </a></td>
- <td class="name"><p><strong><?php echo $kb["name"]; ?></strong></p><?php echo('<span class="type">'.$kb['description'].'</span>'); ?>
+ <td class="entry"><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>');?>
- </td>
+ <?php if($kb['detailpage']<>'') echo('<br /><a target="_blank" href="'.$kb['detailpage'].'"><b>read more</b></a>')?>
+ <br /></td>
</tr>
<?php endforeach; ?>
</tbody>
@@ -18,7 +19,7 @@
$pageNavi=OC_Util::getPageNavi($_['pagecount'],$_['page'],$url);
$pageNavi->printPage();
?>
- <a target="_blank" class="prettybutton" href="http://apps.owncloud.com/knowledgebase/editquestion.php?action=new"><?php echo $l->t( 'Ask a question' ); ?></a>
+ <br /><a target="_blank" class="newquestion" href="http://apps.owncloud.com/knowledgebase/editquestion.php?action=new"><?php echo $l->t( 'Ask a question' ); ?></a>
<?php endif;?>