mirror of https://github.com/BOINC/boinc.git
Added files missed in prior module update
This commit is contained in:
parent
a1133997c8
commit
63375b14ab
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Token integration for FileField Meta.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implementation of hook_token_list().
|
||||
*
|
||||
* Provide a user readable list of FileField Meta tokens.
|
||||
*/
|
||||
function filefield_meta_token_list($type = 'all') {
|
||||
if ($type == 'field' || $type == 'all') {
|
||||
$tokens['file']['filefield-width'] = t('File Video width');
|
||||
$tokens['file']['filefield-height'] = t('File Video height');
|
||||
$tokens['file']['filefield-duration'] = t('File Duration');
|
||||
$tokens['file']['filefield-audio-format'] = t('File Audio Format path');
|
||||
$tokens['file']['filefield-audio-sample-rate'] = t('File Audio sample rate');
|
||||
$tokens['file']['filefield-audio-channel-mode'] = t('File Audio channel mode (stereo, mono)');
|
||||
$tokens['file']['filefield-audio-bitrate'] = t('File Audio bitrate');
|
||||
$tokens['file']['filefield-audio-bitrate-mode'] = t('File Audio bitrate mode (cbr, vbr, abr...)');
|
||||
|
||||
// ID3 tags.
|
||||
foreach (filefield_meta_tags() as $tag => $label) {
|
||||
$tokens['file']['filefield-tag-' . $tag] = t('File ID3 @tag tag', array('@tag' => $label));
|
||||
}
|
||||
|
||||
return $tokens;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of hook_token_values().
|
||||
*
|
||||
* Provide the token values for a given file item.
|
||||
*/
|
||||
function filefield_meta_token_values($type, $object = NULL) {
|
||||
$tokens = array();
|
||||
if ($type == 'field' && isset($object[0]['fid'])) {
|
||||
$item = $object[0];
|
||||
|
||||
$tokens['filefield-width'] = $item['data']['width'] ;
|
||||
$tokens['filefield-height'] = $item['data']['height'] ;
|
||||
$tokens['filefield-duration'] = $item['data']['duration'] ;
|
||||
$tokens['filefield-audio-format'] = isset($item['data']['audio_format']) ? check_plain($item['data']['audio_format']) : '';
|
||||
$tokens['filefield-audio-sample-rate'] = isset($item['data']['sample_rate']) ? check_plain($item['data']['sample_rate']) : '';
|
||||
$tokens['filefield-audio-channel-mode'] = isset($item['data']['audio_channel_mode']) ? check_plain($item['data']['audio_channel_mode']) : '';
|
||||
$tokens['filefield-audio-bitrate'] = isset($item['data']['audio_bitrate']) ? check_plain($item['data']['audio_bitrate']) : '';
|
||||
$tokens['filefield-audio-bitrate-mode'] = isset($item['data']['audio_bitrate_mode']) ? check_plain($item['data']['audio_bitrate_mode']) : '';
|
||||
|
||||
// ID3 tags.
|
||||
foreach (filefield_meta_tags() as $tag => $label) {
|
||||
$tokens['filefield-tag-title'] = isset($item['data']['tags'][$tag]) ? check_plain($item['data']['tags'][$tag]) : '';
|
||||
}
|
||||
}
|
||||
|
||||
return $tokens;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* Returns a file icon based on its MIME type.
|
||||
*/
|
||||
|
||||
class filefield_handler_field_icon extends views_handler_field {
|
||||
function construct() {
|
||||
parent::construct();
|
||||
$this->additional_fields['fid'] = 'fid';
|
||||
$this->additional_fields['filename'] = 'filename';
|
||||
$this->additional_fields['filesize'] = 'filesize';
|
||||
}
|
||||
|
||||
function render($values) {
|
||||
$pseudo_file = array(
|
||||
'fid' => $values->{$this->aliases['fid']},
|
||||
'filemime' => $values->{$this->field_alias},
|
||||
'filename' => $values->{$this->aliases['filename']},
|
||||
'filesize' => $values->{$this->aliases['filesize']},
|
||||
);
|
||||
return theme('filefield_icon', $pseudo_file);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
Installation Instructions
|
||||
=====
|
||||
- Download the module and place in your /sites/all/modules or wherever you kids are installing your contrib modules these days.
|
||||
- Go to /admin/build/modules and enable Flag and Flag Friend in the "Flags" category/fieldset.
|
||||
- Go to /admin/build/flags and enable the 'friend' flag.
|
||||
- Some default values are entered for you in this flag's configuration. Feel free to modify what is available.
|
||||
- If you have Views installed, you should see a new tab when you go to your /user/N page titled 'Friends'. Underneath you will have two sub-tabs titled 'Flagged' and 'Pending'. Feel free to modify these views as you see fit, but I wouldn't mess too much with the arguments and/or relationships unless you really know what you are doing.
|
||||
-- Friends lists your current friend relationships.
|
||||
-- Flagged lists other users you have flagged and are awaiting a response from.
|
||||
-- Pending lists other users that have flagged you are are awaiting your response.
|
Loading…
Reference in New Issue