From 1e68d4fb75b9831ed763328b7982e44d1d4cdc5b Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 13 Jun 2016 19:58:24 -0700 Subject: deprecate the item_id table - replace with iconfig. A possibly useful function in the iconfig class would be a search which takes a service id and type and uid, matches against an item and returns the iid. That could save a bit of code duplication. --- Zotlabs/Module/Layouts.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'Zotlabs/Module/Layouts.php') diff --git a/Zotlabs/Module/Layouts.php b/Zotlabs/Module/Layouts.php index 9b9fc22f3..a0b1c31cc 100644 --- a/Zotlabs/Module/Layouts.php +++ b/Zotlabs/Module/Layouts.php @@ -90,13 +90,14 @@ class Layouts extends \Zotlabs\Web\Controller { return; } - //This feature is not exposed in redbasic ui since it is not clear why one would want to - //download a json encoded pdl file - we dont have a possibility to import it. - //Use the buildin share/install feature instead. + // This feature is not exposed in redbasic ui since it is not clear why one would want to + // download a json encoded pdl file - we dont have a possibility to import it. + // Use the buildin share/install feature instead. + if((argc() > 3) && (argv(2) === 'share') && (argv(3))) { - $r = q("select sid, service, mimetype, title, body from item_id - left join item on item.id = item_id.iid - where item_id.uid = %d and item.mid = '%s' and service = 'PDL' order by sid asc", + $r = q("select iconfig.v, iconfig.k, mimetype, title, body from iconfig + left join item on item.id = iconfig.iid + where uid = %d and mid = '%s' and iconfig.cat = 'system' and iconfig.k = 'PDL' order by iconfig.v asc", intval($owner), dbesc(argv(3)) ); @@ -141,8 +142,9 @@ class Layouts extends \Zotlabs\Web\Controller { $editor = status_editor($a,$x); - $r = q("select iid, sid, mid, title, body, mimetype, created, edited, item_type from item_id left join item on item_id.iid = item.id - where item_id.uid = %d and service = 'PDL' and item_type = %d order by item.created desc", + $r = q("select iconfig.iid, iconfig.v, mid, title, body, mimetype, created, edited, item_type from iconfig + left join item on iconfig.iid = item.id + where uid = %d and iconfig.cat = 'system' and iconfig.k = 'PDL' and item_type = %d order by item.created desc", intval($owner), intval(ITEM_TYPE_PDL) ); @@ -164,7 +166,7 @@ class Layouts extends \Zotlabs\Web\Controller { ); $pages[$rr['iid']][] = array( 'url' => $rr['iid'], - 'title' => $rr['sid'], + 'title' => $rr['v'], 'descr' => $rr['title'], 'mid' => $rr['mid'], 'created' => $rr['created'], -- cgit v1.2.3