ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilPDFCompInstaller Class Reference
+ Collaboration diagram for ilPDFCompInstaller:

Static Public Member Functions

static registerPurpose ($service, $purpose, $preferred)
 
static unregisterPurpose ($service, $purpose)
 
static unregisterPreferred ($service, $purpose, $preferred)
 
static flushPurposes ($service)
 
static isPurposeRegistered ($service, $purpose)
 
static getPurposesByService ($service)
 
static getServices ()
 
static checkForMultipleServiceAndPurposeCombination ()
 
static doCleanUp ()
 
static updateFromXML ($service, $purpose, $preferred)
 

Data Fields

const PURPOSE_CONF_TABLE = "pdfgen_conf"
 
const PURPOSE_MAP_TABLE = "pdfgen_map"
 
const PURPOSE_PURPOSES_TABLE = "pdfgen_purposes"
 
const RENDERER_TABLE = "pdfgen_renderer"
 
const RENDERER_AVAIL_TABLE = "pdfgen_renderer_avail"
 

Detailed Description

Definition at line 3 of file class.ilPDFCompInstaller.php.

Member Function Documentation

◆ checkForMultipleServiceAndPurposeCombination()

static ilPDFCompInstaller::checkForMultipleServiceAndPurposeCombination ( )
static
Returns
bool

Definition at line 167 of file class.ilPDFCompInstaller.php.

References $DIC, $ilDB, $query, $result, and $row.

Referenced by ilObjPDFGenerationGUI\configForm().

168  {
169  global $DIC;
170  $ilDB = $DIC['ilDB'];
171  $query = 'SELECT service, purpose FROM ' . self::PURPOSE_PURPOSES_TABLE . ' GROUP BY service, purpose having count(*) > 1';
172  $result = $ilDB->query($query);
173  $row = $ilDB->fetchAssoc($result);
174  if (is_array($row) && count($row) > 0) {
175  return true;
176  }
177  return false;
178  }
$result
global $DIC
Definition: saml.php:7
$query
global $ilDB
+ Here is the caller graph for this function:

◆ doCleanUp()

static ilPDFCompInstaller::doCleanUp ( )
static

Definition at line 180 of file class.ilPDFCompInstaller.php.

References $DIC, $ilDB, $query, $result, and $row.

Referenced by ilObjPDFGenerationGUI\doCleanUp().

181  {
182  global $DIC;
183  $ilDB = $DIC['ilDB'];
184  $query = 'SELECT service, purpose FROM ' . self::PURPOSE_PURPOSES_TABLE . ' GROUP BY service, purpose having count(*) > 1';
185  $result = $ilDB->query($query);
186  while ($row = $ilDB->fetchAssoc($result)) {
187  self::unregisterPurpose($row['service'], $row['purpose']);
188  self::addPurpose($row['service'], $row['purpose']);
189  }
190 
191  $query = 'SELECT service, purpose, preferred FROM ' . self::PURPOSE_MAP_TABLE . ' GROUP BY service, purpose, preferred having count(*) > 1';
192 
193  $result = $ilDB->query($query);
194  while ($row = $ilDB->fetchAssoc($result)) {
195  self::unregisterPreferred($row['service'], $row['purpose'], $row['preferred']);
196  self::addPreferred($row['service'], $row['purpose'], $row['preferred']);
197  }
198  }
$result
global $DIC
Definition: saml.php:7
$query
global $ilDB
+ Here is the caller graph for this function:

◆ flushPurposes()

static ilPDFCompInstaller::flushPurposes (   $service)
static
Parameters
string$service
Returns
void

Definition at line 99 of file class.ilPDFCompInstaller.php.

References $DIC, $ilDB, and $service.

100  {
101  global $DIC;
102  $ilDB = $DIC['ilDB'];
103 
104  $ilDB->manipulate("DELETE FROM " . self::PURPOSE_PURPOSES_TABLE . " WHERE service = " . $ilDB->quote($service, "txt"));
105  }
global $DIC
Definition: saml.php:7
$service
Definition: login.php:15
global $ilDB

◆ getPurposesByService()

static ilPDFCompInstaller::getPurposesByService (   $service)
static
Parameters
string$service
Returns
string[]

Definition at line 133 of file class.ilPDFCompInstaller.php.

References $DIC, $ilDB, $query, $result, $row, $service, and array.

134  {
135  global $DIC;
136  $ilDB = $DIC['ilDB'];
137 
138  $query = 'SELECT purpose FROM ' . self::PURPOSE_PURPOSES_TABLE . ' WHERE service = ' . $ilDB->quote($service, 'text');
139  $result = $ilDB->query($query);
140  $purposes = array();
141  while ($row = $ilDB->fetchAssoc($result)) {
142  $purposes[] = $row['purpose'];
143  }
144  return $purposes;
145  }
$result
global $DIC
Definition: saml.php:7
$service
Definition: login.php:15
$query
Create styles array
The data for the language used.
global $ilDB

◆ getServices()

static ilPDFCompInstaller::getServices ( )
static
Returns
string[]

Definition at line 150 of file class.ilPDFCompInstaller.php.

References $DIC, $ilDB, $query, $result, $row, and array.

