ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilJsonUtil Class Reference

JSON (Javascript Object Notation) functions with backward compatibility for PHP version < 5.2. More...

+ Collaboration diagram for ilJsonUtil:

Static Public Member Functions

static encode ($mixed, $suppress_native=false)
static decode ($json_notated_string, $suppress_native=false)
static checkNativeSupport ()

Detailed Description

JSON (Javascript Object Notation) functions with backward compatibility for PHP version < 5.2.

Author
Jan Posselt jposs.nosp@m.elt@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Version
$Id$

Definition at line 12 of file class.ilJsonUtil.php.

Member Function Documentation

static ilJsonUtil::checkNativeSupport ( )
static

Definition at line 42 of file class.ilJsonUtil.php.

{
return function_exists('json_encode') && function_exists('json_decode');
}
static ilJsonUtil::decode (   $json_notated_string,
  $suppress_native = false 
)
static

Definition at line 28 of file class.ilJsonUtil.php.

References SERVICES_JSON_SUPPRESS_ERRORS.

Referenced by ilPageQuestionProcessor\saveQuestionAnswer().

{
if (!$suppress_native && self::checkNativeSupport())
{
return json_decode($json_notated_string);
}
else
{
include_once './Services/JSON/include/json.php';
return $json->decode($json_notated_string);
}
}

+ Here is the caller graph for this function:

static ilJsonUtil::encode (   $mixed,
  $suppress_native = false 
)
static

Definition at line 14 of file class.ilJsonUtil.php.

References SERVICES_JSON_SUPPRESS_ERRORS.

Referenced by ilTermsOfServiceJsonResponse\__toString(), ilCloudPluginFileTreeGUI\addDropZone(), ilCloudPluginCreateFolderGUI\asyncCreateFolder(), ilCloudPluginDeleteGUI\asyncDeleteItem(), ilObjCloudGUI\asyncGetBlock(), ilCloudPluginUploadGUI\asyncUploadFile(), ilCloudPluginDeleteGUI\cancel(), ilCloudPluginCreateFolderGUI\createFolder(), ilCloudPluginDeleteGUI\deleteItem(), ilPublicUserProfileGUI\doProfileAutoComplete(), ilAccountRegistrationGUI\doProfileAutoComplete(), ilObjForumGUI\fetchTreeChildrenAsyncObject(), ilForumExplorer\fillTreeTemplate(), ilChatroomBlockGUI\getChatroomSelectionList(), ilFileUploadGUI\getHTML(), ilAccordionGUI\getHTML(), ilAdvancedSelectionListGUI\getHTML(), ilDataSet\getJsonRepresentation(), ilRoleAutoComplete\getList(), ilSearchAutoComplete\getList(), ilRoleAutoComplete\getListByObject(), ilSearchAutoComplete\getLuceneList(), ilOverlayGUI\getOnLoadCode(), ilPreviewGUI\getPreviewHTML(), ilPreviewGUI\initPreview(), ilWikiPageGUI\insertWikiLinkAC(), ilMDEditorGUI\keywordAutocomplete(), ilBlogPostingGUI\keywordAutocomplete(), ilMailAddressbookGUI\lookupAddressbookAsync(), ilMailAddressbookGUI\lookupEmailsAsync(), ilMailSearchGUI\lookupRecipientAsync(), ilMailFormGUI\lookupRecipientAsync(), ilMailAddressbookGUI\lookupUsersAsync(), ilCloudPluginUploadGUI\uploadFiles(), and ilObjFileGUI\uploadFiles().

{
if (!$suppress_native && self::checkNativeSupport())
{
return json_encode($mixed);
}
else
{
include_once './Services/JSON/include/json.php';
return $json->encode($mixed);
}
}

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: