From 7b41839ea8f2aad020444c42f2cba89040ca28b8 Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Sun, 2 Oct 2016 00:41:25 +0200 Subject: [TASK] Update Doxyfile and fix Doxygen errors. Updated Doxyfile to include new folders. Add a list for @hooks tags. Fixed some parsing problems for Doxygen. --- Zotlabs/Module/Thing.php | 158 +++++++++++++++++++++++------------------------ 1 file changed, 79 insertions(+), 79 deletions(-) (limited to 'Zotlabs/Module/Thing.php') diff --git a/Zotlabs/Module/Thing.php b/Zotlabs/Module/Thing.php index a7ac63f73..95c6c5636 100644 --- a/Zotlabs/Module/Thing.php +++ b/Zotlabs/Module/Thing.php @@ -1,10 +1,10 @@ set_from_array($_REQUEST); } - + $x = $acl->get(); - + if($term_hash) { $t = q("select * from obj where obj_obj = '%s' and obj_channel = %d limit 1", dbesc($term_hash), @@ -97,7 +97,7 @@ class Thing extends \Zotlabs\Web\Controller { } else $local_photo = $orig_record['obj_imgurl']; - + $r = q("update obj set obj_term = '%s', obj_url = '%s', obj_imgurl = '%s', obj_edited = '%s', allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s' where obj_obj = '%s' and obj_channel = %d ", dbesc($name), dbesc(($url) ? $url : z_root() . '/thing/' . $term_hash), @@ -110,9 +110,9 @@ class Thing extends \Zotlabs\Web\Controller { dbesc($term_hash), intval(local_channel()) ); - + info( t('Thing updated') . EOL); - + $r = q("select * from obj where obj_channel = %d and obj_obj = '%s' limit 1", intval(local_channel()), dbesc($term_hash) @@ -120,31 +120,31 @@ class Thing extends \Zotlabs\Web\Controller { if($r) { build_sync_packet(0, array('obj' => $r)); } - + return; } - + $sql = (($profile_guid) ? " and profile_guid = '" . dbesc($profile_guid) . "' " : " and is_default = 1 "); $p = q("select profile_guid, is_default from profile where uid = %d $sql limit 1", intval(local_channel()) ); - + if($p) $profile = $p[0]; else return; - + $local_photo = null; - + if($photo) { $arr = import_xchan_photo($photo,get_observer_hash(),true); $local_photo = $arr[0]; $local_photo_type = $arr[3]; } - + $created = datetime_convert(); $url = (($url) ? $url : z_root() . '/thing/' . $hash); - + $r = q("insert into obj ( obj_page, obj_verb, obj_type, obj_channel, obj_obj, obj_term, obj_url, obj_imgurl, obj_created, obj_edited, allow_cid, allow_gid, deny_cid, deny_gid ) values ('%s','%s', %d, %d, '%s','%s','%s','%s','%s','%s','%s','%s','%s','%s') ", dbesc($profile['profile_guid']), dbesc($verb), @@ -161,14 +161,14 @@ class Thing extends \Zotlabs\Web\Controller { dbesc($x['deny_cid']), dbesc($x['deny_gid']) ); - + if(! $r) { notice( t('Object store: failed')); return; } - + info( t('Thing added')); - + $r = q("select * from obj where obj_channel = %d and obj_obj = '%s' limit 1", intval(local_channel()), dbesc($hash) @@ -176,15 +176,15 @@ class Thing extends \Zotlabs\Web\Controller { if($r) { build_sync_packet(0, array('obj' => $r)); } - + if($activity) { $arr = array(); $links = array(array('rel' => 'alternate','type' => 'text/html', 'href' => $url)); if($local_photo) $links[] = array('rel' => 'photo', 'type' => $local_photo_type, 'href' => $local_photo); - + $objtype = ACTIVITY_OBJ_THING; - + $obj = json_encode(array( 'type' => $objtype, 'id' => $url, @@ -192,28 +192,28 @@ class Thing extends \Zotlabs\Web\Controller { 'title' => $name, 'content' => $name )); - + $bodyverb = str_replace('OBJ: ', '',t('OBJ: %1$s %2$s %3$s')); - + $arr['owner_xchan'] = $channel['channel_hash']; $arr['author_xchan'] = $channel['channel_hash']; - + $arr['item_origin'] = 1; $arr['item_wall'] = 1; $arr['item_thread_top'] = 1; - + $ulink = '[zrl=' . $channel['xchan_url'] . ']' . $channel['channel_name'] . '[/zrl]'; $plink = '[zrl=' . $url . ']' . $name . '[/zrl]'; - + $arr['body'] = sprintf( $bodyverb, $ulink, $translated_verb, $plink ); - + if($local_photo) $arr['body'] .= "\n\n[zmg]" . $local_photo . "[/zmg]"; - + $arr['verb'] = $verb; $arr['obj_type'] = $objtype; $arr['obj'] = $obj; - + if(! $profile['is_default']) { $arr['item_private'] = true; $str = ''; @@ -229,37 +229,37 @@ class Thing extends \Zotlabs\Web\Controller { else $arr['allow_cid'] = '<' . get_observer_hash() . '>'; } - + $ret = post_activity_item($arr); } } - - + + function get() { - + // @FIXME one problem with things is we can't share them unless we provide the channel in the url - // so we can definitively lookup the owner. - + // so we can definitively lookup the owner. + if(argc() == 2) { - + $r = q("select obj_channel from obj where obj_type = %d and obj_obj = '%s' limit 1", intval(TERM_OBJ_THING), dbesc(argv(1)) ); - if($r) + if($r) $sql_extra = permissions_sql($r[0]['obj_channel']); - + $r = q("select * from obj where obj_type = %d and obj_obj = '%s' $sql_extra limit 1", intval(TERM_OBJ_THING), dbesc(argv(1)) ); - + if($r) { return replace_macros(get_markup_template('show_thing.tpl'), array( '$header' => t('Show Thing'), '$edit' => t('Edit'), '$delete' => t('Delete'), - '$canedit' => ((local_channel() && local_channel() == $r[0]['obj_channel']) ? true : false), + '$canedit' => ((local_channel() && local_channel() == $r[0]['obj_channel']) ? true : false), '$thing' => $r[0] )); } else { @@ -267,34 +267,34 @@ class Thing extends \Zotlabs\Web\Controller { return; } } - + $channel = \App::get_channel(); - + if(! (local_channel() && $channel)) { notice( t('Permission denied.') . EOL); return; } - + $acl = new \Zotlabs\Access\AccessList($channel); $channel_acl = $acl->get(); - + $lockstate = (($acl->is_private()) ? 'lock' : 'unlock'); - + $thing_hash = ''; - + if(argc() == 3 && argv(1) === 'edit') { $thing_hash = argv(2); - + $r = q("select * from obj where obj_type = %d and obj_obj = '%s' limit 1", intval(TERM_OBJ_THING), dbesc($thing_hash) ); - + if((! $r) || ($r[0]['obj_channel'] != local_channel())) { notice( t('Permission denied.') . EOL); return ''; } - + $o .= replace_macros(get_markup_template('thing_edit.tpl'),array( '$thing_hdr' => t('Edit Thing'), '$multiprof' => feature_enabled(local_channel(),'multi_profiles'), @@ -319,36 +319,36 @@ class Thing extends \Zotlabs\Web\Controller { '$lockstate' => $lockstate, '$submit' => t('Submit') )); - + return $o; } - + if(argc() == 3 && argv(1) === 'drop') { $thing_hash = argv(2); - + $r = q("select * from obj where obj_type = %d and obj_obj = '%s' limit 1", intval(TERM_OBJ_THING), dbesc($thing_hash) ); - + if((! $r) || ($r[0]['obj_channel'] != local_channel())) { notice( t('Permission denied.') . EOL); return ''; } - + $x = q("delete from obj where obj_obj = '%s' and obj_type = %d and obj_channel = %d", dbesc($thing_hash), intval(TERM_OBJ_THING), intval(local_channel()) ); - + $r[0]['obj_deleted'] = 1; - + build_sync_packet(0,array('obj' => $r)); - + return $o; } - + $o .= replace_macros(get_markup_template('thing_input.tpl'),array( '$thing_hdr' => t('Add Thing to your Profile'), '$multiprof' => feature_enabled(local_channel(),'multi_profiles'), @@ -369,8 +369,8 @@ class Thing extends \Zotlabs\Web\Controller { '$lockstate' => $lockstate, '$submit' => t('Submit') )); - + return $o; } - + } -- cgit v1.2.3