ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilBibliographicSetting Class Reference

Class ilBibliographicSetting. More...

+ Inheritance diagram for ilBibliographicSetting:
+ Collaboration diagram for ilBibliographicSetting:

Public Member Functions

 getConnectorContainerName ()
 
 generateLibraryLink (ilBibliographicEntry $entry, $type)
 
 getButton (ilObjBibliographic $bibl_obj, ilBibliographicEntry $entry)
 
 getId ()
 
 setId ($id)
 
 getImg ()
 
 setImg ($img)
 
 getName ()
 
 setName ($name)
 
 getShowInList ()
 
 setShowInList ($show_in_list)
 
 getUrl ()
 
 setUrl ($url)
 
- Public Member Functions inherited from ActiveRecord
 getArConnector ()
 
 getArFieldList ()
 
 getConnectorContainerName ()
 
 setConnectorContainerName ($connector_container_name)
 
 getPrimaryFieldValue ()
 
 setPrimaryFieldValue ($value)
 
 __construct ($primary_key=0, arConnector $connector=null)
 
 storeObjectToCache ()
 
 __getConvertedDateFieldsAsArray ($format=null)
 
 __asCsv ($separator=';', $header=false)
 
 __asArray ()
 
 __asStdClass ()
 
 __asSerializedObject ()
 
 buildFromArray (array $array)
 
 fixDateField ($field_name, $value)
 
 sleep ($field_name)
 
 wakeUp ($field_name, $field_value)
 
 getArrayForDb ()
 
 getArrayForConnector ()
 
 installConnector ()
 
 store ()
 
 save ()
 
 create ()
 
 copy ($new_id=0)
 
 afterObjectLoad ()
 
 read ()
 
 update ()
 
 delete ()
 
 __call ($name, $arguments)
 

Static Public Member Functions

static returnDbTableName ()
 
static getAll ()
 
- Static Public Member Functions inherited from ActiveRecord
static returnDbTableName ()
 
static installDB ()
 
static renameDBField ($old_name, $new_name)
 
static tableExists ()
 
static fieldExists ($field_name)
 
static removeDBField ($field_name)
 
static updateDB ()
 
static resetDB ()
 
static truncateDB ()
 
static flushDB ()
 
static preloadObjects ()
 
static additionalParams (array $additional_params)
 
static findOrFail ($primary_key, array $add_constructor_args=array())
 Tries to find the object and throws an Exception if object is not found, instead of returning null. More...
 
static findOrGetInstance ($primary_key, array $add_constructor_args=array())
 
static where ($where, $operator=null)
 
