PHP Doc pour le SL framework

Voici les classes du SL framework :

pluginSedLex[CLASSE]

This PHP class aims at simplifying the developement of new plugin for Wordpress and especially if you do not know how to develop it.

Therefore, your plugin class should inherit from this class. Please refer to the HOW TO manual to learn more.

Voici les méthodes de la classe:

Méthodes Détails
Méthodes Détails

getPluginID[METHODE]

Get the plugin ID

Paramètres :

Pas de paramètre

Valeur de retour :

string the plugin ID string. the string will be empty if it is not a plugin (i.e. the framework)

Exemple d'appel :

string getPluginID () ;

get_param[METHODE]

Get the value of an option of the plugin

For instance: echo $this->get_param('opt1') will return the value of the option 'opt1' stored for this plugin. Please note that two different plugins may have options with the same name without any conflict.

Paramètres :

$option (string) the name of the option

Valeur de retour :

mixed the value of the option requested

Exemple d'appel :

mixed get_param ($option) ;

Voir aussi :

parametersSedLex::parametersSedLex

pluginSedLex::del_param

pluginSedLex::get_name_params

pluginSedLex::set_param

get_name_params[METHODE]

Get name of all options

For instance: echo $this->get_name_params() will return an array with the name of all the options of the plugin

Paramètres :

Pas de paramètre

Valeur de retour :

array an array with all option names

Exemple d'appel :

array get_name_params () ;

Voir aussi :

parametersSedLex::parametersSedLex

pluginSedLex::del_param

pluginSedLex::get_param

pluginSedLex::set_param

del_param[METHODE]

Delete an option of the plugin

For instance: echo $this->get_param('opt1') will return the value of the option 'opt1' stored for this plugin. Please note that two different plugins may have options with the same name without any conflict.

Paramètres :

$option (string) the name of the option

Valeur de retour :

void

Exemple d'appel :

void del_param ($option) ;

Voir aussi :

parametersSedLex::parametersSedLex

pluginSedLex::gel_param

pluginSedLex::get_name_params

pluginSedLex::set_param

set_param[METHODE]

Set the option of the plugin

For instance, $this->set_param('opt1', 'val1') will store the string 'val1' for the option 'opt1'. Any object may be stored in the options

Paramètres :

$option (string) the name of the option

$value (mixed) the value of the option to be saved

Valeur de retour :

void

Exemple d'appel :

void set_param ($option, $value) ;

Voir aussi :

parametersSedLex::parametersSedLex

pluginSedLex::get_param

add_js[METHODE]

Add a javascript file in the header

For instance, $this->add_js('http://www.monserveur.com/wp-content/plugins/my_plugin/js/foo.js') ; will add the 'my_plugin/js/foo.js' in the header.

In order to save bandwidth and boost your website, the framework will concat all the added javascript (by this function) and serve the browser with a single js file

Note : you have to call this function in function your_function called by add_action('wp_print_scripts', array( $this, 'your_function'));

Paramètres :

$url (string) the complete http url of the javascript (this javascript should be an internal javascript i.e. stored by your blog and not, for instance, stored by Google)

Valeur de retour :

void

Exemple d'appel :

void add_js ($url) ;

Voir aussi :

pluginSedLex::flush_js

pluginSedLex::add_inline_js

add_inline_js[METHODE]

Add inline javascript in the header

For instance $this->add_inline_js('alert("foo");') ;

In order to save bandwidth and boost your website, the framework will concat all the added javascript (by this function) and serve the browser with a single js file

Note : you have to call this function in function your_function called by add_action('wp_print_scripts', array( $this, 'your_function'));

Paramètres :

$text (string) the javascript to be inserted in the header (without any <script> tags)

Valeur de retour :

void

Exemple d'appel :

void add_inline_js ($text) ;

Voir aussi :

pluginSedLex::flush_js

pluginSedLex::add_js

add_css[METHODE]

Add a CSS file in the header

For instance, $this->add_css('http://www.monserveur.com/wp-content/plugins/my_plugin/js/foo.css') ; will add the 'my_plugin/js/foo.css' in the header.

In order to save bandwidth and boost your website, the framework will concat all the added css (by this function) and serve the browser with a single css file

Note : you have to call this function in function your_function called by add_action('wp_print_styles', array( $this, 'your_function'));

Paramètres :

$url (string) the complete http url of the css file (this css should be an internal javascript i.e. stored by your blog and not, for instance, stored by Google)

Valeur de retour :

void

Exemple d'appel :

void add_css ($url) ;

Voir aussi :

pluginSedLex::flush_css

pluginSedLex::add_inline_css

add_inline_css[METHODE]

Add inline CSS in the header

For instance, $this->add_inline_css('.head { color:#FFFFFF; }') ;

In order to save bandwidth and boost your website, the framework will concat all the added css (by this function) and serve the browser with a single css file

Note : you have to call this function in function your_function called by add_action('wp_print_styles', array( $this, 'your_function'));

Paramètres :

$text (string) the css to be inserted in the header (without any <style> tags)

Valeur de retour :

void

Exemple d'appel :

void add_inline_css ($text) ;

Voir aussi :

pluginSedLex::flush_css

pluginSedLex::add_css

get_plugins_data[METHODE]

Get information on the plugin

For instance $info = pluginSedlex::get_plugins_data(WP_PLUGIN_DIR.'/my-plugin/my-plugin.php') will return an array with

- the folder of the plugin : $info['Dir_Plugin']

- the name of the plugin : $info['Plugin_Name']

- the tags of the plugin : $info['Plugin_Tag']

- the url of the plugin : $info['Plugin_URI']

- the description of the plugin : $info['Description']

- the name of the author : $info['Author']

- the url of the author : $info['Author_URI']

- the version number : $info['Version']

- the email of the Author : $info['Email']

Paramètres :

$plugin_file [optionnelle] (string) path of the plugin main file. If no paramater is provided, the file is the current plugin main file. (par défaut, sa valeur est : )

