User:Emanuele/codedoc: Difference between revisions From Online Manual

Jump to: navigation, search
(Created page with "== $user_info['mod_cache'] and $_SESSION['mc'] == * '''time''' - the last time (timestamp) the mod_cache array has been rebuilt; * '''id''' - the user id; * '''gq''' - '''g'''rou...")
 
No edit summary
Line 16: Line 16:
** 1=1 - allowedTo('moderate_forum');
** 1=1 - allowedTo('moderate_forum');
** b.id_board IN ({list_of_boards}) - list_of_boards is a list (comma separated) of boards the user is moderator of.
** b.id_board IN ({list_of_boards}) - list_of_boards is a list (comma separated) of boards the user is moderator of.
== createList ==
* '''id''' - '''mandatory''', an id to identify the list
* '''columns''' - '''mandatory''', an associative array of columns, the key of each column must be unique (of course) the value is an array of values:
** '''sort''' - ''optional'', an associative array that holds the rules to sort the column, it can contain:
*** '''default''' - '''mandatory''', the default sorting rule;
*** '''reverse''' - '''mandatory''', the reverse sorting rule;
** '''header''' - '''mandatory''', an associative array describing the header of the column, it can contain the following indexes:
*** '''eval''' - ''optional'' (alternative to value), php code that will be passed to the php function eval;
*** '''value''' - ''optional'' (alternative to eval), a value (usually a string) that will be displayed as column header;
*** '''class''' - ''optional'', a css class to use for the header of the column;
*** '''style''' - ''optional'', a css style to use for the header of the column;
*** '''colspan''' - ''optional'', a number that will be used for the colspan attribute of the header;
** '''data''' - '''mandatory''', an associative array that holds the information to display the information, it can contain:
*** '''db''' - ''optional'' (alternative to db_htmlsafe, sprintf, function, eval, value), the easiest way, a value straight from the database;
*** '''db_htmlsafe''' - ''optional'' (alternative to db, sprintf, function, eval, value), similar to db, but make the value HTML safe;
*** '''sprintf'''' - ''optional'' (alternative to db, db_htmlsafe, function, eval, value), uses vsprintf to prepare the value, it must be in the form of an associative array containing:
**** '''params''' - '''mandatory''', pairs of values: the key holds the string to be used as parameter of vsprintf and the value is a boolean that defines if the key must be html safe or not.
**** '''format''' - '''mandatory''', the format of the string (the first parameter of vsprintf).
*** '''function''' - ''optional'' (alternative to db, db_htmlsafe, sprintf, eval, value), a php function that returns the value that should be displayed;
*** '''eval''' - ''optional'' (alternative to db, db_htmlsafe, sprintf, function, value), code that is passed to the php eval function;
*** '''value''' - ''optional'' (alternative to db, db_htmlsafe, sprintf, function, eval), a literal value;
*** if none from db, db_htmlsafe, sprintf, function, eval, value is present an empty string will be displayed;
*** '''comma_format''' - ''optional'', boolean if true the value is passed to the function comma_format;
*** '''timeformat''' - ''optional'', boolean if true the value is passed to the function timeformat;
*** '''class''' - ''optional'', a css class to use for the column;
*** '''style''' - ''optional'', a css style to use for the column;
* '''data_check''' - ''optional'' (2.1 only), an associative array, the key can be ''class'' or ''style'', the value is a function that checks the value and return a class or a style to be used at the row (tr) level of the table.
* '''items_per_page''' - ''optional'' (mandatory if get_count or base_href are present), the number of items to show in each page of the table;
* '''get_count''' - an associative array that allows find the number of elements of the list, it can contain the following parameters:
** '''file''' - ''optional'' a file (including path) to include;
** '''function''' - '''mandatory''', the function that counts the elements and return the value;
** '''params''' - ''optional'', an array of parameters that will be passed to the function;
* '''base_href''' - ''optional'' (mandatory if items_per_page is present), the href to be user to construct the page index;
* '''get_items''' - ''optional'', an associative array that allows find the values of elements of the list, it can contain the following parameters:
** '''file''' - ''optional'' a file (including path) to include;
** '''function''' - '''mandatory''', the function that returns the values of the elements;
** '''params''' - ''optional'', an array of parameters that will be passed to the function;
* '''title''' - ''optional'', the title of the table
* '''start_var_name''' - ''optional'', the starting variable name ('''not so sure''')
* '''default_sort_col''' - ''optional'', the default column used to sort the table;
* '''width''' - ''optional'', the width of the table;
* '''request_vars''' - '''optional''', an associative array of values that can be taken from $_REQUEST to define the sorting ('''no idea what I'm writing'''), it can contain:
** '''sort''' - ''optional'', a $_GET variable name that define the column to sort;
** '''desc''' - ''optional'', a $_GET variable name to define if the column should be sorted ascending or descending;
* '''form''' - ''optional'', an associative array of data to create a form, it can contain:
** '''missing a lot here''' - '''TBW'''
* '''no_items_label''' - '''TBW'''
* '''no_items_align''' - '''TBW'''
* '''additional_rows''' - '''TBW'''
** '''missing a lot here''' - '''TBW'''
* '''javascript''' - '''TBW'''
* '''list_menu''' - '''TBW'''

