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,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
|
||||
function get_theme_config_file($theme){
|
||||
if(! function_exists('get_theme_config_file')) {
|
||||
function get_theme_config_file($theme) {
|
||||
$a = get_app();
|
||||
$base_theme = $a->theme_info['extends'];
|
||||
|
||||
|
@ -13,7 +13,9 @@ function get_theme_config_file($theme){
|
|||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(! function_exists('settings_init')) {
|
||||
function settings_init(&$a) {
|
||||
|
||||
if(! local_user()) {
|
||||
|
@ -110,10 +112,10 @@ function settings_init(&$a) {
|
|||
'$class' => 'settings-widget',
|
||||
'$items' => $tabs,
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(! function_exists('settings_post')) {
|
||||
function settings_post(&$a) {
|
||||
|
||||
if(! local_user())
|
||||
|
@ -630,8 +632,9 @@ function settings_post(&$a) {
|
|||
goaway($a->get_baseurl(true) . '/settings' );
|
||||
return; // NOTREACHED
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(! function_exists('settings_content')) {
|
||||
function settings_content(&$a) {
|
||||
|
||||
$o = '';
|
||||
|
@ -1295,6 +1298,5 @@ function settings_content(&$a) {
|
|||
$o .= '</form>' . "\r\n";
|
||||
|
||||
return $o;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue