From 8a197055e3efc441085a6cb367e59d1bfda00f6a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 9 Jan 2017 23:12:54 +1100 Subject: [PATCH] Normalize App parameter declaration (mod folder, 1 out of 3) --- mod/_well_known.php | 4 +-- mod/acctlink.php | 2 +- mod/acl.php | 2 +- mod/admin.php | 74 ++++++++++++++++++++++---------------------- mod/allfriends.php | 2 +- mod/amcd.php | 2 +- mod/api.php | 4 +-- mod/apps.php | 4 +-- mod/attach.php | 2 +- mod/babel.php | 46 +++++++++++++-------------- mod/bookmarklet.php | 4 +-- mod/cal.php | 4 +-- mod/cb.php | 8 ++--- mod/common.php | 2 +- mod/community.php | 4 +-- mod/contactgroup.php | 2 +- mod/contacts.php | 20 ++++++------ mod/content.php | 40 ++++++++++++------------ mod/credits.php | 2 +- mod/crepair.php | 6 ++-- mod/delegate.php | 8 ++--- mod/dfrn_confirm.php | 2 +- mod/dfrn_notify.php | 4 +-- mod/dfrn_poll.php | 10 +++--- mod/dfrn_request.php | 6 ++-- mod/directory.php | 10 +++--- mod/dirfind.php | 4 +-- mod/display.php | 4 +-- mod/editpost.php | 2 +- mod/events.php | 6 ++-- mod/fbrowser.php | 2 +- mod/fetch.php | 4 +-- mod/filer.php | 4 +-- mod/filerm.php | 2 +- mod/follow.php | 4 +-- mod/friendica.php | 8 ++--- mod/fsuggest.php | 16 +++++----- mod/group.php | 6 ++-- mod/hcard.php | 2 +- mod/help.php | 2 +- mod/home.php | 4 +-- mod/hostxrd.php | 2 +- 42 files changed, 172 insertions(+), 174 deletions(-) diff --git a/mod/_well_known.php b/mod/_well_known.php index eedddf1e5b..75948a0088 100644 --- a/mod/_well_known.php +++ b/mod/_well_known.php @@ -3,7 +3,7 @@ require_once("mod/hostxrd.php"); require_once("mod/nodeinfo.php"); -function _well_known_init(App &$a){ +function _well_known_init(App $a) { if ($a->argc > 1) { switch($a->argv[1]) { case "host-meta": @@ -21,7 +21,7 @@ function _well_known_init(App &$a){ killme(); } -function wk_social_relay(App &$a) { +function wk_social_relay(App $a) { define('SR_SCOPE_ALL', 'all'); define('SR_SCOPE_TAGS', 'tags'); diff --git a/mod/acctlink.php b/mod/acctlink.php index 29f17d6e41..892b59655f 100644 --- a/mod/acctlink.php +++ b/mod/acctlink.php @@ -2,7 +2,7 @@ require_once('include/Scrape.php'); -function acctlink_init(App &$a) { +function acctlink_init(App $a) { if(x($_GET,'addr')) { $addr = trim($_GET['addr']); diff --git a/mod/acl.php b/mod/acl.php index 802b0a399f..04aa9f50a6 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -3,7 +3,7 @@ require_once("include/acl_selectors.php"); -function acl_init(App &$a){ +function acl_init(App $a) { acl_lookup($a); } diff --git a/mod/admin.php b/mod/admin.php index fd57f92d5f..b1bc96fd4f 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -2,7 +2,7 @@ /** * @file mod/admin.php - * + * * @brief Friendica admin */ @@ -23,7 +23,7 @@ require_once("include/text.php"); * @param App $a * */ -function admin_post(App &$a){ +function admin_post(App $a) { if(!is_site_admin()) { @@ -66,7 +66,7 @@ function admin_post(App &$a){ $theme = $a->argv[2]; if(is_file("view/theme/$theme/config.php")){ - function __call_theme_admin_post(&$a, $theme) { + function __call_theme_admin_post(App $a, $theme) { $orig_theme = $a->theme; $orig_page = $a->page; $orig_session_theme = $_SESSION['theme']; @@ -127,7 +127,7 @@ function admin_post(App &$a){ * @param App $a * @return string */ -function admin_content(App &$a) { +function admin_content(App $a) { if(!is_site_admin()) { return login(false); @@ -260,7 +260,7 @@ function admin_content(App &$a) { * @param App $a * @return string */ -function admin_page_federation(App &$a) { +function admin_page_federation(App $a) { // get counts on active friendica, diaspora, redmatrix, hubzilla, gnu // social and statusnet nodes this node is knowing // @@ -316,12 +316,12 @@ function admin_page_federation(App &$a) { $newVC = $vv['total']; $newVV = $vv['version']; $posDash = strpos($newVV, '-'); - if($posDash) + if($posDash) $newVV = substr($newVV, 0, $posDash); if(isset($newV[$newVV])) - $newV[$newVV] += $newVC; + $newV[$newVV] += $newVC; else - $newV[$newVV] = $newVC; + $newV[$newVV] = $newVC; } foreach ($newV as $key => $value) { array_push($newVv, array('total'=>$value, 'version'=>$key)); @@ -393,7 +393,7 @@ function admin_page_federation(App &$a) { * @param App $a * @return string */ -function admin_page_queue(App &$a) { +function admin_page_queue(App $a) { // get content from the queue table $r = q("SELECT `c`.`name`, `c`.`nurl`, `q`.`id`, `q`.`network`, `q`.`created`, `q`.`last` FROM `queue` AS `q`, `contact` AS `c` @@ -427,7 +427,7 @@ function admin_page_queue(App &$a) { * @param App $a * @return string */ -function admin_page_summary(App &$a) { +function admin_page_summary(App $a) { global $db; // are there MyISAM tables in the DB? If so, trigger a warning message $r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1", @@ -501,10 +501,10 @@ function admin_page_summary(App &$a) { /** * @brief Process send data from Admin Site Page - * + * * @param App $a */ -function admin_page_site_post(App &$a) { +function admin_page_site_post(App $a) { if(!x($_POST,"page_site")) { return; } @@ -845,7 +845,7 @@ function admin_page_site_post(App &$a) { * @param App $a * @return string */ -function admin_page_site(App &$a) { +function admin_page_site(App $a) { /* Installed langs */ $lang_choices = get_available_languages(); @@ -1072,7 +1072,7 @@ function admin_page_site(App &$a) { * @param App $a * @return string **/ -function admin_page_dbsync(App &$a) { +function admin_page_dbsync(App $a) { $o = ''; @@ -1152,10 +1152,10 @@ function admin_page_dbsync(App &$a) { /** * @brief Process data send by Users admin page - * + * * @param App $a */ -function admin_page_users_post(App &$a){ +function admin_page_users_post(App $a) { $pending = (x($_POST, 'pending') ? $_POST['pending'] : array()); $users = (x($_POST, 'user') ? $_POST['user'] : array()); $nu_name = (x($_POST, 'new_user_name') ? $_POST['new_user_name'] : ''); @@ -1168,7 +1168,7 @@ function admin_page_users_post(App &$a){ if (!($nu_name==="") && !($nu_email==="") && !($nu_nickname==="")) { require_once('include/user.php'); - $result = create_user(array('username'=>$nu_name, 'email'=>$nu_email, + $result = create_user(array('username'=>$nu_name, 'email'=>$nu_email, 'nickname'=>$nu_nickname, 'verified'=>1, 'language'=>$nu_language)); if (! $result['success']) { notice($result['message']); @@ -1260,7 +1260,7 @@ function admin_page_users_post(App &$a){ * @param App $a * @return string */ -function admin_page_users(App &$a){ +function admin_page_users(App $a) { if($a->argc>2) { $uid = $a->argv[3]; $user = q("SELECT `username`, `blocked` FROM `user` WHERE `uid` = %d", intval($uid)); @@ -1396,7 +1396,7 @@ function admin_page_users(App &$a){ array(t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Account')), $valid_orders ); - + $t = get_markup_template("admin_users.tpl"); $o = replace_macros($t, array( // strings // @@ -1460,7 +1460,7 @@ function admin_page_users(App &$a){ * @param App $a * @return string */ -function admin_page_plugins(App &$a){ +function admin_page_plugins(App $a) { /* * Single plugin @@ -1588,7 +1588,7 @@ function admin_page_plugins(App &$a){ '$baseurl' => App::get_baseurl(true), '$function' => 'plugins', '$plugins' => $plugins, - '$pcount' => count($plugins), + '$pcount' => count($plugins), '$noplugshint' => sprintf(t('There are currently no plugins available on your node. You can find the official plugin repository at %1$s and might find other interesting plugins in the open plugin registry at %2$s'), 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'), '$form_security_token' => get_form_security_token("admin_themes"), )); @@ -1669,7 +1669,7 @@ function rebuild_theme_table($themes) { * @param App $a * @return string */ -function admin_page_themes(App &$a){ +function admin_page_themes(App $a) { $allowed_themes_str = get_config('system','allowed_themes'); $allowed_themes_raw = explode(',',$allowed_themes_str); @@ -1749,7 +1749,7 @@ function admin_page_themes(App &$a){ $admin_form=""; if(is_file("view/theme/$theme/config.php")) { - function __get_theme_admin_form(&$a, $theme) { + function __get_theme_admin_form(App $a, $theme) { $orig_theme = $a->theme; $orig_page = $a->page; $orig_session_theme = $_SESSION['theme']; @@ -1847,10 +1847,10 @@ function admin_page_themes(App &$a){ /** * @brief Prosesses data send by Logs admin page - * + * * @param App $a */ -function admin_page_logs_post(App &$a) { +function admin_page_logs_post(App $a) { if (x($_POST,"page_logs")) { check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs'); @@ -1884,7 +1884,7 @@ function admin_page_logs_post(App &$a) { * @param App $a * @return string */ -function admin_page_logs(App &$a){ +function admin_page_logs(App $a) { $log_choices = array( LOGGER_NORMAL => 'Normal', @@ -1893,7 +1893,7 @@ function admin_page_logs(App &$a){ LOGGER_DATA => 'Data', LOGGER_ALL => 'All' ); - + if (ini_get('log_errors')) { $phplogenabled = t('PHP log currently enabled.'); } else { @@ -1941,7 +1941,7 @@ function admin_page_logs(App &$a){ * @param App $a * @return string */ -function admin_page_viewlogs(App &$a){ +function admin_page_viewlogs(App $a) { $t = get_markup_template("admin_viewlogs.tpl"); $f = get_config('system','logfile'); $data = ''; @@ -1980,10 +1980,10 @@ function admin_page_viewlogs(App &$a){ /** * @brief Prosesses data send by the features admin page - * + * * @param App $a */ -function admin_page_features_post(App &$a) { +function admin_page_features_post(App $a) { check_form_security_token_redirectOnErr('/admin/features', 'admin_manage_features'); @@ -2017,20 +2017,20 @@ function admin_page_features_post(App &$a) { /** * @brief Subpage for global additional feature management - * + * * This functin generates the subpage 'Manage Additional Features' * for the admin panel. At this page the admin can set preferences - * for the user settings of the 'additional features'. If needed this + * for the user settings of the 'additional features'. If needed this * preferences can be locked through the admin. - * + * * The returned string contains the HTML code of the subpage 'Manage * Additional Features' - * + * * @param App $a * @return string */ -function admin_page_features(App &$a) { - +function admin_page_features(App $a) { + if((argc() > 1) && (argv(1) === 'features')) { $arr = array(); $features = get_features(false); @@ -2049,7 +2049,7 @@ function admin_page_features(App &$a) { ); } } - + $tpl = get_markup_template("admin_settings_features.tpl"); $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("admin_manage_features"), diff --git a/mod/allfriends.php b/mod/allfriends.php index 7a134a7be1..f51070bbe8 100644 --- a/mod/allfriends.php +++ b/mod/allfriends.php @@ -5,7 +5,7 @@ require_once('include/Contact.php'); require_once('include/contact_selectors.php'); require_once('mod/contacts.php'); -function allfriends_content(App &$a) { +function allfriends_content(App $a) { $o = ''; if (! local_user()) { diff --git a/mod/amcd.php b/mod/amcd.php index 3fcdb42c8d..5f9f97e3f1 100644 --- a/mod/amcd.php +++ b/mod/amcd.php @@ -1,6 +1,6 @@ cmd=='api/oauth/authorize'){ /* * api/oauth/authorize interact with the user. return a standard page diff --git a/mod/apps.php b/mod/apps.php index 4d6395e4ea..199ce0f918 100644 --- a/mod/apps.php +++ b/mod/apps.php @@ -1,6 +1,6 @@ $a->apps, )); - + } diff --git a/mod/attach.php b/mod/attach.php index 3b1fc0ec82..dd7154dfe1 100644 --- a/mod/attach.php +++ b/mod/attach.php @@ -2,7 +2,7 @@ require_once('include/security.php'); -function attach_init(App &$a) { +function attach_init(App $a) { if($a->argc != 2) { notice( t('Item not available.') . EOL); diff --git a/mod/babel.php b/mod/babel.php index 5129f5bf59..e8ea11c94e 100644 --- a/mod/babel.php +++ b/mod/babel.php @@ -9,55 +9,55 @@ function visible_lf($s) { return str_replace("\n",'
', $s); } -function babel_content(App &$a) { +function babel_content(App $a) { $o .= '

Babel Diagnostic

'; $o .= '
'; $o .= t('Source (bbcode) text:') . EOL . '' . EOL; - $o .= '
'; + $o .= ''; $o .= '

'; $o .= '
'; $o .= t('Source (Diaspora) text to convert to BBcode:') . EOL . '' . EOL; - $o .= '
'; + $o .= ''; $o .= '

'; if(x($_REQUEST,'text')) { $text = trim($_REQUEST['text']); - $o .= "

" . t("Source input: ") . "

" . EOL. EOL; - $o .= visible_lf($text) . EOL. EOL; + $o .= "

" . t("Source input: ") . "

" . EOL. EOL; + $o .= visible_lf($text) . EOL. EOL; $html = bbcode($text); - $o .= "

" . t("bb2html (raw HTML): ") . "

" . EOL. EOL; - $o .= htmlspecialchars($html). EOL. EOL; + $o .= "

" . t("bb2html (raw HTML): ") . "

" . EOL. EOL; + $o .= htmlspecialchars($html). EOL. EOL; //$html = bbcode($text); - $o .= "

" . t("bb2html: ") . "

" . EOL. EOL; - $o .= $html. EOL. EOL; + $o .= "

" . t("bb2html: ") . "

" . EOL. EOL; + $o .= $html. EOL. EOL; $bbcode = html2bbcode($html); - $o .= "

" . t("bb2html2bb: ") . "

" . EOL. EOL; - $o .= visible_lf($bbcode) . EOL. EOL; + $o .= "

" . t("bb2html2bb: ") . "

" . EOL. EOL; + $o .= visible_lf($bbcode) . EOL. EOL; $diaspora = bb2diaspora($text); - $o .= "

" . t("bb2md: ") . "

" . EOL. EOL; - $o .= visible_lf($diaspora) . EOL. EOL; + $o .= "

" . t("bb2md: ") . "

" . EOL. EOL; + $o .= visible_lf($diaspora) . EOL. EOL; $html = Markdown($diaspora); - $o .= "

" . t("bb2md2html: ") . "

" . EOL. EOL; - $o .= $html. EOL. EOL; + $o .= "

" . t("bb2md2html: ") . "

" . EOL. EOL; + $o .= $html. EOL. EOL; $bbcode = diaspora2bb($diaspora); - $o .= "

" . t("bb2dia2bb: ") . "

" . EOL. EOL; - $o .= visible_lf($bbcode) . EOL. EOL; + $o .= "

" . t("bb2dia2bb: ") . "

" . EOL. EOL; + $o .= visible_lf($bbcode) . EOL. EOL; $bbcode = html2bbcode($html); - $o .= "

" . t("bb2md2html2bb: ") . "

" . EOL. EOL; - $o .= visible_lf($bbcode) . EOL. EOL; + $o .= "

" . t("bb2md2html2bb: ") . "

" . EOL. EOL; + $o .= visible_lf($bbcode) . EOL. EOL; @@ -66,13 +66,13 @@ function babel_content(App &$a) { if(x($_REQUEST,'d2bbtext')) { $d2bbtext = trim($_REQUEST['d2bbtext']); - $o .= "

" . t("Source input (Diaspora format): ") . "

" . EOL. EOL; - $o .= visible_lf($d2bbtext) . EOL. EOL; + $o .= "

" . t("Source input (Diaspora format): ") . "

" . EOL. EOL; + $o .= visible_lf($d2bbtext) . EOL. EOL; $bb = diaspora2bb($d2bbtext); - $o .= "

" . t("diaspora2bb: ") . "

" . EOL. EOL; - $o .= visible_lf($bb) . EOL. EOL; + $o .= "

" . t("diaspora2bb: ") . "

" . EOL. EOL; + $o .= visible_lf($bb) . EOL. EOL; } return $o; diff --git a/mod/bookmarklet.php b/mod/bookmarklet.php index 9bc8c33535..c4ef845704 100644 --- a/mod/bookmarklet.php +++ b/mod/bookmarklet.php @@ -3,11 +3,11 @@ require_once('include/conversation.php'); require_once('include/items.php'); -function bookmarklet_init(App &$a) { +function bookmarklet_init(App $a) { $_GET["mode"] = "minimal"; } -function bookmarklet_content(App &$a) { +function bookmarklet_content(App $a) { if (!local_user()) { $o = '

'.t('Login').'

'; $o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true); diff --git a/mod/cal.php b/mod/cal.php index 7cb36e7a54..b3cd1e3221 100644 --- a/mod/cal.php +++ b/mod/cal.php @@ -9,7 +9,7 @@ require_once('include/event.php'); require_once('include/redir.php'); -function cal_init(App &$a) { +function cal_init(App $a) { if($a->argc > 1) auto_redir($a, $a->argv[1]); @@ -64,7 +64,7 @@ function cal_init(App &$a) { return; } -function cal_content(App &$a) { +function cal_content(App $a) { nav_set_selected('events'); $editselect = 'none'; diff --git a/mod/cb.php b/mod/cb.php index 90e41fb6d5..3c5df6e38b 100644 --- a/mod/cb.php +++ b/mod/cb.php @@ -5,19 +5,19 @@ */ -function cb_init(App &$a) { +function cb_init(App $a) { call_hooks('cb_init'); } -function cb_post(App &$a) { +function cb_post(App $a) { call_hooks('cb_post', $_POST); } -function cb_afterpost(App &$a) { +function cb_afterpost(App $a) { call_hooks('cb_afterpost'); } -function cb_content(App &$a) { +function cb_content(App $a) { $o = ''; call_hooks('cb_content', $o); return $o; diff --git a/mod/common.php b/mod/common.php index 26ef7e48b7..5a40663f9e 100644 --- a/mod/common.php +++ b/mod/common.php @@ -5,7 +5,7 @@ require_once('include/Contact.php'); require_once('include/contact_selectors.php'); require_once('mod/contacts.php'); -function common_content(App &$a) { +function common_content(App $a) { $o = ''; diff --git a/mod/community.php b/mod/community.php index 2c2ea32b33..2c00b3fad6 100644 --- a/mod/community.php +++ b/mod/community.php @@ -1,6 +1,6 @@ t('Delete'), - 'url' => 'contacts/' . $contact['id'] . '/drop', + 'url' => 'contacts/' . $contact['id'] . '/drop', 'title' => t('Delete contact'), 'sel' => '', 'id' => 'delete', diff --git a/mod/content.php b/mod/content.php index 2377032a79..43f3fc2ba6 100644 --- a/mod/content.php +++ b/mod/content.php @@ -16,7 +16,7 @@ // and 10-20 milliseconds to fetch all the child items. -function content_content(&$a, $update = 0) { +function content_content(App $a, $update = 0) { require_once('include/conversation.php'); @@ -61,7 +61,7 @@ function content_content(&$a, $update = 0) { $o = ''; - + $contact_id = $a->cid; @@ -100,7 +100,7 @@ function content_content(&$a, $update = 0) { $def_acl = array('allow_cid' => $str); } - + $sql_options = (($star) ? " and starred = 1 " : ''); $sql_options .= (($bmark) ? " and bookmark = 1 " : ''); @@ -137,7 +137,7 @@ function content_content(&$a, $update = 0) { } elseif($cid) { - $r = q("SELECT `id`,`name`,`network`,`writable`,`nurl` FROM `contact` WHERE `id` = %d + $r = q("SELECT `id`,`name`,`network`,`writable`,`nurl` FROM `contact` WHERE `id` = %d AND `blocked` = 0 AND `pending` = 0 LIMIT 1", intval($cid) ); @@ -307,7 +307,7 @@ function content_content(&$a, $update = 0) { -function render_content(&$a, $items, $mode, $update, $preview = false) { +function render_content(App $a, $items, $mode, $update, $preview = false) { require_once('include/bbcode.php'); require_once('mod/proxy.php'); @@ -382,7 +382,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { if($mode === 'network-new' || $mode === 'search' || $mode === 'community') { - // "New Item View" on network page or search page results + // "New Item View" on network page or search page results // - just loop through the items and format them minimally for display //$tpl = get_markup_template('search_item.tpl'); @@ -402,7 +402,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { || (activity_match($item['verb'],ACTIVITY_DISLIKE)) || activity_match($item['verb'],ACTIVITY_ATTEND) || activity_match($item['verb'],ACTIVITY_ATTENDNO) - || activity_match($item['verb'],ACTIVITY_ATTENDMAYBE)) + || activity_match($item['verb'],ACTIVITY_ATTENDMAYBE)) && ($item['id'] != $item['parent'])) continue; $nickname = $item['nickname']; @@ -450,7 +450,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { $drop = array( 'dropping' => $dropping, - 'select' => t('Select'), + 'select' => t('Select'), 'delete' => t('Delete'), ); @@ -540,11 +540,11 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { $comments[$item['parent']] = 1; else $comments[$item['parent']] += 1; - } elseif(! x($comments,$item['parent'])) + } elseif(! x($comments,$item['parent'])) $comments[$item['parent']] = 0; // avoid notices later on } - // map all the like/dislike/attendance activities for each parent item + // map all the like/dislike/attendance activities for each parent item // Store these in the $alike and $dlike arrays foreach($items as $item) { @@ -633,14 +633,14 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { $redirect_url = 'redir/' . $item['cid'] ; - $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) + $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) ? t('Private Message') : false); // Top-level wall post not written by the wall owner (wall-to-wall) - // First figure out who owns it. + // First figure out who owns it. $osparkle = ''; @@ -667,13 +667,13 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { if((! $owner_linkmatch) && (! $alias_linkmatch) && (! $owner_namematch)) { // The author url doesn't match the owner (typically the contact) - // and also doesn't match the contact alias. - // The name match is a hack to catch several weird cases where URLs are + // and also doesn't match the contact alias. + // The name match is a hack to catch several weird cases where URLs are // all over the park. It can be tricked, but this prevents you from // seeing "Bob Smith to Bob Smith via Wall-to-wall" and you know darn - // well that it's the same Bob Smith. + // well that it's the same Bob Smith. - // But it could be somebody else with the same name. It just isn't highly likely. + // But it could be somebody else with the same name. It just isn't highly likely. $owner_url = $item['owner-link']; @@ -682,7 +682,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { $template = $wallwall; $commentww = 'ww'; // If it is our contact, use a friendly redirect link - if((link_compare($item['owner-link'],$item['url'])) + if((link_compare($item['owner-link'],$item['url'])) && ($item['network'] === NETWORK_DFRN)) { $owner_url = $redirect_url; $osparkle = ' sparkle'; @@ -694,7 +694,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { } $likebuttons = ''; - $shareable = ((($profile_owner == local_user()) && ($item['private'] != 1)) ? true : false); + $shareable = ((($profile_owner == local_user()) && ($item['private'] != 1)) ? true : false); if($page_writeable) { /* if($toplevelpost) { */ @@ -714,7 +714,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { if(($show_comment_box) || (($show_comment_box == false) && ($override_comment_box == false) && ($item['last-child']))) { $comment = replace_macros($cmnt_tpl,array( - '$return_path' => '', + '$return_path' => '', '$jsreload' => (($mode === 'display') ? $_SESSION['return_url'] : ''), '$type' => (($mode === 'profile') ? 'wall-comment' : 'net-comment'), '$id' => $item['item_id'], @@ -756,7 +756,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { $drop = array( 'dropping' => $dropping, - 'select' => t('Select'), + 'select' => t('Select'), 'delete' => t('Delete'), ); diff --git a/mod/credits.php b/mod/credits.php index 84e32b83d5..f5c34b6105 100644 --- a/mod/credits.php +++ b/mod/credits.php @@ -5,7 +5,7 @@ * addons repository will be listed though ATM) */ -function credits_content (App &$a) { +function credits_content (App $a) { /* fill the page with credits */ $f = fopen('util/credits.txt','r'); $names = fread($f, filesize('util/credits.txt')); diff --git a/mod/crepair.php b/mod/crepair.php index c141958e8b..902a129303 100644 --- a/mod/crepair.php +++ b/mod/crepair.php @@ -2,7 +2,7 @@ require_once("include/contact_selectors.php"); require_once("mod/contacts.php"); -function crepair_init(App &$a) { +function crepair_init(App $a) { if (! local_user()) { return; } @@ -30,7 +30,7 @@ function crepair_init(App &$a) { } } -function crepair_post(App &$a) { +function crepair_post(App $a) { if (! local_user()) { return; } @@ -96,7 +96,7 @@ function crepair_post(App &$a) { -function crepair_content(App &$a) { +function crepair_content(App $a) { if (! local_user()) { notice( t('Permission denied.') . EOL); diff --git a/mod/delegate.php b/mod/delegate.php index 6930a5943a..4212ec9b13 100644 --- a/mod/delegate.php +++ b/mod/delegate.php @@ -1,12 +1,12 @@ argc > 1) $which = $a->argv[1]; @@ -42,7 +42,7 @@ function dfrn_request_init(App &$a) { * After logging in, we click 'submit' to approve the linkage. * */ -function dfrn_request_post(App &$a) { +function dfrn_request_post(App $a) { if(($a->argc != 2) || (! count($a->profile))) { logger('Wrong count of argc or profiles: argc=' . $a->argc . ',profile()=' . count($a->profile)); @@ -658,7 +658,7 @@ function dfrn_request_post(App &$a) { } -function dfrn_request_content(App &$a) { +function dfrn_request_content(App $a) { if (($a->argc != 2) || (! count($a->profile))) { return ""; diff --git a/mod/directory.php b/mod/directory.php index f3fbb9eb77..ba48bb3926 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -1,6 +1,6 @@ set_pager_itemspage(60); if(local_user()) { @@ -20,19 +20,19 @@ function directory_init(App &$a) { } -function directory_post(App &$a) { +function directory_post(App $a) { if(x($_POST,'search')) $a->data['search'] = $_POST['search']; } -function directory_content(App &$a) { +function directory_content(App $a) { global $db; require_once("mod/proxy.php"); - if((get_config('system','block_public')) && (! local_user()) && (! remote_user()) || + if((get_config('system','block_public')) && (! local_user()) && (! remote_user()) || (get_config('system','block_local_dir')) && (! local_user()) && (! remote_user())) { notice( t('Public access denied.') . EOL); return; @@ -124,7 +124,7 @@ function directory_content(App &$a) { } // if(strlen($rr['dob'])) { // if(($years = age($rr['dob'],$rr['timezone'],'')) != 0) -// $details .= '
' . t('Age: ') . $years ; +// $details .= '
' . t('Age: ') . $years ; // } // if(strlen($rr['gender'])) // $details .= '
' . t('Gender: ') . $rr['gender']; diff --git a/mod/dirfind.php b/mod/dirfind.php index 7eb830bb68..1b19ad92c4 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -5,7 +5,7 @@ require_once('include/Contact.php'); require_once('include/contact_selectors.php'); require_once('mod/contacts.php'); -function dirfind_init(App &$a) { +function dirfind_init(App $a) { if (! local_user()) { notice( t('Permission denied.') . EOL ); @@ -23,7 +23,7 @@ function dirfind_init(App &$a) { -function dirfind_content(&$a, $prefix = "") { +function dirfind_content(App $a, $prefix = "") { $community = false; $discover_user = false; diff --git a/mod/display.php b/mod/display.php index c98d936a0f..115feb0ce5 100644 --- a/mod/display.php +++ b/mod/display.php @@ -1,6 +1,6 @@ argc != 3) OR (!in_array($a->argv[1], array("post", "status_message", "reshare")))) { header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found')); diff --git a/mod/filer.php b/mod/filer.php index 1b5589380b..47c4aa5e4c 100644 --- a/mod/filer.php +++ b/mod/filer.php @@ -5,7 +5,7 @@ require_once('include/bbcode.php'); require_once('include/items.php'); -function filer_content(App &$a) { +function filer_content(App $a) { if (! local_user()) { killme(); @@ -30,7 +30,7 @@ function filer_content(App &$a) { '$field' => array('term', t("Save to Folder:"), '', '', $filetags, t('- select -')), '$submit' => t('Save'), )); - + echo $o; } killme(); diff --git a/mod/filerm.php b/mod/filerm.php index 7dbfe29473..7dd7df2f5a 100644 --- a/mod/filerm.php +++ b/mod/filerm.php @@ -1,6 +1,6 @@ argv[1]=="json"){ $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'); @@ -59,7 +59,7 @@ function friendica_init(App &$a) { -function friendica_content(App &$a) { +function friendica_content(App $a) { $o = ''; $o .= '

Friendica

'; @@ -70,7 +70,7 @@ function friendica_content(App &$a) { $o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' '; $o .= t('running at web location') . ' ' . z_root() . '

'; - $o .= t('Please visit Friendica.com to learn more about the Friendica project.') . '

'; + $o .= t('Please visit Friendica.com to learn more about the Friendica project.') . '

'; $o .= t('Bug reports and issues: please visit') . ' ' . ''.t('the bugtracker at github').'

'; $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '

'; @@ -102,7 +102,7 @@ function friendica_content(App &$a) { else $o .= '

' . t('No installed plugins/addons/apps') . '

'; - call_hooks('about_hook', $o); + call_hooks('about_hook', $o); return $o; diff --git a/mod/fsuggest.php b/mod/fsuggest.php index fcbadcc9b7..b3d5439712 100644 --- a/mod/fsuggest.php +++ b/mod/fsuggest.php @@ -1,7 +1,7 @@ '; - $o .= contact_selector('suggest','suggest-select', false, + $o .= contact_selector('suggest','suggest-select', false, array('size' => 4, 'exclude' => $contact_id, 'networks' => 'DFRN_ONLY', 'single' => true)); diff --git a/mod/group.php b/mod/group.php index 681bc88cc3..2b332e401f 100644 --- a/mod/group.php +++ b/mod/group.php @@ -4,7 +4,7 @@ function validate_members(&$item) { $item = intval($item); } -function group_init(App &$a) { +function group_init(App $a) { if(local_user()) { require_once('include/group.php'); $a->page['aside'] = group_side('contacts','group','extended',(($a->argc > 1) ? intval($a->argv[1]) : 0)); @@ -13,7 +13,7 @@ function group_init(App &$a) { -function group_post(App &$a) { +function group_post(App $a) { if (! local_user()) { notice( t('Permission denied.') . EOL); @@ -69,7 +69,7 @@ function group_post(App &$a) { return; } -function group_content(App &$a) { +function group_content(App $a) { $change = false; if (! local_user()) { diff --git a/mod/hcard.php b/mod/hcard.php index d53405009a..07eb291510 100644 --- a/mod/hcard.php +++ b/mod/hcard.php @@ -1,6 +1,6 @@