Changeset 3199


Ignore:
Timestamp:
09/01/10 16:28:19 (14 years ago)
Author:
alexandrecorreia
Message:

Ticket #764 - Correcao do valor caminho absoluto para relativo ( controller.xml ).

Location:
branches/2.2/jabberit_messenger
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/jabberit_messenger/controller.php

    r3102 r3199  
    77        ); 
    88} 
     9 
    910require_once '../header.session.inc.php'; 
    1011 
     
    2526} 
    2627 
    27 require_once dirname(__FILE__) . '/inc/Controller.class.php'; 
     28if( file_exists(dirname(__FILE__) . "/inc/Controller.class.php") ) 
     29{ 
     30        require_once dirname(__FILE__) . '/inc/Controller.class.php'; 
    2831 
    29 $controller = new Controller; 
    30 printf("%s", $controller->exec($$request_method)); 
     32        $controller = new Controller(); 
     33        printf("%s", $controller->exec($$request_method, dirname(__FILE__))); 
     34        exit(0); 
     35} 
    3136 
    32 exit(0); 
    3337?> 
  • branches/2.2/jabberit_messenger/inc/Controller.class.php

    r3102 r3199  
    2626 
    2727        private $fatalError                                                     = false; 
     28        private $_PATH                                                          = ""; 
    2829 
    2930        public function __construct() 
     
    8990                        { 
    9091                                case 'exec' : 
    91                                         return $this->_exec($arguments[0]); 
     92                                        return $this->_exec($arguments[0], $arguments[1]); 
    9293                                break; 
    9394                                default : return "Method not avaible"; 
     
    100101        } 
    101102 
    102         private final function _exec(array &$pRequest) 
     103        private final function _exec(array &$pRequest, $pPath) 
    103104        { 
    104105                ( $pRequest[$this->string_access] ) 
     
    133134                        and die(__CLASS__ . ' [ ERROR #14 ] :: invalid reference "' . $ref . '"'); 
    134135 
    135                 $path = $section_itens->item($i)->getAttribute('path') 
    136                         or $path = $section->getAttribute('path') 
    137                         or die(__CLASS__ . ' [ ERROR #15 ] :: bad path argument'); 
     136                if( $section_itens->item($i)->getAttribute('path') ) 
     137                        $path = $section_itens->item($i)->getAttribute('path'); 
     138                else if ( $section->getAttribute('path') ) 
     139                        $path = $pPath . $section->getAttribute('path'); 
     140 
     141                if( !$path ) die(__CLASS__ . ' [ ERROR #15 ] :: bad path argument'); 
    138142 
    139143                $prefix = $section_itens->item($i)->getAttribute('prefix') 
     
    188192 
    189193                $file = "{$pPath}/{$pPrefix}{$js}{$pSuffix}"; 
    190                 //$file = "../jabberit_messenger/{$pPath}/{$pPrefix}{$js}{$pSuffix}"; 
    191194 
    192195                file_exists($file) 
    193                         or die(__CLASS__ . ' [ ERROR #19 ] :: the file that has the class was not opened'); 
     196                        or die(__CLASS__ . ' [ ERROR #19 ] :: the file that has the class was not opened' . $file ); 
    194197 
    195198                $debug = $pSectionItem->parentNode->getAttribute('debug'); 
    196199                 
    197200                return file_get_contents($file); 
    198  
    199201        } 
    200202} 
  • branches/2.2/jabberit_messenger/inc/controller.xml

    r3102 r3199  
    1717        <controller-sections> 
    1818                <css></css> 
    19                 <js path="/var/www/expresso/jabberit_messenger/js" suffix=".js"> 
     19                <js path="/js" suffix=".js"> 
    2020                        <item ref="connector" js="connector" /> 
    2121                        <item ref="editSelect" js="editSelect" /> 
     
    3131                        <item ref="makeW" js="makeW" /> 
    3232                </js> 
    33                 <php path="/var/www/expresso/jabberit_messenger/inc" suffix=".class.php"> 
     33                <php path="/inc" suffix=".class.php"> 
    3434                        <item ref="contacts_im" alias="getParticipantsExternal" class="contacts_im" method="getParticipantsExternal" prefix="class." suffix=".inc.php"/> 
    3535                        <item ref="contacts_im" alias="list_contacts" class="contacts_im" method="list_contacts" prefix="class." suffix=".inc.php"/> 
  • branches/2.2/jabberit_messenger/inc/jabberit_acl.inc.php

    r3102 r3199  
    9191                                                'j.editSelect' 
    9292                                                ); 
    93          
     93 
    9494                        require_once dirname(__FILE__) . '/Controller.class.php'; 
    9595         
     
    9999                        foreach( $js as $key => $val )  
    100100                        { 
    101                                 $script .= $controller->exec(array('act' => $val)); 
     101                                $script .= $controller->exec(array('act' => $val), substr(dirname(__FILE__), 0, strlen( dirname(__FILE__) )-4)); 
    102102                        }        
    103103                         
Note: See TracChangeset for help on using the changeset viewer.