static innerjoinAR (ActiveRecord $ar, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static innerjoin ($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static leftjoin ($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static orderBy ($orderBy, $orderDirection='ASC')
 
static dateFormat ($date_format='d.m.Y - H:i:s')
 
static limit ($start, $end)
 
static affectedRows ()
 
static count ()
 
static get ()
 
static debug ()
 
static first ()
 
static getCollection ()
 
static last ()
 
static getFirstFromLastQuery ()
 
static connector (arConnector $connector)
 
static raw ($set_raw=true)
 
static getArray ($key=null, $values=null)
 
static _toCamelCase ($str, $capitalise_first_char=false)
 

Data Fields

const TABLE_NAME = 'il_bibl_settings'
 
- Data Fields inherited from ActiveRecord
const ACTIVE_RECORD_VERSION = '2.0.7'
 

Protected Attributes

 $id
 
 $name
 
 $url
 
 $img
 
 $show_in_list
 
- Protected Attributes inherited from ActiveRecord
 $ar_safe_read = true
 
 $connector_container_name = ''
 

Private Member Functions

 formatAttribute ($a, $type, $attributes, $prefix)
 

Additional Inherited Members

- Protected Member Functions inherited from ActiveRecord
 serializeToCSV ($field)
 This method is called for every field of your instance if you use __asCsv. More...
 
 installDatabase ()
 
- Static Protected Member Functions inherited from ActiveRecord
static getCalledClass ()
 
static fromCamelCase ($str)
 

Detailed Description

Member Function Documentation

◆ formatAttribute()

ilBibliographicSetting::formatAttribute (   $a,
  $type,
  $attributes,
  $prefix 
)
private
Parameters
String$a
String$type
array$attributes
String$prefix
Returns
String

Definition at line 187 of file class.ilBibliographicSetting.php.

References $attributes, and $type.

Referenced by generateLibraryLink().

188  {
189  if ($type = 'ris') {
190  switch ($a) {
191  case 'ti':
192  $a = "title";
193  break;
194  case 't1':
195  $a = "title";
196  break;
197  case 'au':
198  $a = "author";
199  break;
200  case 'sn':
201  if (strlen($attributes[$prefix . "sn"]) <= 9) {
202  $a = "issn";
203  } else {
204  $a = "isbn";
205  }
206  break;
207  case 'py':
208  $a = "date";
209  break;
210  case 'is':
211  $a = "issue";
212  break;
213  case 'vl':
214  $a = "volume";
215  break;
216  }
217  } elseif ($type = 'bib') {
218  switch ($a) {
219  case 'number':
220  $a = "issue";
221  break;
222  case 'year':
223  $a = "date";
224  break;
225  }
226  }
227 
228  return $a;
229  }
$type
$attributes
+ Here is the caller graph for this function:

◆ generateLibraryLink()

ilBibliographicSetting::generateLibraryLink ( ilBibliographicEntry  $entry,
  $type 
)
Parameters
ilBibliographicEntry$entry
string$type(bib|ris)
Returns
string

Definition at line 98 of file class.ilBibliographicSetting.php.

References $attributes, $type, array, formatAttribute(), ilBibliographicEntry\getAttributes(), ilBibliographicEntry\getType(), and getUrl().

Referenced by getButton().

99  {
100  $attributes = $entry->getAttributes();
101  switch ($type) {
102  case 'bib':
103  $prefix = "bib_default_";
104  if (!empty($attributes[$prefix . "isbn"])) {
105  $attr = array( "isbn" );
106  } elseif (!empty($attributes[$prefix . "pmid"])) {
107  $attr = array( "pmid" );
108  } elseif (!empty($attributes[$prefix . "doi"])) {
109  $attr = array( "doi" );
110  } elseif (!empty($attributes[$prefix . "issn"])) {
111  $attr = array( "issn" );
112  } else {
113  $attr = array( "title", "author", "year", "number", "volume" );
114  }
115  break;
116  case 'ris':
117  $prefix = "ris_" . strtolower($entry->getType()) . "_";
118  if (!empty($attributes[$prefix . "sn"])) {
119  $attr = array( "sn" );
120  } elseif (!empty($attributes[$prefix . "do"])) {
121  $attr = array( "do" );
122  } else {
123  $attr = array( "ti", "t1", "au", "py", "is", "vl" );
124  }
125  break;
126  }
127 
128  $url_params = "?";
129  if (sizeof($attr) == 1) {
130  if (($attr[0] == "doi") || ($attr[0] == "pmid")) {
131  $url_params .= "id=" . $this->formatAttribute($attr[0], $type, $attributes, $prefix) . "%3A" . $attributes[$prefix . $attr[0]];
132  } elseif ($attr[0] == "do") {
133  $url_params .= "id=" . $this->formatAttribute($attr[0], $type, $attributes, $prefix) . "i%3A" . $attributes[$prefix . $attr[0]];
134  } else {
135  $url_params .= $this->formatAttribute($attr[0], $type, $attributes, $prefix) . "=" . urlencode($attributes[$prefix . $attr[0]]);
136  }
137  } else {
138  foreach ($attr as $a) {
139  if (array_key_exists($prefix . $a, $attributes)) {
140  if (strlen($url_params) > 1) {
141  $url_params .= "&";
142  }
143  $url_params .= $this->formatAttribute($a, $type, $attributes, $prefix) . "=" . urlencode($attributes[$prefix . $a]);
144  }
145  }
146  }
147 
148  // return full link
149  $full_link = $this->getUrl() . $url_params;
150 
151  return $full_link;
152  }
$type
formatAttribute($a, $type, $attributes, $prefix)
$attributes
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAll()

static ilBibliographicSetting::getAll ( )
static
Returns
ilBibliographicSetting[]

Definition at line 86 of file class.ilBibliographicSetting.php.

Referenced by ilBibliographicRecordListTableGUI\fillRow(), ilBibliographicDetailsGUI\getInstance(), and ilObjBibliographicAdminLibrariesGUI\initTable().

87  {
88  return self::get();
89  }
+ Here is the caller graph for this function:

◆ getButton()

ilBibliographicSetting::getButton ( ilObjBibliographic  $bibl_obj,
ilBibliographicEntry  $entry 
)
Parameters
ilObjBibliographic$bibl_obj
ilBibliographicEntry$entry
Returns
string

Definition at line 161 of file class.ilBibliographicSetting.php.

References generateLibraryLink(), ilObjBibliographic\getFiletype(), getImg(), ilImageLinkButton\getInstance(), and ilLinkButton\getInstance().

162  {
163  if ($this->getImg()) {
164  $button = ilImageLinkButton::getInstance();
165  $button->setUrl($this->generateLibraryLink($entry, $bibl_obj->getFiletype()));
166  $button->setImage($this->getImg(), false);
167  } else {
168  $button = ilLinkButton::getInstance();
169  $button->setUrl($this->generateLibraryLink($entry, $bibl_obj->getFiletype()));
170  $button->setCaption('bibl_link_online');
171  }
172 
173  $button->setTarget('_blank');
174 
175  return $button->render();
176  }
generateLibraryLink(ilBibliographicEntry $entry, $type)
+ Here is the call graph for this function:

◆ getConnectorContainerName()

ilBibliographicSetting::getConnectorContainerName ( )
Returns
string

Definition at line 29 of file class.ilBibliographicSetting.php.

30  {
31  return self::TABLE_NAME;
32  }

◆ getId()

ilBibliographicSetting::getId ( )
Returns
mixed

Definition at line 235 of file class.ilBibliographicSetting.php.

References $id.

236  {
237  return $this->id;
238  }

◆ getImg()

ilBibliographicSetting::getImg ( )
Returns
mixed

Definition at line 253 of file class.ilBibliographicSetting.php.

References $img.

Referenced by getButton().

254  {
255  return $this->img;
256  }
+ Here is the caller graph for this function:

◆ getName()

ilBibliographicSetting::getName ( )
Returns
mixed

Definition at line 271 of file class.ilBibliographicSetting.php.

References $name.

◆ getShowInList()

ilBibliographicSetting::getShowInList ( )
Returns
mixed

Definition at line 289 of file class.ilBibliographicSetting.php.

References $show_in_list.

◆ getUrl()

ilBibliographicSetting::getUrl ( )
Returns
mixed

Definition at line 307 of file class.ilBibliographicSetting.php.

References $url.

Referenced by generateLibraryLink().

308  {
309  return $this->url;
310  }
+ Here is the caller graph for this function:

◆ returnDbTableName()

static ilBibliographicSetting::returnDbTableName ( )
static
Returns
string
Deprecated:

Definition at line 20 of file class.ilBibliographicSetting.php.

21  {
22  return self::TABLE_NAME;
23  }

◆ setId()

ilBibliographicSetting::setId (   $id)
Parameters
mixed$id

Definition at line 244 of file class.ilBibliographicSetting.php.

References $id.

245  {
246  $this->id = $id;
247  }

◆ setImg()

ilBibliographicSetting::setImg (   $img)
Parameters
mixed$img

Definition at line 262 of file class.ilBibliographicSetting.php.

References $img.

263  {
264  $this->img = $img;
265  }

◆ setName()

ilBibliographicSetting::setName (   $name)
Parameters
mixed$name

Definition at line 280 of file class.ilBibliographicSetting.php.

References $name.

281  {
282  $this->name = $name;
283  }

◆ setShowInList()

ilBibliographicSetting::setShowInList (   $show_in_list)
Parameters
mixed$show_in_list

Definition at line 298 of file class.ilBibliographicSetting.php.

References $show_in_list.

299  {
300  $this->show_in_list = $show_in_list;
301  }

◆ setUrl()

ilBibliographicSetting::setUrl (   $url)
Parameters
mixed$url

Definition at line 316 of file class.ilBibliographicSetting.php.

References $url.

317  {
318  $this->url = $url;
319  }

Field Documentation

◆ $id

ilBibliographicSetting::$id
protected

Definition at line 46 of file class.ilBibliographicSetting.php.

Referenced by getId(), and setId().

◆ $img

ilBibliographicSetting::$img
protected

Definition at line 72 of file class.ilBibliographicSetting.php.

Referenced by getImg(), and setImg().

◆ $name

ilBibliographicSetting::$name
protected

Definition at line 55 of file class.ilBibliographicSetting.php.

Referenced by getName(), and setName().

◆ $show_in_list

ilBibliographicSetting::$show_in_list
protected

Definition at line 80 of file class.ilBibliographicSetting.php.

Referenced by getShowInList(), and setShowInList().

◆ $url

ilBibliographicSetting::$url
protected

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

Referenced by getUrl(), and setUrl().

◆ TABLE_NAME

const ilBibliographicSetting::TABLE_NAME = 'il_bibl_settings'

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


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