Valeur de retour :

array information on Name, Author, Description ...

Exemple d'appel :

array get_plugins_data ([$plugin_file]) ;

check_folder_rights[METHODE]

Ensure that the needed folders are writable by the webserver.

Will check usual folders and files.

You may add this in your configuration page $this->check_folder_rights( array(array($theFolderToCheck, "rw")) ) ;

If not a error msg is printed

Paramètres :

$folders (array) list of array with a first element (the complete path of the folder to check) and a second element (the needed rights "r", "w" [or a combination of those])

Valeur de retour :

void

Exemple d'appel :

void check_folder_rights ($folders) ;

the_content_SL[METHODE]

Get the displayed content

Paramètres :

$content (??) ??

Valeur de retour :

void

Exemple d'appel :

void the_content_SL ($content) ;

the_excerpt_ante_SL[METHODE]

Get the excerpt content

Paramètres :

$content (??) ??

Valeur de retour :

void

Exemple d'appel :

void the_excerpt_ante_SL ($content) ;

adminTable[CLASSE]

This PHP class enables the creation of tables in the admin backend

Voici les méthodes de la classe:

Méthodes Détails
Méthodes Détails

adminTable[METHODE]

Constructor of the class

Paramètres :

$nb_all_Items [optionnelle] (integer) the number of all items. If the number of submitted lines are less than this number, a navigation bar will be added at the top of the table (par défaut, sa valeur est : 0)

$nb_max_per_page [optionnelle] (integer) the number of item per page. This parameter is useful if you have submitted the previous parameter. (par défaut, sa valeur est : 0)

$order [optionnelle] (boolean) allow the ordering of the columns with small arrows (par défaut, sa valeur est : )

$search [optionnelle] (??) ?? (par défaut, sa valeur est : )

Valeur de retour :

adminTable the table

Exemple d'appel :

adminTable adminTable ([$nb_all_Items], [$nb_max_per_page], [$order], [$search]) ;

title[METHODE]

Set the titles of the columns

Paramètres :

$array (array) it is an array of string which is of the size of the number of columns. Each string is the title for a different column

Valeur de retour :

void

Exemple d'appel :

void title ($array) ;

current_page[METHODE]

Get the current page of the table.

This is relevant if the number of your items is greater than the number of lines

Paramètres :

Pas de paramètre

Valeur de retour :

integer the page number

Exemple d'appel :

integer current_page () ;

set_nb_all_Items[METHODE]

Set the number of items (all).

Paramètres :

$nb (??) ??

Valeur de retour :

void

Exemple d'appel :

void set_nb_all_Items ($nb) ;

current_filter[METHODE]

Get the currentfilter of the table.

Paramètres :

Pas de paramètre

Valeur de retour :

string the filter

Exemple d'appel :

string current_filter () ;

current_ordercolumn[METHODE]

Get the current column order of the table.

Paramètres :

Pas de paramètre

Valeur de retour :

integer the column number

Exemple d'appel :

integer current_ordercolumn () ;

current_orderdir[METHODE]

Get the current column direction of the table.

Paramètres :

Pas de paramètre

Valeur de retour :

string the column direction "ASC" or "DESC"

Exemple d'appel :

string current_orderdir () ;

removeFooter[METHODE]

Remove the showed title at the footer of the table

By default, titles of the columns are displayed at the top of the table and at its footer.

Paramètres :

Pas de paramètre

Valeur de retour :

void

Exemple d'appel :

void removeFooter () ;

add_line[METHODE]

Add a line in your table

For instance

$table = new adminTable() ;
$table->title(array("Col1", "Col2", "Col3") ) ;
$cel1 = new adminCell("Cel1-1") ;
$cel2 = new adminCell("Cel1-2") ;
$cel3 = new adminCell("Cel1-3") ;
$table->add_line(array($cel1, $cel2, $cel3), '1') ;
echo $table->flush() ;

This code will display a table with a unique line

Paramètres :

$array (array) it is an array of adminCell object. The length of this array is the same size of the number of your columns

$id (id) it is the id of this line. It is useful when you add an action on a cell

Valeur de retour :

void

Exemple d'appel :

void add_line ($array, $id) ;

Voir aussi :

adminCell:add_action

adminCell::adminCell

flush[METHODE]

Return the table HTML code. You just have to echo it

Paramètres :

Pas de paramètre

Valeur de retour :

string the HTML code of the table

Exemple d'appel :

string flush () ;

adminCell[CLASSE]

This PHP class create cells to be used with the adminTable::add_line method

Voici les méthodes de la classe:

Méthodes Détails
Méthodes Détails

adminCell[METHODE]

Create the cells object

Paramètres :

$content (string) the HTML code to be displayed in the cell

Valeur de retour :

adminCell the object

Exemple d'appel :

adminCell adminCell ($content) ;

add_action[METHODE]

To add a javascript action on this cell.

An action a small link at the bottom of the cell which call a javascript action when it is clicked

For instance :

$cel1 = new adminCell("content cell") ;
$cel1->add_action("Delete", "deleteFunction") ;

with the following javascript code in the js/js_admin.js file to call a PHP function (deletePHP) in AJAX

function deleteFunction (element) {
     // Get the id of the line
     var idLine = element.getAttribute("id");
     // Prepare the argument for the AJAX call
     var arguments = {
           action: 'deletePHP',
           id : idLine
     }
     //POST the data
     jQuery.post(ajaxurl, arguments, function(response) {
           // The call is finished
     });
}

and do not forget to add a add_action('wp_ajax_deletePHP', array($this,'deletePHP')); in the _init function of your plugin

If the function is only a string with no parantehsis (i.e. the_function), thus the id of the line will be passed in argument

If the function is a function name with arguments (i.e. the_function(arg1, arg2)), thus this function will be called directly

Paramètres :

$name (string) the text of the link to be displayed

