aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-05-31 19:26:00 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-05-31 19:26:00 -0700
commitf3b95f591a7ec49b6fc148913861bae2bb6aa6c7 (patch)
tree22f9f085950ac16766ed3af1f1d052d233c0660e /mod
parent8fe3daab21f9aba00f7def3553247b0cbcf5f94a (diff)
parent5cc5e0fafdbc1795781b52124a63695ce3e2d49f (diff)
downloadvolse-hubzilla-f3b95f591a7ec49b6fc148913861bae2bb6aa6c7.tar.gz
volse-hubzilla-f3b95f591a7ec49b6fc148913861bae2bb6aa6c7.tar.bz2
volse-hubzilla-f3b95f591a7ec49b6fc148913861bae2bb6aa6c7.zip
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Diffstat (limited to 'mod')
-rw-r--r--mod/directory.php2
-rw-r--r--mod/impel.php57
-rw-r--r--mod/menu.php6
-rw-r--r--mod/mitem.php8
-rw-r--r--mod/profile_photo.php2
5 files changed, 60 insertions, 15 deletions
diff --git a/mod/directory.php b/mod/directory.php
index 3e94d6395..7c7f63037 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -242,7 +242,7 @@ function directory_content(&$a) {
$hometown = ((x($profile,'hometown') == 1) ? t('Hometown: ') . $profile['hometown'] : False);
- $about = ((x($profile,'about') == 1) ? t('About: ') . bbcode($profile['about']) : False);
+ $about = ((x($profile,'about') == 1) ? t('About: ') . bbcode(strip_bbimage($profile['about'])) : False);
$keywords = ((x($profile,'keywords')) ? $profile['keywords'] : '');
diff --git a/mod/impel.php b/mod/impel.php
index 711547624..ff154125b 100644
--- a/mod/impel.php
+++ b/mod/impel.php
@@ -2,6 +2,7 @@
// import page design element
+require_once('include/menu.php');
function impel_init(&$a) {
@@ -21,7 +22,6 @@ function impel_init(&$a) {
if(! $j)
json_return_and_die($ret);
-
$channel = $a->get_channel();
$arr = array();
@@ -57,15 +57,58 @@ function impel_init(&$a) {
logger('mod_impel: unrecognised element type' . print_r($j,true));
break;
}
- if($is_menu) {
-
-
-
-
-
+ if($is_menu) {
+ $m = array();
+ $m['menu_channel_id'] = local_channel();
+ $m['menu_name'] = $j['pagetitle'];
+ $m['menu_desc'] = $j['desc'];
+ if($j['created'])
+ $m['menu_created'] = datetime_convert($j['created']);
+ if($j['edited'])
+ $m['menu_edited'] = datetime_convert($j['edited']);
+
+ $m['menu_flags'] = 0;
+ if($j['flags']) {
+ if(in_array('bookmark',$j['flags']))
+ $m['menu_flags'] |= MENU_BOOKMARK;
+ if(in_array('system',$j['flags']))
+ $m['menu_flags'] |= MENU_SYSTEM;
+ }
+ $menu_id = menu_create($m);
+
+ if($menu_id) {
+ if(is_array($j['items'])) {
+ foreach($j['items'] as $it) {
+ $mitem = array();
+
+ $mitem['mitem_link'] = str_replace('[baseurl]',z_root(),$it['link']);
+ $mitem['mitem_desc'] = escape_tags($it['desc']);
+ $mitem['mitem_order'] = intval($it['order']);
+ if(is_array($it['flags'])) {
+ $mitem['mitem_flags'] = 0;
+ if(in_array('zid',$it['flags']))
+ $mitem['mitem_flags'] |= MENU_ITEM_ZID;
+ if(in_array('new-window',$it['flags']))
+ $mitem['mitem_flags'] |= MENU_ITEM_NEWWIN;
+ if(in_array('chatroom',$it['flags']))
+ $mitem['mitem_flags'] |= MENU_ITEM_CHATROOM;
+ }
+ menu_add_item($menu_id,local_channel(),$mitem);
+ }
+ if($j['edited']) {
+ $x = q("update menu set menu_edited = '%s' where menu_id = %d and menu_channel_id = %d",
+ dbesc(datetime_convert('UTC','UTC',$j['edited'])),
+ intval($menu_id),
+ intval(local_channel())
+ );
+ }
+ }
+ $ret['success'] = true;
+ }
+ $x = $ret;
}
else {
$arr['uid'] = local_channel();
diff --git a/mod/menu.php b/mod/menu.php
index 63aeaa5e3..f46dc9471 100644
--- a/mod/menu.php
+++ b/mod/menu.php
@@ -102,6 +102,8 @@ function menu_content(&$a) {
'$desctitle' => t('Menu Title'),
'$edit' => t('Edit'),
'$drop' => t('Drop'),
+ '$created' => t('Created'),
+ '$edited' => t('Edited'),
'$new' => t('New'),
'$bmark' => t('Bookmarks allowed'),
'$hintnew' => t('Create'),
@@ -140,9 +142,9 @@ function menu_content(&$a) {
'$editcontents' => t('Edit menu contents'),
'$menu_name' => array('menu_name', t('Menu name'), $m['menu_name'], t('Must be unique, only seen by you'), '*'),
'$menu_desc' => array('menu_desc', t('Menu title'), $m['menu_desc'], t('Menu title as seen by others'), ''),
- '$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), (($m['menu_flags'] & MENU_BOOKMARK) ? 1 : 0), t('Menu may be used to store saved bookmarks'), ''),
+ '$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), (($m['menu_flags'] & MENU_BOOKMARK) ? 1 : 0), t('Menu may be used to store saved bookmarks'), array(t('No'), t('Yes'))),
'$menu_system' => (($m['menu_flags'] & MENU_SYSTEM) ? 1 : 0),
- '$submit' => t('Modify')
+ '$submit' => t('Submit and proceed')
));
return $o;
diff --git a/mod/mitem.php b/mod/mitem.php
index 0961e15ff..c4c293d1e 100644
--- a/mod/mitem.php
+++ b/mod/mitem.php
@@ -160,8 +160,8 @@ function mitem_content(&$a) {
'$aclselect' => populate_acl($perm_defaults,false),
'$mitem_desc' => array('mitem_desc', t('Link Name'), '', 'Visible name of the link','*'),
'$mitem_link' => array('mitem_link', t('Link or Submenu Target'), '', t('Enter URL of the link or select a menu name to create a submenu'), '*', 'list="menu-names"'),
- '$usezid' => array('usezid', t('Use magic-auth if available'), true, ''),
- '$newwin' => array('newwin', t('Open link in new window'), false,''),
+ '$usezid' => array('usezid', t('Use magic-auth if available'), true, '', array(t('No'), t('Yes'))),
+ '$newwin' => array('newwin', t('Open link in new window'), false,'', array(t('No'), t('Yes'))),
'$mitem_order' => array('mitem_order', t('Order in list'),'0',t('Higher numbers will sink to bottom of listing')),
'$submit' => t('Submit and finish'),
'$submit_more' => t('Submit and continue'),
@@ -231,8 +231,8 @@ function mitem_content(&$a) {
'$mitem_id' => intval(argv(2)),
'$mitem_desc' => array('mitem_desc', t('Link text'), $mitem['mitem_desc'], '','*'),
'$mitem_link' => array('mitem_link', t('Link or Submenu Target'), $mitem['mitem_link'], 'Enter URL of the link or select a menu name to create a submenu', '*', 'list="menu-names"'),
- '$usezid' => array('usezid', t('Use magic-auth if available'), (($mitem['mitem_flags'] & MENU_ITEM_ZID) ? 1 : 0), ''),
- '$newwin' => array('newwin', t('Open link in new window'), (($mitem['mitem_flags'] & MENU_ITEM_NEWWIN) ? 1 : 0),''),
+ '$usezid' => array('usezid', t('Use magic-auth if available'), (($mitem['mitem_flags'] & MENU_ITEM_ZID) ? 1 : 0), '', array(t('No'), t('Yes'))),
+ '$newwin' => array('newwin', t('Open link in new window'), (($mitem['mitem_flags'] & MENU_ITEM_NEWWIN) ? 1 : 0),'', array(t('No'), t('Yes'))),
'$mitem_order' => array('mitem_order', t('Order in list'),$mitem['mitem_order'],t('Higher numbers will sink to bottom of listing')),
'$submit' => t('Submit'),
'$lockstate' => $lockstate,
diff --git a/mod/profile_photo.php b/mod/profile_photo.php
index 9fe042500..79f84c690 100644
--- a/mod/profile_photo.php
+++ b/mod/profile_photo.php
@@ -329,7 +329,7 @@ function profile_photo_content(&$a) {
return;
}
- $ph = photo_factory($r[0]['data'], $r[0]['type']);
+ $ph = photo_factory(dbunescbin($r[0]['data']), $r[0]['type']);
// go ahead as if we have just uploaded a new photo to crop
profile_photo_crop_ui_head($a, $ph);
}