Changeset 16014


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

feature:2641- compatibility with Piwigo 2.4

Location:
extensions/lmt
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • extensions/lmt/admin/plugin_admin_list.tpl

    r15341 r16014  
    1212            ajaxfct:'admin.img.list',
    1313            numPage:pagenum,
    14             filter:$("#filter").val()
     14            filter:$("#filter").val(),
     15            token:'{/literal}{$token}{literal}'
    1516          },
    1617        url: "{/literal}{$datas.LMT_AJAX_URL_LIST}{literal}",
  • extensions/lmt/admin/plugin_admin_manage.tpl

    r7560 r16014  
    1818          {
    1919            ajaxfct:'admin.manage.list',
    20             numPage:pagenum
     20            numPage:pagenum,
     21            token:'{/literal}{$token}{literal}'
    2122          },
    2223        url: "{/literal}{$datas.LMT_AJAX_URL_LIST}{literal}",
  • extensions/lmt/lmt_aip.class.inc.php

    r15382 r16014  
    7070      GPCRequestBuilder::loadJSandCSS();
    7171    }
    72 
    73     add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
    74     add_event_handler('loc_end_page_header', array(&$this->css_icn, 'applyCSS'));
    75 
    76     GPCCss::applyGpcCss();
    77   }
     72  }
     73
    7874
    7975  /*
     
    8581
    8682    $template->set_filename('plugin_admin_content', dirname(__FILE__)."/admin/lmt_admin.tpl");
     83    GPCCore::setTemplateToken();
    8784
    8885    if(!isset($_GET['tab'])) $_GET['tab']='list';
  • extensions/lmt/lmt_aip_release.class.inc.php

    r7560 r16014  
    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/lmt/lmt_ajax.php

    r15341 r16014  
    2525 */
    2626if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';
    27 if(preg_match('/^admin\./i', $_REQUEST['ajaxfct']))
    28 {
    29   define('IN_ADMIN', true);
    30 }
     27if(preg_match('/^admin\./i', $_REQUEST['ajaxfct'])) define('IN_ADMIN', true);
     28if(!defined('AJAX_CALL')) define('AJAX_CALL', true);
    3129
    3230// the common.inc.php file loads all the main.inc.php plugins files
     
    6058    global $user;
    6159
    62     if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';
     60    GPCAjax::checkToken();
    6361    if(!isset($_REQUEST['errcode'])) $_REQUEST['errcode']='';
    6462
     
    198196          'file' => $row['file'],
    199197          'cat' => $tmpcat,
    200           'thumb' => str_replace(PHPWG_ROOT_PATH, './', DerivativeImage::thumb_url(array('id'=>$row['image_id'], 'path'=>$row['path'])))
     198          'thumb' => str_replace(PHPWG_ROOT_PATH, './', DerivativeImage::url(IMG_SQUARE, array('id'=>$row['image_id'], 'path'=>$row['path'])))
    201199        );
    202200      }
     
    290288          'file' => $row['file'],
    291289          'cat' => $tmpcat,
    292           'thumb' => str_replace(PHPWG_ROOT_PATH, './', DerivativeImage::thumb_url(array('id'=>$row['image_id'], 'path'=>$row['path'])))
     290          'thumb' => str_replace(PHPWG_ROOT_PATH, './', DerivativeImage::url(IMG_SQUARE, array('id'=>$row['image_id'], 'path'=>$row['path'])))
    293291        );
    294292      }
  • extensions/lmt/lmt_pip.class.inc.php

    r7560 r16014  
    4646    if($this->config['lmt_licence_activated']=='y')
    4747    {
    48       add_event_handler('loc_end_page_header', array(&$this->css_icn, 'applyCSS'));
    4948      add_event_handler('loc_end_picture', array(&$this, 'manageLicenceElement'));
    5049
     
    5655  }
    5756
    58 
     57  public function loadCSS()
     58  {
     59    //parent::loadCSS();  -- don't call the ancestor!
     60    GPCCore::addHeaderCSS('lmt_icn.css', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles()."_icn.css");
     61  }
    5962
    6063  /* -------------------------------------------------------------------------
     
    110113        if($url!="")
    111114        {
    112           $text = "<table style='margin:auto;'><tr><td><a href='".$url."'".$target."><img $alternateText class='logo88x31' style='top:-4px;' src='". LMT_PATH."img/".strToLower($licence['licence'])."_88x31.png'></a></td><td>".$licence['aut_text1']."<br/>".$licence['aut_text2']."</td></tr></table>";
     115          $text = "<table style='margin:auto;'><tr><td><a href='".$url."'".$target."><img $alternateText class='logo88x31' src='". LMT_PATH."img/".strToLower($licence['licence'])."_88x31.png'></a></td><td>".$licence['aut_text1']."<br/>".$licence['aut_text2']."</td></tr></table>";
    113116        }
    114117        else
    115118        {
    116           $text = "<table style='margin:auto;'><tr><td><img $alternateText class='logo88x31' style='top:-4px;' src='". LMT_PATH."img/".strToLower($licence['licence'])."_88x31.png'></td><td>".$licence['aut_text1']."<br/>".$licence['aut_text2']."</td></tr></table>";
     119          $text = "<table style='margin:auto;'><tr><td><img $alternateText class='logo88x31' src='". LMT_PATH."img/".strToLower($licence['licence'])."_88x31.png'></td><td>".$licence['aut_text1']."<br/>".$licence['aut_text2']."</td></tr></table>";
    117120        }
    118121        break;
  • extensions/lmt/lmt_root.class.inc.php

    r11342 r16014  
    1414  --------------------------------------------------------------------------- */
    1515include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
    16 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
    17 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php');
    1816
    1917class LMT_root extends CommonPlugin
    2018{
    21   protected $css;   //the css object
    22   protected $css_icn;   //the css object
    23 
    2419  static public $licences=array('BY', 'BY-ND', 'BY-NC', 'BY-NC-ND', 'BY-NC-SA', 'BY-SA', 'CRIGHT', 'CLEFT', 'CC0', 'PD', 'DEFAULT');
    2520
     
    3530
    3631    $this->setTablesList(array('images', 'licence_author'));
    37 
    38     $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");
    39     $this->css_icn = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles()."_icn.css");
    40   }
    41 
    42   /**
    43    * destructor
    44    */
    45   public function __destruct()
    46   {
    47     unset($this->css);
    48     unset($this->css_icn);
    49     parent::__destruct();
    50   }
    51 
    52   public function initEvents()
    53   {
    54     add_event_handler('blockmanager_register_blocks', array(&$this, 'register_blocks') );
    55   }
    56 
    57   /**
    58    * menu block management
    59    */
    60   public function register_blocks()
    61   {
    62   }
    63 
     32  }
     33
     34
     35  public function loadCSS()
     36  {
     37    global $template;
     38
     39    parent::loadCSS();
     40    GPCCore::addUI('gpcCSS');
     41    GPCCore::addHeaderCSS('lmt.css', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles().".css");
     42    GPCCore::addHeaderCSS('lmt_icn.css', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles()."_icn.css");
     43  }
    6444
    6545  /**
  • extensions/lmt/main.inc.php

    r15341 r16014  
    108108global $prefixeTable;
    109109
    110 if(defined('IN_ADMIN'))
     110if(!defined('AJAX_CALL'))
    111111{
    112   //LMT admin interface loaded and active only if in admin page
    113   include_once("lmt_aim.class.inc.php");
    114   $obj=new LMT_AIM($prefixeTable, __FILE__);
    115   $obj->initEvents();
    116 }
    117 else
    118 {
    119   //LMT public interface loaded and active only if in public page
    120   if(CommonPlugin::checkGPCRelease(LMT_GPC_NEEDED))
     112  if(defined('IN_ADMIN'))
     113  {
     114    //LMT admin interface loaded and active only if in admin page
     115    include_once("lmt_aim.class.inc.php");
     116    $obj=new LMT_AIM($prefixeTable, __FILE__);
     117    $obj->initEvents();
     118  }
     119  else
    121120  {
    122121    //LMT public interface loaded and active only if in public page
    123     include_once("lmt_pip.class.inc.php");
    124     $obj=new LMT_PIP($prefixeTable, __FILE__);
     122    if(CommonPlugin::checkGPCRelease(LMT_GPC_NEEDED) and !mobile_theme())
     123    {
     124      //LMT public interface loaded and active only if in public page
     125      include_once("lmt_pip.class.inc.php");
     126      $obj=new LMT_PIP($prefixeTable, __FILE__);
     127    }
    125128  }
    126129}
Note: See TracChangeset for help on using the changeset viewer.