summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-22 01:28:43 -0700
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-22 01:28:43 -0700
commitcadd71ec8a02fc5619a9347109f9e588e13b3e3b (patch)
treef841b9be9d84be2299d3cfa0c4a74f3efed36505
parent9d976013daf971edf0c06460932e57de533c2ccf (diff)
parent87a09156f8f6b95119b35a5c7bdaafdcd263aa80 (diff)
downloadnextcloud-server-cadd71ec8a02fc5619a9347109f9e588e13b3e3b.tar.gz
nextcloud-server-cadd71ec8a02fc5619a9347109f9e588e13b3e3b.zip
Merge pull request #5455 from owncloud/fixing-2423-master
introduce link_to_docs() and migrate links
-rw-r--r--apps/user_ldap/templates/settings.php2
-rw-r--r--core/templates/installation.php2
-rw-r--r--lib/base.php2
-rw-r--r--lib/private/config.php2
-rw-r--r--lib/private/helper.php9
-rw-r--r--lib/private/setup.php2
-rw-r--r--lib/private/template/functions.php8
-rwxr-xr-xlib/private/util.php16
-rw-r--r--settings/templates/admin.php2
-rw-r--r--settings/templates/personal.php2
10 files changed, 32 insertions, 15 deletions
diff --git a/apps/user_ldap/templates/settings.php b/apps/user_ldap/templates/settings.php
index 319dc38a62d..2530d9c04c7 100644
--- a/apps/user_ldap/templates/settings.php
+++ b/apps/user_ldap/templates/settings.php
@@ -106,7 +106,7 @@
<p class="ldapIndent"><?php p($l->t('Usernames are used to store and assign (meta) data. In order to precisely identify and recognize users, each LDAP user will have a internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage.'));?></p>
<p class="ldapIndent"><button id="ldap_action_clear_user_mappings" name="ldap_action_clear_user_mappings"><?php p($l->t('Clear Username-LDAP User Mapping'));?></button><br/><button id="ldap_action_clear_group_mappings" name="ldap_action_clear_group_mappings"><?php p($l->t('Clear Groupname-LDAP Group Mapping'));?></button></p>
</fieldset>
- <input id="ldap_submit" type="submit" value="Save" /> <button id="ldap_action_test_connection" name="ldap_action_test_connection"><?php p($l->t('Test Configuration'));?></button> <a href="<?php p($theme->getDocBaseUrl()); ?>/server/5.0/admin_manual/auth_ldap.html" target="_blank"><img src="<?php print_unescaped(OCP\Util::imagePath('', 'actions/info.png')); ?>" style="height:1.75ex" /> <?php p($l->t('Help'));?></a>
+ <input id="ldap_submit" type="submit" value="Save" /> <button id="ldap_action_test_connection" name="ldap_action_test_connection"><?php p($l->t('Test Configuration'));?></button> <a href="<?php print_unescaped(link_to_docs('admin-ldap')); ?>" target="_blank"><img src="<?php print_unescaped(OCP\Util::imagePath('', 'actions/info.png')); ?>" style="height:1.75ex" /> <?php p($l->t('Help'));?></a>
</div>
</form>
diff --git a/core/templates/installation.php b/core/templates/installation.php
index a6f55cb0e28..3457a3c9a99 100644
--- a/core/templates/installation.php
+++ b/core/templates/installation.php
@@ -39,7 +39,7 @@
<p><?php p($l->t('Your data directory and files are probably accessible from the internet because the .htaccess file does not work.'));?><br>
<?php print_unescaped($l->t(
'For information how to properly configure your server, please see the <a href="%s" target="_blank">documentation</a>.',
- $theme->getDocBaseUrl().'/server/5.0/admin_manual/installation.html'
+ link_to_docs('admin-install')
)); ?></p>
</fieldset>
<?php endif; ?>
diff --git a/lib/base.php b/lib/base.php
index ee925b8f736..ef574b2d895 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -181,7 +181,7 @@ class OC {
OC_Template::printErrorPage(
"Can't write into config directory!",
'This can usually be fixed by '
- .'<a href="' . $defaults->getDocBaseUrl() . '/server/5.0/admin_manual/installation/installation_source.html#set-the-directory-permissions" target="_blank">giving the webserver write access to the config directory</a>.'
+ .'<a href="' . link_to_docs('admin-dir_permissions') . '" target="_blank">giving the webserver write access to the config directory</a>.'
);
}
}
diff --git a/lib/private/config.php b/lib/private/config.php
index 72423137fa3..caf7b1d7066 100644
--- a/lib/private/config.php
+++ b/lib/private/config.php
@@ -172,7 +172,7 @@ class Config {
$result = @file_put_contents($this->configFilename, $content);
if (!$result) {
$defaults = new \OC_Defaults;
- $url = $defaults->getDocBaseUrl() . '/server/5.0/admin_manual/installation/installation_source.html#set-the-directory-permissions';
+ $url = \OC_Helper::linkToDocs('admin-dir-permissions');
throw new HintException(
"Can't write into config directory!",
'This can usually be fixed by '
diff --git a/lib/private/helper.php b/lib/private/helper.php
index e9b129db0ca..fca08adca8b 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -59,6 +59,15 @@ class OC_Helper {
}
/**
+ * @param $key
+ * @return string url to the online documentation
+ */
+ public static function linkToDocs($key) {
+ $theme = new OC_Defaults();
+ return $theme->getDocBaseUrl() . '/server/5.0/go.php?to=' . $key;
+ }
+
+ /**
* @brief Creates an absolute url
* @param string $app app
* @param string $file file
diff --git a/lib/private/setup.php b/lib/private/setup.php
index 6bf3c88370f..3cc1d29c6a4 100644
--- a/lib/private/setup.php
+++ b/lib/private/setup.php
@@ -183,7 +183,7 @@ class OC_Setup {
$error = $l->t('Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.');
$hint = $l->t('Please double check the <a href=\'%s\'>installation guides</a>.',
- 'http://doc.owncloud.org/server/5.0/admin_manual/installation.html');
+ link_to_docs('admin-install'));
OC_Template::printErrorPage($error, $hint);
exit();
diff --git a/lib/private/template/functions.php b/lib/private/template/functions.php
index 0aa2b27b96b..ce42633b364 100644
--- a/lib/private/template/functions.php
+++ b/lib/private/template/functions.php
@@ -36,6 +36,14 @@ function link_to( $app, $file, $args = array() ) {
}
/**
+ * @param $key
+ * @return string url to the online documentation
+ */
+function link_to_docs($key) {
+ return OC_Helper::linkToDocs($key);
+}
+
+/**
* @brief make OC_Helper::imagePath available as a simple function
* @param string $app app
* @param string $image image
diff --git a/lib/private/util.php b/lib/private/util.php
index 885cce87541..f63884c0f32 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -303,16 +303,16 @@ class OC_Util {
//common hint for all file permissions error messages
$permissionsHint = 'Permissions can usually be fixed by '
- .'<a href="' . $defaults->getDocBaseUrl() . '/server/5.0/admin_manual/installation/installation_source.html'
- .'#set-the-directory-permissions" target="_blank">giving the webserver write access to the root directory</a>.';
+ .'<a href="' . OC_Helper::linkToDocs('admin-dir_permissions')
+ .'" target="_blank">giving the webserver write access to the root directory</a>.';
// Check if config folder is writable.
if(!is_writable(OC::$SERVERROOT."/config/") or !is_readable(OC::$SERVERROOT."/config/")) {
$errors[] = array(
'error' => "Can't write into config directory",
'hint' => 'This can usually be fixed by '
- .'<a href="' . $defaults->getDocBaseUrl() . '/server/5.0/admin_manual/installation/installation_source.html'
- .'#set-the-directory-permissions" target="_blank">giving the webserver write access to the config directory</a>.'
+ .'<a href="' . OC_Helper::linkToDocs('admin-dir_permissions')
+ .'" target="_blank">giving the webserver write access to the config directory</a>.'
);
}
@@ -324,8 +324,8 @@ class OC_Util {
$errors[] = array(
'error' => "Can't write into apps directory",
'hint' => 'This can usually be fixed by '
- .'<a href="' . $defaults->getDocBaseUrl() . '/server/5.0/admin_manual/installation/installation_source.html'
- .'#set-the-directory-permissions" target="_blank">giving the webserver write access to the apps directory</a> '
+ .'<a href="' . OC_Helper::linkToDocs('admin-dir_permissions')
+ .'" target="_blank">giving the webserver write access to the apps directory</a> '
.'or disabling the appstore in the config file.'
);
}
@@ -340,8 +340,8 @@ class OC_Util {
$errors[] = array(
'error' => "Can't create data directory (".$CONFIG_DATADIRECTORY.")",
'hint' => 'This can usually be fixed by '
- .'<a href="' . $defaults->getDocBaseUrl() . '/server/5.0/admin_manual/installation/installation_source.html'
- .'#set-the-directory-permissions" target="_blank">giving the webserver write access to the root directory</a>.'
+ .'<a href="' . OC_Helper::linkToDocs('admin-dir_permissions')
+ .'" target="_blank">giving the webserver write access to the root directory</a>.'
);
}
} else if(!is_writable($CONFIG_DATADIRECTORY) or !is_readable($CONFIG_DATADIRECTORY)) {
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
index a2c877340ee..a5724bf3b17 100644
--- a/settings/templates/admin.php
+++ b/settings/templates/admin.php
@@ -30,7 +30,7 @@ if (!$_['isWebDavWorking']) {
<span class="securitywarning">
<?php p($l->t('Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.')); ?>
- <?php print_unescaped($l->t('Please double check the <a href="%s">installation guides</a>.', $theme->getDocBaseUrl().'/server/5.0/admin_manual/installation.html')); ?>
+ <?php print_unescaped($l->t('Please double check the <a href="%s">installation guides</a>.', link_to_docs('admin-install'))); ?>
</span>
</fieldset>
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index 60c509b4a1c..6c758e659a8 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -132,7 +132,7 @@ if($_['passwordChangeSupported']) {
<fieldset class="personalblock">
<h2><?php p($l->t('WebDAV'));?></h2>
<code><?php print_unescaped(OC_Helper::linkToRemote('webdav')); ?></code><br />
- <em><?php print_unescaped($l->t('Use this address to <a href="%s/server/5.0/user_manual/files/files.html" target="_blank">access your Files via WebDAV</a>', array($theme->getDocBaseUrl())));?></em>
+ <em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));?></em>
</fieldset>
<?php foreach($_['forms'] as $form) {