Plugin Directory

Changeset 1328926


Ignore:
Timestamp:
01/15/2016 11:31:11 AM (10 years ago)
Author:
latorante
Message:

Updating to version 3.4.5

Location:
genoo/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • genoo/trunk/Genoo.php

    r1326466 r1328926  
    66    Author URI: http://www.genoo.com/
    77    Author Email: info@genoo.com
    8     Version: 3.4
     8    Version: 3.4.5
    99    License: GPLv2
    1010    Text Domain: genoo
  • genoo/trunk/GenooInit.php

    r1326466 r1328926  
    5656        define('GENOO_REFRESH', sha1('added-new-js-css'));
    5757        define('GENOO_DOMAIN', '//api.genoo.com');
     58        define('GENOO_DEV', apply_filters('wpmktengine_dev', FALSE));
    5859        // start the engine last file to require, rest is auto
    5960        // custom auto loader, PSR-0 Standard
  • genoo/trunk/libs/Genoo/Admin.php

    r1326466 r1328926  
    448448                        'label' => __('Button Hover Image', 'genoo')
    449449                    ),
     450                    array(
     451                        'type' => 'text',
     452                        'label' => __('Button CSS ID', 'wpmktengine'),
     453                    ),
     454                    array(
     455                        'type' => 'text',
     456                        'label' => __('Button CSS Class', 'wpmktengine'),
     457                    ),
    450458                    $this->repositarySettings->getLumensDropdown($this->repositaryLumens)
    451459                )
  • genoo/trunk/libs/Genoo/Api.php

    r1326466 r1328926  
    432432        // leads
    433433        $result = $this->call(self::POST_STREAM_TYPES, array(
    434             'name' => (string)$name,
    435             'description' => $description,
     434            array(
     435                'name' => (string)$name,
     436                'description' => $description,
     437            )
    436438        ));
    437439        // return
    438         if((is_object($result)) && (isset($result->result)) && ($result->result == 'success')){
    439             return TRUE;
    440         }
     440        if(is_array($result) && (isset($result[0]))){
     441            if(is_object($result[0]) && (isset($result[0]->result)) && ($result[0]->result == 'success')){
     442                return TRUE;
     443            } else {
     444                return FALSE;
     445            }
     446        };
    441447        return FALSE;
     448    }
     449
     450
     451    /**
     452     * Stream type full as an array
     453     *
     454     * @param array $array
     455     * @return bool
     456     * @throws ApiException
     457     */
     458
     459    public function setStreamTypes($array = array())
     460    {
     461        if(empty($array) || !is_array($array)){
     462            throw new \InvalidArgumentException(__('setStreamTypes accepts only non-empty array as an argument.', 'genoo'));
     463        }
     464        return $this->call(self::POST_STREAM_TYPES, $array);
    442465    }
    443466
     
    863886            // prep action and lastQuery
    864887            $prepAction = $action;
    865             $prepUrl = (self::DEV ? self::URL_DEV : self::URL) . str_replace(array('[A]','[S]', '[P]'), '', $action);
     888            $prepUrl = (GENOO_DEV ? self::URL_DEV : self::URL) . str_replace(array('[A]','[S]', '[P]'), '', $action);
    866889            // build query arguments
    867890            if(Strings::endsWith($prepAction, "[S]")){
  • genoo/trunk/libs/Genoo/CTA.php

    r1287280 r1328926  
    8282    /** @var bool */
    8383    public $followOriginalUrl = false;
     84    /** @var  */
     85    public $button_id;
     86    /** @var  */
     87    public $button_class;
    8488
    8589
     
    186190        $this->displayTitle = ($k == true && ($z == 'titledesc' || $z == 'title')) ? true : false;
    187191        $this->displayDesc = ($k == true && ($z == 'titledesc' || $z == 'desc')) ? true : false;
     192        $this->button_id = $this->post->getMeta('button_css_id');
     193        $this->button_class = $this->post->getMeta('button_css_class');
    188194        if($this->isForm){
    189195            $this->followOriginalUrl = $this->post->getMeta('follow_original_return_url') == 0 ? FALSE : TRUE;
  • genoo/trunk/libs/Genoo/ModalWindow.php

    r975155 r1328926  
    6969        $modalWindow->aria = $modalWindow->visibility ? '' : 'hidden aria-hidden="true"';
    7070        $modalWindow->id = self::getModalId($id);
    71         $modalWindow->class = $modalWindow->visibility ? 'visible renderedVisible' : '';
     71        $modalWindow->class = $modalWindow->visibility ? 'visible renderedVisible ' : '';
    7272        $modalWindow->class .= $class;
    7373        $modalWindow->tabIndex = $this->countModals() + 1;
     
    158158     * @param bool $button
    159159     * @param $class
     160     * @param $cssid
    160161     * @return string
    161162     */
    162163
    163     public static function button($title, $id, $button = true, $class = null, $mobile = false)
     164    public static function button($title, $id, $button = true, $class = null, $mobile = false, $cssid = '')
    164165    {
    165166        // prep
     
    179180
    180181        $t = '';
    181         $r .= '<form method="POST" action="'. $link  .'" '.$formTarget.'>';
    182         $r .= '<input type="submit" class="'. $class .'" '. $linkOnClick .' value="'. $title .'">';
     182        $r .= '<form method="POST" id="genooButtonForm" action="'. $link  .'" '.$formTarget.'>';
     183        $r .= '<input type="submit" id="'. $cssid .'" class="'. $class .'" '. $linkOnClick .' value="'. $title .'">';
    183184        $r .= '</form>';
    184185
  • genoo/trunk/libs/Genoo/WidgetCTA.php

    r1314410 r1328926  
    216216        return $instance;
    217217    }
    218 
    219218
    220219    /**
     
    258257                $instance['hideButtonTIME'] = isset($this->shortcodeAtts['time']) ? $this->shortcodeAtts['time'] : 0;
    259258                $instance['followOriginalUrl'] = $this->cta->followOriginalUrl;
     259                $instance['originalCTA'] = $this->cta;
    260260                $isHidePopOver = $instance['isPopOver'] && $instance['popOverHide'] ? TRUE : FALSE;
    261261                if($this->cta->isForm || $this->cta->isClasslist){
     
    284284                            $r .= '<div class="genooInlineBlock '. $alignClass .'">';
    285285                        }
     286                        // Set attributes
     287                        $attributes = '';
     288                        if(isset($this->cta->button_class) || isset($this->cta->button_id)){
     289                            // Added filters to apply custom class and id from plugins or
     290                            // theme modifications
     291                            $attribute_id = apply_filters(
     292                                'wpmktengine_cta_button_css_id',
     293                                $this->cta->button_id,
     294                                $this->id,
     295                                $this->cta
     296                            );
     297                            $attribute_class = apply_filters(
     298                                'wpmktengine_cta_button_css_class',
     299                                $this->cta->button_class,
     300                                $this->id,
     301                                $this->cta
     302                            );
     303                            $attributes = 'id="'. $attribute_id .'" class="'. $attribute_class .'"';
     304                        }
    286305                        $r .= '<form '. $blank .' method="POST" action="'. $this->cta->link .'">';
    287306                            $r .= '<span id="'. $bid .'" '. $hidden .'>';
    288                                 $r .= '<input type="submit" value="'. $this->cta->linkText .'" '. $isAdditionalAttributes .' />';
    289                             $r .= '</span>';
     307                            $r .= '<input '. $attributes .' type="submit" value="'. $this->cta->linkText .'" '. $isAdditionalAttributes .' />';
     308                        $r .= '</span>';
    290309                        $r .= '</form>';
    291310                        if($isInlineBlock){
     
    296315                        }
    297316                    } elseif($this->cta->isClasslist){
    298                         //$r .= print_r($this->cta);
     317
    299318                    }
    300319                    $r .= isset($args['after_widget']) ? $args['after_widget'] : '';
  • genoo/trunk/libs/Genoo/WidgetForm.php

    r1289849 r1328926  
    102102        // Form popover hide button?
    103103        $isHidePopOver = (isset($instance['isPopOver']) && $instance['isPopOver']) && (isset($instance['popOverHide']) && $instance['popOverHide']) ? TRUE : FALSE;
     104        // Attributes with filters
     105        $attribute_id = '';
     106        $attribute_class = '';
     107        if(array_key_exists('originalCTA', $instance)){
     108            if(isset($instance['originalCTA']->button_id) && isset($instance['originalCTA']->button_class)){
     109                $attribute_id = apply_filters(
     110                    'wpmktengine_cta_button_css_id',
     111                    $instance['originalCTA']->button_id,
     112                    $this->id,
     113                    $instance['originalCTA']
     114                );
     115                $attribute_class = apply_filters(
     116                    'wpmktengine_cta_button_css_class',
     117                    $instance['originalCTA']->button_class,
     118                    $this->id,
     119                    $instance['originalCTA']
     120                );
     121            }
     122        }
    104123        // if form is not in modal window
    105124        if($formModal == false){
     
    174193                // Skipping mobile button? Shortcodes cant deal with mobile button now
    175194                if($formHSkipMobileButton){
    176                     $html .= '<span>' . ModalWindow::button($formButton, $this->id, true, 'genooButton form-button-submit') . '<div class="clear"></div></span>';
     195                    $html .= '<span>' . ModalWindow::button($formButton, $this->id, TRUE, 'genooButton form-button-submit ' . $attribute_class, FALSE, $attribute_id) . '<div class="clear"></div></span>';
    177196                } else {
    178                     $html .= '<span class="genooDisplayDesktop">' . ModalWindow::button($formButton, $this->id, true, 'genooButton form-button-submit') . '<div class="clear"></div></span>';
     197                    $html .= '<span class="genooDisplayDesktop">' . ModalWindow::button($formButton, $this->id, TRUE, 'genooButton form-button-submit ' . $attribute_class, FALSE, $attribute_id) . '<div class="clear"></div></span>';
    179198                    if(isset($instance['canHaveMobile']) && $instance['canHaveMobile'] == false){
    180199                    } else {
    181                         $html .= '<span class="genooDisplayMobile">' . ModalWindow::button($formButton, $this->id, false, 'genooButton form-button-submit', true) . '<div class="clear"></div></span>';
     200                        $html .= '<span class="genooDisplayMobile">' . ModalWindow::button($formButton, $this->id, FALSE, 'genooButton form-button-submit ' . $attribute_class, TRUE, $attribute_id) . '<div class="clear"></div></span>';
    182201                    }
    183202                }
     
    187206                // classic html button
    188207                if($is_macIE || $is_winIE || $is_IE || $formHSkipMobileButton){
    189                     $html .= '<span>' . ModalWindow::button($formButton, $this->id, true, 'genooButton form-button-submit') . '</span>';
     208                    $html .= '<span>' . ModalWindow::button($formButton, $this->id, TRUE, 'genooButton form-button-submit ' . $attribute_class, FALSE, $attribute_id) . '</span>';
    190209                } else {
    191                     $html .= '<span class="genooDisplayDesktop">' . ModalWindow::button($formButton, $this->id, true, 'genooButton form-button-submit') . '</span>';
    192                     if(isset($instance['canHaveMobile']) && $instance['canHaveMobile'] == false){
     210                    $html .= '<span class="genooDisplayDesktop">' . ModalWindow::button($formButton, $this->id, TRUE, 'genooButton form-button-submit ' . $attribute_class, FALSE, $attribute_id) . '</span>';
     211                    if(isset($instance['canHaveMobile']) && $instance['canHaveMobile'] == FALSE){
    193212                    } else {
    194                         $html .= '<span class="genooDisplayMobile">' . ModalWindow::button($formButton, $this->id, false, 'genooButton form-button-submit', true) . '</span>';
     213                        $html .= '<span class="genooDisplayMobile">' . ModalWindow::button($formButton, $this->id, FALSE, 'genooButton form-button-submit ' . $attribute_class, TRUE, $attribute_id) . '</span>';
    195214                    }
    196215                }
    197216            }
    198217            // Remove desktop display, if not needed
    199             if(isset($instance['canHaveMobile']) && $instance['canHaveMobile'] == false){
     218            if(isset($instance['canHaveMobile']) && $instance['canHaveMobile'] == FALSE){
    200219                $html = str_replace('class="genooDisplayDesktop"', '', $html);
    201220            }
  • genoo/trunk/readme.txt

    r1326466 r1328926  
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
    8 Stable tag: 3.4
     8Stable tag: 3.4.5
    99
    1010Combine the flexibility of WordPress with the power of Genoo and experience amazing results!
     
    6767
    6868== Changelog ==
     69
     70= 3.4.5 =
     71* Added ability to ad custom CSS class and ID to CTA buttons
    6972
    7073= 3.4.0 =
Note: See TracChangeset for help on using the changeset viewer.