Merge https://github.com/redmatrix/redmatrix into pending_merge
This commit is contained in:
commit
821bbd41e1
@ -1258,15 +1258,19 @@ function format_categories(&$item,$writeable) {
|
|||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add any hashtags which weren't mentioned in the message body, e.g. community tags
|
/**
|
||||||
|
* @brief Add any hashtags which weren't mentioned in the message body, e.g. community tags
|
||||||
|
*
|
||||||
|
* @param[in] array &$item
|
||||||
|
* @return string HTML link of hashtag
|
||||||
|
*/
|
||||||
function format_hashtags(&$item) {
|
function format_hashtags(&$item) {
|
||||||
|
|
||||||
$s = '';
|
$s = '';
|
||||||
$terms = get_terms_oftype($item['term'],TERM_HASHTAG);
|
|
||||||
|
$terms = get_terms_oftype($item['term'], TERM_HASHTAG);
|
||||||
if($terms) {
|
if($terms) {
|
||||||
foreach($terms as $t) {
|
foreach($terms as $t) {
|
||||||
$term = htmlspecialchars($t['term'],ENT_COMPAT,'UTF-8',false) ;
|
$term = htmlspecialchars($t['term'], ENT_COMPAT, 'UTF-8', false) ;
|
||||||
if(! trim($term))
|
if(! trim($term))
|
||||||
continue;
|
continue;
|
||||||
if(strpos($item['body'], $t['url']))
|
if(strpos($item['body'], $t['url']))
|
||||||
@ -1278,6 +1282,7 @@ function format_hashtags(&$item) {
|
|||||||
$s .= '#<a href="' . zid($t['url']) . '" >' . $term . '</a>';
|
$s .= '#<a href="' . zid($t['url']) . '" >' . $term . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1301,6 +1306,7 @@ function format_mentions(&$item) {
|
|||||||
$s .= '@<a href="' . zid($t['url']) . '" >' . $term . '</a>';
|
$s .= '@<a href="' . zid($t['url']) . '" >' . $term . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2065,7 +2071,11 @@ function json_decode_plus($s) {
|
|||||||
return $x;
|
return $x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Creates navigation menu for webpage, layout, blocks, menu sites.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function design_tools() {
|
function design_tools() {
|
||||||
|
|
||||||
$channel = get_app()->get_channel();
|
$channel = get_app()->get_channel();
|
||||||
|
@ -98,7 +98,6 @@ function layouts_content(&$a) {
|
|||||||
header('Content-disposition: attachment; filename="' . $r[0]['sid'] . '.pdl"');
|
header('Content-disposition: attachment; filename="' . $r[0]['sid'] . '.pdl"');
|
||||||
echo json_encode($r);
|
echo json_encode($r);
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,5 +173,4 @@ function layouts_content(&$a) {
|
|||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
23
mod/menu.php
23
mod/menu.php
@ -3,11 +3,20 @@
|
|||||||
require_once('include/menu.php');
|
require_once('include/menu.php');
|
||||||
require_once('include/identity.php');
|
require_once('include/identity.php');
|
||||||
|
|
||||||
|
function menu_init(&$a) {
|
||||||
|
if (array_key_exists('sys', $_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
|
||||||
|
$sys = get_sys_channel();
|
||||||
|
if ($sys && intval($sys['channel_id'])) {
|
||||||
|
$a->is_sys = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function menu_post(&$a) {
|
function menu_post(&$a) {
|
||||||
|
|
||||||
$uid = local_channel();
|
$uid = local_channel();
|
||||||
|
|
||||||
if(array_key_exists('sys',$_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
|
if(array_key_exists('sys', $_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
|
||||||
$sys = get_sys_channel();
|
$sys = get_sys_channel();
|
||||||
$uid = intval($sys['channel_id']);
|
$uid = intval($sys['channel_id']);
|
||||||
$a->is_sys = true;
|
$a->is_sys = true;
|
||||||
@ -44,7 +53,6 @@ function menu_post(&$a) {
|
|||||||
notice( t('Unable to create menu.'). EOL);
|
notice( t('Unable to create menu.'). EOL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -52,7 +60,7 @@ function menu_content(&$a) {
|
|||||||
|
|
||||||
$uid = local_channel();
|
$uid = local_channel();
|
||||||
|
|
||||||
if($a->is_sys && is_site_admin()) {
|
if ($a->is_sys && is_site_admin()) {
|
||||||
$sys = get_sys_channel();
|
$sys = get_sys_channel();
|
||||||
$uid = intval($sys['channel_id']);
|
$uid = intval($sys['channel_id']);
|
||||||
}
|
}
|
||||||
@ -82,7 +90,8 @@ function menu_content(&$a) {
|
|||||||
'$hintnew' => t('Create a new menu'),
|
'$hintnew' => t('Create a new menu'),
|
||||||
'$hintdrop' => t('Delete this menu'),
|
'$hintdrop' => t('Delete this menu'),
|
||||||
'$hintcontent' => t('Edit menu contents'),
|
'$hintcontent' => t('Edit menu contents'),
|
||||||
'$hintedit' => t('Edit this menu')
|
'$hintedit' => t('Edit this menu'),
|
||||||
|
'$sys' => $a->is_sys
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
@ -97,12 +106,14 @@ function menu_content(&$a) {
|
|||||||
'$menu_name' => array('menu_name', t('Menu name'), '', t('Must be unique, only seen by you'), '*'),
|
'$menu_name' => array('menu_name', t('Menu name'), '', t('Must be unique, only seen by you'), '*'),
|
||||||
'$menu_desc' => array('menu_desc', t('Menu title'), '', t('Menu title as seen by others'), ''),
|
'$menu_desc' => array('menu_desc', t('Menu title'), '', t('Menu title as seen by others'), ''),
|
||||||
'$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), 0 , t('Menu may be used to store saved bookmarks'), ''),
|
'$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), 0 , t('Menu may be used to store saved bookmarks'), ''),
|
||||||
'$submit' => t('Create')
|
'$submit' => t('Create'),
|
||||||
|
'$sys' => $a->is_sys
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif(intval(argv(1))) {
|
elseif(intval(argv(1))) {
|
||||||
$m = menu_fetch_id(intval(argv(1)),$uid);
|
$m = menu_fetch_id(intval(argv(1)),$uid);
|
||||||
if(! $m) {
|
if(! $m) {
|
||||||
notice( t('Menu not found.') . EOL);
|
notice( t('Menu not found.') . EOL);
|
||||||
|
@ -129,7 +129,7 @@ function webpages_content(&$a) {
|
|||||||
|
|
||||||
// Get a list of webpages. We can't display all them because endless scroll makes that unusable,
|
// Get a list of webpages. We can't display all them because endless scroll makes that unusable,
|
||||||
// so just list titles and an edit link.
|
// so just list titles and an edit link.
|
||||||
//TODO - this should be replaced with pagelist_widget
|
/** @TODO - this should be replaced with pagelist_widget */
|
||||||
|
|
||||||
$r = q("select * from item_id left join item on item_id.iid = item.id
|
$r = q("select * from item_id left join item on item_id.iid = item.id
|
||||||
where item_id.uid = %d and service = 'WEBPAGE' order by item.created desc",
|
where item_id.uid = %d and service = 'WEBPAGE' order by item.created desc",
|
||||||
@ -157,7 +157,7 @@ function webpages_content(&$a) {
|
|||||||
$url = z_root() . '/editwebpage/' . $which;
|
$url = z_root() . '/editwebpage/' . $which;
|
||||||
|
|
||||||
$o .= replace_macros(get_markup_template('webpagelist.tpl'), array(
|
$o .= replace_macros(get_markup_template('webpagelist.tpl'), array(
|
||||||
'$listtitle' => t('Webpages'),
|
'$listtitle' => t('Webpages'),
|
||||||
'$baseurl' => $url,
|
'$baseurl' => $url,
|
||||||
'$edit' => t('Edit'),
|
'$edit' => t('Edit'),
|
||||||
'$pages' => $pages,
|
'$pages' => $pages,
|
||||||
@ -169,9 +169,7 @@ function webpages_content(&$a) {
|
|||||||
'$title_txt' => t('Title'),
|
'$title_txt' => t('Title'),
|
||||||
'$created_txt' => t('Created'),
|
'$created_txt' => t('Created'),
|
||||||
'$edited_txt' => t('Edited')
|
'$edited_txt' => t('Edited')
|
||||||
|
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<a href="mitem/{{$menu_id}}" title="{{$hintedit}}">{{$editcontents}}</a>
|
<a href="mitem/{{$menu_id}}" title="{{$hintedit}}">{{$editcontents}}</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<form id="menuedit" action="menu{{if $menu_id}}/{{$menu_id}}{{/if}}" method="post" >
|
<form id="menuedit" action="menu{{if $menu_id}}/{{$menu_id}}{{/if}}{{if $sys}}?f=&sys=1{{/if}}" method="post" >
|
||||||
|
|
||||||
{{if $menu_id}}
|
{{if $menu_id}}
|
||||||
<input type="hidden" name="menu_id" value="{{$menu_id}}" />
|
<input type="hidden" name="menu_id" value="{{$menu_id}}" />
|
||||||
@ -14,7 +14,6 @@
|
|||||||
<input type="hidden" name="menu_system" value="{{$menu_system}}" />
|
<input type="hidden" name="menu_system" value="{{$menu_system}}" />
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
{{include file="field_input.tpl" field=$menu_name}}
|
{{include file="field_input.tpl" field=$menu_name}}
|
||||||
{{include file="field_input.tpl" field=$menu_desc}}
|
{{include file="field_input.tpl" field=$menu_desc}}
|
||||||
{{include file="field_checkbox.tpl" field=$menu_bookmark}}
|
{{include file="field_checkbox.tpl" field=$menu_bookmark}}
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
<div class="generic-content-wrapper-styled">
|
<div class="generic-content-wrapper-styled">
|
||||||
|
|
||||||
<h1>{{$title}}</h1>
|
<h1>{{$title}}</h1>
|
||||||
|
<a href="menu/new{{if $sys}}?f=&sys=1{{/if}}" title="{{$hintnew}}">{{$hintnew}}</a>
|
||||||
<a href="menu/new" title="{{$hintnew}}">{{$hintnew}}</a>
|
<br>
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
{{if $menus }}
|
{{if $menus }}
|
||||||
<ul id="menulist">
|
<ul id="menulist">
|
||||||
{{foreach $menus as $m }}
|
{{foreach $menus as $m }}
|
||||||
<li><a href="menu/{{$m.menu_id}}" title="{{$hintedit}}"><i class="icon-pencil design-icons design-edit-icon btn btn-default"></i></a> <a href="menu/{{$m.menu_id}}/drop" title="{{$hintdrop}}"><i class="icon-trash drop-icons design-icons design-remove-icon btn btn-default"></i></a> {{if $m.bookmark}}<i class="icon-bookmark" title="{{$bmark}}" ></i> {{/if}}<a href="mitem/{{$m.menu_id}}/new" title="{{$hintcontent}}">{{$m.menu_name}}</a></li>
|
<li>
|
||||||
|
<a href="menu/{{$m.menu_id}}{{if $sys}}?f=&sys=1{{/if}}" title="{{$hintedit}}"><i class="icon-pencil design-icons design-edit-icon btn btn-default"></i></a>
|
||||||
|
<a href="menu/{{$m.menu_id}}/drop{{if $sys}}?f=&sys=1{{/if}}" title="{{$hintdrop}}"><i class="icon-trash drop-icons design-icons design-remove-icon btn btn-default"></i></a> {{if $m.bookmark}}<i class="icon-bookmark" title="{{$bmark}}" ></i> {{/if}}<a href="mitem/{{$m.menu_id}}/new{{if $sys}}?f=&sys=1{{/if}}" title="{{$hintcontent}}">{{$m.menu_name}}</a>
|
||||||
|
</li>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
</ul>
|
</ul>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
</div>
|
</div>
|
Reference in New Issue
Block a user