Moodle  2.2.1
http://www.collinsharper.com
cc_helpers Class Reference

Static Public Member Functions

static is_html ($filename)
static uuidgen ($prefix= '', $suffix= '', $uppercase=true)
static randomdir ($where, $prefix= '', $suffix= '')
static build_query ($attributes, $search)
static process_embedded_files (&$doc, $attributes, $search, $customslash=null)
static embedded_files ($html)
static embedded_mapping ($packageroot, $contextid=null)
static add_files (cc_i_manifest &$manifest, $packageroot, $outdir, $allinone=true)
static handle_static_content (cc_i_manifest &$manifest, $packageroot, $contextid, $outdir, $allinone=true)
static handle_resource_content (cc_i_manifest &$manifest, $packageroot, $contextid, $outdir, $allinone=true)
static process_linked_files ($content, cc_i_manifest &$manifest, $packageroot, $contextid, $outdir, $webcontent=false)
static relative_location ($originpath, $linkingpath)

Detailed Description

Various helper utils

Author:
Darko Miletic dmiletic@moodlerooms.com

Definition at line 32 of file cc_utils.php.


Member Function Documentation

static add_files ( cc_i_manifest &$  manifest,
packageroot,
outdir,
allinone = true 
) [static]

Definition at line 157 of file cc_utils.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static build_query ( attributes,
search 
) [static]

Definition at line 76 of file cc_utils.php.

Here is the caller graph for this function:

static embedded_files ( html) [static]

Get list of embedded files

Parameters:
string$html
Returns:
multitype:mixed

Definition at line 107 of file cc_utils.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static embedded_mapping ( packageroot,
contextid = null 
) [static]

Definition at line 121 of file cc_utils.php.

Here is the caller graph for this function:

static handle_resource_content ( cc_i_manifest &$  manifest,
packageroot,
contextid,
outdir,
allinone = true 
) [static]

Definition at line 214 of file cc_utils.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static handle_static_content ( cc_i_manifest &$  manifest,
packageroot,
contextid,
outdir,
allinone = true 
) [static]

Excerpt from IMS CC 1.1 overview : No spaces in filenames, directory and file references should employ all lowercase or all uppercase - no mixed case

Parameters:
cc_i_manifest$manifest
string$packageroot
integer$contextid
string$outdir
boolean$allinone
Exceptions:
RuntimeException

Definition at line 209 of file cc_utils.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static is_html ( filename) [static]

Checks extension of the supplied filename

Parameters:
string$filename

Definition at line 39 of file cc_utils.php.

Here is the caller graph for this function:

static process_embedded_files ( &$  doc,
attributes,
search,
customslash = null 
) [static]

Definition at line 87 of file cc_utils.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static process_linked_files ( content,
cc_i_manifest &$  manifest,
packageroot,
contextid,
outdir,
webcontent = false 
) [static]
  • detect all embedded files
  • locate their physical counterparts in moodle 2 backup
  • copy all files in the cc package stripping any spaces and using inly lowercase letters
  • add those files as resources of the type webcontent to the manifest
  • replace the links to the resourcse using $IMS-CC-FILEBASE$ and their new locations
  • cc_resource has array of files and array of dependencies
  • most likely we would need to add all files as independent resources and than attach them all as dependencies to the forum tag

Definition at line 249 of file cc_utils.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static randomdir ( where,
prefix = '',
suffix = '' 
) [static]

Creates new folder with random name

Parameters:
string$where
string$prefix
string$suffix
Returns:
mixed - directory short name or false in case of faliure

Definition at line 65 of file cc_utils.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static relative_location ( originpath,
linkingpath 
) [static]

Definition at line 287 of file cc_utils.php.

static uuidgen ( prefix = '',
suffix = '',
uppercase = true 
) [static]

Generates unique identifier

Parameters:
string$prefix
string$suffix
Returns:
string

Definition at line 51 of file cc_utils.php.

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations