ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSystemStyleHTMLExport Class Reference

HTML export class for system styles. More...

+ Collaboration diagram for ilSystemStyleHTMLExport:

Public Member Functions

 __construct ($a_exp_dir)
 Initialisation.
 createDirectories ()
 Create directories.
 addImage ($a_file, $a_exp_file_name="")
 Add (icon) image to the list of images to be exported.
 export ()
 Export.

Private Attributes

 $exp_dir = ""
 $images = array()

Detailed Description

HTML export class for system styles.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:

Definition at line 11 of file class.ilSystemStyleHTMLExport.php.

Constructor & Destructor Documentation

ilSystemStyleHTMLExport::__construct (   $a_exp_dir)

Initialisation.

Parameters
string$a_exp_direxport directory

Definition at line 21 of file class.ilSystemStyleHTMLExport.php.

References addImage().

{
$this->exp_dir = $a_exp_dir;
$this->style_dir = $a_exp_dir."/style";
$this->style_img_dir = $a_exp_dir."/style/images";
$this->img_dir = $a_exp_dir."/images";
$this->img_browser_dir = $a_exp_dir."/images/browser";
// add standard images
$this->addImage("enlarge.png");
$this->addImage("browser/blank.png", "/browser/plus.png");
$this->addImage("browser/blank.png", "/browser/minus.png");
$this->addImage("browser/blank.png", "/browser/blank.png");
$this->addImage("spacer.png");
$this->addImage("icon_st.png");
$this->addImage("icon_st_s.png");
$this->addImage("icon_pg.png");
$this->addImage("icon_pg_s.png");
$this->addImage("icon_lm.png");
$this->addImage("icon_lm_s.png");
$this->addImage("nav_arr_L.png");
$this->addImage("nav_arr_R.png");
$this->addImage("browser/forceexp.png");
$this->addImage("download.png");
}

+ Here is the call graph for this function:

Member Function Documentation

ilSystemStyleHTMLExport::addImage (   $a_file,
  $a_exp_file_name = "" 
)

Add (icon) image to the list of images to be exported.

Parameters
@return

Definition at line 64 of file class.ilSystemStyleHTMLExport.php.

Referenced by __construct().

{
$this->images[] = array("file" => $a_file,
"exp_file_name" => $a_file);
}

+ Here is the caller graph for this function:

ilSystemStyleHTMLExport::createDirectories ( )

Create directories.

Definition at line 50 of file class.ilSystemStyleHTMLExport.php.

References ilUtil\makeDir().

Referenced by export().

{
ilUtil::makeDir($this->style_dir);
ilUtil::makeDir($this->style_img_dir);
ilUtil::makeDir($this->img_dir);
ilUtil::makeDir($this->img_browser_dir);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSystemStyleHTMLExport::export ( )

Export.

Parameters
@return

Definition at line 76 of file class.ilSystemStyleHTMLExport.php.

References $ilUser, createDirectories(), ilUtil\getImagePath(), and ilUtil\getStyleSheetLocation().

{
global $ilUser;
// export system style sheet
$location_stylesheet = ilUtil::getStyleSheetLocation("filesystem");
$style_name = $ilUser->prefs["style"].".css";
copy($location_stylesheet, $this->style_dir."/".$style_name);
$fh = fopen($location_stylesheet, "r");
$css = fread($fh, filesize($location_stylesheet));
preg_match_all("/url\(([^\)]*)\)/",$css,$files);
foreach (array_unique($files[1]) as $fileref)
{
$fileref = dirname($location_stylesheet)."/".$fileref;
if (is_file($fileref))
{
copy($fileref, $this->style_img_dir."/".basename($fileref));
}
}
fclose($fh);
// export (icon) images
foreach ($this->images as $im)
{
$from = $to = $im["file"];
if ($im["exp_file_name"] != "")
{
$to = $im["exp_file_name"];
}
copy(ilUtil::getImagePath($from, false, "filesystem"),
$this->img_dir."/".$to);
}
}

+ Here is the call graph for this function:

Field Documentation

ilSystemStyleHTMLExport::$exp_dir = ""
private

Definition at line 13 of file class.ilSystemStyleHTMLExport.php.

ilSystemStyleHTMLExport::$images = array()
private

Definition at line 14 of file class.ilSystemStyleHTMLExport.php.


The documentation for this class was generated from the following file: