Changeset 384
- Timestamp:
- 10/05/07 20:46:36 (1 year ago)
- Files:
-
- trunk/config/locales/en.php (modified) (1 diff)
- trunk/config/locales/es.php (modified) (1 diff)
- trunk/lib/AkActionController.php (modified) (7 diffs)
- trunk/lib/AkRequest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/config/locales/en.php
r383 r384 155 155 $dictionary['Please add force=true to the argument list in order to overwrite existing files.'] = 'Please add force=true to the argument list in order to overwrite existing files.'; 156 156 157 // 2007-10-06 3:15:57 158 159 160 $dictionary['Could not find a helper to handle the method "%method" you called in your view'] = 'Could not find a helper to handle the method "%method" you called in your view'; 161 157 162 158 163 ?> trunk/config/locales/es.php
r383 r384 149 149 $dictionary['Please add force=true to the argument list in order to overwrite existing files.'] = 'Please add force=true to the argument list in order to overwrite existing files.'; 150 150 151 // 2007-10-06 3:15:57 152 153 154 $dictionary['Could not find a helper to handle the method "%method" you called in your view'] = 'Could not find a helper to handle the method "%method" you called in your view'; 155 151 156 152 157 ?> trunk/lib/AkActionController.php
r383 r384 125 125 126 126 var $module_name; 127 127 var $_module_path; 128 128 129 /** 129 130 * Old fashioned way of dispatching requests. Please use AkDispatcher or roll your own. … … 235 236 { 236 237 $helpers = $this->getDefaultHelpers(); 237 238 238 $helpers = array_merge($helpers, $this->getApplicationHelpers()); 239 239 240 240 require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'AkActionViewHelper.php'); 241 241 242 242 $current_controller_helper = $this->getControllerName(); 243 $current_controller_helper_file_name = AK_HELPERS_DIR.DS.AkInflector::underscore($current_controller_helper).'_helper.php'; 243 $current_controller_helper_file_name = AK_HELPERS_DIR.DS.$this->_module_path.AkInflector::underscore($current_controller_helper).'_helper.php'; 244 244 245 if(file_exists($current_controller_helper_file_name)){ 245 246 $helpers[$current_controller_helper_file_name] = $current_controller_helper; … … 286 287 { 287 288 $helper_names = array(); 288 289 289 if ($this->app_helpers == 'all' ){ 290 290 $available_helpers = Ak::dir(AK_HELPERS_DIR,array('dirs'=>false)); … … 520 520 $this->_flash_handled ? null : $this->_handleFlashAttribute(); 521 521 522 // Ror Backwards compatibility523 522 if(!is_array($options)){ 524 523 return $this->renderFile(empty($options) ? $this->getDefaultTemplateName() : $options, $status, true); … … 778 777 779 778 if(!isset($this->controller_name)){ 780 $current_class_name = get_class($this);779 $current_class_name = str_replace('_', '::', get_class($this)); 781 780 782 781 $included_controllers = $this->_getIncludedControllerNames(); 783 $lowercase_included_controllers = array_ filter($included_controllers, 'strtolower');782 $lowercase_included_controllers = array_map('strtolower', $included_controllers); 784 783 $key = array_search(strtolower($current_class_name), $lowercase_included_controllers, true); 785 784 $found_controller = substr($included_controllers[$key], 0, -10); … … 807 806 $this->module_name = join('/', array_map(array('AkInflector','underscore'), strstr($module_parts, '::') ? explode('::', $module_parts) : array($module_parts))); 808 807 $this->controller_name = substr($this->controller_name, strrpos($this->controller_name, '::')+2); 808 809 809 } 810 810 } … … 1372 1372 if(!empty($layout)){ 1373 1373 $layout = strstr($layout,'/') || strstr($layout,DS) ? $layout : 'layouts'.DS.$layout; 1374 $layout = substr($layout,0,7) === 'layouts' ? AK_VIEWS_DIR.DS.$layout.'.tpl' : $layout.'.tpl'; 1374 $layout = substr($layout,0,7) === 'layouts' ? 1375 (empty($this->_module_path) ? AK_VIEWS_DIR.DS.$layout.'.tpl' : AK_VIEWS_DIR.DS.'layouts'.DS.trim($this->_module_path, DS).'.tpl') : 1376 $layout.'.tpl'; 1375 1377 if (file_exists($layout)) { 1376 1378 return $layout; trunk/lib/AkRequest.php
r383 r384 746 746 if(!empty($params['module'])){ 747 747 $module_path = trim(str_replace(array('/','\\'), DS, Ak::sanitize_include($params['module'], 'high')), DS).DS; 748 $module_shared_model = AK_CONTROLLERS_DIR.DS.trim($module_path,DS).'_controller.php'; 748 749 $module_class_peffix = str_replace(' ','_',AkInflector::titleize(str_replace(DS,' ', trim($module_path, DS)))).'_'; 749 750 } … … 753 754 $controller_path = AK_CONTROLLERS_DIR.DS.$module_path.$controller_file_name; 754 755 include_once(AK_APP_DIR.DS.'application_controller.php'); 756 757 if(!empty($module_path) && file_exists($module_shared_model)){ 758 include_once($module_shared_model); 759 } 760 755 761 if(@!include_once($controller_path)){ 756 762 trigger_error(Ak::t('Could not find the file /app/controllers/<i>%controller_file_name</i> for '.
