Changeset 2150190
- Timestamp:
- 09/03/2019 01:10:45 PM (7 years ago)
- Location:
- wp-platform/trunk
- Files:
-
- 5 edited
-
classes/Breadcrumb.php (modified) (1 diff)
-
classes/Controller.php (modified) (2 diffs)
-
classes/Form.php (modified) (5 diffs)
-
classes/Setup.php (modified) (2 diffs)
-
plugin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-platform/trunk/classes/Breadcrumb.php
r1678156 r2150190 12 12 public function generate() 13 13 { 14 15 14 global $wp_query; 16 15 global $post; 17 16 //print_r($wp_query);exit; 17 18 if (is_feed()) { 19 return; 20 } 18 21 19 22 //reset -
wp-platform/trunk/classes/Controller.php
r1678156 r2150190 75 75 76 76 $controller = new $controller_name(); 77 $controller->mergeData($this->data); 77 78 $controller->call($action, $params); 78 79 79 $this-> data = array_merge($this->data,$controller->data);80 $this->mergeData($controller->data); 80 81 81 82 } … … 187 188 } 188 189 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 189 199 } -
wp-platform/trunk/classes/Form.php
r1724302 r2150190 202 202 if (!$this->submitted()) { 203 203 $value = $initial; 204 } else if (isset($_REQUEST[$name]) ) {204 } else if (isset($_REQUEST[$name]) && $_REQUEST[$name] !== '') { 205 205 $value = $_REQUEST[$name]; 206 206 } else { 207 $value = '';207 $value = null; 208 208 } 209 209 … … 401 401 if ($is_multi && in_array($key, $value)) { 402 402 $selected = ' selected="selected"'; 403 } elseif ($key == $value) { 403 } elseif ($value !== null && $key == $value) { 404 $selected = ' selected="selected"'; 405 } elseif ($value === null && $key === $value) { 404 406 $selected = ' selected="selected"'; 405 407 } else { … … 1568 1570 * @return void 1569 1571 */ 1570 public function error($msg, $key=false, $ignore=false) 1571 { 1572 1572 public function error($msg, $key = null, $ignore = false) 1573 { 1573 1574 $this->has_success = false; 1574 1575 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 { 1578 1581 $this->errors[] = $msg; 1579 1582 } 1580 1581 1583 } 1582 1584 … … 1591 1593 $msg = $Exception->getMessage(); 1592 1594 $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 } 1593 1609 } 1594 1610 … … 2074 2090 protected static function addToFooter($html) 2075 2091 { 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 } 2079 2099 } 2080 2100 -
wp-platform/trunk/classes/Setup.php
r1785176 r2150190 114 114 115 115 //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')); 118 117 119 118 //error handler … … 200 199 } 201 200 202 /**201 /** 203 202 * @return void 204 203 */ 205 204 public static function sessionStart() 206 205 { 207 if (!session_id()) { 208 session_start(); 206 if (!headers_sent()) { 207 if (!session_id()) { 208 session_start(); 209 } 209 210 } 210 211 } -
wp-platform/trunk/plugin.php
r1785176 r2150190 2 2 /** 3 3 * Plugin Name: WP-Platform V1 4 * Version: 1.7.3 24 * Version: 1.7.39 5 5 * Description: Platform to allow developers to build bespoke functionality in an MVC and OOP fashion 6 6 */
Note: See TracChangeset
for help on using the changeset viewer.