Properties

$cache

$cache : \Battis\HierarchicalSimpleCache

Cache manager

Type

\Battis\HierarchicalSimpleCache

$smarty

$smarty : \smtech\StMarksSmarty\StMarksSmarty

St. Mark's-styled HTML templating

Type

\smtech\StMarksSmarty\StMarksSmarty

Methods

interactiveGetAccessToken()

interactiveGetAccessToken(string  $reason = null, string  $redirectURL = null, string  $errorURL = null) : void

Interactively acquire an API access token

/config/canvas/key and /config/canvas/secret must be defined in config.xml for this to work!

Parameters

string $reason

Explanation of why an API access token is necessary

string $redirectURL

(Optional, defaults to $_SERVER['REQUEST_URI']) URL of page to redirect to after acquiring access token

string $errorURL

(Optional) URL of page to redirect to on error

interactiveConsumersControlPanel()

interactiveConsumersControlPanel() : void

Handle tool consumer management interactively

Display and manage a control panel for managing Tool Consumers interactively.

setCache()

setCache(\Battis\HierarchicalSimpleCache  $cache) 

Update the cache manager

Parameters

\Battis\HierarchicalSimpleCache $cache

getCache()

getCache() : \Battis\HierarchicalSimpleCache

Get the cache manager

Returns

\Battis\HierarchicalSimpleCache

cache_pushKey()

cache_pushKey(string  $layer) : string

Push a hierarchical layer to the cache

Parameters

string $layer

Returns

string

cache_popKey()

cache_popKey() : string|null

Pop a hierarchical layer off of the cache

Returns

string|null

cache_get()

cache_get(string  $key) : mixed

Retrieve a cached value

Parameters

string $key

Returns

mixed

cache_set()

cache_set(string  $key, mixed  $data) : boolean

Set a cached value

Parameters

string $key
mixed $data

Returns

boolean

setSmarty()

setSmarty(\smtech\StMarksSmarty\StMarksSmarty  $smarty) 

Update the HTML templating engine

Parameters

\smtech\StMarksSmarty\StMarksSmarty $smarty

getSmarty()

getSmarty() : \smtech\StMarksSmarty\StMarksSmarty

Get the HTML templating engine

Returns

\smtech\StMarksSmarty\StMarksSmarty

smarty_assign()

smarty_assign(string  $varname, mixed  $var = null, boolean  $noCache = false) : void

Assign a value to a template variables

Parameters

string $varname
mixed $var
boolean $noCache

(Optional, default false)

smarty_addTemplateDir()

smarty_addTemplateDir(string  $template, string  $key = null, boolean  $isConfig = false) 

Register another template directory

Parameters

string $template
string $key

(Optional, default null)

boolean $isConfig

(Optional, default false)

smarty_prependTemplateDir()

smarty_prependTemplateDir(string  $template, string  $key = null) 

Prepend an over-riding template directory to Smarty

Parameters

string $template
string $key

(Optional)

smarty_addMessage()

smarty_addMessage(string  $title, string  $content, string  $class = \Battis\BootstrapSmarty\NotificationMessage::INFO) 

Add a message to be displayed to the user

Parameters

string $title
string $content
string $class

(Optional, default NotificationMessage::INFO)

smarty_display()

smarty_display(string  $template = 'page.tpl', string  $cache_id = null, string  $compile_id = null, string  $parent = null) : void

Display an HTML template

Parameters

string $template

(Optional, default page.tpl)

string $cache_id

(Optional, default null)

string $compile_id

(Optional, default, null)

string $parent

(Optional, default null)

loadConfiguration()

loadConfiguration(string  $configFilePath, boolean  $forceRecache = false) : void

Update a Toolbox instance from a configuration file

Extends the inherited Toolbox::loadConfiguration() to add two additional pieces of configuration metadata:

  • APP_PATH is the path to the Tool Provider app
  • APP_URL is the URL of the Tool Provider app

Also stores the API access token acquired by interactiveGetAccessToken().

Parameters

string $configFilePath
boolean $forceRecache

(Optional, default false)

interactiveConsumersControlPanel_loadConsumer()

interactiveConsumersControlPanel_loadConsumer(string  $key = null) : \LTI_Tool_Consumer

Create a (potentially new) LTI_Tool_Consumer

Parameters

string $key

(Optional)

Returns

\LTI_Tool_Consumer