first cut at rating widget. The flaw is that it is limited because it requires local_channel() (formerly local_user()). We need to extend this to take you home like rpost does if you're logged in as remote_channel() - and/or we need zot to send the rating message to the source channel and target in addition to the directories.

This commit is contained in:
friendica
2015-02-04 15:48:39 -08:00
parent 1ceb0a7fba
commit 3988948516
8 changed files with 82 additions and 25 deletions
+27
View File
@@ -903,3 +903,30 @@ function widget_random_block($arr) {
return $o;
}
function widget_rating($arr) {
$a = get_app();
if(! local_channel())
return;
$channel = $a->get_channel();
if($arr['target'])
$hash = $arr['target'];
else
$hash = $a->poi['xchan_hash'];
if(! $hash)
return;
if($hash == $channel['channel_hash'])
return;
head_add_js('ratings.js');
$o = '<div class="widget rateme">';
$o .= '<div class="rateme fakelink" onclick="doRatings(\'' . $hash . '\'); return false;"><i class="icon-pencil"></i> ' . t('Rate Me') . '</div></div>';
return $o;
}