From 1cd3b4182595b838a535dd6b6990251db05d49e6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 30 Mar 2016 22:13:24 -0700 Subject: deprecate $a->get_baseurl() --- mod/profiles.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index f891c6033..fca2ff429 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -17,7 +17,7 @@ function profiles_init(&$a) { ); if(! count($r)) { notice( t('Profile not found.') . EOL); - goaway($a->get_baseurl(true) . '/profiles'); + goaway(z_root() . '/profiles'); return; // NOTREACHED } $profile_guid = $r['profile_guid']; @@ -44,7 +44,7 @@ function profiles_init(&$a) { // profiles_build_sync(local_channel()); - goaway($a->get_baseurl(true) . '/profiles'); + goaway(z_root() . '/profiles'); return; // NOTREACHED } @@ -83,9 +83,9 @@ function profiles_init(&$a) { info( t('New profile created.') . EOL); if(count($r3) == 1) - goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']); + goaway(z_root() . '/profiles/' . $r3[0]['id']); - goaway($a->get_baseurl(true) . '/profiles'); + goaway(z_root() . '/profiles'); } if((argc() > 2) && (argv(1) === 'clone')) { @@ -129,9 +129,9 @@ function profiles_init(&$a) { profiles_build_sync(local_channel()); if(($r3) && (count($r3) == 1)) - goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']); + goaway(z_root() . '/profiles/' . $r3[0]['id']); - goaway($a->get_baseurl(true) . '/profiles'); + goaway(z_root() . '/profiles'); return; // NOTREACHED } @@ -629,7 +629,7 @@ function profiles_content(&$a) { // $editselect = 'textareas'; $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array( - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$editselect' => $editselect, )); @@ -703,7 +703,7 @@ function profiles_content(&$a) { '$lbl_gender' => t('Your gender'), '$lbl_marital' => t('Marital status'), '$lbl_sexual' => t('Sexual preference'), - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$profile_id' => $r[0]['id'], '$profile_name' => array('profile_name', t('Profile name'), $r[0]['profile_name'], t('Required'), '*'), '$is_default' => $is_default, @@ -767,7 +767,7 @@ function profiles_content(&$a) { '$profile_name' => $rr['profile_name'], '$visible' => (($rr['is_default']) ? '' . translate_scope(map_scope($channel['channel_r_profile'])) . '' - : '' . t('Edit visibility') . '') + : '' . t('Edit visibility') . '') )); } -- cgit v1.2.3 From 9abd95fad3784a10fc48bc40f9b8a75d7d74edda Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 31 Mar 2016 16:06:03 -0700 Subject: static App --- mod/profiles.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index fca2ff429..75c05b634 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -99,11 +99,11 @@ function profiles_init(&$a) { $name = t('Profile-') . ($num_profiles + 1); $r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1", intval(local_channel()), - intval($a->argv[2]) + intval(App::$argv[2]) ); if(! count($r1)) { notice( t('Profile unavailable to clone.') . EOL); - $a->error = 404; + App::$error = 404; return; } unset($r1[0]['id']); @@ -144,7 +144,7 @@ function profiles_init(&$a) { ); if(! $r1) { notice( t('Profile unavailable to export.') . EOL); - $a->error = 404; + App::$error = 404; return; } header('content-type: application/octet_stream'); @@ -168,7 +168,7 @@ function profiles_init(&$a) { // we start loading content if(((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_channel(),'multi_profiles')) { if(feature_enabled(local_channel(),'multi_profiles')) - $id = $a->argv[1]; + $id = App::$argv[1]; else { $x = q("select id from profile where uid = %d and is_default = 1", intval(local_channel()) @@ -182,11 +182,11 @@ function profiles_init(&$a) { ); if(! count($r)) { notice( t('Profile not found.') . EOL); - $a->error = 404; + App::$error = 404; return; } - $chan = $a->get_channel(); + $chan = App::get_channel(); profile_load($a,$chan['channel_address'],$r[0]['id']); } @@ -234,7 +234,7 @@ function profiles_post(&$a) { if((argc() > 1) && (argv(1) !== "new") && intval(argv(1))) { $orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1", - intval($a->argv[1]), + intval(App::$argv[1]), intval(local_channel()) ); if(! count($orig)) { @@ -563,7 +563,7 @@ function profiles_post(&$a) { build_sync_packet(local_channel(),array('profile' => $r)); } - $channel = $a->get_channel(); + $channel = App::get_channel(); if($namechanged && $is_default) { $r = q("UPDATE xchan SET xchan_name = '%s', xchan_name_date = '%s' WHERE xchan_hash = '%s'", @@ -590,7 +590,7 @@ function profiles_content(&$a) { $o = ''; - $channel = $a->get_channel(); + $channel = App::get_channel(); if(! local_channel()) { notice( t('Permission denied.') . EOL); @@ -604,7 +604,7 @@ function profiles_content(&$a) { if(((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_channel(),'multi_profiles')) { if(feature_enabled(local_channel(),'multi_profiles')) - $id = $a->argv[1]; + $id = App::$argv[1]; else { $x = q("select id from profile where uid = %d and is_default = 1", intval(local_channel()) @@ -628,7 +628,7 @@ function profiles_content(&$a) { // if(feature_enabled(local_channel(),'richtext')) // $editselect = 'textareas'; - $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array( + App::$page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array( '$baseurl' => z_root(), '$editselect' => $editselect, )); -- cgit v1.2.3