mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
Reformatting code (moving javascript to own file)
This commit is contained in:
parent
14870d74df
commit
9b84532e57
42
templates/kathrine/javascript.php
Normal file
42
templates/kathrine/javascript.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
$menus = get_template_menus();
|
||||||
|
|
||||||
|
function get_template_pages($category) {
|
||||||
|
global $menus;
|
||||||
|
|
||||||
|
$ret = array();
|
||||||
|
foreach($menus[$category] as $menu) {
|
||||||
|
$ret[] = $menu['link'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
var category = '<?php
|
||||||
|
if(strpos(URI, 'subtopic=') !== false) {
|
||||||
|
$tmp = array($_REQUEST['subtopic']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$tmp = URI;
|
||||||
|
if(empty($tmp)) {
|
||||||
|
$tmp = array('news');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$tmp = explode('/', URI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(in_array($tmp[0], get_template_pages(MENU_CATEGORY_NEWS)))
|
||||||
|
echo 'news';
|
||||||
|
elseif(in_array($tmp[0], get_template_pages(MENU_CATEGORY_LIBRARY)))
|
||||||
|
echo 'library';
|
||||||
|
elseif(in_array($tmp[0], get_template_pages(MENU_CATEGORY_COMMUNITY)))
|
||||||
|
echo 'community';
|
||||||
|
elseif(in_array($tmp[0], array_merge(get_template_pages(MENU_CATEGORY_ACCOUNT), array('account'))))
|
||||||
|
echo 'account';
|
||||||
|
elseif(in_array($tmp[0], get_template_pages(MENU_CATEGORY_SHOP)))
|
||||||
|
echo 'shops';
|
||||||
|
else {
|
||||||
|
echo 'news';
|
||||||
|
}
|
||||||
|
?>';
|
@ -13,48 +13,7 @@ defined('MYAAC') or die('Direct access not allowed!');
|
|||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="tools/basic.js"></script>
|
<script type="text/javascript" src="tools/basic.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<?php
|
<?php require 'javascript.php'; ?>
|
||||||
$menus = get_template_menus();
|
|
||||||
|
|
||||||
function get_template_pages($category) {
|
|
||||||
global $menus;
|
|
||||||
|
|
||||||
$ret = array();
|
|
||||||
foreach($menus[$category] as $menu) {
|
|
||||||
$ret[] = $menu['link'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $ret;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
var category = '<?php
|
|
||||||
if(strpos(URI, 'subtopic=') !== false) {
|
|
||||||
$tmp = array($_REQUEST['subtopic']);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$tmp = URI;
|
|
||||||
if(empty($tmp)) {
|
|
||||||
$tmp = array('news');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$tmp = explode('/', URI);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(in_array($tmp[0], get_template_pages(MENU_CATEGORY_NEWS)))
|
|
||||||
echo 'news';
|
|
||||||
elseif(in_array($tmp[0], get_template_pages(MENU_CATEGORY_LIBRARY)))
|
|
||||||
echo 'library';
|
|
||||||
elseif(in_array($tmp[0], get_template_pages(MENU_CATEGORY_COMMUNITY)))
|
|
||||||
echo 'community';
|
|
||||||
elseif(in_array($tmp[0], array_merge(get_template_pages(MENU_CATEGORY_ACCOUNT), array('account'))))
|
|
||||||
echo 'account';
|
|
||||||
elseif(in_array($tmp[0], get_template_pages(MENU_CATEGORY_SHOP)))
|
|
||||||
echo 'shops';
|
|
||||||
else {
|
|
||||||
echo 'news';
|
|
||||||
}
|
|
||||||
?>';
|
|
||||||
</script>
|
</script>
|
||||||
<?php echo template_place_holder('head_end'); ?>
|
<?php echo template_place_holder('head_end'); ?>
|
||||||
</head>
|
</head>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user