Skip to content

Commit

Permalink
refs #1720 : modified - move body scripts to head.
Browse files Browse the repository at this point in the history
 -
  • Loading branch information
inureyes committed Dec 16, 2014
1 parent f207085 commit a223791
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions interface/common/blog/begin.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
$canonicalLink = '';
}
dress('SKIN_head_end', $automaticLink.$canonicalLink."[##_SKIN_head_end_##]", $view);
$view = str_replace('[##_SKIN_head_end_##]',getScriptsOnHead().'[##_SKIN_head_end_##]', $view); // TO DO : caching this part.
$view = str_replace('[##_SKIN_body_start_##]',getUpperView((isset($paging) ? $paging : null),$entryIds).'[##_SKIN_body_start_##]', $view);
$view = str_replace('[##_SKIN_head_end_##]',getScriptsOnHead((isset($paging) ? $paging : null),$entryIds).'[##_SKIN_head_end_##]', $view); // TO DO : caching this part.
$view = str_replace('[##_SKIN_body_start_##]',getUpperView().'[##_SKIN_body_start_##]', $view);
$view = str_replace('[##_SKIN_body_end_##]',getLowerView().getScriptsOnFoot().'[##_SKIN_body_end_##]', $view); // care the order for js function overloading issue.

$browserUtil = Utils_Browser::getInstance();
Expand Down
34 changes: 17 additions & 17 deletions library/view/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function dressInsertBefore($tag, $value, & $contents, $useCache = false, $forceP
}
}

function getScriptsOnHead() {
function getScriptsOnHead($paging, $entryIds = null) {
$context = Model_Context::getInstance();
ob_start();
?>
Expand All @@ -74,22 +74,6 @@ function getScriptsOnHead() {
<script type="text/javascript" src="<?php echo $context->getProperty('service.resourcepath');?>/script/common2.js"></script>
<script type="text/javascript" src="<?php echo $context->getProperty('service.resourcepath');?>/script/gallery.js" ></script>
<script type="text/javascript" src="<?php echo $context->getProperty('service.resourcepath');?>/script/flash.js" ></script>
<?php
$view = ob_get_contents();
ob_end_clean();
return $view;
}

function getUpperView($paging, $entryIds = null) {
$context = Model_Context::getInstance();
ob_start();
?>
<!--
<?php echo TEXTCUBE_NAME." ".TEXTCUBE_VERSION.CRLF;?>

Homepage: <?php echo TEXTCUBE_HOMEPAGE.CRLF;?>
<?php echo TEXTCUBE_COPYRIGHT.CRLF;?>
-->
<script type="text/javascript">
//<![CDATA[
var servicePath = "<?php echo $context->getProperty('service.path');?>";
Expand All @@ -116,6 +100,22 @@ function getUpperView($paging, $entryIds = null) {
}
//]]>
</script>
<?php
$view = ob_get_contents();
ob_end_clean();
return $view;
}

function getUpperView() {
$context = Model_Context::getInstance();
ob_start();
?>
<!--
<?php echo TEXTCUBE_NAME." ".TEXTCUBE_VERSION.CRLF;?>

Homepage: <?php echo TEXTCUBE_HOMEPAGE.CRLF;?>
<?php echo TEXTCUBE_COPYRIGHT.CRLF;?>
-->
<?php
if (doesHaveOwnership()) {
?>
Expand Down

0 comments on commit a223791

Please sign in to comment.