Plugin Directory

Changeset 1546352


Ignore:
Timestamp:
12/06/2016 10:08:12 AM (9 years ago)
Author:
latorante
Message:

Pushing version 4.5

Location:
genoo/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • genoo/trunk/Genoo.php

    r1527244 r1546352  
    66    Author URI: http://www.genoo.com/
    77    Author Email: info@genoo.com
    8     Version: 4.4
     8    Version: 4.5
    99    License: GPLv2
    1010    Text Domain: genoo
  • genoo/trunk/libs/Genoo/HtmlForm.php

    r1448709 r1546352  
    2929    /** @var */
    3030    private $form_id;
     31    /** @var string */
     32    private $unique;
     33    /** @var string */
     34    private $validator;
    3135    /** @var int */
    3236    static $count = 1;
     
    5458        $this->form = $this->dom->getElementsByTagName("form")->item(0);
    5559        $this->msg = $this->dom->getElementById("genooMsg");
     60        $this->unique = $this->getUniqueId();
    5661        $this->appendClasses();
    5762        $this->appendHTTPSIP();
     
    112117                                        // Has on submit protection, therefore id
    113118                                        $this->form_id = filter_var($element->getAttribute('onsubmit'), FILTER_SANITIZE_NUMBER_INT);
     119                                        $this->validator = $element->getAttribute('onsubmit');
    114120                                    } elseif($element->hasAttribute('onSubmit')){
    115121                                        // Has on submit protection, therefore id
    116122                                        $this->form_id = filter_var($element->getAttribute('onSubmit'), FILTER_SANITIZE_NUMBER_INT);
     123                                        $this->validator = $element->getAttribute('onSubmit');
    117124                                    }
    118125                                }
     
    159166                // This one behaves specially
    160167                if($key == 'returnModalUrl'){
     168                    // Value
    161169                    $this->form_return = $value;
    162                     $value =  self::FORM_RETURN;
     170                    $value = self::FORM_RETURN;
     171                    // Append id
     172                    // TODO: when fixed on api end
     173                    // $value = $value . '#f' . $this->unique;
    163174                }
    164175                $node = $this->dom->createElement("input");
     
    203214                $fragment->appendXML($html);
    204215                $this->msg->appendChild($fragment);
     216                // Add genoo pop class
     217                if(is_object($this->msg) && method_exists($this->msg, 'setAttribute')){
     218                    $this->msg->setAttribute('class', 'genooPop');
     219                }
    205220            } else {
    206221                // If for some reason it's not to be found and set, try
     
    226241                                    $fragment->appendXML($html);
    227242                                    $element->appendChild($fragment);
     243                                    // Append class genooPop
     244                                    if(is_object($element) && method_exists($element, 'setAttribute')){
     245                                        $element->setAttribute('class', 'genooPop');
     246                                    }
    228247                                }
    229248                            }
     
    256275    }
    257276
     277    /**
     278     * @return string
     279     */
     280    public function getUniqueId()
     281    {
     282        static $counter = 1;
     283        $data = preg_replace('~<(?:!DOCTYPE|/?(?:html|body))[^>]*>\s*~i', '', $this->dom->saveHTML());
     284        $unique_id = '_' . $counter . '_' . sha1($data);
     285        $counter++;
     286        return $unique_id;
     287    }
    258288
    259289    /**
     
    273303            $unique = substr($unique, 0, strpos($unique, ':'));
    274304            $unique = filter_var($unique, FILTER_SANITIZE_NUMBER_INT);
    275             // With unique form ID, replace all instances in JS and text
    276             $unique_id = uniqid('form_');
    277305            // Last check of the same number
    278306            if($unique !== $this->form_id){
     
    280308                $unique = $this->form_id;
    281309            }
    282             $data = str_replace($unique, $unique_id, $data);
     310            $data = str_replace($unique, $this->unique, $data);
    283311            // And then return the form_key
    284312            $data = str_replace(self::FORM_KEY, $this->form_key, $data);
     
    288316            // Done
    289317        }
     318        $unique_id = "f" . $this->unique;
    290319        // Return
    291         return $data;
     320        return "<div id=\"$unique_id\">" . $data . "</div>";
    292321    }
    293322
  • genoo/trunk/libs/Genoo/RepositoryThemes.php

    r1424523 r1546352  
    196196                    // Here comes the style switching magic
    197197                    if(Strings::contains($CSSRuleName, '.genooForm.') && Strings::endsWith($CSSRuleName, '.genooPop')){
    198                         // This is modal style. If it has border-raidous and background, we drop background of overall thing
     198                        // This is modal style. If it has border-radious and background, we drop background of overall thing
    199199                        if($rule->hasProperty('border-radius') || $rule->hasProperty('background-color')){
    200200                            // Has background color and border radius
    201                             // We now need to add canceling sytle for hte whole modal, to remove the padding and
     201                            // We now need to add canceling style for the whole modal, to remove the padding and
    202202                            // background
    203203                            $CSS->addRule($CSSNewRule)
  • genoo/trunk/libs/Genoo/TemplateRenderer.php

    r1527246 r1546352  
    488488                                    $styles = $current_col[0]->style;
    489489                                    $styles_2 = clone $styles;
    490                                     $partitionBackgroundStyle = $this->iterateRowInlineStyleFor($styles, 'background');
     490                                    $partitionBackgroudnStyle = $this->iterateRowInlineStyleFor($styles, 'background');
    491491                                    $partitionBox = $this->iterateRowInlineStyleFor($styles_2, 'box');
    492492                                } else {
    493                                     $partitionBackgroundStyle = '';
     493                                    $partitionBackgroudnStyle = '';
    494494                                    $partitionBox = '';
    495495                                }
  • genoo/trunk/readme.txt

    r1527244 r1546352  
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
    8 Stable tag: 4.4
     8Stable tag: 4.5
    99
    1010Combine the flexibility of WordPress with the power of Genoo and experience amazing results!
Note: See TracChangeset for help on using the changeset viewer.