Plugin Directory

Changeset 1346660


Ignore:
Timestamp:
02/09/2016 11:26:26 AM (10 years ago)
Author:
latorante
Message:

Updating to version 3.4.9

Location:
genoo/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • genoo/trunk/Genoo.php

    r1342940 r1346660  
    66    Author URI: http://www.genoo.com/
    77    Author Email: info@genoo.com
    8     Version: 3.4.8
     8    Version: 3.4.9
    99    License: GPLv2
    1010    Text Domain: genoo
  • genoo/trunk/GenooInit.php

    r1336987 r1346660  
    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));
    5958        // start the engine last file to require, rest is auto
    6059        // custom auto loader, PSR-0 Standard
     
    6261        $classLoader = new GenooRobotLoader('Genoo', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'libs' . DIRECTORY_SEPARATOR);
    6362        $classLoader->register();
     63        // wp init
     64        Action::add('plugins_loaded', array($this, 'init'));
     65        // wp die
     66        Action::add('shutdown', array($this, 'shutdown'));
     67    }
     68
     69
     70    /**
     71     * Initialize
     72     */
     73
     74    public function init()
     75    {
     76        // Rest of constatns
     77        define('GENOO_DEV', apply_filters('wpmktengine_dev', FALSE));
    6478        // initialize
    6579        $this->repositarySettings = new RepositorySettings();
     
    7084        define('GENOO_SETUP', $this->api->isSetupFull());
    7185        define('GENOO_LUMENS', $this->api->isLumensSetup());
    72         // wp init
    73         Action::add('plugins_loaded', array($this, 'init'));
    74         // wp die
    75         Action::add('shutdown', array($this, 'shutdown'));
    76     }
    77 
    78 
    79     /**
    80      * Initialize
    81      */
    82 
    83     public function init()
    84     {
     86
    8587        /**
    8688         * 0. Text-domain
     
    162164        add_feed('wpmktengine_cta', function(){
    163165            // Send headers
     166            header('Access-Control-Allow-Origin: *');
    164167            header('Cache-Control: no-cache, must-revalidate');
    165168            header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60))); // 1 hour
  • genoo/trunk/libs/Genoo/Api.php

    r1342947 r1346660  
    743743     * @param string $description
    744744     * @param string $url
    745      * @return null
     745     * @return mixed
     746     * @throws ApiException
    746747     */
    747748    public function putActivityByMail($email, $activityType, $activityName, $description = '', $url = '')
     
    758759                return $leadid;
    759760            } else {
    760                 //logError('Warning: lead' . $email . ' does not exist.');
     761                throw new ApiException('No lead for ' . $email . ' found.');
    761762            }
    762763        } catch (\Exception $e){
    763             //logError('Error during: ' . $activityType . ', Error: ' . $e->getMessage());
    764         }
    765         return NULL;
     764            throw new ApiException('Error during: ' . $activityType . ', Error: ' . $e->getMessage());
     765        }
    766766    }
    767767
     
    835835    private function call($action, $params = null)
    836836    {
    837 
    838 
    839837        try{
    840838            switch($action){
     
    979977
    980978class ApiException extends \Exception{}
     979class ApiNoteException extends \Exception{}
  • genoo/trunk/libs/Genoo/Frontend.php

    r1342940 r1346660  
    320320                                $modalGutsInject->appendMsg($widgetMsgSuccess, $modalResult);
    321321                            }
     322                            $modalGutsInject->hideRequired();
    322323                        }
    323324                        // add html with injected values
  • genoo/trunk/libs/Genoo/HtmlForm.php

    r1333632 r1346660  
    2424    /** @var */
    2525    private $form_key;
     26    /** @var  */
     27    private $form_return = NULL;
    2628    /** @var */
    2729    private $form_id;
     
    3032    /** Form key */
    3133    const FORM_KEY = '{{FORM_KEY}}';
     34    const FORM_RETURN = '{{FORM_RETURN}}';
    3235
    3336
     
    135138        if($array){
    136139            foreach($array as $key => $value){
     140                // This one behaves specially
     141                if($key == 'returnModalUrl'){
     142                    $this->form_return = $value;
     143                    $value =  self::FORM_RETURN;
     144                }
    137145                $node = $this->dom->createElement("input");
    138146                $node->setAttribute("type","hidden");
     
    176184                $fragment->appendXML($html);
    177185                $this->msg->appendChild($fragment);
     186            }
     187        }
     188    }
     189
     190
     191    /**
     192     * Hide required field
     193     * after the form was submitted
     194     */
     195
     196    public function hideRequired()
     197    {
     198        // Find span
     199        $span = $this->dom->getElementsByTagName("span");
     200        // Do we have elements?
     201        if($span instanceof \DOMNodeList){
     202            foreach($span as $element){
     203                // Remove if parent
     204                if($element->parentNode){
     205                    $element->parentNode->removeChild($element);
     206                }
    178207            }
    179208        }
     
    207236            // And then return the form_key
    208237            $data = str_replace(self::FORM_KEY, $this->form_key, $data);
     238            if($this->form_return !== NULL){
     239                $data = str_replace(self::FORM_RETURN, $this->form_return, $data);
     240            }
     241            // Done
    209242        }
    210243        // Return
  • genoo/trunk/libs/Genoo/Shortcodes.php

    r1121144 r1346660  
    149149                        $inject->appendMsg($formSuccess, $result);
    150150                    }
     151                    // Hide required if any
     152                    $inject->hideRequired();
    151153                }
    152154                // return html
  • genoo/trunk/libs/Genoo/Wordpress/MetaboxBuilder.php

    r1287280 r1346660  
    537537        if($name == 'form' && $this->formValue($name) !== ''){
    538538            $array = $this->forms->getFormsArray();
    539             echo '<div class="bContent">'. $array[$this->formValue($name)] .'</div>';
     539            $value = array_key_exists($this->formValue($name), $array) ? $array[$this->formValue($name)] : '';
     540            echo '<div class="bContent">'. $value .'</div>';
    540541        } elseif($name == 'image' && $this->formIsChecked($name . '-on')){
    541542            $value = $this->formValue($name);
     
    651652        $r->content .= '<div class="clear"></div>';
    652653        // Put it all together
    653         $r->content = '';
    654654        $hideRest = FALSE;
    655655        if(isset($_GET['modalWindow']) && !is_null($readyId) && $_GET['modalWindow'] == 'modalWindow' . ucfirst($readyId)){
  • genoo/trunk/readme.txt

    r1342940 r1346660  
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
    8 Stable tag: 3.4.8
     8Stable tag: 3.4.9
    99
    1010Combine the flexibility of WordPress with the power of Genoo and experience amazing results!
     
    6868
    6969== Changelog ==
     70
     71= 3.4.9 =
     72* Removing "required field" after form submission
     73* Fixed error for not found form response according to form indicator in GET parameters
     74* Allowing CTA feed from any origin
    7075
    7176= 3.4.8 =
Note: See TracChangeset for help on using the changeset viewer.