Changeset 4553 for extensions/event_cats


Ignore:
Timestamp:
Dec 22, 2009, 1:29:01 AM (14 years ago)
Author:
LucMorizur
Message:

[Event Cats] Add feature 1335 (possibility to display the 'Connection' link in identification block menu for generic users)

Location:
extensions/event_cats
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • extensions/event_cats/admin/evntcats_admin.php

    r4486 r4553  
    152152   if (!change_ec_conf('comment_display', $_POST['ec_comments']))
    153153    ec_end2(11);
     154  if (isset($_POST['ec_connection']))
     155   if (!change_ec_conf('display_connection', $_POST['ec_connection']))
     156    ec_end2(12);
    154157  $page['tab'] = 'config';
    155158  $page['infos'][] = l10n('ec_config_saved');
     
    386389$template->assign('ec_help_banner_OK', (read_ec_conf('in_help_display') == '1'));
    387390
    388 $template->assign('EVNTCATS_PATH',EVNTCATS_PATH);
    389 $template->assign('RACINE_URL',ROOT_URL);
     391$template->assign('EVNTCATS_PATH', EVNTCATS_PATH);
     392$template->assign('RACINE_URL', ROOT_URL);
    390393$template->assign('U_HELP', get_root_url().'popuphelp.php?page=help');
    391394
  • extensions/event_cats/admin/template/config.tpl

    r4470 r4553  
    169169            {'Banner off'|@translate}
    170170          </label>
     171        <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> {* <!-- sorry :-\ --> *}
     172        <td style = "text-align:right; font-weight:bold;">
     173          {'Display connection'|@translate}&nbsp;&nbsp;
     174        </td>
     175        <td>
     176          <label for = "ec_connection_1_id">
     177            <input type = "radio" name = "ec_connection" value = "1" id = "ec_connection_1_id"
     178              {if $ec_conf.display_connection == '1'} checked = "checked" {/if}
     179            />
     180            {'Yes'|@translate}
     181          </label><br />
     182          <label for = "ec_connection_0_id">
     183            <input type = "radio" name = "ec_connection" value = "0" id = "ec_connection_0_id"
     184              {if $ec_conf.display_connection == '0'} checked = "checked" {/if}
     185            />
     186            {'No'|@translate}
     187          </label>
    171188        </td>
    172189    </table>
  • extensions/event_cats/include/ec_conf.inc.php

    r4470 r4553  
    9393  'in_help_display'       // whether the help banner is displayed.
    9494    => '1',               // 0: not displayed ; 1 : displayed (surprising !)
     95                          //
     96  'display_connection'    // whether the "Connection" link must be displayed
     97    => '0',               // for generic users, 0 or 1.
    9598);
    9699
     
    108111  'comment_display'    => array('0', '1'),
    109112  'in_help_display'    => array('0', '1'),
     113  'display_connection' => array('0', '1'),
    110114);
    111115
  • extensions/event_cats/language/en_UK/help.html

    r4500 r4553  
    1616<hr width = "5%" align = "center">
    1717<p>
    18   &nbsp;&nbsp;&nbsp;&nbsp;L'identification automatique est effectuée grâce à un code "autolog", placé dans un lien que vous fournissez aux personnes à qui vous voulez donner accès. Les personnes utilisant ce lien se trouvent directement identifiées sur votre site sous le compte associé au code "autolog". La page affichée juste après l'identification peut être&nbsp;:
     18  &nbsp;&nbsp;&nbsp;&nbsp;The automatic identification is carried out thanks to the "autolog" code, placed in the link that you give to the people whom you want to give access to. The visitors using this link find themselves directly logged in on your gallery under the account associated to the "autolog" code. The page displayed just after the identification can be:
    1919  <ul>
    20     <li>la page d'accueil&nbsp;;</li>
    21     <li>une page de catégorie&nbsp;;</li>
    22     <li>une image&nbsp;;</li>
    23     <li>une page créée grâce au plugin "<a href = "http://fr.piwigo.org/ext/extension_view.php?eid=153" title = "Ouvrir une nouvelle fenêtre sur le plugin Additional Pages" onClick = "window.open(this.href); return false;">Additional Pages</a>", à condition bien sûr que ce plugin soit installé et activé, et qu'au moins une page soit disponible.</li>
     20    <li>home page;</li>
     21    <li>a category page;</li>
     22    <li>a picture;</li>
     23    <li>a page from plugin "<a href = "http://fr.piwigo.org/ext/extension_view.php?eid=153" title = "Open a window on plugin Additional Pages" onclick = "window.open(this.href); return false;">Additional Pages</a>", provided of course that this plugin is installed and activated, and that at least one of its page is available.</li>
    2424  </ul>
    25   &nbsp;&nbsp;&nbsp;&nbsp;Une fois identifiés, vos visiteurs peuvent se créer un compte&nbsp;&#151; personnel&nbsp;&#151; ayant les mêmes droits que le compte sous lequel ils étaient identifiés avant de se créer leur compte. Il est ainsi possible qu'un visiteur se crée un compte et aie immédiatement accès à du contenu privé sur votre galerie, sans avoir à attendre de validation de votre part. Il vous est possible d'autoriser ou pas la duplication de compte, de la même façon que vous autorisez ou pas l'accès à une catégorie privée, en sélectionnant les groupes, les types de compte, ou les comptes individuellement.
     25  &nbsp;&nbsp;&nbsp;&nbsp;Once identified, your visitors can create an account&nbsp;&#151; a personal one&nbsp;&#151; having the same properties than the account under which they were previously identified. One can this way create his own account and have immediately access to private content on your gallery, without to wait for a validation from you. You can grant or deny account duplication, the same way you grant or deny access to a private category, selecting groups, account status, or accounts individually.
    2626</p>
    2727<p>
    28   &nbsp;&nbsp;&nbsp;&nbsp;Le lien (URL) permettant l'identification automatique sur votre galerie, est du type&nbsp;:
    29   <ul><li style = "list-style-type:none;">http://<span style = "font-style:italic;">&#139;adresse de votre galerie&#155;</span><span style = "font-weight:bold;">&#38;autolog=<span style = "font-style:italic;">&#139;code&#155;</span></span></li></ul>
    30   &nbsp;&nbsp;&nbsp;&nbsp;Lorsque l'utilisateur doit être redirigé sur une autre page que l'accueil, il est rajouté les paramètres <span style = "font-weight:bold;">&#38;cat=<span style = "font-style:italic;">&#139;identifiant catégorie&#155;</span></span> pour une catégorie, <span style = "font-weight:bold;">&#38;img=<span style = "font-style:italic;">&#139;identifiant image&#155;</span></span> pour une image (en plus du paramètre de catégorie), et <span style = "font-weight:bold;">&#38;ap=<span style = "font-style:italic;">&#139;identifiant add. p.&#155;</span></span> pour une page du plugin Additional Pages.<br />
     28  &nbsp;&nbsp;&nbsp;&nbsp;The link (URL) allowing automatic identification on your gallery, is built as following:
     29  <ul><li style = "list-style-type:none;">http://<span style = "font-style:italic;">&#139;your gallery location&#155;</span><span style = "font-weight:bold;">&#38;autolog=<span style = "font-style:italic;">&#139;code&#155;</span></span></li></ul>
     30  &nbsp;&nbsp;&nbsp;&nbsp;When the user shall be redirected on another page than the home page, the following parameters are added: <span style = "font-weight:bold;">&#38;cat=<span style = "font-style:italic;">&#139;category identifier&#155;</span></span> for a category, <span style = "font-weight:bold;">&#38;img=<span style = "font-style:italic;">&#139;image identifier&#155;</span></span> for an image (in addition of category parameter), and <span style = "font-weight:bold;">&#38;ap=<span style = "font-style:italic;">&#139;Add. P. identifier&#155;</span></span> for a page from plugin Additional Pages. If an autolog URL is submitted with an <span style = "font-weight:bold;">&#38;img</span> parameter without category, the displayed page is the home page. If an autolog URL is submitted with both an <span style = "font-weight:bold;">&#38;ap</span> and a <span style = "font-weight:bold;">&#38;cat</span> parameter (with or without the <span style = "font-weight:bold;">&#38;img</span> parameter), the displayed page is the Additional Page.<br />
    3131</p>
    3232<p></p>
  • extensions/event_cats/language/en_UK/plugin.lang.php

    r4500 r4553  
    113113$lang['Banner on']                 = 'Activated';
    114114$lang['Banner off']                = 'Not activated';
     115$lang['Display connection']        = 'Display "Login" link&nbsp;&nbsp;<br />to generic users';
    115116
    116117// JS messages
     
    151152$lang['ec_group_create_OK']        = 'Group "%s" created';
    152153$lang['ec_group_create_OK2']       = '"%1$s" linked to "%2$s"';
    153 $lang['ec_entry_create_OK']        = 'Entry %s created';
     154$lang['ec_entry_create_OK']        = 'Entry %s created ';
    154155$lang['ec_cnfrm_forced']           = ' (displayed page forced)';
    155156$lang['ec_entry_modify_OK']        = 'Entry %s modified';
  • extensions/event_cats/language/fr_FR/help.html

    r4500 r4553  
    2828  &nbsp;&nbsp;&nbsp;&nbsp;Le lien (URL) permettant l'identification automatique sur votre galerie, est du type&nbsp;:
    2929  <ul><li style = "list-style-type:none;">http://<span style = "font-style:italic;">&#139;adresse de votre galerie&#155;</span><span style = "font-weight:bold;">&#38;autolog=<span style = "font-style:italic;">&#139;code&#155;</span></span></li></ul>
    30   &nbsp;&nbsp;&nbsp;&nbsp;Lorsque l'utilisateur doit être redirigé sur une autre page que l'accueil, il est rajouté les paramètres <span style = "font-weight:bold;">&#38;cat=<span style = "font-style:italic;">&#139;identifiant catégorie&#155;</span></span> pour une catégorie, <span style = "font-weight:bold;">&#38;img=<span style = "font-style:italic;">&#139;identifiant image&#155;</span></span> pour une image (en plus du paramètre de catégorie), et <span style = "font-weight:bold;">&#38;ap=<span style = "font-style:italic;">&#139;identifiant add. p.&#155;</span></span> pour une page du plugin Additional Pages.<br />
     30  &nbsp;&nbsp;&nbsp;&nbsp;Lorsque l'utilisateur doit être redirigé sur une autre page que l'accueil, il est rajouté les paramètres <span style = "font-weight:bold;">&#38;cat=<span style = "font-style:italic;">&#139;identifiant catégorie&#155;</span></span> pour une catégorie, <span style = "font-weight:bold;">&#38;img=<span style = "font-style:italic;">&#139;identifiant image&#155;</span></span> pour une image (en plus du paramètre de catégorie), et <span style = "font-weight:bold;">&#38;ap=<span style = "font-style:italic;">&#139;identifiant Add. P.&#155;</span></span> pour une page du plugin Additional Pages. Si un URL avec autolog est envoyé, comportant le paramètre <span style = "font-weight:bold;">&#38;img</span> sans celui de la catégorie, c'est la page d'accueil qui est affichée. Si un URL avec autolog est envoyé, comportant à la fois les paramètres <span style = "font-weight:bold;">&#38;ap</span> et <span style = "font-weight:bold;">&#38;cat</span> (avec ou sans le paramètre <span style = "font-weight:bold;">&#38;img</span>), c'est la page Additional Page qui est affichée.<br />
    3131</p>
    3232<p></p>
  • extensions/event_cats/language/fr_FR/plugin.lang.php

    r4500 r4553  
    113113$lang['Banner on']                 = 'Activé';
    114114$lang['Banner off']                = 'Désactivé';
     115$lang['Display connection']        = 'Afficher le lien "Connexion"&nbsp;&nbsp;<br />pour les utilisateurs génériques';
    115116
    116117// JS messages
     
    151152$lang['ec_group_create_OK']        = 'Création groupe "%s"';
    152153$lang['ec_group_create_OK2']       = '"%1$s" associé à "%2$s"';
    153 $lang['ec_entry_create_OK']        = 'Création entrée : %s';
     154$lang['ec_entry_create_OK']        = 'Création entrée %s ';
    154155$lang['ec_cnfrm_forced']           = ' (affichage forcé)';
    155156$lang['ec_entry_modify_OK']        = 'Modification entrée %s';
  • extensions/event_cats/main.inc.php

    r4487 r4553  
    4040//ini_set('display_errors', true);
    4141
    42 global $conf, $prefixeTable, $ec_lists;
     42global $conf, $prefixeTable, $ec_lists, $ec_page;
     43$ec_page = NULL;
    4344
    4445define( // -------------------------------------------------------------------
    4546  'EVNTCATS_INFO_VERSION', // VERSION HISTORY :
    46    '1.1.5'   // Fix bugs 1324 and 1325
    47 // '1.1.4'   // Improve help banner
    48 // '1.1.3'   // Better help banner management ; finalize banner texts
    49 // '1.1.2'   // Better help banner example : some examples
    50 // '1.1.1'   // Better help banner example ; but still no text in it
    51 // '1.1.0'   // First bugs (1305 and 1306) corrected ;
    52 //      add newly created user/group association with cat/AP (was forgotten) ;
    53 //      begin help banner
    54 // '1.0.0'   // Conception version
     47   '1.2.0' // Add feature 1335, Possibility to display the 'Connection'
     48           // link in identification block menu for generic users ;
     49           // finish (?) english translation
     50
     51// --------------------------------------------------------------------------- => à modifier :
     52                                                                               // evntcats_admin.php -> analyser un changement d'option dans la page d'options ;
     53                                                                               // config.tpl         -> proposer le réglage de cette nouvelle option ;
     54                                                                               // main.inc.php       -> afficher le lien si l'option le demande.
     55
     56// '1.1.5' // Fix bugs 1324 and 1325
     57// '1.1.4' // Improve help banner
     58// '1.1.3' // Better help banner management ; finalize banner texts
     59// '1.1.2' // Better help banner example : some examples
     60// '1.1.1' // Better help banner example ; but still no text in it
     61// '1.1.0' // First bugs (1305 and 1306) corrected ;
     62           // add newly created user/group association with cat/AP (was
     63           // forgotten) ; begin help banner
     64// '1.0.0' // Conception version
    5565); // ------------------------------------------------------------------------
    5666define(
     
    114124
    115125function auto_log_user() {
    116   global $ec_lists;
     126  global $ec_lists, $ec_page;
    117127
    118128  $ec_ap  = NULL;
     
    161171              }
    162172            }
    163             redirect(PHPWG_ROOT_PATH.'index.php?/category/'.$ec_cat);
     173            $ec_page = PHPWG_ROOT_PATH.'index.php?/category/'.$ec_cat;
     174            redirect($ec_page);
    164175          }
    165176        }
     
    276287 *
    277288 * duplicate_account_url()
    278  * adds a link "Duplicate" in Identification block menu.
     289 * adds a link for duplicating the currently identified user in
     290 * Identification block menu, in case the identifed user is granted to
     291 * duplication. Displays also the connection link for generic users, if
     292 * required in the configuration.
    279293 *
    280294 * @param no parameter
     
    285299
    286300function duplicate_account_url() {
    287   global $lang, $template, $user;
     301  global $lang, $template, $user, $ec_page;
    288302 
     303  // Adds duplication link, if needed
    289304  if (!is_admin() and !is_a_guest()) if (
    290305    read_ec_conf('dup_allow') == '1' or (
     
    301316    ) {
    302317      $lang['Register'] = $lang['Duplicate'];
    303       $lang['Create a new account'] = $lang['Create a new account with same properties'];
    304     }
     318      $lang['Create a new account'] =
     319       $lang['Create a new account with same properties'];
     320    }
     321  }
     322 
     323  // Adds connection link, if needed
     324  if (read_ec_conf('display_connection') == '1' and is_generic()) {
     325    // Adds connection link
     326    $template->assign(
     327      'U_LOGIN',
     328      get_root_url().'identification.php?redirect='.$_SERVER['REQUEST_URI']
     329    );
     330    // Removes "quick connection" fieldset (form)
     331    $template->set_filenames(array(
     332      'ec_no_quick_connect' =>
     333      realpath(EVNTCATS_PATH.'ec_no_quick_connect.tpl')
     334    ));
     335    $begin = 'PLUGIN_INDEX_CONTENT_BEFORE';
     336    $old_begin = $template->get_template_vars($begin);
     337    $template->assign_var_from_handle($begin, 'ec_no_quick_connect');
     338    $template->concat($begin, $old_begin);
    305339  }
    306340}
    307341
    308 add_event_handler('get_admin_plugin_menu_links', array(&$obj, 'plugin_admin_menu') );
     342add_event_handler(
     343 'get_admin_plugin_menu_links',
     344 array(&$obj, 'plugin_admin_menu')
     345);
    309346set_plugin_data($plugin['id'], $obj);
    310347
Note: See TracChangeset for help on using the changeset viewer.