Ignore:
Timestamp:
Jun 29, 2010, 12:06:15 AM (11 years ago)
Author:
vdigital
Message:

Fix: Missing translations
Fix: Who can see in general case

Testing phase - unstable version

Location:
extensions/virtualAutoGrant
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/virtualAutoGrant/VAG_admin.php

    r6613 r6619  
    4242$vag = array_merge( $vag, array(
    4343        'Dir' => VAG_DIR,
    44         'Path' => embellish_url($template->get_template_vars('ROOT_URL').VAG_PATH),
     44        'Path' => VAG_PATH,
    4545        'Ver' => VAG_VER,
    4646  ));
  • extensions/virtualAutoGrant/language/en_UK/plugin.lang.php

    r6610 r6619  
    1414
    1515$lang['Only the default webmaster can change this option.'] = 'Only the default webmaster can change this option.';
     16
     17$lang['Grant automatically the default webmaster has been reset to its previous value.'] = 'Grant automatically the default webmaster has been reset to its previous value.';
     18$lang['You are not authorized to change this configuration (Webmaster only).'] = 'You are not authorized to change this configuration (Webmaster only).';
     19$lang['Your configuration is saved.'] = 'Your configuration is saved.';
    1620?>
  • extensions/virtualAutoGrant/language/fr_FR/plugin.lang.php

    r6610 r6619  
    22$lang['On'] = 'Oui, si possible';
    33$lang['Off'] = 'Non, en principe';
    4 $lang['Virtual AutoGrant configuration'] = 'Configuration de Virtual';
     4$lang['Virtual AutoGrant configuration'] = 'Configuration de Virtual AutoGrant';
    55$lang['New virtual categories will be assumed private, access granted to creator and webmaster and/or uploaded pictures will have "Who can see" set to creator privacy level']
    66    = 'Les nouvelles catégories virtuelles seront privatives, l\'accès attribué au créateur et au webmaster,<br/> et/ou les images ajoutées auront le "Qui peut voir" au niveau de confidentialité du créateur';
     
    1616
    1717$lang['Only the default webmaster can change this option.'] = 'Uniquement le webmaster par défaut peut modifier cette option.';
     18
     19$lang['Grant automatically the default webmaster has been reset to its previous value.'] = 'L\'attribution d\'accès au webmaster a été restauréee à la valeur précédente.';
     20
     21$lang['You are not authorized to change this configuration (Webmaster only).'] = 'Vous n\'êtes pas autorisé à modifier cette configuration (réservé au Webmestre).';
     22$lang['Your configuration is NOT saved due to above reasons.'] = 'Votre configuration n\'a PAS été enregistré suite aux erreurs ci-dessus.';
     23$lang['Your configuration is saved.'] = 'Votre configuration a été enregistrée.';
     24
    1825?>
  • extensions/virtualAutoGrant/template/VAG_admin.tpl

    r6610 r6619  
    77<p>
    88
    9 {'New categories will be assumed private, access granted to creator and webmaster and/or uploaded pictures will have "Who can see" set to creator privacy level'|@translate}
     9{'New virtual categories will be assumed private, access granted to creator and webmaster and/or uploaded pictures will have "Who can see" set to creator privacy level'|@translate}
    1010
    1111</p>
  • extensions/virtualAutoGrant/virtual_categories_granted_to_creator.php

    r6613 r6619  
    3838    list($max_id) = pwg_db_fetch_row(pwg_query('SELECT MAX(id) FROM '.CATEGORIES_TABLE . ';'));
    3939    $vag['lastcat before'] == $max_id;
     40    list($max_id) = pwg_db_fetch_row(pwg_query('SELECT MAX(id) FROM '.IMAGES_TABLE . ';'));
     41    $vag['lastimg before'] == $max_id;
    4042    add_event_handler('loc_end_admin', 'VAG_grant_to_somebody');
    4143    return $menu;
     
    4446    function VAG_grant_to_somebody() {
    4547      global $conf, $vag, $user;
    46       if ( !isset($vag['lastcat before']) ) return false;
     48      if ( empty($vag['lastcat before']) ) $vag['lastcat before'] = 0;
     49      if ( empty($vag['lastimg before']) ) $vag['lastimg before'] = 0;
    4750      list($new_id) = pwg_db_fetch_row(pwg_query('SELECT MAX(id) FROM '.CATEGORIES_TABLE
    4851      . ' WHERE id > ' . $vag['lastcat before'] . ' AND site_id IS NULL;'));
     
    5457        mass_inserts(USER_ACCESS_TABLE, array('user_id','cat_id'), $insert);
    5558      }
    56       // To do set level
     59      // Who can see
     60      if ( $vag['set_who_can_see'] == 0 ) return false;
     61      if ( is_webmaster() and $vag['webmaster_set_who_can_see'] == 1) return false;
     62      // New image_ids
     63      $img_ids = array_from_query('SELECT id FROM ' . IMAGES_TABLE . ' WHERE id > ' . $vag['lastimg before'] . ';', 'id');
     64      if (count($img_ids) == 0) return false;
     65      // New image_ids which are associated to a public category at least
     66      if ($vag['ignore_who_can_see_on_private'] == 1)
     67        $img_ids = array_from_query('SELECT image_id FROM ' . IMAGE_CATEGORY_TABLE
     68            . ' WHERE category_id IN (SELECT id FROM ' . CATEGORIES_TABLE . ' WHERE status = \'public\')'
     69            . ' AND image_id IN ('.implode(',', $img_ids).');');
     70      $r = pwg_query('UPDATE '.IMAGES_TABLE.' SET level = ' . $user['level'] . ' WHERE level < '. $user['level']
     71            . ' AND id IN ('.implode(',', $img_ids).');');
    5772    }
    5873  }
     
    116131        array_push($menu, array(
    117132                'NAME' => 'Virtual AutoGrant',
    118                 'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/VAG_admin.php')
     133                'URL' => get_admin_plugin_menu_link( VAG_PATH .'VAG_admin.php')
    119134        ));
    120135        return $menu;
Note: See TracChangeset for help on using the changeset viewer.