Ignore:
Timestamp:
Jan 12, 2011, 3:23:39 PM (13 years ago)
Author:
cljosse
Message:

[cl_conflit] compatibility whith piwishack


File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/cl_conflit/conflit.inc.php

    r8187 r8629  
    22// +-----------------------------------------------------------------------+
    33// | Piwigo - a PHP based picture gallery                                  |
    4 // | cl_conflit                                                             |
     4// | cl_conflit                                                            |
    55// +-----------------------------------------------------------------------+
    66// | Copyright(C) 2010      cljosse                                        |
     
    2929//============================================================
    3030 /*
    31   *  cl_conflit_script
     31  *  cl_conflit_script_1
    3232 */
    33  static public function cl_conflit_script()
     33 static public function cl_conflit_script_1()
    3434        {
    35            global  $template,$user,$conf,$picture ,$page,$cl_plugin;
    36  
     35                global  $template,$user,$conf,$picture ,$page,$cl_plugin;
     36                if (isset( $page['body_id']) && $page['body_id']=='theAdminPage'  ) return ;
     37                $ma_page=isset($page['body_id'])?$page['body_id']:"" ;
     38                if ($ma_page=='thePiwiShackControllerPage') return ;
    3739                $my_path =  basename(dirname(__FILE__)).'/' ;
    3840            $my_path = dirname(__FILE__).'/';
    3941                $template->set_filenames(array('cl_conflit_init'=>$my_path. "template/conflit.tpl" ) );
    40                 $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    41 $cl_conflit_parametres =         cl_conflit_Get_Options() ;
    42 
    43                        
     42                $DEBUG =  isset($conf['cl_debug']) ? $conf['cl_debug'] : "false"  ;
     43                $cl_conflit_parametres =         cl_conflit_Get_Options() ;
    4444                $theme=$user['theme'];
    45                
     45                $url = get_root_url();         
    4646                $template->assign(
    4747                                                array(
     
    5050                                                'cl_version' => $cl_plugin['version'] ,
    5151                                                'name' => $cl_plugin['name'] ,
    52                                                
     52                                                'MY_ROOT' => $url,                                             
    5353                                                'theme' => $theme  ,
    54                                                 'DEBUG' => $debug   ,
    55                                                 'CONFLIT_ROOT' => CONFLIT_PATH)
     54                                                'DEBUG' => $DEBUG   ,
     55                                                'CONFLIT_PATH' => CONFLIT_PATH)
    5656                                                 );
    57 
    58                 if(     $page['body_id'] == 'theAdminPage' ) return ;
     57       
    5958                return $template->parse( 'cl_conflit_init', false);
    60         }// function cl_conflit_script
     59        }// function cl_conflit_script_1
    6160//=================================================================================
    6261/*
    63  *
     62 * cl_conflit_script_2
    6463*/
    6564 static public function cl_conflit_script_2()
    6665 {
    6766                global  $template,$user,$conf,$picture ,$page,$cl_plugin;
    68          
    69                         $my_path =  basename(dirname(__FILE__)).'/' ;
    7067                        $my_path = dirname(__FILE__).'/';
    71                         $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    72                          
    73                         $theme=$user['theme'];
     68                        $DEBUG =  isset($conf['cl_debug']) ? $conf['cl_debug'] : "false"  ;
     69                        $ma_page=isset($page['body_id'])?$page['body_id']:"" ;                   
     70                        $theme=$user['theme'];                         
     71                        if ($ma_page=='thePiwiShackControllerPage') return ;
    7472
    7573                        $template->assign(
     
    7775                                            'cl_version' => $cl_plugin['version'] ,
    7876                                                'name' => $cl_plugin['name'] ,
    79                                                 'ma_page' =>    $page['body_id'],
     77                                                'ma_page' =>    $ma_page,
    8078                                                 
    8179                                                'theme' => $theme  ,
    82                                                 'DEBUG' => $debug   ,
    83                                                 'CONFLIT_ROOT' => CONFLIT_PATH)
     80                                                'DEBUG' => $DEBUG   ,
     81                                                'CONFLIT_PATH' => CONFLIT_PATH)
    8482                                                );
    8583                                                 
    86                 $autoscript="<script type='text/javascript'>
    87          
    88         if (typeof (save_framework) == 'function')
    89         save_framework('".$page['body_id']."');
    90 </script>";
    91                 $template->append('footer_elements',$autoscript); 
    92                 return ;
    93 
    94 
     84                                $autoscript="<script type='text/javascript'>
     85                                /* cl_conflit_script_2 */       
     86                                if (typeof (save_framework) == 'function')
     87                                        save_framework('".$page['body_id']."');
     88                                </script>";
     89                        $template->append('footer_elements',$autoscript); 
     90                        return ;
    9591 }// function cl_conflit_script_2
    9692
    97  //=================================================================
    98  /*
    99  * 
    100  */
    101  static public function cl_conflit_script_3($content)
    102  {
    103            global  $template,$user,$conf,$picture ,$page,$cl_plugin;
    104            
    105                         $my_path =  basename(dirname(__FILE__)).'/' ;
    106                         $my_path = dirname(__FILE__).'/';
    107                         $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    108                          
    109                         $theme=$user['theme'];
    110 
    111 $ThePicture = $template->get_template_vars('current');
    112 $tpl_name =   $user['theme'] ;
    113 if ( !empty($content) )   {  return $content;  }       
    114 if ($ThePicture['is_picture'] <> 1 )    {  return $content;  ; }       
    115 
    116          $cl_conflitjs = '<script type="text/javascript" charset="utf-8"  src="';
    117               $autocss =   $cl_conflitjs.'themes/default/js/jquery.packed.js"></script>'."\n";
    118                   $template->append('head_elements',$autocss);
    119 
    120                 $autocss="<script type='text/javascript'>
    121     //   jQuery('#theImage').css({opacity:'0.0'});
    122 </script>";
    123 
    124                 $template->append('footer_elements',"\n".$autocss);
    125                 return $content ;
    126 
    127 
    128  }// function cl_conflit_script_3
     93    //================================================
    12994        /*
    130         *
     95        * cl_conflit_admin
    13196        */
    13297        static public function cl_conflit_admin($menu)
     
    184149         
    185150 }
    186 
    187 
    188 
    189 
    190151?>
Note: See TracChangeset for help on using the changeset viewer.