Gitlab CSE Unil
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
M. Chardon
moodle-assignfeedback_editpdfplus
Commits
8cc2c1b8
Commit
8cc2c1b8
authored
May 28, 2018
by
M. Chardon
Browse files
correction stamp : creation du repetoire temporaire à la volée si non existant
parent
d8821989
Changes
1
Hide whitespace changes
Inline
Side-by-side
classes/utils_stamp.php
View file @
8cc2c1b8
...
...
@@ -71,6 +71,12 @@ class utils_stamp {
$outputDirectory
=
$CFG
->
dataroot
.
self
::
STAMPS_FILEAREA
;
$fileName
=
sprintf
(
"%s%s.png"
,
$outputDirectory
,
$iconName
);
$dirPath
=
dirname
(
$fileName
);
if
(
!
is_dir
(
$dirPath
)
||
!
file_exists
(
$dirPath
))
{
//try to create the directory
self
::
mkdirRecursive
(
$dirPath
,
0777
);
}
//get RGB color
$colorRGB
=
utils_color
::
hex2RGB
(
$color
);
...
...
@@ -78,6 +84,18 @@ class utils_stamp {
return
self
::
putIconIntoFile
(
$charFAHexaCode
,
$fileName
,
$colorRGB
,
$fontSize
);
}
/**
* Create a final directory with its path
*
* @param String $pathname Path to final directory to create
* @param String $mode Linux right
* @return Boolean If directory is created
*/
public
static
function
mkdirRecursive
(
$pathname
,
$mode
)
{
is_dir
(
dirname
(
$pathname
))
||
mkdir_recursive
(
dirname
(
$pathname
),
$mode
);
return
is_dir
(
$pathname
)
||
@
mkdir
(
$pathname
,
$mode
);
}
/**
* Write a chart into a PNG file
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment