first import

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-08 11:40:19 +02:00
commit 1bc61b12ad
8435 changed files with 1582817 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<?php
/**
* @file
* Views handler for simplenews field simplewnews_category.hyperlinks.
*/
/**
* Provide HTML Mail Hyperlinks position settings.
*/
class simplenews_handler_field_category_hyperlinks extends views_handler_field {
function render($values) {
switch ($values->{$this->field_alias}) {
case 0:
return t('Bottom');
case 1:
return t('Inline');
}
}
}

View File

@@ -0,0 +1,21 @@
<?php
/**
* @file
* Views field handler for simplenews_category.opt_inout.
*/
/**
* Provide translatable simplenews_category.opt_inout Options.
*/
class simplenews_handler_field_category_new_account extends views_handler_field {
function render($values) {
$opt = array(
'none' => t('None'),
'on' => t('Default on'),
'off' => t('Default off'),
'silent' => t('invisible Subscrition'),
);
return check_plain($opt[$values->{$this->field_alias}]);
}
}

View File

@@ -0,0 +1,20 @@
<?php
/**
* @file
* Views field handler for simplenews_category.opt_inout.
*/
/**
* Provide translatable simplenews_category.opt_inout Options.
*/
class simplenews_handler_field_category_opt_inout extends views_handler_field {
function render($values) {
$opt = array(
'hidden' => t('Hidden'),
'single' => t('Single opt-in'),
'double' => t('Double opt-in'),
);
return check_plain($opt[$values->{$this->field_alias}]);
}
}

View File

@@ -0,0 +1,18 @@
<?php
/**
* @file
* Views field handler for simplenews newsletter priority.
*/
/**
* Display simplenews newsletter priorities. See simplenews.admin.inc
* @ row 1427 for definition of the simplenews_get_priority() function
*/
class simplenews_handler_field_newsletter_priority extends views_handler_field {
function render($values) {
module_load_include('inc', 'simplenews', 'includes/simplenews.admin');
$p = simplenews_get_priority();
return check_plain($p[$values->{$this->field_alias}]);
}
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* Field handler to present a link to close or open commenting on a node.
*/
class simplenews_handler_field_newsletter_send extends views_handler_field_node_link {
/**
* Renders the link.
*/
function render_link($node, $values) {
// Ensure user has access to delete this node.
if (!user_access('send newsletter')) {
return;
}
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['query'] = drupal_get_destination();
if ($node->simplenews->status == SIMPLENEWS_STATUS_SEND_NOT) {
$this->options['alter']['path'] = "node/$node->nid/simplenews";
$text = !empty($this->options['text']) ? $this->options['text'] : t('Send newsletter');
return $text;
}
else {
return;
}
}
}

View File

@@ -0,0 +1,23 @@
<?php
/**
* @file
* Views handler for simplenews sent status.
*/
/**
* Display newsletter sent status.
*/
class simplenews_handler_field_newsletter_status extends views_handler_field {
function render($values) {
switch ($values->{$this->field_alias}) {
case SIMPLENEWS_STATUS_SEND_NOT:
default:
return t('Not sent');
case SIMPLENEWS_STATUS_SEND_PENDING:
return t('Pending');
case SIMPLENEWS_STATUS_SEND_READY:
return t('Sent');
}
}
}

View File

@@ -0,0 +1,18 @@
<?php
/**
* @file
* Views handler for simplenews field simplewnews_category.hyperlinks.
*/
/**
* Display HTML Mail Hyperlinks position settings.
*/
class simplenews_handler_filter_category_hyperlinks extends views_handler_filter_in_operator {
function get_value_options() {
$this->value_options = array(
0 => t('Bottom'),
1 => t('Inline'),
);
}
}

View File

@@ -0,0 +1,20 @@
<?php
/**
* @file
* Views fiter handler for simplenews_category.new_account.
*/
/**
* Provide translatable simplenews_category.new_account Options.
*/
class simplenews_handler_filter_category_new_account extends views_handler_filter_in_operator {
function get_value_options() {
$this->value_options = array(
'none' => t('None'),
'on' => t('Default on'),
'off' => t('Default off'),
'silent' => t('invisible Subscrition'),
);
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* @file
* Views fiter handler for simplenews_category.opt_inout.
*/
/**
* Provide translatable simplenews_category.opt_inout Options.
*/
class simplenews_handler_filter_category_opt_inout extends views_handler_filter_in_operator {
function get_value_options() {
$this->value_options = array(
'hidden' => t('Hidden'),
'single' => t('Single opt-in'),
'double' => t('Double opt-in'),
);
}
}

View File

@@ -0,0 +1,18 @@
<?php
/**
* @file
* Views filter handler for simplenews newsletter priorities
*/
/*
* Display simplenews newsletter priorities. See simplenews.admin.inc
* @row 1427 for definition of the simplenews_get_priority() function
*/
class simplenews_handler_filter_newsletter_priority extends views_handler_filter_in_operator {
function get_value_options() {
module_load_include('inc', 'simplenews', 'includes/simplenews.admin');
$this->value_options = simplenews_get_priority();
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* @file
* Views filter for simplenews sent status.
*/
/**
* Filter based on newsletter sent status.
*/
class simplenews_handler_filter_newsletter_status extends views_handler_filter_in_operator {
function get_value_options() {
$this->value_options = array(
SIMPLENEWS_STATUS_SEND_NOT => t('Not sent'),
SIMPLENEWS_STATUS_SEND_PENDING => t('Pending'),
SIMPLENEWS_STATUS_SEND_READY => t('Sent'),
);
}
}