Updated modules to allow for partial overrides without errors
Only define functions if they have not been defined before, e.g. in themes. This makes it possible to override parts of a module and still use the other functions.
This commit is contained in:
parent
a81d929cdf
commit
db949bb802
123 changed files with 768 additions and 471 deletions
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists('hcard_init')) {
|
||||
function hcard_init(&$a) {
|
||||
|
||||
$blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
|
||||
|
@ -15,7 +16,7 @@ function hcard_init(&$a) {
|
|||
$profile = 0;
|
||||
if((local_user()) && ($a->argc > 2) && ($a->argv[2] === 'view')) {
|
||||
$which = $a->user['nickname'];
|
||||
$profile = $a->argv[1];
|
||||
$profile = $a->argv[1];
|
||||
}
|
||||
|
||||
profile_load($a,$which,$profile);
|
||||
|
@ -23,7 +24,7 @@ function hcard_init(&$a) {
|
|||
if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) {
|
||||
$a->page['htmlhead'] .= '<meta name="friendica.community" content="true" />';
|
||||
}
|
||||
if(x($a->profile,'openidserver'))
|
||||
if(x($a->profile,'openidserver'))
|
||||
$a->page['htmlhead'] .= '<link rel="openid.server" href="' . $a->profile['openidserver'] . '" />' . "\r\n";
|
||||
if(x($a->profile,'openid')) {
|
||||
$delegate = ((strstr($a->profile['openid'],'://')) ? $a->profile['openid'] : 'http://' . $a->profile['openid']);
|
||||
|
@ -42,10 +43,9 @@ function hcard_init(&$a) {
|
|||
$uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : ''));
|
||||
$a->page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . $a->get_baseurl() . '/xrd/?uri=' . $uri . '" />' . "\r\n";
|
||||
header('Link: <' . $a->get_baseurl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
|
||||
|
||||
|
||||
$dfrn_pages = array('request', 'confirm', 'notify', 'poll');
|
||||
foreach($dfrn_pages as $dfrn)
|
||||
$a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"".$a->get_baseurl()."/dfrn_{$dfrn}/{$which}\" />\r\n";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue