aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authormarijus <mario@mariovavti.com>2014-03-05 17:03:38 +0100
committermarijus <mario@mariovavti.com>2014-03-05 17:03:38 +0100
commit6cdc25ade96c4451e87af475a6e4f0490b591c36 (patch)
tree474ebb0f31063805d8b95dcddc22d4345c989936 /mod
parentffb791968e48b5699dc99fffccc562f198f86c5d (diff)
parentd58abc0230e07663ce543088c186639d36f82f02 (diff)
downloadvolse-hubzilla-6cdc25ade96c4451e87af475a6e4f0490b591c36.tar.gz
volse-hubzilla-6cdc25ade96c4451e87af475a6e4f0490b591c36.tar.bz2
volse-hubzilla-6cdc25ade96c4451e87af475a6e4f0490b591c36.zip
Merge branch 'master' of https://github.com/friendica/red
Diffstat (limited to 'mod')
-rw-r--r--mod/connections.php47
-rw-r--r--mod/dirsearch.php2
-rw-r--r--mod/item.php2
-rw-r--r--mod/lang.php6
-rw-r--r--mod/openid.php2
-rw-r--r--mod/pdledit.php62
-rw-r--r--mod/post.php1
-rw-r--r--mod/settings.php1
8 files changed, 104 insertions, 19 deletions
diff --git a/mod/connections.php b/mod/connections.php
index 679b6d79d..dbdcbdc93 100644
--- a/mod/connections.php
+++ b/mod/connections.php
@@ -35,7 +35,7 @@ function connections_post(&$a) {
if(! $orig_record) {
notice( t('Could not access contact record.') . EOL);
- goaway($a->get_baseurl(true) . '/connections');
+ goaway(z_root() . '/connections');
return; // NOTREACHED
}
@@ -170,14 +170,14 @@ function connections_content(&$a) {
return login();
}
- $blocked = false;
- $hidden = false;
- $ignored = false;
- $archived = false;
- $unblocked = false;
- $pending = false;
-
- $all = false;
+ $blocked = false;
+ $hidden = false;
+ $ignored = false;
+ $archived = false;
+ $unblocked = false;
+ $pending = false;
+ $unconnected = false;
+ $all = false;
$_SESSION['return_url'] = $a->query_string;
@@ -212,6 +212,11 @@ function connections_content(&$a) {
$pending = true;
nav_set_selected('intros');
break;
+ case 'unconnected':
+ $search_flags = ABOOK_FLAG_UNCONNECTED;
+ $head = t('Unconnected');
+ $unconnected = true;
+ break;
case 'all':
$head = t('All');
@@ -237,57 +242,65 @@ function connections_content(&$a) {
$tabs = array(
array(
'label' => t('Suggestions'),
- 'url' => $a->get_baseurl(true) . '/suggest',
+ 'url' => z_root() . '/suggest',
'sel' => '',
'title' => t('Suggest new connections'),
),
array(
'label' => t('New Connections'),
- 'url' => $a->get_baseurl(true) . '/connections/pending',
+ 'url' => z_root() . '/connections/pending',
'sel' => ($pending) ? 'active' : '',
'title' => t('Show pending (new) connections'),
),
array(
'label' => t('All Connections'),
- 'url' => $a->get_baseurl(true) . '/connections/all',
+ 'url' => z_root() . '/connections/all',
'sel' => ($all) ? 'active' : '',
'title' => t('Show all connections'),
),
array(
'label' => t('Unblocked'),
- 'url' => $a->get_baseurl(true) . '/connections',
+ 'url' => z_root() . '/connections',
'sel' => (($unblocked) && (! $search) && (! $nets)) ? 'active' : '',
'title' => t('Only show unblocked connections'),
),
array(
'label' => t('Blocked'),
- 'url' => $a->get_baseurl(true) . '/connections/blocked',
+ 'url' => z_root() . '/connections/blocked',
'sel' => ($blocked) ? 'active' : '',
'title' => t('Only show blocked connections'),
),
array(
'label' => t('Ignored'),
- 'url' => $a->get_baseurl(true) . '/connections/ignored',
+ 'url' => z_root() . '/connections/ignored',
'sel' => ($ignored) ? 'active' : '',
'title' => t('Only show ignored connections'),
),
array(
'label' => t('Archived'),
- 'url' => $a->get_baseurl(true) . '/connections/archived',
+ 'url' => z_root() . '/connections/archived',
'sel' => ($archived) ? 'active' : '',
'title' => t('Only show archived connections'),
),
array(
'label' => t('Hidden'),
- 'url' => $a->get_baseurl(true) . '/connections/hidden',
+ 'url' => z_root() . '/connections/hidden',
'sel' => ($hidden) ? 'active' : '',
'title' => t('Only show hidden connections'),
),
+ array(
+ 'label' => t('Unconnected'),
+ 'url' => z_root() . '/connections/unconnected',
+ 'sel' => ($unconnected) ? 'active' : '',
+ 'title' => t('Only show one-way connections'),
+ ),
+
+
);
$tab_tpl = get_markup_template('common_tabs.tpl');
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 7b83b8a46..d06ccb619 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -99,7 +99,7 @@ function dirsearch_content(&$a) {
- $perpage = (($_REQUEST['n']) ? $_REQUEST['n'] : 80);
+ $perpage = (($_REQUEST['n']) ? $_REQUEST['n'] : 300);
$page = (($_REQUEST['p']) ? intval($_REQUEST['p'] - 1) : 0);
$startrec = (($page+1) * $perpage) - $perpage;
$limit = (($_REQUEST['limit']) ? intval($_REQUEST['limit']) : 0);
diff --git a/mod/item.php b/mod/item.php
index 2feb64a37..6ea434542 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -862,7 +862,7 @@ function item_post(&$a) {
// figure out how to return, depending on from whence we came
if($api_source)
- return;
+ return $post;
if($return_path) {
goaway($a->get_baseurl() . "/" . $return_path);
diff --git a/mod/lang.php b/mod/lang.php
new file mode 100644
index 000000000..fba5f9c73
--- /dev/null
+++ b/mod/lang.php
@@ -0,0 +1,6 @@
+<?php
+
+function lang_content(&$a) {
+ return lang_selector();
+}
+
diff --git a/mod/openid.php b/mod/openid.php
index b0d4008d4..2112e0af4 100644
--- a/mod/openid.php
+++ b/mod/openid.php
@@ -62,6 +62,7 @@ function openid_content(&$a) {
if($r) {
$_SESSION['authenticated'] = 1;
$_SESSION['visitor_id'] = $r[0]['xchan_hash'];
+ $_SESSION['my_url'] = $r[0]['xchan_url'];
$_SESSION['my_address'] = $r[0]['xchan_addr'];
$arr = array('xchan' => $r[0], 'session' => $_SESSION);
call_hooks('magic_auth_openid_success',$arr);
@@ -169,6 +170,7 @@ function openid_content(&$a) {
set_xconfig($url,'system','openid',$authid);
$_SESSION['authenticated'] = 1;
$_SESSION['visitor_id'] = $r[0]['xchan_hash'];
+ $_SESSION['my_url'] = $r[0]['xchan_url'];
$_SESSION['my_address'] = $r[0]['xchan_addr'];
$arr = array('xchan' => $r[0], 'session' => $_SESSION);
call_hooks('magic_auth_openid_success',$arr);
diff --git a/mod/pdledit.php b/mod/pdledit.php
new file mode 100644
index 000000000..36b9a0c14
--- /dev/null
+++ b/mod/pdledit.php
@@ -0,0 +1,62 @@
+<?php
+
+function pdledit_post(&$a) {
+ if(! local_user())
+ return;
+ if(! $_REQUEST['module'])
+ return;
+ if(! trim($_REQUEST['content'])) {
+ del_pconfig(local_user(),'system','mod_' . $_REQUEST['module'] . '.pdl');
+ goaway(z_root() . '/pdledit/' . $_REQUEST['module']);
+ }
+ set_pconfig(local_user(),'system','mod_' . $_REQUEST['module'] . '.pdl',escape_tags($_REQUEST['content']));
+ info( t('Layout updated.') . EOL);
+ goaway(z_root() . '/pdledit/' . $_REQUEST['module']);
+}
+
+
+function pdledit_content(&$a) {
+
+ if(! local_user()) {
+ notice( t('Permission denied.') . EOL);
+ return;
+ }
+
+ if(argc() > 1)
+ $module = 'mod_' . argv(1) . '.pdl';
+ else {
+ $o .= '<h1>' . t('Edit System Page Description') . '</h1>';
+ $files = glob('mod/*');
+ if($files) {
+ foreach($files as $f) {
+ $name = basename($f,'.php');
+ $x = theme_include('mod_' . $name . '.pdl');
+ if($x) {
+ $o .= '<a href="pdledit/' . $name . '" >' . $name . '</a><br />';
+ }
+ }
+ }
+
+ // list module pdl files
+ return $o;
+ }
+
+ $t = get_pconfig(local_user(),'system',$module);
+ if(! $t)
+ $t = file_get_contents(theme_include($module));
+ if(! $t) {
+ notice( t('Layout not found.') . EOL);
+ return '';
+ }
+
+ $o = replace_macros(get_markup_template('pdledit.tpl'),array(
+ '$header' => t('Edit System Page Description'),
+ '$mname' => t('Module Name:'),
+ '$help' => t('Layout Help'),
+ '$module' => argv(1),
+ '$content' => htmlspecialchars($t,ENT_COMPAT,'UTF-8'),
+ '$submit' => t('Submit')
+ ));
+
+ return $o;
+}
diff --git a/mod/post.php b/mod/post.php
index 6c57bfa0d..54d0d8db9 100644
--- a/mod/post.php
+++ b/mod/post.php
@@ -243,6 +243,7 @@ function post_init(&$a) {
$_SESSION['authenticated'] = 1;
$_SESSION['visitor_id'] = $x[0]['xchan_hash'];
+ $_SESSION['my_url'] = $x[0]['xchan_url'];
$_SESSION['my_address'] = $address;
$_SESSION['remote_service_class'] = $remote_service_class;
$_SESSION['remote_level'] = $remote_level;
diff --git a/mod/settings.php b/mod/settings.php
index 13cb3cae9..1d2a5ecf9 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -758,6 +758,7 @@ function settings_content(&$a) {
'$itemspage' => array('itemspage', t("Maximum number of conversations to load at any time:"), $itemspage, t('Maximum of 100 items')),
'$nosmile' => array('nosmile', t("Don't show emoticons"), $nosmile, ''),
'$chanview_full' => array('chanview_full', t('Do not view remote profiles in frames'), $chanview, t('By default open in a sub-window of your own site')),
+ '$layout_editor' => t('System Page Layout Editor - (advanced)'),
'$theme_config' => $theme_config,
));