$javascript_function (string) the name of the function to be called when the link is clicked

Valeur de retour :

adminCell the cell object

Exemple d'appel :

adminCell add_action ($name, $javascript_function) ;

adminTabs[CLASSE]

This PHP class enables the creation of tabulation in the admin backend

Voici les méthodes de la classe:

Méthodes Détails
Méthodes Détails

adminTabs[METHODE]

Constructor of the class

Paramètres :

Pas de paramètre

Valeur de retour :

adminTabs the tabs

Exemple d'appel :

adminTabs adminTabs () ;

add_tab[METHODE]

Add a tabulation

For instance,

$tabs = new adminTabs() ;
ob_start() ;
echo "Content 1" ;
$tabs->add_tab("Tab1", ob_get_clean() ) ;
ob_start() ;
echo "Content 2" ;
$tabs->add_tab("Tab2", ob_get_clean() ) ;
echo $tabs->flush() ;

will create to basic tabulation.

Paramètres :

$title (string) the title of the tabulation

$content (string) the HTML content of the tab

$image [optionnelle] (string) the path of an image that will be display before the title. Please indicate a 20x20px image. (par défaut, sa valeur est : )

Valeur de retour :

void

Exemple d'appel :

void add_tab ($title, $content, [$image]) ;

activate[METHODE]

Change the tabs activated by default (normally it is the first tab i.e. 1)

1 is the first, 2 is the second, etc.

Paramètres :

$nb (integer) the tabultaion index to activate

Valeur de retour :

void

Exemple d'appel :

void activate ($nb) ;

flush[METHODE]

Print the tabulation HTML code.

Paramètres :

Pas de paramètre

Valeur de retour :

void

Exemple d'appel :

void flush () ;

boxAdmin[CLASSE]

This PHP class enables the creation of a box in the admin backend

Voici les méthodes de la classe:

Méthodes Détails
Méthodes Détails

boxAdmin[METHODE]

Constructor of the class

Paramètres :

$title (string) the title of the box

$content (string) the HTML code of the content of the box

Valeur de retour :

boxAdmin the box object

Exemple d'appel :

boxAdmin boxAdmin ($title, $content) ;

flush[METHODE]

Print the box HTML code.

Paramètres :

Pas de paramètre

Valeur de retour :

void

Exemple d'appel :

void flush () ;

browsersOsDetection[CLASSE]

This PHP class enables the Browser and OS detection

Voici les méthodes de la classe:

Méthodes Détails
Méthodes Détails

browsersOsDetection[METHODE]

Constructor of the class

Paramètres :

$agent (??) ??

Valeur de retour :

browsersOsDetection

Exemple d'appel :

browsersOsDetection browsersOsDetection ($agent) ;

getBrowserName[METHODE]

Get the browser name

Paramètres :

Pas de paramètre

Valeur de retour :

string The browser name

Exemple d'appel :

string getBrowserName () ;

getBrowserVersion[METHODE]

Get the browser version

Paramètres :

Pas de paramètre

Valeur de retour :

string The browser version

Exemple d'appel :

string getBrowserVersion () ;

getPlatformName[METHODE]

Get the platform name

Paramètres :

Pas de paramètre

Valeur de retour :

string The platform name

Exemple d'appel :

string getPlatformName () ;

getPlatformVersion[METHODE]

Get the platform version

Paramètres :

Pas de paramètre

Valeur de retour :

string The platform version

Exemple d'appel :

string getPlatformVersion () ;

SL_Database[CLASSE]

This PHP class creates an export of the database

Voici les méthodes de la classe:

Méthodes Détails
Méthodes Détails

progress[METHODE]

Return the progression ratio

Paramètres :

$file (string) the sql file that is being created

Valeur de retour :

string the progress nb_table_extracted/nb_table

Exemple d'appel :

string progress ($file) ;

reset[METHODE]

Reset the process

Paramètres :

$path (string) the path in which the database sql file should be created

Valeur de retour :

void

Exemple d'appel :

void reset ($path) ;

createSQL[METHODE]

Create the sql file

Paramètres :

$sqlfilename (string) the path of the sql file to create

$maxExecutionTime [optionnelle] (integer) the maximum execution time (in second) (par défaut, sa valeur est : 20)

$maxAllocatedMemory [optionnelle] (integer) the maximum memory allocated by the process (in bytes) (par défaut, sa valeur est : 4000000)

Valeur de retour :

array with the name of the file (or 'finished' => false and if an error occured see 'error' for the error message)

Exemple d'appel :

array createSQL ($sqlfilename, [$maxExecutionTime], [$maxAllocatedMemory]) ;

SL_Debug[CLASSE]

This PHP class allow to log debug information regarding the execution of plugins

For instance :

SL_Debug::log(get_class(), "An error occurred!", $error_level);

the error_level may be 1=critical ; 2=error ; 3=warning ; 4=information ; 5=verbose.

Voici les méthodes de la classe:

Méthodes Détails
Méthodes Détails

get_log_path[METHODE]

Get log file

Paramètres :

Pas de paramètre

Valeur de retour :

string the path of the log file

Exemple d'appel :

string get_log_path () ;

log[METHODE]

Log function

Paramètres :

$where (string) the name of the plugin which call the log function

$text (string) the text to be logged

$error_level [optionnelle] (integer) 1=critical ; 2=error ; 3=warning ; 4=information ; 5=verbose (par défaut, sa valeur est : 5)

Valeur de retour :

void

Exemple d'appel :

void log ($where, $text, [$error_level]) ;

deprecatedSL[CLASSE]

This PHP class enables the creation of a box in the admin backend

