ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
functions.php File Reference

Go to the source code of this file.

Functions

if(function_exists('assetic_init')) assetic_init (AssetFactory $factory)
 Initializes the global Assetic object. More...
 
 assetic_javascripts ($inputs=array(), $filters=array(), array $options=array())
 Returns an array of javascript URLs. More...
 
 assetic_stylesheets ($inputs=array(), $filters=array(), array $options=array())
 Returns an array of stylesheet URLs. More...
 
 assetic_image ($input, $filters=array(), array $options=array())
 Returns an image URL. More...
 
 _assetic_urls ($inputs=array(), $filters=array(), array $options=array())
 Returns an array of asset urls. More...
 

Function Documentation

◆ _assetic_urls()

_assetic_urls (   $inputs = array(),
  $filters = array(),
array  $options = array() 
)

Returns an array of asset urls.

Parameters
array | string$inputsInput strings
array | string$filtersFilter names
array$optionsAn array of options
Returns
array An array of URLs

Definition at line 97 of file functions.php.

References $options, and array.

Referenced by assetic_image(), assetic_javascripts(), and assetic_stylesheets().

98 {
99  global $_assetic;
100 
101  if (!is_array($inputs)) {
102  $inputs = array_filter(array_map('trim', explode(',', $inputs)));
103  }
104 
105  if (!is_array($filters)) {
106  $filters = array_filter(array_map('trim', explode(',', $filters)));
107  }
108 
109  $coll = $_assetic->factory->createAsset($inputs, $filters, $options);
110 
111  $debug = isset($options['debug']) ? $options['debug'] : $_assetic->factory->isDebug();
112  $combine = isset($options['combine']) ? $options['combine'] : !$debug;
113 
114  $one = $coll->getTargetPath();
115  if ($combine) {
116  $many = array($one);
117  } else {
118  $many = array();
119  foreach ($coll as $leaf) {
120  $many[] = $leaf->getTargetPath();
121  }
122  }
123 
124  return new TraversableString($one, $many);
125 }
An object that can be used as either a string or array.
if(!is_array($argv)) $options
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ assetic_image()

assetic_image (   $input,
  $filters = array(),
array  $options = array() 
)

Returns an image URL.

Parameters
string$inputAn input
array | string$filtersFilter names
array$optionsAn array of options
Returns
string An image URL

Definition at line 77 of file functions.php.

References $options, and _assetic_urls().

Referenced by Assetic\Factory\Loader\FunctionCallsFormulaLoader\registerSetupCode().

78 {
79  if (!isset($options['output'])) {
80  $options['output'] = 'images/*';
81  }
82 
83  $urls = _assetic_urls($input, $filters, $options);
84 
85  return current($urls);
86 }
if(!is_array($argv)) $options
_assetic_urls($inputs=array(), $filters=array(), array $options=array())
Returns an array of asset urls.
Definition: functions.php:97
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assetic_init()

if (function_exists( 'assetic_init')) assetic_init ( AssetFactory  $factory)

Initializes the global Assetic object.

Parameters
AssetFactory$factoryThe asset factory

Definition at line 24 of file functions.php.

25 {
26  global $_assetic;
27 
28  $_assetic = new stdClass();
29  $_assetic->factory = $factory;
30 }

◆ assetic_javascripts()

assetic_javascripts (   $inputs = array(),
  $filters = array(),
array  $options = array() 
)

Returns an array of javascript URLs.

Parameters
array | string$inputsInput strings
array | string$filtersFilter names
array$optionsAn array of options
Returns
array An array of javascript URLs

Definition at line 41 of file functions.php.

References $options, and _assetic_urls().

Referenced by Assetic\Factory\Loader\FunctionCallsFormulaLoader\registerSetupCode().

42 {
43  if (!isset($options['output'])) {
44  $options['output'] = 'js/*.js';
45  }
46 
47  return _assetic_urls($inputs, $filters, $options);
48 }
if(!is_array($argv)) $options
_assetic_urls($inputs=array(), $filters=array(), array $options=array())
Returns an array of asset urls.
Definition: functions.php:97
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assetic_stylesheets()

assetic_stylesheets (   $inputs = array(),
  $filters = array(),
array  $options = array() 
)

Returns an array of stylesheet URLs.

Parameters
array | string$inputsInput strings
array | string$filtersFilter names
array$optionsAn array of options
Returns
array An array of stylesheet URLs

Definition at line 59 of file functions.php.

References $options, and _assetic_urls().

Referenced by Assetic\Factory\Loader\FunctionCallsFormulaLoader\registerSetupCode().

60 {
61  if (!isset($options['output'])) {
62  $options['output'] = 'css/*.css';
63  }
64 
65  return _assetic_urls($inputs, $filters, $options);
66 }
if(!is_array($argv)) $options
_assetic_urls($inputs=array(), $filters=array(), array $options=array())
Returns an array of asset urls.
Definition: functions.php:97
+ Here is the call graph for this function:
+ Here is the caller graph for this function: