Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

(no description)

Copyright: 2011 Darko Miletic <dmiletic@moodlerooms.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 468 lines (15 kb)
Included or required: 4 times
Referenced: 0 times
Includes or requires: 1 file
 backup/cc/cc_lib/xmlbase.php

Defines 4 classes

cc_helpers:: (12 methods):
  is_html()
  uuidgen()
  randomdir()
  build_query()
  process_embedded_files()
  embedded_files()
  embedded_mapping()
  add_files()
  handle_static_content()
  handle_resource_content()
  process_linked_files()
  relative_location()

cc_resource_location:: (4 methods):
  __construct()
  dirname()
  fullpath()
  rootdir()

pkg_static_resources:: (7 methods):
  __clone()
  __construct()
  instance()
  add()
  get_values()
  get_identifier()
  reset()

pkg_resource_dependencies:: (6 methods):
  __clone()
  __construct()
  instance()
  add()
  reset()
  get_deps()


Class: cc_helpers  - X-Ref

Various helper utils

is_html($filename)   X-Ref
Checks extension of the supplied filename

param: string $filename

uuidgen($prefix = '', $suffix = '', $uppercase = true)   X-Ref
Generates unique identifier

param: string $prefix
param: string $suffix
return: string

randomdir($where, $prefix = '', $suffix = '')   X-Ref
Creates new folder with random name

param: string $where
param: string $prefix
param: string $suffix
return: mixed - directory short name or false in case of failure

build_query($attributes, $search)   X-Ref
No description

process_embedded_files(&$doc, $attributes, $search, $customslash = null)   X-Ref
No description

embedded_files($html)   X-Ref
Get list of embedded files

param: string $html
return: multitype:mixed

embedded_mapping($packageroot, $contextid = null)   X-Ref
No description

add_files(cc_i_manifest &$manifest, $packageroot, $outdir, $allinone = true)   X-Ref
No description

handle_static_content(cc_i_manifest &$manifest, $packageroot, $contextid, $outdir, $allinone = true)   X-Ref
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

param: cc_i_manifest $manifest
param: string $packageroot
param: integer $contextid
param: string $outdir
param: boolean $allinone

handle_resource_content(cc_i_manifest &$manifest, $packageroot, $contextid, $outdir, $allinone = true)   X-Ref
No description

process_linked_files($content, cc_i_manifest &$manifest, $packageroot,$contextid, $outdir, $webcontent = false)   X-Ref
No description

relative_location($originpath, $linkingpath)   X-Ref
No description

Class: cc_resource_location  - X-Ref

__construct($rootdir)   X-Ref
ctor

param: string $rootdir - path to the containing directory

dirname($endseparator=false)   X-Ref
Newly created directory

return: string

fullpath($endseparator=false)   X-Ref
Full path to the new directory

return: string

rootdir($endseparator=false)   X-Ref
Returns containing dir

return: string

Class: pkg_static_resources  - X-Ref

__clone()   X-Ref


__construct()   X-Ref
No description

instance()   X-Ref

return: pkg_static_resources

add($key, $identifier, $file, $main, $node = null)   X-Ref
add new element

param: string $identifier
param: string $file
param: boolean $main

get_values()   X-Ref

return: array

get_identifier($location)   X-Ref
No description

reset()   X-Ref
No description

Class: pkg_resource_dependencies  - X-Ref

__clone()   X-Ref


__construct()   X-Ref
No description

instance()   X-Ref

return: pkg_resource_dependencies

add(array $deps)   X-Ref

param: array $deps

reset()   X-Ref
No description

get_deps()   X-Ref

return: array