Skip to content
Snippets Groups Projects
Commit 5f0a4c1c authored by Chris Gross's avatar Chris Gross
Browse files

7.x-1.15 Release Candidate 1

parent a3762c37
No related branches found
Tags 7.x-1.15-rc1
No related merge requests found
Showing
with 1182 additions and 3 deletions
WCM Base 7.x-1.15-rc21, 2019-04-19
----------------------------------
- WCM Base:
- Added WCM Addtoany module to allow social sharing of news articles.
- Updated Panopoly to 1.66 per SA-CONTRIB-2019-045.
WCM Base 7.x-1.14, 2019-04-18
-----------------------------
- WCM Base: Updated Drupal core to 7.66 per SA-CORE-2019-005 and -006.
WCM Base 7.x-1.14-rc3, 2019-04-14 WCM Base 7.x-1.14-rc3, 2019-04-14
--------------------------------- ---------------------------------
- WCM Omega: - WCM Omega:
......
...@@ -9,6 +9,7 @@ includes[wcm_base] = wcm_base.make ...@@ -9,6 +9,7 @@ includes[wcm_base] = wcm_base.make
;custom ;custom
projects[wcm_accessibility][options][working-copy] = TRUE projects[wcm_accessibility][options][working-copy] = TRUE
projects[wcm_addtoany][options][working-copy] = TRUE
projects[wcm_admin_menu][options][working-copy] = TRUE projects[wcm_admin_menu][options][working-copy] = TRUE
projects[ocio_basic_page][options][working-copy] = TRUE projects[ocio_basic_page][options][working-copy] = TRUE
projects[ocio_book][options][working-copy] = TRUE projects[ocio_book][options][working-copy] = TRUE
......
1. Install the module
2. check permissions on admin/user/access to decide which role and which node type is provided with the button.
3. Enjoy
\ No newline at end of file
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.
.addtoany-round-icon {
border-radius: 4px;
}
.addtoany-universal-button-option img {
vertical-align: middle;
}
\ No newline at end of file
<?php
/**
* @file
* Administration settings for AddToAny buttons integration
*/
// Load CSS
drupal_add_css((drupal_get_path('module', 'addtoany') . '/addtoany.admin.css'));
/**
* Administration settings form.
*
* @return
* The completed form definition.
*/
function addtoany_admin_settings() {
$form = array();
global $base_path;
$button_img = '<img src="' . $base_path . drupal_get_path('module', 'addtoany') . '/images/%s" width="%d" height="%d"%s />';
$button_options = array(
'a2a_svg_32' => sprintf($button_img, 'a2a_32_32.png', 32, 32, ' class="addtoany-round-icon"'),
'share_save_171_16.png|171|16' => sprintf($button_img, 'share_save_171_16.png', 171, 16, ''),
'share_save_256_24.png|256|24' => sprintf($button_img, 'share_save_256_24.png', 256, 24, ''),
'custom' => 'Custom button',
'text' => 'Text only',
'none' => 'None',
);
$form['#attached']['js'] = array(
drupal_get_path('module', 'addtoany') . '/addtoany.admin.js',
);
$form['addtoany_button_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Buttons'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['addtoany_button_settings']['addtoany_buttons_size'] = array(
'#type' => 'textfield',
'#title' => t('Icon size'),
'#field_suffix' => ' ' . t('pixels'),
'#default_value' => variable_get('addtoany_buttons_size', '32'),
'#size' => 10,
'#maxlength' => 3,
'#element_validate' => array('element_validate_integer_positive'),
'#description' => t('AddToAny\'s large SVG icons are mobile ready, pixel perfect on high DPI or retina displays, and revert to PNG in older browsers.'),
'#required' => TRUE
);
$form['addtoany_button_settings']['addtoany_service_button_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Service Buttons'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['addtoany_button_settings']['addtoany_service_button_settings']['addtoany_additional_html'] = array(
'#type' => 'textarea',
'#title' => t('Service Buttons HTML code'),
'#default_value' => variable_get('addtoany_additional_html', ''),
'#description' => t('You can add HTML code to display customized <a href="https://www.addtoany.com/buttons/customize/drupal/standalone_services" target="_blank">standalone service buttons</a> next to each universal sharing button. For example: <br /> <code>&lt;a class=&quot;a2a_button_facebook&quot;&gt;&lt;/a&gt;<br />&lt;a class=&quot;a2a_button_twitter&quot;&gt;&lt;/a&gt;<br />&lt;a class=&quot;a2a_button_pinterest&quot;&gt;&lt;/a&gt;</code>
'),
);
$form['addtoany_button_settings']['addtoany_service_button_settings']['addtoany_additional_html_placement'] = array(
'#type' => 'radios',
'#title' => t('Service Buttons placement'),
'#default_value' => variable_get('addtoany_additional_html_placement', 'before'),
'#options' => array(
'before' => t('Before the universal sharing button'),
'after' => t('After the universal sharing button'),
),
);
$form['addtoany_button_settings']['universal_button'] = array(
'#type' => 'fieldset',
'#title' => t('Universal Button'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
/* #states workaround in addtoany.admin.js */
);
$form['addtoany_button_settings']['universal_button']['addtoany_image'] = array(
'#type' => 'radios',
'#title' => t('Button'),
'#default_value' => variable_get('addtoany_image', 'share_save_171_16.png|171|16'),
'#attributes' => array('class' => array('addtoany-universal-button-option')),
'#options' => $button_options,
);
$form['addtoany_button_settings']['universal_button']['addtoany_custom_image'] = array(
'#type' => 'textfield',
'#title' => t('Custom button URL'),
'#default_value' => variable_get('addtoany_custom_image', ''),
'#description' => t('URL to the button image of your choosing. Example: http://example.com/share.png'),
'#states' => array(
// Show only if custom button is selected
'visible' => array(
':input[name="addtoany_image"]' => array('value' => 'custom'),
),
),
);
$form['addtoany_button_settings']['universal_button']['addtoany_image_attributes'] = array(
'#type' => 'textfield',
'#title' => t('Button image HTML attributes'),
'#default_value' => variable_get('addtoany_image_attributes', 'alt="Share"'),
'#description' => t('Extra HTML attributes for img tag. Example: alt=""'),
);
$form['addtoany_button_settings']['universal_button']['addtoany_link_text'] = array(
'#type' => 'textfield',
'#title' => t('Link text'),
'#default_value' => variable_get('addtoany_link_text', ''),
'#description' => t('Text for the universal sharing button link. Example: Share'),
);
$form['addtoany_placement_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Placement'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['addtoany_placement_settings']['addtoany_nodetypes'] = array(
'#type' => 'checkboxes',
'#title' => t('Node types'),
'#description' => t('Display buttons for these node types.'),
'#default_value' => variable_get('addtoany_nodetypes', array('page', 'article')),
'#options' => node_type_get_names(),
);
$form['addtoany_placement_settings']['addtoany_display_in_teasers'] = array(
'#type' => 'checkbox',
'#title' => t('Display for node <strong>teasers</strong>'),
'#default_value' => variable_get('addtoany_display_in_teasers', '1'),
'#description' => t('Display buttons for node <strong>teasers</strong> in selected sections.'),
'#states' => array(
// Disable if no section placement is selected
'disabled' => array(
':input[name="addtoany_display_in_nodecont"]' => array('checked' => FALSE),
':input[name="addtoany_display_in_nodelink"]' => array('checked' => FALSE),
),
),
);
$form['addtoany_placement_settings']['addtoany_display_in_nodelink'] = array(
'#type' => 'checkbox',
'#title' => t('Display in <strong>link</strong> section'),
'#default_value' => variable_get('addtoany_display_in_nodelink', '1'),
'#description' => t('Display buttons in the <strong>link</strong> section of node pages.'),
);
$form['addtoany_placement_settings']['addtoany_display_in_nodecont'] = array(
'#type' => 'checkbox',
'#title' => t('Display in <strong>content</strong> section'),
'#default_value' => variable_get('addtoany_display_in_nodecont', '0'),
'#description' => t('Display buttons in the <strong>content</strong> section of node pages.'),
);
$form['addtoany_placement_settings']['addtoany_display_in_rss'] = array(
'#type' => 'checkbox',
'#title' => t('Display in <strong>RSS</strong> feed'),
'#default_value' => variable_get('addtoany_display_in_rss', '1'),
'#description' => t('Display buttons in the RSS feed.'),
);
$form['addtoany_placement_settings']['addtoany_display_weight'] = array(
'#type' => 'weight',
'#title' => t('Content weight'),
'#default_value' => variable_get('addtoany_display_weight', 40),
'#delta' => 50,
'#description' => t('Optional weight value for buttons displayed in the <strong>content</strong> section.'),
'#states' => array(
// Show only if placement in "content" selected
'visible' => array(
':input[name="addtoany_display_in_nodecont"]' => array('checked' => TRUE),
),
),
);
$form['addtoany_additional_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Additional options'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['addtoany_additional_settings']['addtoany_additional_js'] = array(
'#type' => 'textarea',
'#title' => t('Additional JavaScript'),
'#default_value' => variable_get('addtoany_additional_js', ''),
'#description' => t('You can add special JavaScript code for AddToAny. Advanced users might want to check out AddToAny\'s <a href="https://www.addtoany.com/buttons/api/" target="_blank">JavaScript API</a> and <a href="https://www.addtoany.com/buttons/customize/drupal" target="_blank">documentation</a>.'),
);
$form['addtoany_additional_settings']['addtoany_additional_css'] = array(
'#type' => 'textarea',
'#title' => t('Additional CSS'),
'#default_value' => variable_get('addtoany_additional_css', ''),
'#description' => t('You can add special CSS code for AddToAny. See <a href="https://www.addtoany.com/buttons/customize/drupal" target="_blank">AddToAny documentation</a> for customizations.'),
);
$form['addtoany_additional_settings']['addtoany_no_3p'] = array(
'#type' => 'checkbox',
'#title' => t('Disable 3rd party cookies'),
'#default_value' => variable_get('addtoany_no_3p', '0'),
'#description' => t('Disabling may affect analytics and limit some functionality.'),
);
return system_settings_form($form);
}
(function ($) {
Drupal.behaviors.addtoany = {
attach: function(context, settings) {
// Initial page setup
var addtoany_icon = $('input[value="a2a_svg_32"]').next('label').find('img:first'),
initial_icon_size_int = parseInt( $('input[name="addtoany_buttons_size"]').val() );
// Set the A2A icon's size to match selected Icon Size
addtoany_icon.height(initial_icon_size_int).width(initial_icon_size_int);
// Bring attention to large A2A icon option
// because the universal button will likely be changed to match the other icons
// (Drupal #states can't handle this)
$('input[name="addtoany_buttons_size"]').change(function() {
var icon_size = $(this).val(),
icon_size_int = parseInt(icon_size);
// If icon size is the classic 16 pixels, and the modern A2A icon is not checked
if ( icon_size != '16' && ! $('input[value="a2a_svg_32"]').is(':checked') ) {
// Expand Universal Button fieldset if collapsed
if ( $('#edit-universal-button').is('.collapsed') )
Drupal.toggleFieldset('#edit-universal-button');
// Flash the A2A icon if not selected, because it should be selected to match the other icons
addtoany_icon.fadeTo('fast', .2).fadeTo('fast', 1).fadeTo('fast', .2).fadeTo('fast', 1);
// Set the A2A icon's size to match selected Icon Size
addtoany_icon.height(icon_size_int).width(icon_size_int);
}
});
}
};
}(jQuery));
\ No newline at end of file
.addtoany {
display: inline;
}
.addtoany_list {
display: inline;
line-height: 16px;
}
.addtoany_list > a,
.addtoany_list a img,
.addtoany_list a > span {
vertical-align: middle;
}
.addtoany_list > a {
display: inline-block;
font-size: 16px;
padding: 0 4px;
}
.addtoany_list.a2a_kit_size_32 > a {
font-size: 32px;
}
.addtoany_list .a2a_counter img {
float: left;
}
.addtoany_list a span.a2a_img {
display: inline-block;
height: 16px;
opacity: 1;
overflow: hidden;
width: 16px;
}
.addtoany_list a span {
display: inline-block;
float: none;
}
.addtoany_list.a2a_kit_size_32 a > span {
border-radius: 4px;
height: 32px;
line-height: 32px;
opacity: 1;
width: 32px;
}
.addtoany_list a:hover:hover img,
.addtoany_list a:hover span {
opacity: .7;
}
.addtoany_list a.addtoany_share_save img {
border: 0;
width: auto;
height: auto;
}
.addtoany_list.a2a_kit_size_32 a .a2a_count {
position: relative;
}
\ No newline at end of file
name = AddToAny
description = Share buttons by AddToAny, including the AddToAny universal sharing button, Facebook, Twitter, Google+, Pinterest, and over 100 more on the <a href='https://www.addtoany.com/' target='_blank'>AddToAny</a> platform.
core = 7.x
files[] = addtoany.module
files[] = addtoany.admin.inc
files[] = addtoany.variable.inc
files[] = views/addtoany_handler_field_addtoany_link.inc
files[] = views/addtoany.views.inc
configure = admin/config/services/addtoany
; Information added by Drupal.org packaging script on 2018-07-03
version = "7.x-4.15"
core = "7.x"
project = "addtoany"
datestamp = "1530660828"
<?php
/**
* @file
* Stand alone module file to handle AddToAny buttons integration
*/
/**
* Implements hook_install().
*/
function addtoany_install() {
drupal_set_message(st("Your AddToAny settings are available under !link",
array( '!link' => l('Configuration > Web services > AddToAny ', 'admin/config/services/addtoany' ) )
));
}
/**
* Implements hook_permission().
*/
function addtoany_permission() {
return array(
'administer addtoany' => array(
'title' => t('Administer addtoany'),
'description' => t(''),
),
);
}
/**
* Implements hook_node_view().
*/
function addtoany_node_view($node, $view_mode) {
$types = variable_get('addtoany_nodetypes', array('page', 'article'));
$teaser = ($view_mode == 'teaser') ? TRUE : FALSE;
$rss = ($view_mode == 'rss') ? TRUE : FALSE;
// Display in link section?
$show = (!empty($node->type) && in_array($node->type, $types, TRUE) && ($node->status == 1) && (variable_get('addtoany_display_in_nodelink', '1') != 0)
&& (
(!$teaser) || ($teaser && variable_get('addtoany_display_in_teasers', '1') != 0)
)
&& (
(!$rss) || ($rss && variable_get('addtoany_display_in_rss', '1') != 0)
)
);
if ($show) {
$node->content['links']['#links']['addtoany'] = array(
'title' => addtoany_create_node_buttons($node),
'html' => TRUE,
);
}
// Display in content section?
$show = (!empty($node->type) && in_array($node->type, $types, TRUE) && ($node->status == 1) && (variable_get('addtoany_display_in_nodecont', '0') != 0)
&& (
(!$teaser) || ($teaser && variable_get('addtoany_display_in_teasers', '1') != 0)
)
&& (
(!$rss) || ($rss && variable_get('addtoany_display_in_rss', '1') != 0)
)
);
$weight = variable_get('addtoany_display_weight', 40);
if ($show) {
$node->content['addtoany'] = array(
'#markup' => addtoany_create_node_buttons($node),
'#weight' => $weight,
);
}
}
/**
* Implements hook_views_api().
*/
function addtoany_views_api() {
return array(
'api' => 2,
'path' => drupal_get_path('module', 'addtoany') . '/views',
);
}
/**
* Implements hook_menu().
*/
function addtoany_menu() {
$items = array();
$items['admin/config/services/addtoany'] = array(
'title' => t('AddToAny'),
'description' => t('Settings for your <a href="https://www.addtoany.com/" target="blank">AddToAny</a> share buttons.'),
'page callback' => 'drupal_get_form',
'page arguments' => array('addtoany_admin_settings'),
'access arguments' => array('administer addtoany'),
'file' => 'addtoany.admin.inc',
);
return $items;
}
/**
* Implements hook_block_info().
*/
function addtoany_block_info() {
$blocks['addtoany_button'] = array(
'info' => t('AddToAny buttons'),
'cache' => DRUPAL_NO_CACHE,
);
return $blocks;
}
/**
* Implements hook_block_list().
*/
function addtoany_block_list() {
$blocks['addtoany_button'] = array(
'info' => t('AddToAny buttons'),
'status' => TRUE,
'weight' => 0,
'visibility' => 1,
'pages' => '*',
);
return $blocks;
}
/**
* Implements hook_block_view().
*/
function addtoany_block_view($delta = 0) {
$block = array();
switch ($delta) {
case 'addtoany_button':
$block['subject'] = t('AddToAny');
$block['content'] = addtoany_create_node_buttons(menu_get_object());
break;
}
return $block;
}
/**
* Implements hook_page_alter().
*
* @return
* String containing JavaScript code for asynchronous loading of AddToAny's external script.
*/
function addtoany_page_alter(&$page) {
global $_addtoany_init, $_addtoany_targets;
// Always add CSS file (necessary for aggregation)
$page['content']['#attached']['css'][] = drupal_get_path('module', 'addtoany') . '/addtoany.css';
// Only output script when AddToAny is used
if ( ! $_addtoany_init)
return;
$javascript_header = "window.a2a_config=window.a2a_config||{};"
. "window.da2a={done:false,"
. "html_done:false,"
. "script_ready:false,"
. "script_load:function(){"
. "var a=document.createElement('script'),"
. "s=document.getElementsByTagName('script')[0];"
. "a.type='text/javascript';a.async=true;"
. "a.src='https://static.addtoany.com/menu/page.js';"
. "s.parentNode.insertBefore(a,s);"
. "da2a.script_load=function(){};"
. "},"
. "script_onready:function(){"
. "da2a.script_ready=true;"
. "if(da2a.html_done)da2a.init();"
. "},"
. "init:function(){"
. "for(var i=0,el,target,targets=da2a.targets,length=targets.length;i<length;i++){"
. "el=document.getElementById('da2a_'+(i+1));"
. "target=targets[i];"
. "a2a_config.linkname=target.title;"
. "a2a_config.linkurl=target.url;"
. "if(el){"
. "a2a.init('page',{target:el});"
. "el.id='';" // Remove ID so AJAX can reuse the same ID
. "}"
. "da2a.done=true;"
. "}"
. "da2a.targets=[];" // Empty targets array so AJAX can reuse from index 0
. "}"
. "};"
// AJAX support
. "(function ($){"
. "Drupal.behaviors.addToAny = {"
. "attach: function (context, settings) {"
// If not the full document (it's probably AJAX), and window.da2a exists
. "if (context !== document && window.da2a) {"
. "if(da2a.script_ready)a2a.init_all('page');" // Init all uninitiated AddToAny instances
. "da2a.script_load();" // Load external script if not already called
. "}"
. "}"
. "}"
. "})(jQuery);"
. "a2a_config.callbacks=a2a_config.callbacks||[];"
. "a2a_config.callbacks.push({ready:da2a.script_onready});"
. "a2a_config.overlays=a2a_config.overlays||[];"
. "a2a_config.templates=a2a_config.templates||{};"
. ((variable_get('addtoany_no_3p', '0') != '1') ? "" : "a2a_config.no_3p=1;")
. variable_get('addtoany_additional_js', '');
$javascript_footer = "da2a.targets=["
. implode(",", $_addtoany_targets)
. "];\n"
. "da2a.html_done=true;"
. "if(da2a.script_ready&&!da2a.done)da2a.init();" // External script may load before html_done=true, but will only init if html_done=true. So call da2a.init() if external script is ready, and if da2a.init() hasn't been called already. Otherwise, wait for callback to call da2a.init()
. "da2a.script_load();"; // Load external script if not already called with the first AddToAny instance. Fixes issues where first instance code is processed internally but without actual code output
$page['content']['#attached']['js'][] = array(
'data' => $javascript_header,
'scope' => 'header',
'type' => 'inline',
);
$page['content']['#attached']['js'][] = array(
'data' => $javascript_footer,
'scope' => 'footer',
'type' => 'inline',
);
/**
* Custom CSS Setting
*/
$css = variable_get('addtoany_additional_css', '');
if(!empty($css)) {
drupal_add_css($css, 'inline');
}
}
/**
* Internal function to call the async script loading function right after the first AddToAny instance, to utilize concurrent downloading and increase overall page-load performance.
*
* @param int $id_num
* @param string $link_name
* @param string $link_url
* @return
* String containing a JavaScript function call for asynchronous script loading right after the first instance.
*/
function _addtoany_create_script($id_num, $link_name, $link_url) {
global $_addtoany_targets, $_addtoany_init;
if ( ! isset($_addtoany_targets)) {
$_addtoany_targets = array();
}
$button_config = "\n{title:". drupal_json_encode($link_name) . ","
. "url:" . drupal_json_encode($link_url) . "}";
$_addtoany_targets[] = $button_config;
if ( ! $_addtoany_init) {
$javascript_load_early = "<script type=\"text/javascript\">\n"
. "<!--//--><![CDATA[//><!--\n"
. "if(window.da2a)da2a.script_load();\n"
. "//--><!]]>\n"
. "</script>";
}
else
$javascript_load_early = "";
$_addtoany_init = TRUE;
return $javascript_load_early;
}
/**
* Generate code for AddToAny buttons for a node.
*
* @param object $node
* The node object to create the buttons for.
*
* @return string
* The HTML code for the buttons.
*/
function addtoany_create_node_buttons($node) {
$url = isset($node) ? 'node/' . $node->nid : NULL;
$title = isset($node) ? $node->title : NULL;
return addtoany_create_buttons($url, $title);
}
/**
* Generate code for AddToAny buttons.
*
* @param array $url
* If present this will be used as the URL. It can be a relative internal path
* or an absolute URL. Use an empty string or <front> for the home page or
* NULL to use the current page URL.
* The URL will be run through check_url().
*
* @param string $title
* If present this will be used as the title. Use an empty string for no title
* or NULL to use the current page title.
* The title will be run through check_plain().
*
* @return string
* The HTML code for the buttons.
*/
function addtoany_create_buttons($url = NULL, $title = NULL) {
global $_addtoany_num, $base_path;
$_addtoany_num++;
$additional_html = variable_get('addtoany_additional_html', '');
$additional_html_placement = variable_get('addtoany_additional_html_placement', 'before');
// Default to <front> or the current path.
if (!isset($url)) {
// Use <front> for the front page to avoid '/node' as the final URL,
// otherwise use current path.
$url = (drupal_is_front_page()) ? '<front>' : current_path();
}
else {
// Sanitize and encode URL for HTML output.
$url = check_url($url);
}
// Default to the current title, using the site name for the home page.
if (!isset($title)) {
if (drupal_is_front_page()) {
$title = module_exists('page_title') ? page_title_page_get_title() : check_plain(variable_get('site_name', 'Drupal'));
}
else {
$title = module_exists('page_title') ? page_title_page_get_title() : drupal_get_title();
}
}
// Set the link name.
$link_name = $title;
// Make an absolute link URL out of whatever URL/path we have been given.
$link_url = url($url, array('absolute' => TRUE));
$buttons_size = variable_get('addtoany_buttons_size', '32');
// Must be a 3 digit positive integer.
$buttons_size = (
$buttons_size !== '32' && strlen($buttons_size) <= 3 && $buttons_size !== ''
&& is_numeric($buttons_size) && intval($buttons_size) == $buttons_size && $buttons_size > 0
) ? $buttons_size : '32';
$button_setting = variable_get('addtoany_image', 'share_save_171_16.png|171|16');
if ($button_setting == 'a2a_svg_32') {
$button_setting = 'text';
$button_text = '';
}
elseif ($button_setting == 'custom') {
$button_image = check_url(variable_get('addtoany_custom_image', ''));
$button_width = '';
$button_height = '';
}
elseif ($button_setting == 'none') {
// Universal share button disabled.
}
elseif ($button_setting != 'text') {
$button = explode('|', $button_setting);
$button_filename = $button[0];
$button_width = ' width="' . $button[1] . '"';
$button_height = ' height="' . $button[2] . '"';
$button_image = $base_path . drupal_get_path('module', 'addtoany') . '/images/' . $button_filename;
}
if ($button_setting != 'none') {
// Permit blank button_text (so AddToAny Kit can set the icon) if set above,
// or use addtoany_link_text if set.
$button_text = (isset($button_text)) ? $button_text : check_plain(variable_get('addtoany_link_text', ''));
if (strlen($button_text) > 0) {
$button_text = ' ' . $button_text;
}
$button_innerHTML = ($button_setting == "text") ? $button_text : sprintf('<img src="%s"%s%s %s/>%s',
$button_image,
$button_width,
$button_height,
filter_xss(variable_get('addtoany_image_attributes', 'alt="Share this"'), array()),
$button_text
);
$universal_button = sprintf('<a%s href="https://www.addtoany.com/share#url=%s&amp;title=%s">%s</a>',
' class="a2a_dd addtoany_share_save"',
rawurlencode($link_url),
rawurlencode($link_name),
$button_innerHTML
);
}
else {
$universal_button = '';
}
// If doing AJAX
if ( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) {
$javascript = '';
$kit_data_attrs = drupal_attributes(array('data-a2a-url' => $link_url, 'data-a2a-title' => $link_name));
$kit_id_attr = '';
$kit_target_classname = '';
} else {
$javascript = _addtoany_create_script($_addtoany_num, $link_name, $link_url);
$kit_data_attrs = '';
$kit_id_attr = ' id="da2a_' . $_addtoany_num . '"'; // The ID is later removed by JS (to support AJAX, previously).
$kit_target_classname = ' a2a_target';
}
return ( sprintf('<span class="a2a_kit%s%s addtoany_list"%s%s>
%s
%s
%s
</span>
%s',
($buttons_size != '16') ? ' a2a_kit_size_' . $buttons_size : '',
$kit_target_classname,
$kit_id_attr,
$kit_data_attrs,
($additional_html_placement == 'before') ? $additional_html : '',
$universal_button,
($additional_html_placement == 'after') ? $additional_html : '',
$javascript
));
}
/**
* Implements hook_ds_fields_info().
*/
function addtoany_ds_fields_info($entity_type) {
$fields['node']['addtoany'] = array(
'title' => t('AddToAny buttons'),
'field_type' => DS_FIELD_TYPE_FUNCTION,
'function' => 'addtoany_ds_buttons_field',
);
return $fields;
}
/**
* Returns the addtoany buttons field.
*/
function addtoany_ds_buttons_field($field) {
$entity = $field['entity'];
return addtoany_create_node_buttons($entity);
}
<?php
/**
* @file
* Variable module integration for the AddToAny module.
*/
/**
* Implements hook_variable_info().
*/
function addtoany_variable_info($options = array()) {
$variables['addtoany_link_text'] = array(
'type' => 'string',
'title' => t('AddToAny link text', array(), $options),
'description' => t('Text for the universal sharing button link. Example: Share.', array(), $options),
'default' => '',
'localize' => TRUE,
);
return $variables;
}
\ No newline at end of file
profiles/wcm_base/modules/contrib/addtoany/images/a2a_32_32.png

104 B

profiles/wcm_base/modules/contrib/addtoany/images/share_16_16.png

627 B

profiles/wcm_base/modules/contrib/addtoany/images/share_save_120_16.png

1.97 KiB

profiles/wcm_base/modules/contrib/addtoany/images/share_save_171_16.png

2.51 KiB

profiles/wcm_base/modules/contrib/addtoany/images/share_save_256_24.png

2.44 KiB

<?php
/**
* @file
* Views integration for AddToAny.
*/
/**
* Implementation of hook_views_data().
*/
function addtoany_views_data() {
// Add the addtoany link to the node fields
$data['node']['addtoany_link'] = array(
'title' => t('AddToAny link'),
'help' => t('Link provided by the AddToAny module'),
'group' => t('Content'),
'field' => array(
'handler' => 'addtoany_handler_field_addtoany_link',
'click sortable' => FALSE,
)
);
return $data;
}
<?php
/**
* @file
* Views field handler for the AddToAny link field
*/
/**
* Field handler to present AddToAny links.
*/
class addtoany_handler_field_addtoany_link extends views_handler_field_node_link {
function render($values) {
if (($entity = $this->get_value($values)) && node_access('view', $entity)) {
return addtoany_create_node_buttons($entity);
}
}
}
...@@ -7,8 +7,8 @@ package = Fields ...@@ -7,8 +7,8 @@ package = Fields
dependencies[] = field dependencies[] = field
configure = admin/config/content/tablefield configure = admin/config/content/tablefield
; Information added by Drupal.org packaging script on 2018-12-08 ; Information added by Drupal.org packaging script on 2019-04-16
version = "7.x-3.2" version = "7.x-3.4"
core = "7.x" core = "7.x"
project = "tablefield" project = "tablefield"
datestamp = "1544293992" datestamp = "1555444847"
...@@ -96,6 +96,13 @@ function tablefield_permission() { ...@@ -96,6 +96,13 @@ function tablefield_permission() {
* The field delta to load. * The field delta to load.
*/ */
function tablefield_export_csv($entity_type, $entity_id, $field_name, $langcode, $delta) { function tablefield_export_csv($entity_type, $entity_id, $field_name, $langcode, $delta) {
// Ensure this is a tablefield.
$field_info = field_info_field($field_name);
if (!$field_info || $field_info['type'] != 'tablefield') {
return drupal_not_found();
}
$filename = sprintf('%s_%s_%s_%s_%s.csv', $entity_type, $entity_id, $field_name, $langcode, $delta); $filename = sprintf('%s_%s_%s_%s_%s.csv', $entity_type, $entity_id, $field_name, $langcode, $delta);
$uri = 'temporary://' . $filename; $uri = 'temporary://' . $filename;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment