provide theme_init() functions

This commit is contained in:
friendica 2012-04-08 05:52:00 -07:00
parent 3afc9915e3
commit 741a5dba57
9 changed files with 20 additions and 0 deletions

View file

@ -922,6 +922,7 @@ function profile_load(&$a, $nickname, $profile = 0) {
/** /**
* load/reload current theme info * load/reload current theme info
*/ */
$theme_info_file = "view/theme/".current_theme()."/theme.php"; $theme_info_file = "view/theme/".current_theme()."/theme.php";
if (file_exists($theme_info_file)){ if (file_exists($theme_info_file)){
require_once($theme_info_file); require_once($theme_info_file);

View file

@ -258,6 +258,11 @@ if($a->module_loaded) {
$func($a); $func($a);
} }
if(function_exists(str_replace('-','_',current_theme()) . '_init')) {
$func = str_replace('-','_',current_theme()) . '_init';
$func($a);
}
if(($_SERVER['REQUEST_METHOD'] === 'POST') && (! $a->error) if(($_SERVER['REQUEST_METHOD'] === 'POST') && (! $a->error)
&& (function_exists($a->module . '_post')) && (function_exists($a->module . '_post'))
&& (! x($_POST,'auth-params'))) { && (! x($_POST,'auth-params'))) {

View file

@ -11,6 +11,7 @@ $a->theme_info = array(
'extends' => 'duepuntozero', 'extends' => 'duepuntozero',
); );
function darkzero_NS_init(&$a) {
$a->page['htmlhead'] .= <<< EOT $a->page['htmlhead'] .= <<< EOT
<script> <script>
$(document).ready(function() { $(document).ready(function() {
@ -57,3 +58,4 @@ $('.savedsearchterm').hover(
</script> </script>
EOT; EOT;
}

View file

@ -12,6 +12,7 @@ $a->theme_info = array(
'extends' => 'duepuntozero', 'extends' => 'duepuntozero',
); );
function darkzero_init(&$a) {
$a->page['htmlhead'] .= <<< EOT $a->page['htmlhead'] .= <<< EOT
<script> <script>
$(document).ready(function() { $(document).ready(function() {
@ -58,3 +59,4 @@ $('.savedsearchterm').hover(
</script> </script>
EOT; EOT;
}

View file

@ -1,6 +1,7 @@
<?php <?php
$a->theme_info = array(); $a->theme_info = array();
function duepuntozero_init(&$a) {
$a->page['htmlhead'] .= <<< EOT $a->page['htmlhead'] .= <<< EOT
<script> <script>
$(document).ready(function() { $(document).ready(function() {
@ -47,3 +48,4 @@ $('.savedsearchterm').hover(
</script> </script>
EOT; EOT;
}

View file

@ -3,6 +3,7 @@ $a->theme_info = array(
'extends' => 'duepuntozero', 'extends' => 'duepuntozero',
); );
function greenzero_init(&$a) {
$a->page['htmlhead'] .= <<< EOT $a->page['htmlhead'] .= <<< EOT
<script> <script>
$(document).ready(function() { $(document).ready(function() {
@ -49,3 +50,4 @@ $('.savedsearchterm').hover(
</script> </script>
EOT; EOT;
}

View file

@ -3,6 +3,7 @@ $a->theme_info = array(
'extends' => 'duepuntozero', 'extends' => 'duepuntozero',
); );
function purplezero_init(&$a) {
$a->page['htmlhead'] .= <<< EOT $a->page['htmlhead'] .= <<< EOT
<script> <script>
$(document).ready(function() { $(document).ready(function() {
@ -49,3 +50,4 @@ $('.savedsearchterm').hover(
</script> </script>
EOT; EOT;
}

View file

@ -3,6 +3,7 @@ $a->theme_info = array(
'extends' => 'duepuntozero', 'extends' => 'duepuntozero',
); );
function slack_NS_init(&$a) {
$a->page['htmlhead'] .= <<< EOT $a->page['htmlhead'] .= <<< EOT
<script> <script>
$(document).ready(function() { $(document).ready(function() {
@ -49,3 +50,4 @@ $('.savedsearchterm').hover(
</script> </script>
EOT; EOT;
}

View file

@ -3,6 +3,7 @@ $a->theme_info = array(
'extends' => 'duepuntozero', 'extends' => 'duepuntozero',
); );
function slackr_init(&$a) {
$a->page['htmlhead'] .= <<< EOT $a->page['htmlhead'] .= <<< EOT
<script> <script>
$(document).ready(function() { $(document).ready(function() {
@ -49,3 +50,4 @@ $('.savedsearchterm').hover(
</script> </script>
EOT; EOT;
}