Plugin Directory

Changeset 2150190


Ignore:
Timestamp:
09/03/2019 01:10:45 PM (7 years ago)
Author:
spindogs
Message:

v1.7.39

Location:
wp-platform/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wp-platform/trunk/classes/Breadcrumb.php

    r1678156 r2150190  
    1212    public function generate()
    1313    {
    14 
    1514        global $wp_query;
    1615        global $post;
    1716        //print_r($wp_query);exit;
     17
     18        if (is_feed()) {
     19            return;
     20        }
    1821
    1922        //reset
  • wp-platform/trunk/classes/Controller.php

    r1678156 r2150190  
    7575
    7676        $controller = new $controller_name();
     77        $controller->mergeData($this->data);
    7778        $controller->call($action, $params);
    7879
    79         $this->data = array_merge($this->data, $controller->data);
     80        $this->mergeData($controller->data);
    8081
    8182    }
     
    187188    }
    188189
     190    /**
     191     * @param array $data
     192     * @return void
     193     */
     194    protected function mergeData($data)
     195    {
     196        $this->data = array_merge($this->data, $data);
     197    }
     198
    189199}
  • wp-platform/trunk/classes/Form.php

    r1724302 r2150190  
    202202        if (!$this->submitted()) {
    203203            $value = $initial;
    204         } else if (isset($_REQUEST[$name])) {
     204        } else if (isset($_REQUEST[$name]) && $_REQUEST[$name] !== '') {
    205205            $value = $_REQUEST[$name];
    206206        } else {
    207             $value = '';
     207            $value = null;
    208208        }
    209209
     
    401401                if ($is_multi && in_array($key, $value)) {
    402402                    $selected = ' selected="selected"';
    403                 } elseif ($key == $value) {
     403                } elseif ($value !== null && $key == $value) {
     404                    $selected = ' selected="selected"';
     405                } elseif ($value === null && $key === $value) {
    404406                    $selected = ' selected="selected"';
    405407                } else {
     
    15681570     * @return void
    15691571     */
    1570     public function error($msg, $key=false, $ignore=false)
    1571     {
    1572 
     1572    public function error($msg, $key = null, $ignore = false)
     1573    {
    15731574        $this->has_success = false;
    15741575
    1575         if ($key && !isset($this->errors[$key])) {
    1576             $this->errors[$key] = $msg;
    1577         } elseif (!$ignore) {
     1576        if ($key) {
     1577            if (!isset($this->errors[$key]) || !$ignore) {
     1578                $this->errors[$key] = $msg;
     1579            }
     1580        } else {
    15781581            $this->errors[] = $msg;
    15791582        }
    1580 
    15811583    }
    15821584
     
    15911593        $msg = $Exception->getMessage();
    15921594        $this->error($msg, $key, $ignore);
     1595    }
     1596
     1597
     1598    /**
     1599     * @param string $field
     1600     */
     1601    public function clearError($field)
     1602    {
     1603        if (isset($this->errors[$field])) {
     1604            unset($this->errors[$field]);
     1605        }
     1606        if (!$this->errors) {
     1607            $this->has_success = true;
     1608        }
    15931609    }
    15941610
     
    20742090    protected static function addToFooter($html)
    20752091    {
    2076         add_action('wp_footer', function() use ($html){
    2077             echo $html;
    2078         }, 100);
     2092        if (function_exists('wp_footer')) {
     2093            add_action('wp_footer', function() use ($html){
     2094                echo $html;
     2095            }, 100);
     2096        } else {
     2097            $GLOBALS['footer_includes'][] = $html;
     2098        }
    20792099    }
    20802100
  • wp-platform/trunk/classes/Setup.php

    r1785176 r2150190  
    114114
    115115        //router
    116         add_action('after_setup_theme', array(__CLASS__, 'router'));
    117         add_action('admin_menu', array(__CLASS__, 'router'));
     116        add_action('wp_loaded', array(__CLASS__, 'router'));
    118117
    119118        //error handler
     
    200199    }
    201200
    202     /**
     201     /**
    203202     * @return void
    204203     */
    205204    public static function sessionStart()
    206205    {
    207         if (!session_id()) {
    208             session_start();
     206        if (!headers_sent()) {
     207            if (!session_id()) {
     208                session_start();
     209            }
    209210        }
    210211    }
  • wp-platform/trunk/plugin.php

    r1785176 r2150190  
    22/**
    33 * Plugin Name: WP-Platform V1
    4  * Version: 1.7.32
     4 * Version: 1.7.39
    55 * Description: Platform to allow developers to build bespoke functionality in an MVC and OOP fashion
    66 */
Note: See TracChangeset for help on using the changeset viewer.