Changeset 16011


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

feature:2638- compatibility with Piwigo 2.4

Location:
extensions/GMaps
Files:
2 added
17 edited

Legend:

Unmodified
Added
Removed
  • extensions/GMaps/admin/gmaps_category_maps.tpl

    r15345 r16011  
    88
    99{combine_script  id="gpc.ui.iconSelector" path="plugins/GrumPluginClasses/js/ui.iconSelector.js" require="jquery.ui"}
    10 {combine_script  id="gpc.ui.categorySelector" path="plugins/GrumPluginClasses/js/ui.categorySelector.js" require="jquery.ui"}
    1110{combine_script  id="maps.google.com/api" path="http://maps.google.com/maps/api/js?sensor=false"}
    1211
     
    204203                  url: "{/literal}{$datas.urlRequest}{literal}",
    205204                  async: true,
    206                   data: { ajaxfct:"admin.assoc.getAssoc", id:properties.id },
     205                  data: { ajaxfct:"admin.assoc.getAssoc", token:'{/literal}{$token}{literal}', id:properties.id },
    207206                  success:
    208207                    function(msg)
     
    245244                        url: "{/literal}{$datas.urlRequest}{literal}",
    246245                        async: true,
    247                         data: { ajaxfct:"admin.assoc.deleteAssoc", id:id },
     246                        data: { ajaxfct:"admin.assoc.deleteAssoc", token:'{/literal}{$token}{literal}', id:id },
    248247                        success:
    249248                          function(msg)
     
    328327          url: "{/literal}{$datas.urlRequest}{literal}",
    329328          async: true,
    330           data: { ajaxfct:"admin.assoc.getList" },
     329          data: { ajaxfct:"admin.assoc.getList", token:'{/literal}{$token}{literal}' },
    331330          success:
    332331            function(msg)
     
    383382          url: "{/literal}{$datas.urlRequest}{literal}",
    384383          async: true,
    385           data: { ajaxfct:"admin.assoc.setAssoc", id:properties.id, datas:datas },
     384          data: { ajaxfct:"admin.assoc.setAssoc", token:'{/literal}{$token}{literal}', id:properties.id, datas:datas },
    386385          success:
    387386            function(msg)
  • extensions/GMaps/admin/gmaps_category_maps_iListMaps.tpl

    r7132 r16011  
    1515
    1616    <td width="40px">
    17       <img src="{$themeconf.admin_icon_dir}/edit_s.png"
    18            class="button" alt="{'gmaps_edit'|@translate}"
    19            title="{'gmaps_edit'|@translate}"
    20            onclick='am.editAssoc({$data.id});'/>
    21       <img src="{$themeconf.admin_icon_dir}/delete.png"
    22            class="button"
    23            alt="{'gmaps_delete'|@translate}"
    24            title="{'gmaps_delete'|@translate}"
    25            onclick='am.deleteAssoc({$data.id});'/>
     17      <span class="buttonEdit"
     18            title="{'gmaps_edit'|@translate}"
     19            onclick='am.editAssoc({$data.id});'/>
     20      <span class="buttonDelete"
     21            title="{'gmaps_delete'|@translate}"
     22            onclick='am.deleteAssoc({$data.id});'/>
    2623    </td>
    2724  </tr>
  • extensions/GMaps/admin/gmaps_kmlfiles.tpl

    r15345 r16011  
    7979                  url: "{/literal}{$datas.urlRequest}{literal}",
    8080                  async: true,
    81                   data: { ajaxfct:"admin.kmlFiles.getFile", id:properties.id },
     81                  data: { ajaxfct:"admin.kmlFiles.getFile", token:'{/literal}{$token}{literal}', id:properties.id },
    8282                  success:
    8383                    function(msg)
     
    122122                        url: "{/literal}{$datas.urlRequest}{literal}",
    123123                        async: true,
    124                         data: { ajaxfct:"admin.kmlFiles.deleteFile", id:id },
     124                        data: { ajaxfct:"admin.kmlFiles.deleteFile", token:'{/literal}{$token}{literal}', id:id },
    125125                        success:
    126126                          function(msg)
     
    181181          url: "{/literal}{$datas.urlRequest}{literal}",
    182182          async: true,
    183           data: { ajaxfct:"admin.kmlFiles.getList" },
     183          data: { ajaxfct:"admin.kmlFiles.getList", token:'{/literal}{$token}{literal}' },
    184184          success:
    185185            function(msg)
     
    243243            url: "{/literal}{$datas.urlRequest}{literal}",
    244244            async: true,
    245             data: { ajaxfct:"admin.kmlFiles.setFile", id:properties.id, name:$('#iBDKmlName').val() },
     245            data: { ajaxfct:"admin.kmlFiles.setFile", token:'{/literal}{$token}{literal}', id:properties.id, name:$('#iBDKmlName').val() },
    246246            success:
    247247              function(msg)
     
    333333        <td>{'gmaps_name'|@translate}</td>
    334334        <td>
     335          <input type='hidden' id='iToken' name ="token" value='{$token}'>
    335336          <input type='hidden' id='iBDKmlId' name ="id" value=''>
    336337          <input type='hidden' id='iBDKmlAjaxFct' name="ajaxfct" value='admin.kmlFiles.setFile'>
  • extensions/GMaps/admin/gmaps_kmlfiles_iListFiles.tpl

    r7567 r16011  
    99
    1010    <td width="40px">
    11       <img src="{$themeconf.admin_icon_dir}/edit_s.png"
    12            class="button" alt="{'gmaps_edit'|@translate}"
    13            title="{'gmaps_edit'|@translate}"
    14            onclick='km.editKmlFile({$data.id});'/>
    15       <img src="{$themeconf.admin_icon_dir}/delete.png"
    16            class="button"
    17            alt="{'gmaps_delete'|@translate}"
    18            title="{'gmaps_delete'|@translate}"
    19            onclick='km.deleteKmlFile({$data.id});'/>
     11      <span class="buttonEdit"
     12            title="{'gmaps_edit'|@translate}"
     13            onclick='km.editKmlFile({$data.id});'/>
     14      <span class="buttonDelete"
     15            title="{'gmaps_delete'|@translate}"
     16            onclick='km.deleteKmlFile({$data.id});'/>
    2017    </td>
    2118  </tr>
  • extensions/GMaps/admin/gmaps_maps.tpl

    r15345 r16011  
    435435                  url: "{/literal}{$datas.urlRequest}{literal}",
    436436                  async: true,
    437                   data: { ajaxfct:"admin.maps.getMap", id:properties.id },
     437                  data: { ajaxfct:"admin.maps.getMap", token:'{/literal}{$token}{literal}', id:properties.id },
    438438                  success:
    439439                    function(msg)
     
    481481                        url: "{/literal}{$datas.urlRequest}{literal}",
    482482                        async: true,
    483                         data: { ajaxfct:"admin.maps.deleteMap", id:id },
     483                        data: { ajaxfct:"admin.maps.deleteMap", token:'{/literal}{$token}{literal}', id:id },
    484484                        success:
    485485                          function(msg)
     
    603603          url: "{/literal}{$datas.urlRequest}{literal}",
    604604          async: true,
    605           data: { ajaxfct:"admin.maps.getList" },
     605          data: { ajaxfct:"admin.maps.getList", token:'{/literal}{$token}{literal}' },
    606606          success:
    607607            function(msg)
     
    670670          url: "{/literal}{$datas.urlRequest}{literal}",
    671671          async: true,
    672           data: { ajaxfct:"admin.maps.setMap", id:properties.id, datas:datas },
     672          data: { ajaxfct:"admin.maps.setMap", token:'{/literal}{$token}{literal}', id:properties.id, datas:datas },
    673673          success:
    674674            function(msg)
  • extensions/GMaps/admin/gmaps_maps_iListMaps.tpl

    r7567 r16011  
    1313
    1414    <td width="40px">
    15       <img src="{$themeconf.admin_icon_dir}/edit_s.png"
    16            class="button" alt="{'gmaps_edit'|@translate}"
     15      <span class="buttonEdit"
    1716           title="{'gmaps_edit'|@translate}"
    1817           onclick='udm.editMap({$data.id});'/>
    19       <img src="{$themeconf.admin_icon_dir}/delete.png"
    20            class="button"
    21            alt="{'gmaps_delete'|@translate}"
     18      <span class="buttonDelete"
    2219           title="{'gmaps_delete'|@translate}"
    2320           onclick='udm.deleteMap({$data.id});'/>
  • extensions/GMaps/gmaps.css

    r7308 r16011  
    77#iListKml table  { width:100%; text-align:left; border-collapse: collapse; }
    88
    9 #iListMaps.roma table tr:hover,
    10 #iListAssoc.roma table tr:hover,
    11 #iListKml.roma table tr:hover  { cursor:pointer; background:#303030; }
    129
    13 #iListMaps.clear table tr:hover,
    14 #iListAssoc.clear table tr:hover,
    15 #iListKml.clear table tr:hover { cursor:pointer; color: #D54E21; background:#dbe8f3; }
    1610
    1711#iBDAssocCatId {
     
    7670}
    7771
    78 // fix IE8 compatibility bugs from GPC 3.2.0 (fixed in next release)
     72/* fix IE8 compatibility bugs from GPC 3.2.0 (fixed in next release) */
    7973.formtable, .formtable P { margin-left:0px;  }
    8074.tabsheet2 { list-style:none; }
     75
     76.buttonEdit,
     77.buttonDelete {
     78  width:15px;
     79  height:15px;
     80  display:inline-block;
     81  background:url(./../GrumPluginClasses/icons/buttons.png) no-repeat 0 0 transparent;
     82}
  • extensions/GMaps/gmaps2.css

    r7308 r16011  
    137137}
    138138
    139 
     139.icon_gmaps {
     140  border:none;
     141}
  • extensions/GMaps/gmaps_aip.class.inc.php

    r15345 r16011  
    7878  public function initEvents()
    7979  {
     80    global $template;
     81
    8082    parent::initEvents();
    8183
     
    8587      GPCRequestBuilder::loadJSandCSS();
    8688    }
    87     add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
    88     GPCCss::applyGpcCss();
    89   }
     89  }
     90
    9091
    9192  /**
     
    100101
    101102    $template->set_filename('plugin_admin_content', dirname(__FILE__)."/admin/gmaps_admin.tpl");
     103    GPCCore::setTemplateToken();
    102104
    103105    switch($_GET['tab'])
     
    232234    global $template;
    233235
     236    GPCCore::addUI('categorySelector');
    234237    GPCCore::addHeaderCSS('iconSelector', 'plugins/GrumPluginClasses/css/iconSelector_'.$template->get_themeconf('name').'.css');
    235     GPCCore::addHeaderCSS('categorySelector', 'plugins/GrumPluginClasses/css/categorySelector_'.$template->get_themeconf('name').'.css');
    236238
    237239    $template->set_filename('body_page',
  • extensions/GMaps/gmaps_aip_release.class.inc.php

    r7398 r16011  
    3535
    3636  /*
    37     initialize events call for the plugin
    38   */
    39   public function initEvents()
    40   {
    41     parent::initEvents();
    42     add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
    43   }
    44 
    45   /*
    4637    display administration page
    4738  */
  • extensions/GMaps/gmaps_ajax.php

    r15345 r16011  
    2525   */
    2626  if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';
    27   if(preg_match('/^admin\./i', $_REQUEST['ajaxfct']))
    28   {
    29     define('IN_ADMIN', true);
    30   }
     27  if(preg_match('/^admin\./i', $_REQUEST['ajaxfct'])) define('IN_ADMIN', true);
     28  if(!defined('AJAX_CALL')) define('AJAX_CALL', true);
    3129
    3230  // the common.inc.php file loads all the main.inc.php plugins files
     
    5957      global $user;
    6058
    61       if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';
    6259      if(!isset($_REQUEST['errcode'])) $_REQUEST['errcode']='';
     60      GPCAjax::checkToken();
    6361
    6462      // check if asked function is valid
    65       if(!($_REQUEST['ajaxfct']=='admin.maps.getList' or
    66            $_REQUEST['ajaxfct']=='admin.maps.setMap' or
    67            $_REQUEST['ajaxfct']=='admin.maps.getMap' or
    68            $_REQUEST['ajaxfct']=='admin.maps.deleteMap' or
    69            $_REQUEST['ajaxfct']=='admin.assoc.getList' or
    70            $_REQUEST['ajaxfct']=='admin.assoc.setAssoc' or
    71            $_REQUEST['ajaxfct']=='admin.assoc.getAssoc' or
    72            $_REQUEST['ajaxfct']=='admin.assoc.deleteAssoc' or
    73            $_REQUEST['ajaxfct']=='admin.kmlFiles.getList' or
    74            $_REQUEST['ajaxfct']=='admin.kmlFiles.setFile' or
    75            $_REQUEST['ajaxfct']=='admin.kmlFiles.getFile' or
    76            $_REQUEST['ajaxfct']=='admin.kmlFiles.deleteFile' or
    77 
    78            $_REQUEST['ajaxfct']=='public.maps.init' or
    79            $_REQUEST['ajaxfct']=='public.maps.getMarkers'
    80            )) $_REQUEST['ajaxfct']='';
    81 
    82       if(preg_match('/^admin\./i', $_REQUEST['ajaxfct']) and !is_admin()) $_REQUEST['ajaxfct']='';
    83 
    84 
    85       if($_REQUEST['ajaxfct']!='')
     63      if(!($_REQUEST[GPC_AJAX]=='admin.maps.getList' or
     64           $_REQUEST[GPC_AJAX]=='admin.maps.setMap' or
     65           $_REQUEST[GPC_AJAX]=='admin.maps.getMap' or
     66           $_REQUEST[GPC_AJAX]=='admin.maps.deleteMap' or
     67           $_REQUEST[GPC_AJAX]=='admin.assoc.getList' or
     68           $_REQUEST[GPC_AJAX]=='admin.assoc.setAssoc' or
     69           $_REQUEST[GPC_AJAX]=='admin.assoc.getAssoc' or
     70           $_REQUEST[GPC_AJAX]=='admin.assoc.deleteAssoc' or
     71           $_REQUEST[GPC_AJAX]=='admin.kmlFiles.getList' or
     72           $_REQUEST[GPC_AJAX]=='admin.kmlFiles.setFile' or
     73           $_REQUEST[GPC_AJAX]=='admin.kmlFiles.getFile' or
     74           $_REQUEST[GPC_AJAX]=='admin.kmlFiles.deleteFile' or
     75
     76           $_REQUEST[GPC_AJAX]=='public.maps.init' or
     77           $_REQUEST[GPC_AJAX]=='public.maps.getMarkers'
     78           )) $_REQUEST[GPC_AJAX]='';
     79
     80      if(preg_match('/^admin\./i', $_REQUEST[GPC_AJAX]) and !is_admin()) $_REQUEST[GPC_AJAX]='';
     81
     82
     83      if($_REQUEST[GPC_AJAX]!='')
    8684      {
    8785        /*
     
    9694         *  admin.kmlFiles.getFile
    9795         */
    98         if($_REQUEST['ajaxfct']=="admin.maps.getMap" or
    99            $_REQUEST['ajaxfct']=="admin.assoc.getAssoc" or
    100            $_REQUEST['ajaxfct']=="admin.kmlFiles.getFile")
     96        if($_REQUEST[GPC_AJAX]=="admin.maps.getMap" or
     97           $_REQUEST[GPC_AJAX]=="admin.assoc.getAssoc" or
     98           $_REQUEST[GPC_AJAX]=="admin.kmlFiles.getFile")
    10199        {
    102100          if(!isset($_REQUEST['id']) or
    103101             !is_numeric($_REQUEST['id']) or
    104              $_REQUEST['id']=='') $_REQUEST['ajaxfct']='';
     102             $_REQUEST['id']=='') $_REQUEST[GPC_AJAX]='';
    105103        }
    106104
     
    111109         *  admin.kmlFiles.deleteFile
    112110         */
    113         if($_REQUEST['ajaxfct']=="admin.maps.deleteMap" or
    114            $_REQUEST['ajaxfct']=="admin.assoc.deleteAssoc" or
    115            $_REQUEST['ajaxfct']=="admin.kmlFiles.deleteFile")
     111        if($_REQUEST[GPC_AJAX]=="admin.maps.deleteMap" or
     112           $_REQUEST[GPC_AJAX]=="admin.assoc.deleteAssoc" or
     113           $_REQUEST[GPC_AJAX]=="admin.kmlFiles.deleteFile")
    116114        {
    117115          if(!isset($_REQUEST['id']) or
    118116             !is_numeric($_REQUEST['id']) or
    119              $_REQUEST['id']=='') $_REQUEST['ajaxfct']='';
     117             $_REQUEST['id']=='') $_REQUEST[GPC_AJAX]='';
    120118        }
    121119
     
    123121         * check admin.maps.setMap values
    124122         */
    125         if($_REQUEST['ajaxfct']=="admin.maps.setMap")
     123        if($_REQUEST[GPC_AJAX]=="admin.maps.setMap")
    126124        {
    127125          if(!isset($_REQUEST['id']) or
    128126             !isset($_REQUEST['datas']) or !is_array($_REQUEST['datas']))
    129127          {
    130             $_REQUEST['ajaxfct']='';
     128            $_REQUEST[GPC_AJAX]='';
    131129          }
    132130          else
     
    147145                 ))
    148146            {
    149               $_REQUEST['ajaxfct']='';
     147              $_REQUEST[GPC_AJAX]='';
    150148            }
    151149            else
     
    153151              if(!($_REQUEST['datas']['displayType']=='IC' or
    154152                  $_REQUEST['datas']['displayType']=='IP' or
    155                   $_REQUEST['datas']['displayType']=='MP')) $_REQUEST['ajaxfct']='';
     153                  $_REQUEST['datas']['displayType']=='MP')) $_REQUEST[GPC_AJAX]='';
    156154
    157155              if(!($_REQUEST['datas']['sizeMode']=='A' or
    158                   $_REQUEST['datas']['sizeMode']=='F')) $_REQUEST['ajaxfct']='';
     156                  $_REQUEST['datas']['sizeMode']=='F')) $_REQUEST[GPC_AJAX]='';
    159157
    160158              if(!is_numeric($_REQUEST['datas']['width']) or
     
    199197         * check admin.maps.setAssoc values
    200198         */
    201         if($_REQUEST['ajaxfct']=="admin.assoc.setAssoc")
     199        if($_REQUEST[GPC_AJAX]=="admin.assoc.setAssoc")
    202200        {
    203201          if(!isset($_REQUEST['id']) or
    204202             !isset($_REQUEST['datas']) or !is_array($_REQUEST['datas']))
    205203          {
    206             $_REQUEST['ajaxfct']='';
     204            $_REQUEST[GPC_AJAX]='';
    207205          }
    208206          else
     
    217215                 isset($_REQUEST['datas']['title']) ))
    218216            {
    219               $_REQUEST['ajaxfct']='';
     217              $_REQUEST[GPC_AJAX]='';
    220218            }
    221219            else
    222220            {
    223221              if($_REQUEST['datas']['categoryId']=='' or
    224                  $_REQUEST['datas']['categoryId']<0) $_REQUEST['ajaxfct']='';
    225 
    226               if($_REQUEST['datas']['mapId']=='') $_REQUEST['ajaxfct']='';
     222                 $_REQUEST['datas']['categoryId']<0) $_REQUEST[GPC_AJAX]='';
     223
     224              if($_REQUEST['datas']['mapId']=='') $_REQUEST[GPC_AJAX]='';
    227225
    228226              if(!($_REQUEST['datas']['applySubCat']=='y' or
     
    240238         * check admin.kmlFiles.setFile values
    241239         */
    242         if($_REQUEST['ajaxfct']=="admin.kmlFiles.setFile")
     240        if($_REQUEST[GPC_AJAX]=="admin.kmlFiles.setFile")
    243241        {
    244242          if(!isset($_REQUEST['id']) )
    245243          {
    246             $_REQUEST['ajaxfct']='';
     244            $_REQUEST[GPC_AJAX]='';
    247245          }
    248246          else
     
    251249            {
    252250              if(!(isset($_FILES['file']['name']) and
    253                    isset($_FILES['file']['tmp_name']))) $_REQUEST['ajaxfct']='';
     251                   isset($_FILES['file']['tmp_name']))) $_REQUEST[GPC_AJAX]='';
    254252            }
    255253          }
     
    261259         * check public.maps.getMarkers values
    262260         */
    263         if($_REQUEST['ajaxfct']=="public.maps.getMarkers")
     261        if($_REQUEST[GPC_AJAX]=="public.maps.getMarkers")
    264262        {
    265263          if(!isset($_REQUEST['datas']) or
    266264             !is_array($_REQUEST['datas']))
    267265          {
    268             $_REQUEST['ajaxfct']='';
     266            $_REQUEST[GPC_AJAX]='';
    269267          }
    270268          else
     
    281279                 isset($_REQUEST['datas']['bounds']['west']) ))
    282280            {
    283               $_REQUEST['ajaxfct']='';
     281              $_REQUEST[GPC_AJAX]='';
    284282            }
    285283            if(!isset($_REQUEST['datas']['loadIndex'])) $_REQUEST['datas']['loadIndex']='';
     
    290288         * check public.maps.getMarkerInfos values
    291289         */
    292         if($_REQUEST['ajaxfct']=="public.maps.init")
    293         {
    294           if(!isset($_REQUEST['category'])) $_REQUEST['ajaxfct']='';
     290        if($_REQUEST[GPC_AJAX]=="public.maps.init")
     291        {
     292          if(!isset($_REQUEST['category'])) $_REQUEST[GPC_AJAX]='';
    295293          if(!isset($_REQUEST['mapId'])) $_REQUEST['mapId']=null;
    296294        }
     
    305303    {
    306304      $result="<p class='errors'>An error has occured</p>";
    307       switch($_REQUEST['ajaxfct'])
     305      switch($_REQUEST[GPC_AJAX])
    308306      {
    309307        case 'admin.maps.getList':
     
    539537      {
    540538        $sql="DELETE FROM ".$this->tables['category_maps']."
    541               WHERE map_id='$id';";
     539              WHERE mapId='$id';";
    542540        $result=pwg_query($sql);
    543541        if($result) return('ok');
  • extensions/GMaps/gmaps_pip.class.inc.php

    r15345 r16011  
    5252      )
    5353  );
    54   protected $css2;
    5554
    5655  public function __construct($prefixeTable, $filelocation)
    5756  {
    5857    parent::__construct($prefixeTable, $filelocation);
    59     $this->css2 = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles()."2.css");
    6058    $this->loadConfig();
    6159    $this->initEvents();
     
    8684  {
    8785    parent::initEvents();
    88 
    8986    add_event_handler('loc_begin_index', array(&$this, 'displayCategoryPageMap'));
    9087    if(!isset($_GET['slideshow'])) add_event_handler('loc_begin_picture', array(&$this, 'displayPicturePageMap'), EVENT_HANDLER_PRIORITY_NEUTRAL+5);
    9188    add_event_handler('amd_jpegMD_loaded', array(&$this, 'preparePictureMaps'));
    92     add_event_handler('loc_end_page_header', array(&$this->css2, 'applyCSS'));
    9389    add_event_handler('render_category_description',  array(&$this, 'categoryMarkup'), EVENT_HANDLER_PRIORITY_NEUTRAL-5, 2);
    9490  }
    9591
    9692
     93  public function loadCSS()
     94  {
     95    //parent::loadCSS(); // -- do not call ancestor!
     96    GPCCore::addHeaderCSS('gmaps.css2', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles()."2.css");
     97  }
    9798
    9899  /* -------------------------------------------------------------------------
     
    213214            gmaps =
    214215              {
     216                token:'".get_pwg_token()."',
    215217                lang:{
    216218                  boundmap:'".l10n('gmaps_i_boundmap')."',
     
    306308var gmaps =
    307309  {
     310    token:'".get_pwg_token()."',
    308311    geolocated:".($nb>0?'true':'false').",
    309312    forceDisplay:".($nb==0?'true':'false').",
     
    503506  var gmaps =
    504507    {
     508      token:'".get_pwg_token()."',
    505509      geolocated:".($this->picture['geolocated']?'true':'false').",
    506510      forceDisplay:".($this->picture['forceDisplay']?'true':'false').",
  • extensions/GMaps/gmaps_root.class.inc.php

    r12213 r16011  
    1414  --------------------------------------------------------------------------- */
    1515  include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
    16   include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
    1716
    1817  class GMaps_root extends CommonPlugin
     
    2221    const ID_MODE_MAP='M';
    2322
    24     protected $css;
    2523    protected $maps=array();
    2624    protected $forceDisplay=0;
     
    8684
    8785      $this->setTablesList(array('maps', 'category_maps', 'cache', 'cache_id', 'kmlfiles'));
    88       $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");
    89     }
    90 
    91     public function __destruct()
    92     {
    93       parent::__destruct();
    94     }
    95 
    96     public function initEvents()
    97     {
    98     }
    99 
    100 
    101     /*
    102       surchage of CommonPlugin->saveConfig function
    103     */
    104     public function saveConfig()
    105     {
    106       if(parent::saveConfig())
    107       {
    108         return(true);
    109       }
    110       return(false);
    111     }
    112 
    113     /*
    114       surchage of CommonPlugin->saveConfig function
    115     */
    116     public function loadConfig()
    117     {
    118       parent::loadConfig();
    119     }
     86    }
     87
     88    public function loadCSS()
     89    {
     90      global $template;
     91
     92      parent::loadCSS();
     93      GPCCore::addUI('gpcCSS');
     94      GPCCore::addHeaderCSS('gmaps.css', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles().".css");
     95      GPCCore::addHeaderCSS('gmaps.cssT', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles().'_'.$template->get_themeconf('name').".css");
     96    }
     97
    12098
    12199    /*
     
    129107      );
    130108    }
    131 
    132109
    133110    /**
  • extensions/GMaps/js/gmapsCategory.js

    r15345 r16011  
    121121        url: "plugins/GMaps/gmaps_ajax.php",
    122122        async: true,
    123         data: { ajaxfct:"public.maps.getMarkers", datas:datas },
     123        data: { ajaxfct:"public.maps.getMarkers", token:gmaps.token, datas:datas },
    124124        success:
    125125          function(msg)
     
    548548                  url: "plugins/GMaps/gmaps_ajax.php",
    549549                  async: true,
    550                   data: { ajaxfct:"public.maps.init", category:gmaps.categoryId, mapId:'n' },
     550                  data: { ajaxfct:"public.maps.init", token:gmaps.token, category:gmaps.categoryId, mapId:'n' },
    551551                  success:
    552552                    function(msg)
  • extensions/GMaps/js/gmapsMarkup.js

    r15345 r16011  
    147147        url: "plugins/GMaps/gmaps_ajax.php",
    148148        async: true,
    149         data: { ajaxfct:"public.maps.getMarkers", datas:datas },
     149        data: { ajaxfct:"public.maps.getMarkers", token:gmaps.token, datas:datas },
    150150        success:
    151151          function(msg)
     
    498498        url: "plugins/GMaps/gmaps_ajax.php",
    499499        async: true,
    500         data: { ajaxfct:"public.maps.init", category:gmapsMarkup.categoryId, mapId:'y' },
     500        data: { ajaxfct:"public.maps.init", token:gmaps.token, category:gmapsMarkup.categoryId, mapId:'y' },
    501501        success:
    502502          function(msg)
  • extensions/GMaps/main.inc.php

    r15345 r16011  
    160160global $prefixeTable;
    161161
    162 if(defined('IN_ADMIN'))
     162if(!defined('AJAX_CALL'))
    163163{
    164   //GMaps admin interface loaded and active only if in admin page
    165   include_once("gmaps_aim.class.inc.php");
    166   $obj=new GMaps_AIM($prefixeTable, __FILE__);
    167   $obj->initEvents();
    168 }
    169 else
    170 {
    171   if(CommonPlugin::checkGPCRelease(GMAPS_GPC_NEEDED))
     164  if(defined('IN_ADMIN'))
    172165  {
    173     //GMaps public interface loaded and active only if in public page
    174     include_once("gmaps_pip.class.inc.php");
    175     $obj=new GMaps_PIP($prefixeTable, __FILE__);
     166    //GMaps admin interface loaded and active only if in admin page
     167    include_once("gmaps_aim.class.inc.php");
     168    $obj=new GMaps_AIM($prefixeTable, __FILE__);
     169    $obj->initEvents();
     170  }
     171  else
     172  {
     173    if(CommonPlugin::checkGPCRelease(GMAPS_GPC_NEEDED) and !mobile_theme())
     174    {
     175      //GMaps public interface loaded and active only if in public page
     176      include_once("gmaps_pip.class.inc.php");
     177      $obj=new GMaps_PIP($prefixeTable, __FILE__);
     178    }
    176179  }
    177180}
  • extensions/GMaps/templates/gmaps_dialog_area_choose.tpl

    r15345 r16011  
    4646        url: "plugins/GMaps/gmaps_ajax.php",
    4747        async: true,
    48         data: { ajaxfct:"public.maps.init", category:0 },
     48        data: { ajaxfct:"public.maps.init", token:'{/literal}{$token}{literal}', category:0 },
    4949        success: function (msg)
    5050          {
     
    224224        url: "plugins/GMaps/gmaps_ajax.php",
    225225        async: true,
    226         data: { ajaxfct:"public.maps.getMarkers", datas:datas },
     226        data: { ajaxfct:"public.maps.getMarkers", token:'{/literal}{$token}{literal}', datas:datas },
    227227        success:
    228228          function(msg)
Note: See TracChangeset for help on using the changeset viewer.