Voici les méthodes de la classe:

    Méthodes Détails
    Méthodes Détails

    feedbackSL[CLASSE]

    This PHP class enables the translation of the plugin using the framework

    Voici les méthodes de la classe:

    Méthodes Détails
    Méthodes Détails

    feedbackSL[METHODE]

    Constructor of the class

    Paramètres :

    $plugin (string) the name of the plugin (probably <code>str_replace("/","",str_replace(basename(__FILE__),"",plugin_basename( __FILE__)))</code>)

    $pluginID (string) the pluginID of the plugin (probably <code>$this->pluginID</code>)

    Valeur de retour :

    feedbackSL the feedbackSL object

    Exemple d'appel :

    feedbackSL feedbackSL ($plugin, $pluginID) ;

    enable_feedback[METHODE]

    Display the feedback form

    Please note that the users will send you their comments/feedback at the email used is in the header of the main file of your plugin Author Email : name@domain.tld

    Paramètres :

    Pas de paramètre

    Valeur de retour :

    void

    Exemple d'appel :

    void enable_feedback () ;

    foldDiff[CLASSE]

    This PHP class allows to compare two folder to find differences

    Voici les méthodes de la classe:

    Méthodes Détails
    Méthodes Détails

    diff[METHODE]

    Compute differences between the two folders

    Paramètres :

    $path1 (string) the path of the first folder

    $path2 (string) the path of the second folder

    $racine [optionnelle] (boolean) true if it the the first level (par défaut, sa valeur est : 1)

    Valeur de retour :

    void

    Exemple d'appel :

    void diff ($path1, $path2, [$racine]) ;

    render[METHODE]

    Display the difference

    Paramètres :

    $closeNotModifiedFolders [optionnelle] (boolean) close folders if their contents have not been modified (par défaut, sa valeur est : 1)

    $withTick [optionnelle] (boolean) display ticks (par défaut, sa valeur est : )

    $withRandom [optionnelle] (boolean) set to true if there are a plurality of rendering (par défaut, sa valeur est : )

    Valeur de retour :

    string the random number that should be used to know which button has been clicked

    Exemple d'appel :

    string render ([$closeNotModifiedFolders], [$withTick], [$withRandom]) ;

    otherPlugins[CLASSE]

    This PHP class create a page with the other plugins of the author referenced

    Voici les méthodes de la classe:

    Méthodes Détails
    Méthodes Détails

    otherPlugins[METHODE]

    Constructor of the class

    Paramètres :

    $nameAuthor [optionnelle] (string) the name of the author for which the plugins has to be listed (par défaut, sa valeur est : )

    $exclu [optionnelle] (array) a list of excluded plugin (slug name) (par défaut, sa valeur est : [])

    Valeur de retour :

    void

    Exemple d'appel :

    void otherPlugins ([$nameAuthor], [$exclu]) ;

    list_plugins[METHODE]

    Display the list of plugins

    Paramètres :

    Pas de paramètre

    Valeur de retour :

    void

    Exemple d'appel :

    void list_plugins () ;

    get_list_plugins[METHODE]

    Get the list of plugins and save it on the disk

    Paramètres :

    Pas de paramètre

    Valeur de retour :

    void

    Exemple d'appel :

    void get_list_plugins () ;

    pluginInfo[METHODE]

    Display the plugin Info

    Paramètres :

    $plugin (string) the name of the plugin (slug name)

    Valeur de retour :

    array the first cell is for the synthesis, the second is for the description and the screenshot

    Exemple d'appel :

    array pluginInfo ($plugin) ;

    parametersSedLex[CLASSE]

    This PHP class enable the creation of form to manage the parameter of your plugin

    Voici les méthodes de la classe:

    Méthodes Détails
    Méthodes Détails

    parametersSedLex[METHODE]

    Constructor of the object

    Paramètres :

    $obj (class) a reference to the object containing the parameter (usually, you need to provide "$this"). If it is "new rootSLframework()", it means that it is the framework parameters.

    $tab [optionnelle] (string) if you want to activate a tabulation after the submission of the form (par défaut, sa valeur est : )

    Valeur de retour :

    parametersSedLex the form class to manage parameter/options of your plugin

    Exemple d'appel :

    parametersSedLex parametersSedLex ($obj, [$tab]) ;

    Voir aussi :

    pluginSedLex::set_param

    pluginSedLex::get_param

    add_title[METHODE]

    Add title in the form

    Paramètres :

    $title (string) the title to add

    Valeur de retour :

    void

    Exemple d'appel :

    void add_title ($title) ;

    add_comment[METHODE]

    Add a comment in the form

    Paramètres :

    $comment (string) the comment to add

    Valeur de retour :

    void

    Exemple d'appel :

    void add_comment ($comment) ;

    add_comment_default_value[METHODE]

    Add a comment in the form which display the default value of the param

    Paramètres :

    $param (??) ??

    Valeur de retour :

    void

    Exemple d'appel :

    void add_comment_default_value ($param) ;

    add_param[METHODE]

    Add a textarea, input, checkbox, etc. in the form to enable the modification of parameter of the plugin

    Please note that the default value of the parameter (defined in the get_default_option function) will define the type of input form. If the default value is a:
          - string, the input form will be an input text
          - integer, the input form will be an input text accepting only integer
          - string beggining with a '*', the input form will be a textarea
          - string equals to '[file]$path', the input form will be a file input and the file will be stored at $path (relative to the upload folder)
          - string equals to '[password]$password', the input form will be a password input ;
          - array of string, the input form will be a dropdown list
          - boolean, the input form will be a checkbox

    Paramètres :

    $param (string) the name of the parameter/option as defined in your plugin and especially in the <code>get_default_option</code> of your plugin

    $name (string) the displayed name of the parameter in the form

    $forbid [optionnelle] (string) regexp which will delete some characters in the submitted string (only a warning is raised) : For instance <code>$forbid = "/[^a-zA-Z0-9]/"</code> will remove all the non alphanumeric value (par défaut, sa valeur est : )

    $allow [optionnelle] (string) regexp which will verify that the submitted string will respect this rexexp, if not, the submitted value is not saved and an erreor is raised : For instance, <code>$allow = "/^[a-zA-Z]/"</code> require that the submitted string begin with a nalpha character (par défaut, sa valeur est : )

    $related [optionnelle] (array) a list of the other params that will be actived/deactivated when this parameter is set to true/false (thus, this param should be a boolean) (par défaut, sa valeur est : [])

    Valeur de retour :

    void

    Exemple d'appel :

    void add_param ($param, $name, [$forbid], [$allow], [$related]) ;

    get_new_value[METHODE]

    Get the new value of the parameter after its update (with happen upon calling flush)

    Paramètres :

    $param (string) the name of the parameter/option as defined in your plugin and especially in the <code>get_default_option</code> of your plugin

    Valeur de retour :

    mixed the value of the param (array if there is an error or null if there is no new value)

    Exemple d'appel :

    mixed get_new_value ($param) ;

    remove_param[METHODE]

    Remove a parameter of the plugin which has been previously added through add_param (then it can be useful if you want to update a parameter without printing the form)

    It will also remove any comment for the same

    Paramètres :

    $param (string) the name of the parameter/option as defined in your plugin and especially in the <code>get_default_option</code> of your plugin

    Valeur de retour :

    void

    Exemple d'appel :

    void remove_param ($param) ;

    flush[METHODE]

    Print the form with parameters

    Paramètres :

    Pas de paramètre

    Valeur de retour :

    void

    Exemple d'appel :

    void flush () ;

    phpDoc[CLASSE]

    This PHP class enables the generation of the documentation of the PHP files used for the framework

    Please note that the methods of this class is not supposed to be called from your plugin. Thus, its methods are not displayed here.

    Voici les méthodes de la classe:

      Méthodes Détails
      Méthodes Détails

      popupAdmin[CLASSE]

      This PHP class create a page with the other plugins of the author listed

      Voici les méthodes de la classe:

      Méthodes Détails
      Méthodes Détails

      popupAdmin[METHODE]

      Constructor of the class

      Paramètres :

      $title (string) the title which will be displayed in the top of the popup

      $content (string) the content of the popup

      $css [optionnelle] (string) the css of the popup if needed. (par défaut, sa valeur est : )

      $callback [optionnelle] (??) ?? (par défaut, sa valeur est : )

      Valeur de retour :

      void

      Exemple d'appel :

      void popupAdmin ($title, $content, [$css], [$callback]) ;

      render[METHODE]

      Display the popup

      Paramètres :

      Pas de paramètre

      Valeur de retour :

      void

      Exemple d'appel :

      void render () ;

      progressBarAdmin[CLASSE]

      This PHP class enables the creation of a progress bar

      Voici les méthodes de la classe:

      Méthodes Détails
      Méthodes Détails

      progressBarAdmin[METHODE]

      Constructor of the class

      Paramètres :

      $length [optionnelle] (integer) the width in pixel of the progress bar (par défaut, sa valeur est : 300)

      $height [optionnelle] (integer) the height in pixel of the progress bar (par défaut, sa valeur est : 20)

      $start [optionnelle] (integer) the % of the start (progression) (par défaut, sa valeur est : 0)

      $insideText [optionnelle] (string) the text to put in the progress bar (par défaut, sa valeur est : )

      $id [optionnelle] (string) the identifieur if there is a pluralitu of progress bar (the image which moves is named $id."_image", the text is named $id."_txt") (par défaut, sa valeur est : progressbar)

      Valeur de retour :

      boxAdmin the box object

      Exemple d'appel :

      boxAdmin progressBarAdmin ([$length], [$height], [$start], [$insideText], [$id]) ;

      flush[METHODE]

      Print the progress bar code

      Once the progress bar is displayed, you may modify the progression by calling in javascript progressBar_modifyProgression(25,"id") which modify the progression to 25% for the ID "id" (the ID is not mandatory, by default the ID will be "progressbar")

      Once the progress bar is displayed, you may modify the text by calling in javascript progressBar_modifyText("new text","id") which modify the text to "new text" for the ID "id" (the ID is not mandatory, by default the ID will be "progressbar")

      Paramètres :

      Pas de paramètre

      Valeur de retour :

      void

      Exemple d'appel :

      void flush () ;

      translationSL[CLASSE]

      This PHP class enables the translation of the plugin using the framework

      Voici les méthodes de la classe:

      Méthodes Détails
      Méthodes Détails

      translationSL[METHODE]

      Constructor of the class

      Paramètres :

      $domain (string) the name of the domain (probably <code>$this->pluginID</code>)

      $plugin (string) the name of the plugin (probably <code>str_replace("/","",str_replace(basename(__FILE__),"",plugin_basename( __FILE__)))</code>)

      Valeur de retour :

      translationSL the translationSL object

      Exemple d'appel :

      translationSL translationSL ($domain, $plugin) ;

      enable_translation[METHODE]

      Enable the translation and display the management interface

      Please note that the translators will be able to send you their translation so that you can add them to your repository (the email used is in the header of the main file of your plugin Author Email : name@domain.tld)

      Paramètres :

      Pas de paramètre

      Valeur de retour :

      void

      Exemple d'appel :

      void enable_translation () ;

      set_locale[METHODE]

      Set the language ... according to the configuration

      Paramètres :

      $loc (??) ??

      Valeur de retour :

      void

      Exemple d'appel :

      void set_locale ($loc) ;

      textDiff[CLASSE]

      This PHP class allows to determine which part of a text has been removed and added

      Voici les méthodes de la classe:

      Méthodes Détails
      Méthodes Détails

      diff[METHODE]

      Identify the added part

      Paramètres :

      $text1 (string) the reference text

      $text2 (string) the text to compare with

      Valeur de retour :

      void

      Exemple d'appel :

      void diff ($text1, $text2) ;

      treeList[CLASSE]

      This PHP class allows to display hierachical list in a smart way

      Voici les méthodes de la classe:

      Méthodes Détails
      Méthodes Détails

      render[METHODE]

      Display the tree list according to the array given

      For instance :

      $array = array(
      array('first element', null),
      array('second element', array(
      array('sub1', null),
      array('sub2', null)
      )),
      array('third element', null)
      ) ;

      treeList::render($array) ;

      if the array have 1 elements i.e. array('title element') the first element is the title (no children)

      if the array have 2 elements i.e. array('title element', "E45AF"), the second element will be considered as the id of the array

      if the array have 3 elements i.e. array('title element', "E45AF", null) the third element is the children (array or null)

      if the array have 4 elements i.e. array('title element', "E45AF", null, false), the fourth element will be considered as an indication whether the node is to be expanded or not (by default it is true)

      Paramètres :

      $array (array) list to display, each item of the list is an array : array('title', null) if the node is the last one in the tree or array(title, array(...)) if there is other son nodes.

      $reduce_develop [optionnelle] (boolean) to enable the reduction and the expansion of the tree with javascript (par défaut, sa valeur est : )

      $reorder_callback (string) if you want to make the tree (nested list) sortable, please indicate what is the ajax callback function to be called upon sort. This function will receive the array in the $_POST['result'] variable. This function should return "OK". Otherwise, the return message will be 'alerted'

      $classPerso [optionnelle] (string) a CSS custom class to customize the apparence of the tree (par défaut, sa valeur est : )

      Valeur de retour :

      void

      Exemple d'appel :

      void render ($array, [$reduce_develop], $reorder_callback, [$classPerso]) ;

      svnAdmin[CLASSE]

      This PHP class enables the svn management of the plugin with the wordpress.org repository

      Voici les méthodes de la classe:

      Méthodes Détails
      Méthodes Détails

      svnAdmin[METHODE]

      Constructor of the class

      Paramètres :

      $host (string) the host of the svn repository (for instance svn.wp-plugins.org)

      $port [optionnelle] (interger) the port of the webdav repository (par défaut, sa valeur est : 80)

      $login [optionnelle] (string) your login (par défaut, sa valeur est : )

      $mdp [optionnelle] (string) your password (par défaut, sa valeur est : )

      Valeur de retour :

      svnAdmin the box object

      Exemple d'appel :

      svnAdmin svnAdmin ($host, [$port], [$login], [$mdp]) ;

      listFilesInRepository[METHODE]

      List the files and folder on the repository

      Paramètres :

      $base (string) the relative path of the folder to be looked into (from the repository)

      $rec [optionnelle] (boolean) true if the listing should be reccursive (useful if you want the list of an entire repository with sub-folders) (par défaut, sa valeur est : 1)

      $credentials [optionnelle] (boolean) true if the repository requires credentials to list files (par défaut, sa valeur est : )

      Valeur de retour :

      array 'isOk' => whether the request is successful, 'list' => the list of files and folders, 'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array listFilesInRepository ($base, [$rec], [$credentials]) ;

      getActivityFolder[METHODE]

      Get the activity collection folder (required to put/delete file in the repo)

      Paramètres :

      $base (string) the relative path of the folder (for instance /yourplugin/trunk/)

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : )

      Valeur de retour :

      array 'isOk' => whether the request is successful, 'activity_folder' => the activity folder, 'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array getActivityFolder ($base, [$credentials]) ;

      getVCC[METHODE]

      Get VCC (Version Controlled Resource)

      Paramètres :

      $base (string) the relative path of the folder (for instance /yourplugin/trunk/)

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : )

      Valeur de retour :

      array 'isOk' => whether the request is successful, 'vcc' => the version controlled folder, 'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array getVCC ($base, [$credentials]) ;

      getRevision[METHODE]

      Get Repository Revision

      Paramètres :

      $base (string) the relative path of the folder (for instance /yourplugin/trunk/)

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : )

      Valeur de retour :

      array 'isOk' => whether the request is successful, 'revision' => the revision number, 'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array getRevision ($base, [$credentials]) ;

      createActivity[METHODE]

      Create an activity

      Paramètres :

      $activity_n_uuid (string) it is the activity folder concatenated with an random UUID (composed with hexadecimal digit xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : )

      Valeur de retour :

      array 'isOk' => whether the request is successful, 'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array createActivity ($activity_n_uuid, [$credentials]) ;

      Voir aussi :

      svnAdmin::getActivityFolder

      getCommitCommentURL[METHODE]

      Get the commit comment URL

      Paramètres :

      $vcc (string) the VCC of the repository

      $activity_n_uuid (string) it is the activity folder concatenated with the random UUID (composed with hexadecimal digit xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : )

      Valeur de retour :

      array 'isOk' => whether the request is successful, 'url' the comment url, 'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array getCommitCommentURL ($vcc, $activity_n_uuid, [$credentials]) ;

      Voir aussi :

      svnAdmin::getActivityFolder

      svnAdmin::getVCC

      setCommitComment[METHODE]

      Set a commit comment

      Paramètres :

      $comment (string) the comment to be added

      $comment_url (string) the comment url

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : )

      Valeur de retour :

      array 'isOk' => whether the request is successful,'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array setCommitComment ($comment, $comment_url, [$credentials]) ;

      Voir aussi :

      svnAdmin::getCommitCommentURL

      getVersionFolder[METHODE]

      Get the version folder

      Paramètres :

      $base (string) the relative path of the folder (for instance /yourplugin/trunk/)

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : )

      Valeur de retour :

      array 'isOk' => whether the request is successful, 'version_folder' => the version folder,'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array getVersionFolder ($base, [$credentials]) ;

      getPutFolder[METHODE]

      Get the folder to put files or delete files

      Paramètres :

      $version (string) the version folder

      $activity_n_uuid (string) it is the activity folder concatenated with the random UUID (composed with hexadecimal digit xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : )

      Valeur de retour :

      array 'isOk' => whether the request is successful, 'put_folder' the put url, 'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array getPutFolder ($version, $activity_n_uuid, [$credentials]) ;

      Voir aussi :

      svnAdmin::getActivityFolder

      svnAdmin::getVersionFolder

      putFile[METHODE]

      Put a file in the repo

      Paramètres :

      $put_folder_n_file (string) the put folder concatenated with the file name

      $file (string) the complete url of the file on your disk

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : )

      Valeur de retour :

      array 'isOk' => whether the request is successful, 'svn_header' the svn header sent (useful for debugging), 'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array putFile ($put_folder_n_file, $file, [$credentials]) ;

      Voir aussi :

      svnAdmin::getPutFolder

      putFolder[METHODE]

      Put folder in the repository

      Paramètres :

      $put_folder_n_folder (string) the put folder concatenated with the folder to add

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : 1)

      Valeur de retour :

      array 'isOk' => whether the request is successful,'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array putFolder ($put_folder_n_folder, [$credentials]) ;

      Voir aussi :

      svnAdmin::getPutFolder

      deleteFileFolder[METHODE]

      Put folder in the repository

      Paramètres :

      $put_folder_n_filefolder (string) the put folder concatenated with the folder/file to add

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : 1)

      Valeur de retour :

      array 'isOk' => whether the request is successful,'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array deleteFileFolder ($put_folder_n_filefolder, [$credentials]) ;

      Voir aussi :

      svnAdmin::getPutFolder

      merge[METHODE]

      Merge the commit ... thus all the change will be taken in account

      Paramètres :

      $base (string) the relative path of the folder (for instance /yourplugin/trunk/)

      $activity_n_uuid (string) it is the activity folder concatenated with the random UUID (composed with hexadecimal digit xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : )

      Valeur de retour :

      array 'isOk' => whether the request is successful, 'commit_info' the commit information, 'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array merge ($base, $activity_n_uuid, [$credentials]) ;

      Voir aussi :

      svnAdmin::getActivityFolder

      getFile[METHODE]

      Get a single file of the repository

      Paramètres :

      $base_file (string) the relative path of the file to get (for instance /yourplugin/trunk/file1.txt)

      $store (string) the local path to store the file retrieved (for instance /home/foo/yourplugin/file1.txt)

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : 1)

      Valeur de retour :

      array 'isOk' => whether the request is successful, 'siez' the size in bytes of the retrieved file

      Exemple d'appel :

      array getFile ($base_file, $store, [$credentials]) ;

      getAllFiles[METHODE]

      Get all files of the repository

      Paramètres :

      $base (string) the relative path of the folder (for instance /yourplugin/trunk/)

      $vcc (string) the VCC

      $rev (string) the revision number

      $store (string) the local path to store the file retrieved (for instance /home/foo/yourplugin/)

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : 1)

      Valeur de retour :

      array 'isOk' => whether the request is successful, 'info' the list of retrieved files/folder, 'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array getAllFiles ($base, $vcc, $rev, $store, [$credentials]) ;

      Voir aussi :

      svnAdmin::getRevision

      svnAdmin::getVCC

      prepareCommit[METHODE]

      Prepare the commit

      Paramètres :

      $base (string) the relative path of the folder (for instance /yourplugin/trunk/)

      $comment (string) the comment for the commit

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : )

      Valeur de retour :

      array 'isOk' => whether the request is successful, 'step' indicated the step which fails, 'putFolder' the put folder , 'activityFolder' the acivity folder, 'uuid' the random uuid used for this commit, 'raw_result' the request and the respond in an array (useful for debugging purpose)

      Exemple d'appel :

      array prepareCommit ($base, $comment, [$credentials]) ;

      sendSVNRequest[METHODE]

      Send a SVN request

      Paramètres :

      $host (string) the host (for instance svn.wp-plugins.org)

      $relative_uri (string) the base url (for instance /yourplugin/trunk/)

      $type (string) the type of request (e.g. GET, PROPFIND, PROPPATCH, etc.)

      $content (string) the content of the http request

      $additional_headers [optionnelle] (array) if addiotionnal header are required (for instance array('Content-Type: text/plain')) (par défaut, sa valeur est : [])

      $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : )

      Valeur de retour :

      array the response and the content sent

      Exemple d'appel :

      array sendSVNRequest ($host, $relative_uri, $type, $content, [$additional_headers], [$credentials]) ;

      Utils[CLASSE]

      This PHP class regroups a few useful method to manage directory, string, ...

      Voici les méthodes de la classe:

      Méthodes Détails
      Méthodes Détails

      convertUTF8[METHODE]

      To convert into UTF8

      Paramètres :

      $content (string) the string to convert into UTF8

      Valeur de retour :

      string the converted string

      Exemple d'appel :

      string convertUTF8 ($content) ;

      dirSize[METHODE]

      Compute the size of a directory (reccursively or not)

      Paramètres :

      $path (string) the path of the directory to scan

      $recursive [optionnelle] (boolean) set to FALSE if you do NOT want to reccurse in the folder of the directory (par défaut, sa valeur est : 1)

      Valeur de retour :

      integer the size of the directory

      Exemple d'appel :

      integer dirSize ($path, [$recursive]) ;

      is_really_int[METHODE]

      Test if the argument is really an integer (even if string)

      For instance :

      is_really_int(5) will return TRUE.

      is_really_int("5") will return TRUE.

      is_really_int(5.2) will return FALSE.

      is_really_int(array(5)) will return FALSE.

      Paramètres :

      $int (mixed) the integer, float, string, ... to check

      Valeur de retour :

      boolean TRUE if it is an integer, FALSE otherwise

      Exemple d'appel :

      boolean is_really_int ($int) ;

      rand_str[METHODE]

      Randomize a string

      For instance, rand_str(5, "0123456789") will return a string of length 5 characters comprising only numbers

      Paramètres :

      $length (integer) the length of the randomized result string

      $chars (string) the available characters for the randomized result string

      Valeur de retour :

      string the randomized result string

      Exemple d'appel :

      string rand_str ($length, $chars) ;

      create_identifier[METHODE]

      Create an simple identifier from a given string. It removes all non alphanumeric characters and strip spaces

      For instance :

      create_identifier("Hello World 007") will return "Hello_World_007".

      create_identifier("It's time !") will return "Its_time_".

      create_identifier("4L car") will return "L_car".

      Paramètres :

      $text (string) the text to be sanitized

      Valeur de retour :

      string the sanitized string (identifier)

      Exemple d'appel :

      string create_identifier ($text) ;

      byteSize[METHODE]

      Convert an integer into a string which represent a size in a computer format (ie. MB, KB, GB, etc.)

      Paramètres :

      $bytes (integer) the number to convert into a byte-format (ie. MB, KB, GB, etc.)

      Valeur de retour :

      string the size with a byte-format at the end (ie. MB, KB, GB, etc.)

      Exemple d'appel :

      string byteSize ($bytes) ;

      multicolumn_sort[METHODE]

      Sort a table against the n-th column

      Paramètres :

      $data (array) the table (i.e. array of array) to be sorted

      $num (integer) the n-th column to be considered in order to sort the table

      $asc [optionnelle] (boolean) the order will be ascendant if true and descendant otherwise (par défaut, sa valeur est : 1)

      Valeur de retour :

      array the sorted table

      Exemple d'appel :

      array multicolumn_sort ($data, $num, [$asc]) ;

      copy_rec[METHODE]

      Copy a file or a directory (recursively)

      Paramètres :

      $source (string) the source directory

      $destination (string) the destination directory

      Valeur de retour :

      void

      Exemple d'appel :

      void copy_rec ($source, $destination) ;

      rm_rec[METHODE]

      Delete a file or a directory (recursively)

      Paramètres :

      $path (string) the path to delete

      Valeur de retour :

      boolean true if the dir or file does not exists at the end of the rm process

      Exemple d'appel :

      boolean rm_rec ($path) ;

      md5_rec[METHODE]

      Compute the md5 of a file or a directory (recursively)

      Paramètres :

      $path (string) the path to compute hash

      $exclu [optionnelle] (array) a list of filename/folder to exclude from the hash (par défaut, sa valeur est : [])

      Valeur de retour :

      string md5 hash

      Exemple d'appel :

      string md5_rec ($path, [$exclu]) ;

      is_writable[METHODE]

      Check if a folder or a file is writable

      Paramètres :

      $path (string) the path to the folder or the file

      Valeur de retour :

      boolean true if the folder or the file is writable

      Exemple d'appel :

      boolean is_writable ($path) ;

      is_readable[METHODE]

      Check if a folder or a file is readable

      Paramètres :

      $path (string) the path to the folder or the file

      Valeur de retour :

      boolean true if the folder or the file is writable

      Exemple d'appel :

      boolean is_readable ($path) ;

      SL_Zip[CLASSE]

      This PHP class creates zip file (multipart if needed)

      It requires the gzcompress function. Otherwise, a fatal error will be raised

      For instance :

      $z = new SL_Zip;
      $z -> addFile("/www/test/File.txt","/www/test/","/newroot/");
      $z -> addDir("/www/test/Folder","/www/test/","/newroot/") ;
      $z -> createZip("/pathToZip/backup.zip",1048576);

      Voici les méthodes de la classe:

      Méthodes Détails
      Méthodes Détails

      progress[METHODE]

      Return the progression ratio

      Paramètres :

      $file (??) ??

      Valeur de retour :

      string the progress nb_file_included/nb_file

      Exemple d'appel :

      string progress ($file) ;

      addFile[METHODE]

      Add files to the archive

      Paramètres :

      $filename (string) the path of the file to add

      $remove [optionnelle] (string) the part of the path to remove (par défaut, sa valeur est : )

      $add [optionnelle] (string) the part of the path to add (par défaut, sa valeur est : )

      Valeur de retour :

      void

      Exemple d'appel :

      void addFile ($filename, [$remove], [$add]) ;

      addDir[METHODE]

      Add directory to the archive (reccursively)

      Paramètres :

      $dirname (string) the path of the folder to add

      $remove [optionnelle] (string) the part of the path to remove (par défaut, sa valeur est : )

      $add [optionnelle] (string) the part of the path to add (par défaut, sa valeur est : )

      $exclu [optionnelle] (array) a list of folder that are no to be included in the zip file (par défaut, sa valeur est : [])

      Valeur de retour :

      void

      Exemple d'appel :

      void addDir ($dirname, [$remove], [$add], [$exclu]) ;

      reset[METHODE]

      reset the zip process

      Paramètres :

      $path (??) ??

      Valeur de retour :

      void

      Exemple d'appel :

      void reset ($path) ;

      is_inProgress[METHODE]

      Tells whether a zip file is being created or not

      Paramètres :

      $path (??) ??

      Valeur de retour :

      array the 'step' could be 'in progress' (a process is still running), 'nothing' (no zip is being zipped) or 'to be completed' (and the 'name_zip' will be the name of the zip file being zipped) or 'error' (and the 'error' will display the error messgae)

      Exemple d'appel :

      array is_inProgress ($path) ;

      createZip[METHODE]

      Create the archive and split it if necessary

      Paramètres :

      $splitfilename (string) the path of the zip file to create

      $chunk_size [optionnelle] (integer) the maximum size of the archive (par défaut, sa valeur est : 1.0E+15)

      $maxExecutionTime [optionnelle] (integer) the maximum execution time in second (if this time is exceeded, the function will return false. You just have to relaunch this function to complete the zip from where it has stopped) (par défaut, sa valeur est : 150)

      $maxAllocatedMemory [optionnelle] (??) ?? (par défaut, sa valeur est : 4000000)

      Valeur de retour :

      array with the name of the file (or 'finished' => false if an error occured see 'error' for the error message)

      Exemple d'appel :

      array createZip ($splitfilename, [$chunk_size], [$maxExecutionTime], [$maxAllocatedMemory]) ;