ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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)
 
 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 175 of file class.ilBibliographicSetting.php.

Referenced by generateLibraryLink().

175  {
176  if ($type = 'ris') {
177  switch ($a) {
178  case 'ti':
179  $a = "title";
180  break;
181  case 't1':
182  $a = "title";
183  break;
184  case 'au':
185  $a = "author";
186  break;
187  case 'sn':
188  if (strlen($attributes[$prefix . "sn"]) <= 9) {
189  $a = "issn";
190  } else {
191  $a = "isbn";
192  }
193  break;
194  case 'py':
195  $a = "date";
196  break;
197  case 'is':
198  $a = "issue";
199  break;
200  case 'vl':
201  $a = "volume";
202  break;
203  }
204  } elseif ($type = 'bib') {
205  switch ($a) {
206  case "number":
207  $a = "issue";
208  break;
209  case "year":
210  $a = "date";
211  break;
212  }
213  }
214 
215  return $a;
216  }
+ 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 formatAttribute(), ilBibliographicEntry\getAttributes(), ilBibliographicEntry\getType(), and getUrl().

Referenced by getButton().

98  {
99  $attributes = $entry->getAttributes();
100  switch ($type) {
101  case 'bib':
102  $prefix = "bib_default_";
103  if (!empty($attributes[$prefix . "isbn"])) {
104  $attr = Array( "isbn" );
105  } elseif (!empty($attributes[$prefix . "issn"])) {
106  $attr = Array( "issn" );
107  } else {
108  $attr = Array( "title", "author", "year", "number", "volume" );
109  }
110  break;
111  case 'ris':
112  $prefix = "ris_" . strtolower($entry->getType()) . "_";
113  if (!empty($attributes[$prefix . "sn"])) {
114  $attr = Array( "sn" );
115  } else {
116  $attr = Array( "ti", "t1", "au", "py", "is", "vl" );
117  }
118  break;
119  }
120 
121  $url_params = "?";
122  if (sizeof($attr) == 1) {
123  $url_params .= $this->formatAttribute($attr[0], $type, $attributes, $prefix) . "=" . urlencode($attributes[$prefix . $attr[0]]);
124  } else {
125  foreach ($attr as $a) {
126  if (array_key_exists($prefix . $a, $attributes)) {
127  if (strlen($url_params) > 1) {
128  $url_params .= "&";
129  }
130  $url_params .= $this->formatAttribute($a, $type, $attributes, $prefix) . "=" . urlencode($attributes[$prefix . $a]);
131  }
132  }
133  }
134 
135  // return full link
136  $full_link = $this->getUrl() . $url_params;
137 
138  return $full_link;
139  }
formatAttribute($a, $type, $attributes, $prefix)
+ 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 87 of file class.ilBibliographicSetting.php.

Referenced by ilDataBibliographicRecordListTableGUI\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 148 of file class.ilBibliographicSetting.php.

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

148  {
149  if ($this->getImg()) {
150  require_once('./Services/UIComponent/Button/classes/class.ilImageLinkButton.php');
151  $button = ilImageLinkButton::getInstance();
152  $button->setUrl($this->generateLibraryLink($entry, $bibl_obj->getFiletype()));
153  $button->setImage($this->getImg(), false);
154  } else {
155  require_once('./Services/UIComponent/Button/classes/class.ilLinkButton.php');
156  $button = ilLinkButton::getInstance();
157  $button->setUrl($this->generateLibraryLink($entry, $bibl_obj->getFiletype()));
158  $button->setCaption('bibl_link_online');
159  }
160 
161  $button->setTarget('_blank');
162 
163  return $button->render();
164  }
generateLibraryLink(ilBibliographicEntry $entry, $type)
+ Here is the call graph for this function:

◆ getConnectorContainerName()

ilBibliographicSetting::getConnectorContainerName ( )
Returns
string

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

31  {
32  return self::TABLE_NAME;
33  }

◆ getId()

ilBibliographicSetting::getId ( )
Returns
mixed

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

References $id.

222  {
223  return $this->id;
224  }

◆ getImg()

ilBibliographicSetting::getImg ( )
Returns
mixed

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

References $img.

Referenced by getButton().

238  {
239  return $this->img;
240  }
+ Here is the caller graph for this function:

◆ getName()

ilBibliographicSetting::getName ( )
Returns
mixed

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

References $name.

◆ getShowInList()

ilBibliographicSetting::getShowInList ( )
Returns
mixed

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

References $show_in_list.

◆ getUrl()

ilBibliographicSetting::getUrl ( )
Returns
mixed

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

References $url.

Referenced by generateLibraryLink().

286  {
287  return $this->url;
288  }
+ Here is the caller graph for this function:

◆ returnDbTableName()

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

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

23  {
24  return self::TABLE_NAME;
25  }

◆ setId()

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

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

References $id.

230  {
231  $this->id = $id;
232  }

◆ setImg()

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

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

References $img.

246  {
247  $this->img = $img;
248  }

◆ setName()

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

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

References $name.

262  {
263  $this->name = $name;
264  }

◆ setShowInList()

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

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

References $show_in_list.

278  {
279  $this->show_in_list = $show_in_list;
280  }

◆ setUrl()

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

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

References $url.

294  {
295  $this->url = $url;
296  }

Field Documentation

◆ $id

ilBibliographicSetting::$id
protected

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

Referenced by getId(), and setId().

◆ $img

ilBibliographicSetting::$img
protected

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

Referenced by getImg(), and setImg().

◆ $name

ilBibliographicSetting::$name
protected

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

Referenced by getName(), and setName().

◆ $show_in_list

ilBibliographicSetting::$show_in_list
protected

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

Referenced by getShowInList(), and setShowInList().

◆ $url

ilBibliographicSetting::$url
protected

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

Referenced by getUrl(), and setUrl().

◆ TABLE_NAME

const ilBibliographicSetting::TABLE_NAME = 'il_bibl_settings'

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


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