Revision as of 10:14, 10 August 2012

$user_info['mod_cache'] and $_SESSION['mc']

  • time - the last time (timestamp) the mod_cache array has been rebuilt;
  • id - the user id;
  • gq - group query, contains a pre-made query for groups the user is moderator of, it can be:
    • 0=1 - moderator of no groups;
    • 1=1 - allowedTo('manage_membergroups');
    • id_group IN ({list_of_groups}) - list_of_groups is a list (comma separated) of groups the user is moderator of;
  • bq - boards query, contains a pre-made query of boards the user has moderation powers, it can be:
    • 0=1 - moderator of no boards;
    • 1=1 - allowedTo('moderate_forum');
    • id_board IN ({list_of_boards}) - list_of_boards is a list (comma separated) of boards the user has moderation powers;
  • ap - approve posts, an array of boards the user can approve posts in, in other words the return of boardsAllowedTo('approve_posts');
  • mb - moderator boards, an array of boards the user is moderator of;
  • mq - moderator query, a pre-made query of boards the user is moderator of, it can be:
    • 0=1 - moderator of no boards;
    • 1=1 - allowedTo('moderate_forum');
    • b.id_board IN ({list_of_boards}) - list_of_boards is a list (comma separated) of boards the user is moderator of.

createList

  • id - mandatory, an id to identify the list
  • columns - mandatory, an associative array of columns, the key of each column must be unique (of course) the value is an array of values:
    • sort - optional, an associative array that holds the rules to sort the column, it can contain:
      • default - mandatory, the default sorting rule;
      • reverse - mandatory, the reverse sorting rule;
    • header - mandatory, an associative array describing the header of the column, it can contain the following indexes:
      • eval - optional (alternative to value), php code that will be passed to the php function eval;
      • value - optional (alternative to eval), a value (usually a string) that will be displayed as column header;
      • class - optional, a css class to use for the header of the column;
      • style - optional, a css style to use for the header of the column;
      • colspan - optional, a number that will be used for the colspan attribute of the header;
    • data - mandatory, an associative array that holds the information to display the information, it can contain:
      • db - optional (alternative to db_htmlsafe, sprintf, function, eval, value), the easiest way, a value straight from the database;
      • db_htmlsafe - optional (alternative to db, sprintf, function, eval, value), similar to db, but make the value HTML safe;
      • sprintf' - optional (alternative to db, db_htmlsafe, function, eval, value), uses vsprintf to prepare the value, it must be in the form of an associative array containing:
        • params - mandatory, pairs of values: the key holds the string to be used as parameter of vsprintf and the value is a boolean that defines if the key must be html safe or not.
        • format - mandatory, the format of the string (the first parameter of vsprintf).
      • function - optional (alternative to db, db_htmlsafe, sprintf, eval, value), a php function that returns the value that should be displayed;
      • eval - optional (alternative to db, db_htmlsafe, sprintf, function, value), code that is passed to the php eval function;
      • value - optional (alternative to db, db_htmlsafe, sprintf, function, eval), a literal value;
      • if none from db, db_htmlsafe, sprintf, function, eval, value is present an empty string will be displayed;
      • comma_format - optional, boolean if true the value is passed to the function comma_format;
      • timeformat - optional, boolean if true the value is passed to the function timeformat;
      • class - optional, a css class to use for the column;
      • style - optional, a css style to use for the column;
  • data_check - optional (2.1 only), an associative array, the key can be class or style, the value is a function that checks the value and return a class or a style to be used at the row (tr) level of the table.
  • items_per_page - optional (mandatory if get_count or base_href are present), the number of items to show in each page of the table;
  • get_count - an associative array that allows find the number of elements of the list, it can contain the following parameters:
    • file - optional a file (including path) to include;
    • function - mandatory, the function that counts the elements and return the value;
    • params - optional, an array of parameters that will be passed to the function;
  • base_href - optional (mandatory if items_per_page is present), the href to be user to construct the page index;
  • get_items - optional, an associative array that allows find the values of elements of the list, it can contain the following parameters:
    • file - optional a file (including path) to include;
    • function - mandatory, the function that returns the values of the elements;
    • params - optional, an array of parameters that will be passed to the function;
  • title - optional, the title of the table
  • start_var_name - optional, the starting variable name (not so sure)
  • default_sort_col - optional, the default column used to sort the table;
  • width - optional, the width of the table;
  • request_vars - optional, an associative array of values that can be taken from $_REQUEST to define the sorting (no idea what I'm writing), it can contain:
    • sort - optional, a $_GET variable name that define the column to sort;
    • desc - optional, a $_GET variable name to define if the column should be sorted ascending or descending;
  • form - optional, an associative array of data to create a form, it can contain:
    • missing a lot here - TBW
  • no_items_label - TBW
  • no_items_align - TBW
  • additional_rows - TBW
    • missing a lot here - TBW
  • javascript - TBW
  • list_menu - TBW


Advertisement: