Changeset 29147


Ignore:
Timestamp:
Aug 2, 2014, 4:33:28 PM (10 years ago)
Author:
mistic100
Message:

clean help + add example codes
TODO: update all language (no new translation, only refactor)

Location:
extensions/ExtendedDescription
Files:
5 added
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • extensions/ExtendedDescription/admin.php

    r29129 r29147  
    33
    44global $template, $page;
     5
    56load_language('plugin.lang', EXTENDED_DESC_PATH);
    67
    7 $page['infos'][] = l10n('Extended Description have been successfully installed. Now you can use all its features in most text boxes of Piwigo.');
    88
     9if (isset($_GET['tab']))
     10{
     11  $template->assign(array(
     12    'EXTDESC_PAGE' => $_GET['tab'],
     13    'EXTDESC_HELP' => load_language('help.'. $_GET['tab'] .'.html', EXTENDED_DESC_PATH, array('return'=>true))
     14    ));
     15}
     16else
     17{
     18  $page['infos'][] = l10n('Extended Description have been successfully installed. Now you can use all its features in most text boxes of Piwigo.');
     19}
    920
    1021
    1122$template->assign(array(
    1223  'EXTENDED_DESC_PATH' => EXTENDED_DESC_PATH,
    13   'EXTDESC_HELP' => array(
    14     'lang' =>       load_language('help.lang.html', EXTENDED_DESC_PATH, array('return'=>true)),
    15     'extdesc' =>    load_language('help.extdesc.html', EXTENDED_DESC_PATH, array('return'=>true)),
    16     'cat_photo' =>  load_language('help.cat_photo.html', EXTENDED_DESC_PATH, array('return'=>true)),
    17     'slider' =>     load_language('help.slider.html', EXTENDED_DESC_PATH, array('return'=>true)),
    18     'hide' =>       load_language('help.hide.html', EXTENDED_DESC_PATH, array('return'=>true)),
    19     'redirect' =>   load_language('help.redirect.html', EXTENDED_DESC_PATH, array('return'=>true)),
    20     'logged' =>     load_language('help.logged.html', EXTENDED_DESC_PATH, array('return'=>true)),
    21     ),
    22   ));
     24  'EXTDESC_ADMIN' => get_root_url() . 'admin.php?page=plugin-ExtendedDescription',
     25  'EXTDESC_TITLES' => array(
     26    'lang' => l10n('Multilingual descriptions'),
     27    'extdesc' => l10n('Extended descriptions'),
     28    'cat_photo' => l10n('Insert an album or a photo'),
     29    'slider' => l10n('Insert a carousel'),
     30    'hide' => l10n('Hide elements'),
     31    'redirect' => l10n('Redirect elements'),
     32    'logged' => l10n('Login link & logged in block'),
     33  ),
     34));
    2335
    24 $template->set_filename('extdesc', realpath(EXTENDED_DESC_PATH . 'template/admin.tpl'));
     36$template->set_filename('extdesc', realpath(EXTENDED_DESC_PATH . 'template/admin/main.tpl'));
    2537$template->assign_var_from_handle('ADMIN_CONTENT', 'extdesc');
  • extensions/ExtendedDescription/include/admin.inc.php

    r29129 r29147  
    6565
    6666    $template->assign(array(
    67       'EXTENDED_DESC_PATH' => EXTENDED_DESC_PATH,
     67      'EXTENDED_DESC_PATH' => 'admin/'.EXTENDED_DESC_PATH,
    6868      'EXTDESC_HELP' => array(
    6969        'lang' =>       load_language('help.lang.html', EXTENDED_DESC_PATH, array('return'=>true)),
     
    7777      ));
    7878
    79     $template->set_filename('extdesc', realpath(EXTENDED_DESC_PATH . 'template/admin.tpl'));
     79    $template->set_filename('extdesc', realpath(EXTENDED_DESC_PATH . 'template/admin/popup.tpl'));
    8080   
    8181    $help_content = '<h2>Extended Description</h2>' . $template->parse('extdesc', true);
  • extensions/ExtendedDescription/language/en_UK/help.cat_photo.html

    r26430 r29147  
     1<h4>[photo id=xx]</h4>
     2<p>This tag allows you to insert one photo of any size you want.</p>
     3
     4<b>Options:</b>
    15<ul>
    2   <li><b>[cat=xx]</b></li>
     6  <li><code>id</code>: the photo identifier</li>
     7  <li><code>album</code>: (optional) the parent album identifier</li>
     8  <li><code>size</code>: (optional) the size of the photo, from <i>{SQ, TH, XXS, XS, S, M, L, XL, XXL}</i></li>
     9  <li><code>html</code>: (optional) if set to <code>false</code> the tag only returns the URL of the photo, without HTML</li>
     10  <li><code>link</code>: (optional) if set to <code>true</code> the photo is wrapped into a link to the photo page</li>
    311</ul>
    4 <p>This tag inserts an album in the description, where xx is the album identifier.</p>
    512
    6 <ul>
    7   <li><b>[photo id=xx album=yy size=M html=yes link=yes]</b></li>
    8 </ul>
    9 <p>This tag allows you to insert one picture of any size you want, with:<br><br>
    10 - <code>id</code> the photo identifier<br>
    11 - <code>album</code> (optional) the parent album identifier<br>
    12 - <code>size</code> (optional) the size of the photo, from <i>{SQ, TH, XXS, XS, S, M, L, XL, XXL}</i><br>
    13 - <code>html</code> (optional) if set to <i>no</i> the tag only returns the URL of the photo, without HTML<br>
    14 - <code>link</code> (optional) if set to <i>yes</i> the photo is wrapped into a link to the picture page</p>
     13<pre>
     14[photo id=46]
    1515
    16 <ul>
    17   <li><b>[random album=yy size=M html=yes link=yes]</b></li>
    18 </ul>
    19 <p>Same thing as above, except that the photo is chosen randomly from <code>album</code></p>
     16[photo id=46 album=22 size=M html=true link=true]
     17</pre>
     18
     19<h4>[random album=xx]</h4>
     20<p>Same thing as above, except that the photo is chosen randomly from the whole gallery or from <code>album</code>.</p>
     21
     22<pre>
     23[random]
     24
     25[random album=123 size=M html=yes link=yes]
     26</pre>
     27
     28<h4>[cat=xx]</h4>
     29<p>This tag inserts an album in the description, where <code>xx</code> is the album identifier.</p>
  • extensions/ExtendedDescription/language/en_UK/help.extdesc.html

    r26430 r29147  
    33or even 2 distinct descriptions inside the album page.</p>
    44
    5 <p>tag &lt;!--more--&gt; adds text to the short description.<br>
    6 tag &lt;!--complete--&gt; lets the user have 2 distinct descriptions.<br>
    7 tag &lt;!--up-down--&gt; lets the user have a top and a bottom description.</p>
    8 
    9 <ul>
    10   <li><b>&lt;!--more--&gt;</b></li>
    11 </ul>
    12 <code>short description &lt;!--more--&gt; long description</code>
     5<h4>&lt;!--more--&gt;</h4>
    136<p>Only the short description is displayed outside the album. On the album page, you will see short description + long description.</p>
    147
    15 <ul>
    16   <li><b>&lt;!--complete--&gt;</b></li>
    17 </ul>
    18 <code>short description &lt;!--complete--&gt; long description</code>
     8<pre>
     9short description &lt;!--more--&gt; long description
     10</pre>
     11
     12<h4>&lt;!--complete--&gt;</h4>
    1913<p>Only the short description is displayed outside the album. On the album page, you will only see the long description, so you have 2 distinct descriptions.</p>
    2014
    21 <ul>
    22   <li><b>&lt;!--up-down--&gt;</b></li>
    23 </ul>
    24 <code>top description &lt;!--up-down--&gt; bottom description</code>
     15<pre>
     16short description &lt;!--complete--&gt; long description
     17</pre>
     18
     19<h4>&lt;!--up-down--&gt;</h4>
    2520<p>Only the top description is displayed outside the album.  On the album page, the top description is displayed above the thumbnails, the bottom description is displayed below the thumbnails.</p>
     21
     22<pre>
     23top description &lt;!--up-down--&gt; bottom description
     24</pre>
  • extensions/ExtendedDescription/language/en_UK/help.hide.html

    r26430 r29147  
    11<h4>Hide an album</h4>
    2 
    3 <p>Use tag <b>&lt;!--hidden--&gt;</b> in the album name:<br>
     2<p>Use tag <code>&lt;!--hidden--&gt;</code> in the album name:<br>
    43<br>
    54- it won't be displayed in the parent album<br>
     
    76
    87<h4>Hide an album from the menu</h4>
    9 
    10 <p>Use tag <b>&lt;!--mb-hidden--&gt;</b> in the album name:<br>
     8<p>Use tag <code>&lt;!--mb-hidden--&gt;</code> in the album name:<br>
    119<br>
    1210- it won't be displayed in the album menu<br>
     
    1412
    1513<h4>Hide a photo</h4>
    16 
    17 <p>Use tag <b>&lt;!--hidden--&gt;</b> in the photo name:<br>
     14<p>Use tag <code>&lt;!--hidden--&gt;</code> in the photo name:<br>
    1815<br>
    1916- it won't be displayed on the thumbnails page<br>
  • extensions/ExtendedDescription/language/en_UK/help.lang.html

    r29129 r29147  
    1 <p>Multilingual descriptions are placed between [lang=xx] and [/lang] tags, where xx is the language code (for example en, es, fr). There are also 2 special languages : [lang=default] and [lang=all]</p>
     1<p>Multilingual descriptions are placed between <code>[lang=xx]</code> and <code>[/lang]</code> tags,
     2where xx is the language code (for example en, es, fr).</p>
    23
    3 <p>The default description will be used if the description is not available in the connected user selected language.
    4 If [lang=default] does not exists, anything outside the [lang] tags will be considered as the default description.</p>
     4<pre>
     5[lang=en]Default description[/lang]
     6[lang=fr]Description en français[/lang]
     7[lang=de]Deutsche Beschreibung[/lang]
     8</pre>
    59
    6 <p><u>Special language <i>all</i></u>: anything inside [lang=all] will be included in the description, whatever the connected user defined language is.
     10<h4>Special language <i>default</i></h4>
     11<p>The default description will be used if the description is not available in the connected user selected language.<br>
     12If <code>[lang=default]</code> does not exists, anything outside the <code>[lang]</code> tags will be considered as the default description.</p>
     13
     14<pre>
     15[lang=default]Default description[/lang]
     16[lang=fr]Description en français[/lang]
     17
     18// OR
     19
     20Default description
     21[lang=fr]Description en français[/lang]
     22</pre>
     23
     24<h4>Special language <i>all</i></h4>
     25<p>Anything inside <code>[lang=all]</code> will be included in the description, whatever the connected user defined language is.<br>
    726This is mainly useful to include HTML/JavaScript code inside a description.</p>
    827
    9 <p><b>Example</b>:<br>
    10 <code>[lang=default] default description [/lang]<br>
    11 [lang=en] description in english [/lang]<br>
    12 [lang=de] deutsche Beschreibung [/lang]</code>
    13 </p>
     28<pre>
     29[lang=all]&lt;p&gt;[/lang]
     30  [lang=default]Default description[/lang]
     31  [lang=fr]Description en français[/lang]
     32  [lang=de]Deutsche Beschreibung[/lang]
     33[lang=all]&lt;/p&gt;[/lang]
     34</pre>
  • extensions/ExtendedDescription/language/en_UK/help.logged.html

    r29129 r29147  
     1<h4>[login-link]</h4>
     2<p>This tag allows to insert everywhere a login link with automatic redirection to the current age.</p>
     3
     4<b>Options:</b>
    15<ul>
    2   <li><b>[login-link html=true text="log in[lang=fr]connectez-vous[/lang]"]</b></li>
     6  <li><code>html</code>: (optional) if set to <i>false</i> the tag only returns the login URL, without HTML</li>
     7  <li><code>text</code>: (optional) link label, can contain <code>[lang]</code> tags</li>
    38</ul>
    49
    5 <p>This tag allow to insert everywhere a login link with automatic redirection to the current age.<br><br>
    6 - <code>html</code> (optional) if set to <i>false</i> the tag only returns the login URL, without HTML<br>
    7 - <code>text</code> (optional) link label, can contain <code>[lang]</code> tags<p>
     10<pre>
     11[login-link]
    812
    9 <ul>
    10   <li><b>[logged]</b></li>
    11 </ul>
     13[login-link html=true text="log in[lang=fr]connectez-vous[/lang]"]
     14</pre>
    1215
     16<h4>[logged]</h4>
    1317<p>Display a block of text only if the current user is logged or not.</p>
    1418
    15 <p><b>Example</b>:<br>
    16 <code>[logged] Welcome back [/logged]<br>
    17 [logged=false] Please log in [/logged]</code>
    18 </p>
     19<pre>
     20[logged=true] Welcome back [/logged]
     21[logged=false] Please log in [/logged]
     22</pre>
  • extensions/ExtendedDescription/language/en_UK/help.redirect.html

    r26430 r29147  
    1 <ul>
    2   <li><b>[redirect http://piwigo.org]</b></li>
    3 </ul>
     1<h4>[redirect http://piwigo.org]</h4>
    42<p>Insert this tag into a album description to redirect it to the URL of your choice.</p>
    53
    6 <ul>
    7   <li><b>[redirect img=xx]</b></li>
    8 </ul>
    9 <p>Redirect to a photo of your gallery where xx is the photo identifier; you can add the album identifier next to the photo identifier: <code>xx.ccc</code>.</p>
     4<h4>[redirect img=xx]</h4>
     5<p>Redirect to a photo of your gallery where <code>xx</code> is the photo identifier; you can add the album identifier next to the photo identifier: <code>xx.ccc</code>.</p>
    106
    11 <ul>
    12   <li><b>[redirect cat=xx]</b></li>
    13 </ul>
    14 <p>Redirect to a album of your gallery where xx the album identifier.</p>
     7<h4>[redirect cat=xx]</h4>
     8<p>Redirect to a album of your gallery where <code>xx</code> the album identifier.</p>
    159
    16 <ul>
    17   <li><b>[redirect search=xx]</b></li>
    18 </ul>
    19 <p>Redirect to a search page of your gallery where xx is the search identifier.</p>
     10<h4>[redirect search=xx]</h4>
     11<p>Redirect to a search page of your gallery where <code>xx</code> is the search identifier.</p>
  • extensions/ExtendedDescription/language/en_UK/help.slider.html

    r26430 r29147  
     1<h4>[slider album=xx]</h4>
     2<p>This tag allows to insert a photo slideshow.</p>
     3
     4<b>Options:</b> (you must set <code>album</code> OR <code>list</code>)
    15<ul>
    2   <li><b>[slider album=xx nb_images=10 random=no list=aa,bb,cc size=M speed=3 title=no effect=fade arrows=yes control=yes elastic=no thumbs_size=80]</b></li>
     6  <li><code>album</code>: (optional) source album</li>
     7  <li><code>nb_images</code>: (optional) max number of photos to display in the slideshow</li>
     8  <li><code>random</code>: (optional) choose photos randomly in the album</li>
     9  <li><code>list</code>: (optional) a list of photos ids separated by a comma</li>
     10  <li><code>size</code>: (optional) the size of the photos, from <i>{SQ, TH, XXS, XS, S, M, L, XL, XXL}</i></li>
     11  <li><code>speed</code>: (optional) the slideshow speed (in seconds)</li>
     12  <li><code>title</code>: (optional) display photo title</li>
     13  <li><code>effect</code>: (optional) transition effect (see <a href="http://docs.dev7studios.com/jquery-plugins/nivo-slider#jumpNav-5">NivoSlider doc</a>)</li>
     14  <li><code>arrows</code>: (optional) display navigation arrows</li>
     15  <li><code>elastic</code>: (optional) adapt slideshow size to each photo</li>
     16  <li><code>control</code>: (optional) display navigation controls, can also be set to <code>thumb</code></li>
     17  <li><code>thumbs_size</code>: (optional) thumbnails size in pixel if <code>control=thumb</code></li>
    318</ul>
    4 <p>This tag allows to insert a slideshow (NivoSlider). (you must set <code>album</code> OR <code>list</code>):<br><br>
    5 - <code>album</code> (optional) source album<br>
    6 - <code>nb_images</code> (optional) max number of photos to display in the slideshow<br>
    7 - <code>random</code> (optional) choose photos randomly in the album <i>{yes, no}</i><br>
    8 - <code>list</code> (optional) a list of photos ids separated by a comma<br>
    9 - <code>size</code> (optional) the size of the photos, from <i>{SQ, TH, XXS, XS, S, M, L, XL, XXL}</i><br>
    10 - <code>speed</code> (optional) the slideshow speed (in seconds)<br>
    11 - <code>title</code> (optional) display photo title <i>{yes, no}</i><br>
    12 - <code>effect</code> (optional) transition effect (see <a href="http://docs.dev7studios.com/jquery-plugins/nivo-slider">NivoSlider doc</a>)<br>
    13 - <code>arrows</code> (optional) display navigation arrows <i>{yes, no}</i><br>
    14 - <code>control</code> (optional) display navigation controls <i>{yes, no, thumb}</i><br>
    15 - <code>elastic</code> (optional) adapt slideshow size to each photo <i>{yes, no}</i><br>
    16 - <code>thumbs_size</code> (optional) thumbnails size in pixel if <code>control=thumb</code><p>
     19
     20<pre>
     21[slider album=123]
     22
     23[slider list=46,47,52]
     24
     25[slider album=123 nb_images=10 random=false size=M speed=3 title=false effect=fade arrows=true elastic=false control=true thumbs_size=80]
     26</pre>
  • extensions/ExtendedDescription/language/en_UK/plugin.lang.php

    r29129 r29147  
    44$lang['This category is redirected to %s'] = 'This album is redirected to %s';
    55$lang['Extended Description have been successfully installed. Now you can use all its features in most text boxes of Piwigo.'] = 'Extended Description have been successfully installed. Now you can use all its features in most text boxes of Piwigo.';
     6
     7$lang['Back'] = 'Back';
    68
    79$lang['Multilingual descriptions'] = 'Multilingual descriptions';
     
    1113$lang['Redirect elements'] = 'Redirect elements';
    1214$lang['Login link & logged in block'] = 'Login link & logged in block';
     15$lang['Insert a carousel'] = 'Insert a carousel';
Note: See TracChangeset for help on using the changeset viewer.