Plugin Directory

Changeset 1148584


Ignore:
Timestamp:
04/29/2015 01:42:46 AM (11 years ago)
Author:
latorante
Message:

Updating to version 2.6.8
-- WordPress 4.2.2 compatibility listing table

Location:
genoo/trunk
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • genoo/trunk/Genoo.php

    r1135410 r1148584  
    66    Author URI: http://www.genoo.com/
    77    Author Email: info@genoo.com
    8     Version: 2.6.5
     8    Version: 2.6.8
    99    License: GPLv2
    1010    Text Domain: genoo
  • genoo/trunk/GenooInit.php

    r1135410 r1148584  
    5252        define('GENOO_CACHE',   GENOO_ROOT . 'cache' . DIRECTORY_SEPARATOR);
    5353        define('GENOO_DEBUG',   get_option('genooDebug'));
    54         define('GENOO_REFRESH', sha1('genoo-refresh-javascript-without-popup'));
     54        define('GENOO_REFRESH', sha1('genoo-refresh-javascript-now-please'));
    5555        // start the engine last file to require, rest is auto
    5656        // custom auto loader, PSR-0 Standard
  • genoo/trunk/assets/GenooEditPost.js

    r1135410 r1148584  
    264264                        if(r == true){
    265265                            jQuery("#ajax-loading").show();
    266                             publish.click();
     266                            publish.trigger('click');
    267267                        } else {
    268268                            jQuery("#publish").removeClass().addClass("button-primary");
     
    276276            if(found == false){
    277277                jQuery("#ajax-loading").show();
    278                 publish.click();
     278                publish.trigger('click');
    279279            }
    280280        } else {
    281281            jQuery("#ajax-loading").show();
    282             publish.click();
     282            publish.trigger('click');
    283283        }
    284284    });
  • genoo/trunk/libs/Genoo/Admin.php

    r1121144 r1148584  
    1212namespace Genoo;
    1313
    14 use Genoo\RepositorySettings,
    15     Genoo\RepositoryUser,
    16     Genoo\RepositoryForms,
    17     Genoo\RepositoryLumens,
    18     Genoo\Api,
    19     Genoo\TableForms,
    20     Genoo\TableLumens,
    21     Genoo\Wordpress\Utils,
    22     Genoo\Wordpress\Settings,
    23     Genoo\Wordpress\Page,
    24     Genoo\Wordpress\Notice,
    25     Genoo\Wordpress\Nag,
    26     Genoo\Wordpress\Metabox,
    27     Genoo\Wordpress\PostType,
    28     Genoo\Wordpress\Action,
    29     Genoo\Wordpress\Filter,
    30     Genoo\Wordpress\TinyMCE,
    31     Genoo\Tools,
    32     Genoo\Utils\Strings;
     14use Genoo\RepositorySettings;
     15use Genoo\RepositoryUser;
     16use Genoo\RepositoryForms;
     17use Genoo\RepositoryLumens;
     18use Genoo\Api;
     19use Genoo\TableForms;
     20use Genoo\TableLumens;
     21use Genoo\Wordpress\Utils;
     22use Genoo\Wordpress\Settings;
     23use Genoo\Wordpress\Page;
     24use Genoo\Wordpress\Notice;
     25use Genoo\Wordpress\Nag;
     26use Genoo\Wordpress\Metabox;
     27use Genoo\Wordpress\PostType;
     28use Genoo\Wordpress\Action;
     29use Genoo\Wordpress\Filter;
     30use Genoo\Wordpress\TinyMCE;
     31use Genoo\Tools;
     32use Genoo\Utils\Strings;
     33use Genoo\Wordpress\Debug;
    3334use Genoo\Wordpress\MetaboxCTA;
    3435
     
    7576        $this->repositaryLumens = new RepositoryLumens($this->cache, $this->api);
    7677        $this->repositaryCTAs = new RepositoryCTA($this->cache);
    77         $this->user = new RepositoryUser();
    78         $this->settings = new Settings($this->repositarySettings, $this->api);
     78        // initialise settings and users
     79        Action::add('init', array($this, 'init'), 1);
    7980        // admin constructor
    8081        Action::add('current_screen', array($this, 'adminCurrentScreen'));
    8182        Action::add('admin_init', array($this, 'adminInit'));
    82         Action::add('admin_init', array($this, 'adminUI'));
     83        Action::add('init', array($this, 'adminUI'));
    8384        Action::add('init', array($this, 'adminPostTypes'));
    8485        Action::add('admin_menu', array($this, 'adminMenu'));
    8586        Action::add('admin_notices', array ($this, 'adminNotices'));
    8687        Action::add('admin_enqueue_scripts', array($this, 'adminEnqueueScripts'), 10, 1);
     88    }
     89
     90    /**
     91     * Init variables
     92     */
     93    public function init()
     94    {
     95        // We first need to get these, but only after init,
     96        // to retrieve all custom post types correclty
     97        $this->user = new RepositoryUser();
     98        $this->settings = new Settings($this->repositarySettings, $this->api);
    8799    }
    88100
  • genoo/trunk/libs/Genoo/Table.php

    r882847 r1148584  
    1212namespace Genoo;
    1313
    14 if(!class_exists('WP_List_Table')){
    15     if(file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php')){
    16         require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
    17     }
    18     // if not, this might fail, do something man, cmon
    19 }
     14use Genoo\RepositoryUser;
     15use Genoo\Utils\Strings;
     16use Genoo\Wordpress\Utils;
     17use Genoo\Wordpress\Notice;
     18use Genoo\Wordpress\WPListTable;
    2019
    21 
    22 use Genoo\RepositoryUser,
    23     Genoo\Utils\Strings,
    24     Genoo\Wordpress\Utils,
    25     Genoo\Wordpress\Notice;
    26 
    27 
    28 abstract class Table extends \WP_List_Table
     20abstract class Table extends \Genoo\Wordpress\WPListTable
    2921{
    3022    /** @var array() */
  • genoo/trunk/libs/Genoo/TableForms.php

    r871929 r1148584  
    1212namespace Genoo;
    1313
    14 use Genoo\Wordpress\Utils,
    15     Genoo\Wordpress\Notice,
    16     Genoo\Tools;
     14use Genoo\Wordpress\Utils;
     15use Genoo\Wordpress\Notice;
     16use Genoo\Tools;
    1717
    1818class TableForms extends Table
  • genoo/trunk/libs/Genoo/Wordpress/Post.php

    r1121144 r1148584  
    128128     */
    129129
    130     public static function getTypes($args = array()){ return get_post_types(array_merge(array('public' => true, 'show_ui' => true), $args), 'objects'); }
     130    public static function getTypes($args = array())
     131    {
     132        return get_post_types(array_merge(array('public' => true, 'show_ui' => true), $args), 'objects');
     133    }
    131134
    132135
  • genoo/trunk/libs/Genoo/Wordpress/Settings.php

    r1121144 r1148584  
    1515    Genoo\Utils\Strings,
    1616    Genoo\Wordpress\Notice,
    17     Genoo\Wordpress\Action;
     17    Genoo\Wordpress\Action,
     18    Genoo\Wordpress\Utils;
     19use Genoo\RepositorySettings;
    1820
    1921class Settings
     
    124126    {
    125127        //register settings sections
    126         foreach ($this->sections as $section){
    127             if (false == get_option($section['id'])){ add_option($section['id']); }
    128             if (isset($section['desc']) && !empty($section['desc'])){
    129                 $section['desc'] = '<div class="inside">'.$section['desc'].'</div>';
    130                 $callback = create_function('', 'echo "'.str_replace('"', '\"', $section['desc']).'";');
    131             } else {
    132                 $callback = '__return_false';
    133             }
    134             add_settings_section($section['id'], $section['title'], $callback, $section['id']);
     128        if(Utils::isIterable($this->sections)){
     129            foreach($this->sections as $section){
     130                if (false == get_option($section['id'])){ add_option($section['id']); }
     131                if (isset($section['desc']) && !empty($section['desc'])){
     132                    $section['desc'] = '<div class="inside">'.$section['desc'].'</div>';
     133                    $callback = create_function('', 'echo "'.str_replace('"', '\"', $section['desc']).'";');
     134                } else {
     135                    $callback = '__return_false';
     136                }
     137                add_settings_section($section['id'], $section['title'], $callback, $section['id']);
     138            }
    135139        }
    136140        //register settings fields
    137         foreach($this->fields as $section => $field){
    138             foreach ($field as $option){
    139                 if(!empty($option)){
    140                     $type = isset($option['type']) ? $option['type'] : 'text';
    141                     $args = array(
    142                         'type' => $type,
    143                         'id' => $option['name'],
    144                         'desc' => isset($option['desc']) ? $option['desc'] : null,
    145                         'name' => $option['label'],
    146                         'section' => $section,
    147                         'options' => isset($option['options']) ? $option['options'] : '',
    148                         'std' => isset($option['default']) ? $option['default'] : '',
    149                         'attr' => isset($option['attr']) ? $option['attr'] : ''
    150                     );
    151                     add_settings_field($section . '[' . $option['name'] . ']', $option['label'], array($this, 'renderer'), $section, $section, $args);
     141        if(Utils::isIterable($this->fields)){
     142            foreach($this->fields as $section => $field){
     143                if(Utils::isIterable($field)){
     144                    foreach ($field as $option){
     145                        if(!empty($option)){
     146                            $type = isset($option['type']) ? $option['type'] : 'text';
     147                            $args = array(
     148                                'type' => $type,
     149                                'id' => $option['name'],
     150                                'desc' => isset($option['desc']) ? $option['desc'] : null,
     151                                'name' => $option['label'],
     152                                'section' => $section,
     153                                'options' => isset($option['options']) ? $option['options'] : '',
     154                                'std' => isset($option['default']) ? $option['default'] : '',
     155                                'attr' => isset($option['attr']) ? $option['attr'] : ''
     156                            );
     157                            add_settings_field($section . '[' . $option['name'] . ']', $option['label'], array($this, 'renderer'), $section, $section, $args);
     158                        }
     159                    }
    152160                }
    153161            }
    154162        }
    155163        // creates our settings in the options table
    156         foreach ($this->sections as $section){
    157             register_setting($section['id'], $section['id'], array($this, 'validate'));
     164        if(Utils::isIterable($this->sections)){
     165            foreach ($this->sections as $section){
     166                register_setting($section['id'], $section['id'], array($this, 'validate'));
     167            }
    158168        }
    159169    }
     
    308318                }
    309319                // go through sections
    310                 foreach($this->sections as $form){
    311                     echo '<div id="'. $form['id'] .'" class="group">';
    312                         echo '<form method="post" action="options.php">';
    313                             do_action('wsa_form_top_' . $form['id'], $form);
    314                             settings_fields($form['id']);
    315                             do_settings_sections($form['id']);
    316                             do_action('wsa_form_bottom_' . $form['id'], $form);
    317                             echo '<div style="padding-left: 10px">';
    318                             submit_button();
    319                             echo '</div>';
    320                         echo '</form>';
    321                     echo '</div>';
     320                if(Utils::isIterable($this->sections)){
     321                    foreach($this->sections as $form){
     322                        echo '<div id="'. $form['id'] .'" class="group">';
     323                            echo '<form method="post" action="options.php">';
     324                                do_action('wsa_form_top_' . $form['id'], $form);
     325                                settings_fields($form['id']);
     326                                do_settings_sections($form['id']);
     327                                do_action('wsa_form_bottom_' . $form['id'], $form);
     328                                echo '<div style="padding-left: 10px">';
     329                                    submit_button();
     330                                echo '</div>';
     331                            echo '</form>';
     332                        echo '</div>';
     333                    }
    322334                }
    323335            echo '</div>';
  • genoo/trunk/libs/Genoo/Wordpress/Utils.php

    r975155 r1148584  
    126126        echo $output;
    127127    }
     128
     129    /**
     130     * Is iterable?
     131     *
     132     * @param $var
     133     * @return bool
     134     */
     135    public static function isIterable($var)
     136    {
     137        return $var !== null
     138                && (is_array($var)
     139                || $var instanceof \Traversable
     140                || $var instanceof \Iterator
     141                || $var instanceof \IteratorAggregate
     142        );
     143    }
    128144}
  • genoo/trunk/readme.txt

    r1135410 r1148584  
    33Tags: marketing automation, email marketing, centralized lead database, lead capture forms
    44Requires at least: 3.3
    5 Tested up to: 4.0
     5Tested up to: 4.2.2
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
    8 Stable tag: 2.6.5
     8Stable tag: 2.6.8
    99
    1010Combine the flexibility of WordPress with the power of Genoo and experience amazing results!
     
    6767== Changelog ==
    6868
     69= 2.6.8 =
     70* Added WordPress 4.2.2 listing table support
     71* Added CTA for custom post type
     72
    6973= 2.6 =
    7074* Added ability to identify multiple CTA's (and their placement within the sidebar) for a specific page or post.
Note: See TracChangeset for help on using the changeset viewer.