]> source.dussan.org Git - nextcloud-server.git/commitdiff
first version of the new documentation system integration.
authorFrank Karlitschek <frank@owncloud.org>
Wed, 12 Dec 2012 21:41:12 +0000 (22:41 +0100)
committerFrank Karlitschek <frank@owncloud.org>
Wed, 12 Dec 2012 21:41:12 +0000 (22:41 +0100)
core/docu/admin/index.php [new file with mode: 0644]
core/docu/user/index.php [new file with mode: 0644]
settings/help.php
settings/templates/help.php

diff --git a/core/docu/admin/index.php b/core/docu/admin/index.php
new file mode 100644 (file)
index 0000000..3f75499
--- /dev/null
@@ -0,0 +1 @@
+here goes the admin documentation
diff --git a/core/docu/user/index.php b/core/docu/user/index.php
new file mode 100644 (file)
index 0000000..dc167c0
--- /dev/null
@@ -0,0 +1,3 @@
+here goes the user documentation
+
+
index 69a5ec9c14691fd58861a2f5a223a70a500bf682..6f99596b2badfcca785ab91a3a3e9e8d5600d549 100644 (file)
@@ -12,15 +12,19 @@ OC_App::loadApps();
 OC_Util::addStyle( "settings", "settings" );
 OC_App::setActiveNavigationEntry( "help" );
 
-$pagesize=7;
-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);
+
+if(isset($_GET['mode']) and $_GET['mode']=='admin') {
+       $url=OC_Helper::linkToAbsolute( 'core', 'docu/admin' );
+}else{
+       $url=OC_Helper::linkToAbsolute( 'core', 'docu/user' );
+}
+
+$url1=OC_Helper::linkToRoute( "settings_help" ).'?mode=user';
+$url2=OC_Helper::linkToRoute( "settings_help" ).'?mode=admin';
 
 $tmpl = new OC_Template( "settings", "help", "user" );
-$tmpl->assign( "kbe", $kbe );
-$tmpl->assign( "pagecount", $pagecount );
-$tmpl->assign( "page", $page );
+$tmpl->assign( "admin", OC_Group::inGroup(OC_User::getUser(), 'admin') );
+$tmpl->assign( "url", $url );
+$tmpl->assign( "url1", $url1 );
+$tmpl->assign( "url2", $url2 );
 $tmpl->printPage();
index 75201a86a9f3d3fe37c0e90caea708ff41b111f6..5ed99420cf494db702935ae874070e8627b9d944 100644 (file)
@@ -1,34 +1,30 @@
-<?php
-/**
- * 2012 Frank Karlitschek frank@owncloud.org
- * This file is licensed under the Affero General Public License version 3 or later.
- * See the COPYING-README file.
- */?>
-
 <div id="controls">
-       <a class="button newquestion" href="http://owncloud.org/support" target="_blank"><?php echo $l->t( 'Documentation' ); ?></a>
-       <a class="button newquestion" href="http://owncloud.org/support/big-files" target="_blank"><?php echo $l->t( 'Managing Big Files' ); ?></a>
-       <a class="button newquestion" href="http://apps.owncloud.com/knowledgebase/editquestion.php?action=new" target="_blank"><?php echo $l->t( 'Ask a question' ); ?></a>
-       <?php
-               $url=OC_Helper::linkTo( "settings", "help.php" ).'?page=';
-               $pageNavi=OC_Util::getPageNavi($_['pagecount'], $_['page'], $url);
-               if($pageNavi) {
-                       $pageNavi->printPage();
-               }
-       ?>
-</diV>
-<?php if(!is_array($_["kbe"]) || !count($_["kbe"])):?>
-       <div class="helpblock">
-               <p><?php echo $l->t('Problems connecting to help database.');?></p>
-               <p><a href="http://apps.owncloud.com/kb"><?php echo $l->t('Go there manually.');?></a></p>
-       </div>
-<?php else:?>
-       <?php foreach($_["kbe"] as $kb): ?>
-       <div class="helpblock">
-               <?php if($kb["preview1"] <> "") echo('<img class="preview" src="'.$kb["preview1"].'" />'); ?>
-               <?php if($kb['detailpage']<>'') echo('<p><a target="_blank" href="'.$kb['detailpage'].'"><strong>'.$kb["name"].'</strong></a></p>');?>
-               <p><?php echo $kb['description'];?></p>
-               <?php if($kb['answer']<>'') echo('<p><strong>'.$l->t('Answer').':</strong><p>'.$kb['answer'].'</p>');?>
-       </div>
-       <?php endforeach;
-endif?>
+        <a class="button newquestion" href="<?php echo($_['url1']); ?>"><?php echo $l->t( 'User Documentation' ); ?></a>
+        <?php if($_['admin']) { ?><a class="button newquestion" href="<?php echo($_['url2']); ?>"><?php echo $l->t( 'Administrator Documentation' ); ?></a><?php } ?>
+        <a class="button newquestion" href="http://owncloud.org/support" target="_blank"><?php echo $l->t( 'Online Documentation' ); ?></a>
+        <a class="button newquestion" href="http://forum.owncloud.org" target="_blank"><?php echo $l->t( 'Forum' ); ?></a>
+        <a class="button newquestion" href="https://github.com/owncloud/core/issues" target="_blank"><?php echo $l->t( 'Bugtracker' ); ?></a>
+</div>
+<br /><br />
+<iframe src="<?php echo($_['url']); ?>" width="100%" id="ifm" ></iframe>
+
+
+<script language="JavaScript">
+<!--
+
+function pageY(elem) {
+    return elem.offsetParent ? (elem.offsetTop + pageY(elem.offsetParent)) : elem.offsetTop;
+}
+var buffer = 5; //scroll bar buffer
+function resizeIframe() {
+    var height = document.documentElement.clientHeight;
+    height -= pageY(document.getElementById('ifm'))+ buffer ;
+    height = (height < 0) ? 0 : height;
+    document.getElementById('ifm').style.height = height + 'px';
+}
+
+document.getElementById('ifm').onload=resizeIframe;
+window.onresize = resizeIframe;
+
+//-->
+</script>