Changeset 16013


Ignore:
Timestamp:
Jun 24, 2012, 9:18:55 PM (12 years ago)
Author:
grum
Message:

feature:2640- compatibility with Piwigo 2.4

Location:
extensions/Histogram
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/Histogram/hgram_aip.class.inc.php

    r15346 r16013  
    5959      GPCRequestBuilder::loadJSandCSS();
    6060    }
    61     add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
    62     GPCCss::applyGpcCss();
     61  }
     62
     63  public function loadCSS()
     64  {
     65    parent::loadCSS();
     66    GPCCore::addUI('gpcCSS');
    6367  }
    6468
  • extensions/Histogram/hgram_ajax.php

    r8509 r16013  
    1919   */
    2020  if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';
    21   if(preg_match('/^admin\./i', $_REQUEST['ajaxfct']))
    22   {
    23     define('IN_ADMIN', true);
    24   }
     21  if(preg_match('/^admin\./i', $_REQUEST['ajaxfct'])) define('IN_ADMIN', true);
     22  if(!defined('AJAX_CALL')) define('AJAX_CALL', true);
    2523
    2624  // the common.inc.php file loads all the main.inc.php plugins files
     
    5553      global $user;
    5654
    57       if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';
    58 
    5955      // check if asked function is valid
    6056      if(!(
    61            $_REQUEST['ajaxfct']=='public.histo.build'
     57           $_REQUEST[GPC_AJAX]=='public.histo.build'
    6258          )
    63         ) $_REQUEST['ajaxfct']='';
     59        ) $_REQUEST[GPC_AJAX]='';
    6460
    6561
    66       if(preg_match('/^admin\./i', $_REQUEST['ajaxfct']) and !is_admin()) $_REQUEST['ajaxfct']='';
     62      if(preg_match('/^admin\./i', $_REQUEST[GPC_AJAX]) and !is_admin()) $_REQUEST[GPC_AJAX]='';
    6763
    68       // check token validity
     64      // check token validity - don't use GPCAjax::checkToken() because using an homemade token..
    6965      if(!isset($_REQUEST['token'])) $_REQUEST['token']='';
    7066
    7167
    7268
    73       if($_REQUEST['ajaxfct']!='')
     69      if($_REQUEST[GPC_AJAX]!='')
    7470      {
    7571        /*
    7672         * check public.histo.build
    7773         */
    78         if($_REQUEST['ajaxfct']=="public.histo.build")
     74        if($_REQUEST[GPC_AJAX]=="public.histo.build")
    7975        {
    80           if(!isset($_REQUEST['id'])) $_REQUEST['ajaxfct']='';
    81           if($_REQUEST['token']!=self::getToken($_REQUEST['id'])) $_REQUEST['ajaxfct']='';
     76          if(!isset($_REQUEST['id'])) $_REQUEST[GPC_AJAX]='';
     77          if($_REQUEST['token']!=self::getToken($_REQUEST['id'])) $_REQUEST[GPC_AJAX]='';
    8278        }
    8379      }
     
    9187    {
    9288      $result="<p class='errors'>An error has occured</p>";
    93       switch($_REQUEST['ajaxfct'])
     89      switch($_REQUEST[GPC_AJAX])
    9490      {
    9591        case 'public.histo.build':
  • extensions/Histogram/hgram_root.class.inc.php

    r8509 r16013  
    1919  include_once('hgram_histogram.class.inc.php');
    2020  include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
    21   include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
    2221  include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php');
    2322
     
    2928    static public $pluginNameFile='hgram';
    3029    static public $pluginTables=array('histo');
    31 
    32     protected $css;   //the css object
    3330
    3431    public function __construct($prefixeTable, $filelocation)
     
    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/Histogram/main.inc.php

    r15346 r16013  
    6868global $prefixeTable;
    6969
    70 if(defined('IN_ADMIN'))
     70if(!defined('AJAX_CALL'))
    7171{
    72   // HGram admin interface loaded and active only if in admin page
    73   include_once("hgram_aim.class.inc.php");
    74   $obj=new HGram_AIM($prefixeTable, __FILE__);
    75   $obj->initEvents();
    76   set_plugin_data($plugin['id'], $obj);
    77 }
    78 else
    79 {
    80   // HGram public interface loaded and active only if in public page
    81   include_once("hgram_pip.class.inc.php");
    82   $obj=new HGram_PIP($prefixeTable, __FILE__);
    83   set_plugin_data($plugin['id'], $obj);
     72  if(defined('IN_ADMIN'))
     73  {
     74    // HGram admin interface loaded and active only if in admin page
     75    include_once("hgram_aim.class.inc.php");
     76    $obj=new HGram_AIM($prefixeTable, __FILE__);
     77    $obj->initEvents();
     78    set_plugin_data($plugin['id'], $obj);
     79  }
     80  else
     81  {
     82    if(CommonPlugin::checkGPCRelease(HGRAM_GPC_NEEDED) and !mobile_theme())
     83    {
     84      // HGram public interface loaded and active only if in public page
     85      include_once("hgram_pip.class.inc.php");
     86      $obj=new HGram_PIP($prefixeTable, __FILE__);
     87      set_plugin_data($plugin['id'], $obj);
     88    }
     89  }
    8490}
    8591
    86 
    87 
    8892?>
Note: See TracChangeset for help on using the changeset viewer.