Changeset 861174
- Timestamp:
- 02/19/2014 09:23:07 PM (12 years ago)
- Location:
- orillacart/trunk
- Files:
-
- 7 edited
-
com_shop/front/views/product/view.html.php (modified) (2 diffs)
-
com_shop/front/views/product_list/view.html.php (modified) (2 diffs)
-
com_shop/helpers/fields.php (modified) (2 diffs)
-
core/component.php (modified) (1 diff)
-
core/view.php (modified) (6 diffs)
-
main.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
orillacart/trunk/com_shop/front/views/product/view.html.php
r802008 r861174 22 22 23 23 24 add_filter(' override_shop', array($this, 'override_templates'), 1, 9);24 add_filter('edit_template_paths_shop', array($this, 'override_templates'), 1, 9); 25 25 26 26 if (has_post_thumbnail()) { … … 210 210 211 211 public function override_templates(array $paths) { 212 $paths[] = dirname(__FILE__) . "/templates/" . $this->row->product->tpl; 212 213 foreach ($paths as $k => $v) { 214 $paths[$k] = trailingslashit($v) . $this->row->product->tpl; 215 } 213 216 return $paths; 214 217 } -
orillacart/trunk/com_shop/front/views/product_list/view.html.php
r852296 r861174 17 17 )); 18 18 $this->assign('pagination', $pagination); 19 add_filter(' override_shop', array($this, 'override_templates'), 1, 9);19 add_filter('edit_template_paths_shop', array($this, 'override_templates'), 1, 9); 20 20 21 21 Factory::getMainframe()->addscript('jquery'); … … 77 77 } 78 78 79 public function override_templates($paths) { 80 $paths[] = dirname(__FILE__) . "/templates/" . empty($this->category->list_template) ? 'list.tpl.php': $this->category->list_template; 81 82 return $paths; 79 public function override_templates(array $paths) { 80 81 foreach ($paths as $k => $v) { 82 $paths[$k] = trailingslashit($v) . $this->row->product->tpl; 83 } 84 return $paths; 83 85 } 84 86 -
orillacart/trunk/com_shop/helpers/fields.php
r802008 r861174 89 89 90 90 public function remove_field($name) { 91 if (array_key_exists($name, $this->_fields)) { 91 92 if (array_key_exists($name, $this->_fields)) { 92 93 unset($this->_fields[$name]); 93 94 return true; … … 127 128 protected $_error_msg = ''; 128 129 protected $_val_callback = array(); 130 protected $_exclude = false; 131 132 public function exclude(){ 133 $this->_exclude = true; 134 $this->set_required(false); 135 } 136 137 public function is_excluded(){ 138 return (bool)$this->_exclude; 139 } 129 140 130 141 public function add_validation($v = array()) { -
orillacart/trunk/core/component.php
r829921 r861174 18 18 abstract static public function register_component($components); 19 19 20 public function getMode(){ 21 return $this->mode; 22 } 20 23 public function add_custom_error($contex, $error, $use_session = true) { 21 24 -
orillacart/trunk/core/view.php
r817387 r861174 92 92 Factory::getApplication()->setMessage($msg, $type); 93 93 } 94 95 94 96 95 public function __construct() { … … 185 184 public function display($tpl = 'default') { 186 185 187 $app = $this->app();186 $app = $this->app(); 188 187 189 188 if (Framework::is_admin() && !request::is_internal() && !Request::is_ajax()) { … … 205 204 static $overrides = array(); 206 205 207 206 208 207 $paths = array(); 209 208 210 209 $com = strtolower($this->app()->getName()); 210 //search for overrides 211 212 211 213 212 214 if (array_key_exists($com, $overrides)) { 213 215 $paths = (array) $overrides[$com]; 214 216 } else { 215 217 218 219 $view_path = str_replace(path::clean($this->app()->getComponentPath() . DS . "views"), "", path::clean($this->_path)); 220 221 $view_path = path::clean($view_path); 222 223 //add wp_content also with lower priority 224 $paths[] = WP_CONTENT_DIR . DS . "com_" . $com . "_" . $this->app()->getMode() . $view_path; 225 //add the template path 226 $paths[] = get_stylesheet_directory() . DS . "com_" . $com . "_" . $this->app()->getMode() . $view_path; 227 228 216 229 $paths = (array) apply_filters('override_' . $com, $paths); 217 230 … … 221 234 222 235 $paths = array_reverse($paths); 223 224 236 237 $paths = (array) apply_filters('edit_template_paths_' . $com, $paths); 225 238 226 239 $the_path = null; … … 242 255 $path = $this->_path . "/templates"; 243 256 244 245 246 257 if (file_exists($path . "/" . $tpl . ".tpl.php")) { 247 258 … … 252 263 } 253 264 254 throw new Exception("template:" . $tpl . __(" file cant be located!","com_shop")); 255 } 265 throw new Exception("template:" . $tpl . __(" file cant be located!", "com_shop")); 266 } 267 256 268 } -
orillacart/trunk/main.php
r856599 r861174 3 3 /* 4 4 Plugin Name: OrillaCart 5 Version: 1.0.2 05 Version: 1.0.21 6 6 Description: ecommerce solution for WordPress 7 7 Plugin URI: http://orillacart.com -
orillacart/trunk/readme.txt
r856599 r861174 86 86 == Changelog == 87 87 88 = 1.0.21 - 19.02.2014 = 89 1. All templates now can be overridden by creating directory com_shop_admin/VIEW_NAME/ and/or com_shop_front/VIEW_NAME/ 90 folders in the theme path or in wp-content. 91 88 92 = 1.0.20 - 12.02.2014 = 89 93 1. shop manager role added.
Note: See TracChangeset
for help on using the changeset viewer.