151  {
152  global $DIC;
153  $ilDB = $DIC['ilDB'];
154 
155  $query = 'SELECT service FROM ' . self::PURPOSE_PURPOSES_TABLE . ' GROUP BY service';
156  $result = $ilDB->query($query);
157  $services = array();
158  while ($row = $ilDB->fetchAssoc($result)) {
159  $services[] = $row['service'];
160  }
161  return $services;
162  }
$result
global $DIC
Definition: saml.php:7
$query
Create styles array
The data for the language used.
global $ilDB

◆ isPurposeRegistered()

static ilPDFCompInstaller::isPurposeRegistered (   $service,
  $purpose 
)
static
Parameters
string$service
string$purpose
Returns
boolean

Definition at line 113 of file class.ilPDFCompInstaller.php.

References $DIC, $ilDB, $query, $result, $row, and $service.

114  {
115  global $DIC;
116  $ilDB = $DIC['ilDB'];
117 
118  $query = 'SELECT count(*) num FROM ' . self::PURPOSE_PURPOSES_TABLE . ' WHERE service = '
119  . $ilDB->quote($service, 'text') . ' AND purpose = ' . $ilDB->quote($purpose, 'text');
120  $result = $ilDB->query($query);
121  $row = $ilDB->fetchAssoc($result);
122  if ($row['num'] != 0) {
123  return true;
124  }
125  return false;
126  }
$result
global $DIC
Definition: saml.php:7
$service
Definition: login.php:15
$query
global $ilDB

◆ registerPurpose()

static ilPDFCompInstaller::registerPurpose (   $service,
  $purpose,
  $preferred 
)
static
Parameters
string$service
string$purpose
string$preferred
Returns
void

Definition at line 18 of file class.ilPDFCompInstaller.php.

References $DIC, $ilDB, $service, and array.

19  {
20  self::addPurpose($service, $purpose);
21  self::addPreferred($service, $purpose, $preferred);
22  }
$service
Definition: login.php:15

◆ unregisterPreferred()

static ilPDFCompInstaller::unregisterPreferred (   $service,
  $purpose,
  $preferred 
)
static
Parameters
$service
$purpose
$preferred

Definition at line 84 of file class.ilPDFCompInstaller.php.

References $DIC, $ilDB, and $service.

85  {
86  global $DIC;
87  $ilDB = $DIC['ilDB'];
88 
89  $ilDB->manipulate("DELETE FROM " . self::PURPOSE_MAP_TABLE .
90  " WHERE service = " . $ilDB->quote($service, "txt") . " AND purpose = " . $ilDB->quote($purpose, "txt") .
91  " AND preferred = " . $ilDB->quote($preferred, "txt"));
92  }
global $DIC
Definition: saml.php:7
$service
Definition: login.php:15
global $ilDB

◆ unregisterPurpose()

static ilPDFCompInstaller::unregisterPurpose (   $service,
  $purpose 
)
static
Parameters
$service
$purpose

Definition at line 70 of file class.ilPDFCompInstaller.php.

References $DIC, $ilDB, and $service.

71  {
72  global $DIC;
73  $ilDB = $DIC['ilDB'];
74 
75  $ilDB->manipulate("DELETE FROM " . self::PURPOSE_PURPOSES_TABLE .
76  " WHERE service = " . $ilDB->quote($service, "txt") . " AND purpose = " . $ilDB->quote($purpose, "txt"));
77  }
global $DIC
Definition: saml.php:7
$service
Definition: login.php:15
global $ilDB

◆ updateFromXML()

static ilPDFCompInstaller::updateFromXML (   $service,
  $purpose,
  $preferred 
)
static
Parameters
$service
$purpose
$preferred

Definition at line 205 of file class.ilPDFCompInstaller.php.

References $DIC, $ilDB, $path, $service, and array.

Referenced by ilObjDefReader\handlerBeginTag().

206  {
207  $parts = explode('/', $service);
208  $service = $parts[1];
209 
210  if (!self::isPurposeRegistered($service, $purpose)) {
211  self::registerPurpose($service, $purpose, $preferred);
212  }
213  }
$service
Definition: login.php:15
+ Here is the caller graph for this function:

Field Documentation

◆ PURPOSE_CONF_TABLE

const ilPDFCompInstaller::PURPOSE_CONF_TABLE = "pdfgen_conf"

Definition at line 5 of file class.ilPDFCompInstaller.php.

◆ PURPOSE_MAP_TABLE

const ilPDFCompInstaller::PURPOSE_MAP_TABLE = "pdfgen_map"

Definition at line 6 of file class.ilPDFCompInstaller.php.

◆ PURPOSE_PURPOSES_TABLE

const ilPDFCompInstaller::PURPOSE_PURPOSES_TABLE = "pdfgen_purposes"

Definition at line 7 of file class.ilPDFCompInstaller.php.

◆ RENDERER_AVAIL_TABLE

const ilPDFCompInstaller::RENDERER_AVAIL_TABLE = "pdfgen_renderer_avail"

Definition at line 9 of file class.ilPDFCompInstaller.php.

◆ RENDERER_TABLE

const ilPDFCompInstaller::RENDERER_TABLE = "pdfgen_renderer"

Definition at line 8 of file class.ilPDFCompInstaller.php.


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