mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-26 09:52:17 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@260071 c90b9560-bf6c-de11-be94-00142212c4b1
144 lines
3.8 KiB
XML
144 lines
3.8 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
||
<!-- $Revision: 1.3 $ -->
|
||
<!-- EN-Revision: 1.2 Maintainer: yannick Status: ready -->
|
||
<!-- Reviewed: no -->
|
||
|
||
<refentry xml:id="function.bbcode-set-flags" xmlns="http://docbook.org/ns/docbook">
|
||
<refnamediv>
|
||
<refname>bbcode_set_flags</refname>
|
||
<refpurpose>Spécifie des options d'analyseurs BBcode</refpurpose>
|
||
</refnamediv>
|
||
<refsect1 role="description">
|
||
&reftitle.description;
|
||
<methodsynopsis>
|
||
<type>bool</type><methodname>bbcode_set_flags</methodname>
|
||
<methodparam><type>resource</type><parameter>bbcode_container</parameter></methodparam>
|
||
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
|
||
<methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam>
|
||
</methodsynopsis>
|
||
|
||
<para>
|
||
Spécifie ou modifie des options d'analyseur BBCode.
|
||
</para>
|
||
|
||
</refsect1>
|
||
<refsect1 role="parameters">
|
||
&reftitle.parameters;
|
||
<para>
|
||
<variablelist>
|
||
<varlistentry>
|
||
<term><parameter>bbcode_container</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Ressource BBCode_Container, retournée par <function>bbcode_create</function>.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>flags</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
L'option qui doit être utilisée avec <parameter>bbcode_container</parameter>
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>mode</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Une des constantes BBCODE_SET_FLAGS_* à utiliser, ou supprimer.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
</para>
|
||
</refsect1>
|
||
<refsect1 role="returnvalues">
|
||
&reftitle.returnvalues;
|
||
<para>
|
||
&return.success;
|
||
</para>
|
||
</refsect1>
|
||
|
||
|
||
<refsect1 role="examples">
|
||
&reftitle.examples;
|
||
<para>
|
||
<example>
|
||
<title>Exemple avec <function>bbcode_set_flags</function></title>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?php
|
||
/*
|
||
* Préparation des r<>gles
|
||
*/
|
||
$arrayBBCode=array(
|
||
'b'=> array('type'=>BBCODE_TYPE_NOARG,
|
||
'open_tag'=>'<b>', 'close_tag'=>'</b>'),
|
||
'u'=> array('type'=>BBCODE_TYPE_NOARG,
|
||
'open_tag'=>'<u>', 'close_tag'=>'</u>'),
|
||
'i'=> array('type'=>BBCODE_TYPE_NOARG,
|
||
'open_tag'=>'<i>', 'close_tag'=>'</i>'),
|
||
);
|
||
/*
|
||
* BBCode mal imbriqué
|
||
*/
|
||
$text="[i] Parser [b] Auto Correction [/i] at work [/b]\n";
|
||
$BBHandler=bbcode_create($arrayBBCode);
|
||
echo bbcode_parse($BBHandler,$text);
|
||
// Activation de la réouverture automatique des éléments fermés
|
||
bbcode_set_flags($BBHandler,BBCODE_CORRECT_REOPEN_TAGS,
|
||
BBCODE_SET_FLAGS_SET);
|
||
echo bbcode_parse($BBHandler,$text);
|
||
|
||
/*
|
||
* BBCode mal imbriqué
|
||
*/
|
||
$text="[i] Parser [b] Auto Correction [/i] at work\n";
|
||
echo bbcode_parse($BBHandler,$text);
|
||
// Enabling automatic close of pending tags
|
||
bbcode_set_flags($BBHandler,
|
||
BBCODE_CORRECT_REOPEN_TAGS|BBCODE_AUTO_CORRECT,
|
||
BBCODE_SET_FLAGS_SET);
|
||
echo bbcode_parse($BBHandler,$text);
|
||
?>
|
||
]]>
|
||
</programlisting>
|
||
&example.outputs;
|
||
<screen>
|
||
<![CDATA[
|
||
<i> Parser <b> Auto Correction </b></i> at work
|
||
<i> Parser <b> Auto Correction </b></i><b> at work </b>
|
||
<i> Parser [b] Auto Correction </i> at work
|
||
<i> Parser <b> Auto Correction </b></i><b> at work
|
||
</b>
|
||
]]>
|
||
</screen>
|
||
</example>
|
||
</para>
|
||
</refsect1>
|
||
|
||
</refentry>
|
||
|
||
<!-- Keep this comment at the end of the file
|
||
Local variables:
|
||
mode: sgml
|
||
sgml-omittag:t
|
||
sgml-shorttag:t
|
||
sgml-minimize-attributes:nil
|
||
sgml-always-quote-attributes:t
|
||
sgml-indent-step:1
|
||
sgml-indent-data:t
|
||
indent-tabs-mode:nil
|
||
sgml-parent-document:nil
|
||
sgml-default-dtd-file:"../../../../manual.ced"
|
||
sgml-exposed-tags:nil
|
||
sgml-local-catalogs:nil
|
||
sgml-local-ecat-files:nil
|
||
End:
|
||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||
vim: et tw=78 syn=sgml
|
||
vi: ts=1 sw=1
|
||
-->
|
||
|