1
0
Fork 0

*much* more usage of App::get_baseurl() instead of $a->get_baseurl() (coding convention applied)

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2016-12-19 14:26:13 +01:00
commit 884f44ce94
108 changed files with 407 additions and 437 deletions

View file

@ -38,7 +38,7 @@ function theme_admin_post(&$a){
}
}
/// @TODO $a is no longer used
function clean_form(&$a, &$colorset, $user){
$colorset = array(
'default'=>t('default'),
@ -56,9 +56,9 @@ function clean_form(&$a, &$colorset, $user){
}
$t = get_markup_template("theme_settings.tpl" );
$o .= replace_macros($t, array(
'$submit' => t('Submit'),
'$baseurl' => $a->get_baseurl(),
'$title' => t("Theme settings"),
'$submit' => t('Submit'),
'$baseurl' => App::get_baseurl(),
'$title' => t("Theme settings"),
'$colorset' => array('duepuntozero_colorset', t('Variations'), $color, '', $colorset),
));
return $o;

View file

@ -57,7 +57,7 @@ function frio_form(&$a, $arr) {
$t = get_markup_template('theme_settings.tpl');
$o .= replace_macros($t, array(
'$submit' => t('Submit'),
'$baseurl' => $a->get_baseurl(),
'$baseurl' => App::get_baseurl(),
'$title' => t("Theme settings"),
'$schema' => array('frio_schema', t("Select scheme"), $arr["schema"], '', $scheme_choices),
'$nav_bg' => array_key_exists("nav_bg", $disable) ? "" : array('frio_nav_bg', t('Navigation bar background color'), $arr['nav_bg']),

View file

@ -18,9 +18,9 @@
<head>
<title><?php if(x($page,'title')) echo $page['title'] ?></title>
<meta request="<?php echo htmlspecialchars($_REQUEST['pagename']) ?> ">
<script>var baseurl="<?php echo $a->get_baseurl() ?>";</script>
<script>var baseurl="<?php echo App::get_baseurl() ?>";</script>
<script>var frio="<?php echo "view/theme/frio"; ?>";</script>
<?php $baseurl = $a->get_baseurl(); ?>
<?php $baseurl = App::get_baseurl(); ?>
<?php $frio = "view/theme/frio"; ?>
<?php
// Because we use minimal for modals the header and the included js stuff should be only loaded

View file

@ -12,9 +12,9 @@
<title><?php if(x($page,'title')) echo $page['title'] ?></title>
<meta name="viewport" content="initial-scale=1.0">
<meta request="<?php echo htmlspecialchars($_REQUEST['pagename']) ?> ">
<script>var baseurl="<?php echo $a->get_baseurl() ?>";</script>
<script>var baseurl="<?php echo App::get_baseurl() ?>";</script>
<script>var frio="<?php echo "view/theme/frio"; ?>";</script>
<?php $baseurl = $a->get_baseurl(); ?>
<?php $baseurl = App::get_baseurl(); ?>
<?php $frio = "view/theme/frio"; ?>
<?php if(x($page,'htmlhead')) echo $page['htmlhead']; ?>

View file

@ -21,7 +21,7 @@ function frio_init(&$a) {
set_template_engine($a, 'smarty3');
$baseurl = $a->get_baseurl();
$baseurl = App::get_baseurl();
$style = get_pconfig(local_user(), 'frio', 'style');

View file

@ -2,7 +2,7 @@
<html lang="<?php echo $lang; ?>">
<head>
<title><?php if(x($page,'title')) echo $page['title'] ?></title>
<script>var baseurl="<?php echo $a->get_baseurl() ?>";</script>
<script>var baseurl="<?php echo App::get_baseurl() ?>";</script>
<?php if(x($page,'htmlhead')) echo $page['htmlhead'] ?>
</head>
<body <?php if($a->module === 'home') echo 'onLoad="setTimeout(\'homeRedirect()\', 1500)"'?>>

View file

@ -23,8 +23,8 @@ function frost_mobile_content_loaded(&$a) {
// I could do this in style.php, but by having the CSS in a file the browser will cache it,
// making pages load faster
if( $a->module === 'home' || $a->module === 'login' || $a->module === 'register' || $a->module === 'lostpass' ) {
// $a->page['htmlhead'] = str_replace('$stylesheet', $a->get_baseurl() . '/view/theme/frost-mobile/login-style.css', $a->page['htmlhead']);
$a->theme['stylesheet'] = $a->get_baseurl() . '/view/theme/frost-mobile/login-style.css';
// $a->page['htmlhead'] = str_replace('$stylesheet', App::get_baseurl() . '/view/theme/frost-mobile/login-style.css', $a->page['htmlhead']);
$a->theme['stylesheet'] = App::get_baseurl() . '/view/theme/frost-mobile/login-style.css';
}
if( $a->module === 'login' )
$a->page['end'] .= '<script type="text/javascript"> $(document).ready(function() { $("#id_" + window.loginName).focus();} );</script>';

View file

@ -2,7 +2,7 @@
<html lang="<?php echo $lang; ?>">
<head>
<title><?php if(x($page,'title')) echo $page['title'] ?></title>
<script>var baseurl="<?php echo $a->get_baseurl() ?>";</script>
<script>var baseurl="<?php echo App::get_baseurl() ?>";</script>
<?php if(x($page,'htmlhead')) echo $page['htmlhead'] ?>
</head>
<body <?php if($a->module === 'home') echo 'onLoad="setTimeout(\'homeRedirect()\', 1500)"'?>>

View file

@ -21,8 +21,8 @@ function frost_content_loaded(&$a) {
// I could do this in style.php, but by having the CSS in a file the browser will cache it,
// making pages load faster
if( $a->module === 'home' || $a->module === 'login' || $a->module === 'register' || $a->module === 'lostpass' ) {
//$a->page['htmlhead'] = str_replace('$stylesheet', $a->get_baseurl() . '/view/theme/frost/login-style.css', $a->page['htmlhead']);
$a->theme['stylesheet'] = $a->get_baseurl() . '/view/theme/frost/login-style.css';
//$a->page['htmlhead'] = str_replace('$stylesheet', App::get_baseurl() . '/view/theme/frost/login-style.css', $a->page['htmlhead']);
$a->theme['stylesheet'] = App::get_baseurl() . '/view/theme/frost/login-style.css';
}
if( $a->module === 'login' )
$a->page['end'] .= '<script type="text/javascript"> $(document).ready(function() { $("#id_" + window.loginName).focus();} );</script>';

View file

@ -48,7 +48,7 @@ function theme_admin_post(&$a){
}
}
/// @TODO $a is no longer used here
function quattro_form(&$a, $align, $color, $tfs, $pfs){
$colors = array(
"dark"=>"Quattro",
@ -62,7 +62,7 @@ function quattro_form(&$a, $align, $color, $tfs, $pfs){
$t = get_markup_template("theme_settings.tpl" );
$o .= replace_macros($t, array(
'$submit' => t('Submit'),
'$baseurl' => $a->get_baseurl(),
'$baseurl' => App::get_baseurl(),
'$title' => t("Theme settings"),
'$align' => array('quattro_align', t('Alignment'), $align, '', array('left'=>t('Left'), 'center'=>t('Center'))),
'$color' => array('quattro_color', t('Color scheme'), $color, '', $colors),

View file

@ -8,6 +8,6 @@
*/
function quattro_init(&$a) {
$a->page['htmlhead'] .= '<script src="'.$a->get_baseurl().'/view/theme/quattro/tinycon.min.js"></script>';
$a->page['htmlhead'] .= '<script src="'.$a->get_baseurl().'/view/theme/quattro/js/quattro.js"></script>';;
$a->page['htmlhead'] .= '<script src="'.App::get_baseurl().'/view/theme/quattro/tinycon.min.js"></script>';
$a->page['htmlhead'] .= '<script src="'.App::get_baseurl().'/view/theme/quattro/js/quattro.js"></script>';;
}

View file

@ -2,7 +2,7 @@
<html>
<head>
<title><?php if(x($page,'title')) echo $page['title'] ?></title>
<script>var baseurl="<?php echo $a->get_baseurl() ?>";</script>
<script>var baseurl="<?php echo App::get_baseurl() ?>";</script>
<script type="text/javascript">
function ScrollToBottom(){
window.scrollTo(0,document.body.scrollHeight);

View file

@ -15,7 +15,7 @@ function smoothly_init(&$a) {
$cssFile = null;
$ssl_state = null;
$baseurl = $a->get_baseurl($ssl_state);
$baseurl = App::get_baseurl($ssl_state);
$a->page['htmlhead'] .= <<< EOT
<script>
@ -114,7 +114,7 @@ if(! function_exists('_js_in_foot')) {
*/
$a = get_app();
$ssl_state = null;
$baseurl = $a->get_baseurl($ssl_state);
$baseurl = App::get_baseurl($ssl_state);
$bottom['$baseurl'] = $baseurl;
$tpl = get_markup_template('bottom.tpl');

View file

@ -89,7 +89,7 @@ function theme_admin_post(&$a){
}
}
/// @TODO $a is no longer used
function vier_form(&$a, $style, $show_pages, $show_profiles, $show_helpers, $show_services, $show_friends, $show_lastusers){
$styles = array(
"plus"=>"Plus",
@ -105,7 +105,7 @@ function vier_form(&$a, $style, $show_pages, $show_profiles, $show_helpers, $sho
$t = get_markup_template("theme_settings.tpl");
$o .= replace_macros($t, array(
'$submit' => t('Submit'),
'$baseurl' => $a->get_baseurl(),
'$baseurl' => App::get_baseurl(),
'$title' => t("Theme settings"),
'$style' => array('vier_style',t ('Set style'),$style,'',$styles),
'$show_pages' => array('vier_show_pages', t('Community Pages'), $show_pages, '', $show_or_not),

View file

@ -138,7 +138,7 @@ function vier_community_info() {
$show_lastusers = get_vier_config("show_lastusers", 1);
//get_baseurl
$url = $a->get_baseurl($ssl_state);
$url = App::get_baseurl($ssl_state);
$aside['$url'] = $url;
// comunity_profiles