Ignore:
Timestamp:
May 22, 2011, 1:21:25 PM (13 years ago)
Author:
nikrou
Message:

Make plugin compatible with piwigo 2.2
Add pl_PL, thanks to Ortolan
Add ar_AR, thanks to bakir

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/photoWidget/admin.php

    r6850 r10988  
    33// | photoWidget  - a plugin for Piwigo                                    |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2010 Nicolas Roudaire             http://www.nikrou.net  |
     5// | Copyright(C) 2010-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
     
    3232  if (isset($_POST['pw_all_categories'])) {
    3333    if ($_POST['pw_all_categories']==1) {
    34       array_push($GLOBALS['page']['infos'],
    35                  l10n('You choose that mode for').' '.l10n('all categories'));
     34      $page['infos'][] = l10n('You choose that mode for').' '.l10n('All categories');
    3635      $me->pw_all_categories = 1;
    3736      $me->pw_categories = array();
     
    4039      if (isset($_POST['pw_categories'])) {
    4140        if (count($_POST['pw_categories'])==1 && ($_POST['pw_categories'][0]=='__none__')) {
    42           array_push($GLOBALS['page']['errors'],
    43                      l10n('You must choose at least one category'));
     41          $page['errors'][] = l10n('You must choose at least one category');
    4442          $me->pw_categories = array();
    4543          $save_config = true;     
    4644        } else {
    47           array_push($GLOBALS['page']['infos'],
    48                      l10n('You choose that mode for').' '.
    49                      l10n_dec('one category',
    50                               'severals categories',
    51                               count($_POST['pw_categories'])));
     45          $page['infos'][] = l10n('You choose that mode for').' '.
     46            l10n_dec('one category',
     47                     'severals categories',
     48                     count($_POST['pw_categories'])
     49                     );
    5250          $me->pw_all_categories = 0;
    5351          $me->pw_categories = $_POST['pw_categories'];       
     
    5553        }
    5654      } else {
    57         array_push($GLOBALS['page']['errors'],
    58                    l10n('You must choose at least one category'));
     55        $page['errors'][] = l10n('You must choose at least one category');
    5956      }
    6057    }
     
    6360  if (!empty($_POST['pw_width']) && intval($_POST['pw_width'])!=$me->pw_width) {
    6461    $me->pw_width = intval($_POST['pw_width']);
    65     array_push($GLOBALS['page']['infos'], l10n('Width has been updated'));
     62    $page['infos'][] = l10n('Width has been updated');
    6663    $save_config = true;
    6764  }
    6865  if (!empty($_POST['pw_height']) && intval($_POST['pw_height'])!=$me->pw_height) {
    6966    $me->pw_height = intval($_POST['pw_height']);
    70     array_push($GLOBALS['page']['infos'], l10n('Height has been updated'));
     67    $page['infos'][] = l10n('Height has been updated');
    7168    $save_config = true;
    7269  }
    7370  if (!empty($_POST['pw_bgcolor']) && trim($_POST['pw_bgcolor'])!=$me->pw_bgcolor) {
    7471    $me->pw_bgcolor = $_POST['pw_bgcolor'];
    75     array_push($GLOBALS['page']['infos'], l10n('Background color of animation has been updated'));
     72    $page['infos'][] = l10n('Background color of animation has been updated');
    7673    $save_config = true;
    7774  }
     
    8885$all_categories = simple_hash_from_query($query, 'id', 'name');
    8986
    90 $GLOBALS['template']->set_filenames(array('plugin_admin_content' => PW_TEMPLATE . '/admin.tpl'));
    91 $GLOBALS['template']->assign('PW_CAT_CHOICES', array(1 => l10n('Yes'), 0 => l10n('No')));
    92 $GLOBALS['template']->assign('ALL_CATEGORIES', $all_categories);
    93 $GLOBALS['template']->assign('PW_CATEGORIES', $me->pw_categories);
    94 $GLOBALS['template']->assign('PW_ALL_CATEGORIES', $me->pw_all_categories);
    95 $GLOBALS['template']->assign('PWG_PHOTO_WIDGET_PLUGIN_CSS', PW_CSS);
    96 $GLOBALS['template']->assign('PWG_PHOTO_WIDGET_PLUGIN_JS', PW_JS);
    97 $GLOBALS['template']->assign('PW_BGCOLOR', $me->pw_bgcolor);
    98 $GLOBALS['template']->assign('PW_WIDTH', $me->pw_width);
    99 $GLOBALS['template']->assign('PW_HEIGHT', $me->pw_height);
    100 $GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
     87$template->set_filenames(array('plugin_admin_content' => PW_TEMPLATE . '/admin.tpl'));
     88$template->assign('PW_CAT_CHOICES', array(1 => l10n('Yes'), 0 => l10n('No')));
     89$template->assign('ALL_CATEGORIES', $all_categories);
     90$template->assign('PW_CATEGORIES', $me->pw_categories);
     91$template->assign('PW_ALL_CATEGORIES', $me->pw_all_categories);
     92$template->assign('PWG_PHOTO_WIDGET_PLUGIN_CSS', PW_CSS);
     93$template->assign('PWG_PHOTO_WIDGET_PLUGIN_JS', PW_JS);
     94$template->assign('PW_BGCOLOR', $me->pw_bgcolor);
     95$template->assign('PW_WIDTH', $me->pw_width);
     96$template->assign('PW_HEIGHT', $me->pw_height);
     97$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
    10198?>
Note: See TracChangeset for help on using the changeset viewer.