Changeset 16010


Ignore:
Timestamp:
Jun 24, 2012, 9:16:25 PM (8 years ago)
Author:
grum
Message:

feature:2639- compatibility with Piwigo 2.4

Location:
extensions/ColorStat
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • extensions/ColorStat/admin/cstat_config.tpl

    r15344 r16010  
    167167          url: "{/literal}{$datas.urlRequest}{literal}",
    168168          async: true,
    169           data: { ajaxfct:"doPpsBench", quality:2 },
     169          data: { ajaxfct:"doPpsBench", quality:2, token:'{/literal}{$token}{literal}' },
    170170          success: function(msg)
    171171            {
  • extensions/ColorStat/admin/cstat_database.tpl

    r15350 r16010  
    2626        url: "{/literal}{$datas.urlRequest}{literal}",
    2727        async: false,
    28         data: { ajaxfct:"updateDatabaseGetStatus" }
     28        data: { ajaxfct:"updateDatabaseGetStatus", token:'{/literal}{$token}{literal}' }
    2929      }
    3030    ).responseText;
     
    9292        url: "{/literal}{$datas.urlRequest}{literal}",
    9393        async: true,
    94         data: { ajaxfct:"updateDatabaseGetList", selectMode:mode, numOfItems:NumberOfItemsPerRequest },
     94        data: { ajaxfct:"updateDatabaseGetList", token:'{/literal}{$token}{literal}', selectMode:mode, numOfItems:NumberOfItemsPerRequest },
    9595        success: function(msg)
    9696          {
     
    127127        url: "{/literal}{$datas.urlRequest}{literal}",
    128128        async: true,
    129         data: { ajaxfct:"updateDatabaseDoAnalyze", imagesList:processAnalyze.lists[processAnalyze.step] },
     129        data: { ajaxfct:"updateDatabaseDoAnalyze", token:'{/literal}{$token}{literal}', imagesList:processAnalyze.lists[processAnalyze.step] },
    130130        success: function(msg)
    131131          {
     
    146146        url: "{/literal}{$datas.urlRequest}{literal}",
    147147        async: false,
    148         data: { ajaxfct:"updateDatabaseConsolidation" }
     148        data: { ajaxfct:"updateDatabaseConsolidation", token:'{/literal}{$token}{literal}' }
    149149       }).responseText;
    150150
  • extensions/ColorStat/admin/cstat_install_page.tpl

    r15344 r16010  
    4242        url: "{/literal}{$urlRequest}{literal}",
    4343        async: true,
    44         data: { ajaxfct:"installProcess", tableSize:tableSize },
     44        data: { ajaxfct:"installProcess", token:'{/literal}{$token}{literal}', tableSize:tableSize },
    4545        success:
    4646          function(msg)
  • extensions/ColorStat/admin/cstat_stat.tpl

    r15350 r16010  
    3636        url: "{/literal}{$datas.urlRequest}{literal}",
    3737        async: true,
    38         data: { ajaxfct:"showStatsGetListColors", orderType:order },
     38        data: { ajaxfct:"showStatsGetListColors", token:'{/literal}{$token}{literal}', orderType:order },
    3939        success:
    4040          function(msg)
  • extensions/ColorStat/cstat_aip.class.inc.php

    r15350 r16010  
    1717
    1818include_once('cstat_root.class.inc.php');
     19include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php');
    1920include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php');
    2021include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTabSheet.class.inc.php');
     
    6667      GPCRequestBuilder::loadJSandCSS();
    6768    }
    68     add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
    69     GPCCss::applyGpcCss();
     69  }
     70
     71
     72  public function loadCSS()
     73  {
     74    parent::loadCSS();
     75    GPCCore::addUI('gpcCSS');
     76    GPCCore::addHeaderCSS('cstat.css', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles().".css");
    7077  }
    7178
     
    7986    $this->returnAjaxContent();
    8087
     88    GPCCore::setTemplateToken();
    8189    $template->set_filename('plugin_admin_content', dirname(__FILE__)."/admin/cstat_admin.tpl");
    8290
     
    116124    global $ajax, $template;
    117125
    118     if(isset($_REQUEST['ajaxfct']))
     126    if($_REQUEST['ajaxfct']!='')
    119127    {
    120128      //$this->debug("AJAXFCT:".$_REQUEST['ajaxfct']);
     
    159167         $_GET['tab']=='config')) $_GET['tab']='stat';
    160168
     169    GPCAjax::checkToken();
    161170
    162171    if(isset($_REQUEST['ajaxfct']))
  • extensions/ColorStat/cstat_pip.class.inc.php

    r6176 r16010  
    5959  }
    6060
    61 
    62 
    6361  /* -------------------------------------------------------------------------
    6462    FUNCTIONS TO MANAGE COLORS DISPLAY
  • extensions/ColorStat/cstat_root.class.inc.php

    r15350 r16010  
    2020  include_once('cstat_colorstat.class.inc.php');
    2121  include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
    22   include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
    2322  include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php');
    2423
     
    3029    static public $colorTableSize=Array('small' => Array(30,20), 'large' => Array(10,10));
    3130
    32     protected $css;   //the css object
    33 
    3431    public function __construct($prefixeTable, $filelocation)
    3532    {
     
    4037
    4138      $this->setTablesList(self::$pluginTables);
    42 
    43 
    44       $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");
    45     }
    46 
    47     public function __destruct()
    48     {
    49       unset($this->css);
    50       parent::__destruct();
    51     }
    52 
    53     public function initEvents()
    54     {
    55       parent::initEvents();
    56       add_event_handler('blockmanager_register_blocks', array(&$this, 'register_blocks') );
    57     }
    58 
    59     /*
    60       menu block management
    61     */
    62     public function register_blocks()
    63     {
    6439    }
    6540
  • extensions/ColorStat/main.inc.php

    r15344 r16010  
    9292else
    9393{
    94   //CStat public interface loaded and active only if in public page
    95   include_once("cstat_pip.class.inc.php");
    96   CStat_functions::init($prefixeTable);
    97   $obj=new CStat_PIP($prefixeTable, __FILE__);
    98   set_plugin_data($plugin['id'], $obj);
     94  if(CommonPlugin::checkGPCRelease(CSTAT_GPC_NEEDED) and !mobile_theme())
     95  {
     96    //CStat public interface loaded and active only if in public page
     97    include_once("cstat_pip.class.inc.php");
     98    CStat_functions::init($prefixeTable);
     99    $obj=new CStat_PIP($prefixeTable, __FILE__);
     100    set_plugin_data($plugin['id'], $obj);
     101  }
    99102}
    100103
Note: See TracChangeset for help on using the changeset viewer.