...
 
Commits (370)
......@@ -6,24 +6,6 @@
function boinc_standard_menu_default_menu_links() {
$menu_links = array();
// Exported menu link: menu-footer-links:https://boinc.berkeley.edu/
$menu_links['menu-footer-links:https://boinc.berkeley.edu/'] = array(
'menu_name' => 'menu-footer-links',
'link_path' => 'https://boinc.berkeley.edu/',
'router_path' => '',
'link_title' => 'BOINC',
'options' => array(
'attributes' => array(
'title' => '',
),
),
'module' => 'menu',
'hidden' => '0',
'external' => '1',
'has_children' => '0',
'expanded' => '0',
'weight' => '10',
);
// Exported menu link: primary-links:<front>
$menu_links['primary-links:<front>'] = array(
'menu_name' => 'primary-links',
......@@ -34,6 +16,7 @@ function boinc_standard_menu_default_menu_links() {
'attributes' => array(
'title' => '',
),
'alter' => TRUE,
),
'module' => 'menu',
'hidden' => '0',
......@@ -52,11 +35,12 @@ function boinc_standard_menu_default_menu_links() {
'attributes' => array(
'title' => '',
),
'alter' => TRUE,
),
'module' => 'menu',
'hidden' => '0',
'external' => '0',
'has_children' => '0',
'has_children' => '1',
'expanded' => '0',
'weight' => '-50',
'parent_path' => 'dashboard',
......@@ -71,6 +55,7 @@ function boinc_standard_menu_default_menu_links() {
'attributes' => array(
'title' => '',
),
'alter' => TRUE,
),
'module' => 'menu',
'hidden' => '0',
......
......@@ -20,7 +20,7 @@ dependencies[] = "fe_block"
dependencies[] = "features"
dependencies[] = "fieldgroup"
dependencies[] = "flag"
dependencies[] = "flag_abuse"
dependencies[] = "flag_abuse_reason"
dependencies[] = "flag_comment_notify"
dependencies[] = "htmlpurifier"
dependencies[] = "ignore_user"
......@@ -75,12 +75,25 @@ features[fieldgroup][] = "page-group_boinctranslate_opts"
features[filter_formats][] = "php_code"
features[filter_formats][] = "plain_text"
features[filter_formats][] = "rich_text"
features[flag][] = "abuse_comment"
features[flag][] = "abuse_node"
features[flag][] = "abuse_user"
features[flag][] = "abuse_comment_1"
features[flag][] = "abuse_comment_2"
features[flag][] = "abuse_comment_3"
features[flag][] = "abuse_comment_4"
features[flag][] = "abuse_comment_5"
features[flag][] = "abuse_comment_meta"
features[flag][] = "abuse_node_1"
features[flag][] = "abuse_node_2"
features[flag][] = "abuse_node_3"
features[flag][] = "abuse_node_4"
features[flag][] = "abuse_node_5"
features[flag][] = "abuse_node_meta"
features[flag][] = "abuse_user_1"
features[flag][] = "abuse_user_2"
features[flag][] = "abuse_user_3"
features[flag][] = "abuse_user_4"
features[flag][] = "abuse_user_meta"
features[flag][] = "subscriptions"
features[menu_custom][] = "menu-footer-links"
features[menu_links][] = "menu-footer-links:https://boinc.berkeley.edu/"
features[menu_links][] = "primary-links:<front>"
features[menu_links][] = "primary-links:dashboard"
features[menu_links][] = "primary-links:user/me/edit"
......
......@@ -356,18 +356,18 @@ function boinc_standard_strongarm() {
),
),
2 => array(
'name' => 'Sample profile',
'name' => 'Editor',
'usertab' => 1,
'filesize' => 1,
'quota' => 2,
'tuquota' => 0,
'filesize' => '2',
'quota' => '0',
'tuquota' => '0',
'extensions' => 'gif png jpg jpeg',
'dimensions' => '800x600',
'filenum' => 1,
'dimensions' => '0',
'filenum' => '0',
'directories' => array(
0 => array(
'name' => 'u%uid',
'subnav' => 0,
'name' => 'content',
'subnav' => 1,
'browse' => 1,
'upload' => 1,
'thumb' => 1,
......@@ -377,31 +377,43 @@ function boinc_standard_strongarm() {
),
'thumbnails' => array(
0 => array(
'name' => 'Thumb',
'name' => 'Small',
'dimensions' => '90x90',
'prefix' => 'thumb_',
'prefix' => 'small_',
'suffix' => '',
),
1 => array(
'name' => 'Medium',
'dimensions' => '120x120',
'prefix' => 'medium_',
'suffix' => '',
),
2 => array(
'name' => 'Large',
'dimensions' => '180x180',
'prefix' => 'large_',
'suffix' => '',
),
),
),
3 => array(
'name' => 'Editor',
'name' => 'Administrator',
'usertab' => 1,
'filesize' => '1',
'quota' => '2',
'filesize' => '2',
'quota' => '0',
'tuquota' => '0',
'extensions' => 'gif png jpg jpeg',
'dimensions' => '800x600',
'filenum' => '1',
'dimensions' => '0',
'filenum' => '0',
'directories' => array(
0 => array(
'name' => 'u%uid',
'subnav' => 0,
'name' => 'content',
'subnav' => 1,
'browse' => 1,
'upload' => 1,
'thumb' => 1,
'delete' => 0,
'resize' => 0,
'delete' => 1,
'resize' => 1,
),
),
'thumbnails' => array(
......@@ -433,13 +445,13 @@ function boinc_standard_strongarm() {
$strongarm->api_version = 1;
$strongarm->name = 'imce_roles_profiles';
$strongarm->value = array(
3519698132 => array(
1110965548 => array(
'weight' => '0',
'pid' => '0',
),
1110965548 => array(
3519698132 => array(
'weight' => '0',
'pid' => '0',
'pid' => '3',
),
268174006 => array(
'weight' => '0',
......@@ -447,9 +459,9 @@ function boinc_standard_strongarm() {
),
2938987599 => array(
'weight' => '0',
'pid' => '3',
'pid' => '2',
),
1257454314 => array(
933038561 => array(
'weight' => '0',
'pid' => '0',
),
......@@ -457,10 +469,6 @@ function boinc_standard_strongarm() {
'weight' => '0',
'pid' => '0',
),
933038561 => array(
'weight' => '0',
'pid' => '0',
),
2 => array(
'weight' => 11,
'pid' => '0',
......@@ -1883,8 +1891,8 @@ function boinc_standard_strongarm() {
'default_favicon' => 1,
'favicon_path' => '',
'favicon_upload' => '',
'boinc_stats_chart_color' => '#009CDB',
'boinc_stats_chart_bcolor' => '#EEEEEE',
'boinc_stats_chart_color' => '#0091CD',
'boinc_stats_chart_bcolor' => '#FFFFFF',
);
$export['theme_einstein_settings'] = $strongarm;
......
......@@ -16,6 +16,7 @@ function user_profiles_menu_default_menu_links() {
'attributes' => array(
'title' => '',
),
'alter' => TRUE,
),
'module' => 'menu',
'hidden' => '0',
......@@ -35,6 +36,7 @@ function user_profiles_menu_default_menu_links() {
'attributes' => array(
'title' => '',
),
'alter' => TRUE,
),
'module' => 'menu',
'hidden' => '0',
......
<?php
$base_url = 'https://albertathome.org';
......@@ -955,7 +955,7 @@ function _boinctranslate_locale_import_read_po($op, $file, $mode = NULL, $lang =
$lineno = 0; // Current line
while (!feof($fd)) {
$line = fgets($fd, 10 * 1024); // A line should not be this long
$line = fgets($fd, 100 * 1024); // A line should not be this long
if ($lineno == 0) {
// The first line might come with a UTF-8 BOM, which should be removed.
$line = str_replace("\xEF\xBB\xBF", '', $line);
......
......@@ -2303,7 +2303,7 @@ function boincuser_get_profile_links($uid) {
$output .= '</li>';
$count++;
}
$output .= '<li class="' . (($count) ? '' : 'first ') . 'last tab">' . flag_create_link('abuse_user', $account->uid) . '</li>';
$output .= '<li class="' . (($count) ? '' : 'first ') . 'last tab">' . flag_create_link('abuse_user_meta', $account->uid) . '</li>';
$output .= '</ul>';
}
return $output;
......
/* $Id$ */
/**
* @file
*
* CSS-style for flag-abuse-reason content
*/
.dropbtn {
background-color: #3498DB;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer;
}
.dropbtn:hover, .dropbtn:focus {
background-color: #2980B9;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 160px;
overflow: auto;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown a:hover {background-color: #ddd;}
.show {display: block;}
\ No newline at end of file
; $Id$
name = Flag Abuse Reason
description = Allow users to give a reason for flagged content
core = 6.x
package = Flags
dependencies[] = comment
dependencies[] = flag
dependencies[] = node
dependencies[] = user
project = "flag_abuse_reason"
datestamp = "1557420000"
version = "6.x-1.x"
<?php
// $Id$
/**
* @file
* Create a flag link with a JS dropdown with reasons why content has
* been flagged for abuse.
*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Hooks into flag module
* * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Implementation of hook_flag_default_flags()
*/
function flag_abuse_reason_flag_default_flags() {
$flags = array();
module_load_include('inc', 'flag_abuse_reason', 'includes/flag_abuse_reason.flag_default');
_flag_abuse_reason_abuse_node_flags($flags);
_flag_abuse_reason_abuse_comment_flags($flags);
_flag_abuse_reason_abuse_user_flags($flags);
return $flags;
}
/**
* Implementation of hook_views_api().
*/
function flag_abuse_reason_views_api() {
return array(
'api' => 2.0,
'path' => drupal_get_path('module', 'flag_abuse_reason') . '/includes',
);
}
/**
* Implementation of hook_perm().
*/
function flag_abuse_reason_perm() {
return array('reset abuse flags');
}
/**
* Implementation of hook_preprocess_flag().
*
* Here we change our flag event/action to 'reset'.
*/
function flag_abuse_reason_preprocess_flag(&$vars) {
drupal_add_js(drupal_get_path('module', 'flag_abuse_reason') . "/includes/flag_abuse_reason.js");
drupal_add_css(drupal_get_path('module', 'flag_abuse_reason') . "/css/flag_abuse_reason.css");
global $user;
$metaflags = array('abuse_node_meta', 'abuse_comment_meta', 'abuse_user_meta');
// permmission check instead of a role
// Is this one of our abuse flags?
if (in_array($vars['flag']->name, $metaflags)) {
// count the number of flags on this content
$count = db_result(db_query("SELECT COUNT(*) FROM {flag_content} WHERE content_id=%d AND fid=%d", $vars['content_id'], $vars['flag']->fid));
// If the variable <flagname>-<contentid> is set, then Reset
// completely.
if (variable_get($vars['flag']->name.'-'.$vars['content_id'], FALSE)) {
if (user_access('reset abuse flags', $user)) {
$vars['action'] = 'none';
$vars['link_text'] = t('Reset Completely');
$vars['link_title'] = t('Reset everying, allows users to re-flag content.');
}
else {
$vars['action'] = 'none';
$vars['link_text'] = t('Locked');
$vars['link_title'] = t('Reporting locked by moderator.');
$vars['link'] = array();
$vars['link_href'] = '';
$vars['flag_classes'] = 'flag style-like-link';
}
}
else {
// If there are flags on this content, clear the flags and
// lock the content.
if (user_access('reset abuse flags', $user)) {
if ($count>0) {
$vars['action'] = 'reset';
$vars['link_text'] = t('Clear Reports and Lock');
$vars['link_title'] = t('Remove all flags on this content and prevent any new flagging.');
}
// Otherwise the link is shown but has no effect.
else {
$vars['action'] = 'none';
$vars['link_text'] = t('No abuse reports');
$vars['link_title'] = t('This content has no abuse reports. Link does nothing.');
$vars['link'] = array();
$vars['link_href'] = '';
$vars['flag_classes'] = 'flag style-like-link';
}
}
}
}
}
/**
* Implementation of hook_flag().
*
* If a user with appropriate permission/role flags this content from our view
* we want to remove all flags. http://drupal.org/node/327901#comment-1085685
*/
function flag_abuse_reason_flag($event, $flag, $content_id, $account) {
$metaflags = array('abuse_node_meta', 'abuse_comment_meta', 'abuse_user_meta');
// For privileged users, check permissions and reset flags
// permission check instead of a role.
if (user_access('reset abuse flags', $account)) {
// Is this one of our abuse flags?
if (in_array($flag->name, $metaflags)) {
// Reset the flags completely.
if (variable_get($flag->name.'-'.$content_id, FALSE)) {
// Since the user flags the content again, we need to unflag it.
flag_reset_flag($flag, $content_id);
// @todo - replace t() with bts()
drupal_set_message(t('INFO: Reset everything. Users may reflag this content.', array('!rows' => $rows)), 'info');
// unlock flag; effectively resets flags for this content
variable_del($flag->name.'-'.$content_id);
}
else {
// Clear and Lock all flags on this content.
$dbresult = db_query("SELECT DISTINCT fid FROM {flag_content} WHERE content_id = %d", $content_id);
$rows = 0;
while ($myfid = db_fetch_array($dbresult)) {
$myflag = flag_get_flag(NULL, array_pop($myfid));
$rows += flag_reset_flag($myflag, $content_id);
}
if ($rows) {
// This user actually flags the content as well, so it may
// confuse the user if they reset what they thought was one
// flag and we report two.
$rows--;
// @todo - replace t() with bts()
drupal_set_message(t('INFO: Cleared !rows flags. Content is now locked and may not be reflagged.', array('!rows' => $rows)), 'info');
// This is the line which sets a Drupal variable which
// prevents the flag link from showing again for all
// users. Effectively preventing the content from being
// flagged again.
variable_set($flag->name.'-'.$content_id, TRUE);
}
}
}
}
// Normal users may cancel their all their reported flags on this
// content.
else {
if ( ($event=='unflag') && (in_array($flag->name, $metaflags)) ) {
$allflags = flag_get_user_flags($flag->content_type, $content_id, $account->uid);
foreach ($allflags as $subflag) {
$myflag = flag_get_flag(NULL, $subflag->fid);
$rc = $myflag->flag('unflag', $content_id, $account);
}
}
}
}
/**
* Implementation of hook_flag_access().
*/
function flag_abuse_reason_flag_access($flag, $content_id, $action, $account) {
/* @todo - consider removing block
$metaflags = array('abuse_node_meta', 'abuse_comment_meta', 'abuse_user_meta');
if (in_array($flag->name, $metaflags)) {
// Check to see if this flag is locked.
if (variable_get($flag->name.'-'.$content_id, FALSE)) {
if (user_access('reset abuse flags', $account)) {
return TRUE;
}
else {
// Normal users see nothing when flag is locked.
return FALSE;
}
}
}
*/
}
/**
* Implementation of hook_form_FORM_ID_alter().
*/
function flag_abuse_reason_form_flag_confirm_alter(&$form, &$form_state) {
global $user;
// Permmission check instead of a role.
if (user_access('reset abuse flags', $account)) {
$flag_name = $form['flag_name']['#value'];
// Is this one of our abuse flags?
if (in_array($flag_name, array('abuse_node_meta', 'abuse_comment_meta', 'abuse_user_meta'))) {
drupal_set_title(t('Flag reset'));
$form['description']['#value'] = t('Are you sure you want to reset all offensive flag on this content? Once doing so, users will not be able to flag this content again.');
$form['actions']['submit']['#value'] = t('Reset flags');
}
}
}
/**
* @file
*
* Javascript for flag_abuse_reason. Shows the dropdown box defined in
* the template.
*/
/**
* Useful variables/parameters
*
* data.contentId - Id of content, e.g., node id, comment id, etc.
* data.contentType - Type of content, e.g., node, comment, etc.
* data.flagName - Name of the flag.
* data.flagStatus - State of the flag.
*/
$(document).bind('flagGlobalBeforeLinkUpdate', function(event, data) {
/* dd is the dropdown defined the boinc template.
*/
var dd = 'flag_abuse_reason-dropdown-' + data.contentType + '-' + data.contentId;
var ddelement = document.getElementById(dd);
// Only node, comment, and user types are defined.
switch (data.contentType) {
case 'node':
/**
* Node
*/
// User clicks on the Report link
if ( window.getComputedStyle(ddelement).display === "none" &&
data.flagName == "abuse_node_meta" &&
data.flagStatus == "flagged" ) {
ddelement.style.display = "block";
}
if ( window.getComputedStyle(ddelement).display === "block" ) {
// User clicks on any of the flags in the drop down
if ( data.flagName != "abuse_node_meta" &&
data.flagStatus == "flagged" ) {
ddelement.style.display = "none";
}
// User clicks on Cancel Report
else if ( data.flagName == "abuse_node_meta" &&
data.flagStatus == "unflagged" ) {
ddelement.style.display = "none";
}
}
// User unflags by Cancel Report - refresh page
if ( window.getComputedStyle(ddelement).display === "none" &&
data.flagName == "abuse_node_meta" &&
data.flagStatus == "unflagged" ) {
window.location.reload();
}
break;
case 'comment':
/**
* Comments
*/
// User clicks on the Report link
if ( window.getComputedStyle(ddelement).display === "none" &&
data.flagName == "abuse_comment_meta" &&
data.flagStatus == "flagged" ) {
ddelement.style.display = "block";
}
if ( window.getComputedStyle(ddelement).display === "block" ) {
// User clicks on any of the flags in the drop down
if ( data.flagName != "abuse_comment_meta" &&
data.flagStatus == "flagged" ) {
ddelement.style.display = "none";
}
// User clicks on Cancel Report
else if ( data.flagName == "abuse_comment_meta" &&
data.flagStatus == "unflagged" ) {
ddelement.style.display = "none";
}
}
// User unflags by Cancel Report - refresh page
if ( window.getComputedStyle(ddelement).display === "none" &&
data.flagName == "abuse_comment_meta" &&
data.flagStatus == "unflagged" ) {
window.location.reload();
}
break;
case 'user':
/**
* User
*/
// User clicks on the Report link
if ( window.getComputedStyle(ddelement).display === "none" &&
data.flagName == "abuse_user_meta" &&
data.flagStatus == "flagged" ) {
ddelement.style.display = "block";
}
if ( window.getComputedStyle(ddelement).display === "block" ) {
// User clicks on any of the flags in the drop down
if ( data.flagName != "abuse_user_meta" &&
data.flagStatus == "flagged" ) {
ddelement.style.display = "none";
}
// User clicks on Cancel Report
else if ( data.flagName == "abuse_user_meta" &&
data.flagStatus == "unflagged" ) {
ddelement.style.display = "none";
}
}
// User unflags by Cancel Report - refresh page
if ( window.getComputedStyle(ddelement).display === "none" &&
data.flagName == "abuse_user_meta" &&
data.flagStatus == "unflagged" ) {
window.location.reload();
}
break;
} //switch
});
......@@ -54,6 +54,7 @@
* @see zen_process()
*/
?>
<div class="<?php print $classes; ?> clearfix">
<?php
static $authors;
......@@ -82,6 +83,9 @@
}
?>
<?php
$ddname = 'flag_abuse_reason-dropdown-comment-' . $comment->cid;
?>
<div class="user">
<?php
$account = user_load(array('uid' => $comment->uid));
......@@ -179,6 +183,15 @@
<span class="label">)</span>
</div>
<?php endif; ?>
<div class="dropdown">
<div id="<?php print $ddname; ?>" class="dropdown-content">
<?php print flag_create_link('abuse_comment_1', $comment->cid); ?>
<?php print flag_create_link('abuse_comment_2', $comment->cid); ?>
<?php print flag_create_link('abuse_comment_3', $comment->cid); ?>
<?php print flag_create_link('abuse_comment_4', $comment->cid); ?>
<?php print flag_create_link('abuse_comment_5', $comment->cid); ?>
</div>
</div>
<div class="content">
<?php print $content; ?>
<?php if ($signature AND $show_signatures): ?>
......
......@@ -137,6 +137,9 @@
<div id="node-<?php print $node->nid; ?>-alt" class="<?php print $classes; ?> clearfix<?php echo ($first_page) ? '' : ' not-first-page'; ?>">
<?php endif; ?>
<?php
$ddname = 'flag_abuse_reason-dropdown-node-' . $node->nid;
?>
<div class="user">
<?php
$account = user_load(array('uid' => $uid));
......@@ -212,6 +215,15 @@
</div>
<?php endif; ?>
<div class="dropdown">
<div id="<?php print $ddname; ?>" class="dropdown-content">
<?php print flag_create_link('abuse_node_1', $node->nid); ?>
<?php print flag_create_link('abuse_node_2', $node->nid); ?>
<?php print flag_create_link('abuse_node_3', $node->nid); ?>
<?php print flag_create_link('abuse_node_4', $node->nid); ?>
<?php print flag_create_link('abuse_node_5', $node->nid); ?>
</div>
</div>
<div class="content">
<?php print $content; ?>
<?php if ($signature AND $show_signatures): ?>
......
......@@ -153,6 +153,9 @@
<div id="node-<?php print $node->nid; ?>-alt" class="<?php print $classes; ?> clearfix<?php echo ($first_page) ? '' : ' not-first-page'; ?>">
<?php endif; ?>
<?php
$ddname = 'flag_abuse_reason-dropdown-node-' . $node->nid;
?>
<div class="user">
<?php
$account = user_load(array('uid' => $uid));
......@@ -228,6 +231,15 @@
</div>
<?php endif; ?>
<div class="dropdown">
<div id="<?php print $ddname; ?>" class="dropdown-content">
<?php print flag_create_link('abuse_node_1', $node->nid); ?>
<?php print flag_create_link('abuse_node_2', $node->nid); ?>
<?php print flag_create_link('abuse_node_3', $node->nid); ?>
<?php print flag_create_link('abuse_node_4', $node->nid); ?>
<?php print flag_create_link('abuse_node_5', $node->nid); ?>
</div>
</div>
<div class="content">
<?php print $content; ?>
<?php if ($signature AND $show_signatures): ?>
......
......@@ -231,3 +231,15 @@ if ($user->uid AND ($user->uid != $account->uid)) {
</div>
<?php endif; ?>
</div>
<?php
$ddname = 'flag_abuse_reason-dropdown-user-' . $account->uid;
?>
<div class="dropdown">
<div id="<?php print $ddname; ?>" class="dropdown-content">
<?php print flag_create_link('abuse_user_1', $account->uid); ?>
<?php print flag_create_link('abuse_user_2', $account->uid); ?>
<?php print flag_create_link('abuse_user_3', $account->uid); ?>
<?php print flag_create_link('abuse_user_4', $account->uid); ?>
<?php print flag_create_link('abuse_user_5', $account->uid); ?>
</div>
</div>
......@@ -120,6 +120,9 @@ $db_url = array(
'boinc_rw' => "{$boinc_rw_dbtype}://{$boinc_rw_dbuser}:".urlencode($boinc_rw_dbpass)."@{$boinc_rw_dbserver}/{$boinc_rw_dbname}"
);
$db_prefix = '';
$db_charset = array(
'boinc' => 'latin1'
);
// Set boinc_ro if variables are present, otherwise duplicate
// 'boinc_rw' entry as 'boinc_ro'.
......