first import
This commit is contained in:
339
sites/all/modules/debut_media/LICENSE.txt
Normal file
339
sites/all/modules/debut_media/LICENSE.txt
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
40
sites/all/modules/debut_media/debut_media.context.inc
Normal file
40
sites/all/modules/debut_media/debut_media.context.inc
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* @file
|
||||
* debut_media.context.inc
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implementation of hook_context_default_contexts().
|
||||
*/
|
||||
function debut_media_context_default_contexts() {
|
||||
$export = array();
|
||||
|
||||
$context = new stdClass;
|
||||
$context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
|
||||
$context->api_version = 3;
|
||||
$context->name = 'media';
|
||||
$context->description = 'Display sidebar block and set breadcrumb.';
|
||||
$context->tag = '';
|
||||
$context->conditions = array(
|
||||
'path' => array(
|
||||
'values' => array(
|
||||
'media/*' => 'file/*',
|
||||
'~media/images' => '~file/images',
|
||||
'~media/video' => '~file/video',
|
||||
),
|
||||
),
|
||||
);
|
||||
$context->reactions = array(
|
||||
'breadcrumb' => 'file',
|
||||
'menu' => 'file',
|
||||
);
|
||||
$context->condition_mode = 0;
|
||||
|
||||
// Translatables
|
||||
// Included for use with string extractors like potx.
|
||||
t('Display sidebar block and set breadcrumb.');
|
||||
$export['media'] = $context;
|
||||
|
||||
return $export;
|
||||
}
|
34
sites/all/modules/debut_media/debut_media.css
Normal file
34
sites/all/modules/debut_media/debut_media.css
Normal file
@@ -0,0 +1,34 @@
|
||||
.jcarousel-skin-default .jcarousel-container-horizontal {
|
||||
width: 550px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.jcarousel-skin-default .jcarousel-clip-horizontal {
|
||||
width: 550px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.jcarousel-skin-default .jcarousel-item-horizontal {
|
||||
height: 180px;
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
.jcarousel-skin-default .jcarousel-next-horizontal {
|
||||
top: 90px;
|
||||
}
|
||||
|
||||
.jcarousel-skin-default .jcarousel-prev-horizontal {
|
||||
top: 90px;
|
||||
}
|
||||
|
||||
/* Float imagefield images left and add margin */
|
||||
.fusion-float-imagefield-left .views-field-field-content-image img {
|
||||
float: left; /* LTR */
|
||||
margin: 0 15px 15px 0; /* LTR */
|
||||
}
|
||||
|
||||
/* Float imagefield images right and add margin */
|
||||
.fusion-float-imagefield-right .views-field-field-content-image img {
|
||||
float: right; /* LTR */
|
||||
margin: 0 0 15px 15px; /* LTR */
|
||||
}
|
2076
sites/all/modules/debut_media/debut_media.features.field.inc
Normal file
2076
sites/all/modules/debut_media/debut_media.features.field.inc
Normal file
File diff suppressed because it is too large
Load Diff
76
sites/all/modules/debut_media/debut_media.features.inc
Normal file
76
sites/all/modules/debut_media/debut_media.features.inc
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* @file
|
||||
* debut_media.features.inc
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implementation of hook_ctools_plugin_api().
|
||||
*/
|
||||
function debut_media_ctools_plugin_api() {
|
||||
list($module, $api) = func_get_args();
|
||||
if ($module == "context" && $api == "context") {
|
||||
return array("version" => "3");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of hook_views_api().
|
||||
*/
|
||||
function debut_media_views_api() {
|
||||
return array(
|
||||
'api' => 3,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of hook_image_default_styles().
|
||||
*/
|
||||
function debut_media_image_default_styles() {
|
||||
$styles = array();
|
||||
|
||||
// Exported image style: medium_large
|
||||
$styles['medium_large'] = array(
|
||||
'name' => 'medium_large',
|
||||
'effects' => array(
|
||||
2 => array(
|
||||
'label' => 'Scale',
|
||||
'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.',
|
||||
'effect callback' => 'image_scale_effect',
|
||||
'form callback' => 'image_scale_form',
|
||||
'summary theme' => 'image_scale_summary',
|
||||
'module' => 'image',
|
||||
'name' => 'image_scale',
|
||||
'data' => array(
|
||||
'width' => '360',
|
||||
'height' => '',
|
||||
'upscale' => 0,
|
||||
),
|
||||
'weight' => '1',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// Exported image style: small_square_thumbnail
|
||||
$styles['small_square_thumbnail'] = array(
|
||||
'name' => 'small_square_thumbnail',
|
||||
'effects' => array(
|
||||
3 => array(
|
||||
'label' => 'Scale and crop',
|
||||
'help' => 'Scale and crop will maintain the aspect-ratio of the original image, then crop the larger dimension. This is most useful for creating perfectly square thumbnails without stretching the image.',
|
||||
'effect callback' => 'image_scale_and_crop_effect',
|
||||
'form callback' => 'image_resize_form',
|
||||
'summary theme' => 'image_resize_summary',
|
||||
'module' => 'image',
|
||||
'name' => 'image_scale_and_crop',
|
||||
'data' => array(
|
||||
'width' => '100',
|
||||
'height' => '100',
|
||||
),
|
||||
'weight' => '1',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return $styles;
|
||||
}
|
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Implementation of hook_menu_default_menu_links().
|
||||
*/
|
||||
function debut_media_menu_default_menu_links() {
|
||||
$menu_links = array();
|
||||
|
||||
if (module_exists('debut')) {
|
||||
// Exported menu link: main-menu:file
|
||||
$menu_links['main-menu:file'] = array(
|
||||
'menu_name' => 'main-menu',
|
||||
'link_path' => 'file',
|
||||
'router_path' => 'file',
|
||||
'link_title' => 'Multimedia',
|
||||
'options' => array(
|
||||
'attributes' => array(
|
||||
'title' => 'View media files.',
|
||||
),
|
||||
),
|
||||
'module' => 'menu',
|
||||
'hidden' => '0',
|
||||
'external' => '0',
|
||||
'has_children' => '1',
|
||||
'expanded' => '0',
|
||||
'weight' => '15',
|
||||
);
|
||||
// Exported menu link: main-menu:file/images
|
||||
$menu_links['main-menu:file/image'] = array(
|
||||
'menu_name' => 'main-menu',
|
||||
'link_path' => 'file/image',
|
||||
'router_path' => 'file/image',
|
||||
'link_title' => 'Images',
|
||||
'options' => array(
|
||||
'attributes' => array(
|
||||
'title' => 'View images.',
|
||||
),
|
||||
),
|
||||
'module' => 'menu',
|
||||
'hidden' => '0',
|
||||
'external' => '0',
|
||||
'has_children' => '0',
|
||||
'expanded' => '0',
|
||||
'weight' => '0',
|
||||
'parent_path' => 'file',
|
||||
);
|
||||
// Exported menu link: main-menu:file/video
|
||||
$menu_links['main-menu:file/video'] = array(
|
||||
'menu_name' => 'main-menu',
|
||||
'link_path' => 'file/video',
|
||||
'router_path' => 'file/video',
|
||||
'link_title' => 'Video',
|
||||
'options' => array(
|
||||
'attributes' => array(
|
||||
'title' => 'View all videos.',
|
||||
),
|
||||
),
|
||||
'module' => 'menu',
|
||||
'hidden' => '0',
|
||||
'external' => '0',
|
||||
'has_children' => '0',
|
||||
'expanded' => '0',
|
||||
'weight' => '0',
|
||||
'parent_path' => 'file',
|
||||
);
|
||||
// Translatables
|
||||
// Included for use with string extractors like potx.
|
||||
t('Images');
|
||||
t('Media');
|
||||
t('Video');
|
||||
}
|
||||
|
||||
return $menu_links;
|
||||
}
|
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* @file
|
||||
* debut_media.features.user_permission.inc
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_user_default_permissions().
|
||||
*/
|
||||
function debut_media_user_default_permissions() {
|
||||
$permissions = array();
|
||||
|
||||
// Exported permission: add media from remote sources
|
||||
$permissions['add media from remote sources'] = array(
|
||||
'name' => 'add media from remote sources',
|
||||
'roles' => array(
|
||||
0 => 'administrator',
|
||||
1 => 'contributor',
|
||||
2 => 'editor',
|
||||
),
|
||||
'module' => 'media_internet',
|
||||
);
|
||||
|
||||
// Exported permission: administer files
|
||||
$permissions['administer files'] = array(
|
||||
'name' => 'administer files',
|
||||
'roles' => array(
|
||||
0 => 'administrator',
|
||||
1 => 'editor',
|
||||
),
|
||||
'module' => 'file_entity',
|
||||
);
|
||||
|
||||
// Exported permission: edit file
|
||||
$permissions['edit file'] = array(
|
||||
'name' => 'edit file',
|
||||
'roles' => array(
|
||||
0 => 'administrator',
|
||||
1 => 'contributor',
|
||||
2 => 'editor',
|
||||
),
|
||||
'module' => 'file_entity',
|
||||
);
|
||||
|
||||
// Exported permission: import media
|
||||
$permissions['import media'] = array(
|
||||
'name' => 'import media',
|
||||
'roles' => array(
|
||||
0 => 'administrator',
|
||||
1 => 'contributor',
|
||||
2 => 'editor',
|
||||
),
|
||||
'module' => 'media',
|
||||
);
|
||||
|
||||
// Exported permission: view file
|
||||
$permissions['view file'] = array(
|
||||
'name' => 'view file',
|
||||
'roles' => array(
|
||||
0 => 'administrator',
|
||||
1 => 'anonymous user',
|
||||
2 => 'authenticated user',
|
||||
3 => 'contributor',
|
||||
4 => 'editor',
|
||||
),
|
||||
'module' => 'file_entity',
|
||||
);
|
||||
|
||||
// Exported permission: view own unpublished media
|
||||
$permissions['view own unpublished media'] = array(
|
||||
'name' => 'view own unpublished media',
|
||||
'roles' => array(
|
||||
0 => 'administrator',
|
||||
1 => 'contributor',
|
||||
2 => 'editor',
|
||||
),
|
||||
'module' => 'file_admin',
|
||||
);
|
||||
|
||||
return $permissions;
|
||||
}
|
60
sites/all/modules/debut_media/debut_media.info
Normal file
60
sites/all/modules/debut_media/debut_media.info
Normal file
@@ -0,0 +1,60 @@
|
||||
core = "7.x"
|
||||
dependencies[] = "context"
|
||||
dependencies[] = "features"
|
||||
dependencies[] = "file_admin"
|
||||
dependencies[] = "file_styles"
|
||||
dependencies[] = "jcarousel"
|
||||
dependencies[] = "media_internet"
|
||||
dependencies[] = "media_vimeo"
|
||||
dependencies[] = "media_youtube"
|
||||
dependencies[] = "taxonomy"
|
||||
dependencies[] = "views"
|
||||
description = "A media feature including media file views."
|
||||
features[context][] = "media"
|
||||
features[ctools][] = "context:context:3"
|
||||
features[ctools][] = "views:views_default:3.0"
|
||||
features[field][] = "file-application-field_tags"
|
||||
features[field][] = "file-application-media_description"
|
||||
features[field][] = "file-application-media_title"
|
||||
features[field][] = "file-audio-field_tags"
|
||||
features[field][] = "file-audio-media_description"
|
||||
features[field][] = "file-audio-media_title"
|
||||
features[field][] = "file-default-field_tags"
|
||||
features[field][] = "file-default-media_description"
|
||||
features[field][] = "file-default-media_title"
|
||||
features[field][] = "file-image-field_tags"
|
||||
features[field][] = "file-image-media_description"
|
||||
features[field][] = "file-image-media_title"
|
||||
features[field][] = "file-text-field_tags"
|
||||
features[field][] = "file-text-media_description"
|
||||
features[field][] = "file-text-media_title"
|
||||
features[field][] = "file-video-field_tags"
|
||||
features[field][] = "file-video-media_description"
|
||||
features[field][] = "file-video-media_title"
|
||||
features[image][] = "medium_large"
|
||||
features[image][] = "small_square_thumbnail"
|
||||
features[user_permission][] = "add media from remote sources"
|
||||
features[user_permission][] = "administer files"
|
||||
features[user_permission][] = "edit file"
|
||||
features[user_permission][] = "import media"
|
||||
features[user_permission][] = "view file"
|
||||
features[user_permission][] = "view own unpublished media"
|
||||
features[views_view][] = "media"
|
||||
files[] = "views/views_handler_field_file_rendered.inc"
|
||||
files[] = "views/views_handler_argument_file_type.inc"
|
||||
files[] = "views/views_handler_field_file_type.inc"
|
||||
files[] = "views/views_handler_filter_file_type.inc"
|
||||
files[] = "views/views_plugin_row_file_view.inc"
|
||||
name = "Debut Media"
|
||||
package = "Features"
|
||||
php = "5.2.4"
|
||||
recommends[] = "media_browser_plus"
|
||||
recommends[] = "styles_ui"
|
||||
recommends[] = "transliteration"
|
||||
|
||||
; Information added by drupal.org packaging script on 2011-10-26
|
||||
version = "7.x-1.0-beta5"
|
||||
core = "7.x"
|
||||
project = "debut_media"
|
||||
datestamp = "1319651729"
|
||||
|
101
sites/all/modules/debut_media/debut_media.install
Normal file
101
sites/all/modules/debut_media/debut_media.install
Normal file
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Install file for debut media. Includes field and instance definitions.
|
||||
* Based on approaches from media gallery.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_install().
|
||||
*
|
||||
* Add "Tags", "Title", and "Description" fields to files.
|
||||
*
|
||||
* @see media_gallery_install().
|
||||
*/
|
||||
function debut_media_install() {
|
||||
// Make sure the standard 'field_tags' field exists.
|
||||
_debut_media_ensure_vocabulary_tags();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_requirements().
|
||||
*/
|
||||
function debut_media_requirements() {
|
||||
$requirements = array();
|
||||
$t = get_t();
|
||||
|
||||
$required_fields = _debut_media_controlled_fields();
|
||||
// In addition to the fields we control, we also need the standard field_tags
|
||||
// that most sites will have gotten from their install profile.
|
||||
$required_fields['field_tags'] = array('type' => 'taxonomy_term_reference');
|
||||
|
||||
foreach ($required_fields as $field_name => $field_definition) {
|
||||
$field = field_info_field($field_name);
|
||||
// If the field doesn't exist, we will create it on install.
|
||||
if (!$field) {
|
||||
continue;
|
||||
}
|
||||
if ($field['type'] != $field_definition['type']) {
|
||||
$requirements['existing_field_' . $field_name] = array(
|
||||
'description' => $t("%field_name already exists and is not of type %type. Installation cannot continue. Please remove this field or change its type.", array('%field_name' => $field_name, '%type' => $field_definition['type'])),
|
||||
'severity' => REQUIREMENT_ERROR,
|
||||
);
|
||||
}
|
||||
}
|
||||
return $requirements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sure the field_tags field exists and is of the right type.
|
||||
*/
|
||||
function _debut_media_ensure_vocabulary_tags() {
|
||||
// Make sure the 'tags' vocabulary exists.
|
||||
$vocabulary = taxonomy_vocabulary_machine_name_load('tags');
|
||||
if (!$vocabulary) {
|
||||
$description = st('Use tags to group articles on similar topics into categories.');
|
||||
$help = st('Enter a comma-separated list of words to describe your content.');
|
||||
$vocabulary = (object) array(
|
||||
'name' => 'Tags',
|
||||
'description' => $description,
|
||||
'machine_name' => 'tags',
|
||||
'help' => $help,
|
||||
);
|
||||
taxonomy_vocabulary_save($vocabulary);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns definitions for fields this module both creates and deletes.
|
||||
*
|
||||
* @see _media_gallery_controlled_fields().
|
||||
*/
|
||||
function _debut_media_controlled_fields() {
|
||||
$fields = array(
|
||||
// Fields to create on media items.
|
||||
'media_description' => array(
|
||||
'field_name' => 'media_description',
|
||||
'locked' => TRUE,
|
||||
'type' => 'text_long',
|
||||
'translatable' => TRUE,
|
||||
),
|
||||
'media_title' => array(
|
||||
'field_name' => 'media_title',
|
||||
'locked' => TRUE,
|
||||
'type' => 'text',
|
||||
'translatable' => TRUE,
|
||||
),
|
||||
);
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_uninstall().
|
||||
*/
|
||||
function debut_media_uninstall() {
|
||||
// Delete fields and instances.
|
||||
foreach (array_keys(_debut_media_controlled_fields()) as $field) {
|
||||
field_delete_field($field);
|
||||
}
|
||||
}
|
52
sites/all/modules/debut_media/debut_media.make.inc
Normal file
52
sites/all/modules/debut_media/debut_media.make.inc
Normal file
@@ -0,0 +1,52 @@
|
||||
; Drupal version
|
||||
core = 7.x
|
||||
api = 2
|
||||
|
||||
; Contrib modules
|
||||
projects[context][subdir] = contrib
|
||||
projects[context][version] = 3.0-beta2
|
||||
projects[ctools][subdir] = contrib
|
||||
projects[ctools][version] = 1.x-dev
|
||||
projects[debut][subdir] = contrib
|
||||
projects[debut][version] = 1.0-beta3
|
||||
projects[debut_media][subdir] = contrib
|
||||
projects[debut_media][version] = 1.0-beta5
|
||||
projects[features][subdir] = contrib
|
||||
projects[features][version] = 1.0-beta4
|
||||
projects[file_admin][download][type] = "git"
|
||||
projects[file_admin][download][url] = "git://git.drupal.org/sandbox/nedjo/1217748"
|
||||
projects[file_admin][type] = "module"
|
||||
projects[file_admin][subdir] = contrib
|
||||
projects[file_entity][subdir] = contrib
|
||||
projects[file_entity][version] = 2.x-dev
|
||||
projects[jcarousel][subdir] = contrib
|
||||
projects[jcarousel][version] = 2.4-alpha3
|
||||
projects[jcarousel][patch][http://drupal.org/files/issues/1164504-jcarousel-notice-skin-1.patch] = http://drupal.org/files/issues/1164504-jcarousel-notice-skin-1.patch
|
||||
projects[media][subdir] = contrib
|
||||
projects[media][version] = 2.0-unstable2
|
||||
projects[media_browser_plus][subdir] = contrib
|
||||
projects[media_browser_plus][version] = 1.0-beta3
|
||||
projects[media_gallery][subdir] = contrib
|
||||
projects[media_gallery][version] = 1.0-beta7
|
||||
projects[media_vimeo][subdir] = contrib
|
||||
projects[media_vimeo][version] = 1.x-dev
|
||||
projects[media_youtube][subdir] = contrib
|
||||
projects[media_youtube][version] = 1.0-alpha5
|
||||
projects[media_youtube][patch][http://drupalcode.org/project/media_youtube.git/patch/f11ff66] = http://drupalcode.org/project/media_youtube.git/patch/f11ff66
|
||||
projects[multiform][subdir] = contrib
|
||||
projects[multiform][version] = 1.0-beta2
|
||||
projects[remote_stream_wrapper][subdir] = contrib
|
||||
projects[remote_stream_wrapper][version] = 1.0-beta2
|
||||
projects[styles][subdir] = contrib
|
||||
projects[styles][version] = 2.0-alpha8
|
||||
projects[styles][patch][http://drupal.org/files/issues/1186624-styles-media-fields.patch] = http://drupal.org/files/issues/1186624-styles-media-fields.patch
|
||||
projects[transliteration][subdir] = contrib
|
||||
projects[transliteration][version] = 3.0
|
||||
projects[views][subdir] = contrib
|
||||
projects[views][version] = 3.x-dev
|
||||
|
||||
; Libraries
|
||||
libraries[colorbox][download][type] = "get"
|
||||
libraries[colorbox][download][url] = "https://github.com/jackmoore/colorbox/zipball/v1.3.16"
|
||||
libraries[colorbox][directory_name] = "colorbox"
|
||||
|
324
sites/all/modules/debut_media/debut_media.module
Normal file
324
sites/all/modules/debut_media/debut_media.module
Normal file
@@ -0,0 +1,324 @@
|
||||
<?php
|
||||
|
||||
include_once('debut_media.features.inc');
|
||||
|
||||
/**
|
||||
* Implements hook_init().
|
||||
*
|
||||
* Add javascript and css required for the media browser link.
|
||||
*/
|
||||
function debut_media_init() {
|
||||
if (arg(0) == 'file' && is_null(arg(1))) {
|
||||
$path = drupal_get_path('module', 'media');
|
||||
$element['#attached'] = array(
|
||||
'js' => array($path . '/js/media.admin.js'),
|
||||
'css' => array($path . '/css/media.css'),
|
||||
);
|
||||
module_load_include('inc', 'media', 'includes/media.browser');
|
||||
media_attach_browser_js($element);
|
||||
// Render an empty element to add the js and css.
|
||||
drupal_render($element);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_menu_alter().
|
||||
*
|
||||
* Add a local action link to the media page.
|
||||
*/
|
||||
function debut_media_menu_alter(&$items) {
|
||||
if (isset($items['media/browser'])) {
|
||||
$items['media/add'] = $items['media/browser'];
|
||||
$items['media/add']['type'] = MENU_LOCAL_ACTION;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_entity_info_alter().
|
||||
*
|
||||
* Enable custom settings for the 'full' file view mode.
|
||||
* See http://drupal.org/node/1291428.
|
||||
*/
|
||||
function debut_media_entity_info_alter(&$entity_info) {
|
||||
$entity_info['file']['view modes']['full']['custom settings'] = TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_module_implements_alter().
|
||||
*
|
||||
* Extends the core file entity to be fieldable. Modules can define file types
|
||||
* via hook_file_type_info(). For each defined type, create a bundle, so that
|
||||
* fields can be configured per file type.
|
||||
*/
|
||||
function debut_media_module_implements_alter(&$implementations, $hook) {
|
||||
if ($hook == 'entity_info_alter') {
|
||||
// Move debut_media_entity_info_alter() to the end of the list.
|
||||
// module_implements() iterates through $implementations with a foreach
|
||||
// loop which PHP iterates in the order that the items were added, so to
|
||||
// move an item to the end of the array, we remove it and then add it.
|
||||
$group = $implementations['debut_media'];
|
||||
unset($implementations['debut_media']);
|
||||
$implementations['debut_media'] = $group;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_views_data_alter().
|
||||
*
|
||||
* Use the media_title field for the file fid argument's name field.
|
||||
*
|
||||
* @todo: determine why this doesn't appear to work with views contextual
|
||||
* filters;
|
||||
*/
|
||||
function debut_media_views_data_alter(&$data) {
|
||||
$data['file_managed']['fid']['argument']['name field'] = 'media_title';
|
||||
$data['file_managed']['fid']['argument']['name table'] = 'field_data_media_title';
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_page_alter().
|
||||
*
|
||||
* Set the page title for media items to the title of the item.
|
||||
*/
|
||||
function debut_media_page_alter(&$variables) {
|
||||
if (arg(0) == 'file' && $file = menu_get_object('file')) {
|
||||
if (!empty($file->media_title['und'][0]['safe_value'])) {
|
||||
drupal_set_title($file->media_title['und'][0]['safe_value']);
|
||||
}
|
||||
}
|
||||
// Add late in the page generation process to override the jcarousel css.
|
||||
drupal_add_css(drupal_get_path('module', 'debut_media') . '/debut_media.css');
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of Styles module hook_styles_default_styles().
|
||||
*/
|
||||
function debut_media_styles_default_styles() {
|
||||
return array(
|
||||
'file' => array(
|
||||
'styles' => array(
|
||||
'medium_large' => array(
|
||||
'label' => 'Medium large',
|
||||
'description' => 'A medium large format of the media.',
|
||||
),
|
||||
'small_square_thumbnail' => array(
|
||||
'label' => 'Small square thumbnail',
|
||||
'description' => 'A small, square format of the media.',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of Styles module hook_styles_default_presets_alter().
|
||||
*/
|
||||
function debut_media_styles_default_presets_alter(&$presets) {
|
||||
foreach (array_keys(debut_media_image_default_styles()) as $image_style) {
|
||||
// Cover the containers defined by file_styles and media_youtube.
|
||||
foreach (array('application', 'image', 'audio', 'video', 'default', 'media_youtube', 'media_vimeo') as $type) {
|
||||
// Ensure another module hasn't removed the container.
|
||||
if (isset($presets['file']['containers'][$type])) {
|
||||
$presets['file']['containers'][$type]['styles'][$image_style] = array(
|
||||
'default preset' => 'medium_large',
|
||||
);
|
||||
$presets['file']['containers'][$type]['presets'][$image_style] = array(
|
||||
array(
|
||||
'name' => 'image_style',
|
||||
'settings' => array(
|
||||
'image_style' => $image_style,
|
||||
),
|
||||
),
|
||||
array(
|
||||
'name' => 'thumbnail',
|
||||
'settings' => array(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of hook_field_default_fields_alter().
|
||||
*
|
||||
* Selectively add media fields to content types provided by features. To
|
||||
* receive a media_field instance, the feature should include the following in
|
||||
* its .info file:
|
||||
* debut[media][node_types][my_content_type] = my_content_type
|
||||
* where my_content_type is the name of a feature-provided content type.
|
||||
*
|
||||
* The media field status of a feature's content type can be altered by using
|
||||
* hook_system_info_alter(). Example:
|
||||
* %code
|
||||
* function example_system_info_alter(&$info, $module, $type) {
|
||||
* if ($type == $module && $module->name == 'debut_article') {
|
||||
* unset($info['debut']['media']['article']);
|
||||
* }
|
||||
* }
|
||||
* %endcode
|
||||
*/
|
||||
function debut_media_field_default_fields_alter(&$items) {
|
||||
// Get features modules and determine which if claim media.
|
||||
$features = features_get_features();
|
||||
$node_types = array();
|
||||
foreach ($features as $feature) {
|
||||
$info = $feature->info;
|
||||
if (isset($info['debut']) && isset($info['debut']['media']) && isset($info['debut']['media']['node_types'])) {
|
||||
// Key the array by node type to match the format of the 'service_links_node_types' variable.
|
||||
$node_types = array_merge($node_types, array_combine($info['debut']['media']['node_types'], $info['debut']['media']['node_types']));
|
||||
}
|
||||
}
|
||||
// Add media fields to the designated node types.
|
||||
if (!empty($node_types)) {
|
||||
$field = debut_media_media_field();
|
||||
foreach ($node_types as $type) {
|
||||
// Don't override an existing field. This allows features to provide
|
||||
// their own version of the field.
|
||||
if (!isset($items["node-$type-field_media"])) {
|
||||
$field['field_instance']['bundle'] = $type;
|
||||
$items["node-$type-field_media"] = $field;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the structure of the media field.
|
||||
*
|
||||
* The instance bundle is marked as 'placeholder'. It should be converted to
|
||||
* the appropriate node type before being used.
|
||||
*/
|
||||
function debut_media_media_field() {
|
||||
$field = array(
|
||||
'field_config' => array(
|
||||
'active' => '1',
|
||||
'cardinality' => '-1',
|
||||
'deleted' => '0',
|
||||
'entity_types' => array(),
|
||||
'field_name' => 'field_media',
|
||||
'foreign keys' => array(
|
||||
'fid' => array(
|
||||
'columns' => array(
|
||||
'fid' => 'fid',
|
||||
),
|
||||
'table' => 'file_managed',
|
||||
),
|
||||
),
|
||||
'indexes' => array(
|
||||
'fid' => array(
|
||||
0 => 'fid',
|
||||
),
|
||||
),
|
||||
'module' => 'file',
|
||||
'settings' => array(
|
||||
'display_default' => 0,
|
||||
'display_field' => 0,
|
||||
'uri_scheme' => 'public',
|
||||
),
|
||||
'translatable' => '0',
|
||||
'type' => 'file',
|
||||
),
|
||||
'field_instance' => array(
|
||||
'bundle' => 'placeholder',
|
||||
'deleted' => '0',
|
||||
'description' => '',
|
||||
'display' => array(
|
||||
'default' => array(
|
||||
'label' => 'hidden',
|
||||
'module' => 'file_entity',
|
||||
'settings' => array(
|
||||
'file_view_mode' => 'media_large',
|
||||
),
|
||||
'type' => 'file_rendered',
|
||||
'weight' => '4',
|
||||
),
|
||||
'teaser' => array(
|
||||
'label' => 'above',
|
||||
'settings' => array(),
|
||||
'type' => 'hidden',
|
||||
'weight' => 0,
|
||||
),
|
||||
),
|
||||
'entity_type' => 'node',
|
||||
'field_name' => 'field_media',
|
||||
'label' => 'Media',
|
||||
'required' => 0,
|
||||
'settings' => array(
|
||||
'description_field' => 0,
|
||||
'file_directory' => '',
|
||||
'file_extensions' => 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp',
|
||||
'max_filesize' => '',
|
||||
'user_register_form' => FALSE,
|
||||
),
|
||||
'widget' => array(
|
||||
'active' => 1,
|
||||
'module' => 'media',
|
||||
'settings' => array(
|
||||
'allowed_schemes' => array(
|
||||
'public' => 'public',
|
||||
'vimeo' => 'vimeo',
|
||||
'youtube' => 'youtube',
|
||||
),
|
||||
'allowed_types' => array(
|
||||
'audio' => 0,
|
||||
'default' => 'default',
|
||||
'image' => 'image',
|
||||
'video' => 'video',
|
||||
),
|
||||
'browser_plugins' => array(
|
||||
'library' => 0,
|
||||
'media_default--media_browser_1' => 0,
|
||||
'media_internet' => 0,
|
||||
'upload' => 0,
|
||||
),
|
||||
'progress_indicator' => 'throbber',
|
||||
),
|
||||
'type' => 'media_generic',
|
||||
'weight' => '10',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return $field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_file_default_displays_alter().
|
||||
*
|
||||
* Clone settings for 'media_large' to new 'full' view mode. Add a generic file
|
||||
* fallback for each view mode + file type combo.
|
||||
*
|
||||
* @todo: remove 'media_large' to 'full' cloning once media provider modules
|
||||
* catch up. See http://drupal.org/node/1291428.
|
||||
*/
|
||||
function debut_media_file_default_displays_alter(&$items) {
|
||||
$info = entity_get_info('file');
|
||||
$bundles = array_keys($info['bundles']);
|
||||
$view_modes = array_keys($info['view modes']);
|
||||
|
||||
foreach ($items as $key => $data) {
|
||||
list($file_type, $view_mode, $formatter_name) = explode('__', $key);
|
||||
if ($view_mode == 'media_large') {
|
||||
$display_name = implode('__', array($file_type, 'full', $formatter_name));
|
||||
if (!isset($items[$display_name])) {
|
||||
$items[$display_name] = clone($data);
|
||||
$items[$display_name]->name = $display_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($bundles as $file_type) {
|
||||
foreach ($view_modes as $view_mode) {
|
||||
$display_name = implode('__', array($file_type, $view_mode, 'file_field_file_default'));
|
||||
if (!isset($items[$display_name])) {
|
||||
$items[$display_name] = (object) array(
|
||||
'api_version' => 1,
|
||||
'name' => $display_name,
|
||||
'status' => 1,
|
||||
'weight' => 35,
|
||||
'settings' => array(),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
29
sites/all/modules/debut_media/debut_media.views.inc
Normal file
29
sites/all/modules/debut_media/debut_media.views.inc
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Views integration for the debut_media module.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_views_data().
|
||||
*/
|
||||
function debut_media_views_data() {
|
||||
// File rendered
|
||||
$data['file_managed']['rendered'] = array(
|
||||
'title' => t('File'),
|
||||
'title_short' => t('File:Rendered'),
|
||||
'help' => t('Display the file in a specific view mode.'),
|
||||
'field' => array(
|
||||
'handler' => 'views_handler_field_file_rendered',
|
||||
'click sortable' => TRUE,
|
||||
'real field' => 'fid',
|
||||
'additional fields' => array(
|
||||
'fid',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
322
sites/all/modules/debut_media/debut_media.views_default.inc
Normal file
322
sites/all/modules/debut_media/debut_media.views_default.inc
Normal file
@@ -0,0 +1,322 @@
|
||||
<?php
|
||||
/**
|
||||
* @file
|
||||
* debut_media.views_default.inc
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_views_default_views().
|
||||
*/
|
||||
function debut_media_views_default_views() {
|
||||
$export = array();
|
||||
|
||||
$view = new view;
|
||||
$view->name = 'media';
|
||||
$view->description = 'Displays of media including a page and a carousel of promoted items.';
|
||||
$view->tag = '';
|
||||
$view->base_table = 'file_managed';
|
||||
$view->human_name = 'Media';
|
||||
$view->core = 7;
|
||||
$view->api_version = '3.0';
|
||||
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
|
||||
|
||||
/* Display: Defaults */
|
||||
$handler = $view->new_display('default', 'Defaults', 'default');
|
||||
$handler->display->display_options['use_more_text'] = '';
|
||||
$handler->display->display_options['access']['type'] = 'none';
|
||||
$handler->display->display_options['cache']['type'] = 'none';
|
||||
$handler->display->display_options['query']['type'] = 'views_query';
|
||||
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
|
||||
$handler->display->display_options['exposed_form']['type'] = 'basic';
|
||||
$handler->display->display_options['pager']['type'] = 'full';
|
||||
$handler->display->display_options['pager']['options']['items_per_page'] = '15';
|
||||
$handler->display->display_options['pager']['options']['offset'] = '0';
|
||||
$handler->display->display_options['pager']['options']['id'] = '0';
|
||||
$handler->display->display_options['pager']['options']['expose']['items_per_page_options_all'] = 0;
|
||||
$handler->display->display_options['style_plugin'] = 'default';
|
||||
$handler->display->display_options['row_plugin'] = 'fields';
|
||||
/* Field: File: File ID */
|
||||
$handler->display->display_options['fields']['fid']['id'] = 'fid';
|
||||
$handler->display->display_options['fields']['fid']['table'] = 'file_managed';
|
||||
$handler->display->display_options['fields']['fid']['field'] = 'fid';
|
||||
$handler->display->display_options['fields']['fid']['exclude'] = TRUE;
|
||||
$handler->display->display_options['fields']['fid']['alter']['alter_text'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['alter']['make_link'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['alter']['absolute'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['alter']['word_boundary'] = 1;
|
||||
$handler->display->display_options['fields']['fid']['alter']['ellipsis'] = 1;
|
||||
$handler->display->display_options['fields']['fid']['alter']['strip_tags'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['alter']['trim'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['alter']['html'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['element_label_colon'] = 1;
|
||||
$handler->display->display_options['fields']['fid']['element_default_classes'] = 1;
|
||||
$handler->display->display_options['fields']['fid']['hide_empty'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['empty_zero'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['link_to_file'] = 0;
|
||||
/* Field: File: File */
|
||||
$handler->display->display_options['fields']['rendered']['id'] = 'rendered';
|
||||
$handler->display->display_options['fields']['rendered']['table'] = 'file_managed';
|
||||
$handler->display->display_options['fields']['rendered']['field'] = 'rendered';
|
||||
$handler->display->display_options['fields']['rendered']['label'] = '';
|
||||
$handler->display->display_options['fields']['rendered']['alter']['alter_text'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['make_link'] = 1;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['path'] = 'file/[fid]';
|
||||
$handler->display->display_options['fields']['rendered']['alter']['absolute'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['external'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['replace_spaces'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['trim_whitespace'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['nl2br'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['word_boundary'] = 1;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['ellipsis'] = 1;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['strip_tags'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['trim'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['html'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['element_label_colon'] = FALSE;
|
||||
$handler->display->display_options['fields']['rendered']['element_default_classes'] = 1;
|
||||
$handler->display->display_options['fields']['rendered']['hide_empty'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['empty_zero'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['hide_alter_empty'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['link_to_file'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['file_view_mode'] = 'media_preview';
|
||||
/* Field: File: Title */
|
||||
$handler->display->display_options['fields']['media_title']['id'] = 'media_title';
|
||||
$handler->display->display_options['fields']['media_title']['table'] = 'field_data_media_title';
|
||||
$handler->display->display_options['fields']['media_title']['field'] = 'media_title';
|
||||
$handler->display->display_options['fields']['media_title']['label'] = '';
|
||||
$handler->display->display_options['fields']['media_title']['alter']['alter_text'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['make_link'] = 1;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['path'] = 'file/[fid] ';
|
||||
$handler->display->display_options['fields']['media_title']['alter']['absolute'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['external'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['replace_spaces'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['trim_whitespace'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['nl2br'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['word_boundary'] = 1;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['ellipsis'] = 1;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['strip_tags'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['trim'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['html'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['element_label_colon'] = FALSE;
|
||||
$handler->display->display_options['fields']['media_title']['element_default_classes'] = 1;
|
||||
$handler->display->display_options['fields']['media_title']['hide_empty'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['empty_zero'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['hide_alter_empty'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['field_api_classes'] = 0;
|
||||
/* Field: Field: Tags */
|
||||
$handler->display->display_options['fields']['field_tags']['id'] = 'field_tags';
|
||||
$handler->display->display_options['fields']['field_tags']['table'] = 'field_data_field_tags';
|
||||
$handler->display->display_options['fields']['field_tags']['field'] = 'field_tags';
|
||||
$handler->display->display_options['fields']['field_tags']['label'] = '';
|
||||
$handler->display->display_options['fields']['field_tags']['alter']['alter_text'] = 0;
|
||||
$handler->display->display_options['fields']['field_tags']['alter']['make_link'] = 0;
|
||||
$handler->display->display_options['fields']['field_tags']['alter']['absolute'] = 0;
|
||||
$handler->display->display_options['fields']['field_tags']['alter']['external'] = 0;
|
||||
$handler->display->display_options['fields']['field_tags']['alter']['replace_spaces'] = 0;
|
||||
$handler->display->display_options['fields']['field_tags']['alter']['trim_whitespace'] = 0;
|
||||
$handler->display->display_options['fields']['field_tags']['alter']['nl2br'] = 0;
|
||||
$handler->display->display_options['fields']['field_tags']['alter']['word_boundary'] = 1;
|
||||
$handler->display->display_options['fields']['field_tags']['alter']['ellipsis'] = 1;
|
||||
$handler->display->display_options['fields']['field_tags']['alter']['strip_tags'] = 0;
|
||||
$handler->display->display_options['fields']['field_tags']['alter']['trim'] = 0;
|
||||
$handler->display->display_options['fields']['field_tags']['alter']['html'] = 0;
|
||||
$handler->display->display_options['fields']['field_tags']['element_label_colon'] = FALSE;
|
||||
$handler->display->display_options['fields']['field_tags']['element_default_classes'] = 1;
|
||||
$handler->display->display_options['fields']['field_tags']['hide_empty'] = 0;
|
||||
$handler->display->display_options['fields']['field_tags']['empty_zero'] = 0;
|
||||
$handler->display->display_options['fields']['field_tags']['group_rows'] = 1;
|
||||
$handler->display->display_options['fields']['field_tags']['delta_offset'] = '0';
|
||||
$handler->display->display_options['fields']['field_tags']['delta_reversed'] = 0;
|
||||
$handler->display->display_options['fields']['field_tags']['field_api_classes'] = 0;
|
||||
/* Sort criterion: File: Upload date */
|
||||
$handler->display->display_options['sorts']['timestamp']['id'] = 'timestamp';
|
||||
$handler->display->display_options['sorts']['timestamp']['table'] = 'file_managed';
|
||||
$handler->display->display_options['sorts']['timestamp']['field'] = 'timestamp';
|
||||
$handler->display->display_options['sorts']['timestamp']['order'] = 'DESC';
|
||||
/* Filter criterion: File: Mime type */
|
||||
$handler->display->display_options['filters']['filemime']['id'] = 'filemime';
|
||||
$handler->display->display_options['filters']['filemime']['table'] = 'file_managed';
|
||||
$handler->display->display_options['filters']['filemime']['field'] = 'filemime';
|
||||
|
||||
/* Display: Page: Media */
|
||||
$handler = $view->new_display('page', 'Page: Media', 'page_1');
|
||||
$handler->display->display_options['defaults']['title'] = FALSE;
|
||||
$handler->display->display_options['title'] = 'Multimedia';
|
||||
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
|
||||
$handler->display->display_options['style_plugin'] = 'grid';
|
||||
$handler->display->display_options['style_options']['columns'] = '3';
|
||||
$handler->display->display_options['style_options']['fill_single_line'] = 1;
|
||||
$handler->display->display_options['defaults']['style_options'] = FALSE;
|
||||
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
|
||||
$handler->display->display_options['row_plugin'] = 'fields';
|
||||
$handler->display->display_options['defaults']['row_options'] = FALSE;
|
||||
$handler->display->display_options['defaults']['filters'] = FALSE;
|
||||
/* Filter criterion: File: Type */
|
||||
$handler->display->display_options['filters']['type']['id'] = 'type';
|
||||
$handler->display->display_options['filters']['type']['table'] = 'file_managed';
|
||||
$handler->display->display_options['filters']['type']['field'] = 'type';
|
||||
$handler->display->display_options['filters']['type']['value'] = array(
|
||||
'audio' => 'audio',
|
||||
'image' => 'image',
|
||||
'video' => 'video',
|
||||
);
|
||||
$handler->display->display_options['filters']['type']['group'] = 0;
|
||||
$handler->display->display_options['path'] = 'file';
|
||||
$handler->display->display_options['menu']['weight'] = '0';
|
||||
$handler->display->display_options['menu']['name'] = 'main-menu';
|
||||
|
||||
/* Display: Page: Images */
|
||||
$handler = $view->new_display('page', 'Page: Images', 'page_2');
|
||||
$handler->display->display_options['defaults']['title'] = FALSE;
|
||||
$handler->display->display_options['title'] = 'Images';
|
||||
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
|
||||
$handler->display->display_options['style_plugin'] = 'grid';
|
||||
$handler->display->display_options['style_options']['columns'] = '3';
|
||||
$handler->display->display_options['style_options']['fill_single_line'] = 1;
|
||||
$handler->display->display_options['defaults']['style_options'] = FALSE;
|
||||
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
|
||||
$handler->display->display_options['row_plugin'] = 'fields';
|
||||
$handler->display->display_options['defaults']['row_options'] = FALSE;
|
||||
$handler->display->display_options['defaults']['filters'] = FALSE;
|
||||
/* Filter criterion: File: Type */
|
||||
$handler->display->display_options['filters']['type']['id'] = 'type';
|
||||
$handler->display->display_options['filters']['type']['table'] = 'file_managed';
|
||||
$handler->display->display_options['filters']['type']['field'] = 'type';
|
||||
$handler->display->display_options['filters']['type']['value'] = array(
|
||||
'image' => 'image',
|
||||
);
|
||||
$handler->display->display_options['filters']['type']['group'] = 0;
|
||||
$handler->display->display_options['path'] = 'file/image';
|
||||
$handler->display->display_options['menu']['weight'] = '0';
|
||||
$handler->display->display_options['menu']['name'] = 'main-menu';
|
||||
|
||||
/* Display: Page: Video */
|
||||
$handler = $view->new_display('page', 'Page: Video', 'page_3');
|
||||
$handler->display->display_options['defaults']['title'] = FALSE;
|
||||
$handler->display->display_options['title'] = 'Videos';
|
||||
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
|
||||
$handler->display->display_options['style_plugin'] = 'grid';
|
||||
$handler->display->display_options['style_options']['columns'] = '3';
|
||||
$handler->display->display_options['style_options']['fill_single_line'] = 1;
|
||||
$handler->display->display_options['defaults']['style_options'] = FALSE;
|
||||
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
|
||||
$handler->display->display_options['row_plugin'] = 'fields';
|
||||
$handler->display->display_options['defaults']['row_options'] = FALSE;
|
||||
$handler->display->display_options['defaults']['filters'] = FALSE;
|
||||
/* Filter criterion: File: Type */
|
||||
$handler->display->display_options['filters']['type']['id'] = 'type';
|
||||
$handler->display->display_options['filters']['type']['table'] = 'file_managed';
|
||||
$handler->display->display_options['filters']['type']['field'] = 'type';
|
||||
$handler->display->display_options['filters']['type']['value'] = array(
|
||||
'video' => 'video',
|
||||
);
|
||||
$handler->display->display_options['path'] = 'file/video';
|
||||
$handler->display->display_options['menu']['weight'] = '0';
|
||||
$handler->display->display_options['menu']['name'] = 'main-menu';
|
||||
|
||||
/* Display: Block: Carousel */
|
||||
$handler = $view->new_display('block', 'Block: Carousel', 'block_1');
|
||||
$handler->display->display_options['defaults']['title'] = FALSE;
|
||||
$handler->display->display_options['title'] = 'Recent multimedia';
|
||||
$handler->display->display_options['defaults']['pager'] = FALSE;
|
||||
$handler->display->display_options['pager']['type'] = 'some';
|
||||
$handler->display->display_options['pager']['options']['items_per_page'] = '9';
|
||||
$handler->display->display_options['pager']['options']['offset'] = '0';
|
||||
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
|
||||
$handler->display->display_options['style_plugin'] = 'jcarousel';
|
||||
$handler->display->display_options['style_options']['wrap'] = '0';
|
||||
$handler->display->display_options['style_options']['skin'] = 'default';
|
||||
$handler->display->display_options['style_options']['visible'] = '';
|
||||
$handler->display->display_options['style_options']['auto'] = '0';
|
||||
$handler->display->display_options['style_options']['autoPause'] = 1;
|
||||
$handler->display->display_options['style_options']['easing'] = '';
|
||||
$handler->display->display_options['style_options']['vertical'] = 0;
|
||||
$handler->display->display_options['defaults']['style_options'] = FALSE;
|
||||
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
|
||||
$handler->display->display_options['row_plugin'] = 'fields';
|
||||
$handler->display->display_options['defaults']['row_options'] = FALSE;
|
||||
$handler->display->display_options['defaults']['fields'] = FALSE;
|
||||
/* Field: File: File ID */
|
||||
$handler->display->display_options['fields']['fid']['id'] = 'fid';
|
||||
$handler->display->display_options['fields']['fid']['table'] = 'file_managed';
|
||||
$handler->display->display_options['fields']['fid']['field'] = 'fid';
|
||||
$handler->display->display_options['fields']['fid']['exclude'] = TRUE;
|
||||
$handler->display->display_options['fields']['fid']['alter']['alter_text'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['alter']['make_link'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['alter']['absolute'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['alter']['word_boundary'] = 1;
|
||||
$handler->display->display_options['fields']['fid']['alter']['ellipsis'] = 1;
|
||||
$handler->display->display_options['fields']['fid']['alter']['strip_tags'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['alter']['trim'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['alter']['html'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['element_label_colon'] = 1;
|
||||
$handler->display->display_options['fields']['fid']['element_default_classes'] = 1;
|
||||
$handler->display->display_options['fields']['fid']['hide_empty'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['empty_zero'] = 0;
|
||||
$handler->display->display_options['fields']['fid']['link_to_file'] = 0;
|
||||
/* Field: File: File */
|
||||
$handler->display->display_options['fields']['rendered']['id'] = 'rendered';
|
||||
$handler->display->display_options['fields']['rendered']['table'] = 'file_managed';
|
||||
$handler->display->display_options['fields']['rendered']['field'] = 'rendered';
|
||||
$handler->display->display_options['fields']['rendered']['label'] = '';
|
||||
$handler->display->display_options['fields']['rendered']['alter']['alter_text'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['make_link'] = 1;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['path'] = 'file/[fid]';
|
||||
$handler->display->display_options['fields']['rendered']['alter']['absolute'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['external'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['replace_spaces'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['trim_whitespace'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['nl2br'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['word_boundary'] = 1;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['ellipsis'] = 1;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['strip_tags'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['trim'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['alter']['html'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['element_label_colon'] = FALSE;
|
||||
$handler->display->display_options['fields']['rendered']['element_default_classes'] = 1;
|
||||
$handler->display->display_options['fields']['rendered']['hide_empty'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['empty_zero'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['hide_alter_empty'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['link_to_file'] = 0;
|
||||
$handler->display->display_options['fields']['rendered']['file_view_mode'] = 'media_preview';
|
||||
/* Field: File: Title */
|
||||
$handler->display->display_options['fields']['media_title']['id'] = 'media_title';
|
||||
$handler->display->display_options['fields']['media_title']['table'] = 'field_data_media_title';
|
||||
$handler->display->display_options['fields']['media_title']['field'] = 'media_title';
|
||||
$handler->display->display_options['fields']['media_title']['label'] = '';
|
||||
$handler->display->display_options['fields']['media_title']['alter']['alter_text'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['make_link'] = 1;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['path'] = 'file/[fid] ';
|
||||
$handler->display->display_options['fields']['media_title']['alter']['absolute'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['external'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['replace_spaces'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['trim_whitespace'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['nl2br'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['word_boundary'] = 1;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['ellipsis'] = 1;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['strip_tags'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['trim'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['alter']['html'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['element_label_colon'] = FALSE;
|
||||
$handler->display->display_options['fields']['media_title']['element_default_classes'] = 1;
|
||||
$handler->display->display_options['fields']['media_title']['hide_empty'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['empty_zero'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['hide_alter_empty'] = 0;
|
||||
$handler->display->display_options['fields']['media_title']['field_api_classes'] = 0;
|
||||
$handler->display->display_options['defaults']['filters'] = FALSE;
|
||||
/* Filter criterion: File: Type */
|
||||
$handler->display->display_options['filters']['type']['id'] = 'type';
|
||||
$handler->display->display_options['filters']['type']['table'] = 'file_managed';
|
||||
$handler->display->display_options['filters']['type']['field'] = 'type';
|
||||
$handler->display->display_options['filters']['type']['value'] = array(
|
||||
'image' => 'image',
|
||||
'video' => 'video',
|
||||
);
|
||||
/* Filter criterion: File: Promoted to front page */
|
||||
$handler->display->display_options['filters']['promote']['id'] = 'promote';
|
||||
$handler->display->display_options['filters']['promote']['table'] = 'file_managed';
|
||||
$handler->display->display_options['filters']['promote']['field'] = 'promote';
|
||||
$handler->display->display_options['filters']['promote']['value'] = '1';
|
||||
$export['media'] = $view;
|
||||
|
||||
return $export;
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Field handler to translate a file into its rendered form with a specified
|
||||
* view mode.
|
||||
*/
|
||||
class views_handler_field_file_rendered extends views_handler_field_file {
|
||||
function option_definition() {
|
||||
$options = parent::option_definition();
|
||||
$options['file_view_mode'] = array('default' => 'default');
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide file_view_mode option for to file display.
|
||||
*/
|
||||
function options_form(&$form, &$form_state) {
|
||||
parent::options_form($form, $form_state);
|
||||
|
||||
$entity_info = entity_get_info('file');
|
||||
$options = array('default' => t('Default'));
|
||||
foreach ($entity_info['view modes'] as $file_view_mode => $file_view_mode_info) {
|
||||
$options[$file_view_mode] = $file_view_mode_info['label'];
|
||||
}
|
||||
|
||||
$form['file_view_mode'] = array(
|
||||
'#title' => t('File view mode'),
|
||||
'#description' => t('Select a view mode. Note that only the file portion will be displayed.'),
|
||||
'#type' => 'select',
|
||||
'#default_value' => $this->options['file_view_mode'],
|
||||
'#options' => $options,
|
||||
'#fieldset' => 'more',
|
||||
);
|
||||
}
|
||||
|
||||
function render($values) {
|
||||
$value = $this->get_value($values);
|
||||
$file = file_load($value);
|
||||
return file_view_file($file, $this->options['file_view_mode']);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user