[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.149.24.244: ~ $
<?php
/**
 * SegmentPlugin for phplist.
 *
 * This file is a part of SegmentPlugin.
 *
 * SegmentPlugin 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 3 of the License, or
 * (at your option) any later version.
 * CriteriaPlugin 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.
 *
 * @category  phplist
 *
 * @author    Duncan Cameron
 * @copyright 2014-2016 Duncan Cameron
 * @license   http://www.gnu.org/licenses/gpl.html GNU General Public License, Version 3
 */

/**
 * @category  phplist
 */
class SegmentPlugin_ConditionFactory
{
    private $attributes;
    private $dao;

    /**
     * @param SegmentPlugin_DAO $dao
     * @param array             $attributes
     */
    public function __construct($dao, $attributes)
    {
        $this->dao = $dao;
        $this->attributes = $attributes;
    }

    /**
     * Create a condition type object using a subscriber field or attribute.
     * A field is treated as an attribute id if it is numeric, otherwise as a subscriber field.
     *
     * @param string $field attribute id or subscriber field
     *
     * @return SegmentPlugin_Condition
     */
    public function createConditionType($field, $messageData)
    {
        if (ctype_digit($field)) {
            if (!isset($this->attributes[$field])) {
                throw new SegmentPlugin_ConditionException("attribute id $field does not exist");
            }
            $attr = $this->attributes[$field];

            switch ($attr['type']) {
                case 'select':
                case 'radio':
                    $r = new SegmentPlugin_AttributeConditionSelect($attr);
                    break;
                case 'checkbox':
                    $r = new SegmentPlugin_AttributeConditionCheckbox($attr);
                    break;
                case 'checkboxgroup':
                    $r = new SegmentPlugin_AttributeConditionCheckboxgroup($attr);
                    break;
                case 'textline':
                case 'textarea':
                case 'hidden':
                    $r = new SegmentPlugin_AttributeConditionText($attr);
                    break;
                case 'date':
                    $r = new SegmentPlugin_AttributeConditionDate($attr);
                    break;
                default:
                    throw new SegmentPlugin_ConditionException("unrecognised attribute type {$attr['type']}");
            }
        } else {
            switch ($field) {
                case 'activity':
                    $r = new SegmentPlugin_SubscriberConditionActivity($field);
                    break;
                case 'entered':
                    $r = new SegmentPlugin_SubscriberConditionEntered($field);
                    break;
                case 'listentered':
                    $r = new SegmentPlugin_SubscriberConditionListEntered($field);
                    break;
                case 'email':
                    $r = new SegmentPlugin_SubscriberConditionEmail($field);
                    break;
                case 'id':
                    $r = new SegmentPlugin_SubscriberConditionIdentity($field);
                    break;
                case 'uniqid':
                    $r = new SegmentPlugin_SubscriberConditionIdentity($field);
                    break;
                case 'lists':
                    $r = new SegmentPlugin_SubscriberConditionLists($field);
                    break;
                default:
                    throw new SegmentPlugin_ConditionException("unrecognised subscriber field $field");
            }
        }
        $r->dao = $this->dao;
        $r->messageData = $messageData;

        return $r;
    }

    /**
     * Returns an array of attribute names indexed by attribute id.
     *
     * @return array
     */
    public function attributeFields()
    {
        return array_column($this->attributes, 'name', 'id');
    }

    /**
     * Returns an array of descriptive subscriber fields.
     *
     * @return array
     */
    public function subscriberFields()
    {
        return array(
            'email' => 'Email address',
            'id' => 'Subscriber id',
            'uniqid' => 'Subscriber unique id',
            'entered' => 'Date signed-up to phpList',
            'listentered' => 'Date subscribed to list',
            'lists' => 'List membership',
            'activity' => 'Campaign activity',
        );
    }
}

Filemanager

Name Type Size Permission Actions
Controller Folder 0755
lan Folder 0755
AttributeConditionCheckbox.php File 1.56 KB 0644
AttributeConditionCheckboxgroup.php File 2.37 KB 0644
AttributeConditionDate.php File 2.88 KB 0644
AttributeConditionSelect.php File 1.93 KB 0644
AttributeConditionText.php File 3.39 KB 0644
Condition.php File 2.1 KB 0644
ConditionException.php File 889 B 0644
ConditionFactory.php File 4.59 KB 0644
ControllerFactory.php File 1.54 KB 0644
DAO.php File 6.64 KB 0644
DateConditionBase.php File 4.3 KB 0644
NoConditionsException.php File 892 B 0644
Operator.php File 1.42 KB 0644
SavedSegments.php File 4.18 KB 0644
Segment.php File 7.35 KB 0644
SelectedSubscribersExport.php File 1.39 KB 0644
SubscriberConditionActivity.php File 6.46 KB 0644
SubscriberConditionEmail.php File 3.36 KB 0644
SubscriberConditionEntered.php File 1.73 KB 0644
SubscriberConditionIdentity.php File 1.85 KB 0644
SubscriberConditionListEntered.php File 1.74 KB 0644
SubscriberConditionLists.php File 1.82 KB 0644
ValueException.php File 925 B 0644
class_map.php File 2.45 KB 0644
depends.php File 1.74 KB 0644
export.php File 887 B 0644
script.html File 817 B 0644
sendtab.tpl.php File 3.56 KB 0644
styles.html File 1.14 KB 0644
version.txt File 15 B 0644
viewmessage.tpl.php File 1.51 KB 0644