Changeset 7895


Ignore:
Timestamp:
Nov 27, 2010, 6:14:46 PM (13 years ago)
Author:
cljosse
Message:

[cl_conflit] save

Location:
extensions/cl_conflit
Files:
5 edited

Legend:

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

    r7880 r7895  
    3333 static public function cl_conflit_script()
    3434        {
    35            global  $template,$user,$conf,$picture ,$page,$cl_version;
     35           global  $template,$user,$conf,$picture ,$page,$cl_plugin;
    3636                $my_path =  basename(dirname(__FILE__)).'/' ;
    3737            $my_path = dirname(__FILE__).'/';
     
    4040                $cl_conflit =  isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ;                     
    4141                $theme=$user['theme'];
    42                          
     42               
    4343                $template->assign(
    44                                                 array( 'version' => $cl_version['version'] ,
     44                                                array(
     45                                                'version' => $cl_plugin['version'] ,
     46                                                'name' => $cl_plugin['id'] ,
    4547                                                'cl_conflit' => $cl_conflit  ,
    4648                                                'theme' => $theme  ,
     
    5860 static public function cl_conflit_script_2()
    5961 {
    60                 global  $template,$user,$conf,$picture ,$page,$cl_version;
     62                global  $template,$user,$conf,$picture ,$page,$cl_plugin;
    6163         
    6264                        $my_path =  basename(dirname(__FILE__)).'/' ;
     
    6769
    6870                        $template->assign(
    69                                         array('version' => $cl_version['version'] ,
     71                                        array(                                         
     72                                            'version' => $cl_plugin['version'] ,
     73                                                'name' => $cl_plugin['id'] ,
    7074                                                'ma_page' =>    $page['body_id'],
    7175                                                'cl_conflit' => $cl_conflit  ,
     
    9296 static public function cl_conflit_script_3($content)
    9397 {
    94            global  $template,$user,$conf,$picture ,$page,$cl_version;
     98           global  $template,$user,$conf,$picture ,$page,$cl_plugin;
    9599           
    96100                        $my_path =  basename(dirname(__FILE__)).'/' ;
  • extensions/cl_conflit/include/affiche.php

    r7880 r7895  
    11<?php 
     2
     3          $plg_data = implode( '', file($path.'main.inc.php') );
     4          if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) )
     5          {
     6            $plugin['name'] = trim( $val[1] );
     7          }
     8          if (preg_match("|Version: (.*)|", $plg_data, $val))
     9          {
     10            $plugin['version'] = trim($val[1]);
     11          }
     12          if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) )
     13          {
     14            $plugin['uri'] = trim($val[1]);
     15          }
     16          if ($desc = load_language('description.txt', $path.'/', array('return' => true)))
     17          {
     18            $plugin['description'] = trim($desc);
     19          }
     20          elseif ( preg_match("|Description: (.*)|", $plg_data, $val) )
     21          {
     22            $plugin['description'] = trim($val[1]);
     23          }
     24          if ( preg_match("|Author: (.*)|", $plg_data, $val) )
     25          {
     26            $plugin['author'] = trim($val[1]);
     27          }
     28          if ( preg_match("|Author URI: (.*)|", $plg_data, $val) )
     29          {
     30            $plugin['author uri'] = trim($val[1]);
     31          }
     32          if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid='))
     33          {
     34            list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']);
     35            if (is_numeric($extension)) $plugin['extension'] = $extension;
     36          }
     37          // IMPORTANT SECURITY !
     38          $plugin = array_map('htmlspecialchars', $plugin);
     39
     40$version = $plugin['version'] ;
     41 
    242
    343$visible=(isset($visible))?$visible:false;
     
    646$version=isset($version)?$version:"";
    747$theme=$user['theme'];
    8 $user_status = $user['status'] ;
     48 
    949
    1050        $template->assign(
    1151                                        array(
    12                                         'thumbnail' => $conf['prefix_thumbnail'],
    13                     'visible' => $visible,
     52                                        'version' => $version,
     53                                        'cl_plugin' => $cl_plugin,
    1454                    'version' => $version,
    1555                    'CONFLIT_PATH' => CONFLIT_PATH,
    1656                    'theme' => $theme,
    17                                          'SCALED_WIDTH' => $picture['current']['scaled_width'],
    18                                          'SCALED_HEIGHT' => $picture['current']['scaled_height'],                   
    19                     'IMG_WIDTH'         => $img_width,
    20                     'IMG_HEIGHT'        => $img_height,
    21                     'MINI_HEIGHT' => $conflit_parametres->mini_height,
    22                     'MINI_WIDTH'        => $conflit_parametres->mini_width,
    23                     'MARGE_BASSE' => $conflit_parametres->marge_basse,
    24                     'ECHELLE_MAX' => $conflit_parametres->echelle_max,
    2557
    26                     'check_auto_w' => ($conflit_parametres->check_auto_w == 'on') ? 'checked="checked"'  : '' ,
    27                     'check_icon_v' => ($conflit_parametres->check_icon_v == 'on') ? 'checked="checked"'  : '' ,
    28                     'check_desc_v' => ($conflit_parametres->check_desc_v == 'on') ? 'checked="checked"'  : '' ,
    29 
    30                                         'webmaster_width' => $conflit_parametres->webmaster_width,
    31                     'webmaster_height' => $conflit_parametres->webmaster_height,
    32                                         'webmaster_enabled' => ($conflit_parametres->webmaster_enabled == 'on') ? 'checked="checked"'  : '' ,
    33 
    34                     'admin_width' => $conflit_parametres->admin_width,
    35                     'admin_height' => $conflit_parametres->admin_height,
    36                                         'admin_enabled' => ($conflit_parametres->admin_enabled == 'on') ? 'checked="checked"'  : '' ,
    37 
    38                     'generic_width' => $conflit_parametres->generic_width,
    39                     'generic_height' => $conflit_parametres->generic_height,
    40                                         'generic_enabled' => ($conflit_parametres->generic_enabled == 'on') ? 'checked="checked"'  : '' ,
    41 
    42                     'guest_width' => $conflit_parametres->guest_width,
    43                     'guest_height' => $conflit_parametres->guest_height,
    44                                         'guest_enabled' => ($conflit_parametres->guest_enabled == 'on') ? 'checked="checked"'  : '' ,
    45                                  
    46                     'normal_width' => $conflit_parametres->normal_width,
    47                     'normal_height' => $conflit_parametres->normal_height,
    48                                         'normal_enabled' => ($conflit_parametres->normal_enabled == 'on') ? 'checked="checked"'  : '' ,
    49 
    50                                         'user_status'   => get_user_status($user_status) 
    5158                                       
    5259                                 )
  • extensions/cl_conflit/js/conflit.js

    r7880 r7895  
    1313    // jQuery est chargé
    1414}
    15 try {
    16     Conflit = { version: Version };
    17 } catch (e) {
    18 
    19 }
     15
    2016//===================================================
    2117var detect = navigator.userAgent.toLowerCase();
     
    145141        }
    146142    } else if (element == document) {
     143
     144        ret_element = jQuery(element);
     145        return ret_element;
     146
     147
     148     } else if (element == window) {
    147149
    148150        ret_element = jQuery(element);
     
    304306        var e_message = e.message;
    305307        var e_stack = e.stack;
     308        var state_ff = "";
    306309        if (e_stack) { //Firefox Opera 3.6
    307310            //=== test fichier source =============
     
    343346                        break;
    344347                    }
    345                     if (Src_Match.match("jQuery")) {
     348                    if (Src_Match.match("jQuery", "gi")) {
    346349                        callstack.push("jQuery");
    347350                        isCallstackPopulated = true;
     351                     
    348352                        break;
    349353                    }
     
    351355            }
    352356            //callstack.shift();
     357            state_ff = callstack.join('\n');
    353358            isCallstackPopulated = false;
    354359        }
     
    386391
    387392        currentFunction = currentFunction.caller;
     393        var fn2 = currentFunction.toString(); // fonction d'appel local (conflit)
    388394        currentFunction = currentFunction.caller;
    389395        //$family
     
    407413            if (fn.match(RegExp("jquery|switchmenu|switchTabs|switchInterface|gally|initializeImageMode", "gi"))) {
    408414                states.push('jQuery');
    409 
     415                break;
    410416            }
    411417            if (fn.match(RegExp("dialog..open", "gi"))) {
    412418                states.push('GMaps');
    413 
     419                break;
    414420            }
    415421            if (fn.match(RegExp("GMaps|applyMap|markupMaps|applyMarkers", "gi"))) {
    416422                states.push('GMaps');
    417 
     423                break;
    418424            }
    419425            //======================
     
    421427
    422428                states.push('paMOOramics');
    423 
     429              break;
    424430            }
    425431            if (fn.match(RegExp("observe|responder|stopobserving|fireContentLoadedEvent", "gi"))) {
    426432                states.push('rv_gmaps');
    427 
     433                break;
    428434            }
    429435            //? bubble 
     
    433439
    434440                    states.push('Luciano');
    435 
     441                    break;
    436442                }
    437443            }
     444            // "window.fireEvent('domready')"
     445            Expression = new RegExp("window.fireEvent", "gi")
     446            if (fn.match(Expression)) {  //luciano
     447                // "window.fireEvent('domready')"
     448                Expression = new RegExp("window.fireEvent..domready..", "gi")
     449                if (fn.match(Expression)) {
     450                    states.push('Luciano');
     451                    break;
     452                }
     453            }
    438454            if (fn.match(RegExp("(splat|buildFrameWork|photoNext)", "gi"))) {  //luciano
    439455
    440456                states.push('Luciano');
    441 
    442             }
    443 
    444             if (all_functions.length > 50) break;
     457                break;
     458            }
     459
     460            if (all_functions.length > 50)
     461            break;
    445462
    446463
     
    449466
    450467    }
     468  // state_ff + "|" +
    451469    state = states.join('\n');
     470    if (state == "")
     471        state = state_ff;
     472
    452473    Fn = all_functions;
    453474    return { state: state, fn: callstack.join('\n') };
     
    463484    });
    464485    //==============================================
     486    librairies=[];
    465487    jQuery.extend(jQuery.expr[':'], {
    466488        // Nom du sélecteur personnalisé
     
    497519                    if (a.src.match(RegExp("mootools|pamooramic|luciano", "gi"))) {
    498520                        jQuery.noop;
    499 
     521                        librairies.push(a.src);
    500522                    }
    501523
     
    534556
    535557}
    536 if (typeof ($fn) != "function") {
    537     $.fn = function (options) {
    538         return jQuery.fn(options);
    539     }
    540 
    541 
    542 }
     558
    543559if (typeof ($.get) != "function") {
    544560    $.get = function (options) {
     
    550566$_ = $;
    551567function save_framework(page) {
    552     Conflit = { version: Version };
     568    try {
     569        Conflit = { version: Version, name: cl_plugin };
     570    } catch (e) {
     571
     572    }
     573   
    553574    $_ = $;
    554575    return
  • extensions/cl_conflit/main.inc.php

    r7882 r7895  
    1212if (!defined('CONFLIT_PATH'))
    1313define(  'CONFLIT_PATH',   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' );
    14 
    15 include_once(CONFLIT_PATH.'conflit.inc.php');
    16 global $cl_version,$cl_plugin ;
    17 //===================================================================
    18         $path = CONFLIT_PATH;
    19           $plg_data = implode( '', file($path.'main.inc.php') );
    20           if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) )
    21           {
    22             $plugin['name'] = trim( $val[1] );
    23           }
    24           if (preg_match("|Version: (.*)|", $plg_data, $val))
    25           {
    26             $plugin['version'] = trim($val[1]);
    27           }
    28           if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) )
    29           {
    30             $plugin['uri'] = trim($val[1]);
    31           }
    32           if ($desc = load_language('description.txt', $path.'/', array('return' => true)))
    33           {
    34             $plugin['description'] = trim($desc);
    35           }
    36           elseif ( preg_match("|Description: (.*)|", $plg_data, $val) )
    37           {
    38             $plugin['description'] = trim($val[1]);
    39           }
    40           if ( preg_match("|Author: (.*)|", $plg_data, $val) )
    41           {
    42             $plugin['author'] = trim($val[1]);
    43           }
    44           if ( preg_match("|Author URI: (.*)|", $plg_data, $val) )
    45           {
    46             $plugin['author uri'] = trim($val[1]);
    47           }
    48           if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid='))
    49           {
    50             list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']);
    51             if (is_numeric($extension)) $plugin['extension'] = $extension;
    52           }
    53            
    54           $plugin = array_map('htmlspecialchars', $plugin);
     14 
     15        $path = CONFLIT_PATH;   
     16         
     17//============================================================================         
     18                  global $cl_version , $cl_plugin ;
    5519                  $cl_version = $plugin;
    56 //============================================================================         
    57 
    58 
     20                  $cl_plugin = $plugin;
     21//============================================================================
     22include_once(CONFLIT_PATH.'conflit.inc.php');   
    5923$conflit_controler = new conflit_controler();
    6024
  • extensions/cl_conflit/template/conflit.tpl

    r7880 r7895  
    88    var DEBUG = '{$DEBUG}';
    99    var theme = '{$theme}';
    10     var Version =  '{$version}' ;
     10    var Version = '{$version}';
     11    var cl_plugin = '{$cl_plugin}';
    1112</script>
Note: See TracChangeset for help on using the changeset viewer.