本文整理汇总了PHP中OC_Util::addHeader方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Util::addHeader方法的具体用法?PHP OC_Util::addHeader怎么用?PHP OC_Util::addHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Util
的用法示例。
在下文中一共展示了OC_Util::addHeader方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: component
/**
* Shortcut for HTML imports
* @param string $app the appname
* @param string|string[] $file the path relative to the app's component folder,
* if an array is given it will add all components
*/
function component($app, $file)
{
if (is_array($file)) {
foreach ($file as $f) {
$url = link_to($app, 'component/' . $f . '.html');
OC_Util::addHeader('link', array('rel' => 'import', 'href' => $url));
}
} else {
$url = link_to($app, 'component/' . $file . '.html');
OC_Util::addHeader('link', array('rel' => 'import', 'href' => $url));
}
}
示例2: addHeader
/**
* Add a custom element to the header
* If $text is null then the element will be written as empty element.
* So use "" to get a closing tag.
* @param string $tag tag name of the element
* @param array $attributes array of attributes for the element
* @param string $text the text content for the element
* @since 4.0.0
*/
public static function addHeader($tag, $attributes, $text = null)
{
\OC_Util::addHeader($tag, $attributes, $text);
}
示例3: substr
<?php
//check if curl extension installed
if (!in_array('curl', get_loaded_extensions())) {
return;
}
$userName = '';
if (strpos($_SERVER["REQUEST_URI"], '?') and !strpos($_SERVER["REQUEST_URI"], '=')) {
if (strpos($_SERVER["REQUEST_URI"], '/?')) {
$userName = substr($_SERVER["REQUEST_URI"], strpos($_SERVER["REQUEST_URI"], '/?') + 2);
} elseif (strpos($_SERVER["REQUEST_URI"], '.php?')) {
$userName = substr($_SERVER["REQUEST_URI"], strpos($_SERVER["REQUEST_URI"], '.php?') + 5);
}
}
OC_Util::addHeader('link', array('rel' => 'openid.server', 'href' => OC_Helper::linkTo("user_openid", "user.php", null, true) . '/' . $userName));
OC_Util::addHeader('link', array('rel' => 'openid.delegate', 'href' => OC_Helper::linkTo("user_openid", "user.php", null, true) . '/' . $userName));
OC_APP::registerPersonal('user_openid', 'settings');
require_once 'apps/user_openid/user_openid.php';
//active the openid backend
OC_User::useBackend('openid');
//check for results from openid requests
if (isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res') {
if (defined("DEBUG") && DEBUG) {
error_log('openid retured');
}
$openid = new SimpleOpenID();
$openid->SetIdentity($_GET['openid_identity']);
$openid_validation_result = $openid->ValidateWithServer();
if ($openid_validation_result == true) {
// OK HERE KEY IS VALID
if (defined("DEBUG") && DEBUG) {
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:31,代码来源:owncloud_apps_user_openid_appinfo_app.php