Merge branch 'develop' into rewrites/dbm_is_result
Signed-off-by: Roland Häder <roland@mxchange.org> Conflicts: mod/events.php mod/fbrowser.php mod/group.php view/theme/quattro/theme.php
This commit is contained in:
commit
35973b9273
9
boot.php
9
boot.php
|
@ -1537,7 +1537,7 @@ function check_db() {
|
||||||
* Sets the base url for use in cmdline programs which don't have
|
* Sets the base url for use in cmdline programs which don't have
|
||||||
* $_SERVER variables
|
* $_SERVER variables
|
||||||
*/
|
*/
|
||||||
function check_url(&$a) {
|
function check_url(App &$a) {
|
||||||
|
|
||||||
$url = get_config('system','url');
|
$url = get_config('system','url');
|
||||||
|
|
||||||
|
@ -1559,7 +1559,7 @@ function check_url(&$a) {
|
||||||
/**
|
/**
|
||||||
* @brief Automatic database updates
|
* @brief Automatic database updates
|
||||||
*/
|
*/
|
||||||
function update_db(&$a) {
|
function update_db(App &$a) {
|
||||||
$build = get_config('system','build');
|
$build = get_config('system','build');
|
||||||
if(! x($build))
|
if(! x($build))
|
||||||
$build = set_config('system','build',DB_UPDATE_VERSION);
|
$build = set_config('system','build',DB_UPDATE_VERSION);
|
||||||
|
@ -1675,7 +1675,7 @@ function run_update_function($x) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function check_plugins(&$a) {
|
function check_plugins(App &$a) {
|
||||||
|
|
||||||
$r = q("SELECT * FROM `addon` WHERE `installed` = 1");
|
$r = q("SELECT * FROM `addon` WHERE `installed` = 1");
|
||||||
if (dbm::is_result($r))
|
if (dbm::is_result($r))
|
||||||
|
@ -2410,7 +2410,8 @@ function get_temppath() {
|
||||||
return("");
|
return("");
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_template_engine(&$a, $engine = 'internal') {
|
/// @deprecated
|
||||||
|
function set_template_engine(App &$a, $engine = 'internal') {
|
||||||
/// @note This function is no longer necessary, but keep it as a wrapper to the class method
|
/// @note This function is no longer necessary, but keep it as a wrapper to the class method
|
||||||
/// to avoid breaking themes again unnecessarily
|
/// to avoid breaking themes again unnecessarily
|
||||||
|
|
||||||
|
|
|
@ -77,9 +77,9 @@ This will include:
|
||||||
$a->argc = 3
|
$a->argc = 3
|
||||||
$a->argv = array(0 => 'plugin', 1 => 'arg1', 2 => 'arg2');
|
$a->argv = array(0 => 'plugin', 1 => 'arg1', 2 => 'arg2');
|
||||||
|
|
||||||
Your module functions will often contain the function plugin_name_content(&$a), which defines and returns the page body content.
|
Your module functions will often contain the function plugin_name_content(App &$a), which defines and returns the page body content.
|
||||||
They may also contain plugin_name_post(&$a) which is called before the _content function and typically handles the results of POST forms.
|
They may also contain plugin_name_post(App &$a) which is called before the _content function and typically handles the results of POST forms.
|
||||||
You may also have plugin_name_init(&$a) which is called very early on and often does module initialisation.
|
You may also have plugin_name_init(App &$a) which is called very early on and often does module initialisation.
|
||||||
|
|
||||||
Templates
|
Templates
|
||||||
---
|
---
|
||||||
|
|
|
@ -68,7 +68,7 @@ The code will be something like:
|
||||||
file: mod/network.php
|
file: mod/network.php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function network_content(&$a) {
|
function network_content(App &$a) {
|
||||||
$itemsmanager = new \Friendica\ItemsManager();
|
$itemsmanager = new \Friendica\ItemsManager();
|
||||||
$items = $itemsmanager->getAll();
|
$items = $itemsmanager->getAll();
|
||||||
|
|
||||||
|
|
|
@ -67,9 +67,9 @@ So würde http://example.com/plugin/arg1/arg2 nach einem Modul "plugin" suchen u
|
||||||
$a->argc = 3
|
$a->argc = 3
|
||||||
$a->argv = array(0 => 'plugin', 1 => 'arg1', 2 => 'arg2');
|
$a->argv = array(0 => 'plugin', 1 => 'arg1', 2 => 'arg2');
|
||||||
|
|
||||||
Deine Modulfunktionen umfassen oft die Funktion plugin_name_content(&$a), welche den Seiteninhalt definiert und zurückgibt.
|
Deine Modulfunktionen umfassen oft die Funktion plugin_name_content(App &$a), welche den Seiteninhalt definiert und zurückgibt.
|
||||||
Sie können auch plugin_name_post(&$a) umfassen, welches vor der content-Funktion aufgerufen wird und normalerweise die Resultate der POST-Formulare handhabt.
|
Sie können auch plugin_name_post(App &$a) umfassen, welches vor der content-Funktion aufgerufen wird und normalerweise die Resultate der POST-Formulare handhabt.
|
||||||
Du kannst ebenso plugin_name_init(&$a) nutzen, was oft frühzeitig aufgerufen wird und das Modul initialisert.
|
Du kannst ebenso plugin_name_init(App &$a) nutzen, was oft frühzeitig aufgerufen wird und das Modul initialisert.
|
||||||
|
|
||||||
|
|
||||||
Derzeitige Hooks
|
Derzeitige Hooks
|
||||||
|
|
|
@ -122,7 +122,7 @@ the 1st part of the line is the name of the CSS file (without the .css) the 2nd
|
||||||
Calling the t() function with the common name makes the string translateable.
|
Calling the t() function with the common name makes the string translateable.
|
||||||
The selected 1st part will be saved in the database by the theme_post function.
|
The selected 1st part will be saved in the database by the theme_post function.
|
||||||
|
|
||||||
function theme_post(&$a){
|
function theme_post(App &$a){
|
||||||
// non local users shall not pass
|
// non local users shall not pass
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
@ -167,7 +167,7 @@ The content of this file should be something like
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
/* meta informations for the theme, see below */
|
/* meta informations for the theme, see below */
|
||||||
function duepuntozero_lr_init(&$a) {
|
function duepuntozero_lr_init(App &$a) {
|
||||||
$a-> theme_info = array(
|
$a-> theme_info = array(
|
||||||
'extends' => 'duepuntozero'.
|
'extends' => 'duepuntozero'.
|
||||||
);
|
);
|
||||||
|
@ -250,7 +250,7 @@ Next crucial part of the theme.php file is a definition of an init function.
|
||||||
The name of the function is <theme-name>_init.
|
The name of the function is <theme-name>_init.
|
||||||
So in the case of quattro it is
|
So in the case of quattro it is
|
||||||
|
|
||||||
function quattro_init(&$a) {
|
function quattro_init(App &$a) {
|
||||||
$a->theme_info = array();
|
$a->theme_info = array();
|
||||||
set_template_engine($a, 'smarty3');
|
set_template_engine($a, 'smarty3');
|
||||||
}
|
}
|
||||||
|
|
|
@ -678,7 +678,7 @@ function acl_lookup(&$a, $out_type = 'json') {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return array with the search results
|
* @return array with the search results
|
||||||
*/
|
*/
|
||||||
function navbar_complete(&$a) {
|
function navbar_complete(App &$a) {
|
||||||
|
|
||||||
// logger('navbar_complete');
|
// logger('navbar_complete');
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@
|
||||||
* @hook 'logged_in'
|
* @hook 'logged_in'
|
||||||
* array $user logged user record
|
* array $user logged user record
|
||||||
*/
|
*/
|
||||||
function api_login(&$a){
|
function api_login(App &$a){
|
||||||
// login with oauth
|
// login with oauth
|
||||||
try{
|
try{
|
||||||
$oauth = new FKOAuth1();
|
$oauth = new FKOAuth1();
|
||||||
|
@ -251,8 +251,8 @@
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string API call result
|
* @return string API call result
|
||||||
*/
|
*/
|
||||||
function api_call(&$a){
|
function api_call(App &$a){
|
||||||
GLOBAL $API, $called_api;
|
global $API, $called_api;
|
||||||
|
|
||||||
$type="json";
|
$type="json";
|
||||||
if (strpos($a->query_string, ".xml")>0) $type="xml";
|
if (strpos($a->query_string, ".xml")>0) $type="xml";
|
||||||
|
|
|
@ -343,7 +343,7 @@ function cron_poll_contacts($argc, $argv) {
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
function cron_clear_cache(&$a) {
|
function cron_clear_cache(App &$a) {
|
||||||
|
|
||||||
$last = get_config('system','cache_last_cleared');
|
$last = get_config('system','cache_last_cleared');
|
||||||
|
|
||||||
|
@ -430,7 +430,7 @@ function cron_clear_cache(&$a) {
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
function cron_repair_diaspora(&$a) {
|
function cron_repair_diaspora(App &$a) {
|
||||||
$r = q("SELECT `id`, `url` FROM `contact`
|
$r = q("SELECT `id`, `url` FROM `contact`
|
||||||
WHERE `network` = '%s' AND (`batch` = '' OR `notify` = '' OR `poll` = '' OR pubkey = '')
|
WHERE `network` = '%s' AND (`batch` = '' OR `notify` = '' OR `poll` = '' OR pubkey = '')
|
||||||
ORDER BY RAND() LIMIT 50", dbesc(NETWORK_DIASPORA));
|
ORDER BY RAND() LIMIT 50", dbesc(NETWORK_DIASPORA));
|
||||||
|
|
|
@ -206,7 +206,7 @@ function bbtoevent($s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sort_by_date($a) {
|
function sort_by_date(App &$a) {
|
||||||
|
|
||||||
usort($a,'ev_compare');
|
usort($a,'ev_compare');
|
||||||
return $a;
|
return $a;
|
||||||
|
|
|
@ -599,7 +599,7 @@ function get_events() {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
function advanced_profile(&$a) {
|
function advanced_profile(App &$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
$uid = $a->profile['uid'];
|
$uid = $a->profile['uid'];
|
||||||
|
@ -807,7 +807,7 @@ function get_my_url() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function zrl_init(&$a) {
|
function zrl_init(App &$a) {
|
||||||
$tmp_str = get_my_url();
|
$tmp_str = get_my_url();
|
||||||
if(validate_url($tmp_str)) {
|
if(validate_url($tmp_str)) {
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function nav(&$a) {
|
function nav(App &$a) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|
|
@ -369,7 +369,7 @@ if(! function_exists('paginate')) {
|
||||||
* @param App $a App instance
|
* @param App $a App instance
|
||||||
* @return string html for pagination #FIXME remove html
|
* @return string html for pagination #FIXME remove html
|
||||||
*/
|
*/
|
||||||
function paginate(&$a) {
|
function paginate(App &$a) {
|
||||||
|
|
||||||
$data = paginate_data($a);
|
$data = paginate_data($a);
|
||||||
$tpl = get_markup_template("paginate.tpl");
|
$tpl = get_markup_template("paginate.tpl");
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
/// @TODO This file has DOS line endings!
|
||||||
require_once("mod/hostxrd.php");
|
require_once("mod/hostxrd.php");
|
||||||
require_once("mod/nodeinfo.php");
|
require_once("mod/nodeinfo.php");
|
||||||
|
|
||||||
function _well_known_init(&$a){
|
function _well_known_init(App &$a){
|
||||||
if ($a->argc > 1) {
|
if ($a->argc > 1) {
|
||||||
switch($a->argv[1]) {
|
switch($a->argv[1]) {
|
||||||
case "host-meta":
|
case "host-meta":
|
||||||
|
@ -20,7 +21,7 @@ function _well_known_init(&$a){
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
function wk_social_relay(&$a) {
|
function wk_social_relay(App &$a) {
|
||||||
|
|
||||||
define('SR_SCOPE_ALL', 'all');
|
define('SR_SCOPE_ALL', 'all');
|
||||||
define('SR_SCOPE_TAGS', 'tags');
|
define('SR_SCOPE_TAGS', 'tags');
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once('include/Scrape.php');
|
require_once('include/Scrape.php');
|
||||||
|
|
||||||
function acctlink_init(&$a) {
|
function acctlink_init(App &$a) {
|
||||||
|
|
||||||
if(x($_GET,'addr')) {
|
if(x($_GET,'addr')) {
|
||||||
$addr = trim($_GET['addr']);
|
$addr = trim($_GET['addr']);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
require_once("include/acl_selectors.php");
|
require_once("include/acl_selectors.php");
|
||||||
|
|
||||||
function acl_init(&$a){
|
function acl_init(App &$a){
|
||||||
acl_lookup($a);
|
acl_lookup($a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ require_once("include/text.php");
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function admin_post(&$a){
|
function admin_post(App &$a){
|
||||||
|
|
||||||
|
|
||||||
if(!is_site_admin()) {
|
if(!is_site_admin()) {
|
||||||
|
@ -127,7 +127,7 @@ function admin_post(&$a){
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_content(&$a) {
|
function admin_content(App &$a) {
|
||||||
|
|
||||||
if(!is_site_admin()) {
|
if(!is_site_admin()) {
|
||||||
return login(false);
|
return login(false);
|
||||||
|
@ -260,7 +260,7 @@ function admin_content(&$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_federation(&$a) {
|
function admin_page_federation(App &$a) {
|
||||||
// get counts on active friendica, diaspora, redmatrix, hubzilla, gnu
|
// get counts on active friendica, diaspora, redmatrix, hubzilla, gnu
|
||||||
// social and statusnet nodes this node is knowing
|
// social and statusnet nodes this node is knowing
|
||||||
//
|
//
|
||||||
|
@ -393,7 +393,7 @@ function admin_page_federation(&$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_queue(&$a) {
|
function admin_page_queue(App &$a) {
|
||||||
// get content from the queue table
|
// get content from the queue table
|
||||||
$r = q("SELECT `c`.`name`, `c`.`nurl`, `q`.`id`, `q`.`network`, `q`.`created`, `q`.`last`
|
$r = q("SELECT `c`.`name`, `c`.`nurl`, `q`.`id`, `q`.`network`, `q`.`created`, `q`.`last`
|
||||||
FROM `queue` AS `q`, `contact` AS `c`
|
FROM `queue` AS `q`, `contact` AS `c`
|
||||||
|
@ -427,7 +427,7 @@ function admin_page_queue(&$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_summary(&$a) {
|
function admin_page_summary(App &$a) {
|
||||||
global $db;
|
global $db;
|
||||||
// are there MyISAM tables in the DB? If so, trigger a warning message
|
// 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",
|
$r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1",
|
||||||
|
@ -504,7 +504,7 @@ function admin_page_summary(&$a) {
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
function admin_page_site_post(&$a) {
|
function admin_page_site_post(App &$a) {
|
||||||
if(!x($_POST,"page_site")) {
|
if(!x($_POST,"page_site")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -845,7 +845,7 @@ function admin_page_site_post(&$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_site(&$a) {
|
function admin_page_site(App &$a) {
|
||||||
|
|
||||||
/* Installed langs */
|
/* Installed langs */
|
||||||
$lang_choices = get_available_languages();
|
$lang_choices = get_available_languages();
|
||||||
|
@ -1072,7 +1072,7 @@ function admin_page_site(&$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
**/
|
**/
|
||||||
function admin_page_dbsync(&$a) {
|
function admin_page_dbsync(App &$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
|
@ -1155,7 +1155,7 @@ function admin_page_dbsync(&$a) {
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
function admin_page_users_post(&$a){
|
function admin_page_users_post(App &$a){
|
||||||
$pending = (x($_POST, 'pending') ? $_POST['pending'] : array());
|
$pending = (x($_POST, 'pending') ? $_POST['pending'] : array());
|
||||||
$users = (x($_POST, 'user') ? $_POST['user'] : array());
|
$users = (x($_POST, 'user') ? $_POST['user'] : array());
|
||||||
$nu_name = (x($_POST, 'new_user_name') ? $_POST['new_user_name'] : '');
|
$nu_name = (x($_POST, 'new_user_name') ? $_POST['new_user_name'] : '');
|
||||||
|
@ -1260,7 +1260,7 @@ function admin_page_users_post(&$a){
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_users(&$a){
|
function admin_page_users(App &$a){
|
||||||
if($a->argc>2) {
|
if($a->argc>2) {
|
||||||
$uid = $a->argv[3];
|
$uid = $a->argv[3];
|
||||||
$user = q("SELECT `username`, `blocked` FROM `user` WHERE `uid` = %d", intval($uid));
|
$user = q("SELECT `username`, `blocked` FROM `user` WHERE `uid` = %d", intval($uid));
|
||||||
|
@ -1460,7 +1460,7 @@ function admin_page_users(&$a){
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_plugins(&$a){
|
function admin_page_plugins(App &$a){
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Single plugin
|
* Single plugin
|
||||||
|
@ -1666,7 +1666,7 @@ function rebuild_theme_table($themes) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_themes(&$a){
|
function admin_page_themes(App &$a){
|
||||||
|
|
||||||
$allowed_themes_str = get_config('system','allowed_themes');
|
$allowed_themes_str = get_config('system','allowed_themes');
|
||||||
$allowed_themes_raw = explode(',',$allowed_themes_str);
|
$allowed_themes_raw = explode(',',$allowed_themes_str);
|
||||||
|
@ -1847,7 +1847,7 @@ function admin_page_themes(&$a){
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
function admin_page_logs_post(&$a) {
|
function admin_page_logs_post(App &$a) {
|
||||||
if(x($_POST,"page_logs")) {
|
if(x($_POST,"page_logs")) {
|
||||||
check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs');
|
check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs');
|
||||||
|
|
||||||
|
@ -1881,7 +1881,7 @@ function admin_page_logs_post(&$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_logs(&$a){
|
function admin_page_logs(App &$a){
|
||||||
|
|
||||||
$log_choices = array(
|
$log_choices = array(
|
||||||
LOGGER_NORMAL => 'Normal',
|
LOGGER_NORMAL => 'Normal',
|
||||||
|
@ -1938,7 +1938,7 @@ function admin_page_logs(&$a){
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_viewlogs(&$a){
|
function admin_page_viewlogs(App &$a){
|
||||||
$t = get_markup_template("admin_viewlogs.tpl");
|
$t = get_markup_template("admin_viewlogs.tpl");
|
||||||
$f = get_config('system','logfile');
|
$f = get_config('system','logfile');
|
||||||
$data = '';
|
$data = '';
|
||||||
|
@ -1980,7 +1980,7 @@ function admin_page_viewlogs(&$a){
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
function admin_page_features_post(&$a) {
|
function admin_page_features_post(App &$a) {
|
||||||
|
|
||||||
check_form_security_token_redirectOnErr('/admin/features', 'admin_manage_features');
|
check_form_security_token_redirectOnErr('/admin/features', 'admin_manage_features');
|
||||||
|
|
||||||
|
@ -2026,7 +2026,7 @@ function admin_page_features_post(&$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_features(&$a) {
|
function admin_page_features(App &$a) {
|
||||||
|
|
||||||
if((argc() > 1) && (argv(1) === 'features')) {
|
if((argc() > 1) && (argv(1) === 'features')) {
|
||||||
$arr = array();
|
$arr = array();
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/Contact.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
require_once('mod/contacts.php');
|
require_once('mod/contacts.php');
|
||||||
|
|
||||||
function allfriends_content(&$a) {
|
function allfriends_content(App &$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -19,7 +19,7 @@ function allfriends_content(&$a) {
|
||||||
if(! $cid)
|
if(! $cid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$uid = $a->user[uid];
|
$uid = $a->user['uid'];
|
||||||
|
|
||||||
$c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($cid),
|
intval($cid),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function amcd_content(&$a) {
|
function amcd_content(App &$a) {
|
||||||
//header("Content-type: text/json");
|
//header("Content-type: text/json");
|
||||||
echo <<< EOT
|
echo <<< EOT
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,7 @@ function oauth_get_client($request){
|
||||||
return $r[0];
|
return $r[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
function api_post(&$a) {
|
function api_post(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -34,7 +34,7 @@ function api_post(&$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function api_content(&$a) {
|
function api_content(App &$a) {
|
||||||
if ($a->cmd=='api/oauth/authorize'){
|
if ($a->cmd=='api/oauth/authorize'){
|
||||||
/*
|
/*
|
||||||
* api/oauth/authorize interact with the user. return a standard page
|
* api/oauth/authorize interact with the user. return a standard page
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function apps_content(&$a) {
|
function apps_content(App &$a) {
|
||||||
$privateaddons = get_config('config','private_addons');
|
$privateaddons = get_config('config','private_addons');
|
||||||
if ($privateaddons === "1") {
|
if ($privateaddons === "1") {
|
||||||
if((! (local_user()))) {
|
if((! (local_user()))) {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
|
|
||||||
function attach_init(&$a) {
|
function attach_init(App &$a) {
|
||||||
|
|
||||||
if($a->argc != 2) {
|
if($a->argc != 2) {
|
||||||
notice( t('Item not available.') . EOL);
|
notice( t('Item not available.') . EOL);
|
||||||
|
|
|
@ -9,7 +9,7 @@ function visible_lf($s) {
|
||||||
return str_replace("\n",'<br />', $s);
|
return str_replace("\n",'<br />', $s);
|
||||||
}
|
}
|
||||||
|
|
||||||
function babel_content(&$a) {
|
function babel_content(App &$a) {
|
||||||
|
|
||||||
$o .= '<h1>Babel Diagnostic</h1>';
|
$o .= '<h1>Babel Diagnostic</h1>';
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
require_once('include/conversation.php');
|
require_once('include/conversation.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
function bookmarklet_init(&$a) {
|
function bookmarklet_init(App &$a) {
|
||||||
$_GET["mode"] = "minimal";
|
$_GET["mode"] = "minimal";
|
||||||
}
|
}
|
||||||
|
|
||||||
function bookmarklet_content(&$a) {
|
function bookmarklet_content(App &$a) {
|
||||||
if(!local_user()) {
|
if(!local_user()) {
|
||||||
$o = '<h2>'.t('Login').'</h2>';
|
$o = '<h2>'.t('Login').'</h2>';
|
||||||
$o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);
|
$o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
require_once('include/event.php');
|
require_once('include/event.php');
|
||||||
require_once('include/redir.php');
|
require_once('include/redir.php');
|
||||||
|
|
||||||
function cal_init(&$a) {
|
function cal_init(App &$a) {
|
||||||
if($a->argc > 1)
|
if($a->argc > 1)
|
||||||
auto_redir($a, $a->argv[1]);
|
auto_redir($a, $a->argv[1]);
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ function cal_init(&$a) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function cal_content(&$a) {
|
function cal_content(App &$a) {
|
||||||
nav_set_selected('events');
|
nav_set_selected('events');
|
||||||
|
|
||||||
$editselect = 'none';
|
$editselect = 'none';
|
||||||
|
|
|
@ -5,19 +5,19 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function cb_init(&$a) {
|
function cb_init(App &$a) {
|
||||||
call_hooks('cb_init');
|
call_hooks('cb_init');
|
||||||
}
|
}
|
||||||
|
|
||||||
function cb_post(&$a) {
|
function cb_post(App &$a) {
|
||||||
call_hooks('cb_post', $_POST);
|
call_hooks('cb_post', $_POST);
|
||||||
}
|
}
|
||||||
|
|
||||||
function cb_afterpost(&$a) {
|
function cb_afterpost(App &$a) {
|
||||||
call_hooks('cb_afterpost');
|
call_hooks('cb_afterpost');
|
||||||
}
|
}
|
||||||
|
|
||||||
function cb_content(&$a) {
|
function cb_content(App &$a) {
|
||||||
$o = '';
|
$o = '';
|
||||||
call_hooks('cb_content', $o);
|
call_hooks('cb_content', $o);
|
||||||
return $o;
|
return $o;
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/Contact.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
require_once('mod/contacts.php');
|
require_once('mod/contacts.php');
|
||||||
|
|
||||||
function common_content(&$a) {
|
function common_content(App &$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function community_init(&$a) {
|
function community_init(App &$a) {
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
unset($_SESSION['theme']);
|
unset($_SESSION['theme']);
|
||||||
unset($_SESSION['mobile-theme']);
|
unset($_SESSION['mobile-theme']);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
|
|
||||||
function contactgroup_content(&$a) {
|
function contactgroup_content(App &$a) {
|
||||||
|
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
|
|
@ -7,7 +7,7 @@ require_once('include/Scrape.php');
|
||||||
require_once('mod/proxy.php');
|
require_once('mod/proxy.php');
|
||||||
require_once('include/Photo.php');
|
require_once('include/Photo.php');
|
||||||
|
|
||||||
function contacts_init(&$a) {
|
function contacts_init(App &$a) {
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ function contacts_init(&$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function contacts_batch_actions(&$a){
|
function contacts_batch_actions(App &$a){
|
||||||
$contacts_id = $_POST['contact_batch'];
|
$contacts_id = $_POST['contact_batch'];
|
||||||
if (!is_array($contacts_id)) return;
|
if (!is_array($contacts_id)) return;
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ function contacts_batch_actions(&$a){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function contacts_post(&$a) {
|
function contacts_post(App &$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
@ -339,7 +339,7 @@ function _contact_drop($contact_id, $orig_record) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function contacts_content(&$a) {
|
function contacts_content(App &$a) {
|
||||||
|
|
||||||
$sort_type = 0;
|
$sort_type = 0;
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* addons repository will be listed though ATM)
|
* addons repository will be listed though ATM)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function credits_content (&$a) {
|
function credits_content (App &$a) {
|
||||||
/* fill the page with credits */
|
/* fill the page with credits */
|
||||||
$f = fopen('util/credits.txt','r');
|
$f = fopen('util/credits.txt','r');
|
||||||
$names = fread($f, filesize('util/credits.txt'));
|
$names = fread($f, filesize('util/credits.txt'));
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
require_once("include/contact_selectors.php");
|
require_once("include/contact_selectors.php");
|
||||||
require_once("mod/contacts.php");
|
require_once("mod/contacts.php");
|
||||||
|
|
||||||
function crepair_init(&$a) {
|
function crepair_init(App &$a) {
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ function crepair_init(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function crepair_post(&$a) {
|
function crepair_post(App &$a) {
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ function crepair_post(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function crepair_content(&$a) {
|
function crepair_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
require_once('mod/settings.php');
|
require_once('mod/settings.php');
|
||||||
|
|
||||||
function delegate_init(&$a) {
|
function delegate_init(App &$a) {
|
||||||
return settings_init($a);
|
return settings_init($a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function delegate_content(&$a) {
|
function delegate_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -11,7 +11,7 @@ require_once('include/event.php');
|
||||||
|
|
||||||
require_once('library/defuse/php-encryption-1.2.1/Crypto.php');
|
require_once('library/defuse/php-encryption-1.2.1/Crypto.php');
|
||||||
|
|
||||||
function dfrn_notify_post(&$a) {
|
function dfrn_notify_post(App &$a) {
|
||||||
logger(__function__, LOGGER_TRACE);
|
logger(__function__, LOGGER_TRACE);
|
||||||
$dfrn_id = ((x($_POST,'dfrn_id')) ? notags(trim($_POST['dfrn_id'])) : '');
|
$dfrn_id = ((x($_POST,'dfrn_id')) ? notags(trim($_POST['dfrn_id'])) : '');
|
||||||
$dfrn_version = ((x($_POST,'dfrn_version')) ? (float) $_POST['dfrn_version'] : 2.0);
|
$dfrn_version = ((x($_POST,'dfrn_version')) ? (float) $_POST['dfrn_version'] : 2.0);
|
||||||
|
@ -221,7 +221,7 @@ function dfrn_notify_post(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function dfrn_notify_content(&$a) {
|
function dfrn_notify_content(App &$a) {
|
||||||
|
|
||||||
if(x($_GET,'dfrn_id')) {
|
if(x($_GET,'dfrn_id')) {
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ require_once('include/auth.php');
|
||||||
require_once('include/dfrn.php');
|
require_once('include/dfrn.php');
|
||||||
|
|
||||||
|
|
||||||
function dfrn_poll_init(&$a) {
|
function dfrn_poll_init(App &$a) {
|
||||||
|
|
||||||
|
|
||||||
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
|
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
|
||||||
|
@ -203,7 +203,7 @@ function dfrn_poll_init(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function dfrn_poll_post(&$a) {
|
function dfrn_poll_post(App &$a) {
|
||||||
|
|
||||||
$dfrn_id = ((x($_POST,'dfrn_id')) ? $_POST['dfrn_id'] : '');
|
$dfrn_id = ((x($_POST,'dfrn_id')) ? $_POST['dfrn_id'] : '');
|
||||||
$challenge = ((x($_POST,'challenge')) ? $_POST['challenge'] : '');
|
$challenge = ((x($_POST,'challenge')) ? $_POST['challenge'] : '');
|
||||||
|
@ -383,7 +383,7 @@ function dfrn_poll_post(&$a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function dfrn_poll_content(&$a) {
|
function dfrn_poll_content(App &$a) {
|
||||||
|
|
||||||
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
|
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
|
||||||
$type = ((x($_GET,'type')) ? $_GET['type'] : 'data');
|
$type = ((x($_GET,'type')) ? $_GET['type'] : 'data');
|
||||||
|
|
|
@ -17,7 +17,7 @@ require_once('include/Scrape.php');
|
||||||
require_once('include/Probe.php');
|
require_once('include/Probe.php');
|
||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
|
|
||||||
function dfrn_request_init(&$a) {
|
function dfrn_request_init(App &$a) {
|
||||||
|
|
||||||
if($a->argc > 1)
|
if($a->argc > 1)
|
||||||
$which = $a->argv[1];
|
$which = $a->argv[1];
|
||||||
|
@ -42,7 +42,7 @@ function dfrn_request_init(&$a) {
|
||||||
* After logging in, we click 'submit' to approve the linkage.
|
* After logging in, we click 'submit' to approve the linkage.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function dfrn_request_post(&$a) {
|
function dfrn_request_post(App &$a) {
|
||||||
|
|
||||||
if(($a->argc != 2) || (! count($a->profile))) {
|
if(($a->argc != 2) || (! count($a->profile))) {
|
||||||
logger('Wrong count of argc or profiles: argc=' . $a->argc . ',profile()=' . count($a->profile));
|
logger('Wrong count of argc or profiles: argc=' . $a->argc . ',profile()=' . count($a->profile));
|
||||||
|
@ -654,7 +654,7 @@ function dfrn_request_post(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function dfrn_request_content(&$a) {
|
function dfrn_request_content(App &$a) {
|
||||||
|
|
||||||
if (($a->argc != 2) || (! count($a->profile))) {
|
if (($a->argc != 2) || (! count($a->profile))) {
|
||||||
return "";
|
return "";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function directory_init(&$a) {
|
function directory_init(App &$a) {
|
||||||
$a->set_pager_itemspage(60);
|
$a->set_pager_itemspage(60);
|
||||||
|
|
||||||
if(local_user()) {
|
if(local_user()) {
|
||||||
|
@ -20,14 +20,14 @@ function directory_init(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function directory_post(&$a) {
|
function directory_post(App &$a) {
|
||||||
if(x($_POST,'search'))
|
if(x($_POST,'search'))
|
||||||
$a->data['search'] = $_POST['search'];
|
$a->data['search'] = $_POST['search'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function directory_content(&$a) {
|
function directory_content(App &$a) {
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
require_once("mod/proxy.php");
|
require_once("mod/proxy.php");
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/Contact.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
require_once('mod/contacts.php');
|
require_once('mod/contacts.php');
|
||||||
|
|
||||||
function dirfind_init(&$a) {
|
function dirfind_init(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL );
|
notice( t('Permission denied.') . EOL );
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function display_init(&$a) {
|
function display_init(App &$a) {
|
||||||
|
|
||||||
if ((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
if ((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once('include/acl_selectors.php');
|
require_once('include/acl_selectors.php');
|
||||||
|
|
||||||
function editpost_content(&$a) {
|
function editpost_content(App &$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,11 @@ require_once('include/datetime.php');
|
||||||
require_once('include/event.php');
|
require_once('include/event.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
function events_init(&$a) {
|
function events_init(App &$a) {
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if($a->argc == 1) {
|
if ($a->argc == 1) {
|
||||||
// if it's a json request abort here becaus we don't
|
// if it's a json request abort here becaus we don't
|
||||||
// need the widget data
|
// need the widget data
|
||||||
if($a->argv[1] === 'json')
|
if($a->argv[1] === 'json')
|
||||||
|
@ -20,8 +20,9 @@ function events_init(&$a) {
|
||||||
|
|
||||||
$cal_widget = widget_events();
|
$cal_widget = widget_events();
|
||||||
|
|
||||||
if(! x($a->page,'aside'))
|
if (! x($a->page,'aside')) {
|
||||||
$a->page['aside'] = '';
|
$a->page['aside'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
$a->page['aside'] .= $cal_widget;
|
$a->page['aside'] .= $cal_widget;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +30,7 @@ function events_init(&$a) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function events_post(&$a) {
|
function events_post(App &$a) {
|
||||||
|
|
||||||
logger('post: ' . print_r($_REQUEST,true));
|
logger('post: ' . print_r($_REQUEST,true));
|
||||||
|
|
||||||
|
@ -184,38 +185,41 @@ function events_post(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function events_content(&$a) {
|
function events_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($a->argc == 1)
|
if ($a->argc == 1) {
|
||||||
$_SESSION['return_url'] = App::get_baseurl() . '/' . $a->cmd;
|
$_SESSION['return_url'] = App::get_baseurl() . '/' . $a->cmd;
|
||||||
|
}
|
||||||
|
|
||||||
if(($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) {
|
if (($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) {
|
||||||
$r = q("update event set ignore = 1 where id = %d and uid = %d",
|
$r = q("update event set ignore = 1 where id = %d and uid = %d",
|
||||||
intval($a->argv[2]),
|
intval($a->argv[2]),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($a->argc > 2) && ($a->argv[1] === 'unignore') && intval($a->argv[2])) {
|
if (($a->argc > 2) && ($a->argv[1] === 'unignore') && intval($a->argv[2])) {
|
||||||
$r = q("update event set ignore = 0 where id = %d and uid = %d",
|
$r = q("update event set ignore = 0 where id = %d and uid = %d",
|
||||||
intval($a->argv[2]),
|
intval($a->argv[2]),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($a->theme_events_in_profile)
|
if ($a->theme_events_in_profile) {
|
||||||
nav_set_selected('home');
|
nav_set_selected('home');
|
||||||
else
|
} else {
|
||||||
nav_set_selected('events');
|
nav_set_selected('events');
|
||||||
|
}
|
||||||
|
|
||||||
$editselect = 'none';
|
$editselect = 'none';
|
||||||
if( feature_enabled(local_user(), 'richtext') )
|
if ( feature_enabled(local_user(), 'richtext') ) {
|
||||||
$editselect = 'textareas';
|
$editselect = 'textareas';
|
||||||
|
}
|
||||||
|
|
||||||
// get the translation strings for the callendar
|
// get the translation strings for the callendar
|
||||||
$i18n = get_event_strings();
|
$i18n = get_event_strings();
|
||||||
|
|
|
@ -10,8 +10,7 @@ require_once('include/Photo.php');
|
||||||
/**
|
/**
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
/// @TODO & is missing or App ?
|
function fbrowser_content(App &$a){
|
||||||
function fbrowser_content($a){
|
|
||||||
|
|
||||||
if (!local_user())
|
if (!local_user())
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -8,7 +8,7 @@ require_once("include/xml.php");
|
||||||
|
|
||||||
/// @TODO You always make it like this: function foo(&$a)
|
/// @TODO You always make it like this: function foo(&$a)
|
||||||
/// @TODO This means that the value of $a can be changed in anything, remove & and use App as type-hint
|
/// @TODO This means that the value of $a can be changed in anything, remove & and use App as type-hint
|
||||||
function fetch_init(&$a){
|
function fetch_init(App &$a){
|
||||||
|
|
||||||
if (($a->argc != 3) OR (!in_array($a->argv[1], array("post", "status_message", "reshare")))) {
|
if (($a->argc != 3) OR (!in_array($a->argv[1], array("post", "status_message", "reshare")))) {
|
||||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
|
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
|
|
||||||
function filer_content(&$a) {
|
function filer_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function filerm_content(&$a) {
|
function filerm_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/follow.php');
|
||||||
require_once('include/Contact.php');
|
require_once('include/Contact.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
|
|
||||||
function follow_content(&$a) {
|
function follow_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -149,7 +149,7 @@ function follow_content(&$a) {
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
function follow_post(&$a) {
|
function follow_post(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function friendica_init(&$a) {
|
function friendica_init(App &$a) {
|
||||||
if ($a->argv[1]=="json"){
|
if ($a->argv[1]=="json"){
|
||||||
$register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
|
$register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ function friendica_init(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function friendica_content(&$a) {
|
function friendica_content(App &$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
$o .= '<h3>Friendica</h3>';
|
$o .= '<h3>Friendica</h3>';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
function fsuggest_post(&$a) {
|
function fsuggest_post(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
return;
|
return;
|
||||||
|
@ -70,7 +70,7 @@ function fsuggest_post(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function fsuggest_content(&$a) {
|
function fsuggest_content(App &$a) {
|
||||||
|
|
||||||
require_once('include/acl_selectors.php');
|
require_once('include/acl_selectors.php');
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ function validate_members(&$item) {
|
||||||
$item = intval($item);
|
$item = intval($item);
|
||||||
}
|
}
|
||||||
|
|
||||||
function group_init(&$a) {
|
function group_init(App &$a) {
|
||||||
if(local_user()) {
|
if(local_user()) {
|
||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
$a->page['aside'] = group_side('contacts','group','extended',(($a->argc > 1) ? intval($a->argv[1]) : 0));
|
$a->page['aside'] = group_side('contacts','group','extended',(($a->argc > 1) ? intval($a->argv[1]) : 0));
|
||||||
|
@ -13,7 +13,7 @@ function group_init(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function group_post(&$a) {
|
function group_post(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -28,15 +28,18 @@ function group_post(&$a) {
|
||||||
if($r) {
|
if($r) {
|
||||||
info( t('Group created.') . EOL );
|
info( t('Group created.') . EOL );
|
||||||
$r = group_byname(local_user(),$name);
|
$r = group_byname(local_user(),$name);
|
||||||
if($r)
|
if ($r) {
|
||||||
goaway(App::get_baseurl() . '/group/' . $r);
|
goaway(App::get_baseurl() . '/group/' . $r);
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
notice( t('Could not create group.') . EOL );
|
notice( t('Could not create group.') . EOL );
|
||||||
|
}
|
||||||
goaway(App::get_baseurl() . '/group');
|
goaway(App::get_baseurl() . '/group');
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
if(($a->argc == 2) && (intval($a->argv[1]))) {
|
|
||||||
|
if (($a->argc == 2) && (intval($a->argv[1]))) {
|
||||||
check_form_security_token_redirectOnErr('/group', 'group_edit');
|
check_form_security_token_redirectOnErr('/group', 'group_edit');
|
||||||
|
|
||||||
$r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
|
@ -50,22 +53,24 @@ function group_post(&$a) {
|
||||||
}
|
}
|
||||||
$group = $r[0];
|
$group = $r[0];
|
||||||
$groupname = notags(trim($_POST['groupname']));
|
$groupname = notags(trim($_POST['groupname']));
|
||||||
if((strlen($groupname)) && ($groupname != $group['name'])) {
|
if ((strlen($groupname)) && ($groupname != $group['name'])) {
|
||||||
$r = q("UPDATE `group` SET `name` = '%s' WHERE `uid` = %d AND `id` = %d",
|
$r = q("UPDATE `group` SET `name` = '%s' WHERE `uid` = %d AND `id` = %d",
|
||||||
dbesc($groupname),
|
dbesc($groupname),
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
intval($group['id'])
|
intval($group['id'])
|
||||||
);
|
);
|
||||||
if($r)
|
|
||||||
|
if ($r) {
|
||||||
info( t('Group name changed.') . EOL );
|
info( t('Group name changed.') . EOL );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$a->page['aside'] = group_side();
|
$a->page['aside'] = group_side();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function group_content(&$a) {
|
function group_content(App &$a) {
|
||||||
$change = false;
|
$change = false;
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function hcard_init(&$a) {
|
function hcard_init(App &$a) {
|
||||||
|
|
||||||
$blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
|
$blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ if (!function_exists('load_doc_file')) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function help_content(&$a) {
|
function help_content(App &$a) {
|
||||||
|
|
||||||
nav_set_selected('help');
|
nav_set_selected('help');
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('home_init')) {
|
if(! function_exists('home_init')) {
|
||||||
function home_init(&$a) {
|
function home_init(App &$a) {
|
||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
call_hooks('home_init',$ret);
|
call_hooks('home_init',$ret);
|
||||||
|
@ -17,7 +17,7 @@ function home_init(&$a) {
|
||||||
|
|
||||||
|
|
||||||
if(! function_exists('home_content')) {
|
if(! function_exists('home_content')) {
|
||||||
function home_content(&$a) {
|
function home_content(App &$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once('include/crypto.php');
|
require_once('include/crypto.php');
|
||||||
|
|
||||||
function hostxrd_init(&$a) {
|
function hostxrd_init(App &$a) {
|
||||||
header('Access-Control-Allow-Origin: *');
|
header('Access-Control-Allow-Origin: *');
|
||||||
header("Content-type: text/xml");
|
header("Content-type: text/xml");
|
||||||
$pubkey = get_config('system','site_pubkey');
|
$pubkey = get_config('system','site_pubkey');
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
require_once("include/socgraph.php");
|
require_once("include/socgraph.php");
|
||||||
require_once("include/Contact.php");
|
require_once("include/Contact.php");
|
||||||
|
|
||||||
function hovercard_init(&$a) {
|
function hovercard_init(App &$a) {
|
||||||
// Just for testing purposes
|
// Just for testing purposes
|
||||||
$_GET["mode"] = "minimal";
|
$_GET["mode"] = "minimal";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
function ignored_init(&$a) {
|
function ignored_init(App &$a) {
|
||||||
|
|
||||||
$ignored = 0;
|
$ignored = 0;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ require_once "include/Photo.php";
|
||||||
$install_wizard_pass=1;
|
$install_wizard_pass=1;
|
||||||
|
|
||||||
|
|
||||||
function install_init(&$a){
|
function install_init(App &$a){
|
||||||
|
|
||||||
// $baseurl/install/testrwrite to test if rewite in .htaccess is working
|
// $baseurl/install/testrwrite to test if rewite in .htaccess is working
|
||||||
if ($a->argc==2 && $a->argv[1]=="testrewrite") {
|
if ($a->argc==2 && $a->argv[1]=="testrewrite") {
|
||||||
|
@ -25,7 +25,7 @@ function install_init(&$a){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_post(&$a) {
|
function install_post(App &$a) {
|
||||||
global $install_wizard_pass, $db;
|
global $install_wizard_pass, $db;
|
||||||
|
|
||||||
switch($install_wizard_pass) {
|
switch($install_wizard_pass) {
|
||||||
|
@ -131,7 +131,7 @@ function get_db_errno() {
|
||||||
return mysql_errno();
|
return mysql_errno();
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_content(&$a) {
|
function install_content(App &$a) {
|
||||||
|
|
||||||
global $install_wizard_pass, $db;
|
global $install_wizard_pass, $db;
|
||||||
$o = '';
|
$o = '';
|
||||||
|
@ -560,7 +560,7 @@ function check_imagik(&$checks) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function manual_config(&$a) {
|
function manual_config(App &$a) {
|
||||||
$data = htmlentities($a->data['txt'],ENT_COMPAT,'UTF-8');
|
$data = htmlentities($a->data['txt'],ENT_COMPAT,'UTF-8');
|
||||||
$o = t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
|
$o = t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
|
||||||
$o .= "<textarea rows=\"24\" cols=\"80\" >$data</textarea>";
|
$o .= "<textarea rows=\"24\" cols=\"80\" >$data</textarea>";
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
require_once('include/email.php');
|
require_once('include/email.php');
|
||||||
|
|
||||||
function invite_post(&$a) {
|
function invite_post(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -95,7 +95,7 @@ function invite_post(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function invite_content(&$a) {
|
function invite_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -27,7 +27,7 @@ require_once('include/Scrape.php');
|
||||||
require_once('include/diaspora.php');
|
require_once('include/diaspora.php');
|
||||||
require_once('include/Contact.php');
|
require_once('include/Contact.php');
|
||||||
|
|
||||||
function item_post(&$a) {
|
function item_post(App &$a) {
|
||||||
|
|
||||||
if((! local_user()) && (! remote_user()) && (! x($_REQUEST,'commenter')))
|
if((! local_user()) && (! remote_user()) && (! x($_REQUEST,'commenter')))
|
||||||
return;
|
return;
|
||||||
|
@ -1065,7 +1065,7 @@ function item_post_return($baseurl, $api_source, $return_path) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function item_content(&$a) {
|
function item_content(App &$a) {
|
||||||
|
|
||||||
if((! local_user()) && (! remote_user()))
|
if((! local_user()) && (! remote_user()))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
require_once('include/like.php');
|
require_once('include/like.php');
|
||||||
|
|
||||||
function like_content(&$a) {
|
function like_content(App &$a) {
|
||||||
if(! local_user() && ! remote_user()) {
|
if(! local_user() && ! remote_user()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require_once('include/datetime.php');
|
require_once('include/datetime.php');
|
||||||
|
|
||||||
|
|
||||||
function localtime_post(&$a) {
|
function localtime_post(App &$a) {
|
||||||
|
|
||||||
$t = $_REQUEST['time'];
|
$t = $_REQUEST['time'];
|
||||||
if(! $t)
|
if(! $t)
|
||||||
|
@ -16,7 +16,7 @@ function localtime_post(&$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function localtime_content(&$a) {
|
function localtime_content(App &$a) {
|
||||||
$t = $_REQUEST['time'];
|
$t = $_REQUEST['time'];
|
||||||
if(! $t)
|
if(! $t)
|
||||||
$t = 'now';
|
$t = 'now';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
function lockview_content(&$a) {
|
function lockview_content(App &$a) {
|
||||||
|
|
||||||
$type = (($a->argc > 1) ? $a->argv[1] : 0);
|
$type = (($a->argc > 1) ? $a->argv[1] : 0);
|
||||||
if (is_numeric($type)) {
|
if (is_numeric($type)) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function login_content(&$a) {
|
function login_content(App &$a) {
|
||||||
if(x($_SESSION,'theme'))
|
if(x($_SESSION,'theme'))
|
||||||
unset($_SESSION['theme']);
|
unset($_SESSION['theme']);
|
||||||
if(x($_SESSION,'mobile-theme'))
|
if(x($_SESSION,'mobile-theme'))
|
||||||
|
|
|
@ -4,7 +4,7 @@ require_once('include/email.php');
|
||||||
require_once('include/enotify.php');
|
require_once('include/enotify.php');
|
||||||
require_once('include/text.php');
|
require_once('include/text.php');
|
||||||
|
|
||||||
function lostpass_post(&$a) {
|
function lostpass_post(App &$a) {
|
||||||
|
|
||||||
$loginame = notags(trim($_POST['login-name']));
|
$loginame = notags(trim($_POST['login-name']));
|
||||||
if(! $loginame)
|
if(! $loginame)
|
||||||
|
@ -77,7 +77,7 @@ function lostpass_post(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function lostpass_content(&$a) {
|
function lostpass_content(App &$a) {
|
||||||
|
|
||||||
|
|
||||||
if(x($_GET,'verify')) {
|
if(x($_GET,'verify')) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function maintenance_content(&$a) {
|
function maintenance_content(App &$a) {
|
||||||
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||||
header('Status: 503 Service Temporarily Unavailable');
|
header('Status: 503 Service Temporarily Unavailable');
|
||||||
header('Retry-After: 600');
|
header('Retry-After: 600');
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require_once("include/text.php");
|
require_once("include/text.php");
|
||||||
|
|
||||||
|
|
||||||
function manage_post(&$a) {
|
function manage_post(App &$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
@ -91,7 +91,7 @@ function manage_post(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function manage_content(&$a) {
|
function manage_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -13,7 +13,7 @@ require_once('mod/proxy.php');
|
||||||
* @param App &$a
|
* @param App &$a
|
||||||
* @return void|string
|
* @return void|string
|
||||||
*/
|
*/
|
||||||
function match_content(&$a) {
|
function match_content(App &$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
|
|
|
@ -4,7 +4,7 @@ require_once('include/acl_selectors.php');
|
||||||
require_once('include/message.php');
|
require_once('include/message.php');
|
||||||
require_once('include/Smilies.php');
|
require_once('include/Smilies.php');
|
||||||
|
|
||||||
function message_init(&$a) {
|
function message_init(App &$a) {
|
||||||
|
|
||||||
$tabs = '';
|
$tabs = '';
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ function message_init(&$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function message_post(&$a) {
|
function message_post(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -173,7 +173,7 @@ function item_redir_and_replace_images($body, $images, $cid) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function message_content(&$a) {
|
function message_content(App &$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
nav_set_selected('messages');
|
nav_set_selected('messages');
|
||||||
|
@ -364,7 +364,7 @@ function message_content(&$a) {
|
||||||
|
|
||||||
$_SESSION['return_url'] = $a->query_string;
|
$_SESSION['return_url'] = $a->query_string;
|
||||||
|
|
||||||
if($a->argc == 1) {
|
if ($a->argc == 1) {
|
||||||
|
|
||||||
// List messages
|
// List messages
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once('library/asn1.php');
|
require_once('library/asn1.php');
|
||||||
|
|
||||||
function modexp_init(&$a) {
|
function modexp_init(App &$a) {
|
||||||
|
|
||||||
if($a->argc != 2)
|
if($a->argc != 2)
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
|
|
||||||
function mood_init(&$a) {
|
function mood_init(App &$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
@ -108,7 +108,7 @@ function mood_init(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function mood_content(&$a) {
|
function mood_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function msearch_post(&$a) {
|
function msearch_post(App &$a) {
|
||||||
|
|
||||||
$perpage = (($_POST['n']) ? $_POST['n'] : 80);
|
$perpage = (($_POST['n']) ? $_POST['n'] : 80);
|
||||||
$page = (($_POST['p']) ? intval($_POST['p'] - 1) : 0);
|
$page = (($_POST['p']) ? intval($_POST['p'] - 1) : 0);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once("include/nav.php");
|
require_once("include/nav.php");
|
||||||
|
|
||||||
function navigation_content(&$a) {
|
function navigation_content(App &$a) {
|
||||||
|
|
||||||
$nav_info = nav_info($a);
|
$nav_info = nav_info($a);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
function network_init(&$a) {
|
function network_init(App &$a) {
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
|
@ -222,7 +222,7 @@ function saved_searches($search) {
|
||||||
*
|
*
|
||||||
* @return Array ( $no_active, $comment_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active );
|
* @return Array ( $no_active, $comment_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active );
|
||||||
*/
|
*/
|
||||||
function network_query_get_sel_tab($a) {
|
function network_query_get_sel_tab(App &$a) {
|
||||||
$no_active='';
|
$no_active='';
|
||||||
$starred_active = '';
|
$starred_active = '';
|
||||||
$new_active = '';
|
$new_active = '';
|
||||||
|
@ -293,7 +293,7 @@ function network_query_get_sel_net() {
|
||||||
return $network;
|
return $network;
|
||||||
}
|
}
|
||||||
|
|
||||||
function network_query_get_sel_group($a) {
|
function network_query_get_sel_group(App &$a) {
|
||||||
$group = false;
|
$group = false;
|
||||||
|
|
||||||
if($a->argc >= 2 && is_numeric($a->argv[1])) {
|
if($a->argc >= 2 && is_numeric($a->argv[1])) {
|
||||||
|
@ -810,7 +810,7 @@ function network_content(&$a, $update = 0) {
|
||||||
* @param app $a The global App
|
* @param app $a The global App
|
||||||
* @return string Html of the networktab
|
* @return string Html of the networktab
|
||||||
*/
|
*/
|
||||||
function network_tabs($a) {
|
function network_tabs(App &$a) {
|
||||||
// item filter tabs
|
// item filter tabs
|
||||||
/// @TODO fix this logic, reduce duplication
|
/// @TODO fix this logic, reduce duplication
|
||||||
/// $a->page['content'] .= '<div class="tabs-wrapper">';
|
/// $a->page['content'] .= '<div class="tabs-wrapper">';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function newmember_content(&$a) {
|
function newmember_content(App &$a) {
|
||||||
|
|
||||||
|
|
||||||
$o = '<h1>' . t('Welcome to Friendica') . '</h1>';
|
$o = '<h1>' . t('Welcome to Friendica') . '</h1>';
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
require_once("include/plugin.php");
|
require_once("include/plugin.php");
|
||||||
|
|
||||||
function nodeinfo_wellknown(&$a) {
|
function nodeinfo_wellknown(App &$a) {
|
||||||
if (!get_config("system", "nodeinfo")) {
|
if (!get_config("system", "nodeinfo")) {
|
||||||
http_status_exit(404);
|
http_status_exit(404);
|
||||||
killme();
|
killme();
|
||||||
|
@ -20,7 +20,7 @@ function nodeinfo_wellknown(&$a) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
function nodeinfo_init(&$a){
|
function nodeinfo_init(App &$a){
|
||||||
if (!get_config("system", "nodeinfo")) {
|
if (!get_config("system", "nodeinfo")) {
|
||||||
http_status_exit(404);
|
http_status_exit(404);
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -4,7 +4,7 @@ require_once('include/Contact.php');
|
||||||
require_once('include/socgraph.php');
|
require_once('include/socgraph.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
|
|
||||||
function nogroup_init(&$a) {
|
function nogroup_init(App &$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
@ -19,7 +19,7 @@ function nogroup_init(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function nogroup_content(&$a) {
|
function nogroup_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function noscrape_init(&$a) {
|
function noscrape_init(App &$a) {
|
||||||
|
|
||||||
if($a->argc > 1)
|
if($a->argc > 1)
|
||||||
$which = $a->argv[1];
|
$which = $a->argv[1];
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function notes_init(&$a) {
|
function notes_init(App &$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/* identi.ca -> friendica items permanent-url compatibility */
|
/* identi.ca -> friendica items permanent-url compatibility */
|
||||||
|
|
||||||
function notice_init(&$a){
|
function notice_init(App &$a){
|
||||||
$id = $a->argv[1];
|
$id = $a->argv[1];
|
||||||
$r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d",
|
$r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d",
|
||||||
intval($id)
|
intval($id)
|
||||||
|
|
|
@ -9,7 +9,7 @@ require_once("include/NotificationsManager.php");
|
||||||
require_once("include/contact_selectors.php");
|
require_once("include/contact_selectors.php");
|
||||||
require_once("include/network.php");
|
require_once("include/network.php");
|
||||||
|
|
||||||
function notifications_post(&$a) {
|
function notifications_post(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
|
@ -65,7 +65,7 @@ function notifications_post(&$a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function notifications_content(&$a) {
|
function notifications_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
require_once('include/NotificationsManager.php');
|
require_once('include/NotificationsManager.php');
|
||||||
|
|
||||||
|
|
||||||
function notify_init(&$a) {
|
function notify_init(App &$a) {
|
||||||
if(! local_user()) return;
|
if(! local_user()) return;
|
||||||
$nm = new NotificationsManager();
|
$nm = new NotificationsManager();
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ function notify_init(&$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function notify_content(&$a) {
|
function notify_content(App &$a) {
|
||||||
if(! local_user()) return login();
|
if(! local_user()) return login();
|
||||||
|
|
||||||
$nm = new NotificationsManager();
|
$nm = new NotificationsManager();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
require_once("include/oembed.php");
|
require_once("include/oembed.php");
|
||||||
|
|
||||||
function oembed_content(&$a){
|
function oembed_content(App &$a){
|
||||||
// logger('mod_oembed ' . $a->query_string, LOGGER_ALL);
|
// logger('mod_oembed ' . $a->query_string, LOGGER_ALL);
|
||||||
|
|
||||||
if ($a->argv[1]=='b2h'){
|
if ($a->argv[1]=='b2h'){
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
function oexchange_init(&$a) {
|
function oexchange_init(App &$a) {
|
||||||
|
|
||||||
if(($a->argc > 1) && ($a->argv[1] === 'xrd')) {
|
if(($a->argc > 1) && ($a->argv[1] === 'xrd')) {
|
||||||
$tpl = get_markup_template('oexchange_xrd.tpl');
|
$tpl = get_markup_template('oexchange_xrd.tpl');
|
||||||
|
@ -14,7 +14,7 @@ function oexchange_init(&$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function oexchange_content(&$a) {
|
function oexchange_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
$o = login(false);
|
$o = login(false);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
require_once('library/openid.php');
|
require_once('library/openid.php');
|
||||||
|
|
||||||
|
|
||||||
function openid_content(&$a) {
|
function openid_content(App &$a) {
|
||||||
|
|
||||||
$noid = get_config('system','no_openid');
|
$noid = get_config('system','no_openid');
|
||||||
if($noid)
|
if($noid)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
function opensearch_content(&$a) {
|
function opensearch_content(App &$a) {
|
||||||
|
|
||||||
$tpl = get_markup_template('opensearch.tpl');
|
$tpl = get_markup_template('opensearch.tpl');
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require_once('include/Scrape.php');
|
require_once('include/Scrape.php');
|
||||||
require_once('include/follow.php');
|
require_once('include/follow.php');
|
||||||
|
|
||||||
function ostatus_subscribe_content(&$a) {
|
function ostatus_subscribe_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -19,7 +19,7 @@ use \Friendica\ParseUrl;
|
||||||
|
|
||||||
require_once("include/items.php");
|
require_once("include/items.php");
|
||||||
|
|
||||||
function parse_url_content(&$a) {
|
function parse_url_content(App &$a) {
|
||||||
|
|
||||||
$text = null;
|
$text = null;
|
||||||
$str_tags = "";
|
$str_tags = "";
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
require_once('include/Photo.php');
|
require_once('include/Photo.php');
|
||||||
|
|
||||||
function photo_init(&$a) {
|
function photo_init(App &$a) {
|
||||||
global $_SERVER;
|
global $_SERVER;
|
||||||
|
|
||||||
$prvcachecontrol = false;
|
$prvcachecontrol = false;
|
||||||
|
|
|
@ -10,7 +10,7 @@ require_once('include/tags.php');
|
||||||
require_once('include/threads.php');
|
require_once('include/threads.php');
|
||||||
require_once('include/Probe.php');
|
require_once('include/Probe.php');
|
||||||
|
|
||||||
function photos_init(&$a) {
|
function photos_init(App &$a) {
|
||||||
|
|
||||||
if ($a->argc > 1)
|
if ($a->argc > 1)
|
||||||
auto_redir($a, $a->argv[1]);
|
auto_redir($a, $a->argv[1]);
|
||||||
|
@ -112,7 +112,7 @@ function photos_init(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function photos_post(&$a) {
|
function photos_post(App &$a) {
|
||||||
|
|
||||||
logger('mod-photos: photos_post: begin' , LOGGER_DEBUG);
|
logger('mod-photos: photos_post: begin' , LOGGER_DEBUG);
|
||||||
|
|
||||||
|
@ -928,7 +928,7 @@ function photos_post(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function photos_content(&$a) {
|
function photos_content(App &$a) {
|
||||||
|
|
||||||
// URLs:
|
// URLs:
|
||||||
// photos/name
|
// photos/name
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// See here for a documentation for portable contacts:
|
// See here for a documentation for portable contacts:
|
||||||
// https://web.archive.org/web/20160405005550/http://portablecontacts.net/draft-spec.html
|
// https://web.archive.org/web/20160405005550/http://portablecontacts.net/draft-spec.html
|
||||||
|
|
||||||
function poco_init(&$a) {
|
function poco_init(App &$a) {
|
||||||
require_once("include/bbcode.php");
|
require_once("include/bbcode.php");
|
||||||
|
|
||||||
$system_mode = false;
|
$system_mode = false;
|
||||||
|
|
|
@ -19,7 +19,7 @@ require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
|
|
||||||
function poke_init(&$a) {
|
function poke_init(App &$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
@ -144,7 +144,7 @@ function poke_init(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function poke_content(&$a) {
|
function poke_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -10,11 +10,11 @@ require_once('include/crypto.php');
|
||||||
// not yet ready for prime time
|
// not yet ready for prime time
|
||||||
//require_once('include/zot.php');
|
//require_once('include/zot.php');
|
||||||
|
|
||||||
function post_post(&$a) {
|
function post_post(App &$a) {
|
||||||
|
|
||||||
$bulk_delivery = false;
|
$bulk_delivery = false;
|
||||||
|
|
||||||
if($a->argc == 1) {
|
if ($a->argc == 1) {
|
||||||
$bulk_delivery = true;
|
$bulk_delivery = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function pretheme_init(&$a) {
|
function pretheme_init(App &$a) {
|
||||||
|
|
||||||
if($_REQUEST['theme']) {
|
if($_REQUEST['theme']) {
|
||||||
$theme = $_REQUEST['theme'];
|
$theme = $_REQUEST['theme'];
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once('include/Scrape.php');
|
require_once('include/Scrape.php');
|
||||||
|
|
||||||
function probe_content(&$a) {
|
function probe_content(App &$a) {
|
||||||
|
|
||||||
$o .= '<h3>Probe Diagnostic</h3>';
|
$o .= '<h3>Probe Diagnostic</h3>';
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ require_once('include/contact_widgets.php');
|
||||||
require_once('include/redir.php');
|
require_once('include/redir.php');
|
||||||
|
|
||||||
|
|
||||||
function profile_init(&$a) {
|
function profile_init(App &$a) {
|
||||||
|
|
||||||
if(! x($a->page,'aside'))
|
if(! x($a->page,'aside'))
|
||||||
$a->page['aside'] = '';
|
$a->page['aside'] = '';
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once("include/Photo.php");
|
require_once("include/Photo.php");
|
||||||
|
|
||||||
function profile_photo_init(&$a) {
|
function profile_photo_init(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
return;
|
return;
|
||||||
|
@ -13,7 +13,7 @@ function profile_photo_init(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function profile_photo_post(&$a) {
|
function profile_photo_post(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice ( t('Permission denied.') . EOL );
|
notice ( t('Permission denied.') . EOL );
|
||||||
|
@ -169,7 +169,7 @@ function profile_photo_post(&$a) {
|
||||||
|
|
||||||
|
|
||||||
if(! function_exists('profile_photo_content')) {
|
if(! function_exists('profile_photo_content')) {
|
||||||
function profile_photo_content(&$a) {
|
function profile_photo_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL );
|
notice( t('Permission denied.') . EOL );
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
require_once("include/Contact.php");
|
require_once("include/Contact.php");
|
||||||
require_once('include/Probe.php');
|
require_once('include/Probe.php');
|
||||||
|
|
||||||
function profiles_init(&$a) {
|
function profiles_init(App &$a) {
|
||||||
|
|
||||||
nav_set_selected('profiles');
|
nav_set_selected('profiles');
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ function profile_clean_keywords($keywords) {
|
||||||
return $keywords;
|
return $keywords;
|
||||||
}
|
}
|
||||||
|
|
||||||
function profiles_post(&$a) {
|
function profiles_post(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -599,7 +599,7 @@ function profile_activity($changed, $value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function profiles_content(&$a) {
|
function profiles_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function profperm_init(&$a) {
|
function profperm_init(App &$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
@ -13,7 +13,7 @@ function profperm_init(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function profperm_content(&$a) {
|
function profperm_content(App &$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied') . EOL);
|
notice( t('Permission denied') . EOL);
|
||||||
|
|
|
@ -26,7 +26,7 @@ function hub_post_return() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function pubsub_init(&$a) {
|
function pubsub_init(App &$a) {
|
||||||
|
|
||||||
$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
|
$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
|
||||||
$contact_id = (($a->argc > 2) ? intval($a->argv[2]) : 0 );
|
$contact_id = (($a->argc > 2) ? intval($a->argv[2]) : 0 );
|
||||||
|
@ -98,7 +98,7 @@ function pubsub_init(&$a) {
|
||||||
|
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
|
|
||||||
function pubsub_post(&$a) {
|
function pubsub_post(App &$a) {
|
||||||
|
|
||||||
$xml = file_get_contents('php://input');
|
$xml = file_get_contents('php://input');
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ function post_var($name) {
|
||||||
return (x($_POST, $name)) ? notags(trim($_POST[$name])) : '';
|
return (x($_POST, $name)) ? notags(trim($_POST[$name])) : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function pubsubhubbub_init(&$a) {
|
function pubsubhubbub_init(App &$a) {
|
||||||
// PuSH subscription must be considered "public" so just block it
|
// PuSH subscription must be considered "public" so just block it
|
||||||
// if public access isn't enabled.
|
// if public access isn't enabled.
|
||||||
if (get_config('system', 'block_public')) {
|
if (get_config('system', 'block_public')) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function qsearch_init(&$a) {
|
function qsearch_init(App &$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
function randprof_init(&$a) {
|
function randprof_init(App &$a) {
|
||||||
require_once('include/Contact.php');
|
require_once('include/Contact.php');
|
||||||
$x = random_profile();
|
$x = random_profile();
|
||||||
if($x)
|
if($x)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue