Plugin Directory

Changeset 1172260


Ignore:
Timestamp:
06/01/2015 09:55:32 PM (11 years ago)
Author:
latorante
Message:

Updating to version 2.7

Location:
genoo/trunk
Files:
2 added
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • genoo/trunk/Genoo.php

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

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

    r1121144 r1172260  
    5050.genooWidgetImage img { padding: 3px; margin: 3px; display: inline-block; max-width: 70%; height: auto;  }
    5151.genooWidgetImage img { border: 2px dashed #c7c7c7; background: #f8f8f8; margin-bottom: 0; margin-top: 5px; }
     52#repeatable_genoo-dynamic-cta th { padding-left: 28px; }
    5253.genooMetaboxRepeatable td input,
    5354.genooMetaboxRepeatable td select,
    54 .genooMetaboxRepeatable td textarea { width: 100%; }
     55.genooMetaboxRepeatable td textarea { width: 80%; display: inline-block; float: left; margin-left: 20px; }
     56.genooMetaboxRepeatable td { position: relative; }
     57.genooMetaboxRepeatable td .dashicons { width: 20px; height: 20px; display: block; position: absolute; vertical-align: middle; text-align: left; padding-right: 0; }
     58.genooMetaboxRepeatable td .dashicons { max-width: 17%; margin: 0; padding: 0; }
     59.genooMetaboxRepeatable td.invalid select { border-color: #da771e; }
     60.genooMetaboxRepeatable td.invalid .dashicons { color: #da771e; vertical-align: top; width: 20px; text-align: center; }
     61.genooMetaboxRepeatable td.invalid .dashicons:before { content: "x"; }
     62.genooMetaboxRepeatable td.valid select { border-color: #308e1f }
     63.genooMetaboxRepeatable td.valid .dashicons { color: #308e1f; width: 20px; line-height: 30px; }
     64.genooMetaboxRepeatable td.valid .dashicons:before { content: "\f147"; }
     65.version-lower-than-3-8 .genooMetaboxRepeatable td .dashicons { width: 20px; height: 20px; font-size: 20px; line-height: 1; font-family: "Arial", sans-serif; text-decoration: inherit; font-weight: normal; font-style: normal; vertical-align: middle; text-align: center; -webkit-transition: color .1s ease-in 0; transition: color .1s ease-in 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
     66.version-lower-than-3-8 .genooMetaboxRepeatable td.invalid .dashicons:before { content: 'X'; }
     67.version-lower-than-3-8 .genooMetaboxRepeatable td.valid  .dashicons:before { content: '\2713'; }
    5568#genooLog { width: 45%; min-width: 255px; margin: 10px 0;  -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
    5669#genooLog h3 { padding: 0; }
     
    6275#genooProgressBarText { width: 100%; line-height: 25px; }
    6376#genooProgressBarBG { position: absolute; z-index: 300; display: block; left: 0; height: 100%; }
    64 
    6577
    6678/* prevent flickering */
  • genoo/trunk/libs/Genoo/Admin.php

    r1148584 r1172260  
    8686        Action::add('admin_notices', array ($this, 'adminNotices'));
    8787        Action::add('admin_enqueue_scripts', array($this, 'adminEnqueueScripts'), 10, 1);
     88        // we need this for dashicons fallback
     89        Filter::add('admin_body_class', array($this, 'adminBodyClass'), 10, 1);
    8890    }
    8991
     
    111113        // if post edit or add screeen
    112114        if($hook == 'post-new.php' || $hook == 'post.php'){
    113             wp_enqueue_script('GenooEditPost', GENOO_ASSETS . 'GenooEditPost.js', array('jquery'), GENOO_REFRESH);
     115            wp_enqueue_script('GenooEditPost', GENOO_ASSETS . 'GenooEditPosts.js', array('jquery'), GENOO_REFRESH);
    114116        }
    115117        // if setup up add vars
     
    136138            TinyMCE::register($this->repositarySettings->getCTAPostTypes());
    137139        }
     140    }
     141
     142
     143    /**
     144     * Admin body class
     145     * - used to add lower than 3.8, dashicons edit
     146     *
     147     * @param $classes
     148     * @return mixed
     149     */
     150    public function adminBodyClass($classes)
     151    {
     152        global $wp_version;
     153        if (version_compare($wp_version, '3.8', '<' )){
     154            // note that admin body classes use string, instead of an array
     155            // but that might change one day so ...
     156            if(empty($classes)){
     157                $classes = 'version-lower-than-3-8';
     158            } elseif(is_string($classes)){
     159                $classes .= 'version-lower-than-3-8';
     160            } elseif(is_array($classes)) {
     161                $classes[] = 'version-lower-than-3-8';
     162            }
     163        }
     164        return $classes;
    138165    }
    139166
  • genoo/trunk/libs/Genoo/Frontend.php

    r1121144 r1172260  
    8787        if($post instanceof \WP_Post){
    8888            // We only run this on single posts
    89             if(Post::isSingle() || Post::isPage() && Post::isPostType($post, $this->repositorySettings->getCTAPostTypes())){
     89            if((Post::isSingle() || Post::isPage()) && Post::isPostType($post, $this->repositorySettings->getCTAPostTypes())){
    9090                // Dynamic cta
    9191                $cta = new CTADynamic($post);
  • genoo/trunk/libs/Genoo/HtmlForm.php

    r1121144 r1172260  
    8888            if(!empty($this->msg)){
    8989                // html
    90                 $html .= '<strong class="'.$strongClass.'">' . htmlspecialchars($msg) . '</strong>';
     90                $html .= '<strong class="'.$strongClass.'">' . strip_tags($msg, '<br><br/>') . '</strong>'; //htmlspecialchars
    9191                $fragment = $this->dom->createDocumentFragment();
    9292                $fragment->appendXML($html);
  • genoo/trunk/libs/Genoo/Table.php

    r1148584 r1172260  
    1616use Genoo\Wordpress\Utils;
    1717use Genoo\Wordpress\Notice;
    18 use Genoo\Wordpress\WPListTable;
     18use Genoo\Wordpress\TableLite;
    1919
    20 abstract class Table extends \Genoo\Wordpress\WPListTable
     20abstract class Table extends \Genoo\Wordpress\TableLite
    2121{
    2222    /** @var array() */
  • genoo/trunk/libs/Genoo/Wordpress/Http.php

    r882847 r1172260  
    2828     * @param null $url
    2929     */
    30 
    31     public function __construct($url = null){ $this->url = $url; return $this; }
     30    public function __construct($url = null)
     31    {
     32        $this->url = $url;
     33        return $this;
     34    }
    3235
    3336
    3437    /**
    3538     * @param array $args
     39     * @return $this
    3640     */
    37 
    38     public function setArgs(array $args = array()){ $this->args = $args; return $this; }
     41    public function setArgs(array $args = array())
     42    {
     43        $this->args = $args;
     44        return $this;
     45    }
    3946
    4047
    4148    /**
    4249     * @param string $url
     50     * @return $this
    4351     */
    44 
    45     public function setUrl($url = ''){ $this->url = $url; return $this; }
     52    public function setUrl($url = '')
     53    {
     54        $this->url = $url;
     55        return $this;
     56    }
    4657
    4758
    4859    /**
    4960     * @param string $body
     61     * @return $this
    5062     */
    51 
    52     public function setBody($body = ''){ $this->args['body'] = $body; return $this; }
    53 
     63    public function setBody($body = '')
     64    {
     65        $this->args['body'] = $body;
     66        return $this;
     67    }
    5468
    5569    /**
    56      * Get
    57      *
    58      * @return mixed
     70     * @return $this
     71     * @throws HttpException
    5972     */
    60 
    61     public function get(){ $this->response = wp_remote_get($this->url, $this->args); $this->check(); return $this; }
    62 
     73    public function get()
     74    {
     75        $this->response = \wp_remote_get($this->url, $this->args);
     76        $this->check();
     77        return $this;
     78    }
    6379
    6480    /**
    65      * Post
    66      *
    67      * @return mixed
     81     * @param null $body
     82     * @param string $method
     83     * @throws HttpException
    6884     */
    69 
    7085    public function post($body = null, $method = 'POST')
    7186    {
     
    8297        );
    8398        // go my man
    84         $this->response = wp_remote_post($this->url, array_merge($defaults, $this->args));
     99        $this->response = \wp_remote_post($this->url, array_merge($defaults, $this->args));
    85100        $this->check();
    86101    }
     
    88103
    89104    /**
    90      * Put
    91      *
    92105     * @param null $body
    93106     */
    94 
    95107    public function put($body = null)
    96108    {
    97         return $this->post($body, 'PUT');
     109        $this->post($body, 'PUT');
    98110    }
    99111
    100112
    101113    /**
    102      * Head
    103      *
    104      * @return mixed
     114     * @throws HttpException
    105115     */
    106 
    107     public function head(){ $this->response = wp_remote_head($this->url, $this->args); $this->check(); }
     116    public function head()
     117    {
     118        $this->response = \wp_remote_head($this->url, $this->args);
     119        $this->check();
     120    }
    108121
    109122
     
    113126     * @throws HttpException
    114127     */
    115 
    116128    private function check()
    117129    {
     
    124136
    125137    /**
    126      * Get response
    127      *
    128138     * @return mixed
    129139     */
    130 
    131     public function getResponse(){ return $this->response['response']; }
     140    public function getResponse()
     141    {
     142        return $this->response['response'];
     143    }
    132144
    133145
     
    137149     * @return mixed
    138150     */
    139 
    140     public function getResponseCode(){ return $this->response['response']['code']; }
     151    public function getResponseCode()
     152    {
     153        return $this->response['response']['code'];
     154    }
    141155
    142156
     
    146160     * @return mixed
    147161     */
    148 
    149     public function getBody(){ return $this->response['body']; }
     162    public function getBody()
     163    {
     164        return $this->response['body'];
     165    }
    150166
    151167
     
    153169     * Reset
    154170     */
    155 
    156171    public function reset()
    157172    {
  • genoo/trunk/libs/Genoo/Wordpress/Metabox.php

    r1121144 r1172260  
    134134            foreach($this->fields as $field){
    135135                $fieldId = isset($field['id']) ? $field['id'] : str_replace('-', '_', Strings::lower(Strings::webalize($field['label'])));
    136                 $fieldRow = '<div class="themeMetaboxRow" id="themeMetaboxRow'. $fieldId .'" >';
    137                 $fieldValue = get_post_meta($post->ID, $fieldId, true);
    138                 $fieldLabel = '<label for="' . $fieldId . '">' . $field['label'] . '</label>';
    139                 $fieldOptions = isset($field['options']) ? $field['options'] : array();
    140                 $fieldAtts = '';
     136                if(isset($field['type']) && (isset($field['label']))){
     137                    $fieldRow = '<div class="themeMetaboxRow" id="themeMetaboxRow'. $fieldId .'" >';
     138                    $fieldValue = get_post_meta($post->ID, $fieldId, true);
     139                    $fieldLabel = '<label for="' . $fieldId . '">' . $field['label'] . '</label>';
     140                    $fieldOptions = isset($field['options']) ? $field['options'] : array();
     141                    $fieldAtts = '';
     142                }
    141143                if(isset($field['atts']) && is_array($field['atts'])){ foreach($field['atts'] as $key => $value){ $fieldAtts .= ' '. $key .'="'. $value .'" '; } }
    142144                switch($field['type']){
     
    189191                            . '</div>';
    190192                        $fieldInput = '<input type="hidden" name="'. $fieldId .'" id="'. $fieldId .'" value="'. $fieldValue .'" />';
    191                         $fieldInput .= '<a href="#" onclick="Modal.open(event,this);"'
    192                             . 'id="'. $fieldId . 'Btn' .'"'
    193                             . 'data-current-id="'. $fieldValue .'"'
    194                             . 'data-title="'. $fieldLabelButton .'"'
    195                             . 'data-update-text="'. $fieldLabelButton .'"'
    196                             . 'data-target="'. $fieldTarget .'"'
    197                             . 'data-target-input="'. $fieldId .'"'
     193                        $fieldInput .= '<a href="#" onclick="Modal.open(event,this);" '
     194                            . 'id="'. $fieldId . 'Btn' .'" '
     195                            . 'data-current-id="'. $fieldValue .'" '
     196                            . 'data-title="'. $fieldLabelButton .'" '
     197                            . 'data-update-text="'. $fieldLabelButton .'" '
     198                            . 'data-target="'. $fieldTarget .'" '
     199                            . 'data-target-input="'. $fieldId .'" '
    198200                            . 'class="button">'. $fieldLabelButton .'</a>';
    199201                        $fieldInput .= ' | ';
     
    206208                        break;
    207209                }
    208                 // add elements to a row
    209                 $fieldRow .= $fieldLabel;
    210                 $fieldRow .= $fieldInput;
    211                 $fieldRow .= $metaboxClear;
    212                 // add row to metabox form
    213                 $metaboxForm .= $fieldRow . '</div>';
     210                if(isset($field['type']) && (isset($field['label']))){
     211                    // add elements to a row
     212                    $fieldRow .= $fieldLabel;
     213                    $fieldRow .= $fieldInput;
     214                    $fieldRow .= $metaboxClear;
     215                    // add row to metabox form
     216                    $metaboxForm .= $fieldRow . '</div>';
     217                }
    214218            }
    215219        }
  • genoo/trunk/libs/Genoo/Wordpress/MetaboxCTA.php

    r1121144 r1172260  
    144144                        foreach ($savedFields as $field){ ?>
    145145                        <tr>
    146                             <td><?php echo self::select($this->id . '[cta][]', $fieldCTAs, isset($field['cta']) ? $field['cta'] : false); ?></td>
    147                             <td><?php echo self::select($this->id . '[sidebar][]', $fieldSidebars, isset($field['cta']) ? $field['sidebar'] : false); ?></td>
    148                             <td><?php echo self::select($this->id . '[position][]', self::selectPosition(), !empty($field['position']) ? $field['position'] : false); ?></td>
    149                             <td><a class="button remove-row" href="#">Remove</a></td>
     146                            <td width="40" class="validate valid"><span class="dashicons"></span><?php echo self::select($this->id . '[cta][]', $fieldCTAs, isset($field['cta']) ? $field['cta'] : false); ?></td>
     147                            <td width="30" class="validate valid"><span class="dashicons"></span><?php echo self::select($this->id . '[sidebar][]', $fieldSidebars, isset($field['cta']) ? $field['sidebar'] : false); ?></td>
     148                            <td width="20" class="valid"><span class="dashicons"></span><?php echo self::select($this->id . '[position][]', self::selectPosition(), !empty($field['position']) ? $field['position'] : false); ?></td>
     149                            <td width="10"><a class="button remove-row" href="#">Remove</a></td>
    150150                        </tr>
    151151                    <?php
     
    154154                        ?>
    155155                        <tr>
    156                             <td><?php echo self::select($this->id . '[cta][]', $fieldCTAs); ?></td>
    157                             <td><?php echo self::select($this->id . '[sidebar][]', $fieldSidebars); ?></td>
    158                             <td><?php echo self::select($this->id . '[position][]', self::selectPosition()); ?></td>
    159                             <td><a class="button remove-row" href="#">Remove</a></td>
     156                            <td width="40" class="validate invalid"><span class="dashicons"></span><?php echo self::select($this->id . '[cta][]', $fieldCTAs); ?></td>
     157                            <td width="30" class="validate invalid"><span class="dashicons"></span><?php echo self::select($this->id . '[sidebar][]', $fieldSidebars); ?></td>
     158                            <td width="20" class="valid"><span class="dashicons"></span><?php echo self::select($this->id . '[position][]', self::selectPosition()); ?></td>
     159                            <td width="10"><a class="button remove-row" href="#">Remove</a></td>
    160160                        </tr>
    161161                    <?php } ?>
    162162                    <tr class="empty-row screen-reader-text">
    163                         <td><?php echo self::select($this->id . '[cta][]', $fieldCTAs, null, 'empty'); ?></td>
    164                         <td><?php echo self::select($this->id . '[sidebar][]', $fieldSidebars, null, 'empty'); ?></td>
    165                         <td><?php echo self::select($this->id . '[position][]', self::selectPosition(), null, 'empty'); ?></td>
    166                         <td><a class="button remove-row" href="#">Remove</a></td>
     163                        <td width="40" class="validate invalid"><span class="dashicons"></span><?php echo self::select($this->id . '[cta][]', $fieldCTAs, null, 'empty'); ?></td>
     164                        <td width="30" class="validate invalid"><span class="dashicons"></span><?php echo self::select($this->id . '[sidebar][]', $fieldSidebars, null, 'empty'); ?></td>
     165                        <td width="20" class="valid"><span class="dashicons"></span><?php echo self::select($this->id . '[position][]', self::selectPosition(), null, 'empty'); ?></td>
     166                        <td width="10"><a class="button remove-row" href="#">Remove</a></td>
    167167                    </tr>
    168168                    </tbody>
  • genoo/trunk/libs/Genoo/Wordpress/Settings.php

    r1148584 r1172260  
    202202                $fieldHtml .= sprintf('<input type="hidden" name="%1$s[%2$s]" value="off" />', $args['section'], $args['id']);
    203203                $fieldHtml .= sprintf('<input type="checkbox" class="checkbox" id="%1$s-%2$s" name="%1$s[%2$s]" value="on"%4$s %5$s />', $args['section'], $args['id'], $fieldValue, checked($fieldValue, 'on', false), $fieldAttr);
    204                 $fieldHtml .= sprintf('<label for="%1$s[%2$s]"> %3$s</label>', $args['section'], $args['id'], $args['desc']);
     204                $fieldHtml .= sprintf('<label for="%1$s-%2$s"> %3$s</label>', $args['section'], $args['id'], $args['desc']);
    205205                break;
    206206            case 'multicheck':
     
    208208                    $checked = isset($fieldValueUn[$key]) ? $fieldValueUn[$key] : '0';
    209209                    $fieldHtml .= sprintf('<input type="checkbox" class="checkbox" id="%1$s-%2$s-%3$s" name="%1$s[%2$s][%3$s]" value="%3$s"%4$s />', $args['section'], $args['id'], $key, checked($checked, $key, false));
    210                     $fieldHtml .= sprintf('<label for="%1$s[%2$s][%4$s]"> %3$s</label><br />', $args['section'], $args['id'], $label, $key);
     210                    $fieldHtml .= sprintf('<label for="%1$s-%2$s-%4$s"> %3$s</label><br />', $args['section'], $args['id'], $label, $key);
    211211                }
    212212                break;
  • genoo/trunk/readme.txt

    r1148584 r1172260  
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
    8 Stable tag: 2.6.8
     8Stable tag: 2.7
    99
    1010Combine the flexibility of WordPress with the power of Genoo and experience amazing results!
     
    6464
    6565== Upgrade Notice ==
     66* CTA can be enabled for any post-types now
     67* Updated CTA metabox validation
    6668
    6769== Changelog ==
     70
     71= 2.8 =
     72* Added dynamic CTA validation
    6873
    6974= 2.6.8 =
Note: See TracChangeset for help on using the changeset viewer.