Ignore:
Timestamp:
08/15/10 18:45:12 (22 months ago)
Author:
vain
Message:
  • several changes to copyright, router, bootstrap, frontcontroller and various other files
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/viewhelper/smarty/function.load_module.php

    r4493 r4578  
    3737    /*if($params['name'] == 'news') 
    3838    { 
    39         clansuite_xdebug::firebug($params); 
     39        Clansuite_Debug::firebug($params); 
    4040    }*/ 
    4141 
    4242    # Init incomming Variables 
    43     $module    = isset( $params['name'] ) ? (string) mb_strtolower($params['name']) : ''; 
    44     $submodule    = isset( $params['sub'] ) ? (string) mb_strtolower($params['sub']) : ''; 
    45     $action = isset( $params['action'] ) ? (string) $params['action'] : ''; 
    46     $items  = isset( $params['items'] )  ? (int) $params['items'] : null; 
     43    $module = isset($params['name']) ? (string) mb_strtolower($params['name']) : ''; 
     44    $submodule = isset($params['sub']) ? (string) mb_strtolower($params['sub']) : ''; 
     45    $action = isset($params['action']) ? (string) $params['action'] : ''; 
     46    $items = isset($params['items']) ? (int) $params['items'] : null; 
    4747 
    4848    # WATCH it, this resets the incomming parameters array 
     
    5151    $module_classname = 'clansuite_module_'; 
    5252    # Construct the variable module_name 
    53     if (isset($submodule) and mb_strlen($submodule) > 0) 
     53    if(isset($submodule) and mb_strlen($submodule) > 0) 
    5454    { 
    5555        # like "clansuite_module_admin_menu" 
    56         $module_classname .= $module . '_'. $submodule; 
     56        $module_classname .= $module . '_' . $submodule; 
    5757    } 
    5858    else 
     
    6565 
    6666    # Load class, if not already loaded 
    67     if (class_exists($module_classname, false) == false) 
     67    if(class_exists($module_classname, false) == false) 
    6868    { 
    6969        # Check if class was loaded 
    70         if( Clansuite_Loader::loadModul($module_classname) == false) 
     70        if(Clansuite_Loader::loadModul($module_classname) == false) 
    7171        { 
    72             return '<br/>Module missing or misspelled: <strong>'. $module_classname.'</strong>'; 
     72            return '<br/>Module missing or misspelled: <strong>' . $module_classname . '</strong>'; 
    7373        } 
    7474    } 
    7575 
    7676    # Instantiate Class 
    77     $controller = new $module_classname; 
     77    $controller = new $module_classname( 
     78                Clansuite_CMS::getInjector()->instantiate('Clansuite_HttpRequest'), 
     79                Clansuite_CMS::getInjector()->instantiate('Clansuite_HttpResponse') 
     80    ); 
    7881    $controller->setView($smarty); 
    7982    $controller->initModel($module); 
     
    8285     * Get the Ouptut of the Object->Method Call 
    8386     */ 
    84     if( method_exists( $controller, $action ) ) 
     87    if(method_exists($controller, $action)) 
    8588    { 
    8689        # exceptional handling of parameters and output for adminmenu 
    87         if ( $module_classname == 'clansuite_module_menu_admin' ) 
     90        if($module_classname == 'clansuite_module_menu_admin') 
    8891        { 
    8992            $parameters = array(); 
    9093 
    9194            # Build a Parameter Array from Parameter String like: param|param|etc 
    92             if( empty($params['params']) ) 
     95            if(empty($params['params'])) 
    9396            { 
    9497                $parameters = null; 
     
    102105        } 
    103106 
    104         # fast call 
     107        # call 
    105108        $controller->$action($items); 
    106  
    107         #Clansuite_Loader::callClassMethod($controller, $action, $items); 
    108109 
    109110        /** 
     
    116117         * wich is defined by $smarty->template_dir. 
    117118         * the order of detection is also determined by that array. 
    118          * @see $smarty->template_dir, clansuite_xdebug::printr($smarty->template_dir); 
     119         * @see $smarty->template_dir, Clansuite_Debug::printr($smarty->template_dir); 
    119120         */ 
    120  
    121         if($smarty->templateExists($module.DS.$action.'.tpl')) 
     121        if($smarty->templateExists($module . DS . $action . '.tpl')) 
    122122        { 
    123123            # $smarty->template_dir[s]..\news\widget_news.tpl 
    124             return $smarty->fetch($module.DS.$action.'.tpl'); 
     124            return $smarty->fetch($module . DS . $action . '.tpl'); 
    125125        } 
    126         elseif($smarty->templateExists($module.DS.'view'.DS.$action.'.tpl')) 
     126        elseif($smarty->templateExists($module . DS . 'view' . DS . $action . '.tpl')) 
    127127        { 
    128128            # $smarty->template_dir[s]..\news\view\widget_news.tpl 
    129             return $smarty->fetch($module.DS.'view'.DS.$action.'.tpl'); 
     129            return $smarty->fetch($module . DS . 'view' . DS . $action . '.tpl'); 
    130130        } 
    131131        else 
    132132        { 
    133             return $smarty->trigger_error('Error! Failed to load Widget-Template for <br /> '.$module_classname.' -> '.$action.'('.$items.')'); 
     133            return $smarty->trigger_error('Error! Failed to load Widget-Template for <br /> ' . $module_classname . ' -> ' . $action . '(' . $items . ')'); 
    134134        } 
    135135    } 
    136136    else 
    137137    { 
    138         return $smarty->trigger_error('Error! Failed to load Widget: <br /> '.$module_classname.' -> '.$action.'('.$items.')'); 
     138        return $smarty->trigger_error('Error! Failed to load Widget: <br /> ' . $module_classname . ' -> ' . $action . '(' . $items . ')'); 
    139139    } 
    140140} 
Note: See TracChangeset for help on using the changeset viewer.