source: extensions/cl_conflit/conflit.inc.php @ 7882

Last change on this file since 7882 was 7880, checked in by cljosse, 13 years ago

[cl_conflit] create of cl_conflit

File size: 4.7 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | Piwigo - a PHP based picture gallery                                  |
4// | cl_conflit                                                             |
5// +-----------------------------------------------------------------------+
6// | Copyright(C) 2010      cljosse                                        |
7// +-----------------------------------------------------------------------+
8// | This program is free software; you can redistribute it and/or modify  |
9// | it under the terms of the GNU General Public License as published by  |
10// | the Free Software Foundation                                          |
11// |                                                                       |
12// | This program is distributed in the hope that it will be useful, but   |
13// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
14// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
15// | General Public License for more details.                              |
16// |                                                                       |
17// | You should have received a copy of the GNU General Public License     |
18// | along with this program; if not, write to the Free Software           |
19// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
20// | USA.                                                                  |
21// +-----------------------------------------------------------------------+
22if (!defined('CONFLIT_PATH')) 
23define(
24  'CONFLIT_PATH',
25   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'
26);
27
28class conflit_controler {
29//============================================================
30 /*
31  *  cl_conflit_script
32 */
33 static public function cl_conflit_script()
34        {
35           global  $template,$user,$conf,$picture ,$page,$cl_version;
36                $my_path =  basename(dirname(__FILE__)).'/' ;
37            $my_path = dirname(__FILE__).'/';
38                $template->set_filenames(array('cl_conflit_init'=>$my_path. "template/conflit.tpl" ) ); 
39                $debug = isset($conf['debug']) ? $conf['debug'] : false ; 
40                $cl_conflit =  isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ;                     
41                $theme=$user['theme'];
42                         
43                $template->assign(
44                                                array( 'version' => $cl_version['version'] ,
45                                                'cl_conflit' => $cl_conflit  ,
46                                                'theme' => $theme  ,
47                                                'DEBUG' => $debug   ,
48                                                'CONFLIT_ROOT' => CONFLIT_PATH)
49                                                 );
50
51                if(     $page['body_id'] == 'theAdminPage' ) return ;
52                return $template->parse( 'cl_conflit_init', false);
53        }// function cl_autosize_script
54//=================================================================================
55/*
56 *
57*/
58 static public function cl_conflit_script_2()
59 {
60                global  $template,$user,$conf,$picture ,$page,$cl_version;
61         
62                        $my_path =  basename(dirname(__FILE__)).'/' ;
63                        $my_path = dirname(__FILE__).'/';
64                        $debug = isset($conf['debug']) ? $conf['debug'] : false ; 
65                        $cl_conflit =  isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ;
66                        $theme=$user['theme'];
67
68                        $template->assign(
69                                        array('version' => $cl_version['version'] ,
70                                                'ma_page' =>    $page['body_id'],
71                                                'cl_conflit' => $cl_conflit  ,
72                                                'theme' => $theme  ,
73                                                'DEBUG' => $debug   ,
74                                                'CONFLIT_ROOT' => CONFLIT_PATH)
75                                                );
76                                                 
77                $autoscript="<script type='text/javascript'>
78         
79        if (typeof (save_framework) == 'function')
80        save_framework('".$page['body_id']."');
81</script>";
82                $template->append('footer_elements',$autoscript); 
83                return ;
84
85
86 }// function cl_autosize_script_2
87
88 //=================================================================
89 /*
90 * 
91 */
92 static public function cl_conflit_script_3($content)
93 {
94           global  $template,$user,$conf,$picture ,$page,$cl_version;
95           
96                        $my_path =  basename(dirname(__FILE__)).'/' ;
97                        $my_path = dirname(__FILE__).'/';
98                        $debug = isset($conf['debug']) ? $conf['debug'] : false ; 
99                        $cl_conflit =  isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ;
100                        $theme=$user['theme'];
101
102$ThePicture = $template->get_template_vars('current');
103$tpl_name =   $user['theme'] ;
104if ( !empty($content) )   {  return $content;  }       
105if ($ThePicture['is_picture'] <> 1 )    {  return $content;  ; }       
106
107         $autosizejs = '<script type="text/javascript" charset="utf-8"  src="';
108              $autocss =   $autosizejs.'themes/default/js/jquery.packed.js"></script>'."\n"; 
109                  $template->append('head_elements',$autocss);
110
111                $autocss="<script type='text/javascript'>
112    //   jQuery('#theImage').css({opacity:'0.0'});
113</script>";
114
115                $template->append('footer_elements',"\n".$autocss);
116                return $content ;
117
118
119 }// function cl_autosize_script_3
120
121
122} // class
123
124
125
126
127
128?>
Note: See TracBrowser for help on using the repository browser.