diff options
author | marijus <mario@mariovavti.com> | 2014-03-05 17:03:38 +0100 |
---|---|---|
committer | marijus <mario@mariovavti.com> | 2014-03-05 17:03:38 +0100 |
commit | 6cdc25ade96c4451e87af475a6e4f0490b591c36 (patch) | |
tree | 474ebb0f31063805d8b95dcddc22d4345c989936 | |
parent | ffb791968e48b5699dc99fffccc562f198f86c5d (diff) | |
parent | d58abc0230e07663ce543088c186639d36f82f02 (diff) | |
download | volse-hubzilla-6cdc25ade96c4451e87af475a6e4f0490b591c36.tar.gz volse-hubzilla-6cdc25ade96c4451e87af475a6e4f0490b591c36.tar.bz2 volse-hubzilla-6cdc25ade96c4451e87af475a6e4f0490b591c36.zip |
Merge branch 'master' of https://github.com/friendica/red
-rw-r--r-- | assets/home.html | 4 | ||||
-rwxr-xr-x | boot.php | 1 | ||||
-rw-r--r-- | doc/Comanche.md | 8 | ||||
-rw-r--r-- | doc/Widgets.md | 73 | ||||
-rw-r--r-- | doc/comanche.bb | 8 | ||||
-rw-r--r-- | doc/main.bb | 1 | ||||
-rw-r--r-- | include/api.php | 48 | ||||
-rw-r--r-- | include/identity.php | 2 | ||||
-rwxr-xr-x | include/items.php | 4 | ||||
-rw-r--r-- | include/nav.php | 1 | ||||
-rw-r--r-- | include/onepoll.php | 7 | ||||
-rw-r--r-- | include/poller.php | 9 | ||||
-rw-r--r-- | include/widgets.php | 56 | ||||
-rw-r--r-- | include/zot.php | 15 | ||||
-rw-r--r-- | mod/connections.php | 47 | ||||
-rw-r--r-- | mod/dirsearch.php | 2 | ||||
-rw-r--r-- | mod/item.php | 2 | ||||
-rw-r--r-- | mod/lang.php | 6 | ||||
-rw-r--r-- | mod/openid.php | 2 | ||||
-rw-r--r-- | mod/pdledit.php | 62 | ||||
-rw-r--r-- | mod/post.php | 1 | ||||
-rw-r--r-- | mod/settings.php | 1 | ||||
-rw-r--r-- | version.inc | 2 | ||||
-rw-r--r-- | view/theme/redbasic/css/style.css | 6 | ||||
-rw-r--r-- | view/tpl/hdr.tpl | 1 | ||||
-rwxr-xr-x | view/tpl/lang_selector.tpl | 5 | ||||
-rw-r--r-- | view/tpl/pdledit.tpl | 21 | ||||
-rwxr-xr-x | view/tpl/settings_display.tpl | 4 |
28 files changed, 340 insertions, 59 deletions
diff --git a/assets/home.html b/assets/home.html index 0ec29832e..923791b98 100644 --- a/assets/home.html +++ b/assets/home.html @@ -26,7 +26,7 @@ header { z-index: 10000; } <div style="margin-top: 50px;"></div> <center> -<div style="color:#808080;font-weight:bold;font-size:4.0em; margin-bottom:75px;">Dream it. Do it.</div> +<div style="color:#808080;font-weight:bold;font-size:4.0em; margin-top:105px; margin-bottom:45px;">Dream it. Do it.</div> <img style="width: 450px; margin-bottom: 95px;" src="assets/logo_simplifiedap.png" > </center> <div class="tr"> @@ -72,4 +72,4 @@ header { z-index: 10000; } <div class="tr"></div> -<center><div style="margin-top: 35px; color: #808080; font-size: 1.8em;">Welcome to the Matrix</div><div style="font-size: 1.4em; color: #808080;">“The most fun you ever had without taking your clothes off.”<br /><a href="pubsites">Public Sites</a> | <a href="https://redmatrix.me">Project Home</a> | <a href="https://github.com/friendica/red">Git</a> | <a href="https://zothub.com/channel/one">Developers</a></div></center> +<center><div style="margin-top: 35px; color: #808080; font-size: 1.8em;">Welcome to the Matrix</div><a href="pubsites">Public Sites</a> | <a href="https://redmatrix.me">Project Home</a> | <a href="https://github.com/friendica/red">Git</a> | <a href="https://zothub.com/channel/one">Developers</a></div></center> @@ -290,6 +290,7 @@ define ( 'ABOOK_FLAG_IGNORED' , 0x0002); define ( 'ABOOK_FLAG_HIDDEN' , 0x0004); define ( 'ABOOK_FLAG_ARCHIVED' , 0x0008); define ( 'ABOOK_FLAG_PENDING' , 0x0010); +define ( 'ABOOK_FLAG_UNCONNECTED', 0x0020); define ( 'ABOOK_FLAG_SELF' , 0x0080); diff --git a/doc/Comanche.md b/doc/Comanche.md index 658b31ca7..fe122db8c 100644 --- a/doc/Comanche.md +++ b/doc/Comanche.md @@ -98,9 +98,9 @@ Widgets are executable apps provided by the system which you can place on your p -Widgets and arguments are specified with the 'widget' and 'arg' tags. +Widgets and arguments are specified with the 'widget' and 'var' tags. - [widget=recent_visitors][arg=count]24[/arg][/widget] + [widget=recent_visitors][var=count]24[/var][/widget] This loads the "recent_visitors" widget and supplies it with the argument "count" set to "24". @@ -136,8 +136,8 @@ Please note that pasting this example into a layout page is not likely to do any [menu]myfavouritemenu[/menu] [widget=recent_visitors] - [arg=count]24[/arg] - [arg=names_only]1[/arg] + [var=count]24[/var] + [var=names_only]1[/var] [/widget] [widget=tagcloud][/widget] diff --git a/doc/Widgets.md b/doc/Widgets.md new file mode 100644 index 000000000..dc7093f8a --- /dev/null +++ b/doc/Widgets.md @@ -0,0 +1,73 @@ +Core Widgets +============ + +Some/many of these widgets have restrictions which may restrict the type of page where they may appear or may require login + + +* clock - displays the current time + * args: military (1 or 0) - use 24 hour time as opposed to AM/PM + * + +* profile - displays a profile sidebar on pages which load profiles (pages with nickname in the URL) + +* tagcloud - display a tagcloud of webpage items + + * args: count - number of items to return (default 24) + * + + +* collections - collection selector for the current logged in channel + + * args: mode - one of "conversation", "group", "abook" depending on module + * + + +* suggestions - friend suggestions for the current logged on channel + +* follow - presents a text box for following another channel + +* notes - private notes area for the current logged in channel if private_notes feature is enabled + +* savedsearch - network/matrix search with save - must be logged in and savedsearch feature enabled + +* filer - select filed items from network/matrix stream - must be logged in + +* archive - date range selector for network and channel pages + +* fullprofile - same as profile currently + +* categories - categories filter (channel page) + +* tagcloud_wall - tagcloud for channel page only + +* affinity - affinity slider for network page - must be logged in + +* settings_menu - sidebar menu for settings page, must be logged in + +* mailmenu - sidebar menu for private message page - must be logged in + +* design_tools - design tools menu for webpage building pages, must be logged in + +* findpeople - tools to find other channels + +* photo_albums - list photo albums of the current page owner with a selector menu + +* vcard - mini profile sidebar for the person of interest (page owner, whatever) + +* dirsafemode - directory selection tool - only on directory pages + +* dirsort - directory selection tool - only on directory pages + +* dirtags - directory tool - only on directory pages + +* menu_preview - preview a menu - only on menu edit pages + +* chatroom_list - list of chatrooms for the page owner + +* bookmarkedchats - list of bookmarked chatrooms collected on this site for the current observer + +* suggestechats - "interesting" chatrooms chosen for the current observer + +* item - displays a single webpage item by mid +1 args: mid - message_id of webpage to display + diff --git a/doc/comanche.bb b/doc/comanche.bb index 1464d809d..e79f9a4c7 100644 --- a/doc/comanche.bb +++ b/doc/comanche.bb @@ -111,9 +111,9 @@ Widgets are executable apps provided by the system which you can place on your p [/code]
-Widgets and arguments are specified with the 'widget' and 'arg' tags.
+Widgets and arguments are specified with the 'widget' and 'var' tags.
[code]
- [widget=recent_visitors][arg=count]24[/arg][/widget]
+ [widget=recent_visitors][var=count]24[/var][/widget]
[/code]
This loads the "recent_visitors" widget and supplies it with the argument "count" set to "24".
@@ -150,8 +150,8 @@ The 'comment' tag is used to delimit comments. These comments will not appear on [menu]myfavouritemenu[/menu]
[widget=recent_visitors]
- [arg=count]24[/arg]
- [arg=names_only]1[/arg]
+ [var=count]24[/var]
+ [var=names_only]1[/var]
[/widget]
[widget=tagcloud][/widget]
diff --git a/doc/main.bb b/doc/main.bb index decaa0ffc..a9ee3c5d8 100644 --- a/doc/main.bb +++ b/doc/main.bb @@ -37,6 +37,7 @@ [zrl=[baseurl]/help/install]Install[/zrl]
[zrl=[baseurl]/help/comanche]Comanche Page Descriptions[/zrl]
[zrl=[baseurl]/help/Creating-Templates]Creating Comanche Templates[/zrl]
+[zrl=[baseurl]/help/Widgets]Core Widgets[/zrl]
[zrl=[baseurl]/help/plugins]Plugins[/zrl]
[zrl=[baseurl]/help/schema_development]Schemas[/zrl]
[zrl=[baseurl]/help/developers]Developers[/zrl]
diff --git a/include/api.php b/include/api.php index dc270167b..47c78113a 100644 --- a/include/api.php +++ b/include/api.php @@ -533,6 +533,12 @@ require_once('include/items.php'); api_register_func('api/red/channel/export/basic','api_export_basic', true); + + + + + + function api_channel_stream(&$a, $type) { if(api_user() === false) { logger('api_channel_stream: no user'); @@ -691,6 +697,48 @@ require_once('include/items.php'); api_register_func('api/statuses/update','api_statuses_update', true); + function red_item_new(&$a, $type) { + + if (api_user() === false) { + logger('api_statuses_update: no user'); + return false; + } + + logger('api_statuses_update: REQUEST ' . print_r($_REQUEST,true)); + logger('api_statuses_update: FILES ' . print_r($_FILES,true)); + + + // set this so that the item_post() function is quiet and doesn't redirect or emit json + + $_REQUEST['api_source'] = true; + $_REQUEST['profile_uid'] = api_user(); + + if(x($_FILES,'media')) { + $_FILES['userfile'] = $_FILES['media']; + // upload the image if we have one + $_REQUEST['silent']='1'; //tell wall_upload function to return img info instead of echo + require_once('mod/wall_upload.php'); + $media = wall_upload_post($a); + if(strlen($media)>0) + $_REQUEST['body'] .= "\n\n".$media; + } + + require_once('mod/item.php'); + $x = item_post($a); + json_return_and_die($x); + } + + api_register_func('api/red/item/new','red_item_new', true); + + + + + + + + + + function api_status_show(&$a, $type){ $user_info = api_get_user($a); diff --git a/include/identity.php b/include/identity.php index 93174031c..ed6920e67 100644 --- a/include/identity.php +++ b/include/identity.php @@ -1223,4 +1223,4 @@ function get_channel_by_nick($nick) { ); return(($r) ? $r[0] : false); -}
\ No newline at end of file +} diff --git a/include/items.php b/include/items.php index 6ff984370..70e098415 100755 --- a/include/items.php +++ b/include/items.php @@ -1548,7 +1548,7 @@ function item_store($arr,$allow_exec = false) { $allow_exec = $d['allow_exec']; - $ret = array('result' => false, 'item_id' => 0); + $ret = array('success' => false, 'item_id' => 0); if(! $arr['uid']) { logger('item_store: no uid'); @@ -1933,7 +1933,7 @@ function item_store_update($arr,$allow_exec = false) { - $ret = array('result' => false, 'item_id' => 0); + $ret = array('success' => false, 'item_id' => 0); if(! intval($arr['uid'])) { logger('item_store_update: no uid'); $ret['message'] = 'no uid.'; diff --git a/include/nav.php b/include/nav.php index ab0eaa855..3aa50226d 100644 --- a/include/nav.php +++ b/include/nav.php @@ -59,7 +59,6 @@ EOT; $a->page['header'] .= replace_macros(get_markup_template('hdr.tpl'), array( '$baseurl' => $a->get_baseurl(), '$sitelocation' => $sitelocation, - '$langselector' => ((get_config('system','select_language')) ? lang_selector() : ''), '$banner' => $banner )); diff --git a/include/onepoll.php b/include/onepoll.php index a821b76cf..e81d8bcf7 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -29,19 +29,16 @@ function onepoll_run($argv, $argc){ return; } - $d = datetime_convert(); - $contacts = q("SELECT abook.*, xchan.*, account.* FROM abook LEFT JOIN account on abook_account = account_id left join xchan on xchan_hash = abook_xchan where abook_id = %d - AND (( abook_flags = %d ) OR ( abook_flags = %d ) OR ( abook_flags & %d )) + AND (( abook_flags & %d ) OR ( abook_flags = %d )) AND (( account_flags = %d ) OR ( account_flags = %d )) limit 1", intval($contact_id), - intval(ABOOK_FLAG_HIDDEN), + intval(ABOOK_FLAG_HIDDEN|ABOOK_FLAG_PENDING|ABOOK_FLAG_UNCONNECTED), intval(0), - intval(ABOOK_FLAG_PENDING), intval(ACCOUNT_OK), intval(ACCOUNT_UNVERIFIED) ); diff --git a/include/poller.php b/include/poller.php index 649da30f6..423ee46c1 100644 --- a/include/poller.php +++ b/include/poller.php @@ -184,9 +184,7 @@ function poller_run($argv, $argc){ if(! $restart) proc_run('php','include/cronhooks.php'); - // Only poll from those with suitable relationships, - // and which have a polling address and ignore Diaspora since - // we are unable to match those posts with a Diaspora GUID and prevent duplicates. + // Only poll from those with suitable relationships $abandon_sql = (($abandon_days) ? sprintf(" AND account_lastlog > UTC_TIMESTAMP() - INTERVAL %d DAY ", intval($abandon_days)) @@ -197,10 +195,9 @@ function poller_run($argv, $argc){ $contacts = q("SELECT abook_id, abook_flags, abook_updated, abook_connected, abook_closeness, abook_channel FROM abook LEFT JOIN account on abook_account = account_id where 1 $sql_extra - AND (( abook_flags = %d ) OR ( abook_flags = %d )) + AND (( abook_flags & %d ) OR ( abook_flags = %d )) AND (( account_flags = %d ) OR ( account_flags = %d )) $abandon_sql ORDER BY RAND()", - - intval(ABOOK_FLAG_HIDDEN), + intval(ABOOK_FLAG_HIDDEN|ABOOK_FLAG_PENDING|ABOOK_FLAG_UNCONNECTED), intval(0), intval(ACCOUNT_OK), intval(ACCOUNT_UNVERIFIED) // FIXME diff --git a/include/widgets.php b/include/widgets.php index 8d8eef160..90586397f 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -649,4 +649,60 @@ function widget_item($arr) { $o .= prepare_page($r[0]); return $o; +} + +function widget_clock($arr) { + + $miltime = 0; + if(isset($arr['military']) && $arr['military']) + $miltime = 1; + +$o = <<< EOT +<div class="widget"> +<h3 class="clockface"></h3> +<script> + +var timerID = null +var timerRunning = false + +function stopclock(){ + if(timerRunning) + clearTimeout(timerID) + timerRunning = false +} + +function startclock(){ + stopclock() + showtime() +} + +function showtime(){ + var now = new Date() + var hours = now.getHours() + var minutes = now.getMinutes() + var seconds = now.getSeconds() + var military = $miltime + var timeValue = "" + if(military) + timeValue = hours + else + timeValue = ((hours > 12) ? hours - 12 : hours) + timeValue += ((minutes < 10) ? ":0" : ":") + minutes +// timeValue += ((seconds < 10) ? ":0" : ":") + seconds + if(! military) + timeValue += (hours >= 12) ? " P.M." : " A.M." + $('.clockface').html(timeValue) + timerID = setTimeout("showtime()",1000) + timerRunning = true +} + +$(document).ready(function() { + startclock(); +}); + +</script> +</div> +EOT; +return $o; + }
\ No newline at end of file diff --git a/include/zot.php b/include/zot.php index e80dabed9..cfabbae2e 100644 --- a/include/zot.php +++ b/include/zot.php @@ -351,7 +351,10 @@ function zot_refresh($them,$channel = null, $force = false) { intval(ABOOK_FLAG_SELF) ); - if($r) { + if($r) { + + $current_abook_connected = (($r[0]['abook_flags'] & ABOOK_FLAG_UNCONNECTED) ? 0 : 1); + $y = q("update abook set abook_their_perms = %d where abook_xchan = '%s' and abook_channel = %d and not (abook_flags & %d) limit 1", @@ -360,14 +363,16 @@ function zot_refresh($them,$channel = null, $force = false) { intval($channel['channel_id']), intval(ABOOK_FLAG_SELF) ); - if($connected_set === 0) { - // if they are in your address book but you aren't in theirs, mark their address book entry hidden. + if(($connected_set === 0 || $connected_set === 1) && ($connected_set !== $current_abook_unconnected)) { + + // if they are in your address book but you aren't in theirs, and/or this does not + // match your current connected state setting, toggle it. - $y1 = q("update abook set abook_flags = (abook_flags | %d) + $y1 = q("update abook set abook_flags = (abook_flags ^ %d) where abook_xchan = '%s' and abook_channel = %d and not (abook_flags & %d) limit 1", - intval(ABOOK_FLAG_HIDDEN), + intval(ABOOK_FLAG_UNCONNECTED), dbesc($x['hash']), intval($channel['channel_id']), intval(ABOOK_FLAG_SELF) 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, )); diff --git a/version.inc b/version.inc index 8750b1afe..77040f467 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2014-03-04.606 +2014-03-05.607 diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index ab2bd1b3d..47613c200 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1107,12 +1107,6 @@ footer { margin-bottom: 15px; } -#language-selector { - position: absolute; - top: 0px; - left: 16px; -} - #group-members { margin-top: 20px; padding: 10px; diff --git a/view/tpl/hdr.tpl b/view/tpl/hdr.tpl index b0d936742..f1e78b897 100644 --- a/view/tpl/hdr.tpl +++ b/view/tpl/hdr.tpl @@ -4,5 +4,4 @@ <li class="{5}"><a href="{0}" title="{2} {3}"><img src="{1}"><span class='contactname'>{2}</span>{3}<br><span class="notif-when">{4}</span></a></li> </ul> -{{if $langselector}}<div id="langselector" >{{$langselector}}</div>{{/if}} <div id="panel" style="display: none;"></div> diff --git a/view/tpl/lang_selector.tpl b/view/tpl/lang_selector.tpl index 159eeea7e..b512c759b 100755 --- a/view/tpl/lang_selector.tpl +++ b/view/tpl/lang_selector.tpl @@ -1,5 +1,6 @@ -<div id="lang-select-icon" title="{{$title}}" onclick="openClose('language-selector');" ><i class="icon-flag"></i></div> -<div id="language-selector" style="display: none;" > +<h1>{{$title}}</h1> +<br /> +<div id="language-selector" > <form action="#" method="post" > <select name="system_language" onchange="this.form.submit();" > {{foreach $langs.0 as $v=>$l}} diff --git a/view/tpl/pdledit.tpl b/view/tpl/pdledit.tpl new file mode 100644 index 000000000..ef8ff8dce --- /dev/null +++ b/view/tpl/pdledit.tpl @@ -0,0 +1,21 @@ +<h1>{{$header}}</h1> + +<h2>{{$mname}} {{$module}}</h2> + +<br /> +<a href="help/Comanche" target="redmatrix-help">{{$help}}</a> +<br /> +<br /> + + + +<form action="pdledit" method="post" > +<input type="hidden" name="module" value="{{$module}}" /> +<textarea rows="24" cols="80" name="content">{{$content}}</textarea> + +<br /> +<input type="submit" name="submit" value="{{$submit}}" /> + +</form> + + diff --git a/view/tpl/settings_display.tpl b/view/tpl/settings_display.tpl index a8fb002fb..924b4b33f 100755 --- a/view/tpl/settings_display.tpl +++ b/view/tpl/settings_display.tpl @@ -16,6 +16,10 @@ <input type="submit" name="submit" class="settings-submit" value="{{$submit}}" /> </div> +<br /> +<a href="pdledit">{{$layout_editor}}</a> +<br /> + {{if $theme_config}} <h2>Theme settings</h2> {{$theme_config}} |