Plugin Directory

Changeset 1572556


Ignore:
Timestamp:
01/11/2017 03:06:08 PM (9 years ago)
Author:
crosstec
Message:

Fixed various php7 related issues

Location:
breezing-forms/trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • breezing-forms/trunk/BreezingFormsWidget.php

    r1266771 r1572556  
    11<?php
    2 // no translations yet, let's do it quick and dirty for now
    3 $breezingforms_widget_description = 'Display a BreezingForms form';
    4 if( WPLANG == 'de-DE' ){
    5     $breezingforms_widget_description = 'Zeige ein BreezingForms Formular';
    6 }
    7 $breezingforms_widget_title = 'Widget Title';
    8 if( WPLANG == 'de-DE' ){
    9     $breezingforms_widget_title = 'Widget Titel';
    10 }
    11 $breezingforms_widget_formname = 'Formname';
    12 if( WPLANG == 'de-DE' ){
    13     $breezingforms_widget_formname = 'Formularname';
    14 }
    15 $breezingforms_widget_iframe = 'Run in iFrame';
    16 if( WPLANG == 'de-DE' ){
    17     $breezingforms_widget_iframe = 'Im iFrame laden';
    18 }
    19 $breezingforms_widget_iframe_autoheight = 'iFrame Autoheight';
    20 if( WPLANG == 'de-DE' ){
    21     $breezingforms_widget_iframe_autoheight = 'iFrame Automatische Höhe';
    22 }
    23 $breezingforms_widget_iframe_height = 'iFrame height';
    24 if( WPLANG == 'de-DE' ){
    25     $breezingforms_widget_iframe_height = 'iFrame Höhe';
    26 }
    27 $breezingforms_widget_iframe_width = 'iFrame width';
    28 if( WPLANG == 'de-DE' ){
    29     $breezingforms_widget_iframe_width = 'iFrame Breite';
     2if(defined('WPLANG')) {
     3    // no translations yet, let's do it quick and dirty for now
     4    $breezingforms_widget_description = 'Display a BreezingForms form';
     5    if( WPLANG == 'de_DE' ){
     6        $breezingforms_widget_description = 'Zeige ein BreezingForms Formular';
     7    }
     8    $breezingforms_widget_title = 'Widget Title';
     9    if( WPLANG == 'de_DE' ){
     10        $breezingforms_widget_title = 'Widget Titel';
     11    }
     12    $breezingforms_widget_formname = 'Formname';
     13    if( WPLANG == 'de_DE' ){
     14        $breezingforms_widget_formname = 'Formularname';
     15    }
     16    $breezingforms_widget_iframe = 'Run in iFrame';
     17    if( WPLANG == 'de_DE' ){
     18        $breezingforms_widget_iframe = 'Im iFrame laden';
     19    }
     20    $breezingforms_widget_iframe_autoheight = 'iFrame Autoheight';
     21    if( WPLANG == 'de_DE' ){
     22        $breezingforms_widget_iframe_autoheight = 'iFrame Automatische Höhe';
     23    }
     24    $breezingforms_widget_iframe_height = 'iFrame height';
     25    if( WPLANG == 'de_DE' ){
     26        $breezingforms_widget_iframe_height = 'iFrame Höhe';
     27    }
     28    $breezingforms_widget_iframe_width = 'iFrame width';
     29    if( WPLANG == 'de_DE' ){
     30        $breezingforms_widget_iframe_width = 'iFrame Breite';
     31    }
     32
    3033}
    3134
     
    3336class BreezingFormsWidget extends WP_Widget {
    3437
    35         static $did_script = false;
    36    
    37     function BreezingFormsWidget() {
     38        public function __construct() {
    3839                global $breezingforms_widget_description;
    3940               
    40         $widget_ops = array( 'description' => $breezingforms_widget_description );
    41         $this->WP_Widget(false, 'BreezingForms', $widget_ops);
    42                
    43                 add_action('wp_enqueue_scripts', array($this, 'scripts'));
    44     }
     41        $widget_ops = array(
     42            'description' => $breezingforms_widget_description
     43        );
     44        parent::__construct(false, 'BreezingForms', $widget_ops);
     45        //$this->WP_Widget(false, 'BreezingForms', $widget_ops);
     46
     47    }
    4548
    4649    function widget( $args, $instance ) {
  • breezing-forms/trunk/breezingforms.php

    r1332718 r1572556  
    44Plugin URI: http://crosstec.de/en/wordpress-forms-download.html
    55Description: A professional forms plugin for wordpress.
    6 Version: 1.2.7.38
     6Version: 1.2.7.39
    77Author: Crosstec GmbH & Co. KG
    88Author URI: http://crosstec.de
     
    2626    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    2727*/
     28if(!defined('WPLANG')){
     29    define('WPLANG', get_locale());
     30}
    2831
    2932define('BF_PLUGINS_URL', plugins_url());
     
    250253add_action('admin_menu', 'breezingforms_admin_init');
    251254function breezingforms_admin_init(){
    252     add_object_page('BreezingForms', 'BreezingForms', 'administrator', 'breezingforms', 'breezingforms_admin', BF_PLUGINS_URL . '/'.BF_FOLDER.'/breezingforms-icon.png');
     255    add_menu_page('BreezingForms', 'BreezingForms', 'administrator', 'breezingforms', 'breezingforms_admin', BF_PLUGINS_URL . '/'.BF_FOLDER.'/breezingforms-icon.png');
    253256    add_submenu_page('breezingforms', 'BreezingForms', 'Records', 'administrator', 'admin.php?page=breezingforms&act=recordmanagement');
    254257    add_submenu_page('breezingforms', 'BreezingForms', 'Forms', 'administrator', 'admin.php?page=breezingforms&act=manageforms');
  • breezing-forms/trunk/platform/administrator/components/com_breezingforms/admin/import.class.php

    r762616 r1572556  
    2525    var $warnings       = NULL;     // warnings emitted
    2626
    27     function ff_importPackage()
     27    function __construct()
    2828    {
    2929        parent::ff_xmlPackage();
  • breezing-forms/trunk/platform/administrator/components/com_breezingforms/admin/install.class.php

    r762616 r1572556  
    5454    } // exec_sql
    5555
    56     function chmodRecursive($path, $filemode=NULL, $dirmode=NULL)
     56    static function chmodRecursive($path, $filemode=NULL, $dirmode=NULL)
    5757    {
    5858        $ret = TRUE;
     
    8484    } // chmodRecursive
    8585
    86     function testdb($table, $column)
     86    static function testdb($table, $column)
    8787    {
    8888        global $database;
     
    9696    } // testdb
    9797
    98     function step2($option)
     98    static function step2($option)
    9999    {
    100100        global $ff_mospath, $ff_admpath, $ff_compath, $mosConfig_fileperms;
     
    146146    } // step2
    147147
    148     function step3($option)
     148    static function step3($option)
    149149    {
    150150        global $ff_admpath,$mainframe, $ff_config, $errors, $errmode;
  • breezing-forms/trunk/platform/administrator/components/com_breezingforms/admin/install.html.php

    r762616 r1572556  
    1111class HTML_facileFormsInstaller
    1212{
    13     function step2($option, $release)
     13    static function step2($option, $release)
    1414    {
    1515?>
     
    9191
    9292
    93     function step3($option, &$errors)
     93    static function step3($option, &$errors)
    9494    {
    9595?>
  • breezing-forms/trunk/platform/administrator/components/com_breezingforms/libraries/crosstec/functions/helpers.php

    r1004513 r1572556  
    146146}
    147147   
    148 function bf_createMail( $from='', $fromname='', $subject, $body ) {
    149 
    150     jimport('joomla.version');
    151         $version = new JVersion();
    152         $version = $version->getShortVersion();
    153    
    154         $_mailfrom = '';
    155         $_fromname = '';
    156        
    157         if(version_compare($version, '3.0', '<')){
    158             $_mailfrom = JFactory::getConfig()->getValue('config.mailfrom','');
    159             $_fromname = JFactory::getConfig()->getValue('config.fromname','');
    160         }else{
    161             $_mailfrom = JFactory::getConfig()->get('mailfrom','');
    162             $_fromname = JFactory::getConfig()->get('fromname','');
    163         }
    164    
     148function bf_createMail( $from = '', $fromname = '', $subject, $body, $alt_sender = '' ) {
     149
     150    jimport( 'joomla.version' );
     151    $version = new JVersion();
     152    $version = $version->getShortVersion();
     153
     154    $_mailfrom = '';
     155    $_fromname = '';
     156
     157    if ( version_compare( $version, '3.0', '<' ) ) {
     158        $_mailfrom = JFactory::getConfig()->getValue( 'config.mailfrom', '' );
     159        $_fromname = JFactory::getConfig()->getValue( 'config.fromname', '' );
     160    } else {
     161        $_mailfrom = JFactory::getConfig()->get( 'mailfrom', '' );
     162        $_fromname = JFactory::getConfig()->get( 'fromname', '' );
     163    }
     164
    165165    $mail = JFactory::getMailer();
    166        
    167         $mail->setSender(array($_mailfrom, trim($_fromname)));
    168         $mail->setSubject($subject);
    169         $mail->setBody($body);
    170        
    171         $mail->addReplyTo( array( $from ? $from : $_mailfrom, $fromname ? $fromname : $_fromname ) );
    172        
     166
     167    /*
     168    try {
     169
     170        $mail->setSender( array( $alt_sender ? $alt_sender : $_mailfrom, $fromname ? $fromname : $_fromname ) );
     171
     172    } catch ( Exception $e ) {
     173
     174    }*/
     175
     176    $mail->setSubject( $subject );
     177    $mail->setBody( $body );
     178
     179    $prev_from = $alt_sender ? $alt_sender : $_mailfrom;
     180
     181    try {
     182
     183        $mail->SetFrom( $prev_from, $fromname ? $fromname : $_fromname );
     184        //$mail->SetFrom( $from ? $from : '', $fromname ? $fromname : '' );
     185
     186    } catch ( Exception $e ) {
     187
     188    }
     189
     190    try {
     191
     192        if( $from && $from != $prev_from )
     193        {
     194
     195            if ( version_compare( $version, '3.0', '<' ) )
     196            {
     197
     198                $mail->addReplyTo( array( $from, $fromname ? $fromname : $_fromname ) );
     199
     200            }
     201            else
     202            {
     203
     204                $newfrom     = $from ? $from : $_mailfrom;
     205                $newfromname = $fromname ? $fromname : $_fromname;
     206
     207                if ( ! empty( $newfrom ) )
     208                {
     209
     210                    $mail->addReplyTo( $from, $fromname ? $fromname : $_fromname );
     211                }
     212            }
     213
     214        }
     215
     216    } catch ( Exception $e ) {
     217
     218    }
     219
    173220    return $mail;
    174221}
  • breezing-forms/trunk/platform/administrator/components/com_breezingforms/libraries/mailchimp/MCAPI.class.php

    r762616 r1572556  
    4444     * @param string $secure Whether or not this should use a secure connection
    4545     */
    46     function MCAPI($apikey, $secure=false) {
     46    function __construct($apikey, $secure=false) {
    4747        //do more "caching" of the uuid for those people that keep instantiating this...
    4848        $this->secure = $secure;
     
    17211721     */
    17221722    function callServer($method, $params) {
    1723         $dc = "us1";
    1724         if (strstr($this->api_key,"-")){
    1725             list($key, $dc) = explode("-",$this->api_key,2);
     1723        $dc = "us1";
     1724        if (strstr($this->api_key,"-")){
     1725            list($key, $dc) = explode("-",$this->api_key,2);
    17261726            if (!$dc) $dc = "us1";
    17271727        }
    17281728        $host = $dc.".".$this->apiUrl["host"];
    1729         $params["apikey"] = $this->api_key;
     1729        $params["apikey"] = $this->api_key;
    17301730
    17311731        $this->errorMessage = "";
     
    17761776        $serial = unserialize($response);
    17771777        if($response && $serial === false) {
    1778             $response = array("error" => "Bad Response.  Got This: " . $response, "code" => "-99");
     1778            $response = array("error" => "Bad Response.  Got This: " . $response, "code" => "-99");
    17791779        } else {
    1780             $response = $serial;
     1780            $response = $serial;
    17811781        }
    17821782        if(is_array($response) && isset($response["error"])) {
  • breezing-forms/trunk/platform/components/com_breezingforms/facileforms.class.php

    r1332718 r1572556  
    1111global $ff_version, $ff_resnames, $ff_request, $ff_target;
    1212
    13 $ff_version = '1.2.7.38 FREE VERSION (build 278)';
     13$ff_version = '1.2.7.39 FREE VERSION (build 279)';
    1414$ff_target  = 0;
    1515
     
    246246        var $cellnewline = 1;
    247247
    248     function facileFormsConf()
     248    function __construct()
    249249    {
    250250        $this->load();
     
    365365    var $params         = null;     // additional parameters
    366366
    367     function facileFormsMenus(&$db)
     367    function __construct(&$db)
    368368    {
    369369        parent::__construct('#__facileforms_compmenus', 'id', $db);
     
    471471        var $mb_email_custom_html = null;
    472472   
    473     function facileFormsForms(&$db)
     473    function __construct(&$db)
    474474    {
    475475        parent::__construct('#__facileforms_forms', 'id', $db);
     
    572572    var $mailbackfile       = null;
    573573   
    574     function facileFormsElements(&$db)
     574    function __construct(&$db)
    575575    {
    576576        parent::__construct('#__facileforms_elements', 'id', $db);
     
    606606    var $code           = null;     // the code
    607607
    608     function facileFormsScripts(&$db)
     608    function __construct(&$db)
    609609    {
    610610        parent::__construct('#__facileforms_scripts', 'id', $db);
     
    640640    var $code           = null;     // the code
    641641
    642     function facileFormsPieces(&$db)
     642    function __construct(&$db)
    643643    {
    644644        parent::__construct('#__facileforms_pieces', 'id', $db);
     
    682682    var $paypal_download_tries = null;
    683683   
    684     function facileFormsRecords(&$db)
     684    function __construct(&$db)
    685685    {
    686686        parent::__construct('#__facileforms_records', 'id', $db);
     
    714714    var $value          = null;     // data value
    715715
    716     function facileFormsSubrecords(&$db)
     716    function __construct(&$db)
    717717    {
    718718        parent::__construct('#__facileforms_subrecords', 'id', $db);
     
    751751    var $comp           = null;     // complied value: array of array(type, value/code)
    752752
    753     function facileFormsQuerycols()
     753    function __construct()
    754754    {
    755755        $this->title    = '';
  • breezing-forms/trunk/platform/components/com_breezingforms/facileforms.process.php

    r774450 r1572556  
    481481    public $isMobile = false;
    482482   
    483     function HTML_facileFormsProcessor(
     483    function __construct(
    484484    $runmode, // _FF_RUNMODE_FRONTEND, ..._BACKEND, ..._PREVIEW
    485485            $inframe, // run in iframe
  • breezing-forms/trunk/platform/components/com_breezingforms/facileforms.xml.php

    r762621 r1572556  
    2121    var $params     = NULL;     // parameters
    2222
    23     function ff_xmlPackage()
     23    function __construct()
    2424    {
    2525        // constructor
  • breezing-forms/trunk/platform/libraries/joomla/html/html/select.php

    r762627 r1572556  
    11<?php
    22/**
    3  * @package     Joomla.Platform
     3 * @package     Joomla.Libraries
    44 * @subpackage  HTML
    55 *
    6  * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
     6 * @copyright   Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
    77 * @license     GNU General Public License version 2 or later; see LICENSE
    88 */
    99
    1010defined('JPATH_PLATFORM') or die;
     11
     12use Joomla\Utilities\ArrayHelper;
    1113
    1214/**
    1315 * Utility class for creating HTML select lists
    1416 *
    15  * @package     Joomla.Platform
    16  * @subpackage  HTML
    17  * @since       11.1
     17 * @since  1.5
    1818 */
    1919abstract class JHtmlSelect
     
    2323     *
    2424     * @var     array
    25      * @since   11.1
    26      */
    27     static protected $_optionDefaults = array(
    28         'option' => array('option.attr' => null, 'option.disable' => 'disable', 'option.id' => null, 'option.key' => 'value',
    29             'option.key.toHtml' => true, 'option.label' => null, 'option.label.toHtml' => true, 'option.text' => 'text',
    30             'option.text.toHtml' => true));
     25     * @since   1.5
     26     */
     27    protected static $optionDefaults = array(
     28        'option' => array(
     29            'option.attr' => null,
     30            'option.disable' => 'disable',
     31            'option.id' => null,
     32            'option.key' => 'value',
     33            'option.key.toHtml' => true,
     34            'option.label' => null,
     35            'option.label.toHtml' => true,
     36            'option.text' => 'text',
     37            'option.text.toHtml' => true,
     38            'option.class' => 'class',
     39            'option.onclick' => 'onclick',
     40        ),
     41    );
    3142
    3243    /**
     
    3445     *
    3546     * @param   string  $name      The value of the HTML name attribute
    36      * @param   array   $attribs   Additional HTML attributes for the <select> tag
     47     * @param   array   $attribs   Additional HTML attributes for the `<select>` tag
    3748     * @param   string  $selected  The key that is selected
    3849     * @param   string  $yes       Language key for Yes
    3950     * @param   string  $no        Language key for no
    40      * @param   string  $id        The id for the field
     51     * @param   mixed   $id        The id for the field or false for no id
    4152     *
    4253     * @return  string  HTML for the radio list
    4354     *
    44      * @since   11.1
     55     * @since   1.5
    4556     * @see     JFormFieldRadio
    4657     */
    47     public static function booleanlist($name, $attribs = null, $selected = null, $yes = 'JYES', $no = 'JNO', $id = false)
     58    public static function booleanlist($name, $attribs = array(), $selected = null, $yes = 'JYES', $no = 'JNO', $id = false)
    4859    {
    4960        $arr = array(JHtml::_('select.option', '0', JText::_($no)), JHtml::_('select.option', '1', JText::_($yes)));
     61
    5062        return JHtml::_('select.radiolist', $arr, $name, $attribs, 'value', 'text', (int) $selected, $id);
    5163    }
     
    5668     * @param   array    $data       An array of objects, arrays, or scalars.
    5769     * @param   string   $name       The value of the HTML name attribute.
    58      * @param   mixed    $attribs    Additional HTML attributes for the <select> tag. This
     70     * @param   mixed    $attribs    Additional HTML attributes for the `<select>` tag. This
    5971     *                               can be an array of attributes, or an array of options. Treated as options
    6072     *                               if it is the last argument passed. Valid options are:
     
    7688     * @return  string  HTML for the select list.
    7789     *
    78      * @since   11.1
     90     * @since   1.5
    7991     */
    8092    public static function genericlist($data, $name, $attribs = null, $optKey = 'value', $optText = 'text', $selected = null, $idtag = false,
     
    8395        // Set default options
    8496        $options = array_merge(JHtml::$formatOptions, array('format.depth' => 0, 'id' => false));
     97
    8598        if (is_array($attribs) && func_num_args() == 3)
    8699        {
     
    98111            $options['list.select'] = $selected;
    99112        }
     113
    100114        $attribs = '';
     115
    101116        if (isset($options['list.attr']))
    102117        {
    103118            if (is_array($options['list.attr']))
    104119            {
    105                 $attribs = JArrayHelper::toString($options['list.attr']);
     120                $attribs = ArrayHelper::toString($options['list.attr']);
    106121            }
    107122            else
     
    109124                $attribs = $options['list.attr'];
    110125            }
     126
    111127            if ($attribs != '')
    112128            {
     
    116132
    117133        $id = $options['id'] !== false ? $options['id'] : $name;
    118         $id = str_replace(array('[', ']'), '', $id);
     134        $id = str_replace(array('[', ']', ' '), '', $id);
    119135
    120136        $baseIndent = str_repeat($options['format.indent'], $options['format.depth']++);
    121137        $html = $baseIndent . '<select' . ($id !== '' ? ' id="' . $id . '"' : '') . ' name="' . $name . '"' . $attribs . '>' . $options['format.eol']
    122             . self::options($data, $options) . $baseIndent . '</select>' . $options['format.eol'];
     138            . static::options($data, $options) . $baseIndent . '</select>' . $options['format.eol'];
     139
     140        return $html;
     141    }
     142
     143    /**
     144     * Method to build a list with suggestions
     145     *
     146     * @param   array    $data       An array of objects, arrays, or values.
     147     * @param   string   $optKey     The name of the object variable for the option value. If
     148     *                               set to null, the index of the value array is used.
     149     * @param   string   $optText    The name of the object variable for the option text.
     150     * @param   mixed    $idtag      Value of the field id or null by default
     151     * @param   boolean  $translate  True to translate
     152     *
     153     * @return  string  HTML for the select list
     154     *
     155     * @since       3.2
     156     * @deprecated  4.0  Just create the `<datalist>` directly instead
     157     */
     158    public static function suggestionlist($data, $optKey = 'value', $optText = 'text', $idtag = null, $translate = false)
     159    {
     160        // Log deprecated message
     161        JLog::add(
     162            'JHtmlSelect::suggestionlist() is deprecated. Create the <datalist> tag directly instead.',
     163            JLog::WARNING,
     164            'deprecated'
     165        );
     166
     167        // Note: $idtag is requried but has to be an optional argument in the funtion call due to argument order
     168        if (!$idtag)
     169        {
     170            throw new InvalidArgumentException('$idtag is a required argument in deprecated JHtmlSelect::suggestionlist');
     171        }
     172
     173        // Set default options
     174        $options = array_merge(JHtml::$formatOptions, array('format.depth' => 0, 'id' => false));
     175
     176        // Get options from the parameters
     177        $options['id'] = $idtag;
     178        $options['list.attr'] = null;
     179        $options['list.translate'] = $translate;
     180        $options['option.key'] = $optKey;
     181        $options['option.text'] = $optText;
     182        $options['list.select'] = null;
     183
     184        $id = ' id="' . $idtag . '"';
     185
     186        $baseIndent = str_repeat($options['format.indent'], $options['format.depth']++);
     187        $html = $baseIndent . '<datalist' . $id . '>' . $options['format.eol']
     188            . static::options($data, $options) . $baseIndent . '</datalist>' . $options['format.eol'];
     189
    123190        return $html;
    124191    }
     
    152219     * @return  string  HTML for the select list
    153220     *
    154      * @since   11.1
    155      *
    156      * @throws  JException If a group has unprocessable contents.
     221     * @since   1.5
     222     * @throws  RuntimeException If a group has contents that cannot be processed.
    157223     */
    158224    public static function groupedlist($data, $name, $options = array())
     
    177243            if (is_array($options['list.attr']))
    178244            {
    179                 $attribs = JArrayHelper::toString($options['list.attr']);
     245                $attribs = ArrayHelper::toString($options['list.attr']);
    180246            }
    181247            else
     
    183249                $attribs = $options['list.attr'];
    184250            }
     251
    185252            if ($attribs != '')
    186253            {
     
    190257
    191258        $id = $options['id'] !== false ? $options['id'] : $name;
    192         $id = str_replace(array('[', ']'), '', $id);
     259        $id = str_replace(array('[', ']', ' '), '', $id);
    193260
    194261        // Disable groups in the options.
     
    214281                // Sub-list is in an element of an array.
    215282                $subList = $group[$options['group.items']];
     283
    216284                if (isset($group[$options['group.label']]))
    217285                {
     
    219287                    $noGroup = false;
    220288                }
     289
    221290                if (isset($options['group.id']) && isset($group[$options['group.id']]))
    222291                {
     
    228297            {
    229298                // Sub-list is in a property of an object
    230                 $subList = $group->$options['group.items'];
    231                 if (isset($group->$options['group.label']))
    232                 {
    233                     $label = $group->$options['group.label'];
     299                $subList = $group->{$options['group.items']};
     300
     301                if (isset($group->{$options['group.label']}))
     302                {
     303                    $label = $group->{$options['group.label']};
    234304                    $noGroup = false;
    235305                }
    236                 if (isset($options['group.id']) && isset($group->$options['group.id']))
    237                 {
    238                     $id = $group->$options['group.id'];
     306
     307                if (isset($options['group.id']) && isset($group->{$options['group.id']}))
     308                {
     309                    $id = $group->{$options['group.id']};
    239310                    $noGroup = false;
    240311                }
     
    242313            else
    243314            {
    244                 throw new JException('Invalid group contents.', 1, E_WARNING);
     315                throw new RuntimeException('Invalid group contents.', 1);
    245316            }
    246317
    247318            if ($noGroup)
    248319            {
    249                 $html .= self::options($subList, $options);
     320                $html .= static::options($subList, $options);
    250321            }
    251322            else
     
    253324                $html .= $groupIndent . '<optgroup' . (empty($id) ? '' : ' id="' . $id . '"') . ' label="'
    254325                    . ($options['group.label.toHtml'] ? htmlspecialchars($label, ENT_COMPAT, 'UTF-8') : $label) . '">' . $options['format.eol']
    255                     . self::options($subList, $options) . $groupIndent . '</optgroup>' . $options['format.eol'];
     326                    . static::options($subList, $options) . $groupIndent . '</optgroup>' . $options['format.eol'];
    256327            }
    257328        }
     
    269340     * @param   integer  $inc       The increment
    270341     * @param   string   $name      The value of the HTML name attribute
    271      * @param   mixed    $attribs   Additional HTML attributes for the <select> tag, an array of
     342     * @param   mixed    $attribs   Additional HTML attributes for the `<select>` tag, an array of
    272343     *                              attributes, or an array of options. Treated as options if it is the last
    273344     *                              argument passed.
     
    277348     * @return  string   HTML for the select list
    278349     *
    279      * @since    11.1
     350     * @since   1.5
    280351     */
    281352    public static function integerlist($start, $end, $inc, $name, $attribs = null, $selected = null, $format = '')
     
    283354        // Set default options
    284355        $options = array_merge(JHtml::$formatOptions, array('format.depth' => 0, 'option.format' => '', 'id' => null));
     356
    285357        if (is_array($attribs) && func_num_args() == 5)
    286358        {
    287359            // Assume we have an options array
    288360            $options = array_merge($options, $attribs);
     361
    289362            // Extract the format and remove it from downstream options
    290363            $format = $options['option.format'];
     
    297370            $options['list.select'] = $selected;
    298371        }
    299         $start = intval($start);
    300         $end = intval($end);
    301         $inc = intval($inc);
     372
     373        $start = (int) $start;
     374        $end   = (int) $end;
     375        $inc   = (int) $inc;
    302376
    303377        $data = array();
     378
    304379        for ($i = $start; $i <= $end; $i += $inc)
    305380        {
     
    320395     * @param   string  $optText  The returned object property name for the text
    321396     *
    322      * @return  object
    323      *
    324      * @deprecated  12.1  Use JHtmlSelect::groupedList()
     397     * @return  stdClass
     398     *
     399     * @deprecated  4.0  Use JHtmlSelect::groupedList()
    325400     * @see     JHtmlSelect::groupedList()
    326      * @since   11.1
     401     * @since   1.5
    327402     */
    328403    public static function optgroup($text, $optKey = 'value', $optText = 'text')
    329404    {
    330         // Deprecation warning.
    331         JLog::add('JSelect::optgroup is deprecated.', JLog::WARNING, 'deprecated');
     405        JLog::add('JHtmlSelect::optgroup() is deprecated, use JHtmlSelect::groupedList() instead.', JLog::WARNING, 'deprecated');
    332406
    333407        // Set initial state
     
    381455     * @param   boolean  $disable  Not used.
    382456     *
    383      * @return  object
    384      *
    385      * @since   11.1
     457     * @return  stdClass
     458     *
     459     * @since   1.5
    386460     */
    387461    public static function option($value, $text = '', $optKey = 'value', $optText = 'text', $disable = false)
    388462    {
    389         $options = array('attr' => null, 'disable' => false, 'option.attr' => null, 'option.disable' => 'disable', 'option.key' => 'value',
    390             'option.label' => null, 'option.text' => 'text');
     463        $options = array(
     464            'attr' => null,
     465            'disable' => false,
     466            'option.attr' => null,
     467            'option.disable' => 'disable',
     468            'option.key' => 'value',
     469            'option.label' => null,
     470            'option.text' => 'text',
     471        );
     472
    391473        if (is_array($optKey))
    392474        {
     
    401483            $options['disable'] = $disable;
    402484        }
    403         $obj = new JObject;
    404         $obj->$options['option.key'] = $value;
    405         $obj->$options['option.text'] = trim($text) ? $text : $value;
     485
     486        $obj = new stdClass;
     487        $obj->{$options['option.key']}  = $value;
     488        $obj->{$options['option.text']} = trim($text) ? $text : $value;
    406489
    407490        /*
     
    410493         */
    411494        $hasProperty = $options['option.label'] !== null;
     495
    412496        if (isset($options['label']))
    413497        {
     
    417501        elseif ($hasProperty)
    418502        {
    419             $obj->$options['option.label'] = '';
     503            $obj->{$options['option.label']} = '';
    420504        }
    421505
     
    423507        if ($options['attr'] !== null)
    424508        {
    425             $obj->$options['option.attr'] = $options['attr'];
     509            $obj->{$options['option.attr']} = $options['attr'];
    426510        }
    427511
     
    429513        if ($options['disable'] !== null)
    430514        {
    431             $obj->$options['option.disable'] = $options['disable'];
    432         }
     515            $obj->{$options['option.disable']} = $options['disable'];
     516        }
     517
    433518        return $obj;
    434519    }
     
    475560     * @return  string  HTML for the select list
    476561     *
    477      * @since   11.1
     562     * @since   1.5
    478563     */
    479564    public static function options($arr, $optKey = 'value', $optText = 'text', $selected = null, $translate = false)
     
    481566        $options = array_merge(
    482567            JHtml::$formatOptions,
    483             self::$_optionDefaults['option'],
     568            static::$optionDefaults['option'],
    484569            array('format.depth' => 0, 'groups' => true, 'list.select' => null, 'list.translate' => false)
    485570        );
     
    508593            $label = '';
    509594            $id = '';
     595
    510596            if (is_array($element))
    511597            {
    512598                $key = $options['option.key'] === null ? $elementKey : $element[$options['option.key']];
    513599                $text = $element[$options['option.text']];
     600
    514601                if (isset($element[$options['option.attr']]))
    515602                {
    516603                    $attr = $element[$options['option.attr']];
    517604                }
     605
    518606                if (isset($element[$options['option.id']]))
    519607                {
    520608                    $id = $element[$options['option.id']];
    521609                }
     610
    522611                if (isset($element[$options['option.label']]))
    523612                {
    524613                    $label = $element[$options['option.label']];
    525614                }
     615
    526616                if (isset($element[$options['option.disable']]) && $element[$options['option.disable']])
    527617                {
     
    531621            elseif (is_object($element))
    532622            {
    533                 $key = $options['option.key'] === null ? $elementKey : $element->$options['option.key'];
    534                 $text = $element->$options['option.text'];
    535                 if (isset($element->$options['option.attr']))
    536                 {
    537                     $attr = $element->$options['option.attr'];
    538                 }
    539                 if (isset($element->$options['option.id']))
    540                 {
    541                     $id = $element->$options['option.id'];
    542                 }
    543                 if (isset($element->$options['option.label']))
    544                 {
    545                     $label = $element->$options['option.label'];
    546                 }
    547                 if (isset($element->$options['option.disable']) && $element->$options['option.disable'])
     623                $key = $options['option.key'] === null ? $elementKey : $element->{$options['option.key']};
     624                $text = $element->{$options['option.text']};
     625
     626                if (isset($element->{$options['option.attr']}))
     627                {
     628                    $attr = $element->{$options['option.attr']};
     629                }
     630
     631                if (isset($element->{$options['option.id']}))
     632                {
     633                    $id = $element->{$options['option.id']};
     634                }
     635
     636                if (isset($element->{$options['option.label']}))
     637                {
     638                    $label = $element->{$options['option.label']};
     639                }
     640
     641                if (isset($element->{$options['option.disable']}) && $element->{$options['option.disable']})
    548642                {
    549643                    $extra .= ' disabled="disabled"';
     644                }
     645
     646                if (isset($element->{$options['option.class']}) && $element->{$options['option.class']})
     647                {
     648                    $extra .= ' class="' . $element->{$options['option.class']} . '"';
     649                }
     650
     651                if (isset($element->{$options['option.onclick']}) && $element->{$options['option.onclick']})
     652                {
     653                    $extra .= ' onclick="' . $element->{$options['option.onclick']} . '"';
    550654                }
    551655            }
     
    557661            }
    558662
    559             // The use of options that contain optgroup HTML elements was
    560             // somewhat hacked for J1.5. J1.6 introduces the grouplist() method
    561             // to handle this better. The old solution is retained through the
    562             // "groups" option, which defaults true in J1.6, but should be
    563             // deprecated at some point in the future.
     663            /*
     664             * The use of options that contain optgroup HTML elements was
     665             * somewhat hacked for J1.5. J1.6 introduces the grouplist() method
     666             * to handle this better. The old solution is retained through the
     667             * "groups" option, which defaults true in J1.6, but should be
     668             * deprecated at some point in the future.
     669             */
    564670
    565671            $key = (string) $key;
     672
    566673            if ($options['groups'] && $key == '<OPTGROUP>')
    567674            {
     
    576683            else
    577684            {
    578                 // if no string after hyphen - take hyphen out
     685                // If no string after hyphen - take hyphen out
    579686                $splitText = explode(' - ', $text, 2);
    580687                $text = $splitText[0];
    581                 if (isset($splitText[1]))
     688
     689                if (isset($splitText[1]) && $splitText[1] != "" && !preg_match('/^[\s]+$/', $splitText[1]))
    582690                {
    583691                    $text .= ' - ' . $splitText[1];
     
    588696                    $label = JText::_($label);
    589697                }
     698
    590699                if ($options['option.label.toHtml'])
    591700                {
    592701                    $label = htmlentities($label);
    593702                }
     703
    594704                if (is_array($attr))
    595705                {
    596                     $attr = JArrayHelper::toString($attr);
     706                    $attr = ArrayHelper::toString($attr);
    597707                }
    598708                else
     
    600710                    $attr = trim($attr);
    601711                }
     712
    602713                $extra = ($id ? ' id="' . $id . '"' : '') . ($label ? ' label="' . $label . '"' : '') . ($attr ? ' ' . $attr : '') . $extra;
     714
    603715                if (is_array($options['list.select']))
    604716                {
    605717                    foreach ($options['list.select'] as $val)
    606718                    {
    607                         $key2 = is_object($val) ? $val->$options['option.key'] : $val;
     719                        $key2 = is_object($val) ? $val->{$options['option.key']} : $val;
     720
    608721                        if ($key == $key2)
    609722                        {
     
    639752     * @param   array    $data       An array of objects
    640753     * @param   string   $name       The value of the HTML name attribute
    641      * @param   string   $attribs    Additional HTML attributes for the <select> tag
     754     * @param   string   $attribs    Additional HTML attributes for the `<select>` tag
    642755     * @param   mixed    $optKey     The key that is selected
    643756     * @param   string   $optText    The name of the object variable for the option value
     
    646759     * @param   boolean  $translate  True if options will be translated
    647760     *
    648      * @return  string HTML for the select list
    649      *
    650      * @since  11.1
     761     * @return  string  HTML for the select list
     762     *
     763     * @since   1.5
    651764     */
    652765    public static function radiolist($data, $name, $attribs = null, $optKey = 'value', $optText = 'text', $selected = null, $idtag = false,
    653766        $translate = false)
    654767    {
    655         reset($data);
    656         $html = '';
    657768
    658769        if (is_array($attribs))
    659770        {
    660             $attribs = JArrayHelper::toString($attribs);
     771            $attribs = ArrayHelper::toString($attribs);
    661772        }
    662773
    663774        $id_text = $idtag ? $idtag : $name;
     775
     776        $html = '<div class="controls">';
    664777
    665778        foreach ($data as $obj)
     
    670783
    671784            $extra = '';
    672             $extra .= $id ? ' id="' . $obj->id . '"' : '';
     785            $id = $id ? $obj->id : $id_text . $k;
     786
    673787            if (is_array($selected))
    674788            {
     
    676790                {
    677791                    $k2 = is_object($val) ? $val->$optKey : $val;
     792
    678793                    if ($k == $k2)
    679794                    {
    680                         $extra .= ' selected="selected"';
     795                        $extra .= ' selected="selected" ';
    681796                        break;
    682797                    }
     
    685800            else
    686801            {
    687                 $extra .= ((string) $k == (string) $selected ? ' checked="checked"' : '');
    688             }
    689             $html .= "\n\t" . '<input type="radio" name="' . $name . '"' . ' id="' . $id_text . $k . '" value="' . $k . '"' . ' ' . $extra . ' '
    690                 . $attribs . '/>' . "\n\t" . '<label for="' . $id_text . $k . '"' . ' id="' . $id_text . $k . '-lbl" class="radiobtn">' . $t
    691                 . '</label>';
    692         }
     802                $extra .= ((string) $k == (string) $selected ? ' checked="checked" ' : '');
     803            }
     804
     805            $html .= "\n\t" . '<label for="' . $id . '" id="' . $id . '-lbl" class="radio">';
     806            $html .= "\n\t\n\t" . '<input type="radio" name="' . $name . '" id="' . $id . '" value="' . $k . '" ' . $extra
     807                . $attribs . ' />' . $t;
     808            $html .= "\n\t" . '</label>';
     809        }
     810
    693811        $html .= "\n";
     812        $html .= '</div>';
     813        $html .= "\n";
     814
    694815        return $html;
    695816    }
    696 
    697817}
  • breezing-forms/trunk/platform/libraries/joomla/registry/registry.php

    r762627 r1572556  
    337337                }
    338338                $node = $node->$nodes[$i];
     339
    339340            }
    340341
    341342            // Get the old value if exists so we can return it
    342             $result = $node->$nodes[$i] = $value;
     343        switch (true)
     344        {
     345            case (is_object($node)):
     346                $result = $node->{$nodes[$i]} = $value;
     347                break;
     348
     349            case (is_array($node)):
     350                $result = $node[$nodes[$i]] = $value;
     351                break;
     352
     353            default:
     354                $result = null;
     355                break;
     356        }
    343357        }
    344358
    345359        return $result;
    346     }
     360
     361    }
     362   
    347363
    348364    /**
  • breezing-forms/trunk/platform/libraries/joomla/string/string.php

    r762627 r1572556  
    2323
    2424// Same for iconv
    25 if (function_exists('iconv') || ((!strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && dl('iconv.so'))))
     25if (PHP_VERSION_ID < 50600 && function_exists('iconv') || ((!strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && dl('iconv.so'))))
    2626{
    2727    // These are settings that can be set inside code
    28     iconv_set_encoding("internal_encoding", "UTF-8");
    29     iconv_set_encoding("input_encoding", "UTF-8");
    30     iconv_set_encoding("output_encoding", "UTF-8");
     28    // iconv_set_encoding("internal_encoding", "UTF-8");
     29    // iconv_set_encoding("input_encoding", "UTF-8");
     30    // iconv_set_encoding("output_encoding", "UTF-8");
     31
     32    iconv_set_encoding('input_encoding', 'UTF-8');
     33    iconv_set_encoding('output_encoding', 'UTF-8');
     34    iconv_set_encoding('internal_encoding', 'UTF-8');
    3135}
     36else
     37{
     38
     39ini_set('default_charset', 'UTF-8');
     40
     41}
     42
    3243
    3344/**
  • breezing-forms/trunk/readme.txt

    r1332718 r1572556  
    44Tags:  builder, captcha form, contact form, contact form builder, contact form plugin, contact form with auto reply, contact forms, contact us form, contacts form plugin, custom contact form, custom forms, email form, feedback, feedback form, feedback forms, form, form builder, form creation, form creator, form manager, form plugin, form to email, form widget, form with recaptcha, forms, forms plugin, Formular, formulario, multiple forms, paypal form, recaptcha contact form, secure form, survey form, web form, widget contact form, wordpress contact form
    55Requires at least: 3.0
    6 Tested up to: 5.0
    7 Stable tag: 1.2.7.38
     6Tested up to: 6.0
     7Stable tag: 1.2.7.39
    88License: GPL 2
    99
     
    158158== Changelog ==
    159159
     160= 1.2.7.39 =
     161 * fixed some php7 related problems, email sending issues and deprecated warnings
     162
    160163= 1.2.7.38 =
    161164 * forced to use mysqli db adapter as it has been removed from newer php versions
Note: See TracChangeset for help on using the changeset viewer.